diff --git a/apps/benchmark/dataset/real/tu/af/PROVENANCE.json b/apps/benchmark/dataset/real/tu/af/PROVENANCE.json index bc94d12f..06d1efbb 100644 --- a/apps/benchmark/dataset/real/tu/af/PROVENANCE.json +++ b/apps/benchmark/dataset/real/tu/af/PROVENANCE.json @@ -3,5 +3,5 @@ "commit": "4515c15b5848b1ec85e78cb3776e12990cafe004", "dirty": false, "cpp": "cpp-14 (Homebrew GCC 14.2.0_1) 14.2.0", - "generatedAt": "2026-08-01T15:04:28.072Z" + "generatedAt": "2026-08-02T14:37:44.577Z" } diff --git a/apps/benchmark/dataset/real/tu/af/symbols.json.gz b/apps/benchmark/dataset/real/tu/af/symbols.json.gz index 4c65a4ae..4745dbf0 100644 Binary files a/apps/benchmark/dataset/real/tu/af/symbols.json.gz and b/apps/benchmark/dataset/real/tu/af/symbols.json.gz differ diff --git a/apps/benchmark/dataset/real/tu/kleod/PROVENANCE.json b/apps/benchmark/dataset/real/tu/kleod/PROVENANCE.json index 5c0f9260..b0f49b17 100644 --- a/apps/benchmark/dataset/real/tu/kleod/PROVENANCE.json +++ b/apps/benchmark/dataset/real/tu/kleod/PROVENANCE.json @@ -3,5 +3,5 @@ "commit": "704fd74330959112873665d790f911e3679770c0", "dirty": false, "cpp": "cpp-14 (Homebrew GCC 14.2.0_1) 14.2.0", - "generatedAt": "2026-08-02T12:01:59.124Z" + "generatedAt": "2026-08-02T14:37:46.556Z" } diff --git a/apps/benchmark/dataset/real/tu/kleod/symbols.json.gz b/apps/benchmark/dataset/real/tu/kleod/symbols.json.gz index 3156a5a2..689bf875 100644 Binary files a/apps/benchmark/dataset/real/tu/kleod/symbols.json.gz and b/apps/benchmark/dataset/real/tu/kleod/symbols.json.gz differ diff --git a/apps/benchmark/dataset/real/tu/marioparty3/PROVENANCE.json b/apps/benchmark/dataset/real/tu/marioparty3/PROVENANCE.json index 37be1cea..094b8d8b 100644 --- a/apps/benchmark/dataset/real/tu/marioparty3/PROVENANCE.json +++ b/apps/benchmark/dataset/real/tu/marioparty3/PROVENANCE.json @@ -3,5 +3,5 @@ "commit": "6b4380b9493a2bf9a60e3be5f5b6b6e70e4b927e", "dirty": false, "cpp": "cpp-14 (Homebrew GCC 14.2.0_1) 14.2.0", - "generatedAt": "2026-08-01T15:04:33.605Z" + "generatedAt": "2026-08-02T14:37:50.674Z" } diff --git a/apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz b/apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz index 679ea035..9c6b1c77 100644 Binary files a/apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz and b/apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz differ diff --git a/apps/benchmark/dataset/real/tu/pokeemerald/PROVENANCE.json b/apps/benchmark/dataset/real/tu/pokeemerald/PROVENANCE.json index b6e8f629..ee1fa677 100644 --- a/apps/benchmark/dataset/real/tu/pokeemerald/PROVENANCE.json +++ b/apps/benchmark/dataset/real/tu/pokeemerald/PROVENANCE.json @@ -3,5 +3,5 @@ "commit": "9d96fe4bd358bb7f8e70dc58702d5c4cb545b761", "dirty": false, "cpp": "cpp-14 (Homebrew GCC 14.2.0_1) 14.2.0", - "generatedAt": "2026-08-02T12:02:06.071Z" + "generatedAt": "2026-08-02T14:37:53.199Z" } diff --git a/apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz b/apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz index 8bae159c..f5727980 100644 Binary files a/apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz and b/apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz differ diff --git a/apps/benchmark/dataset/real/tu/sa3/PROVENANCE.json b/apps/benchmark/dataset/real/tu/sa3/PROVENANCE.json index 7b4927ef..3cf7bf00 100644 --- a/apps/benchmark/dataset/real/tu/sa3/PROVENANCE.json +++ b/apps/benchmark/dataset/real/tu/sa3/PROVENANCE.json @@ -1,7 +1,7 @@ { "project": "sa3", - "commit": "a4a344bb0de8a0add5f4034a0f7b1a10c02f30e8", + "commit": "a069e81bb4c7128e12bfb182bdcc49141ec5f7fb", "dirty": false, "cpp": "cpp-14 (Homebrew GCC 14.2.0_1) 14.2.0", - "generatedAt": "2026-08-01T12:23:01.254Z" + "generatedAt": "2026-08-02T14:37:56.363Z" } diff --git a/apps/benchmark/dataset/real/tu/sa3/symbols.json.gz b/apps/benchmark/dataset/real/tu/sa3/symbols.json.gz index fcc1f167..f2b4eeb2 100644 Binary files a/apps/benchmark/dataset/real/tu/sa3/symbols.json.gz and b/apps/benchmark/dataset/real/tu/sa3/symbols.json.gz differ diff --git a/apps/benchmark/dataset/real/tu/snowboardkids2/PROVENANCE.json b/apps/benchmark/dataset/real/tu/snowboardkids2/PROVENANCE.json index cf42f050..564a087e 100644 --- a/apps/benchmark/dataset/real/tu/snowboardkids2/PROVENANCE.json +++ b/apps/benchmark/dataset/real/tu/snowboardkids2/PROVENANCE.json @@ -3,5 +3,5 @@ "commit": "63236cd8dce61b8a1b37765952eb340b66684476", "dirty": false, "cpp": "cpp-14 (Homebrew GCC 14.2.0_1) 14.2.0", - "generatedAt": "2026-08-01T15:04:38.726Z" + "generatedAt": "2026-08-02T14:38:00.285Z" } diff --git a/apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz b/apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz index 7a15ef93..b1e0ee49 100644 Binary files a/apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz and b/apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz differ diff --git a/apps/benchmark/results/results.json b/apps/benchmark/results/results.json index 1e94d867..8443f46f 100644 --- a/apps/benchmark/results/results.json +++ b/apps/benchmark/results/results.json @@ -1,6 +1,6 @@ { "meta": { - "generatedAt": "2026-08-02T12:05:10.669Z", + "generatedAt": "2026-08-02T15:34:03.457Z", "toolchains": [ "ido7.1", "agbcc", @@ -14,7 +14,7 @@ "real": 192 }, "asmlift": { - "commit": "f309fec083fbc669836a6aea250dcea84532eecd", + "commit": "005cccf2660e8bd7aa845c3eddffcfac7d6f21a7", "dirty": false }, "m2c": { @@ -101,7 +101,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `add_calc_short_angle3` — benchmark function af:add_calc_short_angle3:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc_short_angle3\n sw\t$a1, 4($sp)\n sw\t$a3, 12($sp)\n lh\t$v1, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n mtc1\t$a2, $f12\n beq\t$a1, $v1, .Lbc\n andi\t$v0, $v1, 0xffff\n andi\t$a3, $a1, 0xffff\n slt\t$at, $a3, $v0\n beqz\t$at, .L38\n move\t$a2, $a3\n lui\t$at, 0x1\n addu\t$a2, $a3, $at\n.L38:\n subu\t$t6, $a2, $v0\n mtc1\t$t6, $f4\n lh\t$t7, 14($sp)\n lh\t$t8, 18($sp)\n cvt.s.w\t$f6, $f4\n mtc1\t$t7, $f8\n nop\n cvt.s.w\t$f14, $f8\n mul.s\t$f2, $f6, $f12\n c.lt.s\t$f14, $f2\n mov.s\t$f0, $f2\n bc1fl\t.L78\n mtc1\t$t8, $f10\n b\t.L94\n mov.s\t$f0, $f14\n mtc1\t$t8, $f10\n.L78:\n nop\n cvt.s.w\t$f12, $f10\n c.lt.s\t$f2, $f12\n nop\n bc1fl\t.L98\n trunc.w.s\t$f16, $f0\n mov.s\t$f0, $f12\n.L94:\n trunc.w.s\t$f16, $f0\n.L98:\n mfc1\t$t0, $f16\n nop\n addu\t$a3, $t0, $v0\n slt\t$at, $a2, $a3\n beqzl\t$at, .Lb8\n sh\t$a3, 0($a0)\n move\t$a3, $a2\n sh\t$a3, 0($a0)\n.Lb8:\n lh\t$v1, 0($a0)\n.Lbc:\n subu\t$v0, $a1, $v1\n sll\t$v0, $v0, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc_short_angle3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc_short_angle3` — benchmark function af:add_calc_short_angle3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc_short_angle3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta3,12(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta1,a1,0x10\n 14:\tmtc1\ta2,$f12\n 18:\tbeq\ta1,v1,bc \n 1c:\tandi\tv0,v1,0xffff\n 20:\tandi\ta3,a1,0xffff\n 24:\tslt\tat,a3,v0\n 28:\tbeqz\tat,38 \n 2c:\tmove\ta2,a3\n 30:\tlui\tat,0x1\n 34:\taddu\ta2,a3,at\n 38:\tsubu\tt6,a2,v0\n 3c:\tmtc1\tt6,$f4\n 40:\tlh\tt7,14(sp)\n 44:\tlh\tt8,18(sp)\n 48:\tcvt.s.w\t$f6,$f4\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f14,$f8\n 58:\tmul.s\t$f2,$f6,$f12\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tmov.s\t$f0,$f2\n 64:\tbc1fl\t78 \n 68:\tmtc1\tt8,$f10\n 6c:\tb\t94 \n 70:\tmov.s\t$f0,$f14\n 74:\tmtc1\tt8,$f10\n 78:\tnop\n 7c:\tcvt.s.w\t$f12,$f10\n 80:\tc.lt.s\t$f2,$f12\n 84:\tnop\n 88:\tbc1fl\t98 \n 8c:\ttrunc.w.s\t$f16,$f0\n 90:\tmov.s\t$f0,$f12\n 94:\ttrunc.w.s\t$f16,$f0\n 98:\tmfc1\tt0,$f16\n 9c:\tnop\n a0:\taddu\ta3,t0,v0\n a4:\tslt\tat,a2,a3\n a8:\tbeqzl\tat,b8 \n ac:\tsh\ta3,0(a0)\n b0:\tmove\ta3,a2\n b4:\tsh\ta3,0(a0)\n b8:\tlh\tv1,0(a0)\n bc:\tsubu\tv0,a1,v1\n c0:\tsll\tv0,v0,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000cc add_calc_short_angle3\n\n\nContents of section .text:\n 0000 afa50004 afa7000c 84830000 00052c00 ..............,.\n 0010 00052c03 44866000 10a30028 3062ffff ..,.D.`....(0b..\n 0020 30a7ffff 00e2082a 10200003 00e03025 0......*. ....0%\n 0030 3c010001 00e13021 00c27023 448e2000 <.....0!..p#D. .\n 0040 87af000e 87b80012 468021a0 448f4000 ........F.!.D.@.\n 0050 00000000 468043a0 460c3082 4602703c ....F.C.F.0.F.p<\n 0060 46001006 45020004 44985000 10000009 F...E...D.P.....\n 0070 46007006 44985000 00000000 46805320 F.p.D.P.....F.S \n 0080 460c103c 00000000 45020003 4600040d F..<....E...F...\n 0090 46006006 4600040d 44088000 00000000 F.`.F...D.......\n 00a0 01023821 00c7082a 50200003 a4870000 ..8!...*P ......\n 00b0 00c03825 a4870000 84830000 00a31023 ..8%...........#\n 00c0 00021400 03e00008 00021403 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a100c1fe 00000000 . ..............\n 0010 0003f5df 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a100c1fe 00000000 0003f5df 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000033 0000001c 00000248 p......3.......H\n 0010 00000005 000003bc 00000001 00000264 ...............d\n 0020 00000004 00000298 00000000 00000000 ................\n 0030 00000011 000002c8 00000040 0000030c ...........@....\n 0040 00000018 0000034c 00000001 00000364 .......L.......d\n 0050 00000000 00000000 00000001 000003ac ................\n 0060 0150b250 101011f0 21211020 d012f010 .P.P....!!. ....\n 0070 f0111116 10231210 21230000 00000000 .....#..!#......\n 0080 00000001 00000000 00000000 00000000 ................\n 0090 ffffffff 00000000 00000000 00000000 ................\n 00a0 001d001f 00000004 0000001b 00000000 ................\n 00b0 00000001 00000000 2c200004 0000002a ........, .....*\n 00c0 00000000 1820000f 0000002a 000000cc ..... .....*....\n 00d0 20200001 00000001 00000000 20200000 .......... ..\n 00e0 02000000 03000000 04000000 05000000 ................\n 00f0 06000000 07000000 08000000 09000000 ................\n 0100 20000000 21000000 0a000000 0b000000 ...!...........\n 0110 0b000000 1a000000 00000000 00000003 ................\n 0120 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0130 7265616c 2d69646f 2d623633 30333139 real-ido-b630319\n 0140 36336333 61656233 662f752e 69006164 63c3aeb3f/u.i.ad\n 0150 645f6361 6c635f73 686f7274 5f616e67 d_calc_short_ang\n 0160 6c653300 6164645f 63616c63 5f73686f le3.add_calc_sho\n 0170 72745f61 6e676c65 33000000 00000000 rt_angle3.......\n 0180 00000001 00000000 00000040 00000000 ...........@....\n 0190 00000004 00000000 00000033 00000000 ...........3....\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 0000001a 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000000 00000000 . ..............\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc_short_angle3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc_short_angle3` — benchmark function af:add_calc_short_angle3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc_short_angle3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta3,12(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta1,a1,0x10\n 14:\tmtc1\ta2,$f12\n 18:\tbeq\ta1,v1,bc \n 1c:\tandi\tv0,v1,0xffff\n 20:\tandi\ta3,a1,0xffff\n 24:\tslt\tat,a3,v0\n 28:\tbeqz\tat,38 \n 2c:\tmove\ta2,a3\n 30:\tlui\tat,0x1\n 34:\taddu\ta2,a3,at\n 38:\tsubu\tt6,a2,v0\n 3c:\tmtc1\tt6,$f4\n 40:\tlh\tt7,14(sp)\n 44:\tlh\tt8,18(sp)\n 48:\tcvt.s.w\t$f6,$f4\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f14,$f8\n 58:\tmul.s\t$f2,$f6,$f12\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tmov.s\t$f0,$f2\n 64:\tbc1fl\t78 \n 68:\tmtc1\tt8,$f10\n 6c:\tb\t94 \n 70:\tmov.s\t$f0,$f14\n 74:\tmtc1\tt8,$f10\n 78:\tnop\n 7c:\tcvt.s.w\t$f12,$f10\n 80:\tc.lt.s\t$f2,$f12\n 84:\tnop\n 88:\tbc1fl\t98 \n 8c:\ttrunc.w.s\t$f16,$f0\n 90:\tmov.s\t$f0,$f12\n 94:\ttrunc.w.s\t$f16,$f0\n 98:\tmfc1\tt0,$f16\n 9c:\tnop\n a0:\taddu\ta3,t0,v0\n a4:\tslt\tat,a2,a3\n a8:\tbeqzl\tat,b8 \n ac:\tsh\ta3,0(a0)\n b0:\tmove\ta3,a2\n b4:\tsh\ta3,0(a0)\n b8:\tlh\tv1,0(a0)\n bc:\tsubu\tv0,a1,v1\n c0:\tsll\tv0,v0,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000cc add_calc_short_angle3\n\n\nContents of section .text:\n 0000 afa50004 afa7000c 84830000 00052c00 ..............,.\n 0010 00052c03 44866000 10a30028 3062ffff ..,.D.`....(0b..\n 0020 30a7ffff 00e2082a 10200003 00e03025 0......*. ....0%\n 0030 3c010001 00e13021 00c27023 448e2000 <.....0!..p#D. .\n 0040 87af000e 87b80012 468021a0 448f4000 ........F.!.D.@.\n 0050 00000000 468043a0 460c3082 4602703c ....F.C.F.0.F.p<\n 0060 46001006 45020004 44985000 10000009 F...E...D.P.....\n 0070 46007006 44985000 00000000 46805320 F.p.D.P.....F.S \n 0080 460c103c 00000000 45020003 4600040d F..<....E...F...\n 0090 46006006 4600040d 44088000 00000000 F.`.F...D.......\n 00a0 01023821 00c7082a 50200003 a4870000 ..8!...*P ......\n 00b0 00c03825 a4870000 84830000 00a31023 ..8%...........#\n 00c0 00021400 03e00008 00021403 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a100c1fe 00000000 . ..............\n 0010 0003f5df 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a100c1fe 00000000 0003f5df 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000033 0000001c 00000248 p......3.......H\n 0010 00000005 000003bc 00000001 00000264 ...............d\n 0020 00000004 00000298 00000000 00000000 ................\n 0030 00000011 000002c8 00000040 0000030c ...........@....\n 0040 00000018 0000034c 00000001 00000364 .......L.......d\n 0050 00000000 00000000 00000001 000003ac ................\n 0060 0150b250 101011f0 21211020 d012f010 .P.P....!!. ....\n 0070 f0111116 10231210 21230000 00000000 .....#..!#......\n 0080 00000001 00000000 00000000 00000000 ................\n 0090 ffffffff 00000000 00000000 00000000 ................\n 00a0 001d001f 00000004 0000001b 00000000 ................\n 00b0 00000001 00000000 2c200004 0000002a ........, .....*\n 00c0 00000000 1820000f 0000002a 000000cc ..... .....*....\n 00d0 20200001 00000001 00000000 20200000 .......... ..\n 00e0 02000000 03000000 04000000 05000000 ................\n 00f0 06000000 07000000 08000000 09000000 ................\n 0100 20000000 21000000 0a000000 0b000000 ...!...........\n 0110 0b000000 1a000000 00000000 00000003 ................\n 0120 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0130 7265616c 2d69646f 2d623633 30333139 real-ido-b630319\n 0140 36336333 61656233 662f752e 69006164 63c3aeb3f/u.i.ad\n 0150 645f6361 6c635f73 686f7274 5f616e67 d_calc_short_ang\n 0160 6c653300 6164645f 63616c63 5f73686f le3.add_calc_sho\n 0170 72745f61 6e676c65 33000000 00000000 rt_angle3.......\n 0180 00000001 00000000 00000040 00000000 ...........@....\n 0190 00000004 00000000 00000033 00000000 ...........3....\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 0000001a 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000000 00000000 . ..............\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc_short_angle3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -188,7 +188,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `add_calc0` — benchmark function af:add_calc0:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc0\n mtc1\t$a1, $f12\n lwc1\t$f2, 0($a0)\n mtc1\t$a2, $f14\n mul.s\t$f0, $f2, $f12\n c.lt.s\t$f14, $f0\n nop\n bc1fl\t.L2c\n neg.s\t$f12, $f14\n b\t.L40\n mov.s\t$f0, $f14\n neg.s\t$f12, $f14\n.L2c:\n c.lt.s\t$f0, $f12\n nop\n bc1fl\t.L44\n sub.s\t$f4, $f2, $f0\n mov.s\t$f0, $f12\n.L40:\n sub.s\t$f4, $f2, $f0\n.L44:\n jr\t$ra\n swc1\t$f4, 0($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc0` — benchmark function af:add_calc0:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc0:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f2,0(a0)\n 8:\tmtc1\ta2,$f14\n c:\tmul.s\t$f0,$f2,$f12\n 10:\tc.lt.s\t$f14,$f0\n 14:\tnop\n 18:\tbc1fl\t2c \n 1c:\tneg.s\t$f12,$f14\n 20:\tb\t40 \n 24:\tmov.s\t$f0,$f14\n 28:\tneg.s\t$f12,$f14\n 2c:\tc.lt.s\t$f0,$f12\n 30:\tnop\n 34:\tbc1fl\t44 \n 38:\tsub.s\t$f4,$f2,$f0\n 3c:\tmov.s\t$f0,$f12\n 40:\tsub.s\t$f4,$f2,$f0\n 44:\tjr\tra\n 48:\tswc1\t$f4,0(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c add_calc0\n\n\nContents of section .text:\n 0000 44856000 c4820000 44867000 460c1002 D.`.....D.p.F...\n 0010 4600703c 00000000 45020004 46007307 F.p<....E...F.s.\n 0020 10000007 46007006 46007307 460c003c ....F.p.F.s.F..<\n 0030 00000000 45020003 46001101 46006006 ....E...F...F.`.\n 0040 46001101 03e00008 e4840000 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00007037 00000000 00000000 00007ff0 ..p7............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00007037 00000000 ...p......p7....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 0000000c 000001b8 p...............\n 0010 00000005 00000304 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000034 0000026c .......(...4...l\n 0040 0000000c 000002a0 00000001 000002ac ................\n 0050 00000000 00000000 00000001 000002f4 ................\n 0060 0010f010 13111410 2010f000 00000000 ........ .......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000001 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000004c ..... .....*...L\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d626438 32373063 real-ido-bd8270c\n 0130 37326164 64626664 642f752e 69006164 72addbfdd/u.i.ad\n 0140 645f6361 6c633000 6164645f 63616c63 d_calc0.add_calc\n 0150 30000000 00000000 00000001 00000000 0...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 00000013 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000b 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add_calc0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc0` — benchmark function af:add_calc0:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc0:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f2,0(a0)\n 8:\tmtc1\ta2,$f14\n c:\tmul.s\t$f0,$f2,$f12\n 10:\tc.lt.s\t$f14,$f0\n 14:\tnop\n 18:\tbc1fl\t2c \n 1c:\tneg.s\t$f12,$f14\n 20:\tb\t40 \n 24:\tmov.s\t$f0,$f14\n 28:\tneg.s\t$f12,$f14\n 2c:\tc.lt.s\t$f0,$f12\n 30:\tnop\n 34:\tbc1fl\t44 \n 38:\tsub.s\t$f4,$f2,$f0\n 3c:\tmov.s\t$f0,$f12\n 40:\tsub.s\t$f4,$f2,$f0\n 44:\tjr\tra\n 48:\tswc1\t$f4,0(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c add_calc0\n\n\nContents of section .text:\n 0000 44856000 c4820000 44867000 460c1002 D.`.....D.p.F...\n 0010 4600703c 00000000 45020004 46007307 F.p<....E...F.s.\n 0020 10000007 46007006 46007307 460c003c ....F.p.F.s.F..<\n 0030 00000000 45020003 46001101 46006006 ....E...F...F.`.\n 0040 46001101 03e00008 e4840000 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00007037 00000000 00000000 00007ff0 ..p7............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00007037 00000000 ...p......p7....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 0000000c 000001b8 p...............\n 0010 00000005 00000304 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000034 0000026c .......(...4...l\n 0040 0000000c 000002a0 00000001 000002ac ................\n 0050 00000000 00000000 00000001 000002f4 ................\n 0060 0010f010 13111410 2010f000 00000000 ........ .......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000001 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000004c ..... .....*...L\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d626438 32373063 real-ido-bd8270c\n 0130 37326164 64626664 642f752e 69006164 72addbfdd/u.i.ad\n 0140 645f6361 6c633000 6164645f 63616c63 d_calc0.add_calc\n 0150 30000000 00000000 00000001 00000000 0...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 00000013 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000b 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add_calc0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -275,7 +275,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `add_calc2` — benchmark function af:add_calc2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc2\n sw\t$a3, 12($sp)\n mtc1\t$a1, $f12\n lwc1\t$f0, 0($a0)\n mtc1\t$a2, $f14\n c.eq.s\t$f12, $f0\n nop\n bc1t\t.L68\n nop\n sub.s\t$f4, $f12, $f0\n lwc1\t$f6, 12($sp)\n lwc1\t$f12, 12($sp)\n mul.s\t$f2, $f4, $f14\n c.lt.s\t$f6, $f2\n nop\n bc1fl\t.L4c\n neg.s\t$f12, $f12\n b\t.L60\n mov.s\t$f2, $f6\n neg.s\t$f12, $f12\n.L4c:\n c.lt.s\t$f2, $f12\n nop\n bc1fl\t.L64\n add.s\t$f8, $f0, $f2\n mov.s\t$f2, $f12\n.L60:\n add.s\t$f8, $f0, $f2\n.L64:\n swc1\t$f8, 0($a0)\n.L68:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc2` — benchmark function af:add_calc2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc2:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tc.eq.s\t$f12,$f0\n 14:\tnop\n 18:\tbc1t\t68 \n 1c:\tnop\n 20:\tsub.s\t$f4,$f12,$f0\n 24:\tlwc1\t$f6,12(sp)\n 28:\tlwc1\t$f12,12(sp)\n 2c:\tmul.s\t$f2,$f4,$f14\n 30:\tc.lt.s\t$f6,$f2\n 34:\tnop\n 38:\tbc1fl\t4c \n 3c:\tneg.s\t$f12,$f12\n 40:\tb\t60 \n 44:\tmov.s\t$f2,$f6\n 48:\tneg.s\t$f12,$f12\n 4c:\tc.lt.s\t$f2,$f12\n 50:\tnop\n 54:\tbc1fl\t64 \n 58:\tadd.s\t$f8,$f0,$f2\n 5c:\tmov.s\t$f2,$f12\n 60:\tadd.s\t$f8,$f0,$f2\n 64:\tswc1\t$f8,0(a0)\n 68:\tjr\tra\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000070 add_calc2\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 46006032 00000000 45010013 00000000 F.`2....E.......\n 0020 46006101 c7a6000c c7ac000c 460e2082 F.a.........F. .\n 0030 4602303c 00000000 45020004 46006307 F.0<....E...F.c.\n 0040 10000007 46003086 46006307 460c103c ....F.0.F.c.F..<\n 0050 00000000 45020003 46020200 46006086 ....E...F...F.`.\n 0060 46020200 e4880000 03e00008 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 0000737d 00000000 00000000 00007ff0 ..s}............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 0000737d 00000000 ..........s}....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001c 00000010 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e8 .......(........\n 0020 00000004 0000021c 00000000 00000000 ................\n 0030 00000011 0000024c 00000034 00000290 .......L...4....\n 0040 0000000c 000002c4 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 0120e023 101020d0 13111410 21210000 . .#.. .....!!..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000001 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000070 20200001 00000001 00000000 ...p ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d356161 nch-real-ido-5aa\n 0130 63353333 32623061 63613537 642f752e c5332b0aca57d/u.\n 0140 69006164 645f6361 6c633200 6164645f i.add_calc2.add_\n 0150 63616c63 32000000 00000000 00000001 calc2...........\n 0160 00000000 00000034 00000000 00000004 .......4........\n 0170 00000000 0000001c 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000e ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add_calc2\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc2` — benchmark function af:add_calc2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc2:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tc.eq.s\t$f12,$f0\n 14:\tnop\n 18:\tbc1t\t68 \n 1c:\tnop\n 20:\tsub.s\t$f4,$f12,$f0\n 24:\tlwc1\t$f6,12(sp)\n 28:\tlwc1\t$f12,12(sp)\n 2c:\tmul.s\t$f2,$f4,$f14\n 30:\tc.lt.s\t$f6,$f2\n 34:\tnop\n 38:\tbc1fl\t4c \n 3c:\tneg.s\t$f12,$f12\n 40:\tb\t60 \n 44:\tmov.s\t$f2,$f6\n 48:\tneg.s\t$f12,$f12\n 4c:\tc.lt.s\t$f2,$f12\n 50:\tnop\n 54:\tbc1fl\t64 \n 58:\tadd.s\t$f8,$f0,$f2\n 5c:\tmov.s\t$f2,$f12\n 60:\tadd.s\t$f8,$f0,$f2\n 64:\tswc1\t$f8,0(a0)\n 68:\tjr\tra\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000070 add_calc2\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 46006032 00000000 45010013 00000000 F.`2....E.......\n 0020 46006101 c7a6000c c7ac000c 460e2082 F.a.........F. .\n 0030 4602303c 00000000 45020004 46006307 F.0<....E...F.c.\n 0040 10000007 46003086 46006307 460c103c ....F.0.F.c.F..<\n 0050 00000000 45020003 46020200 46006086 ....E...F...F.`.\n 0060 46020200 e4880000 03e00008 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 0000737d 00000000 00000000 00007ff0 ..s}............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 0000737d 00000000 ..........s}....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001c 00000010 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e8 .......(........\n 0020 00000004 0000021c 00000000 00000000 ................\n 0030 00000011 0000024c 00000034 00000290 .......L...4....\n 0040 0000000c 000002c4 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 0120e023 101020d0 13111410 21210000 . .#.. .....!!..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000001 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000070 20200001 00000001 00000000 ...p ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d356161 nch-real-ido-5aa\n 0130 63353333 32623061 63613537 642f752e c5332b0aca57d/u.\n 0140 69006164 645f6361 6c633200 6164645f i.add_calc2.add_\n 0150 63616c63 32000000 00000000 00000001 calc2...........\n 0160 00000000 00000034 00000000 00000004 .......4........\n 0170 00000000 0000001c 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000e ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add_calc2\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -368,7 +368,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `adds` — benchmark function af:adds:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel adds\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n sw\t$a3, 12($sp)\n lh\t$v1, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n subu\t$v0, $a1, $v1\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n div\t$zero, $v0, $a2\n sll\t$a3, $a3, 0x10\n sra\t$a3, $a3, 0x10\n bnez\t$a2, .L44\n nop\n break\t0x7\n.L44:\n li\t$at, -1\n bne\t$a2, $at, .L5c\n lui\t$at, 0x8000\n bne\t$v0, $at, .L5c\n nop\n break\t0x6\n.L5c:\n mflo\t$v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slt\t$at, $a3, $v0\n beqz\t$at, .L80\n negu\t$t7, $a3\n addu\t$t6, $v1, $a3\n jr\t$ra\n sh\t$t6, 0($a0)\n.L80:\n slt\t$at, $v0, $t7\n beqz\t$at, .L98\n addu\t$t9, $v1, $v0\n subu\t$t8, $v1, $a3\n jr\t$ra\n sh\t$t8, 0($a0)\n.L98:\n sh\t$t9, 0($a0)\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function adds # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `adds` — benchmark function af:adds:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:adds:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tsw\ta3,12(sp)\n c:\tlh\tv1,0(a0)\n 10:\tsll\ta1,a1,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tsubu\tv0,a1,v1\n 1c:\tsll\tv0,v0,0x10\n 20:\tsra\tv0,v0,0x10\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0x10\n 2c:\tdiv\tzero,v0,a2\n 30:\tsll\ta3,a3,0x10\n 34:\tsra\ta3,a3,0x10\n 38:\tbnez\ta2,44 \n 3c:\tnop\n 40:\tbreak\t0x7\n 44:\tli\tat,-1\n 48:\tbne\ta2,at,5c \n 4c:\tlui\tat,0x8000\n 50:\tbne\tv0,at,5c \n 54:\tnop\n 58:\tbreak\t0x6\n 5c:\tmflo\tv0\n 60:\tsll\tv0,v0,0x10\n 64:\tsra\tv0,v0,0x10\n 68:\tslt\tat,a3,v0\n 6c:\tbeqz\tat,80 \n 70:\tnegu\tt7,a3\n 74:\taddu\tt6,v1,a3\n 78:\tjr\tra\n 7c:\tsh\tt6,0(a0)\n 80:\tslt\tat,v0,t7\n 84:\tbeqz\tat,98 \n 88:\taddu\tt9,v1,v0\n 8c:\tsubu\tt8,v1,a3\n 90:\tjr\tra\n 94:\tsh\tt8,0(a0)\n 98:\tsh\tt9,0(a0)\n 9c:\tjr\tra\n a0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 adds\n\n\nContents of section .text:\n 0000 afa50004 afa60008 afa7000c 84830000 ................\n 0010 00052c00 00052c03 00a31023 00021400 ..,...,....#....\n 0020 00021403 00063400 00063403 0046001a ......4...4..F..\n 0030 00073c00 00073c03 14c00002 00000000 ..<...<.........\n 0040 0007000d 2401ffff 14c10004 3c018000 ....$.......<...\n 0050 14410002 00000000 0006000d 00001012 .A..............\n 0060 00021400 00021403 00e2082a 10200004 ...........*. ..\n 0070 00077823 00677021 03e00008 a48e0000 ..x#.gp!........\n 0080 004f082a 10200004 0062c821 0067c023 .O.*. ...b.!.g.#\n 0090 03e00008 a4980000 a4990000 03e00008 ................\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c0fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c0fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000018 00000218 p......)........\n 0010 00000005 00000368 00000001 00000230 .......h.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 00000030 000002d8 ...........0....\n 0040 00000008 00000308 00000001 00000310 ................\n 0050 00000000 00000000 00000001 00000358 ...............X\n 0060 0210f112 f120e128 021140d0 10f03140 ..... .(..@...1@\n 0070 d010f030 11000000 00000000 00000001 ...0............\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000001 0000000d 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000a4 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d316135 32303738 66643466 -ido-1a52078fd4f\n 0140 39646139 332f752e 69006164 64730000 9da93/u.i.adds..\n 0150 61646473 00000000 00000000 00000001 adds............\n 0160 00000000 0000002f 00000000 00000004 ......./........\n 0170 00000000 00000029 00000000 00000000 .......)........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000015 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"adds\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name adds # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `adds` — benchmark function af:adds:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:adds:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tsw\ta3,12(sp)\n c:\tlh\tv1,0(a0)\n 10:\tsll\ta1,a1,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tsubu\tv0,a1,v1\n 1c:\tsll\tv0,v0,0x10\n 20:\tsra\tv0,v0,0x10\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0x10\n 2c:\tdiv\tzero,v0,a2\n 30:\tsll\ta3,a3,0x10\n 34:\tsra\ta3,a3,0x10\n 38:\tbnez\ta2,44 \n 3c:\tnop\n 40:\tbreak\t0x7\n 44:\tli\tat,-1\n 48:\tbne\ta2,at,5c \n 4c:\tlui\tat,0x8000\n 50:\tbne\tv0,at,5c \n 54:\tnop\n 58:\tbreak\t0x6\n 5c:\tmflo\tv0\n 60:\tsll\tv0,v0,0x10\n 64:\tsra\tv0,v0,0x10\n 68:\tslt\tat,a3,v0\n 6c:\tbeqz\tat,80 \n 70:\tnegu\tt7,a3\n 74:\taddu\tt6,v1,a3\n 78:\tjr\tra\n 7c:\tsh\tt6,0(a0)\n 80:\tslt\tat,v0,t7\n 84:\tbeqz\tat,98 \n 88:\taddu\tt9,v1,v0\n 8c:\tsubu\tt8,v1,a3\n 90:\tjr\tra\n 94:\tsh\tt8,0(a0)\n 98:\tsh\tt9,0(a0)\n 9c:\tjr\tra\n a0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 adds\n\n\nContents of section .text:\n 0000 afa50004 afa60008 afa7000c 84830000 ................\n 0010 00052c00 00052c03 00a31023 00021400 ..,...,....#....\n 0020 00021403 00063400 00063403 0046001a ......4...4..F..\n 0030 00073c00 00073c03 14c00002 00000000 ..<...<.........\n 0040 0007000d 2401ffff 14c10004 3c018000 ....$.......<...\n 0050 14410002 00000000 0006000d 00001012 .A..............\n 0060 00021400 00021403 00e2082a 10200004 ...........*. ..\n 0070 00077823 00677021 03e00008 a48e0000 ..x#.gp!........\n 0080 004f082a 10200004 0062c821 0067c023 .O.*. ...b.!.g.#\n 0090 03e00008 a4980000 a4990000 03e00008 ................\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c0fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c0fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000018 00000218 p......)........\n 0010 00000005 00000368 00000001 00000230 .......h.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 00000030 000002d8 ...........0....\n 0040 00000008 00000308 00000001 00000310 ................\n 0050 00000000 00000000 00000001 00000358 ...............X\n 0060 0210f112 f120e128 021140d0 10f03140 ..... .(..@...1@\n 0070 d010f030 11000000 00000000 00000001 ...0............\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000001 0000000d 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000a4 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d316135 32303738 66643466 -ido-1a52078fd4f\n 0140 39646139 332f752e 69006164 64730000 9da93/u.i.adds..\n 0150 61646473 00000000 00000000 00000001 adds............\n 0160 00000000 0000002f 00000000 00000004 ......./........\n 0170 00000000 00000029 00000000 00000000 .......)........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000015 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"adds\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name adds # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -451,7 +451,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `chase_angle` — benchmark function af:chase_angle:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_angle\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .L98\n sra\t$a1, $a1, 0x10\n lh\t$v0, 0($a0)\n lui\t$at, %hi(game_GameFrame_2F)\n lwc1\t$f0, %lo(game_GameFrame_2F)($at)\n subu\t$t6, $v0, $a1\n sll\t$t7, $t6, 0x10\n sra\t$t8, $t7, 0x10\n blezl\t$t8, .L4c\n mtc1\t$a2, $f4\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n mtc1\t$a2, $f4\n.L4c:\n nop\n cvt.s.w\t$f6, $f4\n mul.s\t$f8, $f6, $f0\n trunc.w.s\t$f10, $f8\n mfc1\t$t2, $f10\n nop\n addu\t$t3, $v0, $t2\n sh\t$t3, 0($a0)\n lh\t$t4, 0($a0)\n li\t$v0, 1\n subu\t$t5, $t4, $a1\n sll\t$t6, $t5, 0x10\n sra\t$t7, $t6, 0x10\n multu\t$t7, $a2\n mflo\t$t8\n bltzl\t$t8, .Lb0\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.L98:\n lh\t$t9, 0($a0)\n bnel\t$a1, $t9, .Lb0\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.Lb0:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_angle # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `chase_angle` — benchmark function af:chase_angle:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_angle:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,98 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tlui\tat,0x0\n 24:\tlwc1\t$f0,0(at)\n 28:\tsubu\tt6,v0,a1\n 2c:\tsll\tt7,t6,0x10\n 30:\tsra\tt8,t7,0x10\n 34:\tblezl\tt8,4c \n 38:\tmtc1\ta2,$f4\n 3c:\tnegu\ta2,a2\n 40:\tsll\ta2,a2,0x10\n 44:\tsra\ta2,a2,0x10\n 48:\tmtc1\ta2,$f4\n 4c:\tnop\n 50:\tcvt.s.w\t$f6,$f4\n 54:\tmul.s\t$f8,$f6,$f0\n 58:\ttrunc.w.s\t$f10,$f8\n 5c:\tmfc1\tt2,$f10\n 60:\tnop\n 64:\taddu\tt3,v0,t2\n 68:\tsh\tt3,0(a0)\n 6c:\tlh\tt4,0(a0)\n 70:\tli\tv0,1\n 74:\tsubu\tt5,t4,a1\n 78:\tsll\tt6,t5,0x10\n 7c:\tsra\tt7,t6,0x10\n 80:\tmultu\tt7,a2\n 84:\tmflo\tt8\n 88:\tbltzl\tt8,b0 \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tsh\ta1,0(a0)\n 98:\tlh\tt9,0(a0)\n 9c:\tbnel\ta1,t9,b0 \n a0:\tmove\tv0,zero\n a4:\tjr\tra\n a8:\tli\tv0,1\n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000c0 .text\n00000000 g F .text\t000000b8 chase_angle\n00000000 O *UND*\t00000004 game_GameFrame_2F\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_HI16 game_GameFrame_2F\n00000024 R_MIPS_LO16 game_GameFrame_2F\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00020 00052c03 84820000 ..4.... ..,.....\n 0020 3c010000 c4200000 00457023 000e7c00 <.... ...Ep#..|.\n 0030 000fc403 5b000005 44862000 00063023 ....[...D. ...0#\n 0040 00063400 00063403 44862000 00000000 ..4...4.D. .....\n 0050 468021a0 46003202 4600428d 440a5000 F.!.F.2.F.B.D.P.\n 0060 00000000 004a5821 a48b0000 848c0000 .....JX!........\n 0070 24020001 01856823 000d7400 000e7c03 $.....h#..t...|.\n 0080 01e60019 0000c012 07020009 00001025 ...............%\n 0090 03e00008 a4850000 84990000 54b90004 ............T...\n 00a0 00001025 03e00008 24020001 00001025 ...%....$......%\n 00b0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300fc76 00000000 . .........v....\n 0010 00000fd1 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300fc76 00000000 00000fd1 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002e 00000010 00000268 p..............h\n 0010 00000006 000003e0 00000001 00000278 ...............x\n 0020 00000004 000002ac 00000000 00000000 ................\n 0030 00000011 000002dc 00000038 00000320 ...........8... \n 0040 00000020 00000358 00000001 00000378 ... ...X.......x\n 0050 00000000 00000000 00000002 000003c0 ................\n 0060 0410f030 f1141228 1020e620 f0321122 ...0...(. . .2.\"\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000004 00000012 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000b8 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d616634 nch-real-ido-af4\n 0130 61653161 35363662 62633664 312f752e ae1a566bbc6d1/u.\n 0140 69006368 6173655f 616e676c 65000000 i.chase_angle...\n 0150 63686173 655f616e 676c6500 67616d65 chase_angle.game\n 0160 5f47616d 65467261 6d655f32 46000000 _GameFrame_2F...\n 0170 00000000 00000001 00000000 00000036 ...............6\n 0180 00000000 00000004 00000000 0000002e ................\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000010 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000c ..... ..........\n 01d0 00000000 04cfffff 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 7fffffff 00000000 7fffffff 00000001 ................\n 0200 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_angle # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `chase_angle` — benchmark function af:chase_angle:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_angle:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,98 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tlui\tat,0x0\n 24:\tlwc1\t$f0,0(at)\n 28:\tsubu\tt6,v0,a1\n 2c:\tsll\tt7,t6,0x10\n 30:\tsra\tt8,t7,0x10\n 34:\tblezl\tt8,4c \n 38:\tmtc1\ta2,$f4\n 3c:\tnegu\ta2,a2\n 40:\tsll\ta2,a2,0x10\n 44:\tsra\ta2,a2,0x10\n 48:\tmtc1\ta2,$f4\n 4c:\tnop\n 50:\tcvt.s.w\t$f6,$f4\n 54:\tmul.s\t$f8,$f6,$f0\n 58:\ttrunc.w.s\t$f10,$f8\n 5c:\tmfc1\tt2,$f10\n 60:\tnop\n 64:\taddu\tt3,v0,t2\n 68:\tsh\tt3,0(a0)\n 6c:\tlh\tt4,0(a0)\n 70:\tli\tv0,1\n 74:\tsubu\tt5,t4,a1\n 78:\tsll\tt6,t5,0x10\n 7c:\tsra\tt7,t6,0x10\n 80:\tmultu\tt7,a2\n 84:\tmflo\tt8\n 88:\tbltzl\tt8,b0 \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tsh\ta1,0(a0)\n 98:\tlh\tt9,0(a0)\n 9c:\tbnel\ta1,t9,b0 \n a0:\tmove\tv0,zero\n a4:\tjr\tra\n a8:\tli\tv0,1\n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000c0 .text\n00000000 g F .text\t000000b8 chase_angle\n00000000 O *UND*\t00000004 game_GameFrame_2F\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_HI16 game_GameFrame_2F\n00000024 R_MIPS_LO16 game_GameFrame_2F\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00020 00052c03 84820000 ..4.... ..,.....\n 0020 3c010000 c4200000 00457023 000e7c00 <.... ...Ep#..|.\n 0030 000fc403 5b000005 44862000 00063023 ....[...D. ...0#\n 0040 00063400 00063403 44862000 00000000 ..4...4.D. .....\n 0050 468021a0 46003202 4600428d 440a5000 F.!.F.2.F.B.D.P.\n 0060 00000000 004a5821 a48b0000 848c0000 .....JX!........\n 0070 24020001 01856823 000d7400 000e7c03 $.....h#..t...|.\n 0080 01e60019 0000c012 07020009 00001025 ...............%\n 0090 03e00008 a4850000 84990000 54b90004 ............T...\n 00a0 00001025 03e00008 24020001 00001025 ...%....$......%\n 00b0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300fc76 00000000 . .........v....\n 0010 00000fd1 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300fc76 00000000 00000fd1 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002e 00000010 00000268 p..............h\n 0010 00000006 000003e0 00000001 00000278 ...............x\n 0020 00000004 000002ac 00000000 00000000 ................\n 0030 00000011 000002dc 00000038 00000320 ...........8... \n 0040 00000020 00000358 00000001 00000378 ... ...X.......x\n 0050 00000000 00000000 00000002 000003c0 ................\n 0060 0410f030 f1141228 1020e620 f0321122 ...0...(. . .2.\"\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000004 00000012 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000b8 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d616634 nch-real-ido-af4\n 0130 61653161 35363662 62633664 312f752e ae1a566bbc6d1/u.\n 0140 69006368 6173655f 616e676c 65000000 i.chase_angle...\n 0150 63686173 655f616e 676c6500 67616d65 chase_angle.game\n 0160 5f47616d 65467261 6d655f32 46000000 _GameFrame_2F...\n 0170 00000000 00000001 00000000 00000036 ...............6\n 0180 00000000 00000004 00000000 0000002e ................\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000010 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000c ..... ..........\n 01d0 00000000 04cfffff 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 7fffffff 00000000 7fffffff 00000001 ................\n 0200 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_angle # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -533,7 +533,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `chase_f` — benchmark function af:chase_f:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_f\n mtc1\t$a2, $f12\n mtc1\t$zero, $f4\n mtc1\t$a1, $f14\n c.eq.s\t$f12, $f4\n nop\n bc1tl\t.L6c\n lwc1\t$f4, 0($a0)\n lwc1\t$f0, 0($a0)\n li\t$v0, 1\n c.lt.s\t$f14, $f0\n nop\n bc1fl\t.L3c\n add.s\t$f6, $f0, $f12\n neg.s\t$f12, $f12\n add.s\t$f6, $f0, $f12\n.L3c:\n mtc1\t$zero, $f18\n swc1\t$f6, 0($a0)\n lwc1\t$f8, 0($a0)\n sub.s\t$f10, $f8, $f14\n mul.s\t$f16, $f10, $f12\n c.le.s\t$f18, $f16\n nop\n bc1fl\t.L88\n move\t$v0, $zero\n jr\t$ra\n swc1\t$f14, 0($a0)\n lwc1\t$f4, 0($a0)\n.L6c:\n c.eq.s\t$f14, $f4\n nop\n bc1fl\t.L88\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L88:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_f # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `chase_f` — benchmark function af:chase_f:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_f:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta2,$f12\n 4:\tmtc1\tzero,$f4\n 8:\tmtc1\ta1,$f14\n c:\tc.eq.s\t$f12,$f4\n 10:\tnop\n 14:\tbc1tl\t6c \n 18:\tlwc1\t$f4,0(a0)\n 1c:\tlwc1\t$f0,0(a0)\n 20:\tli\tv0,1\n 24:\tc.lt.s\t$f14,$f0\n 28:\tnop\n 2c:\tbc1fl\t3c \n 30:\tadd.s\t$f6,$f0,$f12\n 34:\tneg.s\t$f12,$f12\n 38:\tadd.s\t$f6,$f0,$f12\n 3c:\tmtc1\tzero,$f18\n 40:\tswc1\t$f6,0(a0)\n 44:\tlwc1\t$f8,0(a0)\n 48:\tsub.s\t$f10,$f8,$f14\n 4c:\tmul.s\t$f16,$f10,$f12\n 50:\tc.le.s\t$f18,$f16\n 54:\tnop\n 58:\tbc1fl\t88 \n 5c:\tmove\tv0,zero\n 60:\tjr\tra\n 64:\tswc1\t$f14,0(a0)\n 68:\tlwc1\t$f4,0(a0)\n 6c:\tc.eq.s\t$f14,$f4\n 70:\tnop\n 74:\tbc1fl\t88 \n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tli\tv0,1\n 84:\tmove\tv0,zero\n 88:\tjr\tra\n 8c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000090 chase_f\n\n\nContents of section .text:\n 0000 44866000 44802000 44857000 46046032 D.`.D. .D.p.F.`2\n 0010 00000000 45030015 c4840000 c4800000 ....E...........\n 0020 24020001 4600703c 00000000 45020003 $...F.p<....E...\n 0030 460c0180 46006307 460c0180 44809000 F...F.c.F...D...\n 0040 e4860000 c4880000 460e4281 460c5402 ........F.B.F.T.\n 0050 4610903e 00000000 4502000b 00001025 F..>....E......%\n 0060 03e00008 e48e0000 c4840000 46047032 ............F.p2\n 0070 00000000 45020004 00001025 03e00008 ....E......%....\n 0080 24020001 00001025 03e00008 00000000 $......%........\nContents of section .options:\n 0000 01200000 00000000 80000074 00000000 . .........t....\n 0010 00077dd1 00000000 00000000 00007ff0 ..}.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00077dd1 00000000 ...t......}.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000024 00000014 000001f8 p......$........\n 0010 00000005 00000348 00000001 0000020c .......H........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000034 000002b4 .......p...4....\n 0040 00000008 000002e8 00000001 000002f0 ................\n 0050 00000000 00000000 00000001 00000338 ...............8\n 0060 0010f013 1060a310 2010f016 20f04411 .....`.. ... .D.\n 0070 32000000 00000000 00000001 00000000 2...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000090 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d383936 32613031 66623762 32616536 -8962a01fb7b2ae6\n 0140 312f752e 69006368 6173655f 66000000 1/u.i.chase_f...\n 0150 63686173 655f6600 00000000 00000001 chase_f.........\n 0160 00000000 00000032 00000000 00000004 .......2........\n 0170 00000000 00000024 00000000 00000000 .......$........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000011 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_f # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `chase_f` — benchmark function af:chase_f:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_f:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta2,$f12\n 4:\tmtc1\tzero,$f4\n 8:\tmtc1\ta1,$f14\n c:\tc.eq.s\t$f12,$f4\n 10:\tnop\n 14:\tbc1tl\t6c \n 18:\tlwc1\t$f4,0(a0)\n 1c:\tlwc1\t$f0,0(a0)\n 20:\tli\tv0,1\n 24:\tc.lt.s\t$f14,$f0\n 28:\tnop\n 2c:\tbc1fl\t3c \n 30:\tadd.s\t$f6,$f0,$f12\n 34:\tneg.s\t$f12,$f12\n 38:\tadd.s\t$f6,$f0,$f12\n 3c:\tmtc1\tzero,$f18\n 40:\tswc1\t$f6,0(a0)\n 44:\tlwc1\t$f8,0(a0)\n 48:\tsub.s\t$f10,$f8,$f14\n 4c:\tmul.s\t$f16,$f10,$f12\n 50:\tc.le.s\t$f18,$f16\n 54:\tnop\n 58:\tbc1fl\t88 \n 5c:\tmove\tv0,zero\n 60:\tjr\tra\n 64:\tswc1\t$f14,0(a0)\n 68:\tlwc1\t$f4,0(a0)\n 6c:\tc.eq.s\t$f14,$f4\n 70:\tnop\n 74:\tbc1fl\t88 \n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tli\tv0,1\n 84:\tmove\tv0,zero\n 88:\tjr\tra\n 8c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000090 chase_f\n\n\nContents of section .text:\n 0000 44866000 44802000 44857000 46046032 D.`.D. .D.p.F.`2\n 0010 00000000 45030015 c4840000 c4800000 ....E...........\n 0020 24020001 4600703c 00000000 45020003 $...F.p<....E...\n 0030 460c0180 46006307 460c0180 44809000 F...F.c.F...D...\n 0040 e4860000 c4880000 460e4281 460c5402 ........F.B.F.T.\n 0050 4610903e 00000000 4502000b 00001025 F..>....E......%\n 0060 03e00008 e48e0000 c4840000 46047032 ............F.p2\n 0070 00000000 45020004 00001025 03e00008 ....E......%....\n 0080 24020001 00001025 03e00008 00000000 $......%........\nContents of section .options:\n 0000 01200000 00000000 80000074 00000000 . .........t....\n 0010 00077dd1 00000000 00000000 00007ff0 ..}.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00077dd1 00000000 ...t......}.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000024 00000014 000001f8 p......$........\n 0010 00000005 00000348 00000001 0000020c .......H........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000034 000002b4 .......p...4....\n 0040 00000008 000002e8 00000001 000002f0 ................\n 0050 00000000 00000000 00000001 00000338 ...............8\n 0060 0010f013 1060a310 2010f016 20f04411 .....`.. ... .D.\n 0070 32000000 00000000 00000001 00000000 2...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000090 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d383936 32613031 66623762 32616536 -8962a01fb7b2ae6\n 0140 312f752e 69006368 6173655f 66000000 1/u.i.chase_f...\n 0150 63686173 655f6600 00000000 00000001 chase_f.........\n 0160 00000000 00000032 00000000 00000004 .......2........\n 0170 00000000 00000024 00000000 00000000 .......$........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000011 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_f # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -615,7 +615,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `chase_f3` — benchmark function af:chase_f3:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_f3\n sw\t$a3, 12($sp)\n mtc1\t$a1, $f12\n lwc1\t$f0, 0($a0)\n mtc1\t$a2, $f14\n mtc1\t$zero, $f4\n c.le.s\t$f0, $f12\n lwc1\t$f2, 12($sp)\n bc1f\t.L2c\n nop\n b\t.L2c\n mov.s\t$f2, $f14\n.L2c:\n c.eq.s\t$f2, $f4\n nop\n bc1tl\t.L84\n c.eq.s\t$f12, $f0\n c.lt.s\t$f12, $f0\n li\t$v0, 1\n bc1fl\t.L54\n add.s\t$f6, $f0, $f2\n neg.s\t$f2, $f2\n add.s\t$f6, $f0, $f2\n.L54:\n mtc1\t$zero, $f18\n swc1\t$f6, 0($a0)\n lwc1\t$f8, 0($a0)\n sub.s\t$f10, $f8, $f12\n mul.s\t$f16, $f10, $f2\n c.le.s\t$f18, $f16\n nop\n bc1fl\t.L9c\n move\t$v0, $zero\n jr\t$ra\n swc1\t$f12, 0($a0)\n c.eq.s\t$f12, $f0\n.L84:\n nop\n bc1fl\t.L9c\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L9c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_f3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `chase_f3` — benchmark function af:chase_f3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_f3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tmtc1\tzero,$f4\n 14:\tc.le.s\t$f0,$f12\n 18:\tlwc1\t$f2,12(sp)\n 1c:\tbc1f\t2c \n 20:\tnop\n 24:\tb\t2c \n 28:\tmov.s\t$f2,$f14\n 2c:\tc.eq.s\t$f2,$f4\n 30:\tnop\n 34:\tbc1tl\t84 \n 38:\tc.eq.s\t$f12,$f0\n 3c:\tc.lt.s\t$f12,$f0\n 40:\tli\tv0,1\n 44:\tbc1fl\t54 \n 48:\tadd.s\t$f6,$f0,$f2\n 4c:\tneg.s\t$f2,$f2\n 50:\tadd.s\t$f6,$f0,$f2\n 54:\tmtc1\tzero,$f18\n 58:\tswc1\t$f6,0(a0)\n 5c:\tlwc1\t$f8,0(a0)\n 60:\tsub.s\t$f10,$f8,$f12\n 64:\tmul.s\t$f16,$f10,$f2\n 68:\tc.le.s\t$f18,$f16\n 6c:\tnop\n 70:\tbc1fl\t9c \n 74:\tmove\tv0,zero\n 78:\tjr\tra\n 7c:\tswc1\t$f12,0(a0)\n 80:\tc.eq.s\t$f12,$f0\n 84:\tnop\n 88:\tbc1fl\t9c \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 chase_f3\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 44802000 460c003e c7a2000c 45000003 D. .F..>....E...\n 0020 00000000 10000001 46007086 46041032 ........F.p.F..2\n 0030 00000000 45030013 46006032 4600603c ....E...F.`2F.`<\n 0040 24020001 45020003 46020180 46001087 $...E...F...F...\n 0050 46020180 44809000 e4860000 c4880000 F...D...........\n 0060 460c4281 46025402 4610903e 00000000 F.B.F.T.F..>....\n 0070 4502000a 00001025 03e00008 e48c0000 E......%........\n 0080 46006032 00000000 45020004 00001025 F.`2....E......%\n 0090 03e00008 24020001 00001025 03e00008 ....$......%....\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000f4 00000000 . ..............\n 0010 00075ddd 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f4 00000000 00075ddd 00000000 ..........].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000014 00000218 p......)........\n 0010 00000005 0000036c 00000001 0000022c .......l.......,\n 0020 00000004 00000260 00000000 00000000 .......`........\n 0030 00000011 00000290 00000034 000002d4 ...........4....\n 0040 0000000c 00000308 00000001 00000314 ................\n 0050 00000000 00000000 00000001 0000035c ...............\\\n 0060 0110f020 f5131060 a1102010 f01620f0 ... ...`.. ... .\n 0070 33112200 00000000 00000001 00000000 3.\".............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000010 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000a4 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d626264 61656530 30653961 31393062 -bbdaee00e9a190b\n 0140 382f752e 69006368 6173655f 66330000 8/u.i.chase_f3..\n 0150 63686173 655f6633 00000000 00000000 chase_f3........\n 0160 00000001 00000000 00000033 00000000 ...........3....\n 0170 00000004 00000000 00000029 00000000 ...........)....\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000013 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_f3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `chase_f3` — benchmark function af:chase_f3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_f3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tmtc1\tzero,$f4\n 14:\tc.le.s\t$f0,$f12\n 18:\tlwc1\t$f2,12(sp)\n 1c:\tbc1f\t2c \n 20:\tnop\n 24:\tb\t2c \n 28:\tmov.s\t$f2,$f14\n 2c:\tc.eq.s\t$f2,$f4\n 30:\tnop\n 34:\tbc1tl\t84 \n 38:\tc.eq.s\t$f12,$f0\n 3c:\tc.lt.s\t$f12,$f0\n 40:\tli\tv0,1\n 44:\tbc1fl\t54 \n 48:\tadd.s\t$f6,$f0,$f2\n 4c:\tneg.s\t$f2,$f2\n 50:\tadd.s\t$f6,$f0,$f2\n 54:\tmtc1\tzero,$f18\n 58:\tswc1\t$f6,0(a0)\n 5c:\tlwc1\t$f8,0(a0)\n 60:\tsub.s\t$f10,$f8,$f12\n 64:\tmul.s\t$f16,$f10,$f2\n 68:\tc.le.s\t$f18,$f16\n 6c:\tnop\n 70:\tbc1fl\t9c \n 74:\tmove\tv0,zero\n 78:\tjr\tra\n 7c:\tswc1\t$f12,0(a0)\n 80:\tc.eq.s\t$f12,$f0\n 84:\tnop\n 88:\tbc1fl\t9c \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 chase_f3\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 44802000 460c003e c7a2000c 45000003 D. .F..>....E...\n 0020 00000000 10000001 46007086 46041032 ........F.p.F..2\n 0030 00000000 45030013 46006032 4600603c ....E...F.`2F.`<\n 0040 24020001 45020003 46020180 46001087 $...E...F...F...\n 0050 46020180 44809000 e4860000 c4880000 F...D...........\n 0060 460c4281 46025402 4610903e 00000000 F.B.F.T.F..>....\n 0070 4502000a 00001025 03e00008 e48c0000 E......%........\n 0080 46006032 00000000 45020004 00001025 F.`2....E......%\n 0090 03e00008 24020001 00001025 03e00008 ....$......%....\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000f4 00000000 . ..............\n 0010 00075ddd 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f4 00000000 00075ddd 00000000 ..........].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000014 00000218 p......)........\n 0010 00000005 0000036c 00000001 0000022c .......l.......,\n 0020 00000004 00000260 00000000 00000000 .......`........\n 0030 00000011 00000290 00000034 000002d4 ...........4....\n 0040 0000000c 00000308 00000001 00000314 ................\n 0050 00000000 00000000 00000001 0000035c ...............\\\n 0060 0110f020 f5131060 a1102010 f01620f0 ... ...`.. ... .\n 0070 33112200 00000000 00000001 00000000 3.\".............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000010 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000a4 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d626264 61656530 30653961 31393062 -bbdaee00e9a190b\n 0140 382f752e 69006368 6173655f 66330000 8/u.i.chase_f3..\n 0150 63686173 655f6633 00000000 00000000 chase_f3........\n 0160 00000001 00000000 00000033 00000000 ...........3....\n 0170 00000004 00000000 00000029 00000000 ...........)....\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000013 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_f3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -697,7 +697,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `chase_s` — benchmark function af:chase_s:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .L64\n sra\t$a1, $a1, 0x10\n lh\t$v0, 0($a0)\n slt\t$at, $a1, $v0\n beqzl\t$at, .L3c\n addu\t$t6, $v0, $a2\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n addu\t$t6, $v0, $a2\n.L3c:\n sh\t$t6, 0($a0)\n lh\t$t7, 0($a0)\n li\t$v0, 1\n subu\t$t8, $t7, $a1\n multu\t$t8, $a2\n mflo\t$t9\n bltzl\t$t9, .L7c\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.L64:\n lh\t$t0, 0($a0)\n bnel\t$a1, $t0, .L7c\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L7c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s` — benchmark function af:chase_s:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,64 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tslt\tat,a1,v0\n 24:\tbeqzl\tat,3c \n 28:\taddu\tt6,v0,a2\n 2c:\tnegu\ta2,a2\n 30:\tsll\ta2,a2,0x10\n 34:\tsra\ta2,a2,0x10\n 38:\taddu\tt6,v0,a2\n 3c:\tsh\tt6,0(a0)\n 40:\tlh\tt7,0(a0)\n 44:\tli\tv0,1\n 48:\tsubu\tt8,t7,a1\n 4c:\tmultu\tt8,a2\n 50:\tmflo\tt9\n 54:\tbltzl\tt9,7c \n 58:\tmove\tv0,zero\n 5c:\tjr\tra\n 60:\tsh\ta1,0(a0)\n 64:\tlh\tt0,0(a0)\n 68:\tbnel\ta1,t0,7c \n 6c:\tmove\tv0,zero\n 70:\tjr\tra\n 74:\tli\tv0,1\n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000084 chase_s\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00013 00052c03 84820000 ..4.......,.....\n 0020 00a2082a 50200005 00467021 00063023 ...*P ...Fp!..0#\n 0030 00063400 00063403 00467021 a48e0000 ..4...4..Fp!....\n 0040 848f0000 24020001 01e5c023 03060019 ....$......#....\n 0050 0000c812 07220009 00001025 03e00008 .....\".....%....\n 0060 a4850000 84880000 54a80004 00001025 ........T......%\n 0070 03e00008 24020001 00001025 03e00008 ....$......%....\n 0080 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c176 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c176 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000021 00000010 000001f8 p......!........\n 0010 00000005 00000344 00000001 00000208 .......D........\n 0020 00000004 0000023c 00000000 00000000 .......<........\n 0030 00000011 0000026c 00000034 000002b0 .......l...4....\n 0040 00000008 000002e4 00000001 000002ec ................\n 0050 00000000 00000000 00000001 00000334 ...............4\n 0060 0410f023 12211020 e420f042 11320000 ...#.!. . .B.2..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000011 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000084 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d663334 nch-real-ido-f34\n 0130 37633865 38353533 31393935 392f752e 7c8e855319959/u.\n 0140 69006368 6173655f 73000000 63686173 i.chase_s...chas\n 0150 655f7300 00000000 00000001 00000000 e_s.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000021 00000000 00000000 00000001 ...!............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000e 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s` — benchmark function af:chase_s:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,64 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tslt\tat,a1,v0\n 24:\tbeqzl\tat,3c \n 28:\taddu\tt6,v0,a2\n 2c:\tnegu\ta2,a2\n 30:\tsll\ta2,a2,0x10\n 34:\tsra\ta2,a2,0x10\n 38:\taddu\tt6,v0,a2\n 3c:\tsh\tt6,0(a0)\n 40:\tlh\tt7,0(a0)\n 44:\tli\tv0,1\n 48:\tsubu\tt8,t7,a1\n 4c:\tmultu\tt8,a2\n 50:\tmflo\tt9\n 54:\tbltzl\tt9,7c \n 58:\tmove\tv0,zero\n 5c:\tjr\tra\n 60:\tsh\ta1,0(a0)\n 64:\tlh\tt0,0(a0)\n 68:\tbnel\ta1,t0,7c \n 6c:\tmove\tv0,zero\n 70:\tjr\tra\n 74:\tli\tv0,1\n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000084 chase_s\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00013 00052c03 84820000 ..4.......,.....\n 0020 00a2082a 50200005 00467021 00063023 ...*P ...Fp!..0#\n 0030 00063400 00063403 00467021 a48e0000 ..4...4..Fp!....\n 0040 848f0000 24020001 01e5c023 03060019 ....$......#....\n 0050 0000c812 07220009 00001025 03e00008 .....\".....%....\n 0060 a4850000 84880000 54a80004 00001025 ........T......%\n 0070 03e00008 24020001 00001025 03e00008 ....$......%....\n 0080 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c176 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c176 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000021 00000010 000001f8 p......!........\n 0010 00000005 00000344 00000001 00000208 .......D........\n 0020 00000004 0000023c 00000000 00000000 .......<........\n 0030 00000011 0000026c 00000034 000002b0 .......l...4....\n 0040 00000008 000002e4 00000001 000002ec ................\n 0050 00000000 00000000 00000001 00000334 ...............4\n 0060 0410f023 12211020 e420f042 11320000 ...#.!. . .B.2..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000011 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000084 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d663334 nch-real-ido-f34\n 0130 37633865 38353533 31393935 392f752e 7c8e855319959/u.\n 0140 69006368 6173655f 73000000 63686173 i.chase_s...chas\n 0150 655f7300 00000000 00000001 00000000 e_s.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000021 00000000 00000000 00000001 ...!............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000e 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -722,19 +722,19 @@ "asmlift": { "decompiler": "asmlift", "symbolMap": true, - "candidateLabel": "unsigned", + "candidateLabel": "signed", "symbolsUsed": [], "outcome": "nonmatch", - "source": "s32 chase_s2(s16 * a0, u32 a1, u32 a2) {\n s32 v0;\n v0 = *a0;\n *a0 = v0 + (a2 << 16 >> 16);\n if ((*a0 - (a1 << 16 >> 16)) * ((v0 << 16 >> 16) - (a1 << 16 >> 16)) <= 0) {\n *a0 = a1 << 16 >> 16;\n return 1;\n } else {\n return 0;\n }\n}\n", + "source": "s32 chase_s2(s16 * a0, s32 a1, s32 a2) {\n s32 v0;\n v0 = *a0;\n *a0 = v0 + (a2 << 16 >> 16);\n if ((*a0 - (a1 << 16 >> 16)) * ((v0 << 16 >> 16) - (a1 << 16 >> 16)) <= 0) {\n *a0 = a1 << 16 >> 16;\n return 1;\n } else {\n return 0;\n }\n}\n", "score": 18, "maxScore": 24, "compileErrors": null, "breakdown": { "insert": 0, - "delete": 2, - "replace": 3, + "delete": 4, + "replace": 0, "opMismatch": 0, - "argMismatch": 13 + "argMismatch": 14 }, "quality": { "score": 100, @@ -785,7 +785,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `chase_s2` — benchmark function af:chase_s2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s2\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n lh\t$v1, 0($a0)\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n addu\t$t6, $v1, $a2\n sh\t$t6, 0($a0)\n lh\t$t7, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$v0, $v1, 0x10\n sra\t$v0, $v0, 0x10\n subu\t$t9, $v0, $a1\n subu\t$t8, $t7, $a1\n multu\t$t8, $t9\n move\t$v0, $zero\n mflo\t$t0\n bgtz\t$t0, .L58\n nop\n sh\t$a1, 0($a0)\n jr\t$ra\n li\t$v0, 1\n.L58:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s2` — benchmark function af:chase_s2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s2:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta2,a2,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\taddu\tt6,v1,a2\n 18:\tsh\tt6,0(a0)\n 1c:\tlh\tt7,0(a0)\n 20:\tsll\ta1,a1,0x10\n 24:\tsra\ta1,a1,0x10\n 28:\tsll\tv0,v1,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tsubu\tt9,v0,a1\n 34:\tsubu\tt8,t7,a1\n 38:\tmultu\tt8,t9\n 3c:\tmove\tv0,zero\n 40:\tmflo\tt0\n 44:\tbgtz\tt0,58 \n 48:\tnop\n 4c:\tsh\ta1,0(a0)\n 50:\tjr\tra\n 54:\tli\tv0,1\n 58:\tjr\tra\n 5c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000060 chase_s2\n\n\nContents of section .text:\n 0000 afa50004 afa60008 84830000 00063400 ..............4.\n 0010 00063403 00667021 a48e0000 848f0000 ..4..fp!........\n 0020 00052c00 00052c03 00031400 00021403 ..,...,.........\n 0030 0045c823 01e5c023 03190019 00001025 .E.#...#.......%\n 0040 00004012 1d000004 00000000 a4850000 ..@.............\n 0050 03e00008 24020001 03e00008 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 a300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000018 00000010 000001c8 p...............\n 0010 00000005 00000318 00000001 000001d8 ................\n 0020 00000004 0000020c 00000000 00000000 ................\n 0030 00000011 0000023c 00000034 00000280 .......<...4....\n 0040 0000000c 000002b4 00000001 000002c0 ................\n 0050 00000000 00000000 00000001 00000308 ................\n 0060 0110f121 10d11122 40c21011 21000000 ...!...\"@...!...\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000009 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000060 20200001 00000001 00000000 ...` ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d643230 nch-real-ido-d20\n 0130 63333538 62353263 32376664 632f752e c358b52c27fdc/u.\n 0140 69006368 6173655f 73320000 63686173 i.chase_s2..chas\n 0150 655f7332 00000000 00000000 00000001 e_s2............\n 0160 00000000 00000033 00000000 00000004 .......3........\n 0170 00000000 00000018 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000d ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s2` — benchmark function af:chase_s2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s2:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta2,a2,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\taddu\tt6,v1,a2\n 18:\tsh\tt6,0(a0)\n 1c:\tlh\tt7,0(a0)\n 20:\tsll\ta1,a1,0x10\n 24:\tsra\ta1,a1,0x10\n 28:\tsll\tv0,v1,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tsubu\tt9,v0,a1\n 34:\tsubu\tt8,t7,a1\n 38:\tmultu\tt8,t9\n 3c:\tmove\tv0,zero\n 40:\tmflo\tt0\n 44:\tbgtz\tt0,58 \n 48:\tnop\n 4c:\tsh\ta1,0(a0)\n 50:\tjr\tra\n 54:\tli\tv0,1\n 58:\tjr\tra\n 5c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000060 chase_s2\n\n\nContents of section .text:\n 0000 afa50004 afa60008 84830000 00063400 ..............4.\n 0010 00063403 00667021 a48e0000 848f0000 ..4..fp!........\n 0020 00052c00 00052c03 00031400 00021403 ..,...,.........\n 0030 0045c823 01e5c023 03190019 00001025 .E.#...#.......%\n 0040 00004012 1d000004 00000000 a4850000 ..@.............\n 0050 03e00008 24020001 03e00008 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 a300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000018 00000010 000001c8 p...............\n 0010 00000005 00000318 00000001 000001d8 ................\n 0020 00000004 0000020c 00000000 00000000 ................\n 0030 00000011 0000023c 00000034 00000280 .......<...4....\n 0040 0000000c 000002b4 00000001 000002c0 ................\n 0050 00000000 00000000 00000001 00000308 ................\n 0060 0110f121 10d11122 40c21011 21000000 ...!...\"@...!...\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000009 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000060 20200001 00000001 00000000 ...` ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d643230 nch-real-ido-d20\n 0130 63333538 62353263 32376664 632f752e c358b52c27fdc/u.\n 0140 69006368 6173655f 73320000 63686173 i.chase_s2..chas\n 0150 655f7332 00000000 00000000 00000001 e_s2............\n 0160 00000000 00000033 00000000 00000004 .......3........\n 0170 00000000 00000018 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000d ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -868,7 +868,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `chase_s3` — benchmark function af:chase_s3:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s3\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .La4\n sra\t$a1, $a1, 0x10\n lh\t$v1, 0($a0)\n li\t$at, 0x8000\n lui\t$t7, 0xffff\n subu\t$v0, $a1, $v1\n bgez\t$v0, .L40\n slt\t$at, $v0, $at\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n.L40:\n bnez\t$at, .L60\n negu\t$t6, $v0\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n ori\t$t7, $t7, 0x1\n sra\t$a2, $a2, 0x10\n b\t.L80\n subu\t$v0, $t7, $t6\n.L60:\n slti\t$at, $v0, -32767\n beqz\t$at, .L80\n nop\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n li\t$at, 0xffff\n sra\t$a2, $a2, 0x10\n addu\t$v0, $v0, $at\n.L80:\n multu\t$a2, $v0\n addu\t$t8, $v1, $a2\n sh\t$t8, 0($a0)\n li\t$v0, 1\n mflo\t$t9\n bgtzl\t$t9, .Lbc\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.La4:\n lh\t$t0, 0($a0)\n bnel\t$a1, $t0, .Lbc\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.Lbc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s3` — benchmark function af:chase_s3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,a4 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv1,0(a0)\n 20:\tli\tat,0x8000\n 24:\tlui\tt7,0xffff\n 28:\tsubu\tv0,a1,v1\n 2c:\tbgez\tv0,40 \n 30:\tslt\tat,v0,at\n 34:\tnegu\ta2,a2\n 38:\tsll\ta2,a2,0x10\n 3c:\tsra\ta2,a2,0x10\n 40:\tbnez\tat,60 \n 44:\tnegu\tt6,v0\n 48:\tnegu\ta2,a2\n 4c:\tsll\ta2,a2,0x10\n 50:\tori\tt7,t7,0x1\n 54:\tsra\ta2,a2,0x10\n 58:\tb\t80 \n 5c:\tsubu\tv0,t7,t6\n 60:\tslti\tat,v0,-32767\n 64:\tbeqz\tat,80 \n 68:\tnop\n 6c:\tnegu\ta2,a2\n 70:\tsll\ta2,a2,0x10\n 74:\tli\tat,0xffff\n 78:\tsra\ta2,a2,0x10\n 7c:\taddu\tv0,v0,at\n 80:\tmultu\ta2,v0\n 84:\taddu\tt8,v1,a2\n 88:\tsh\tt8,0(a0)\n 8c:\tli\tv0,1\n 90:\tmflo\tt9\n 94:\tbgtzl\tt9,bc \n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tsh\ta1,0(a0)\n a4:\tlh\tt0,0(a0)\n a8:\tbnel\ta1,t0,bc \n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tli\tv0,1\n b8:\tmove\tv0,zero\n bc:\tjr\tra\n c0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c4 chase_s3\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00023 00052c03 84830000 ..4....#..,.....\n 0020 34018000 3c0fffff 00a31023 04410004 4...<......#.A..\n 0030 0041082a 00063023 00063400 00063403 .A.*..0#..4...4.\n 0040 14200007 00027023 00063023 00063400 . ....p#..0#..4.\n 0050 35ef0001 00063403 10000009 01ee1023 5.....4........#\n 0060 28418001 10200006 00000000 00063023 (A... ........0#\n 0070 00063400 3401ffff 00063403 00411021 ..4.4.....4..A.!\n 0080 00c20019 0066c021 a4980000 24020001 .....f.!....$...\n 0090 0000c812 5f200009 00001025 03e00008 ...._ .....%....\n 00a0 a4850000 84880000 54a80004 00001025 ........T......%\n 00b0 03e00008 24020001 00001025 03e00008 ....$......%....\n 00c0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c17e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000031 00000020 00000238 p......1... ...8\n 0010 00000005 00000398 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 0000000c 00000334 00000001 00000340 .......4.......@\n 0050 00000000 00000000 00000001 00000388 ................\n 0060 0410f020 4020a010 30e22020 f110f011 ... @ ..0. ....\n 0070 121110f0 1030f130 e220f032 11220000 .....0.0. .2.\"..\n 0080 00000000 00000001 00000000 00000000 ................\n 0090 00000000 ffffffff 00000000 00000000 ................\n 00a0 00000000 001d001f 00000002 00000017 ................\n 00b0 00000000 00000001 00000000 2c200004 ............, ..\n 00c0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00d0 000000c4 20200001 00000001 00000000 .... ..........\n 00e0 20200000 02000000 03000000 04000000 ..............\n 00f0 05000000 06000000 07000000 08000000 ................\n 0100 09000000 20000000 21000000 0a000000 .... ...!.......\n 0110 0b000000 0b000000 1a000000 00000000 ................\n 0120 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0130 6e63682d 7265616c 2d69646f 2d383035 nch-real-ido-805\n 0140 36623232 64303864 62646363 662f752e 6b22d08dbdccf/u.\n 0150 69006368 6173655f 73330000 63686173 i.chase_s3..chas\n 0160 655f7333 00000000 00000000 00000001 e_s3............\n 0170 00000000 00000033 00000000 00000004 .......3........\n 0180 00000000 00000031 00000000 00000000 .......1........\n 0190 00000001 00000000 00000011 00000000 ................\n 01a0 00000000 01800000 00000000 0000001e ................\n 01b0 00000000 00000000 00000000 18200001 ............. ..\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 00000000 7fffffff 00000000 ................\n 01e0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s3` — benchmark function af:chase_s3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,a4 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv1,0(a0)\n 20:\tli\tat,0x8000\n 24:\tlui\tt7,0xffff\n 28:\tsubu\tv0,a1,v1\n 2c:\tbgez\tv0,40 \n 30:\tslt\tat,v0,at\n 34:\tnegu\ta2,a2\n 38:\tsll\ta2,a2,0x10\n 3c:\tsra\ta2,a2,0x10\n 40:\tbnez\tat,60 \n 44:\tnegu\tt6,v0\n 48:\tnegu\ta2,a2\n 4c:\tsll\ta2,a2,0x10\n 50:\tori\tt7,t7,0x1\n 54:\tsra\ta2,a2,0x10\n 58:\tb\t80 \n 5c:\tsubu\tv0,t7,t6\n 60:\tslti\tat,v0,-32767\n 64:\tbeqz\tat,80 \n 68:\tnop\n 6c:\tnegu\ta2,a2\n 70:\tsll\ta2,a2,0x10\n 74:\tli\tat,0xffff\n 78:\tsra\ta2,a2,0x10\n 7c:\taddu\tv0,v0,at\n 80:\tmultu\ta2,v0\n 84:\taddu\tt8,v1,a2\n 88:\tsh\tt8,0(a0)\n 8c:\tli\tv0,1\n 90:\tmflo\tt9\n 94:\tbgtzl\tt9,bc \n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tsh\ta1,0(a0)\n a4:\tlh\tt0,0(a0)\n a8:\tbnel\ta1,t0,bc \n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tli\tv0,1\n b8:\tmove\tv0,zero\n bc:\tjr\tra\n c0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c4 chase_s3\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00023 00052c03 84830000 ..4....#..,.....\n 0020 34018000 3c0fffff 00a31023 04410004 4...<......#.A..\n 0030 0041082a 00063023 00063400 00063403 .A.*..0#..4...4.\n 0040 14200007 00027023 00063023 00063400 . ....p#..0#..4.\n 0050 35ef0001 00063403 10000009 01ee1023 5.....4........#\n 0060 28418001 10200006 00000000 00063023 (A... ........0#\n 0070 00063400 3401ffff 00063403 00411021 ..4.4.....4..A.!\n 0080 00c20019 0066c021 a4980000 24020001 .....f.!....$...\n 0090 0000c812 5f200009 00001025 03e00008 ...._ .....%....\n 00a0 a4850000 84880000 54a80004 00001025 ........T......%\n 00b0 03e00008 24020001 00001025 03e00008 ....$......%....\n 00c0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c17e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000031 00000020 00000238 p......1... ...8\n 0010 00000005 00000398 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 0000000c 00000334 00000001 00000340 .......4.......@\n 0050 00000000 00000000 00000001 00000388 ................\n 0060 0410f020 4020a010 30e22020 f110f011 ... @ ..0. ....\n 0070 121110f0 1030f130 e220f032 11220000 .....0.0. .2.\"..\n 0080 00000000 00000001 00000000 00000000 ................\n 0090 00000000 ffffffff 00000000 00000000 ................\n 00a0 00000000 001d001f 00000002 00000017 ................\n 00b0 00000000 00000001 00000000 2c200004 ............, ..\n 00c0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00d0 000000c4 20200001 00000001 00000000 .... ..........\n 00e0 20200000 02000000 03000000 04000000 ..............\n 00f0 05000000 06000000 07000000 08000000 ................\n 0100 09000000 20000000 21000000 0a000000 .... ...!.......\n 0110 0b000000 0b000000 1a000000 00000000 ................\n 0120 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0130 6e63682d 7265616c 2d69646f 2d383035 nch-real-ido-805\n 0140 36623232 64303864 62646363 662f752e 6b22d08dbdccf/u.\n 0150 69006368 6173655f 73330000 63686173 i.chase_s3..chas\n 0160 655f7333 00000000 00000000 00000001 e_s3............\n 0170 00000000 00000033 00000000 00000004 .......3........\n 0180 00000000 00000031 00000000 00000000 .......1........\n 0190 00000001 00000000 00000011 00000000 ................\n 01a0 00000000 01800000 00000000 0000001e ................\n 01b0 00000000 00000000 00000000 18200001 ............. ..\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 00000000 7fffffff 00000000 ................\n 01e0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -938,7 +938,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `check_percent_abs` — benchmark function af:check_percent_abs:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel check_percent_abs\n neg.s\t$f4, $f14\n sw\t$a2, 8($sp)\n c.le.s\t$f4, $f12\n sw\t$a3, 12($sp)\n lwc1\t$f6, 8($sp)\n bc1fl\t.L3c\n c.le.s\t$f6, $f12\n c.le.s\t$f12, $f14\n nop\n bc1fl\t.L3c\n c.le.s\t$f6, $f12\n mtc1\t$zero, $f0\n jr\t$ra\n nop\n c.le.s\t$f6, $f12\n.L3c:\n lui\t$at, 0x3f80\n lwc1\t$f8, 8($sp)\n bc1fl\t.L5c\n neg.s\t$f10, $f8\n mtc1\t$at, $f0\n jr\t$ra\n nop\n neg.s\t$f10, $f8\n.L5c:\n lui\t$at, 0xbf80\n c.le.s\t$f12, $f10\n lw\t$t6, 16($sp)\n bc1f\t.L7c\n nop\n mtc1\t$at, $f0\n jr\t$ra\n nop\n.L7c:\n beqz\t$t6, .Lbc\n lwc1\t$f10, 12($sp)\n mtc1\t$zero, $f16\n nop\n c.lt.s\t$f16, $f12\n nop\n bc1fl\t.Lb0\n add.s\t$f6, $f12, $f14\n sub.s\t$f18, $f12, $f14\n lwc1\t$f4, 12($sp)\n jr\t$ra\n mul.s\t$f0, $f18, $f4\n add.s\t$f6, $f12, $f14\n.Lb0:\n lwc1\t$f8, 12($sp)\n jr\t$ra\n mul.s\t$f0, $f6, $f8\n.Lbc:\n mul.s\t$f0, $f12, $f10\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function check_percent_abs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `check_percent_abs` — benchmark function af:check_percent_abs:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:check_percent_abs:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg.s\t$f4,$f14\n 4:\tsw\ta2,8(sp)\n 8:\tc.le.s\t$f4,$f12\n c:\tsw\ta3,12(sp)\n 10:\tlwc1\t$f6,8(sp)\n 14:\tbc1fl\t3c \n 18:\tc.le.s\t$f6,$f12\n 1c:\tc.le.s\t$f12,$f14\n 20:\tnop\n 24:\tbc1fl\t3c \n 28:\tc.le.s\t$f6,$f12\n 2c:\tmtc1\tzero,$f0\n 30:\tjr\tra\n 34:\tnop\n 38:\tc.le.s\t$f6,$f12\n 3c:\tlui\tat,0x3f80\n 40:\tlwc1\t$f8,8(sp)\n 44:\tbc1fl\t5c \n 48:\tneg.s\t$f10,$f8\n 4c:\tmtc1\tat,$f0\n 50:\tjr\tra\n 54:\tnop\n 58:\tneg.s\t$f10,$f8\n 5c:\tlui\tat,0xbf80\n 60:\tc.le.s\t$f12,$f10\n 64:\tlw\tt6,16(sp)\n 68:\tbc1f\t7c \n 6c:\tnop\n 70:\tmtc1\tat,$f0\n 74:\tjr\tra\n 78:\tnop\n 7c:\tbeqz\tt6,bc \n 80:\tlwc1\t$f10,12(sp)\n 84:\tmtc1\tzero,$f16\n 88:\tnop\n 8c:\tc.lt.s\t$f16,$f12\n 90:\tnop\n 94:\tbc1fl\tb0 \n 98:\tadd.s\t$f6,$f12,$f14\n 9c:\tsub.s\t$f18,$f12,$f14\n a0:\tlwc1\t$f4,12(sp)\n a4:\tjr\tra\n a8:\tmul.s\t$f0,$f18,$f4\n ac:\tadd.s\t$f6,$f12,$f14\n b0:\tlwc1\t$f8,12(sp)\n b4:\tjr\tra\n b8:\tmul.s\t$f0,$f6,$f8\n bc:\tmul.s\t$f0,$f12,$f10\n c0:\tjr\tra\n c4:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c8 check_percent_abs\n\n\nContents of section .text:\n 0000 46007107 afa60008 460c203e afa7000c F.q.....F. >....\n 0010 c7a60008 45020009 460c303e 460e603e ....E...F.0>F.`>\n 0020 00000000 45020005 460c303e 44800000 ....E...F.0>D...\n 0030 03e00008 00000000 460c303e 3c013f80 ........F.0><.?.\n 0040 c7a80008 45020005 46004287 44810000 ....E...F.B.D...\n 0050 03e00008 00000000 46004287 3c01bf80 ........F.B.<...\n 0060 460a603e 8fae0010 45000004 00000000 F.`>....E.......\n 0070 44810000 03e00008 00000000 11c0000f D...............\n 0080 c7aa000c 44808000 00000000 460c803c ....D.......F..<\n 0090 00000000 45020006 460e6180 460e6481 ....E...F.a.F.d.\n 00a0 c7a4000c 03e00008 46049002 460e6180 ........F...F.a.\n 00b0 c7a8000c 03e00008 46083002 460a6002 ........F.0.F.`.\n 00c0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00040c2 00000000 . ........@.....\n 0010 000d5df3 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00040c2 00000000 000d5df3 00000000 ..@.......].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000032 00000018 00000248 p......2.......H\n 0010 00000005 000003b0 00000001 00000260 ...............`\n 0020 00000004 00000294 00000000 00000000 ................\n 0030 00000011 000002c4 0000003c 00000308 ...........<....\n 0040 00000014 00000344 00000001 00000358 .......D.......X\n 0050 00000000 00000000 00000001 000003a0 ................\n 0060 10f010f0 40d51220 1020d112 2010f030 ....@.. . .. ..0\n 0070 d1122070 a5132332 00000000 00000001 .. p..#2........\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000002 00000013 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000c8 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d636665 33636534 65663339 -ido-cfe3ce4ef39\n 0140 37396662 342f752e 69006368 65636b5f 79fb4/u.i.check_\n 0150 70657263 656e745f 61627300 63686563 percent_abs.chec\n 0160 6b5f7065 7263656e 745f6162 73000000 k_percent_abs...\n 0170 00000000 00000001 00000000 0000003c ...............<\n 0180 00000000 00000004 00000000 00000032 ...............2\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000018 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 00000000 ..... ..........\n 01d0 00000000 00000000 00000000 00000000 ................\n 01e0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name check_percent_abs # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `check_percent_abs` — benchmark function af:check_percent_abs:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:check_percent_abs:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg.s\t$f4,$f14\n 4:\tsw\ta2,8(sp)\n 8:\tc.le.s\t$f4,$f12\n c:\tsw\ta3,12(sp)\n 10:\tlwc1\t$f6,8(sp)\n 14:\tbc1fl\t3c \n 18:\tc.le.s\t$f6,$f12\n 1c:\tc.le.s\t$f12,$f14\n 20:\tnop\n 24:\tbc1fl\t3c \n 28:\tc.le.s\t$f6,$f12\n 2c:\tmtc1\tzero,$f0\n 30:\tjr\tra\n 34:\tnop\n 38:\tc.le.s\t$f6,$f12\n 3c:\tlui\tat,0x3f80\n 40:\tlwc1\t$f8,8(sp)\n 44:\tbc1fl\t5c \n 48:\tneg.s\t$f10,$f8\n 4c:\tmtc1\tat,$f0\n 50:\tjr\tra\n 54:\tnop\n 58:\tneg.s\t$f10,$f8\n 5c:\tlui\tat,0xbf80\n 60:\tc.le.s\t$f12,$f10\n 64:\tlw\tt6,16(sp)\n 68:\tbc1f\t7c \n 6c:\tnop\n 70:\tmtc1\tat,$f0\n 74:\tjr\tra\n 78:\tnop\n 7c:\tbeqz\tt6,bc \n 80:\tlwc1\t$f10,12(sp)\n 84:\tmtc1\tzero,$f16\n 88:\tnop\n 8c:\tc.lt.s\t$f16,$f12\n 90:\tnop\n 94:\tbc1fl\tb0 \n 98:\tadd.s\t$f6,$f12,$f14\n 9c:\tsub.s\t$f18,$f12,$f14\n a0:\tlwc1\t$f4,12(sp)\n a4:\tjr\tra\n a8:\tmul.s\t$f0,$f18,$f4\n ac:\tadd.s\t$f6,$f12,$f14\n b0:\tlwc1\t$f8,12(sp)\n b4:\tjr\tra\n b8:\tmul.s\t$f0,$f6,$f8\n bc:\tmul.s\t$f0,$f12,$f10\n c0:\tjr\tra\n c4:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c8 check_percent_abs\n\n\nContents of section .text:\n 0000 46007107 afa60008 460c203e afa7000c F.q.....F. >....\n 0010 c7a60008 45020009 460c303e 460e603e ....E...F.0>F.`>\n 0020 00000000 45020005 460c303e 44800000 ....E...F.0>D...\n 0030 03e00008 00000000 460c303e 3c013f80 ........F.0><.?.\n 0040 c7a80008 45020005 46004287 44810000 ....E...F.B.D...\n 0050 03e00008 00000000 46004287 3c01bf80 ........F.B.<...\n 0060 460a603e 8fae0010 45000004 00000000 F.`>....E.......\n 0070 44810000 03e00008 00000000 11c0000f D...............\n 0080 c7aa000c 44808000 00000000 460c803c ....D.......F..<\n 0090 00000000 45020006 460e6180 460e6481 ....E...F.a.F.d.\n 00a0 c7a4000c 03e00008 46049002 460e6180 ........F...F.a.\n 00b0 c7a8000c 03e00008 46083002 460a6002 ........F.0.F.`.\n 00c0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00040c2 00000000 . ........@.....\n 0010 000d5df3 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00040c2 00000000 000d5df3 00000000 ..@.......].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000032 00000018 00000248 p......2.......H\n 0010 00000005 000003b0 00000001 00000260 ...............`\n 0020 00000004 00000294 00000000 00000000 ................\n 0030 00000011 000002c4 0000003c 00000308 ...........<....\n 0040 00000014 00000344 00000001 00000358 .......D.......X\n 0050 00000000 00000000 00000001 000003a0 ................\n 0060 10f010f0 40d51220 1020d112 2010f030 ....@.. . .. ..0\n 0070 d1122070 a5132332 00000000 00000001 .. p..#2........\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000002 00000013 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000c8 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d636665 33636534 65663339 -ido-cfe3ce4ef39\n 0140 37396662 342f752e 69006368 65636b5f 79fb4/u.i.check_\n 0150 70657263 656e745f 61627300 63686563 percent_abs.chec\n 0160 6b5f7065 7263656e 745f6162 73000000 k_percent_abs...\n 0170 00000000 00000001 00000000 0000003c ...............<\n 0180 00000000 00000004 00000000 00000032 ...............2\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000018 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 00000000 ..... ..........\n 01d0 00000000 00000000 00000000 00000000 ................\n 01e0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name check_percent_abs # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -1020,7 +1020,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `get_percent` — benchmark function af:get_percent:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel get_percent\n lui\t$at, 0x3f80\n mtc1\t$at, $f14\n slt\t$at, $a2, $a1\n beqz\t$at, .L20\n mov.s\t$f2, $f14\n mtc1\t$zero, $f2\n jr\t$ra\n mov.s\t$f0, $f2\n.L20:\n slt\t$at, $a2, $a0\n beqz\t$at, .L70\n subu\t$t6, $a0, $a1\n mtc1\t$t6, $f4\n mtc1\t$zero, $f6\n subu\t$t7, $a2, $a1\n cvt.s.w\t$f0, $f4\n c.eq.s\t$f6, $f0\n nop\n bc1t\t.L70\n nop\n mtc1\t$t7, $f8\n nop\n cvt.s.w\t$f10, $f8\n div.s\t$f2, $f10, $f0\n c.lt.s\t$f14, $f2\n nop\n bc1f\t.L70\n nop\n mov.s\t$f2, $f14\n.L70:\n jr\t$ra\n mov.s\t$f0, $f2\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function get_percent # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `get_percent` — benchmark function af:get_percent:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:get_percent:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x3f80\n 4:\tmtc1\tat,$f14\n 8:\tslt\tat,a2,a1\n c:\tbeqz\tat,20 \n 10:\tmov.s\t$f2,$f14\n 14:\tmtc1\tzero,$f2\n 18:\tjr\tra\n 1c:\tmov.s\t$f0,$f2\n 20:\tslt\tat,a2,a0\n 24:\tbeqz\tat,70 \n 28:\tsubu\tt6,a0,a1\n 2c:\tmtc1\tt6,$f4\n 30:\tmtc1\tzero,$f6\n 34:\tsubu\tt7,a2,a1\n 38:\tcvt.s.w\t$f0,$f4\n 3c:\tc.eq.s\t$f6,$f0\n 40:\tnop\n 44:\tbc1t\t70 \n 48:\tnop\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f10,$f8\n 58:\tdiv.s\t$f2,$f10,$f0\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tnop\n 64:\tbc1f\t70 \n 68:\tnop\n 6c:\tmov.s\t$f2,$f14\n 70:\tjr\tra\n 74:\tmov.s\t$f0,$f2\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 get_percent\n\n\nContents of section .text:\n 0000 3c013f80 44817000 00c5082a 10200004 <.?.D.p....*. ..\n 0010 46007086 44801000 03e00008 46001006 F.p.D.......F...\n 0020 00c4082a 10200012 00857023 448e2000 ...*. ....p#D. .\n 0030 44803000 00c57823 46802020 46003032 D.0...x#F. F.02\n 0040 00000000 4501000a 00000000 448f4000 ....E.......D.@.\n 0050 00000000 468042a0 46005083 4602703c ....F.B.F.P.F.p<\n 0060 00000000 45000002 00000000 46007086 ....E.......F.p.\n 0070 03e00008 46001006 00000000 00000000 ....F...........\nContents of section .options:\n 0000 01200000 00000000 8000c072 00000000 . .........r....\n 0010 00004d5f 00000000 00000000 00007ff0 ..M_............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c072 00000000 00004d5f 00000000 ...r......M_....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000014 000001f8 p...............\n 0010 00000005 00000350 00000001 0000020c .......P........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000038 000002b4 .......p...8....\n 0040 0000000c 000002ec 00000001 000002f8 ................\n 0050 00000000 00000000 00000001 00000340 ...............@\n 0060 0141f020 81000a81 fff72210 f4131310 .A. ......\".....\n 0070 41000000 00000000 00000001 00000000 A...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000078 20200001 00000001 ...*...x ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d336439 33326462 34353639 64613436 -3d932db4569da46\n 0140 662f752e 69006765 745f7065 7263656e f/u.i.get_percen\n 0150 74000000 6765745f 70657263 656e7400 t...get_percent.\n 0160 00000000 00000001 00000000 00000036 ...............6\n 0170 00000000 00000004 00000000 0000001e ................\n 0180 00000000 00000000 00000001 00000000 ................\n 0190 00000011 00000000 00000000 01800000 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 00000000 18200001 00000000 00000000 ..... ..........\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name get_percent # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `get_percent` — benchmark function af:get_percent:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:get_percent:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x3f80\n 4:\tmtc1\tat,$f14\n 8:\tslt\tat,a2,a1\n c:\tbeqz\tat,20 \n 10:\tmov.s\t$f2,$f14\n 14:\tmtc1\tzero,$f2\n 18:\tjr\tra\n 1c:\tmov.s\t$f0,$f2\n 20:\tslt\tat,a2,a0\n 24:\tbeqz\tat,70 \n 28:\tsubu\tt6,a0,a1\n 2c:\tmtc1\tt6,$f4\n 30:\tmtc1\tzero,$f6\n 34:\tsubu\tt7,a2,a1\n 38:\tcvt.s.w\t$f0,$f4\n 3c:\tc.eq.s\t$f6,$f0\n 40:\tnop\n 44:\tbc1t\t70 \n 48:\tnop\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f10,$f8\n 58:\tdiv.s\t$f2,$f10,$f0\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tnop\n 64:\tbc1f\t70 \n 68:\tnop\n 6c:\tmov.s\t$f2,$f14\n 70:\tjr\tra\n 74:\tmov.s\t$f0,$f2\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 get_percent\n\n\nContents of section .text:\n 0000 3c013f80 44817000 00c5082a 10200004 <.?.D.p....*. ..\n 0010 46007086 44801000 03e00008 46001006 F.p.D.......F...\n 0020 00c4082a 10200012 00857023 448e2000 ...*. ....p#D. .\n 0030 44803000 00c57823 46802020 46003032 D.0...x#F. F.02\n 0040 00000000 4501000a 00000000 448f4000 ....E.......D.@.\n 0050 00000000 468042a0 46005083 4602703c ....F.B.F.P.F.p<\n 0060 00000000 45000002 00000000 46007086 ....E.......F.p.\n 0070 03e00008 46001006 00000000 00000000 ....F...........\nContents of section .options:\n 0000 01200000 00000000 8000c072 00000000 . .........r....\n 0010 00004d5f 00000000 00000000 00007ff0 ..M_............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c072 00000000 00004d5f 00000000 ...r......M_....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000014 000001f8 p...............\n 0010 00000005 00000350 00000001 0000020c .......P........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000038 000002b4 .......p...8....\n 0040 0000000c 000002ec 00000001 000002f8 ................\n 0050 00000000 00000000 00000001 00000340 ...............@\n 0060 0141f020 81000a81 fff72210 f4131310 .A. ......\".....\n 0070 41000000 00000000 00000001 00000000 A...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000078 20200001 00000001 ...*...x ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d336439 33326462 34353639 64613436 -3d932db4569da46\n 0140 662f752e 69006765 745f7065 7263656e f/u.i.get_percen\n 0150 74000000 6765745f 70657263 656e7400 t...get_percent.\n 0160 00000000 00000001 00000000 00000036 ...............6\n 0170 00000000 00000004 00000000 0000001e ................\n 0180 00000000 00000000 00000001 00000000 ................\n 0190 00000011 00000000 00000000 01800000 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 00000000 18200001 00000000 00000000 ..... ..........\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name get_percent # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -1095,7 +1095,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `gfxopen` — benchmark function af:gfxopen:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel gfxopen\n jr\t$ra\n addiu\t$v0, $a0, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function gfxopen # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `gfxopen` — benchmark function af:gfxopen:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:gfxopen:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddiu\tv0,a0,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 gfxopen\n\n\nContents of section .text:\n 0000 03e00008 24820008 00000000 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 11000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000008 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d636633 31393232 62396531 63623137 -cf31922b9e1cb17\n 0130 652f752e 69006766 786f7065 6e000000 e/u.i.gfxopen...\n 0140 6766786f 70656e00 00000000 00000001 gfxopen.........\n 0150 00000000 00000032 00000000 00000004 .......2........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name gfxopen # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `gfxopen` — benchmark function af:gfxopen:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:gfxopen:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddiu\tv0,a0,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 gfxopen\n\n\nContents of section .text:\n 0000 03e00008 24820008 00000000 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 11000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000008 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d636633 31393232 62396531 63623137 -cf31922b9e1cb17\n 0130 652f752e 69006766 786f7065 6e000000 e/u.i.gfxopen...\n 0140 6766786f 70656e00 00000000 00000001 gfxopen.........\n 0150 00000000 00000032 00000000 00000004 .......2........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name gfxopen # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -1177,7 +1177,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `inter_float` — benchmark function af:inter_float:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel inter_float\n mtc1\t$a1, $f12\n bgtzl\t$a2, .L18\n mtc1\t$a2, $f4\n jr\t$ra\n swc1\t$f12, 0($a0)\n mtc1\t$a2, $f4\n.L18:\n lwc1\t$f2, 0($a0)\n cvt.s.w\t$f6, $f4\n sub.s\t$f0, $f12, $f2\n div.s\t$f8, $f0, $f6\n add.s\t$f10, $f2, $f8\n swc1\t$f10, 0($a0)\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function inter_float # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `inter_float` — benchmark function af:inter_float:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:inter_float:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tbgtzl\ta2,18 \n 8:\tmtc1\ta2,$f4\n c:\tjr\tra\n 10:\tswc1\t$f12,0(a0)\n 14:\tmtc1\ta2,$f4\n 18:\tlwc1\t$f2,0(a0)\n 1c:\tcvt.s.w\t$f6,$f4\n 20:\tsub.s\t$f0,$f12,$f2\n 24:\tdiv.s\t$f8,$f0,$f6\n 28:\tadd.s\t$f10,$f2,$f8\n 2c:\tswc1\t$f10,0(a0)\n 30:\tjr\tra\n 34:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000038 inter_float\n\n\nContents of section .text:\n 0000 44856000 5cc00004 44862000 03e00008 D.`.\\...D. .....\n 0010 e48c0000 44862000 c4820000 468021a0 ....D. .....F.!.\n 0020 46026001 46060203 46081280 e48a0000 F.`.F...F.......\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00001fd7 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00001fd7 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000e 0000000c 000001b8 p...............\n 0010 00000005 00000308 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000038 0000026c .......(...8...l\n 0040 0000000c 000002a4 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 00111130 f010f012 21000000 00000000 ...0....!.......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 00000038 ..... .....*...8\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d646434 38643136 real-ido-dd48d16\n 0130 36626162 37663466 362f752e 6900696e 6bab7f4f6/u.i.in\n 0140 7465725f 666c6f61 74000000 696e7465 ter_float...inte\n 0150 725f666c 6f617400 00000000 00000001 r_float.........\n 0160 00000000 00000036 00000000 00000004 .......6........\n 0170 00000000 0000000e 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000009 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name inter_float # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `inter_float` — benchmark function af:inter_float:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:inter_float:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tbgtzl\ta2,18 \n 8:\tmtc1\ta2,$f4\n c:\tjr\tra\n 10:\tswc1\t$f12,0(a0)\n 14:\tmtc1\ta2,$f4\n 18:\tlwc1\t$f2,0(a0)\n 1c:\tcvt.s.w\t$f6,$f4\n 20:\tsub.s\t$f0,$f12,$f2\n 24:\tdiv.s\t$f8,$f0,$f6\n 28:\tadd.s\t$f10,$f2,$f8\n 2c:\tswc1\t$f10,0(a0)\n 30:\tjr\tra\n 34:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000038 inter_float\n\n\nContents of section .text:\n 0000 44856000 5cc00004 44862000 03e00008 D.`.\\...D. .....\n 0010 e48c0000 44862000 c4820000 468021a0 ....D. .....F.!.\n 0020 46026001 46060203 46081280 e48a0000 F.`.F...F.......\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00001fd7 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00001fd7 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000e 0000000c 000001b8 p...............\n 0010 00000005 00000308 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000038 0000026c .......(...8...l\n 0040 0000000c 000002a4 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 00111130 f010f012 21000000 00000000 ...0....!.......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 00000038 ..... .....*...8\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d646434 38643136 real-ido-dd48d16\n 0130 36626162 37663466 362f752e 6900696e 6bab7f4f6/u.i.in\n 0140 7465725f 666c6f61 74000000 696e7465 ter_float...inte\n 0150 725f666c 6f617400 00000000 00000001 r_float.........\n 0160 00000000 00000036 00000000 00000004 .......6........\n 0170 00000000 0000000e 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000009 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name inter_float # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -1266,7 +1266,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `lbRk_IsKyuurekiLeapYear` — benchmark function af:lbRk_IsKyuurekiLeapYear:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_IsKyuurekiLeapYear\n sll\t$t6, $a0, 0x2\n lui\t$t7, %hi(l_lbRk_leapdays)\n addu\t$t7, $t7, $t6\n lw\t$t7, %lo(l_lbRk_leapdays)($t7)\n move\t$v0, $zero\n beqz\t$t7, .L24\n nop\n jr\t$ra\n li\t$v0, 1\n.L24:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-a9b48a7c4c9b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 lbRk_IsKyuurekiLeapYear(s32 year);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_IsKyuurekiLeapYear # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_IsKyuurekiLeapYear` — benchmark function af:lbRk_IsKyuurekiLeapYear:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_IsKyuurekiLeapYear:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a0,0x2\n 4:\tlui\tt7,0x0\n 8:\taddu\tt7,t7,t6\n c:\tlw\tt7,-8000(t7)\n 10:\tmove\tv0,zero\n 14:\tbeqz\tt7,24 \n 18:\tnop\n 1c:\tjr\tra\n 20:\tli\tv0,1\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c lbRk_IsKyuurekiLeapYear\n00000000 O *UND*\t00000084 l_lbRk_leapdays\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 l_lbRk_leapdays\n0000000c R_MIPS_LO16 l_lbRk_leapdays\n\n\nContents of section .text:\n 0000 00047080 3c0f0000 01ee7821 8defe0c0 ..p.<.....x!....\n 0010 00001025 11e00003 00000000 03e00008 ...%............\n 0020 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000008 000001e8 p...............\n 0010 00000006 0000036c 00000001 000001f0 .......l........\n 0020 00000004 00000224 00000000 00000000 .......$........\n 0030 00000011 00000254 00000044 00000298 .......T...D....\n 0040 00000028 000002dc 00000001 00000304 ...(............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 1330d111 21000000 00000000 00000001 .0..!...........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000002c 20200001 . .....*..., ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d356135 31643436 34373565 -ido-5a51d46475e\n 0130 33623231 342f752e 69006c62 526b5f49 3b214/u.i.lbRk_I\n 0140 734b7975 7572656b 694c6561 70596561 sKyuurekiLeapYea\n 0150 72000000 6c62526b 5f49734b 79757572 r...lbRk_IsKyuur\n 0160 656b694c 65617059 65617200 6c5f6c62 ekiLeapYear.l_lb\n 0170 526b5f6c 65617064 61797300 00000000 Rk_leapdays.....\n 0180 00000001 00000000 00000042 00000000 ...........B....\n 0190 00000004 00000000 0000000b 00000000 ................\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 00000005 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000018 00000000 . ..............\n 01e0 04cfffff 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 7fffffff ................\n 0200 00000000 7fffffff 00000001 00000000 ................\n 0210 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_IsKyuurekiLeapYear # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_IsKyuurekiLeapYear` — benchmark function af:lbRk_IsKyuurekiLeapYear:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_IsKyuurekiLeapYear:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a0,0x2\n 4:\tlui\tt7,0x0\n 8:\taddu\tt7,t7,t6\n c:\tlw\tt7,-8000(t7)\n 10:\tmove\tv0,zero\n 14:\tbeqz\tt7,24 \n 18:\tnop\n 1c:\tjr\tra\n 20:\tli\tv0,1\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c lbRk_IsKyuurekiLeapYear\n00000000 O *UND*\t00000084 l_lbRk_leapdays\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 l_lbRk_leapdays\n0000000c R_MIPS_LO16 l_lbRk_leapdays\n\n\nContents of section .text:\n 0000 00047080 3c0f0000 01ee7821 8defe0c0 ..p.<.....x!....\n 0010 00001025 11e00003 00000000 03e00008 ...%............\n 0020 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000008 000001e8 p...............\n 0010 00000006 0000036c 00000001 000001f0 .......l........\n 0020 00000004 00000224 00000000 00000000 .......$........\n 0030 00000011 00000254 00000044 00000298 .......T...D....\n 0040 00000028 000002dc 00000001 00000304 ...(............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 1330d111 21000000 00000000 00000001 .0..!...........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000002c 20200001 . .....*..., ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d356135 31643436 34373565 -ido-5a51d46475e\n 0130 33623231 342f752e 69006c62 526b5f49 3b214/u.i.lbRk_I\n 0140 734b7975 7572656b 694c6561 70596561 sKyuurekiLeapYea\n 0150 72000000 6c62526b 5f49734b 79757572 r...lbRk_IsKyuur\n 0160 656b694c 65617059 65617200 6c5f6c62 ekiLeapYear.l_lb\n 0170 526b5f6c 65617064 61797300 00000000 Rk_leapdays.....\n 0180 00000001 00000000 00000042 00000000 ...........B....\n 0190 00000004 00000000 0000000b 00000000 ................\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 00000005 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000018 00000000 . ..............\n 01e0 04cfffff 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 7fffffff ................\n 0200 00000000 7fffffff 00000001 00000000 ................\n 0210 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_IsKyuurekiLeapYear # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -1341,7 +1341,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `lbRk_IsLeapMonth` — benchmark function af:lbRk_IsLeapMonth:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_IsLeapMonth\n li\t$at, 13\n bne\t$a0, $at, .L14\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_IsLeapMonth # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_IsLeapMonth` — benchmark function af:lbRk_IsLeapMonth:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_IsLeapMonth:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,13\n 4:\tbne\ta0,at,14 \n 8:\tmove\tv0,zero\n c:\tjr\tra\n 10:\tli\tv0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c lbRk_IsLeapMonth\n\n\nContents of section .text:\n 0000 2401000d 14810003 00001025 03e00008 $..........%....\n 0010 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000198 p...............\n 0010 00000005 000002ec 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 0000003c 00000244 ...........<...D\n 0040 00000014 00000280 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1130e121 00000000 00000001 00000000 .0.!............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 0000001c 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d626639 33623861 30623438 66396139 -bf93b8a0b48f9a9\n 0130 612f752e 69006c62 526b5f49 734c6561 a/u.i.lbRk_IsLea\n 0140 704d6f6e 74680000 6c62526b 5f49734c pMonth..lbRk_IsL\n 0150 6561704d 6f6e7468 00000000 00000000 eapMonth........\n 0160 00000001 00000000 0000003b 00000000 ...........;....\n 0170 00000004 00000000 00000007 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000004 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_IsLeapMonth # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_IsLeapMonth` — benchmark function af:lbRk_IsLeapMonth:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_IsLeapMonth:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,13\n 4:\tbne\ta0,at,14 \n 8:\tmove\tv0,zero\n c:\tjr\tra\n 10:\tli\tv0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c lbRk_IsLeapMonth\n\n\nContents of section .text:\n 0000 2401000d 14810003 00001025 03e00008 $..........%....\n 0010 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000198 p...............\n 0010 00000005 000002ec 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 0000003c 00000244 ...........<...D\n 0040 00000014 00000280 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1130e121 00000000 00000001 00000000 .0.!............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 0000001c 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d626639 33623861 30623438 66396139 -bf93b8a0b48f9a9\n 0130 612f752e 69006c62 526b5f49 734c6561 a/u.i.lbRk_IsLea\n 0140 704d6f6e 74680000 6c62526b 5f49734c pMonth..lbRk_IsL\n 0150 6561704d 6f6e7468 00000000 00000000 eapMonth........\n 0160 00000001 00000000 0000003b 00000000 ...........;....\n 0170 00000004 00000000 00000007 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000004 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_IsLeapMonth # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -1412,7 +1412,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `lbRk_SeirekiDays` — benchmark function af:lbRk_SeirekiDays:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_SeirekiDays\n andi\t$t6, $a0, 0x3\n bnez\t$t6, .L10\n move\t$v1, $zero\n li\t$v1, 1\n.L10:\n sll\t$t7, $v1, 0x2\n subu\t$t7, $t7, $v1\n sll\t$t7, $t7, 0x2\n addu\t$t7, $t7, $v1\n addu\t$t8, $t7, $a1\n lui\t$v0, %hi(t_seiyo_days_tbl)\n addu\t$v0, $v0, $t8\n jr\t$ra\n lbu\t$v0, %lo(t_seiyo_days_tbl)($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-8aa31dab04e4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 lbRk_SeirekiDays(s32 year, s32 month);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_SeirekiDays # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_SeirekiDays` — benchmark function af:lbRk_SeirekiDays:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_SeirekiDays:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\tt6,a0,0x3\n 4:\tbnez\tt6,10 \n 8:\tmove\tv1,zero\n c:\tli\tv1,1\n 10:\tsll\tt7,v1,0x2\n 14:\tsubu\tt7,t7,v1\n 18:\tsll\tt7,t7,0x2\n 1c:\taddu\tt7,t7,v1\n 20:\taddu\tt8,t7,a1\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t8\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 lbRk_SeirekiDays\n00000000 O *UND*\t0000001a t_seiyo_days_tbl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 t_seiyo_days_tbl\n00000030 R_MIPS_LO16 t_seiyo_days_tbl\n\n\nContents of section .text:\n 0000 308e0003 15c00002 00001825 24030001 0..........%$...\n 0010 00037880 01e37823 000f7880 01e37821 ..x...x#..x...x!\n 0020 01e5c021 3c020000 00581021 03e00008 ...!<....X.!....\n 0030 90420000 00000000 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 8100c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001f8 p...............\n 0010 00000006 0000036c 00000001 000001fc .......l........\n 0020 00000004 00000230 00000000 00000000 .......0........\n 0030 00000011 00000260 0000003c 000002a4 .......`...<....\n 0040 00000024 000002e0 00000001 00000304 ...$............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 21f02028 00000000 00000001 00000000 !. (............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000009 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000034 20200001 00000001 ...*...4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363334 39303562 35613031 64633739 -634905b5a01dc79\n 0130 652f752e 69006c62 526b5f53 65697265 e/u.i.lbRk_Seire\n 0140 6b694461 79730000 6c62526b 5f536569 kiDays..lbRk_Sei\n 0150 72656b69 44617973 00745f73 6569796f rekiDays.t_seiyo\n 0160 5f646179 735f7462 6c000000 00000000 _days_tbl.......\n 0170 00000001 00000000 0000003b 00000000 ...........;....\n 0180 00000004 00000000 0000000d 00000000 ................\n 0190 00000000 00000001 00000000 00000011 ................\n 01a0 00000000 00000000 01800000 00000000 ................\n 01b0 00000004 00000000 00000000 00000000 ................\n 01c0 18200001 00000000 00000011 00000000 . ..............\n 01d0 04cfffff 00000000 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 7fffffff 00000001 00000000 ................\n 0200 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_SeirekiDays # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_SeirekiDays` — benchmark function af:lbRk_SeirekiDays:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_SeirekiDays:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\tt6,a0,0x3\n 4:\tbnez\tt6,10 \n 8:\tmove\tv1,zero\n c:\tli\tv1,1\n 10:\tsll\tt7,v1,0x2\n 14:\tsubu\tt7,t7,v1\n 18:\tsll\tt7,t7,0x2\n 1c:\taddu\tt7,t7,v1\n 20:\taddu\tt8,t7,a1\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t8\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 lbRk_SeirekiDays\n00000000 O *UND*\t0000001a t_seiyo_days_tbl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 t_seiyo_days_tbl\n00000030 R_MIPS_LO16 t_seiyo_days_tbl\n\n\nContents of section .text:\n 0000 308e0003 15c00002 00001825 24030001 0..........%$...\n 0010 00037880 01e37823 000f7880 01e37821 ..x...x#..x...x!\n 0020 01e5c021 3c020000 00581021 03e00008 ...!<....X.!....\n 0030 90420000 00000000 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 8100c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001f8 p...............\n 0010 00000006 0000036c 00000001 000001fc .......l........\n 0020 00000004 00000230 00000000 00000000 .......0........\n 0030 00000011 00000260 0000003c 000002a4 .......`...<....\n 0040 00000024 000002e0 00000001 00000304 ...$............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 21f02028 00000000 00000001 00000000 !. (............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000009 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000034 20200001 00000001 ...*...4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363334 39303562 35613031 64633739 -634905b5a01dc79\n 0130 652f752e 69006c62 526b5f53 65697265 e/u.i.lbRk_Seire\n 0140 6b694461 79730000 6c62526b 5f536569 kiDays..lbRk_Sei\n 0150 72656b69 44617973 00745f73 6569796f rekiDays.t_seiyo\n 0160 5f646179 735f7462 6c000000 00000000 _days_tbl.......\n 0170 00000001 00000000 0000003b 00000000 ...........;....\n 0180 00000004 00000000 0000000d 00000000 ................\n 0190 00000000 00000001 00000000 00000011 ................\n 01a0 00000000 00000000 01800000 00000000 ................\n 01b0 00000004 00000000 00000000 00000000 ................\n 01c0 18200001 00000000 00000011 00000000 . ..............\n 01d0 04cfffff 00000000 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 7fffffff 00000001 00000000 ................\n 0200 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_SeirekiDays # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -1494,7 +1494,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `limiter` — benchmark function af:limiter:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel limiter\n mtc1\t$zero, $f4\n nop\n c.lt.s\t$f12, $f4\n nop\n bc1fl\t.L44\n c.lt.s\t$f14, $f12\n neg.s\t$f0, $f14\n c.lt.s\t$f12, $f0\n nop\n bc1fl\t.L38\n mov.s\t$f2, $f12\n jr\t$ra\n nop\n mov.s\t$f2, $f12\n.L38:\n jr\t$ra\n mov.s\t$f0, $f2\n c.lt.s\t$f14, $f12\n.L44:\n nop\n bc1fl\t.L5c\n mov.s\t$f2, $f12\n b\t.L5c\n mov.s\t$f2, $f14\n mov.s\t$f2, $f12\n.L5c:\n mov.s\t$f0, $f2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function limiter # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `limiter` — benchmark function af:limiter:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:limiter:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f14,$f12\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f12,$f0\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f14,$f12\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 limiter\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460c703c 46007007 4600603c E...F.p&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f14,$f12\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f12,$f0\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f14,$f12\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 limiter\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460c703c 46007007 4600603c E...F.p in.s <<'ASM_INPUT'\nglabel ListAlloc_Init\n sw\t$zero, 0($a0)\n sw\t$zero, 4($a0)\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ListAlloc_Init # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ListAlloc_Init` — benchmark function af:ListAlloc_Init:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:ListAlloc_Init:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,0(a0)\n 4:\tsw\tzero,4(a0)\n 8:\tjr\tra\n c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ListAlloc_Init\n\n\nContents of section .text:\n 0000 ac800000 ac800004 03e00008 00801025 ...............%\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000188 p...............\n 0010 00000005 000002d8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 0000003c 00000234 ...........<...4\n 0040 00000010 00000270 00000001 00000280 .......p........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 10101100 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000007 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000010 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d613563 33653965 64653539 61393439 -a5c3e9ede59a949\n 0130 382f752e 69004c69 7374416c 6c6f635f 8/u.i.ListAlloc_\n 0140 496e6974 00000000 4c697374 416c6c6f Init....ListAllo\n 0150 635f496e 69740000 00000000 00000001 c_Init..........\n 0160 00000000 00000039 00000000 00000004 .......9........\n 0170 00000000 00000004 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000003 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ListAlloc_Init # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ListAlloc_Init` — benchmark function af:ListAlloc_Init:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:ListAlloc_Init:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,0(a0)\n 4:\tsw\tzero,4(a0)\n 8:\tjr\tra\n c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ListAlloc_Init\n\n\nContents of section .text:\n 0000 ac800000 ac800004 03e00008 00801025 ...............%\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000188 p...............\n 0010 00000005 000002d8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 0000003c 00000234 ...........<...4\n 0040 00000010 00000270 00000001 00000280 .......p........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 10101100 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000007 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000010 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d613563 33653965 64653539 61393439 -a5c3e9ede59a949\n 0130 382f752e 69004c69 7374416c 6c6f635f 8/u.i.ListAlloc_\n 0140 496e6974 00000000 4c697374 416c6c6f Init....ListAllo\n 0150 635f496e 69740000 00000000 00000001 c_Init..........\n 0160 00000000 00000039 00000000 00000004 .......9........\n 0170 00000000 00000004 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000003 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ListAlloc_Init # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -1642,7 +1642,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `mem_clear` — benchmark function af:mem_clear:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_clear\n sw\t$a2, 8($sp)\n andi\t$a2, $a2, 0xff\n beqz\t$a1, .L4c\n move\t$v0, $zero\n andi\t$a3, $a1, 0x3\n beqz\t$a3, .L30\n move\t$v1, $a3\n.L1c:\n addiu\t$v0, $v0, 1\n sb\t$a2, 0($a0)\n bne\t$v1, $v0, .L1c\n addiu\t$a0, $a0, 1\n beq\t$v0, $a1, .L4c\n.L30:\n addiu\t$v0, $v0, 4\n sb\t$a2, 0($a0)\n sb\t$a2, 1($a0)\n sb\t$a2, 2($a0)\n sb\t$a2, 3($a0)\n bne\t$v0, $a1, .L30\n addiu\t$a0, $a0, 4\n.L4c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_clear # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `mem_clear` — benchmark function af:mem_clear:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_clear:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tandi\ta2,a2,0xff\n 8:\tbeqz\ta1,4c \n c:\tmove\tv0,zero\n 10:\tandi\ta3,a1,0x3\n 14:\tbeqz\ta3,30 \n 18:\tmove\tv1,a3\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\ta2,0(a0)\n 24:\tbne\tv1,v0,1c \n 28:\taddiu\ta0,a0,1\n 2c:\tbeq\tv0,a1,4c \n 30:\taddiu\tv0,v0,4\n 34:\tsb\ta2,0(a0)\n 38:\tsb\ta2,1(a0)\n 3c:\tsb\ta2,2(a0)\n 40:\tsb\ta2,3(a0)\n 44:\tbne\tv0,a1,30 \n 48:\taddiu\ta0,a0,4\n 4c:\tjr\tra\n 50:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000054 mem_clear\n\n\nContents of section .text:\n 0000 afa60008 30c600ff 10a00010 00001025 ....0..........%\n 0010 30a70003 10e00006 00e01825 24420001 0..........%$B..\n 0020 a0860000 1462fffd 24840001 10450007 .....b..$....E..\n 0030 24420004 a0860000 a0860001 a0860002 $B..............\n 0040 a0860003 1445fffa 24840004 03e00008 .....E..$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000015 00000004 000001c8 p...............\n 0010 00000005 0000030c 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 0000000c 000002a8 00000001 000002b4 ................\n 0050 00000000 00000000 00000001 000002fc ................\n 0060 01280711 00000000 00000001 00000000 .(..............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000054 20200001 00000001 ...*...T ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363563 30383663 32383062 37393133 -65c086c280b7913\n 0130 312f752e 69006d65 6d5f636c 65617200 1/u.i.mem_clear.\n 0140 6d656d5f 636c6561 72000000 00000000 mem_clear.......\n 0150 00000001 00000000 00000034 00000000 ...........4....\n 0160 00000004 00000000 00000015 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000004 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"mem_clear\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_clear # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `mem_clear` — benchmark function af:mem_clear:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_clear:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tandi\ta2,a2,0xff\n 8:\tbeqz\ta1,4c \n c:\tmove\tv0,zero\n 10:\tandi\ta3,a1,0x3\n 14:\tbeqz\ta3,30 \n 18:\tmove\tv1,a3\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\ta2,0(a0)\n 24:\tbne\tv1,v0,1c \n 28:\taddiu\ta0,a0,1\n 2c:\tbeq\tv0,a1,4c \n 30:\taddiu\tv0,v0,4\n 34:\tsb\ta2,0(a0)\n 38:\tsb\ta2,1(a0)\n 3c:\tsb\ta2,2(a0)\n 40:\tsb\ta2,3(a0)\n 44:\tbne\tv0,a1,30 \n 48:\taddiu\ta0,a0,4\n 4c:\tjr\tra\n 50:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000054 mem_clear\n\n\nContents of section .text:\n 0000 afa60008 30c600ff 10a00010 00001025 ....0..........%\n 0010 30a70003 10e00006 00e01825 24420001 0..........%$B..\n 0020 a0860000 1462fffd 24840001 10450007 .....b..$....E..\n 0030 24420004 a0860000 a0860001 a0860002 $B..............\n 0040 a0860003 1445fffa 24840004 03e00008 .....E..$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000015 00000004 000001c8 p...............\n 0010 00000005 0000030c 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 0000000c 000002a8 00000001 000002b4 ................\n 0050 00000000 00000000 00000001 000002fc ................\n 0060 01280711 00000000 00000001 00000000 .(..............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000054 20200001 00000001 ...*...T ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363563 30383663 32383062 37393133 -65c086c280b7913\n 0130 312f752e 69006d65 6d5f636c 65617200 1/u.i.mem_clear.\n 0140 6d656d5f 636c6561 72000000 00000000 mem_clear.......\n 0150 00000001 00000000 00000034 00000000 ...........4....\n 0160 00000004 00000000 00000015 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000004 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"mem_clear\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_clear # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -1712,7 +1712,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `mem_cmp` — benchmark function af:mem_cmp:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_cmp\n beqz\t$a2, .Lc8\n andi\t$v1, $a2, 0x3\n negu\t$v1, $v1\n beqz\t$v1, .L44\n addu\t$v0, $v1, $a2\n.L14:\n lbu\t$t6, 0($a0)\n lbu\t$t7, 0($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a2, $a2, -1\n beq\t$t6, $t7, .L34\n nop\n jr\t$ra\n move\t$v0, $zero\n.L34:\n bne\t$v0, $a2, .L14\n addiu\t$a1, $a1, 1\n beqzl\t$a2, .Lcc\n li\t$v0, 1\n.L44:\n lbu\t$t8, 0($a0)\n lbu\t$t9, 0($a1)\n addiu\t$a2, $a2, -4\n beql\t$t8, $t9, .L64\n lbu\t$t0, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t0, 1($a0)\n.L64:\n lbu\t$t1, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a1, $a1, 1\n beql\t$t0, $t1, .L84\n lbu\t$t2, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t2, 1($a0)\n.L84:\n lbu\t$t3, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a1, $a1, 1\n beql\t$t2, $t3, .La4\n lbu\t$t4, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t4, 1($a0)\n.La4:\n lbu\t$t5, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a0, $a0, 1\n beq\t$t4, $t5, .Lc0\n addiu\t$a1, $a1, 1\n jr\t$ra\n move\t$v0, $zero\n.Lc0:\n bnez\t$a2, .L44\n addiu\t$a1, $a1, 1\n.Lc8:\n li\t$v0, 1\n.Lcc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_cmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `mem_cmp` — benchmark function af:mem_cmp:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_cmp:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,c8 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,44 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a0)\n 18:\tlbu\tt7,0(a1)\n 1c:\taddiu\ta0,a0,1\n 20:\taddiu\ta2,a2,-1\n 24:\tbeq\tt6,t7,34 \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,zero\n 34:\tbne\tv0,a2,14 \n 38:\taddiu\ta1,a1,1\n 3c:\tbeqzl\ta2,cc \n 40:\tli\tv0,1\n 44:\tlbu\tt8,0(a0)\n 48:\tlbu\tt9,0(a1)\n 4c:\taddiu\ta2,a2,-4\n 50:\tbeql\tt8,t9,64 \n 54:\tlbu\tt0,1(a0)\n 58:\tjr\tra\n 5c:\tmove\tv0,zero\n 60:\tlbu\tt0,1(a0)\n 64:\tlbu\tt1,1(a1)\n 68:\taddiu\ta0,a0,1\n 6c:\taddiu\ta1,a1,1\n 70:\tbeql\tt0,t1,84 \n 74:\tlbu\tt2,1(a0)\n 78:\tjr\tra\n 7c:\tmove\tv0,zero\n 80:\tlbu\tt2,1(a0)\n 84:\tlbu\tt3,1(a1)\n 88:\taddiu\ta0,a0,1\n 8c:\taddiu\ta1,a1,1\n 90:\tbeql\tt2,t3,a4 \n 94:\tlbu\tt4,1(a0)\n 98:\tjr\tra\n 9c:\tmove\tv0,zero\n a0:\tlbu\tt4,1(a0)\n a4:\tlbu\tt5,1(a1)\n a8:\taddiu\ta0,a0,1\n ac:\taddiu\ta0,a0,1\n b0:\tbeq\tt4,t5,c0 \n b4:\taddiu\ta1,a1,1\n b8:\tjr\tra\n bc:\tmove\tv0,zero\n c0:\tbnez\ta2,44 \n c4:\taddiu\ta1,a1,1\n c8:\tli\tv0,1\n cc:\tjr\tra\n d0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000e0 .text\n00000000 g F .text\t000000d4 mem_cmp\n\n\nContents of section .text:\n 0000 10c00031 30c30003 00031823 1060000d ...10......#.`..\n 0010 00661021 908e0000 90af0000 24840001 .f.!........$...\n 0020 24c6ffff 11cf0003 00000000 03e00008 $...............\n 0030 00001025 1446fff7 24a50001 50c00023 ...%.F..$...P..#\n 0040 24020001 90980000 90b90000 24c6fffc $...........$...\n 0050 53190004 90880001 03e00008 00001025 S..............%\n 0060 90880001 90a90001 24840001 24a50001 ........$...$...\n 0070 51090004 908a0001 03e00008 00001025 Q..............%\n 0080 908a0001 90ab0001 24840001 24a50001 ........$...$...\n 0090 514b0004 908c0001 03e00008 00001025 QK.............%\n 00a0 908c0001 90ad0001 24840001 24840001 ........$...$...\n 00b0 118d0003 24a50001 03e00008 00001025 ....$..........%\n 00c0 14c0ffe0 24a50001 24020001 03e00008 ....$...$.......\n 00d0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300ff7c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300ff7c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000035 00000010 00000248 p......5.......H\n 0010 00000005 00000394 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 00000008 00000334 00000001 0000033c .......4.......<\n 0050 00000000 00000000 00000001 00000384 ................\n 0060 180711f0 1111e140 10b80803 82000800 .......@........\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000003 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000d4 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d343330 nch-real-ido-430\n 0130 33663032 61306666 39666434 302f752e 3f02a0ff9fd40/u.\n 0140 69006d65 6d5f636d 70000000 6d656d5f i.mem_cmp...mem_\n 0150 636d7000 00000000 00000001 00000000 cmp.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000035 00000000 00000000 00000001 ...5............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000f 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_cmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `mem_cmp` — benchmark function af:mem_cmp:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_cmp:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,c8 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,44 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a0)\n 18:\tlbu\tt7,0(a1)\n 1c:\taddiu\ta0,a0,1\n 20:\taddiu\ta2,a2,-1\n 24:\tbeq\tt6,t7,34 \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,zero\n 34:\tbne\tv0,a2,14 \n 38:\taddiu\ta1,a1,1\n 3c:\tbeqzl\ta2,cc \n 40:\tli\tv0,1\n 44:\tlbu\tt8,0(a0)\n 48:\tlbu\tt9,0(a1)\n 4c:\taddiu\ta2,a2,-4\n 50:\tbeql\tt8,t9,64 \n 54:\tlbu\tt0,1(a0)\n 58:\tjr\tra\n 5c:\tmove\tv0,zero\n 60:\tlbu\tt0,1(a0)\n 64:\tlbu\tt1,1(a1)\n 68:\taddiu\ta0,a0,1\n 6c:\taddiu\ta1,a1,1\n 70:\tbeql\tt0,t1,84 \n 74:\tlbu\tt2,1(a0)\n 78:\tjr\tra\n 7c:\tmove\tv0,zero\n 80:\tlbu\tt2,1(a0)\n 84:\tlbu\tt3,1(a1)\n 88:\taddiu\ta0,a0,1\n 8c:\taddiu\ta1,a1,1\n 90:\tbeql\tt2,t3,a4 \n 94:\tlbu\tt4,1(a0)\n 98:\tjr\tra\n 9c:\tmove\tv0,zero\n a0:\tlbu\tt4,1(a0)\n a4:\tlbu\tt5,1(a1)\n a8:\taddiu\ta0,a0,1\n ac:\taddiu\ta0,a0,1\n b0:\tbeq\tt4,t5,c0 \n b4:\taddiu\ta1,a1,1\n b8:\tjr\tra\n bc:\tmove\tv0,zero\n c0:\tbnez\ta2,44 \n c4:\taddiu\ta1,a1,1\n c8:\tli\tv0,1\n cc:\tjr\tra\n d0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000e0 .text\n00000000 g F .text\t000000d4 mem_cmp\n\n\nContents of section .text:\n 0000 10c00031 30c30003 00031823 1060000d ...10......#.`..\n 0010 00661021 908e0000 90af0000 24840001 .f.!........$...\n 0020 24c6ffff 11cf0003 00000000 03e00008 $...............\n 0030 00001025 1446fff7 24a50001 50c00023 ...%.F..$...P..#\n 0040 24020001 90980000 90b90000 24c6fffc $...........$...\n 0050 53190004 90880001 03e00008 00001025 S..............%\n 0060 90880001 90a90001 24840001 24a50001 ........$...$...\n 0070 51090004 908a0001 03e00008 00001025 Q..............%\n 0080 908a0001 90ab0001 24840001 24a50001 ........$...$...\n 0090 514b0004 908c0001 03e00008 00001025 QK.............%\n 00a0 908c0001 90ad0001 24840001 24840001 ........$...$...\n 00b0 118d0003 24a50001 03e00008 00001025 ....$..........%\n 00c0 14c0ffe0 24a50001 24020001 03e00008 ....$...$.......\n 00d0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300ff7c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300ff7c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000035 00000010 00000248 p......5.......H\n 0010 00000005 00000394 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 00000008 00000334 00000001 0000033c .......4.......<\n 0050 00000000 00000000 00000001 00000384 ................\n 0060 180711f0 1111e140 10b80803 82000800 .......@........\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000003 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000d4 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d343330 nch-real-ido-430\n 0130 33663032 61306666 39666434 302f752e 3f02a0ff9fd40/u.\n 0140 69006d65 6d5f636d 70000000 6d656d5f i.mem_cmp...mem_\n 0150 636d7000 00000000 00000001 00000000 cmp.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000035 00000000 00000000 00000001 ...5............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000f 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_cmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -1787,7 +1787,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `mem_copy` — benchmark function af:mem_copy:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_copy\n beqz\t$a2, .L64\n andi\t$v1, $a2, 0x3\n negu\t$v1, $v1\n beqz\t$v1, .L34\n addu\t$v0, $v1, $a2\n.L14:\n lbu\t$t6, 0($a1)\n addiu\t$a2, $a2, -1\n addiu\t$a1, $a1, 1\n addiu\t$a0, $a0, 1\n bne\t$v0, $a2, .L14\n sb\t$t6, -1($a0)\n beqz\t$a2, .L64\n nop\n.L34:\n lbu\t$t7, 0($a1)\n addiu\t$a2, $a2, -4\n addiu\t$a1, $a1, 4\n sb\t$t7, 0($a0)\n lbu\t$t8, -3($a1)\n addiu\t$a0, $a0, 4\n sb\t$t8, -3($a0)\n lbu\t$t9, -2($a1)\n sb\t$t9, -2($a0)\n lbu\t$t0, -1($a1)\n bnez\t$a2, .L34\n sb\t$t0, -1($a0)\n.L64:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_copy # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `mem_copy` — benchmark function af:mem_copy:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_copy:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,64 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,34 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a1)\n 18:\taddiu\ta2,a2,-1\n 1c:\taddiu\ta1,a1,1\n 20:\taddiu\ta0,a0,1\n 24:\tbne\tv0,a2,14 \n 28:\tsb\tt6,-1(a0)\n 2c:\tbeqz\ta2,64 \n 30:\tnop\n 34:\tlbu\tt7,0(a1)\n 38:\taddiu\ta2,a2,-4\n 3c:\taddiu\ta1,a1,4\n 40:\tsb\tt7,0(a0)\n 44:\tlbu\tt8,-3(a1)\n 48:\taddiu\ta0,a0,4\n 4c:\tsb\tt8,-3(a0)\n 50:\tlbu\tt9,-2(a1)\n 54:\tsb\tt9,-2(a0)\n 58:\tlbu\tt0,-1(a1)\n 5c:\tbnez\ta2,34 \n 60:\tsb\tt0,-1(a0)\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t0000006c mem_copy\n\n\nContents of section .text:\n 0000 10c00018 30c30003 00031823 10600009 ....0......#.`..\n 0010 00661021 90ae0000 24c6ffff 24a50001 .f.!....$...$...\n 0020 24840001 1446fffb a08effff 10c0000d $....F..........\n 0030 00000000 90af0000 24c6fffc 24a50004 ........$...$...\n 0040 a08f0000 90b8fffd 24840004 a098fffd ........$.......\n 0050 90b9fffe a099fffe 90a8ffff 14c0fff5 ................\n 0060 a088ffff 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001b 00000008 000001d8 p...............\n 0010 00000005 00000320 00000001 000001e0 ....... ........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000034 00000288 .......D...4....\n 0040 0000000c 000002bc 00000001 000002c8 ................\n 0050 00000000 00000000 00000001 00000310 ................\n 0060 180310f1 10f76100 00000000 00000001 ......a.........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000006c 20200001 . .....*...l ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d323863 66653965 30643932 -ido-28cfe9e0d92\n 0130 39393438 322f752e 69006d65 6d5f636f 99482/u.i.mem_co\n 0140 70790000 6d656d5f 636f7079 00000000 py..mem_copy....\n 0150 00000000 00000001 00000000 00000033 ...............3\n 0160 00000000 00000004 00000000 0000001b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000007 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"mem_copy\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_copy # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `mem_copy` — benchmark function af:mem_copy:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_copy:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,64 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,34 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a1)\n 18:\taddiu\ta2,a2,-1\n 1c:\taddiu\ta1,a1,1\n 20:\taddiu\ta0,a0,1\n 24:\tbne\tv0,a2,14 \n 28:\tsb\tt6,-1(a0)\n 2c:\tbeqz\ta2,64 \n 30:\tnop\n 34:\tlbu\tt7,0(a1)\n 38:\taddiu\ta2,a2,-4\n 3c:\taddiu\ta1,a1,4\n 40:\tsb\tt7,0(a0)\n 44:\tlbu\tt8,-3(a1)\n 48:\taddiu\ta0,a0,4\n 4c:\tsb\tt8,-3(a0)\n 50:\tlbu\tt9,-2(a1)\n 54:\tsb\tt9,-2(a0)\n 58:\tlbu\tt0,-1(a1)\n 5c:\tbnez\ta2,34 \n 60:\tsb\tt0,-1(a0)\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t0000006c mem_copy\n\n\nContents of section .text:\n 0000 10c00018 30c30003 00031823 10600009 ....0......#.`..\n 0010 00661021 90ae0000 24c6ffff 24a50001 .f.!....$...$...\n 0020 24840001 1446fffb a08effff 10c0000d $....F..........\n 0030 00000000 90af0000 24c6fffc 24a50004 ........$...$...\n 0040 a08f0000 90b8fffd 24840004 a098fffd ........$.......\n 0050 90b9fffe a099fffe 90a8ffff 14c0fff5 ................\n 0060 a088ffff 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001b 00000008 000001d8 p...............\n 0010 00000005 00000320 00000001 000001e0 ....... ........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000034 00000288 .......D...4....\n 0040 0000000c 000002bc 00000001 000002c8 ................\n 0050 00000000 00000000 00000001 00000310 ................\n 0060 180310f1 10f76100 00000000 00000001 ......a.........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000006c 20200001 . .....*...l ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d323863 66653965 30643932 -ido-28cfe9e0d92\n 0130 39393438 322f752e 69006d65 6d5f636f 99482/u.i.mem_co\n 0140 70790000 6d656d5f 636f7079 00000000 py..mem_copy....\n 0150 00000000 00000001 00000000 00000033 ...............3\n 0160 00000000 00000004 00000000 0000001b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000007 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"mem_copy\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_copy # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -1870,7 +1870,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `mRmTp_ItemNo2FtrSize` — benchmark function af:mRmTp_ItemNo2FtrSize:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mRmTp_ItemNo2FtrSize\n sw\t$a0, 0($sp)\n andi\t$a0, $a0, 0xffff\n slti\t$at, $a0, 4096\n bnez\t$at, .L34\n move\t$v0, $zero\n slti\t$at, $a0, 7885\n beqz\t$at, .L34\n addiu\t$t6, $a0, -4096\n sra\t$t7, $t6, 0x2\n lui\t$v0, %hi(mRmTp_ftr_size)\n addu\t$v0, $v0, $t7\n jr\t$ra\n lbu\t$v0, %lo(mRmTp_ftr_size)($v0)\n.L34:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-2e2cc0cb59b4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 mRmTp_ItemNo2FtrSize(u16 name);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mRmTp_ItemNo2FtrSize # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `mRmTp_ItemNo2FtrSize` — benchmark function af:mRmTp_ItemNo2FtrSize:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mRmTp_ItemNo2FtrSize:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tandi\ta0,a0,0xffff\n 8:\tslti\tat,a0,4096\n c:\tbnez\tat,34 \n 10:\tmove\tv0,zero\n 14:\tslti\tat,a0,7885\n 18:\tbeqz\tat,34 \n 1c:\taddiu\tt6,a0,-4096\n 20:\tsra\tt7,t6,0x2\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t7\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t0000003c mRmTp_ItemNo2FtrSize\n00000000 O *UND*\t00000000 mRmTp_ftr_size\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 mRmTp_ftr_size\n00000030 R_MIPS_LO16 mRmTp_ftr_size\n\n\nContents of section .text:\n 0000 afa40000 3084ffff 28811000 14200009 ....0...(.... ..\n 0010 00001025 28811ecd 10200006 248ef000 ...%(.... ..$...\n 0020 000e7883 3c020000 004f1021 03e00008 ..x.<....O.!....\n 0030 90420000 03e00008 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 a000c016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a000c016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000f 00000008 000001f8 p...............\n 0010 00000006 00000374 00000001 00000200 .......t........\n 0020 00000004 00000234 00000000 00000000 .......4........\n 0030 00000011 00000264 00000040 000002a8 .......d...@....\n 0040 00000024 000002e8 00000001 0000030c ...$............\n 0050 00000000 00000000 00000002 00000354 ...............T\n 0060 011140c1 25210000 00000000 00000001 ..@.%!..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000003c 20200001 . .....*...< ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d386261 63613133 35653337 -ido-8baca135e37\n 0130 66323333 332f752e 69006d52 6d54705f f2333/u.i.mRmTp_\n 0140 4974656d 4e6f3246 74725369 7a650000 ItemNo2FtrSize..\n 0150 6d526d54 705f4974 656d4e6f 32467472 mRmTp_ItemNo2Ftr\n 0160 53697a65 006d526d 54705f66 74725f73 Size.mRmTp_ftr_s\n 0170 697a6500 00000000 00000001 00000000 ize.............\n 0180 0000003f 00000000 00000004 00000000 ...?............\n 0190 0000000f 00000000 00000000 00000001 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 01800000 00000000 00000006 00000000 ................\n 01c0 00000000 00000000 18200001 00000000 ......... ......\n 01d0 00000015 00000000 04cfffff 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 7fffffff 00000000 7fffffff ................\n 0200 00000001 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mRmTp_ItemNo2FtrSize # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `mRmTp_ItemNo2FtrSize` — benchmark function af:mRmTp_ItemNo2FtrSize:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mRmTp_ItemNo2FtrSize:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tandi\ta0,a0,0xffff\n 8:\tslti\tat,a0,4096\n c:\tbnez\tat,34 \n 10:\tmove\tv0,zero\n 14:\tslti\tat,a0,7885\n 18:\tbeqz\tat,34 \n 1c:\taddiu\tt6,a0,-4096\n 20:\tsra\tt7,t6,0x2\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t7\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t0000003c mRmTp_ItemNo2FtrSize\n00000000 O *UND*\t00000000 mRmTp_ftr_size\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 mRmTp_ftr_size\n00000030 R_MIPS_LO16 mRmTp_ftr_size\n\n\nContents of section .text:\n 0000 afa40000 3084ffff 28811000 14200009 ....0...(.... ..\n 0010 00001025 28811ecd 10200006 248ef000 ...%(.... ..$...\n 0020 000e7883 3c020000 004f1021 03e00008 ..x.<....O.!....\n 0030 90420000 03e00008 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 a000c016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a000c016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000f 00000008 000001f8 p...............\n 0010 00000006 00000374 00000001 00000200 .......t........\n 0020 00000004 00000234 00000000 00000000 .......4........\n 0030 00000011 00000264 00000040 000002a8 .......d...@....\n 0040 00000024 000002e8 00000001 0000030c ...$............\n 0050 00000000 00000000 00000002 00000354 ...............T\n 0060 011140c1 25210000 00000000 00000001 ..@.%!..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000003c 20200001 . .....*...< ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d386261 63613133 35653337 -ido-8baca135e37\n 0130 66323333 332f752e 69006d52 6d54705f f2333/u.i.mRmTp_\n 0140 4974656d 4e6f3246 74725369 7a650000 ItemNo2FtrSize..\n 0150 6d526d54 705f4974 656d4e6f 32467472 mRmTp_ItemNo2Ftr\n 0160 53697a65 006d526d 54705f66 74725f73 Size.mRmTp_ftr_s\n 0170 697a6500 00000000 00000001 00000000 ize.............\n 0180 0000003f 00000000 00000004 00000000 ...?............\n 0190 0000000f 00000000 00000000 00000001 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 01800000 00000000 00000006 00000000 ................\n 01c0 00000000 00000000 18200001 00000000 ......... ......\n 01d0 00000015 00000000 04cfffff 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 7fffffff 00000000 7fffffff ................\n 0200 00000001 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mRmTp_ItemNo2FtrSize # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -1952,7 +1952,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `never_zero` — benchmark function af:never_zero:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel never_zero\n mtc1\t$zero, $f4\n nop\n c.lt.s\t$f12, $f4\n nop\n bc1fl\t.L44\n c.lt.s\t$f12, $f14\n neg.s\t$f0, $f14\n c.lt.s\t$f0, $f12\n nop\n bc1fl\t.L38\n mov.s\t$f2, $f12\n jr\t$ra\n nop\n mov.s\t$f2, $f12\n.L38:\n jr\t$ra\n mov.s\t$f0, $f2\n c.lt.s\t$f12, $f14\n.L44:\n nop\n bc1fl\t.L5c\n mov.s\t$f2, $f12\n b\t.L5c\n mov.s\t$f2, $f14\n mov.s\t$f2, $f12\n.L5c:\n mov.s\t$f0, $f2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function never_zero # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `never_zero` — benchmark function af:never_zero:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:never_zero:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f12,$f14\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f0,$f12\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f12,$f14\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 never_zero\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460e603c 46007007 460c003c E...F.`&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f12,$f14\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f0,$f12\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f12,$f14\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 never_zero\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460e603c 46007007 460c003c E...F.` in.s <<'ASM_INPUT'\nglabel rgba_t_move\n lbu\t$t6, 0($a1)\n sb\t$t6, 0($a0)\n lbu\t$t7, 1($a1)\n sb\t$t7, 1($a0)\n lbu\t$t8, 2($a1)\n sb\t$t8, 2($a0)\n lbu\t$t9, 3($a1)\n jr\t$ra\n sb\t$t9, 3($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rgba_t_move # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `rgba_t_move` — benchmark function af:rgba_t_move:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:rgba_t_move:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tt6,0(a1)\n 4:\tsb\tt6,0(a0)\n 8:\tlbu\tt7,1(a1)\n c:\tsb\tt7,1(a0)\n 10:\tlbu\tt8,2(a1)\n 14:\tsb\tt8,2(a0)\n 18:\tlbu\tt9,3(a1)\n 1c:\tjr\tra\n 20:\tsb\tt9,3(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 rgba_t_move\n\n\nContents of section .text:\n 0000 90ae0000 a08e0000 90af0001 a08f0001 ................\n 0010 90b80002 a0980002 90b90003 03e00008 ................\n 0020 a0990003 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000008 000001a8 p...............\n 0010 00000005 000002f4 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000038 00000258 ...........8...X\n 0040 0000000c 00000290 00000001 0000029c ................\n 0050 00000000 00000000 00000001 000002e4 ................\n 0060 11111110 10f00000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000024 20200001 . .....*...$ ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d633834 30663132 30663065 -ido-c840f120f0e\n 0130 37363932 372f752e 69007267 62615f74 76927/u.i.rgba_t\n 0140 5f6d6f76 65000000 72676261 5f745f6d _move...rgba_t_m\n 0150 6f766500 00000000 00000001 00000000 ove.............\n 0160 00000036 00000000 00000004 00000000 ...6............\n 0170 00000009 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000006 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"rgba_t_move\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name rgba_t_move # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `rgba_t_move` — benchmark function af:rgba_t_move:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:rgba_t_move:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tt6,0(a1)\n 4:\tsb\tt6,0(a0)\n 8:\tlbu\tt7,1(a1)\n c:\tsb\tt7,1(a0)\n 10:\tlbu\tt8,2(a1)\n 14:\tsb\tt8,2(a0)\n 18:\tlbu\tt9,3(a1)\n 1c:\tjr\tra\n 20:\tsb\tt9,3(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 rgba_t_move\n\n\nContents of section .text:\n 0000 90ae0000 a08e0000 90af0001 a08f0001 ................\n 0010 90b80002 a0980002 90b90003 03e00008 ................\n 0020 a0990003 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000008 000001a8 p...............\n 0010 00000005 000002f4 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000038 00000258 ...........8...X\n 0040 0000000c 00000290 00000001 0000029c ................\n 0050 00000000 00000000 00000001 000002e4 ................\n 0060 11111110 10f00000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000024 20200001 . .....*...$ ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d633834 30663132 30663065 -ido-c840f120f0e\n 0130 37363932 372f752e 69007267 62615f74 76927/u.i.rgba_t\n 0140 5f6d6f76 65000000 72676261 5f745f6d _move...rgba_t_m\n 0150 6f766500 00000000 00000001 00000000 ove.............\n 0160 00000036 00000000 00000004 00000000 ...6............\n 0170 00000009 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000006 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"rgba_t_move\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name rgba_t_move # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -2115,7 +2115,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `search_position_angleY` — benchmark function af:search_position_angleY:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel search_position_angleY\n addiu\t$sp, $sp, -24\n sw\t$ra, 20($sp)\n lwc1\t$f6, 0($a0)\n lwc1\t$f4, 0($a1)\n lwc1\t$f10, 8($a0)\n lwc1\t$f8, 8($a1)\n sub.s\t$f14, $f4, $f6\n jal\tatans_table\n sub.s\t$f12, $f8, $f10\n lw\t$ra, 20($sp)\n addiu\t$sp, $sp, 24\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-d8e5c4388b36.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns16 search_position_angleY(xyz_t* subtrahend, xyz_t* minuend);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function search_position_angleY # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `search_position_angleY` — benchmark function af:search_position_angleY:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:search_position_angleY:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tlwc1\t$f6,0(a0)\n c:\tlwc1\t$f4,0(a1)\n 10:\tlwc1\t$f10,8(a0)\n 14:\tlwc1\t$f8,8(a1)\n 18:\tsub.s\t$f14,$f4,$f6\n 1c:\tjal\t0 \n 20:\tsub.s\t$f12,$f8,$f10\n 24:\tlw\tra,20(sp)\n 28:\taddiu\tsp,sp,24\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 search_position_angleY\n00000000 F *UND*\t00000000 atans_table\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 atans_table\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 c4860000 c4a40000 '...............\n 0010 c48a0008 c4a80008 46062381 0c000000 ........F.#.....\n 0020 460a4301 8fbf0014 27bd0018 03e00008 F.C.....'.......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000030 00000000 . .........0....\n 0010 0000f550 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000030 00000000 0000f550 00000000 ...0.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001f0 p...............\n 0010 00000006 00000370 00000001 000001f8 .......p........\n 0020 00000004 0000022c 00000000 00000000 .......,........\n 0030 00000011 0000025c 00000044 000002a0 .......\\...D....\n 0040 00000024 000002e4 00000001 00000308 ...$............\n 0050 00000000 00000000 00000002 00000350 ...............P\n 0060 011111f0 20f01300 00000000 00000001 .... ...........\n 0070 00000000 80000000 fffffffc ffffffff ................\n 0080 00000000 00000000 00000018 001d001f ................\n 0090 00000004 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d623762 34646365 32343233 -ido-b7b4dce2423\n 0130 38363332 352f752e 69007365 61726368 86325/u.i.search\n 0140 5f706f73 6974696f 6e5f616e 676c6559 _position_angleY\n 0150 00000000 73656172 63685f70 6f736974 ....search_posit\n 0160 696f6e5f 616e676c 65590061 74616e73 ion_angleY.atans\n 0170 5f746162 6c650000 00000000 00000001 _table..........\n 0180 00000000 00000041 00000000 00000004 .......A........\n 0190 00000000 0000000d 00000000 00000000 ................\n 01a0 00000001 00000000 00000011 00000000 ................\n 01b0 00000000 01800000 00000000 00000007 ................\n 01c0 00000000 00000000 00000000 18200001 ............. ..\n 01d0 00000000 00000017 00000000 18cfffff ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 7fffffff 00000000 ................\n 0200 7fffffff 00000001 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name search_position_angleY # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `search_position_angleY` — benchmark function af:search_position_angleY:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:search_position_angleY:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tlwc1\t$f6,0(a0)\n c:\tlwc1\t$f4,0(a1)\n 10:\tlwc1\t$f10,8(a0)\n 14:\tlwc1\t$f8,8(a1)\n 18:\tsub.s\t$f14,$f4,$f6\n 1c:\tjal\t0 \n 20:\tsub.s\t$f12,$f8,$f10\n 24:\tlw\tra,20(sp)\n 28:\taddiu\tsp,sp,24\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 search_position_angleY\n00000000 F *UND*\t00000000 atans_table\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 atans_table\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 c4860000 c4a40000 '...............\n 0010 c48a0008 c4a80008 46062381 0c000000 ........F.#.....\n 0020 460a4301 8fbf0014 27bd0018 03e00008 F.C.....'.......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000030 00000000 . .........0....\n 0010 0000f550 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000030 00000000 0000f550 00000000 ...0.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001f0 p...............\n 0010 00000006 00000370 00000001 000001f8 .......p........\n 0020 00000004 0000022c 00000000 00000000 .......,........\n 0030 00000011 0000025c 00000044 000002a0 .......\\...D....\n 0040 00000024 000002e4 00000001 00000308 ...$............\n 0050 00000000 00000000 00000002 00000350 ...............P\n 0060 011111f0 20f01300 00000000 00000001 .... ...........\n 0070 00000000 80000000 fffffffc ffffffff ................\n 0080 00000000 00000000 00000018 001d001f ................\n 0090 00000004 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d623762 34646365 32343233 -ido-b7b4dce2423\n 0130 38363332 352f752e 69007365 61726368 86325/u.i.search\n 0140 5f706f73 6974696f 6e5f616e 676c6559 _position_angleY\n 0150 00000000 73656172 63685f70 6f736974 ....search_posit\n 0160 696f6e5f 616e676c 65590061 74616e73 ion_angleY.atans\n 0170 5f746162 6c650000 00000000 00000001 _table..........\n 0180 00000000 00000041 00000000 00000004 .......A........\n 0190 00000000 0000000d 00000000 00000000 ................\n 01a0 00000001 00000000 00000011 00000000 ................\n 01b0 00000000 01800000 00000000 00000007 ................\n 01c0 00000000 00000000 00000000 18200001 ............. ..\n 01d0 00000000 00000017 00000000 18cfffff ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 7fffffff 00000000 ................\n 0200 7fffffff 00000001 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name search_position_angleY # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -2182,7 +2182,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `spolar2world` — benchmark function af:spolar2world:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel spolar2world\n addiu\t$sp, $sp, -64\n sw\t$ra, 28($sp)\n sw\t$s0, 24($sp)\n sw\t$a0, 64($sp)\n move\t$s0, $a1\n jal\tcos_s\n lh\t$a0, 4($a1)\n swc1\t$f0, 44($sp)\n jal\tcos_s\n lh\t$a0, 6($s0)\n swc1\t$f0, 36($sp)\n jal\tsin_s\n lh\t$a0, 4($s0)\n lh\t$a0, 6($s0)\n jal\tsin_s\n swc1\t$f0, 48($sp)\n lwc1\t$f2, 48($sp)\n lwc1\t$f4, 0($s0)\n lwc1\t$f16, 44($sp)\n addiu\t$t6, $sp, 52\n mul.s\t$f6, $f4, $f2\n lw\t$v0, 64($sp)\n mul.s\t$f8, $f6, $f0\n swc1\t$f8, 52($sp)\n lwc1\t$f10, 0($s0)\n lwc1\t$f8, 36($sp)\n mul.s\t$f18, $f10, $f16\n swc1\t$f18, 56($sp)\n lwc1\t$f4, 0($s0)\n mul.s\t$f6, $f4, $f2\n mul.s\t$f10, $f6, $f8\n swc1\t$f10, 60($sp)\n lw\t$t8, 0($t6)\n sw\t$t8, 0($v0)\n lw\t$t7, 4($t6)\n sw\t$t7, 4($v0)\n lw\t$t8, 8($t6)\n sw\t$t8, 8($v0)\n lw\t$ra, 28($sp)\n lw\t$s0, 24($sp)\n addiu\t$sp, $sp, 64\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function spolar2world # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `spolar2world` — benchmark function af:spolar2world:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:spolar2world:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\tra,28(sp)\n 8:\tsw\ts0,24(sp)\n c:\tsw\ta0,64(sp)\n 10:\tmove\ts0,a1\n 14:\tjal\t0 \n 18:\tlh\ta0,4(a1)\n 1c:\tswc1\t$f0,44(sp)\n 20:\tjal\t0 \n 24:\tlh\ta0,6(s0)\n 28:\tswc1\t$f0,36(sp)\n 2c:\tjal\t0 \n 30:\tlh\ta0,4(s0)\n 34:\tlh\ta0,6(s0)\n 38:\tjal\t0 \n 3c:\tswc1\t$f0,48(sp)\n 40:\tlwc1\t$f2,48(sp)\n 44:\tlwc1\t$f4,0(s0)\n 48:\tlwc1\t$f16,44(sp)\n 4c:\taddiu\tt6,sp,52\n 50:\tmul.s\t$f6,$f4,$f2\n 54:\tlw\tv0,64(sp)\n 58:\tmul.s\t$f8,$f6,$f0\n 5c:\tswc1\t$f8,52(sp)\n 60:\tlwc1\t$f10,0(s0)\n 64:\tlwc1\t$f8,36(sp)\n 68:\tmul.s\t$f18,$f10,$f16\n 6c:\tswc1\t$f18,56(sp)\n 70:\tlwc1\t$f4,0(s0)\n 74:\tmul.s\t$f6,$f4,$f2\n 78:\tmul.s\t$f10,$f6,$f8\n 7c:\tswc1\t$f10,60(sp)\n 80:\tlw\tt8,0(t6)\n 84:\tsw\tt8,0(v0)\n 88:\tlw\tt7,4(t6)\n 8c:\tsw\tt7,4(v0)\n 90:\tlw\tt8,8(t6)\n 94:\tsw\tt8,8(v0)\n 98:\tlw\tra,28(sp)\n 9c:\tlw\ts0,24(sp)\n a0:\taddiu\tsp,sp,64\n a4:\tjr\tra\n a8:\tnop\n ac:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000ac spolar2world\n00000000 F *UND*\t00000000 cos_s\n00000000 F *UND*\t00000000 sin_s\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 cos_s\n00000020 R_MIPS_26 cos_s\n0000002c R_MIPS_26 sin_s\n00000038 R_MIPS_26 sin_s\n\n\nContents of section .text:\n 0000 27bdffc0 afbf001c afb00018 afa40040 '..............@\n 0010 00a08025 0c000000 84a40004 e7a0002c ...%...........,\n 0020 0c000000 86040006 e7a00024 0c000000 ...........$....\n 0030 86040004 86040006 0c000000 e7a00030 ...............0\n 0040 c7a20030 c6040000 c7b0002c 27ae0034 ...0.......,'..4\n 0050 46022182 8fa20040 46003202 e7a80034 F.!....@F.2....4\n 0060 c60a0000 c7a80024 46105482 e7b20038 .......$F.T....8\n 0070 c6040000 46022182 46083282 e7aa003c ....F.!.F.2....<\n 0080 8dd80000 ac580000 8dcf0004 ac4f0004 .....X.......O..\n 0090 8dd80008 ac580008 8fbf001c 8fb00018 .....X..........\n 00a0 27bd0040 03e00008 00000000 00000000 '..@............\nContents of section .options:\n 0000 01200000 00000000 a101c034 00000000 . .........4....\n 0010 000d0fd5 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a101c034 00000000 000d0fd5 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002b 00000014 00000278 p......+.......x\n 0010 00000007 00000400 00000001 0000028c ................\n 0020 00000004 000002c0 00000000 00000000 ................\n 0030 00000011 000002f0 00000038 00000334 ...........8...4\n 0040 0000001c 0000036c 00000001 00000388 .......l........\n 0050 00000000 00000000 00000003 000003d0 ................\n 0060 04322211 13101020 d0f01110 10f11318 .2\".... ........\n 0070 01000000 00000000 00000001 00000000 ................\n 0080 80010000 ffffffdc ffffffff 00000000 ................\n 0090 00000000 00000040 001d001f 00000007 .......@........\n 00a0 00000012 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000ac 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d326130 31346637 32346334 37373737 -2a014f724c47777\n 0140 622f752e 69007370 6f6c6172 32776f72 b/u.i.spolar2wor\n 0150 6c640000 73706f6c 61723277 6f726c64 ld..spolar2world\n 0160 00636f73 5f730073 696e5f73 00000000 .cos_s.sin_s....\n 0170 00000000 00000001 00000000 00000037 ...............7\n 0180 00000000 00000004 00000000 0000002b ...............+\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000011 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000d ..... ..........\n 01d0 00000000 18cfffff 00000000 00000013 ................\n 01e0 00000000 18cfffff 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 7fffffff 00000000 7fffffff 00000001 ................\n 0210 7fffffff 00000002 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name spolar2world # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `spolar2world` — benchmark function af:spolar2world:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:spolar2world:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\tra,28(sp)\n 8:\tsw\ts0,24(sp)\n c:\tsw\ta0,64(sp)\n 10:\tmove\ts0,a1\n 14:\tjal\t0 \n 18:\tlh\ta0,4(a1)\n 1c:\tswc1\t$f0,44(sp)\n 20:\tjal\t0 \n 24:\tlh\ta0,6(s0)\n 28:\tswc1\t$f0,36(sp)\n 2c:\tjal\t0 \n 30:\tlh\ta0,4(s0)\n 34:\tlh\ta0,6(s0)\n 38:\tjal\t0 \n 3c:\tswc1\t$f0,48(sp)\n 40:\tlwc1\t$f2,48(sp)\n 44:\tlwc1\t$f4,0(s0)\n 48:\tlwc1\t$f16,44(sp)\n 4c:\taddiu\tt6,sp,52\n 50:\tmul.s\t$f6,$f4,$f2\n 54:\tlw\tv0,64(sp)\n 58:\tmul.s\t$f8,$f6,$f0\n 5c:\tswc1\t$f8,52(sp)\n 60:\tlwc1\t$f10,0(s0)\n 64:\tlwc1\t$f8,36(sp)\n 68:\tmul.s\t$f18,$f10,$f16\n 6c:\tswc1\t$f18,56(sp)\n 70:\tlwc1\t$f4,0(s0)\n 74:\tmul.s\t$f6,$f4,$f2\n 78:\tmul.s\t$f10,$f6,$f8\n 7c:\tswc1\t$f10,60(sp)\n 80:\tlw\tt8,0(t6)\n 84:\tsw\tt8,0(v0)\n 88:\tlw\tt7,4(t6)\n 8c:\tsw\tt7,4(v0)\n 90:\tlw\tt8,8(t6)\n 94:\tsw\tt8,8(v0)\n 98:\tlw\tra,28(sp)\n 9c:\tlw\ts0,24(sp)\n a0:\taddiu\tsp,sp,64\n a4:\tjr\tra\n a8:\tnop\n ac:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000ac spolar2world\n00000000 F *UND*\t00000000 cos_s\n00000000 F *UND*\t00000000 sin_s\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 cos_s\n00000020 R_MIPS_26 cos_s\n0000002c R_MIPS_26 sin_s\n00000038 R_MIPS_26 sin_s\n\n\nContents of section .text:\n 0000 27bdffc0 afbf001c afb00018 afa40040 '..............@\n 0010 00a08025 0c000000 84a40004 e7a0002c ...%...........,\n 0020 0c000000 86040006 e7a00024 0c000000 ...........$....\n 0030 86040004 86040006 0c000000 e7a00030 ...............0\n 0040 c7a20030 c6040000 c7b0002c 27ae0034 ...0.......,'..4\n 0050 46022182 8fa20040 46003202 e7a80034 F.!....@F.2....4\n 0060 c60a0000 c7a80024 46105482 e7b20038 .......$F.T....8\n 0070 c6040000 46022182 46083282 e7aa003c ....F.!.F.2....<\n 0080 8dd80000 ac580000 8dcf0004 ac4f0004 .....X.......O..\n 0090 8dd80008 ac580008 8fbf001c 8fb00018 .....X..........\n 00a0 27bd0040 03e00008 00000000 00000000 '..@............\nContents of section .options:\n 0000 01200000 00000000 a101c034 00000000 . .........4....\n 0010 000d0fd5 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a101c034 00000000 000d0fd5 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002b 00000014 00000278 p......+.......x\n 0010 00000007 00000400 00000001 0000028c ................\n 0020 00000004 000002c0 00000000 00000000 ................\n 0030 00000011 000002f0 00000038 00000334 ...........8...4\n 0040 0000001c 0000036c 00000001 00000388 .......l........\n 0050 00000000 00000000 00000003 000003d0 ................\n 0060 04322211 13101020 d0f01110 10f11318 .2\".... ........\n 0070 01000000 00000000 00000001 00000000 ................\n 0080 80010000 ffffffdc ffffffff 00000000 ................\n 0090 00000000 00000040 001d001f 00000007 .......@........\n 00a0 00000012 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000ac 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d326130 31346637 32346334 37373737 -2a014f724c47777\n 0140 622f752e 69007370 6f6c6172 32776f72 b/u.i.spolar2wor\n 0150 6c640000 73706f6c 61723277 6f726c64 ld..spolar2world\n 0160 00636f73 5f730073 696e5f73 00000000 .cos_s.sin_s....\n 0170 00000000 00000001 00000000 00000037 ...............7\n 0180 00000000 00000004 00000000 0000002b ...............+\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000011 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000d ..... ..........\n 01d0 00000000 18cfffff 00000000 00000013 ................\n 01e0 00000000 18cfffff 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 7fffffff 00000000 7fffffff 00000001 ................\n 0210 7fffffff 00000002 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name spolar2world # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -2275,7 +2275,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `ValueSet__s_xyz` — benchmark function af:ValueSet__s_xyz:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ValueSet__s_xyz\n lhu\t$t6, 0($a1)\n lh\t$v1, 2($a1)\n andi\t$t7, $t6, 0x7ff\n addu\t$v0, $t7, $a0\n sh\t$v1, 4($v0)\n sh\t$v1, 2($v0)\n jr\t$ra\n sh\t$v1, 0($v0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ValueSet__s_xyz # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ValueSet__s_xyz` — benchmark function af:ValueSet__s_xyz:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:ValueSet__s_xyz:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlhu\tt6,0(a1)\n 4:\tlh\tv1,2(a1)\n 8:\tandi\tt7,t6,0x7ff\n c:\taddu\tv0,t7,a0\n 10:\tsh\tv1,4(v0)\n 14:\tsh\tv1,2(v0)\n 18:\tjr\tra\n 1c:\tsh\tv1,0(v0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 ValueSet__s_xyz\n\n\nContents of section .text:\n 0000 94ae0000 84a30002 31cf07ff 01e41021 ........1......!\n 0010 a4430004 a4430002 03e00008 a4430000 .C...C.......C..\nContents of section .options:\n 0000 01200000 00000000 8000c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000008 00000198 p...............\n 0010 00000005 000002ec 00000001 000001a0 ................\n 0020 00000004 000001d4 00000000 00000000 ................\n 0030 00000011 00000204 0000003c 00000248 ...........<...H\n 0040 00000010 00000284 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1010f120 1020f000 00000000 00000001 ... . ..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000006 0000000c 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000020 20200001 . .....*... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d363432 39343636 64386465 -ido-6429466d8de\n 0130 30653065 362f752e 69005661 6c756553 0e0e6/u.i.ValueS\n 0140 65745f5f 735f7879 7a000000 56616c75 et__s_xyz...Valu\n 0150 65536574 5f5f735f 78797a00 00000000 eSet__s_xyz.....\n 0160 00000001 00000000 0000003a 00000000 ...........:....\n 0170 00000004 00000000 00000008 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000007 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ValueSet__s_xyz\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ValueSet__s_xyz # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ValueSet__s_xyz` — benchmark function af:ValueSet__s_xyz:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:ValueSet__s_xyz:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlhu\tt6,0(a1)\n 4:\tlh\tv1,2(a1)\n 8:\tandi\tt7,t6,0x7ff\n c:\taddu\tv0,t7,a0\n 10:\tsh\tv1,4(v0)\n 14:\tsh\tv1,2(v0)\n 18:\tjr\tra\n 1c:\tsh\tv1,0(v0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 ValueSet__s_xyz\n\n\nContents of section .text:\n 0000 94ae0000 84a30002 31cf07ff 01e41021 ........1......!\n 0010 a4430004 a4430002 03e00008 a4430000 .C...C.......C..\nContents of section .options:\n 0000 01200000 00000000 8000c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000008 00000198 p...............\n 0010 00000005 000002ec 00000001 000001a0 ................\n 0020 00000004 000001d4 00000000 00000000 ................\n 0030 00000011 00000204 0000003c 00000248 ...........<...H\n 0040 00000010 00000284 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1010f120 1020f000 00000000 00000001 ... . ..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000006 0000000c 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000020 20200001 . .....*... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d363432 39343636 64386465 -ido-6429466d8de\n 0130 30653065 362f752e 69005661 6c756553 0e0e6/u.i.ValueS\n 0140 65745f5f 735f7879 7a000000 56616c75 et__s_xyz...Valu\n 0150 65536574 5f5f735f 78797a00 00000000 eSet__s_xyz.....\n 0160 00000001 00000000 0000003a 00000000 ...........:....\n 0170 00000004 00000000 00000008 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000007 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ValueSet__s_xyz\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ValueSet__s_xyz # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -2341,7 +2341,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `xyz_t_add` — benchmark function af:xyz_t_add:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_add\n lwc1\t$f4, 0($a0)\n lwc1\t$f6, 0($a1)\n add.s\t$f8, $f4, $f6\n swc1\t$f8, 0($a2)\n lwc1\t$f16, 4($a1)\n lwc1\t$f10, 4($a0)\n add.s\t$f18, $f10, $f16\n swc1\t$f18, 4($a2)\n lwc1\t$f6, 8($a1)\n lwc1\t$f4, 8($a0)\n add.s\t$f8, $f4, $f6\n jr\t$ra\n swc1\t$f8, 8($a2)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_add # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_add` — benchmark function af:xyz_t_add:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_add:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tadd.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tadd.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tadd.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_add\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062200 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105480 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062200 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d656339 66643861 32343532 -ido-ec9fd8a2452\n 0130 38613731 392f752e 69007879 7a5f745f 8a719/u.i.xyz_t_\n 0140 61646400 78797a5f 745f6164 64000000 add.xyz_t_add...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_add # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_add` — benchmark function af:xyz_t_add:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_add:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tadd.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tadd.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tadd.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_add\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062200 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105480 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062200 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d656339 66643861 32343532 -ido-ec9fd8a2452\n 0130 38613731 392f752e 69007879 7a5f745f 8a719/u.i.xyz_t_\n 0140 61646400 78797a5f 745f6164 64000000 add.xyz_t_add...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_add # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -2408,7 +2408,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `xyz_t_mult_v` — benchmark function af:xyz_t_mult_v:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_mult_v\n mtc1\t$a1, $f12\n lwc1\t$f4, 0($a0)\n lwc1\t$f8, 4($a0)\n lwc1\t$f16, 8($a0)\n mul.s\t$f6, $f4, $f12\n mul.s\t$f10, $f8, $f12\n mul.s\t$f18, $f16, $f12\n swc1\t$f6, 0($a0)\n swc1\t$f10, 4($a0)\n jr\t$ra\n swc1\t$f18, 8($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_mult_v # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_mult_v` — benchmark function af:xyz_t_mult_v:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_mult_v:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f4,0(a0)\n 8:\tlwc1\t$f8,4(a0)\n c:\tlwc1\t$f16,8(a0)\n 10:\tmul.s\t$f6,$f4,$f12\n 14:\tmul.s\t$f10,$f8,$f12\n 18:\tmul.s\t$f18,$f16,$f12\n 1c:\tswc1\t$f6,0(a0)\n 20:\tswc1\t$f10,4(a0)\n 24:\tjr\tra\n 28:\tswc1\t$f18,8(a0)\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c xyz_t_mult_v\n\n\nContents of section .text:\n 0000 44856000 c4840000 c4880004 c4900008 D.`.............\n 0010 460c2182 460c4282 460c8482 e4860000 F.!.F.B.F.......\n 0020 e48a0004 03e00008 e4920008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 000d1dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 000d1dd0 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 0000000c 000001a8 p...............\n 0010 00000005 000002fc 00000001 000001b4 ................\n 0020 00000004 000001e8 00000000 00000000 ................\n 0030 00000011 00000218 00000038 0000025c ...........8...\\\n 0040 00000010 00000294 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 00101010 e01010e0 1020f000 00000000 ......... ......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000006 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000002c ..... .....*...,\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d356562 61356236 real-ido-5eba5b6\n 0130 39663537 39666461 632f752e 69007879 9f579fdac/u.i.xy\n 0140 7a5f745f 6d756c74 5f760000 78797a5f z_t_mult_v..xyz_\n 0150 745f6d75 6c745f76 00000000 00000000 t_mult_v........\n 0160 00000001 00000000 00000037 00000000 ...........7....\n 0170 00000004 00000000 0000000b 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 0000000b 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_mult_v # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_mult_v` — benchmark function af:xyz_t_mult_v:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_mult_v:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f4,0(a0)\n 8:\tlwc1\t$f8,4(a0)\n c:\tlwc1\t$f16,8(a0)\n 10:\tmul.s\t$f6,$f4,$f12\n 14:\tmul.s\t$f10,$f8,$f12\n 18:\tmul.s\t$f18,$f16,$f12\n 1c:\tswc1\t$f6,0(a0)\n 20:\tswc1\t$f10,4(a0)\n 24:\tjr\tra\n 28:\tswc1\t$f18,8(a0)\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c xyz_t_mult_v\n\n\nContents of section .text:\n 0000 44856000 c4840000 c4880004 c4900008 D.`.............\n 0010 460c2182 460c4282 460c8482 e4860000 F.!.F.B.F.......\n 0020 e48a0004 03e00008 e4920008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 000d1dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 000d1dd0 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 0000000c 000001a8 p...............\n 0010 00000005 000002fc 00000001 000001b4 ................\n 0020 00000004 000001e8 00000000 00000000 ................\n 0030 00000011 00000218 00000038 0000025c ...........8...\\\n 0040 00000010 00000294 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 00101010 e01010e0 1020f000 00000000 ......... ......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000006 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000002c ..... .....*...,\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d356562 61356236 real-ido-5eba5b6\n 0130 39663537 39666461 632f752e 69007879 9f579fdac/u.i.xy\n 0140 7a5f745f 6d756c74 5f760000 78797a5f z_t_mult_v..xyz_\n 0150 745f6d75 6c745f76 00000000 00000000 t_mult_v........\n 0160 00000001 00000000 00000037 00000000 ...........7....\n 0170 00000004 00000000 0000000b 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 0000000b 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_mult_v # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -2474,7 +2474,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `xyz_t_sub_ss` — benchmark function af:xyz_t_sub_ss:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_sub_ss\n lh\t$t6, 0($a1)\n lh\t$t7, 0($a2)\n subu\t$t8, $t6, $t7\n mtc1\t$t8, $f4\n nop\n cvt.s.w\t$f6, $f4\n swc1\t$f6, 0($a0)\n lh\t$t0, 2($a2)\n lh\t$t9, 2($a1)\n subu\t$t1, $t9, $t0\n mtc1\t$t1, $f8\n nop\n cvt.s.w\t$f10, $f8\n swc1\t$f10, 4($a0)\n lh\t$t3, 4($a2)\n lh\t$t2, 4($a1)\n subu\t$t4, $t2, $t3\n mtc1\t$t4, $f16\n nop\n cvt.s.w\t$f18, $f16\n jr\t$ra\n swc1\t$f18, 8($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_sub_ss # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_sub_ss` — benchmark function af:xyz_t_sub_ss:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_sub_ss:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tt6,0(a1)\n 4:\tlh\tt7,0(a2)\n 8:\tsubu\tt8,t6,t7\n c:\tmtc1\tt8,$f4\n 10:\tnop\n 14:\tcvt.s.w\t$f6,$f4\n 18:\tswc1\t$f6,0(a0)\n 1c:\tlh\tt0,2(a2)\n 20:\tlh\tt9,2(a1)\n 24:\tsubu\tt1,t9,t0\n 28:\tmtc1\tt1,$f8\n 2c:\tnop\n 30:\tcvt.s.w\t$f10,$f8\n 34:\tswc1\t$f10,4(a0)\n 38:\tlh\tt3,4(a2)\n 3c:\tlh\tt2,4(a1)\n 40:\tsubu\tt4,t2,t3\n 44:\tmtc1\tt4,$f16\n 48:\tnop\n 4c:\tcvt.s.w\t$f18,$f16\n 50:\tjr\tra\n 54:\tswc1\t$f18,8(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000058 xyz_t_sub_ss\n\n\nContents of section .text:\n 0000 84ae0000 84cf0000 01cfc023 44982000 ...........#D. .\n 0010 00000000 468021a0 e4860000 84c80002 ....F.!.........\n 0020 84b90002 03284823 44894000 00000000 .....(H#D.@.....\n 0030 468042a0 e48a0004 84cb0004 84aa0004 F.B.............\n 0040 014b6023 448c8000 00000000 468084a0 .K`#D.......F...\n 0050 03e00008 e4920008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300df70 00000000 . .........p....\n 0010 000d0dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300df70 00000000 000d0dd0 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000016 00000008 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e0 .......(........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000038 00000288 .......D...8....\n 0040 00000010 000002c0 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 16161510 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000008 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000058 20200001 . .....*...X ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d643433 35353733 66633865 -ido-d435573fc8e\n 0130 32643164 662f752e 69007879 7a5f745f 2d1df/u.i.xyz_t_\n 0140 7375625f 73730000 78797a5f 745f7375 sub_ss..xyz_t_su\n 0150 625f7373 00000000 00000000 00000001 b_ss............\n 0160 00000000 00000037 00000000 00000004 .......7........\n 0170 00000000 00000016 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000005 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_sub_ss # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_sub_ss` — benchmark function af:xyz_t_sub_ss:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_sub_ss:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tt6,0(a1)\n 4:\tlh\tt7,0(a2)\n 8:\tsubu\tt8,t6,t7\n c:\tmtc1\tt8,$f4\n 10:\tnop\n 14:\tcvt.s.w\t$f6,$f4\n 18:\tswc1\t$f6,0(a0)\n 1c:\tlh\tt0,2(a2)\n 20:\tlh\tt9,2(a1)\n 24:\tsubu\tt1,t9,t0\n 28:\tmtc1\tt1,$f8\n 2c:\tnop\n 30:\tcvt.s.w\t$f10,$f8\n 34:\tswc1\t$f10,4(a0)\n 38:\tlh\tt3,4(a2)\n 3c:\tlh\tt2,4(a1)\n 40:\tsubu\tt4,t2,t3\n 44:\tmtc1\tt4,$f16\n 48:\tnop\n 4c:\tcvt.s.w\t$f18,$f16\n 50:\tjr\tra\n 54:\tswc1\t$f18,8(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000058 xyz_t_sub_ss\n\n\nContents of section .text:\n 0000 84ae0000 84cf0000 01cfc023 44982000 ...........#D. .\n 0010 00000000 468021a0 e4860000 84c80002 ....F.!.........\n 0020 84b90002 03284823 44894000 00000000 .....(H#D.@.....\n 0030 468042a0 e48a0004 84cb0004 84aa0004 F.B.............\n 0040 014b6023 448c8000 00000000 468084a0 .K`#D.......F...\n 0050 03e00008 e4920008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300df70 00000000 . .........p....\n 0010 000d0dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300df70 00000000 000d0dd0 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000016 00000008 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e0 .......(........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000038 00000288 .......D...8....\n 0040 00000010 000002c0 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 16161510 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000008 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000058 20200001 . .....*...X ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d643433 35353733 66633865 -ido-d435573fc8e\n 0130 32643164 662f752e 69007879 7a5f745f 2d1df/u.i.xyz_t_\n 0140 7375625f 73730000 78797a5f 745f7375 sub_ss..xyz_t_su\n 0150 625f7373 00000000 00000000 00000001 b_ss............\n 0160 00000000 00000037 00000000 00000004 .......7........\n 0170 00000000 00000016 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000005 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_sub_ss # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -2547,7 +2547,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `xyz_t_sub` — benchmark function af:xyz_t_sub:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_sub\n lwc1\t$f4, 0($a0)\n lwc1\t$f6, 0($a1)\n sub.s\t$f8, $f4, $f6\n swc1\t$f8, 0($a2)\n lwc1\t$f16, 4($a1)\n lwc1\t$f10, 4($a0)\n sub.s\t$f18, $f10, $f16\n swc1\t$f18, 4($a2)\n lwc1\t$f6, 8($a1)\n lwc1\t$f4, 8($a0)\n sub.s\t$f8, $f4, $f6\n jr\t$ra\n swc1\t$f8, 8($a2)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_sub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_sub` — benchmark function af:xyz_t_sub:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_sub:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tsub.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tsub.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tsub.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_sub\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062201 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105481 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062201 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d383532 37346662 37623236 -ido-85274fb7b26\n 0130 63633439 392f752e 69007879 7a5f745f cc499/u.i.xyz_t_\n 0140 73756200 78797a5f 745f7375 62000000 sub.xyz_t_sub...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"xyz_t_sub\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_sub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_sub` — benchmark function af:xyz_t_sub:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_sub:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tsub.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tsub.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tsub.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_sub\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062201 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105481 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062201 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d383532 37346662 37623236 -ido-85274fb7b26\n 0130 63633439 392f752e 69007879 7a5f745f cc499/u.i.xyz_t_\n 0140 73756200 78797a5f 745f7375 62000000 sub.xyz_t_sub...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"xyz_t_sub\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_sub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -2618,7 +2618,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `CheckTileCollisionVertical` — benchmark function kleod:CheckTileCollisionVertical:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckTileCollisionVertical\n\t.type\t CheckTileCollisionVertical,function\n\t.thumb_func\nCheckTileCollisionVertical:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x4\n\tmov\tip, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr1, r1, #0x10\n\tstr\tr1, [sp]\n\tlsl\tr2, r2, #0x10\n\tlsr\tr6, r2, #0x10\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr9, r3\n\tldr\tr0, .L10\n\tmov\tsl, r0\n\tldr\tr0, [r0]\n\tldrh\tr3, [r0, #0x2]\n\tldrh\tr1, [r0]\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n\tmov\tr8, r0\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r3\n\tlsl\tr5, r0, #0x2\n.L6:\n\tmov\tr7, r8\n\tldr\tr0, [r7, #0x4]\n\tadd\tr2, r5, r0\n\tldrh\tr0, [r2, #0x2]\n\tcmp\tr6, r0\n\tbcc\t.L5\t@cond_branch\n\tldrh\tr1, [r2, #0x6]\n\tmov\tr7, r9\n\tsub\tr0, r6, r7\n\tcmp\tr1, r0\n\tblt\t.L5\t@cond_branch\n\tldrh\tr1, [r2]\n\tadd\tr0, r1, #0x3\n\tldr\tr7, [sp]\n\tcmp\tr7, r0\n\tbge\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x3\n\tcmp\tr0, r7\n\tbge\t.L5\t@cond_branch\n\tlsl\tr1, r0, #0x10\n\tlsr\tr1, r1, #0x10\n\tldr\tr0, .L10+0x4\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tldrb\tr1, [r2, #0x8]\n\tlsl\tr1, r1, #0x10\n\tldr\tr0, .L10+0x8\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tmov\tr0, ip\n\tstr\tr4, [r0]\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03004D80\n\t.word\t-0x10000\n\t.word\t-0xff0001\n.L5:\n\tadd\tr5, r5, #0xc\n\tadd\tr3, r3, #0x1\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tldrh\tr0, [r0]\n\tcmp\tr3, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L12\n\torr\tr4, r4, r0\n\tmov\tr7, ip\n\tstr\tr4, [r7]\n.L8:\n\tmov\tr0, ip\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t CheckTileCollisionVertical,.Lfe1-CheckTileCollisionVertical\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CheckTileCollisionVertical # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CheckTileCollisionVertical` — benchmark function kleod:CheckTileCollisionVertical:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:CheckTileCollisionVertical:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckTileCollisionVertical\n\t.type\t CheckTileCollisionVertical,function\n\t.thumb_func\nCheckTileCollisionVertical:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x4\n\tmov\tip, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr1, r1, #0x10\n\tstr\tr1, [sp]\n\tlsl\tr2, r2, #0x10\n\tlsr\tr6, r2, #0x10\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr9, r3\n\tldr\tr0, .L10\n\tmov\tsl, r0\n\tldr\tr0, [r0]\n\tldrh\tr3, [r0, #0x2]\n\tldrh\tr1, [r0]\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n\tmov\tr8, r0\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r3\n\tlsl\tr5, r0, #0x2\n.L6:\n\tmov\tr7, r8\n\tldr\tr0, [r7, #0x4]\n\tadd\tr2, r5, r0\n\tldrh\tr0, [r2, #0x2]\n\tcmp\tr6, r0\n\tbcc\t.L5\t@cond_branch\n\tldrh\tr1, [r2, #0x6]\n\tmov\tr7, r9\n\tsub\tr0, r6, r7\n\tcmp\tr1, r0\n\tblt\t.L5\t@cond_branch\n\tldrh\tr1, [r2]\n\tadd\tr0, r1, #0x3\n\tldr\tr7, [sp]\n\tcmp\tr7, r0\n\tbge\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x3\n\tcmp\tr0, r7\n\tbge\t.L5\t@cond_branch\n\tlsl\tr1, r0, #0x10\n\tlsr\tr1, r1, #0x10\n\tldr\tr0, .L10+0x4\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tldrb\tr1, [r2, #0x8]\n\tlsl\tr1, r1, #0x10\n\tldr\tr0, .L10+0x8\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tmov\tr0, ip\n\tstr\tr4, [r0]\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03004D80\n\t.word\t-0x10000\n\t.word\t-0xff0001\n.L5:\n\tadd\tr5, r5, #0xc\n\tadd\tr3, r3, #0x1\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tldrh\tr0, [r0]\n\tcmp\tr3, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L12\n\torr\tr4, r4, r0\n\tmov\tr7, ip\n\tstr\tr4, [r7]\n.L8:\n\tmov\tr0, ip\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t CheckTileCollisionVertical,.Lfe1-CheckTileCollisionVertical\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CheckTileCollisionVertical # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CheckTileCollisionVertical` — benchmark function kleod:CheckTileCollisionVertical:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:CheckTileCollisionVertical:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckTileCollisionVertical\n\t.type\t CheckTileCollisionVertical,function\n\t.thumb_func\nCheckTileCollisionVertical:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x4\n\tmov\tip, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr1, r1, #0x10\n\tstr\tr1, [sp]\n\tlsl\tr2, r2, #0x10\n\tlsr\tr6, r2, #0x10\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr9, r3\n\tldr\tr0, .L10\n\tmov\tsl, r0\n\tldr\tr0, [r0]\n\tldrh\tr3, [r0, #0x2]\n\tldrh\tr1, [r0]\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n\tmov\tr8, r0\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r3\n\tlsl\tr5, r0, #0x2\n.L6:\n\tmov\tr7, r8\n\tldr\tr0, [r7, #0x4]\n\tadd\tr2, r5, r0\n\tldrh\tr0, [r2, #0x2]\n\tcmp\tr6, r0\n\tbcc\t.L5\t@cond_branch\n\tldrh\tr1, [r2, #0x6]\n\tmov\tr7, r9\n\tsub\tr0, r6, r7\n\tcmp\tr1, r0\n\tblt\t.L5\t@cond_branch\n\tldrh\tr1, [r2]\n\tadd\tr0, r1, #0x3\n\tldr\tr7, [sp]\n\tcmp\tr7, r0\n\tbge\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x3\n\tcmp\tr0, r7\n\tbge\t.L5\t@cond_branch\n\tlsl\tr1, r0, #0x10\n\tlsr\tr1, r1, #0x10\n\tldr\tr0, .L10+0x4\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tldrb\tr1, [r2, #0x8]\n\tlsl\tr1, r1, #0x10\n\tldr\tr0, .L10+0x8\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tmov\tr0, ip\n\tstr\tr4, [r0]\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03004D80\n\t.word\t-0x10000\n\t.word\t-0xff0001\n.L5:\n\tadd\tr5, r5, #0xc\n\tadd\tr3, r3, #0x1\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tldrh\tr0, [r0]\n\tcmp\tr3, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L12\n\torr\tr4, r4, r0\n\tmov\tr7, ip\n\tstr\tr4, [r7]\n.L8:\n\tmov\tr0, ip\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t CheckTileCollisionVertical,.Lfe1-CheckTileCollisionVertical\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CheckTileCollisionVertical # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -2689,7 +2689,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `CheckWorldCompletion` — benchmark function kleod:CheckWorldCompletion:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckWorldCompletion\n\t.type\t CheckWorldCompletion,function\n\t.thumb_func\nCheckWorldCompletion:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tcmp\tr0, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr0, .L30\n\tldr\tr2, [r0]\n\tmov\tr0, r9\n\tlsl\tr1, r0, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xf\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB26\n\tb\t.L5\t@long jump\n.LCB26:\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.LCB39\n\tb\t.L5\t@long jump\n.LCB39:\n.L29:\n\tmov\tr0, #0x1\n\tb\t.L27\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgUnk_03004670\n.L3:\n\tldr\tr2, .L32\n\tldr\tr0, [r2]\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB61\n\tb\t.L5\t@long jump\n.LCB61:\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tip, r1\n\tmov\tr6, #0x0\n\tmov\tsl, r6\n\tmov\tr0, #0x0\n\tadd\tr4, r2, #0\n\tmov\tr7, #0x7f\n.L10:\n\tmov\tr2, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr3, r0, #0x3\n.L14:\n\tcmp\tr2, #0x3\n\tbeq\t.L16\t@cond_branch\n\tcmp\tr2, #0x5\n\tbne\t.L15\t@cond_branch\n.L16:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L15\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr8, r0\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgUnk_03004670\n.L15:\n\tcmp\tr2, #0x7\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tip, r0\n.L17:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L13:\n\tadd\tr3, r3, #0x1\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, #0x6\n\tbls\t.L14\t@cond_branch\n\tadd\tr0, r5, #0\n\tcmp\tr0, #0x4\n\tbls\t.L10\t@cond_branch\n\tldr\tr0, .L34\n\tldr\tr1, [r0]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x30\n\tldrb\tr0, [r0]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L22\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L22:\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L23\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L23:\n\tmov\tr1, r9\n\tcmp\tr1, #0x4\n\tbne\t.L24\t@cond_branch\n\tcmp\tr3, #0x7f\n\tbeq\t.L24\t@cond_branch\n\tcmp\tr6, #0x23\n\tbeq\t.L29\t@cond_branch\n.L24:\n\tmov\tr0, r9\n\tcmp\tr0, #0x5\n\tbne\t.L25\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x18\n\tble\t.LCB220\n\tb\t.L29\t@long jump\n.LCB220:\n.L25:\n\tmov\tr0, r9\n\tcmp\tr0, #0x6\n\tbne\t.L5\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x32\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tcmp\tr0, #0x25\n\tbne\t.LCB240\n\tb\t.L29\t@long jump\n.LCB240:\n.L5:\n\tmov\tr0, #0x0\n.L27:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgUnk_03004670\n.Lfe1:\n\t.size\t CheckWorldCompletion,.Lfe1-CheckWorldCompletion\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CheckWorldCompletion # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CheckWorldCompletion` — benchmark function kleod:CheckWorldCompletion:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:CheckWorldCompletion:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckWorldCompletion\n\t.type\t CheckWorldCompletion,function\n\t.thumb_func\nCheckWorldCompletion:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tcmp\tr0, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr0, .L30\n\tldr\tr2, [r0]\n\tmov\tr0, r9\n\tlsl\tr1, r0, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xf\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB26\n\tb\t.L5\t@long jump\n.LCB26:\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.LCB39\n\tb\t.L5\t@long jump\n.LCB39:\n.L29:\n\tmov\tr0, #0x1\n\tb\t.L27\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgUnk_03004670\n.L3:\n\tldr\tr2, .L32\n\tldr\tr0, [r2]\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB61\n\tb\t.L5\t@long jump\n.LCB61:\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tip, r1\n\tmov\tr6, #0x0\n\tmov\tsl, r6\n\tmov\tr0, #0x0\n\tadd\tr4, r2, #0\n\tmov\tr7, #0x7f\n.L10:\n\tmov\tr2, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr3, r0, #0x3\n.L14:\n\tcmp\tr2, #0x3\n\tbeq\t.L16\t@cond_branch\n\tcmp\tr2, #0x5\n\tbne\t.L15\t@cond_branch\n.L16:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L15\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr8, r0\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgUnk_03004670\n.L15:\n\tcmp\tr2, #0x7\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tip, r0\n.L17:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L13:\n\tadd\tr3, r3, #0x1\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, #0x6\n\tbls\t.L14\t@cond_branch\n\tadd\tr0, r5, #0\n\tcmp\tr0, #0x4\n\tbls\t.L10\t@cond_branch\n\tldr\tr0, .L34\n\tldr\tr1, [r0]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x30\n\tldrb\tr0, [r0]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L22\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L22:\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L23\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L23:\n\tmov\tr1, r9\n\tcmp\tr1, #0x4\n\tbne\t.L24\t@cond_branch\n\tcmp\tr3, #0x7f\n\tbeq\t.L24\t@cond_branch\n\tcmp\tr6, #0x23\n\tbeq\t.L29\t@cond_branch\n.L24:\n\tmov\tr0, r9\n\tcmp\tr0, #0x5\n\tbne\t.L25\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x18\n\tble\t.LCB220\n\tb\t.L29\t@long jump\n.LCB220:\n.L25:\n\tmov\tr0, r9\n\tcmp\tr0, #0x6\n\tbne\t.L5\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x32\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tcmp\tr0, #0x25\n\tbne\t.LCB240\n\tb\t.L29\t@long jump\n.LCB240:\n.L5:\n\tmov\tr0, #0x0\n.L27:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgUnk_03004670\n.Lfe1:\n\t.size\t CheckWorldCompletion,.Lfe1-CheckWorldCompletion\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CheckWorldCompletion # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CheckWorldCompletion` — benchmark function kleod:CheckWorldCompletion:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:CheckWorldCompletion:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckWorldCompletion\n\t.type\t CheckWorldCompletion,function\n\t.thumb_func\nCheckWorldCompletion:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tcmp\tr0, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr0, .L30\n\tldr\tr2, [r0]\n\tmov\tr0, r9\n\tlsl\tr1, r0, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xf\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB26\n\tb\t.L5\t@long jump\n.LCB26:\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.LCB39\n\tb\t.L5\t@long jump\n.LCB39:\n.L29:\n\tmov\tr0, #0x1\n\tb\t.L27\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgUnk_03004670\n.L3:\n\tldr\tr2, .L32\n\tldr\tr0, [r2]\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB61\n\tb\t.L5\t@long jump\n.LCB61:\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tip, r1\n\tmov\tr6, #0x0\n\tmov\tsl, r6\n\tmov\tr0, #0x0\n\tadd\tr4, r2, #0\n\tmov\tr7, #0x7f\n.L10:\n\tmov\tr2, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr3, r0, #0x3\n.L14:\n\tcmp\tr2, #0x3\n\tbeq\t.L16\t@cond_branch\n\tcmp\tr2, #0x5\n\tbne\t.L15\t@cond_branch\n.L16:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L15\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr8, r0\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgUnk_03004670\n.L15:\n\tcmp\tr2, #0x7\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tip, r0\n.L17:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L13:\n\tadd\tr3, r3, #0x1\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, #0x6\n\tbls\t.L14\t@cond_branch\n\tadd\tr0, r5, #0\n\tcmp\tr0, #0x4\n\tbls\t.L10\t@cond_branch\n\tldr\tr0, .L34\n\tldr\tr1, [r0]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x30\n\tldrb\tr0, [r0]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L22\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L22:\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L23\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L23:\n\tmov\tr1, r9\n\tcmp\tr1, #0x4\n\tbne\t.L24\t@cond_branch\n\tcmp\tr3, #0x7f\n\tbeq\t.L24\t@cond_branch\n\tcmp\tr6, #0x23\n\tbeq\t.L29\t@cond_branch\n.L24:\n\tmov\tr0, r9\n\tcmp\tr0, #0x5\n\tbne\t.L25\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x18\n\tble\t.LCB220\n\tb\t.L29\t@long jump\n.LCB220:\n.L25:\n\tmov\tr0, r9\n\tcmp\tr0, #0x6\n\tbne\t.L5\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x32\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tcmp\tr0, #0x25\n\tbne\t.LCB240\n\tb\t.L29\t@long jump\n.LCB240:\n.L5:\n\tmov\tr0, #0x0\n.L27:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgUnk_03004670\n.Lfe1:\n\t.size\t CheckWorldCompletion,.Lfe1-CheckWorldCompletion\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CheckWorldCompletion # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -2715,23 +2715,44 @@ "asmlift": { "decompiler": "asmlift", "symbolMap": true, - "outcome": "noncompile", - "source": "s32 CopyBGScrollTiles(void) {\n s32 v0;\n u32 v1;\n s32 v2;\n v1 = 0;\n do {\n if (v1 >= *(u8 *)&gUnk_03005220 << 30 >> 30) {\n v2 = 2;\n } else {\n v2 = 0;\n }\n gBgTilemapBufs[(v1 << 1) + 577] = gBgTilemapBufs[(v1 << 1) + (v2 + 20 << 5)];\n gBgTilemapBufs[(v1 << 1) + 578] = gBgTilemapBufs[(v1 << 1) + ((v2 + 20 << 5) + 1)];\n gBgTilemapBufs[(v1 << 1) + 609] = gBgTilemapBufs[(v1 << 1) + (v2 + 21 << 5)];\n v0 = gBgTilemapBufs[(v1 << 1) + ((v2 + 21 << 5) + 1)];\n gBgTilemapBufs[(v1 << 1) + 610] = v0;\n v1 = v1 + 1;\n } while (v1 <= 2);\n return v0;\n}\n", - "score": null, - "maxScore": null, - "compileErrors": 1, + "candidateLabel": "unsigned", + "droppedCandidates": [ + { + "label": "unsigned/raw-globals", + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-GigbUY/c.c:1078: invalid operands to binary <<" + } + ], + "symbolsUsed": [ + { + "name": "gBgTilemapBufs", + "shape": "u16[]" + }, + { + "name": "gUnk_03005220", + "shape": "struct Unk_03005220 (100 B)" + } + ], + "outcome": "nonmatch", + "source": "s32 CopyBGScrollTiles(void) {\n s32 v0;\n u32 v1;\n s32 v2;\n v1 = 0;\n do {\n if (v1 >= (u32)(*(u8 *)&gUnk_03005220 << 30) >> 30) {\n v2 = 2;\n } else {\n v2 = 0;\n }\n gBgTilemapBufs[0][(v1 << 1) + 577] = gBgTilemapBufs[0][(v1 << 1) + (v2 + 20 << 5)];\n gBgTilemapBufs[0][(v1 << 1) + 578] = gBgTilemapBufs[0][(v1 << 1) + ((v2 + 20 << 5) + 1)];\n gBgTilemapBufs[0][(v1 << 1) + 609] = gBgTilemapBufs[0][(v1 << 1) + (v2 + 21 << 5)];\n v0 = gBgTilemapBufs[0][(v1 << 1) + ((v2 + 21 << 5) + 1)];\n gBgTilemapBufs[0][(v1 << 1) + 610] = v0;\n v1 = v1 + 1;\n } while (v1 <= 2);\n return v0;\n}\n", + "score": 32, + "maxScore": 74, + "compileErrors": null, + "breakdown": { + "insert": 6, + "delete": 4, + "replace": 1, + "opMismatch": 1, + "argMismatch": 20 + }, "quality": { - "score": 100, + "score": 98, "lines": 20, "gotos": 0, - "casts": 2, + "casts": 3, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 - }, - "errorMarkers": [ - "no scorable candidate for 'CopyBGScrollTiles': agbcc failed: /c.c:1078: invalid operands to binary <<" - ] + } }, "m2c": { "decompiler": "m2c", @@ -2753,10 +2774,22 @@ "agbcc failed: /c.c:1082: invalid operands to binary <<" ] }, - "gapSize": null, + "gapSize": { + "decompiler": "asmlift", + "score": 32, + "maxScore": 74, + "ratio": 0.43243243243243246, + "kinds": { + "insert": 6, + "delete": 4, + "replace": 1, + "opMismatch": 1, + "argMismatch": 20 + } + }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `CopyBGScrollTiles` — benchmark function kleod:CopyBGScrollTiles:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCopyBGScrollTiles\n\t.type\t CopyBGScrollTiles,function\n\t.thumb_func\nCopyBGScrollTiles:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr6, #0x0\n\tldr\tr7, .L10\n\tldr\tr4, .L10+0x4\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x1e\n\tlsr\tr0, r0, #0x1e\n\tmov\tr5, #0x2\n\tcmp\tr6, r0\n\tbcs\t.L7\t@cond_branch\n\tmov\tr5, #0x0\n.L7:\n\tlsl\tr3, r6, #0x1\n\tldr\tr0, .L10+0x8\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r5, #0\n\tadd\tr1, r1, #0x14\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0xc\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r1, #0x1\n\tadd\tr1, r3, r1\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tldrh\tr0, [r1]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0x10\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r5, #0\n\tadd\tr2, r2, #0x15\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r3, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L10+0x14\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r4\n\tldrh\tr0, [r3]\n\tstrh\tr0, [r1]\n\tadd\tr6, r6, #0x1\n\tcmp\tr6, #0x2\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x241\n\t.word\t0x242\n\t.word\t0x261\n\t.word\t0x262\n.Lfe1:\n\t.size\t CopyBGScrollTiles,.Lfe1-CopyBGScrollTiles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid CopyBGScrollTiles(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CopyBGScrollTiles # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CopyBGScrollTiles` — benchmark function kleod:CopyBGScrollTiles:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:CopyBGScrollTiles:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCopyBGScrollTiles\n\t.type\t CopyBGScrollTiles,function\n\t.thumb_func\nCopyBGScrollTiles:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr6, #0x0\n\tldr\tr7, .L10\n\tldr\tr4, .L10+0x4\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x1e\n\tlsr\tr0, r0, #0x1e\n\tmov\tr5, #0x2\n\tcmp\tr6, r0\n\tbcs\t.L7\t@cond_branch\n\tmov\tr5, #0x0\n.L7:\n\tlsl\tr3, r6, #0x1\n\tldr\tr0, .L10+0x8\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r5, #0\n\tadd\tr1, r1, #0x14\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0xc\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r1, #0x1\n\tadd\tr1, r3, r1\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tldrh\tr0, [r1]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0x10\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r5, #0\n\tadd\tr2, r2, #0x15\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r3, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L10+0x14\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r4\n\tldrh\tr0, [r3]\n\tstrh\tr0, [r1]\n\tadd\tr6, r6, #0x1\n\tcmp\tr6, #0x2\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x241\n\t.word\t0x242\n\t.word\t0x261\n\t.word\t0x262\n.Lfe1:\n\t.size\t CopyBGScrollTiles,.Lfe1-CopyBGScrollTiles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CopyBGScrollTiles # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CopyBGScrollTiles` — benchmark function kleod:CopyBGScrollTiles:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:CopyBGScrollTiles:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCopyBGScrollTiles\n\t.type\t CopyBGScrollTiles,function\n\t.thumb_func\nCopyBGScrollTiles:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr6, #0x0\n\tldr\tr7, .L10\n\tldr\tr4, .L10+0x4\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x1e\n\tlsr\tr0, r0, #0x1e\n\tmov\tr5, #0x2\n\tcmp\tr6, r0\n\tbcs\t.L7\t@cond_branch\n\tmov\tr5, #0x0\n.L7:\n\tlsl\tr3, r6, #0x1\n\tldr\tr0, .L10+0x8\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r5, #0\n\tadd\tr1, r1, #0x14\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0xc\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r1, #0x1\n\tadd\tr1, r3, r1\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tldrh\tr0, [r1]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0x10\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r5, #0\n\tadd\tr2, r2, #0x15\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r3, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L10+0x14\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r4\n\tldrh\tr0, [r3]\n\tstrh\tr0, [r1]\n\tadd\tr6, r6, #0x1\n\tcmp\tr6, #0x2\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x241\n\t.word\t0x242\n\t.word\t0x261\n\t.word\t0x262\n.Lfe1:\n\t.size\t CopyBGScrollTiles,.Lfe1-CopyBGScrollTiles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CopyBGScrollTiles # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -2791,14 +2824,14 @@ "candidateLabel": "unsigned", "symbolsUsed": [], "outcome": "nonmatch", - "source": "void Decompress(u32 a0, s32 * a1) {\n s32 v0;\n s32 v1;\n if (*a1 >= 0) {\n v1 = LZ77UnCompWram(a1 + 1, a0);\n } else {\n v0 = thunk_HeapAlloc(a1[1] >> 8, 0);\n HuffUnComp(a1 + 1, v0);\n LZ77UnCompWram(v0, a0);\n v1 = thunk_HeapFree(v0, a0);\n }\n return;\n}\n", - "score": 10, + "source": "void Decompress(u32 a0, s32 * a1) {\n s32 v0;\n s32 v1;\n if (*a1 >= 0) {\n v1 = LZ77UnCompWram(a1 + 1, a0);\n } else {\n v0 = thunk_HeapAlloc((u32)a1[1] >> 8, 0);\n HuffUnComp(a1 + 1, v0);\n LZ77UnCompWram(v0, a0);\n v1 = thunk_HeapFree(v0, a0);\n }\n return;\n}\n", + "score": 9, "maxScore": 30, "compileErrors": null, "breakdown": { "insert": 4, "delete": 3, - "replace": 1, + "replace": 0, "opMismatch": 1, "argMismatch": 1 }, @@ -2806,7 +2839,7 @@ "score": 100, "lines": 13, "gotos": 0, - "casts": 0, + "casts": 1, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -2838,20 +2871,20 @@ }, "gapSize": { "decompiler": "asmlift", - "score": 10, + "score": 9, "maxScore": 30, - "ratio": 0.3333333333333333, + "ratio": 0.3, "kinds": { "insert": 4, "delete": 3, - "replace": 1, + "replace": 0, "opMismatch": 1, "argMismatch": 1 } }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `Decompress` — benchmark function kleod:Decompress:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompress\n\t.type\t Decompress,function\n\t.thumb_func\nDecompress:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tldr\tr0, [r5]\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tldr\tr0, [r5, #0x4]\n\tlsr\tr0, r0, #0x8\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r4, #0\n\tbl\tHuffUnComp\n\tadd\tr0, r4, #0\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n\tadd\tr0, r4, #0\n\tbl\tthunk_HeapFree\n\tb\t.L4\n.L3:\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n.L4:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t Decompress,.Lfe1-Decompress\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid *thunk_HeapAlloc(u32, u32);\nvoid thunk_HeapFree(void *);\nvoid HuffUnComp(void *, void *);\nvoid LZ77UnCompWram(void *, void *);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Decompress # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `Decompress` — benchmark function kleod:Decompress:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:Decompress:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompress\n\t.type\t Decompress,function\n\t.thumb_func\nDecompress:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tldr\tr0, [r5]\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tldr\tr0, [r5, #0x4]\n\tlsr\tr0, r0, #0x8\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r4, #0\n\tbl\tHuffUnComp\n\tadd\tr0, r4, #0\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n\tadd\tr0, r4, #0\n\tbl\tthunk_HeapFree\n\tb\t.L4\n.L3:\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n.L4:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t Decompress,.Lfe1-Decompress\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"Decompress\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Decompress # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `Decompress` — benchmark function kleod:Decompress:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:Decompress:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompress\n\t.type\t Decompress,function\n\t.thumb_func\nDecompress:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tldr\tr0, [r5]\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tldr\tr0, [r5, #0x4]\n\tlsr\tr0, r0, #0x8\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r4, #0\n\tbl\tHuffUnComp\n\tadd\tr0, r4, #0\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n\tadd\tr0, r4, #0\n\tbl\tthunk_HeapFree\n\tb\t.L4\n.L3:\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n.L4:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t Decompress,.Lfe1-Decompress\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"Decompress\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Decompress # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -2926,7 +2959,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `DecompressAlloc` — benchmark function kleod:DecompressAlloc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressAlloc\n\t.type\t DecompressAlloc,function\n\t.thumb_func\nDecompressAlloc:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tldr\tr0, [r5]\n\tldr\tr1, .L3\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x7fffffff\n.Lfe1:\n\t.size\t DecompressAlloc,.Lfe1-DecompressAlloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-bbb0f9d88b2b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *DecompressAlloc(void *src);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DecompressAlloc # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `DecompressAlloc` — benchmark function kleod:DecompressAlloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DecompressAlloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressAlloc\n\t.type\t DecompressAlloc,function\n\t.thumb_func\nDecompressAlloc:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tldr\tr0, [r5]\n\tldr\tr1, .L3\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x7fffffff\n.Lfe1:\n\t.size\t DecompressAlloc,.Lfe1-DecompressAlloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DecompressAlloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `DecompressAlloc` — benchmark function kleod:DecompressAlloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DecompressAlloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressAlloc\n\t.type\t DecompressAlloc,function\n\t.thumb_func\nDecompressAlloc:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tldr\tr0, [r5]\n\tldr\tr1, .L3\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x7fffffff\n.Lfe1:\n\t.size\t DecompressAlloc,.Lfe1-DecompressAlloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DecompressAlloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -3021,7 +3054,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `DecompressDma` — benchmark function kleod:DecompressDma:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressDma\n\t.type\t DecompressDma,function\n\t.thumb_func\nDecompressDma:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr5, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr4, r2, #0x10\n\tldr\tr0, [r5]\n\tldr\tr1, .L7\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr7, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tldr\tr1, .L7+0x4\n\tadd\tr0, r7, #0x4\n\tstr\tr0, [r1]\n\tstr\tr6, [r1, #0x4]\n\tlsr\tr4, r4, #0x11\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\torr\tr4, r4, r2\n\tstr\tr4, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n.L3:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r7, #0\n\tbl\tthunk_HeapFree\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x7fffffff\n\t.word\t0x40000d4\n.Lfe1:\n\t.size\t DecompressDma,.Lfe1-DecompressDma\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid *thunk_HeapAlloc(u32, u32);\nvoid thunk_HeapFree(void *);\nvoid Decompress(void *, void *);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DecompressDma # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `DecompressDma` — benchmark function kleod:DecompressDma:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DecompressDma:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressDma\n\t.type\t DecompressDma,function\n\t.thumb_func\nDecompressDma:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr5, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr4, r2, #0x10\n\tldr\tr0, [r5]\n\tldr\tr1, .L7\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr7, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tldr\tr1, .L7+0x4\n\tadd\tr0, r7, #0x4\n\tstr\tr0, [r1]\n\tstr\tr6, [r1, #0x4]\n\tlsr\tr4, r4, #0x11\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\torr\tr4, r4, r2\n\tstr\tr4, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n.L3:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r7, #0\n\tbl\tthunk_HeapFree\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x7fffffff\n\t.word\t0x40000d4\n.Lfe1:\n\t.size\t DecompressDma,.Lfe1-DecompressDma\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"DecompressDma\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DecompressDma # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `DecompressDma` — benchmark function kleod:DecompressDma:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DecompressDma:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressDma\n\t.type\t DecompressDma,function\n\t.thumb_func\nDecompressDma:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr5, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr4, r2, #0x10\n\tldr\tr0, [r5]\n\tldr\tr1, .L7\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr7, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tldr\tr1, .L7+0x4\n\tadd\tr0, r7, #0x4\n\tstr\tr0, [r1]\n\tstr\tr6, [r1, #0x4]\n\tlsr\tr4, r4, #0x11\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\torr\tr4, r4, r2\n\tstr\tr4, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n.L3:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r7, #0\n\tbl\tthunk_HeapFree\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x7fffffff\n\t.word\t0x40000d4\n.Lfe1:\n\t.size\t DecompressDma,.Lfe1-DecompressDma\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"DecompressDma\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DecompressDma # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -3096,7 +3129,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `DivideQ4` — benchmark function kleod:DivideQ4:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ4\n\t.type\t DivideQ4,function\n\t.thumb_func\nDivideQ4:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0xc\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ4,.Lfe1-DivideQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DivideQ4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `DivideQ4` — benchmark function kleod:DivideQ4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DivideQ4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ4\n\t.type\t DivideQ4,function\n\t.thumb_func\nDivideQ4:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0xc\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ4,.Lfe1-DivideQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DivideQ4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `DivideQ4` — benchmark function kleod:DivideQ4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DivideQ4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ4\n\t.type\t DivideQ4,function\n\t.thumb_func\nDivideQ4:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0xc\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ4,.Lfe1-DivideQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DivideQ4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -3171,7 +3204,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `DivideQ8` — benchmark function kleod:DivideQ8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ8\n\t.type\t DivideQ8,function\n\t.thumb_func\nDivideQ8:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ8,.Lfe1-DivideQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DivideQ8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `DivideQ8` — benchmark function kleod:DivideQ8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DivideQ8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ8\n\t.type\t DivideQ8,function\n\t.thumb_func\nDivideQ8:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ8,.Lfe1-DivideQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DivideQ8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `DivideQ8` — benchmark function kleod:DivideQ8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DivideQ8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ8\n\t.type\t DivideQ8,function\n\t.thumb_func\nDivideQ8:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ8,.Lfe1-DivideQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DivideQ8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -3270,7 +3303,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `DmaSpriteToObjVram` — benchmark function kleod:DmaSpriteToObjVram:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDmaSpriteToObjVram\n\t.type\t DmaSpriteToObjVram,function\n\t.thumb_func\nDmaSpriteToObjVram:\n\tldr\tr3, .L3\n\tldr\tr2, .L3+0x4\n\tldr\tr2, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r2\n\tldrh\tr2, [r0, #0x6]\n\tlsl\tr1, r1, #0x5\n\tmul\tr2, r2, r1\n\tldr\tr1, [r0]\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3]\n\tldrh\tr1, [r0, #0x4]\n\tlsl\tr1, r1, #0x5\n\tldr\tr2, .L3+0x8\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3, #0x4]\n\tldrh\tr0, [r0, #0x6]\n\tlsl\tr0, r0, #0x4\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r3, #0x8]\n\tldr\tr0, [r3, #0x8]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x40000d4\n\t.word\t0x30007c8\n\t.word\t0x6010000\n.Lfe1:\n\t.size\t DmaSpriteToObjVram,.Lfe1-DmaSpriteToObjVram\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DmaSpriteToObjVram # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `DmaSpriteToObjVram` — benchmark function kleod:DmaSpriteToObjVram:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DmaSpriteToObjVram:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDmaSpriteToObjVram\n\t.type\t DmaSpriteToObjVram,function\n\t.thumb_func\nDmaSpriteToObjVram:\n\tldr\tr3, .L3\n\tldr\tr2, .L3+0x4\n\tldr\tr2, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r2\n\tldrh\tr2, [r0, #0x6]\n\tlsl\tr1, r1, #0x5\n\tmul\tr2, r2, r1\n\tldr\tr1, [r0]\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3]\n\tldrh\tr1, [r0, #0x4]\n\tlsl\tr1, r1, #0x5\n\tldr\tr2, .L3+0x8\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3, #0x4]\n\tldrh\tr0, [r0, #0x6]\n\tlsl\tr0, r0, #0x4\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r3, #0x8]\n\tldr\tr0, [r3, #0x8]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x40000d4\n\t.word\t0x30007c8\n\t.word\t0x6010000\n.Lfe1:\n\t.size\t DmaSpriteToObjVram,.Lfe1-DmaSpriteToObjVram\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"DmaSpriteToObjVram\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DmaSpriteToObjVram # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `DmaSpriteToObjVram` — benchmark function kleod:DmaSpriteToObjVram:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DmaSpriteToObjVram:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDmaSpriteToObjVram\n\t.type\t DmaSpriteToObjVram,function\n\t.thumb_func\nDmaSpriteToObjVram:\n\tldr\tr3, .L3\n\tldr\tr2, .L3+0x4\n\tldr\tr2, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r2\n\tldrh\tr2, [r0, #0x6]\n\tlsl\tr1, r1, #0x5\n\tmul\tr2, r2, r1\n\tldr\tr1, [r0]\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3]\n\tldrh\tr1, [r0, #0x4]\n\tlsl\tr1, r1, #0x5\n\tldr\tr2, .L3+0x8\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3, #0x4]\n\tldrh\tr0, [r0, #0x6]\n\tlsl\tr0, r0, #0x4\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r3, #0x8]\n\tldr\tr0, [r3, #0x8]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x40000d4\n\t.word\t0x30007c8\n\t.word\t0x6010000\n.Lfe1:\n\t.size\t DmaSpriteToObjVram,.Lfe1-DmaSpriteToObjVram\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"DmaSpriteToObjVram\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DmaSpriteToObjVram # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -3305,7 +3338,7 @@ "droppedCandidates": [ { "label": "unsigned", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-qbbic1/c.c:1076: `gBgDataPtrs' undeclared (first use in this function)" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-X3ad9I/c.c:1076: `gBgDataPtrs' undeclared (first use in this function)" } ], "symbolsUsed": [], @@ -3358,7 +3391,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `FreeAllDecompBuffers` — benchmark function kleod:FreeAllDecompBuffers:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tFreeAllDecompBuffers\n\t.type\t FreeAllDecompBuffers,function\n\t.thumb_func\nFreeAllDecompBuffers:\n\tpush\t{r4, lr}\n\tldr\tr4, .L4\n\tldr\tr0, [r4, #0x4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x8]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x14]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x10]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr4, .L4+0x4\n\tldr\tr0, [r4]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tmov\tr0, #0x0\n\tstr\tr0, [r4]\n.L3:\n\tmov\tr0, #0x8d\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8e\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8f\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x90\n\tbl\tm4aSongNumStart\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x3004790\n\t.word\t0x3005290\n.Lfe1:\n\t.size\t FreeAllDecompBuffers,.Lfe1-FreeAllDecompBuffers\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-f808d4b2fde6.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid FreeAllDecompBuffers(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function FreeAllDecompBuffers # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `FreeAllDecompBuffers` — benchmark function kleod:FreeAllDecompBuffers:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:FreeAllDecompBuffers:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tFreeAllDecompBuffers\n\t.type\t FreeAllDecompBuffers,function\n\t.thumb_func\nFreeAllDecompBuffers:\n\tpush\t{r4, lr}\n\tldr\tr4, .L4\n\tldr\tr0, [r4, #0x4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x8]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x14]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x10]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr4, .L4+0x4\n\tldr\tr0, [r4]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tmov\tr0, #0x0\n\tstr\tr0, [r4]\n.L3:\n\tmov\tr0, #0x8d\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8e\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8f\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x90\n\tbl\tm4aSongNumStart\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x3004790\n\t.word\t0x3005290\n.Lfe1:\n\t.size\t FreeAllDecompBuffers,.Lfe1-FreeAllDecompBuffers\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"FreeAllDecompBuffers\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name FreeAllDecompBuffers # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `FreeAllDecompBuffers` — benchmark function kleod:FreeAllDecompBuffers:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:FreeAllDecompBuffers:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tFreeAllDecompBuffers\n\t.type\t FreeAllDecompBuffers,function\n\t.thumb_func\nFreeAllDecompBuffers:\n\tpush\t{r4, lr}\n\tldr\tr4, .L4\n\tldr\tr0, [r4, #0x4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x8]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x14]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x10]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr4, .L4+0x4\n\tldr\tr0, [r4]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tmov\tr0, #0x0\n\tstr\tr0, [r4]\n.L3:\n\tmov\tr0, #0x8d\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8e\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8f\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x90\n\tbl\tm4aSongNumStart\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x3004790\n\t.word\t0x3005290\n.Lfe1:\n\t.size\t FreeAllDecompBuffers,.Lfe1-FreeAllDecompBuffers\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"FreeAllDecompBuffers\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name FreeAllDecompBuffers # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -3444,7 +3477,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `GameUpdate` — benchmark function kleod:GameUpdate:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGameUpdate\n\t.type\t GameUpdate,function\n\t.thumb_func\nGameUpdate:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tbl\tUpdateWorldMapNodeState\n\tbl\tUpdatePlayerInput\n\tbl\tInitPlayerCollision\n\tbl\tUpdateWorldMapCursor\n.L3:\n\tbl\tUpdatePaletteAnimations\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x30034e4\n.Lfe1:\n\t.size\t GameUpdate,.Lfe1-GameUpdate\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid UpdateWorldMapNodeState(void);\nvoid UpdatePlayerInput(void);\nvoid InitPlayerCollision(void);\nvoid UpdateWorldMapCursor(void);\nvoid UpdatePaletteAnimations(void);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GameUpdate # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GameUpdate` — benchmark function kleod:GameUpdate:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:GameUpdate:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGameUpdate\n\t.type\t GameUpdate,function\n\t.thumb_func\nGameUpdate:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tbl\tUpdateWorldMapNodeState\n\tbl\tUpdatePlayerInput\n\tbl\tInitPlayerCollision\n\tbl\tUpdateWorldMapCursor\n.L3:\n\tbl\tUpdatePaletteAnimations\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x30034e4\n.Lfe1:\n\t.size\t GameUpdate,.Lfe1-GameUpdate\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GameUpdate\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GameUpdate # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GameUpdate` — benchmark function kleod:GameUpdate:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:GameUpdate:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGameUpdate\n\t.type\t GameUpdate,function\n\t.thumb_func\nGameUpdate:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tbl\tUpdateWorldMapNodeState\n\tbl\tUpdatePlayerInput\n\tbl\tInitPlayerCollision\n\tbl\tUpdateWorldMapCursor\n.L3:\n\tbl\tUpdatePaletteAnimations\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x30034e4\n.Lfe1:\n\t.size\t GameUpdate,.Lfe1-GameUpdate\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GameUpdate\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GameUpdate # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -3548,7 +3581,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `GetEntityLookupData` — benchmark function kleod:GetEntityLookupData:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetEntityLookupData\n\t.type\t GetEntityLookupData,function\n\t.thumb_func\nGetEntityLookupData:\n\tlsl\tr0, r0, #0x18\n\tldr\tr2, .L3\n\tldr\tr1, .L3+0x4\n\tlsr\tr0, r0, #0x15\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x5]\n\tstrb\tr1, [r2, #0x11]\n\tldrb\tr0, [r0, #0x6]\n\tstrb\tr0, [r2, #0x12]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntityDataTable\n.Lfe1:\n\t.size\t GetEntityLookupData,.Lfe1-GetEntityLookupData\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid GetEntityLookupData(u8 idx);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GetEntityLookupData # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GetEntityLookupData` — benchmark function kleod:GetEntityLookupData:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:GetEntityLookupData:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetEntityLookupData\n\t.type\t GetEntityLookupData,function\n\t.thumb_func\nGetEntityLookupData:\n\tlsl\tr0, r0, #0x18\n\tldr\tr2, .L3\n\tldr\tr1, .L3+0x4\n\tlsr\tr0, r0, #0x15\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x5]\n\tstrb\tr1, [r2, #0x11]\n\tldrb\tr0, [r0, #0x6]\n\tstrb\tr0, [r2, #0x12]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntityDataTable\n.Lfe1:\n\t.size\t GetEntityLookupData,.Lfe1-GetEntityLookupData\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GetEntityLookupData\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetEntityLookupData # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GetEntityLookupData` — benchmark function kleod:GetEntityLookupData:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:GetEntityLookupData:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetEntityLookupData\n\t.type\t GetEntityLookupData,function\n\t.thumb_func\nGetEntityLookupData:\n\tlsl\tr0, r0, #0x18\n\tldr\tr2, .L3\n\tldr\tr1, .L3+0x4\n\tlsr\tr0, r0, #0x15\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x5]\n\tstrb\tr1, [r2, #0x11]\n\tldrb\tr0, [r0, #0x6]\n\tstrb\tr0, [r2, #0x12]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntityDataTable\n.Lfe1:\n\t.size\t GetEntityLookupData,.Lfe1-GetEntityLookupData\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GetEntityLookupData\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetEntityLookupData # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -3623,7 +3656,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `MultiplyQ4` — benchmark function kleod:MultiplyQ4:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ4\n\t.type\t MultiplyQ4,function\n\t.thumb_func\nMultiplyQ4:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xf\n.L3:\n\tlsl\tr0, r1, #0xc\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ4,.Lfe1-MultiplyQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MultiplyQ4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MultiplyQ4` — benchmark function kleod:MultiplyQ4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:MultiplyQ4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ4\n\t.type\t MultiplyQ4,function\n\t.thumb_func\nMultiplyQ4:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xf\n.L3:\n\tlsl\tr0, r1, #0xc\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ4,.Lfe1-MultiplyQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MultiplyQ4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MultiplyQ4` — benchmark function kleod:MultiplyQ4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:MultiplyQ4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ4\n\t.type\t MultiplyQ4,function\n\t.thumb_func\nMultiplyQ4:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xf\n.L3:\n\tlsl\tr0, r1, #0xc\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ4,.Lfe1-MultiplyQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MultiplyQ4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -3698,7 +3731,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `MultiplyQ8` — benchmark function kleod:MultiplyQ8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ8\n\t.type\t MultiplyQ8,function\n\t.thumb_func\nMultiplyQ8:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ8,.Lfe1-MultiplyQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MultiplyQ8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MultiplyQ8` — benchmark function kleod:MultiplyQ8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:MultiplyQ8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ8\n\t.type\t MultiplyQ8,function\n\t.thumb_func\nMultiplyQ8:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ8,.Lfe1-MultiplyQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MultiplyQ8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MultiplyQ8` — benchmark function kleod:MultiplyQ8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:MultiplyQ8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ8\n\t.type\t MultiplyQ8,function\n\t.thumb_func\nMultiplyQ8:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ8,.Lfe1-MultiplyQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MultiplyQ8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -3732,7 +3765,7 @@ } ], "outcome": "match", - "source": "struct Elem0 { u8 _pad0[3]; u8 field_3; u8 _pad1[16]; u16 field_20; u8 _pad2[14]; };\ns32 ProcessHBlankWait(u32 a0) {\n s32 v0;\n *(u16 *)67109376 = *(u16 *)67109376 | 2;\n *(u16 *)67108868 = *(u16 *)67108868 | 16;\n if (((struct Elem0 *)gBuffer_52A4)[a0].field_3 >> 7 != 0) {\n return 1;\n } else {\n v0 = ((struct Elem0 *)gBuffer_52A4)[a0].field_20;\n ((struct Elem0 *)gBuffer_52A4)[a0].field_20 = v0 - 1;\n if (v0 - 1 << 16 < 0) {\n *(u16 *)67109376 = 65533 & *(u16 *)67109376;\n *(u16 *)67108868 = 65519 & *(u16 *)67108868;\n return 0;\n } else {\n return 1;\n }\n }\n}\n", + "source": "struct Elem0 { u8 _pad0[3]; u8 field_3; u8 _pad1[16]; u16 field_20; u8 _pad2[14]; };\ns32 ProcessHBlankWait(u32 a0) {\n s32 v0;\n *(u16 *)67109376 = *(u16 *)67109376 | 2;\n *(u16 *)67108868 = *(u16 *)67108868 | 16;\n if ((u32)((struct Elem0 *)gBuffer_52A4)[a0].field_3 >> 7 != 0) {\n return 1;\n } else {\n v0 = ((struct Elem0 *)gBuffer_52A4)[a0].field_20;\n ((struct Elem0 *)gBuffer_52A4)[a0].field_20 = v0 - 1;\n if (v0 - 1 << 16 < 0) {\n *(u16 *)67109376 = 65533 & *(u16 *)67109376;\n *(u16 *)67108868 = 65519 & *(u16 *)67108868;\n return 0;\n } else {\n return 1;\n }\n }\n}\n", "score": 0, "maxScore": 47, "compileErrors": null, @@ -3747,7 +3780,7 @@ "score": 88, "lines": 19, "gotos": 0, - "casts": 8, + "casts": 9, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -3779,7 +3812,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `ProcessHBlankWait` — benchmark function kleod:ProcessHBlankWait:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessHBlankWait\n\t.type\t ProcessHBlankWait,function\n\t.thumb_func\nProcessHBlankWait:\n\tpush\t{r4, lr}\n\tldr\tr3, .L7\n\tldrh\tr1, [r3]\n\tmov\tr2, #0x2\n\torr\tr1, r1, r2\n\tstrh\tr1, [r3]\n\tldr\tr4, .L7+0x4\n\tldrh\tr1, [r4]\n\tmov\tr2, #0x10\n\torr\tr1, r1, r2\n\tstrh\tr1, [r4]\n\tldr\tr1, .L7+0x8\n\tldr\tr2, [r1]\n\tlsl\tr1, r0, #0x3\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r2\n\tldrb\tr0, [r1, #0x3]\n\tlsr\tr0, r0, #0x7\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldrh\tr0, [r1, #0x14]\n\tsub\tr0, r0, #0x1\n\tstrh\tr0, [r1, #0x14]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n.L6:\n\tmov\tr0, #0x1\n\tb\t.L5\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\t0x30052a4\n.L4:\n\tldrh\tr1, [r3]\n\tldr\tr0, .L9\n\tand\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrh\tr1, [r4]\n\tldr\tr0, .L9+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\t0xfffd\n\t.word\t0xffef\n.Lfe1:\n\t.size\t ProcessHBlankWait,.Lfe1-ProcessHBlankWait\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ProcessHBlankWait # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ProcessHBlankWait` — benchmark function kleod:ProcessHBlankWait:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ProcessHBlankWait:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessHBlankWait\n\t.type\t ProcessHBlankWait,function\n\t.thumb_func\nProcessHBlankWait:\n\tpush\t{r4, lr}\n\tldr\tr3, .L7\n\tldrh\tr1, [r3]\n\tmov\tr2, #0x2\n\torr\tr1, r1, r2\n\tstrh\tr1, [r3]\n\tldr\tr4, .L7+0x4\n\tldrh\tr1, [r4]\n\tmov\tr2, #0x10\n\torr\tr1, r1, r2\n\tstrh\tr1, [r4]\n\tldr\tr1, .L7+0x8\n\tldr\tr2, [r1]\n\tlsl\tr1, r0, #0x3\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r2\n\tldrb\tr0, [r1, #0x3]\n\tlsr\tr0, r0, #0x7\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldrh\tr0, [r1, #0x14]\n\tsub\tr0, r0, #0x1\n\tstrh\tr0, [r1, #0x14]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n.L6:\n\tmov\tr0, #0x1\n\tb\t.L5\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\t0x30052a4\n.L4:\n\tldrh\tr1, [r3]\n\tldr\tr0, .L9\n\tand\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrh\tr1, [r4]\n\tldr\tr0, .L9+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\t0xfffd\n\t.word\t0xffef\n.Lfe1:\n\t.size\t ProcessHBlankWait,.Lfe1-ProcessHBlankWait\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ProcessHBlankWait # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ProcessHBlankWait` — benchmark function kleod:ProcessHBlankWait:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ProcessHBlankWait:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessHBlankWait\n\t.type\t ProcessHBlankWait,function\n\t.thumb_func\nProcessHBlankWait:\n\tpush\t{r4, lr}\n\tldr\tr3, .L7\n\tldrh\tr1, [r3]\n\tmov\tr2, #0x2\n\torr\tr1, r1, r2\n\tstrh\tr1, [r3]\n\tldr\tr4, .L7+0x4\n\tldrh\tr1, [r4]\n\tmov\tr2, #0x10\n\torr\tr1, r1, r2\n\tstrh\tr1, [r4]\n\tldr\tr1, .L7+0x8\n\tldr\tr2, [r1]\n\tlsl\tr1, r0, #0x3\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r2\n\tldrb\tr0, [r1, #0x3]\n\tlsr\tr0, r0, #0x7\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldrh\tr0, [r1, #0x14]\n\tsub\tr0, r0, #0x1\n\tstrh\tr0, [r1, #0x14]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n.L6:\n\tmov\tr0, #0x1\n\tb\t.L5\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\t0x30052a4\n.L4:\n\tldrh\tr1, [r3]\n\tldr\tr0, .L9\n\tand\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrh\tr1, [r4]\n\tldr\tr0, .L9+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\t0xfffd\n\t.word\t0xffef\n.Lfe1:\n\t.size\t ProcessHBlankWait,.Lfe1-ProcessHBlankWait\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ProcessHBlankWait # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -3875,7 +3908,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `ReadKeyInput` — benchmark function kleod:ReadKeyInput:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadKeyInput\n\t.type\t ReadKeyInput,function\n\t.thumb_func\nReadKeyInput:\n\tpush\t{r4, lr}\n\tldr\tr0, .L6\n\tldrh\tr0, [r0]\n\tldr\tr2, .L6+0x4\n\tadd\tr1, r2, #0\n\teor\tr1, r1, r0\n\tldr\tr3, .L6+0x8\n\tldr\tr4, .L6+0xc\n\tldrh\tr2, [r4]\n\tadd\tr0, r1, #0\n\tbic\tr0, r0, r2\n\tstrh\tr0, [r3]\n\tstrh\tr1, [r4]\n\tmov\tr0, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xf\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0xff\n\tbl\tSoftResetRom\n.L3:\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x1\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L6+0x10\n\tldrh\tr0, [r1]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r1]\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgKeysPressed\n\t.word\tgKeysPrevious\n\t.word\tgAButtonHold\n.L4:\n\tldr\tr0, .L8\n\tstrh\tr1, [r0]\n.L5:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgAButtonHold\n.Lfe1:\n\t.size\t ReadKeyInput,.Lfe1-ReadKeyInput\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid SoftResetRom(u8);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReadKeyInput # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ReadKeyInput` — benchmark function kleod:ReadKeyInput:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReadKeyInput:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadKeyInput\n\t.type\t ReadKeyInput,function\n\t.thumb_func\nReadKeyInput:\n\tpush\t{r4, lr}\n\tldr\tr0, .L6\n\tldrh\tr0, [r0]\n\tldr\tr2, .L6+0x4\n\tadd\tr1, r2, #0\n\teor\tr1, r1, r0\n\tldr\tr3, .L6+0x8\n\tldr\tr4, .L6+0xc\n\tldrh\tr2, [r4]\n\tadd\tr0, r1, #0\n\tbic\tr0, r0, r2\n\tstrh\tr0, [r3]\n\tstrh\tr1, [r4]\n\tmov\tr0, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xf\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0xff\n\tbl\tSoftResetRom\n.L3:\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x1\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L6+0x10\n\tldrh\tr0, [r1]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r1]\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgKeysPressed\n\t.word\tgKeysPrevious\n\t.word\tgAButtonHold\n.L4:\n\tldr\tr0, .L8\n\tstrh\tr1, [r0]\n.L5:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgAButtonHold\n.Lfe1:\n\t.size\t ReadKeyInput,.Lfe1-ReadKeyInput\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ReadKeyInput\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReadKeyInput # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ReadKeyInput` — benchmark function kleod:ReadKeyInput:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReadKeyInput:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadKeyInput\n\t.type\t ReadKeyInput,function\n\t.thumb_func\nReadKeyInput:\n\tpush\t{r4, lr}\n\tldr\tr0, .L6\n\tldrh\tr0, [r0]\n\tldr\tr2, .L6+0x4\n\tadd\tr1, r2, #0\n\teor\tr1, r1, r0\n\tldr\tr3, .L6+0x8\n\tldr\tr4, .L6+0xc\n\tldrh\tr2, [r4]\n\tadd\tr0, r1, #0\n\tbic\tr0, r0, r2\n\tstrh\tr0, [r3]\n\tstrh\tr1, [r4]\n\tmov\tr0, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xf\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0xff\n\tbl\tSoftResetRom\n.L3:\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x1\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L6+0x10\n\tldrh\tr0, [r1]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r1]\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgKeysPressed\n\t.word\tgKeysPrevious\n\t.word\tgAButtonHold\n.L4:\n\tldr\tr0, .L8\n\tstrh\tr1, [r0]\n.L5:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgAButtonHold\n.Lfe1:\n\t.size\t ReadKeyInput,.Lfe1-ReadKeyInput\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ReadKeyInput\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReadKeyInput # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -3948,7 +3981,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `ReadUnalignedU16` — benchmark function kleod:ReadUnalignedU16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU16\n\t.type\t ReadUnalignedU16,function\n\t.thumb_func\nReadUnalignedU16:\n\tadd\tr1, r0, #0\n\tldrb\tr0, [r1]\n\tldrb\tr1, [r1, #0x1]\n\tlsl\tr1, r1, #0x8\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU16,.Lfe1-ReadUnalignedU16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReadUnalignedU16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ReadUnalignedU16` — benchmark function kleod:ReadUnalignedU16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReadUnalignedU16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU16\n\t.type\t ReadUnalignedU16,function\n\t.thumb_func\nReadUnalignedU16:\n\tadd\tr1, r0, #0\n\tldrb\tr0, [r1]\n\tldrb\tr1, [r1, #0x1]\n\tlsl\tr1, r1, #0x8\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU16,.Lfe1-ReadUnalignedU16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReadUnalignedU16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ReadUnalignedU16` — benchmark function kleod:ReadUnalignedU16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReadUnalignedU16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU16\n\t.type\t ReadUnalignedU16,function\n\t.thumb_func\nReadUnalignedU16:\n\tadd\tr1, r0, #0\n\tldrb\tr0, [r1]\n\tldrb\tr1, [r1, #0x1]\n\tlsl\tr1, r1, #0x8\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU16,.Lfe1-ReadUnalignedU16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReadUnalignedU16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -4024,7 +4057,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `ReadUnalignedU32` — benchmark function kleod:ReadUnalignedU32:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU32\n\t.type\t ReadUnalignedU32,function\n\t.thumb_func\nReadUnalignedU32:\n\tadd\tr2, r0, #0\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r2, #0x1]\n\tlsl\tr1, r1, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x2]\n\tlsl\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x3]\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU32,.Lfe1-ReadUnalignedU32\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReadUnalignedU32 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ReadUnalignedU32` — benchmark function kleod:ReadUnalignedU32:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReadUnalignedU32:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU32\n\t.type\t ReadUnalignedU32,function\n\t.thumb_func\nReadUnalignedU32:\n\tadd\tr2, r0, #0\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r2, #0x1]\n\tlsl\tr1, r1, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x2]\n\tlsl\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x3]\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU32,.Lfe1-ReadUnalignedU32\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReadUnalignedU32 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ReadUnalignedU32` — benchmark function kleod:ReadUnalignedU32:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReadUnalignedU32:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU32\n\t.type\t ReadUnalignedU32,function\n\t.thumb_func\nReadUnalignedU32:\n\tadd\tr2, r0, #0\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r2, #0x1]\n\tlsl\tr1, r1, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x2]\n\tlsl\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x3]\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU32,.Lfe1-ReadUnalignedU32\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReadUnalignedU32 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -4098,7 +4131,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `ReciprocalQ4` — benchmark function kleod:ReciprocalQ4:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ4\n\t.type\t ReciprocalQ4,function\n\t.thumb_func\nReciprocalQ4:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ4,.Lfe1-ReciprocalQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReciprocalQ4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ReciprocalQ4` — benchmark function kleod:ReciprocalQ4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReciprocalQ4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ4\n\t.type\t ReciprocalQ4,function\n\t.thumb_func\nReciprocalQ4:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ4,.Lfe1-ReciprocalQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReciprocalQ4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ReciprocalQ4` — benchmark function kleod:ReciprocalQ4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReciprocalQ4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ4\n\t.type\t ReciprocalQ4,function\n\t.thumb_func\nReciprocalQ4:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ4,.Lfe1-ReciprocalQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReciprocalQ4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -4172,7 +4205,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `ReciprocalQ8` — benchmark function kleod:ReciprocalQ8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ8\n\t.type\t ReciprocalQ8,function\n\t.thumb_func\nReciprocalQ8:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ8,.Lfe1-ReciprocalQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReciprocalQ8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ReciprocalQ8` — benchmark function kleod:ReciprocalQ8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReciprocalQ8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ8\n\t.type\t ReciprocalQ8,function\n\t.thumb_func\nReciprocalQ8:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ8,.Lfe1-ReciprocalQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReciprocalQ8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ReciprocalQ8` — benchmark function kleod:ReciprocalQ8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReciprocalQ8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ8\n\t.type\t ReciprocalQ8,function\n\t.thumb_func\nReciprocalQ8:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ8,.Lfe1-ReciprocalQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReciprocalQ8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -4245,7 +4278,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `ReturnOne` — benchmark function kleod:ReturnOne:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReturnOne\n\t.type\t ReturnOne,function\n\t.thumb_func\nReturnOne:\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReturnOne,.Lfe1-ReturnOne\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReturnOne # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ReturnOne` — benchmark function kleod:ReturnOne:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReturnOne:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReturnOne\n\t.type\t ReturnOne,function\n\t.thumb_func\nReturnOne:\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReturnOne,.Lfe1-ReturnOne\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReturnOne # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ReturnOne` — benchmark function kleod:ReturnOne:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReturnOne:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReturnOne\n\t.type\t ReturnOne,function\n\t.thumb_func\nReturnOne:\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReturnOne,.Lfe1-ReturnOne\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReturnOne # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -4279,7 +4312,7 @@ "droppedCandidates": [ { "label": "unsigned", - "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-NJ4syx/c.c:1077: too many arguments to function `thunk_sub_080002A0'" + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-pkBp3G/c.c:1077: too many arguments to function `thunk_sub_080002A0'" } ], "symbolsUsed": [], @@ -4344,7 +4377,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `RollRandomLevelVariant` — benchmark function kleod:RollRandomLevelVariant:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRollRandomLevelVariant\n\t.type\t RollRandomLevelVariant,function\n\t.thumb_func\nRollRandomLevelVariant:\n\tpush\t{r4, r5, r6, lr}\n\tldr\tr0, .L3\n\tldrb\tr4, [r0, #0xc]\n\tsub\tr4, r4, #0x1\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tbl\tthunk_sub_080002A0\n\tldr\tr6, .L3+0x4\n\tmov\tr5, #0x1\n\tand\tr5, r5, r4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr1, #0x5\n\tsub\tr1, r1, r4\n\tbl\tsub_0805193C\n\tadd\tr5, r5, r0\n\tadd\tr5, r5, #0x1\n\tstrb\tr5, [r6, #0xe]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3005400\n\t.word\t0x3004c20\n.Lfe1:\n\t.size\t RollRandomLevelVariant,.Lfe1-RollRandomLevelVariant\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function RollRandomLevelVariant # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `RollRandomLevelVariant` — benchmark function kleod:RollRandomLevelVariant:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:RollRandomLevelVariant:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRollRandomLevelVariant\n\t.type\t RollRandomLevelVariant,function\n\t.thumb_func\nRollRandomLevelVariant:\n\tpush\t{r4, r5, r6, lr}\n\tldr\tr0, .L3\n\tldrb\tr4, [r0, #0xc]\n\tsub\tr4, r4, #0x1\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tbl\tthunk_sub_080002A0\n\tldr\tr6, .L3+0x4\n\tmov\tr5, #0x1\n\tand\tr5, r5, r4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr1, #0x5\n\tsub\tr1, r1, r4\n\tbl\tsub_0805193C\n\tadd\tr5, r5, r0\n\tadd\tr5, r5, #0x1\n\tstrb\tr5, [r6, #0xe]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3005400\n\t.word\t0x3004c20\n.Lfe1:\n\t.size\t RollRandomLevelVariant,.Lfe1-RollRandomLevelVariant\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"RollRandomLevelVariant\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name RollRandomLevelVariant # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `RollRandomLevelVariant` — benchmark function kleod:RollRandomLevelVariant:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:RollRandomLevelVariant:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRollRandomLevelVariant\n\t.type\t RollRandomLevelVariant,function\n\t.thumb_func\nRollRandomLevelVariant:\n\tpush\t{r4, r5, r6, lr}\n\tldr\tr0, .L3\n\tldrb\tr4, [r0, #0xc]\n\tsub\tr4, r4, #0x1\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tbl\tthunk_sub_080002A0\n\tldr\tr6, .L3+0x4\n\tmov\tr5, #0x1\n\tand\tr5, r5, r4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr1, #0x5\n\tsub\tr1, r1, r4\n\tbl\tsub_0805193C\n\tadd\tr5, r5, r0\n\tadd\tr5, r5, #0x1\n\tstrb\tr5, [r6, #0xe]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3005400\n\t.word\t0x3004c20\n.Lfe1:\n\t.size\t RollRandomLevelVariant,.Lfe1-RollRandomLevelVariant\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"RollRandomLevelVariant\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name RollRandomLevelVariant # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -4436,7 +4469,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `StrCpy` — benchmark function kleod:StrCpy:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStrCpy\n\t.type\t StrCpy,function\n\t.thumb_func\nStrCpy:\n.L3:\n\tldrb\tr2, [r1]\n\tstrb\tr2, [r0]\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tbx\tlr\n.Lfe1:\n\t.size\t StrCpy,.Lfe1-StrCpy\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StrCpy # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StrCpy` — benchmark function kleod:StrCpy:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:StrCpy:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStrCpy\n\t.type\t StrCpy,function\n\t.thumb_func\nStrCpy:\n.L3:\n\tldrb\tr2, [r1]\n\tstrb\tr2, [r0]\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tbx\tlr\n.Lfe1:\n\t.size\t StrCpy,.Lfe1-StrCpy\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StrCpy\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StrCpy # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StrCpy` — benchmark function kleod:StrCpy:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:StrCpy:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStrCpy\n\t.type\t StrCpy,function\n\t.thumb_func\nStrCpy:\n.L3:\n\tldrb\tr2, [r1]\n\tstrb\tr2, [r0]\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tbx\tlr\n.Lfe1:\n\t.size\t StrCpy,.Lfe1-StrCpy\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StrCpy\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StrCpy # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -4523,7 +4556,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `StreamCmd_SetBGScroll` — benchmark function kleod:StreamCmd_SetBGScroll:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetBGScroll\n\t.type\t StreamCmd_SetBGScroll,function\n\t.thumb_func\nStreamCmd_SetBGScroll:\n\tpush\t{r4, r5, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tadd\tr3, r0, #0\n\tldr\tr5, .L3+0x4\n\tldr\tr0, [r4]\n\tldrb\tr2, [r0, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr3, r3, #0x4\n\tstrh\tr3, [r1, #0x8]\n\tadd\tr0, r0, #0x5\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr2, [r3, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr0, r0, #0x4\n\tstrh\tr0, [r1, #0xa]\n\tadd\tr3, r3, #0x7\n\tstr\tr3, [r4]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n\t.word\t0x3003430\n.Lfe1:\n\t.size\t StreamCmd_SetBGScroll,.Lfe1-StreamCmd_SetBGScroll\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StreamCmd_SetBGScroll # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StreamCmd_SetBGScroll` — benchmark function kleod:StreamCmd_SetBGScroll:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:StreamCmd_SetBGScroll:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetBGScroll\n\t.type\t StreamCmd_SetBGScroll,function\n\t.thumb_func\nStreamCmd_SetBGScroll:\n\tpush\t{r4, r5, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tadd\tr3, r0, #0\n\tldr\tr5, .L3+0x4\n\tldr\tr0, [r4]\n\tldrb\tr2, [r0, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr3, r3, #0x4\n\tstrh\tr3, [r1, #0x8]\n\tadd\tr0, r0, #0x5\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr2, [r3, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr0, r0, #0x4\n\tstrh\tr0, [r1, #0xa]\n\tadd\tr3, r3, #0x7\n\tstr\tr3, [r4]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n\t.word\t0x3003430\n.Lfe1:\n\t.size\t StreamCmd_SetBGScroll,.Lfe1-StreamCmd_SetBGScroll\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StreamCmd_SetBGScroll # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StreamCmd_SetBGScroll` — benchmark function kleod:StreamCmd_SetBGScroll:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:StreamCmd_SetBGScroll:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetBGScroll\n\t.type\t StreamCmd_SetBGScroll,function\n\t.thumb_func\nStreamCmd_SetBGScroll:\n\tpush\t{r4, r5, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tadd\tr3, r0, #0\n\tldr\tr5, .L3+0x4\n\tldr\tr0, [r4]\n\tldrb\tr2, [r0, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr3, r3, #0x4\n\tstrh\tr3, [r1, #0x8]\n\tadd\tr0, r0, #0x5\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr2, [r3, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr0, r0, #0x4\n\tstrh\tr0, [r1, #0xa]\n\tadd\tr3, r3, #0x7\n\tstr\tr3, [r4]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n\t.word\t0x3003430\n.Lfe1:\n\t.size\t StreamCmd_SetBGScroll,.Lfe1-StreamCmd_SetBGScroll\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StreamCmd_SetBGScroll # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -4616,7 +4649,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `StreamCmd_SetWindowRegs` — benchmark function kleod:StreamCmd_SetWindowRegs:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetWindowRegs\n\t.type\t StreamCmd_SetWindowRegs,function\n\t.thumb_func\nStreamCmd_SetWindowRegs:\n\tpush\t{r4, lr}\n\tldr\tr3, .L3\n\tldr\tr4, .L3+0x4\n\tldr\tr2, [r4]\n\tldrb\tr1, [r2, #0x2]\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr3, r3, #0x2\n\tldrb\tr1, [r2, #0x4]\n\tldrb\tr0, [r2, #0x5]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr2, r2, #0x6\n\tstr\tr2, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x4000048\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t StreamCmd_SetWindowRegs,.Lfe1-StreamCmd_SetWindowRegs\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StreamCmd_SetWindowRegs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StreamCmd_SetWindowRegs` — benchmark function kleod:StreamCmd_SetWindowRegs:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:StreamCmd_SetWindowRegs:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetWindowRegs\n\t.type\t StreamCmd_SetWindowRegs,function\n\t.thumb_func\nStreamCmd_SetWindowRegs:\n\tpush\t{r4, lr}\n\tldr\tr3, .L3\n\tldr\tr4, .L3+0x4\n\tldr\tr2, [r4]\n\tldrb\tr1, [r2, #0x2]\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr3, r3, #0x2\n\tldrb\tr1, [r2, #0x4]\n\tldrb\tr0, [r2, #0x5]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr2, r2, #0x6\n\tstr\tr2, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x4000048\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t StreamCmd_SetWindowRegs,.Lfe1-StreamCmd_SetWindowRegs\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StreamCmd_SetWindowRegs\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StreamCmd_SetWindowRegs # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StreamCmd_SetWindowRegs` — benchmark function kleod:StreamCmd_SetWindowRegs:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:StreamCmd_SetWindowRegs:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetWindowRegs\n\t.type\t StreamCmd_SetWindowRegs,function\n\t.thumb_func\nStreamCmd_SetWindowRegs:\n\tpush\t{r4, lr}\n\tldr\tr3, .L3\n\tldr\tr4, .L3+0x4\n\tldr\tr2, [r4]\n\tldrb\tr1, [r2, #0x2]\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr3, r3, #0x2\n\tldrb\tr1, [r2, #0x4]\n\tldrb\tr0, [r2, #0x5]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr2, r2, #0x6\n\tstr\tr2, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x4000048\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t StreamCmd_SetWindowRegs,.Lfe1-StreamCmd_SetWindowRegs\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StreamCmd_SetWindowRegs\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StreamCmd_SetWindowRegs # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -4683,7 +4716,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `TransformSingleEntityToScreen` — benchmark function kleod:TransformSingleEntityToScreen:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tTransformSingleEntityToScreen\n\t.type\t TransformSingleEntityToScreen,function\n\t.thumb_func\nTransformSingleEntityToScreen:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tldr\tr0, .L19\n\tmov\tr8, r0\n\tmov\tr0, r9\n\tlsl\tr7, r0, #0x3\n\tsub\tr4, r7, r0\n\tlsl\tr4, r4, #0x2\n\tadd\tr4, r4, r8\n\tlsl\tr1, r1, #0x18\n\tasr\tr1, r1, #0x18\n\tldrh\tr5, [r4]\n\tsub\tr5, r5, r1\n\tldr\tr6, .L19+0x4\n\tmov\tr1, #0x40\n\tadd\tr1, r1, r6\n\tmov\tip, r1\n\tldrh\tr0, [r1]\n\tsub\tr5, r5, r0\n\tstrh\tr5, [r4, #0x4]\n\tlsl\tr2, r2, #0x18\n\tasr\tr2, r2, #0x18\n\tldrh\tr3, [r4, #0x2]\n\tsub\tr3, r3, r2\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x42\n\tldrh\tr0, [r2]\n\tsub\tr3, r3, r0\n\tstrh\tr3, [r4, #0x6]\n\tldrh\tr1, [r1]\n\tsub\tr1, r1, r5\n\tldrh\tr0, [r2]\n\tsub\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tldr\tr0, .L19+0x8\n\tldrh\tr0, [r0]\n\tmul\tr0, r0, r1\n\tmov\tr5, r8\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L3:\n\tasr\tr4, r0, #0x8\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tldr\tr2, .L19+0xc\n\tldrh\tr1, [r2]\n\tmul\tr0, r0, r1\n\tadd\tr3, r2, #0\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L4:\n\tasr\tr2, r0, #0x8\n\tmov\tr1, ip\n\tldrh\tr0, [r1]\n\tsub\tr4, r0, r4\n\tmov\tr0, r9\n\tcmp\tr0, #0xc\n\tbls\t.L5\t@cond_branch\n\tldr\tr0, .L19+0x10\n\tldr\tr0, [r0]\n\tadd\tr0, r7, r0\n\tsub\tr0, r0, #0x68\n\tldr\tr0, [r0, #0x4]\n\tb\t.L6\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n\t.word\tgBg2XMag\n\t.word\tgBg2YMag\n\t.word\tgUnk_030051DC\n.L5:\n\tldr\tr0, .L21\n\tadd\tr0, r0, #0x4\n\tadd\tr0, r7, r0\n\tldr\tr0, [r0]\n.L6:\n\tldrb\tr0, [r0, #0x5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xb\n\tbhi\t.L16\t@cond_branch\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L21+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\tgUnk_08078FC8\n\t.word\t.L17\n\t.align\t2, 0\n\t.align\t2, 0\n.L17:\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L9\n\t.word\t.L15\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L16\n\t.word\t.L9\n.L9:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tb\t.L18\n.L12:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x5\n\tb\t.L18\n.L15:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x6\n\tb\t.L18\n.L16:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x4\n.L18:\n\tadd\tr2, r1, r0\n\tmov\tr1, r9\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r5\n\tstrh\tr4, [r0, #0x4]\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t TransformSingleEntityToScreen,.Lfe1-TransformSingleEntityToScreen\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function TransformSingleEntityToScreen # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `TransformSingleEntityToScreen` — benchmark function kleod:TransformSingleEntityToScreen:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:TransformSingleEntityToScreen:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tTransformSingleEntityToScreen\n\t.type\t TransformSingleEntityToScreen,function\n\t.thumb_func\nTransformSingleEntityToScreen:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tldr\tr0, .L19\n\tmov\tr8, r0\n\tmov\tr0, r9\n\tlsl\tr7, r0, #0x3\n\tsub\tr4, r7, r0\n\tlsl\tr4, r4, #0x2\n\tadd\tr4, r4, r8\n\tlsl\tr1, r1, #0x18\n\tasr\tr1, r1, #0x18\n\tldrh\tr5, [r4]\n\tsub\tr5, r5, r1\n\tldr\tr6, .L19+0x4\n\tmov\tr1, #0x40\n\tadd\tr1, r1, r6\n\tmov\tip, r1\n\tldrh\tr0, [r1]\n\tsub\tr5, r5, r0\n\tstrh\tr5, [r4, #0x4]\n\tlsl\tr2, r2, #0x18\n\tasr\tr2, r2, #0x18\n\tldrh\tr3, [r4, #0x2]\n\tsub\tr3, r3, r2\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x42\n\tldrh\tr0, [r2]\n\tsub\tr3, r3, r0\n\tstrh\tr3, [r4, #0x6]\n\tldrh\tr1, [r1]\n\tsub\tr1, r1, r5\n\tldrh\tr0, [r2]\n\tsub\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tldr\tr0, .L19+0x8\n\tldrh\tr0, [r0]\n\tmul\tr0, r0, r1\n\tmov\tr5, r8\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L3:\n\tasr\tr4, r0, #0x8\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tldr\tr2, .L19+0xc\n\tldrh\tr1, [r2]\n\tmul\tr0, r0, r1\n\tadd\tr3, r2, #0\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L4:\n\tasr\tr2, r0, #0x8\n\tmov\tr1, ip\n\tldrh\tr0, [r1]\n\tsub\tr4, r0, r4\n\tmov\tr0, r9\n\tcmp\tr0, #0xc\n\tbls\t.L5\t@cond_branch\n\tldr\tr0, .L19+0x10\n\tldr\tr0, [r0]\n\tadd\tr0, r7, r0\n\tsub\tr0, r0, #0x68\n\tldr\tr0, [r0, #0x4]\n\tb\t.L6\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n\t.word\tgBg2XMag\n\t.word\tgBg2YMag\n\t.word\tgUnk_030051DC\n.L5:\n\tldr\tr0, .L21\n\tadd\tr0, r0, #0x4\n\tadd\tr0, r7, r0\n\tldr\tr0, [r0]\n.L6:\n\tldrb\tr0, [r0, #0x5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xb\n\tbhi\t.L16\t@cond_branch\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L21+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\tgUnk_08078FC8\n\t.word\t.L17\n\t.align\t2, 0\n\t.align\t2, 0\n.L17:\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L9\n\t.word\t.L15\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L16\n\t.word\t.L9\n.L9:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tb\t.L18\n.L12:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x5\n\tb\t.L18\n.L15:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x6\n\tb\t.L18\n.L16:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x4\n.L18:\n\tadd\tr2, r1, r0\n\tmov\tr1, r9\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r5\n\tstrh\tr4, [r0, #0x4]\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t TransformSingleEntityToScreen,.Lfe1-TransformSingleEntityToScreen\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name TransformSingleEntityToScreen # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `TransformSingleEntityToScreen` — benchmark function kleod:TransformSingleEntityToScreen:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:TransformSingleEntityToScreen:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tTransformSingleEntityToScreen\n\t.type\t TransformSingleEntityToScreen,function\n\t.thumb_func\nTransformSingleEntityToScreen:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tldr\tr0, .L19\n\tmov\tr8, r0\n\tmov\tr0, r9\n\tlsl\tr7, r0, #0x3\n\tsub\tr4, r7, r0\n\tlsl\tr4, r4, #0x2\n\tadd\tr4, r4, r8\n\tlsl\tr1, r1, #0x18\n\tasr\tr1, r1, #0x18\n\tldrh\tr5, [r4]\n\tsub\tr5, r5, r1\n\tldr\tr6, .L19+0x4\n\tmov\tr1, #0x40\n\tadd\tr1, r1, r6\n\tmov\tip, r1\n\tldrh\tr0, [r1]\n\tsub\tr5, r5, r0\n\tstrh\tr5, [r4, #0x4]\n\tlsl\tr2, r2, #0x18\n\tasr\tr2, r2, #0x18\n\tldrh\tr3, [r4, #0x2]\n\tsub\tr3, r3, r2\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x42\n\tldrh\tr0, [r2]\n\tsub\tr3, r3, r0\n\tstrh\tr3, [r4, #0x6]\n\tldrh\tr1, [r1]\n\tsub\tr1, r1, r5\n\tldrh\tr0, [r2]\n\tsub\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tldr\tr0, .L19+0x8\n\tldrh\tr0, [r0]\n\tmul\tr0, r0, r1\n\tmov\tr5, r8\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L3:\n\tasr\tr4, r0, #0x8\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tldr\tr2, .L19+0xc\n\tldrh\tr1, [r2]\n\tmul\tr0, r0, r1\n\tadd\tr3, r2, #0\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L4:\n\tasr\tr2, r0, #0x8\n\tmov\tr1, ip\n\tldrh\tr0, [r1]\n\tsub\tr4, r0, r4\n\tmov\tr0, r9\n\tcmp\tr0, #0xc\n\tbls\t.L5\t@cond_branch\n\tldr\tr0, .L19+0x10\n\tldr\tr0, [r0]\n\tadd\tr0, r7, r0\n\tsub\tr0, r0, #0x68\n\tldr\tr0, [r0, #0x4]\n\tb\t.L6\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n\t.word\tgBg2XMag\n\t.word\tgBg2YMag\n\t.word\tgUnk_030051DC\n.L5:\n\tldr\tr0, .L21\n\tadd\tr0, r0, #0x4\n\tadd\tr0, r7, r0\n\tldr\tr0, [r0]\n.L6:\n\tldrb\tr0, [r0, #0x5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xb\n\tbhi\t.L16\t@cond_branch\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L21+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\tgUnk_08078FC8\n\t.word\t.L17\n\t.align\t2, 0\n\t.align\t2, 0\n.L17:\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L9\n\t.word\t.L15\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L16\n\t.word\t.L9\n.L9:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tb\t.L18\n.L12:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x5\n\tb\t.L18\n.L15:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x6\n\tb\t.L18\n.L16:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x4\n.L18:\n\tadd\tr2, r1, r0\n\tmov\tr1, r9\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r5\n\tstrh\tr4, [r0, #0x4]\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t TransformSingleEntityToScreen,.Lfe1-TransformSingleEntityToScreen\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name TransformSingleEntityToScreen # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -4765,7 +4798,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `UpdateEntities` — benchmark function kleod:UpdateEntities:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateEntities\n\t.type\t UpdateEntities,function\n\t.thumb_func\nUpdateEntities:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tbl\tCheckWorldCompletion\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r4, #0\n\tbl\tCopyWorldMapTiles\n\tadd\tr0, r4, #0\n\tbl\tUpdateWorldMapNodeTile\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x6\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t UpdateEntities,.Lfe1-UpdateEntities\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nu32 CheckWorldCompletion(u8);\nvoid CopyWorldMapTiles(u8);\nvoid UpdateWorldMapNodeTile(u8);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateEntities # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateEntities` — benchmark function kleod:UpdateEntities:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateEntities:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateEntities\n\t.type\t UpdateEntities,function\n\t.thumb_func\nUpdateEntities:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tbl\tCheckWorldCompletion\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r4, #0\n\tbl\tCopyWorldMapTiles\n\tadd\tr0, r4, #0\n\tbl\tUpdateWorldMapNodeTile\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x6\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t UpdateEntities,.Lfe1-UpdateEntities\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"UpdateEntities\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateEntities # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateEntities` — benchmark function kleod:UpdateEntities:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateEntities:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateEntities\n\t.type\t UpdateEntities,function\n\t.thumb_func\nUpdateEntities:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tbl\tCheckWorldCompletion\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r4, #0\n\tbl\tCopyWorldMapTiles\n\tadd\tr0, r4, #0\n\tbl\tUpdateWorldMapNodeTile\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x6\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t UpdateEntities,.Lfe1-UpdateEntities\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"UpdateEntities\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateEntities # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -4854,7 +4887,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `UpdateFadeEffect` — benchmark function kleod:UpdateFadeEffect:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateFadeEffect\n\t.type\t UpdateFadeEffect,function\n\t.thumb_func\nUpdateFadeEffect:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldr\tr1, .L4+0x4\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tbl\tsub_08051A0C\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x10\n\tbhi\t.L3\t@cond_branch\n\tldr\tr1, .L4+0x8\n\tlsl\tr0, r2, #0x8\n\torr\tr0, r0, r2\n\tstrh\tr0, [r1]\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x4000006\n\t.word\tgEntityArray\n\t.word\t0x4000052\n.Lfe1:\n\t.size\t UpdateFadeEffect,.Lfe1-UpdateFadeEffect\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid UpdateFadeEffect(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateFadeEffect # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateFadeEffect` — benchmark function kleod:UpdateFadeEffect:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateFadeEffect:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateFadeEffect\n\t.type\t UpdateFadeEffect,function\n\t.thumb_func\nUpdateFadeEffect:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldr\tr1, .L4+0x4\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tbl\tsub_08051A0C\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x10\n\tbhi\t.L3\t@cond_branch\n\tldr\tr1, .L4+0x8\n\tlsl\tr0, r2, #0x8\n\torr\tr0, r0, r2\n\tstrh\tr0, [r1]\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x4000006\n\t.word\tgEntityArray\n\t.word\t0x4000052\n.Lfe1:\n\t.size\t UpdateFadeEffect,.Lfe1-UpdateFadeEffect\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateFadeEffect # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateFadeEffect` — benchmark function kleod:UpdateFadeEffect:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateFadeEffect:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateFadeEffect\n\t.type\t UpdateFadeEffect,function\n\t.thumb_func\nUpdateFadeEffect:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldr\tr1, .L4+0x4\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tbl\tsub_08051A0C\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x10\n\tbhi\t.L3\t@cond_branch\n\tldr\tr1, .L4+0x8\n\tlsl\tr0, r2, #0x8\n\torr\tr0, r0, r2\n\tstrh\tr0, [r1]\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x4000006\n\t.word\tgEntityArray\n\t.word\t0x4000052\n.Lfe1:\n\t.size\t UpdateFadeEffect,.Lfe1-UpdateFadeEffect\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateFadeEffect # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -4880,23 +4913,52 @@ "asmlift": { "decompiler": "asmlift", "symbolMap": true, - "outcome": "noncompile", - "source": "s32 UpdateHUDCounterDisplay(s32 a0, s32 a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n u16 * v5;\n if (gUnk_03004C20.unkA == 1) {\n v2 = 100;\n } else {\n if (gUnk_03004C20.level != 6) {\n v2 = 30;\n } else {\n v2 = 100;\n }\n }\n v0 = *(u16 *)&gUnk_03005220;\n if (v2 != v0 << 20 >> 25) {\n v3 = 0;\n } else {\n v3 = 1;\n }\n if (gUnk_03004C20.unkA == 1) {\n if (v0 << 20 >> 25 <= 99) {\n v4 = 1;\n v5 = &gBgTilemapBufs;\n } else {\n gBgTilemapBufs[594] = gBgTilemapBufs[659];\n gBgTilemapBufs[626] = gBgTilemapBufs[691];\n v4 = 1;\n v5 = &gBgTilemapBufs;\n }\n } else {\n if (gUnk_03004C20.level != 6) {\n v4 = 0;\n v5 = &gBgTilemapBufs;\n } else {\n if (v0 << 20 >> 25 <= 99) {\n v4 = 1;\n v5 = &gBgTilemapBufs;\n } else {\n gBgTilemapBufs[594] = gBgTilemapBufs[659];\n gBgTilemapBufs[626] = gBgTilemapBufs[691];\n v4 = 1;\n v5 = &gBgTilemapBufs;\n }\n }\n }\n v1 = *(u16 *)&gUnk_03005220;\n if (v1 << 20 >> 25 > 9) {\n v5[(149 << 2) - v4] = v5[(v1 << 20 >> 25) / 10 + 658];\n v5[(157 << 2) - v4] = v5[(*(u16 *)&gUnk_03005220 << 20 >> 25) / 10 + 690];\n }\n v5[597 - v4] = v5[(*(u16 *)&gUnk_03005220 << 20 >> 25) % 10 + 658];\n v5[629 - v4] = v5[(*(u16 *)&gUnk_03005220 << 20 >> 25) % 10 + 690];\n return v3;\n}\n", - "score": null, - "maxScore": null, - "compileErrors": 1, + "candidateLabel": "unsigned", + "droppedCandidates": [ + { + "label": "unsigned/raw-globals", + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-CcKKJi/c.c:1088: incompatible types in assignment" + }, + { + "label": "signed/raw-globals", + "error": "agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-yO9fF2/c.c:1088: incompatible types in assignment" + } + ], + "symbolsUsed": [ + { + "name": "gBgTilemapBufs", + "shape": "u16[]" + }, + { + "name": "gUnk_03004C20", + "shape": "struct Unk_03004C20 (24 B)" + }, + { + "name": "gUnk_03005220", + "shape": "struct Unk_03005220 (100 B)" + } + ], + "outcome": "nonmatch", + "source": "s32 UpdateHUDCounterDisplay(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n u16 * v5;\n if (gUnk_03004C20.unkA == 1) {\n v2 = 100;\n } else {\n if (gUnk_03004C20.level != 6) {\n v2 = 30;\n } else {\n v2 = 100;\n }\n }\n v0 = *(u16 *)&gUnk_03005220;\n if (v2 != (u32)(v0 << 20) >> 25) {\n v3 = 0;\n } else {\n v3 = 1;\n }\n if (gUnk_03004C20.unkA == 1) {\n if ((u32)(v0 << 20) >> 25 <= 99) {\n v4 = 1;\n v5 = &gBgTilemapBufs;\n } else {\n gBgTilemapBufs[0][594] = gBgTilemapBufs[0][659];\n gBgTilemapBufs[0][626] = gBgTilemapBufs[0][691];\n v4 = 1;\n v5 = &gBgTilemapBufs;\n }\n } else {\n if (gUnk_03004C20.level != 6) {\n v4 = 0;\n v5 = &gBgTilemapBufs;\n } else {\n if ((u32)(v0 << 20) >> 25 <= 99) {\n v4 = 1;\n v5 = &gBgTilemapBufs;\n } else {\n gBgTilemapBufs[0][594] = gBgTilemapBufs[0][659];\n gBgTilemapBufs[0][626] = gBgTilemapBufs[0][691];\n v4 = 1;\n v5 = &gBgTilemapBufs;\n }\n }\n }\n v1 = *(u16 *)&gUnk_03005220;\n if ((u32)(v1 << 20) >> 25 > 9) {\n v5[(149 << 2) - v4] = v5[((u32)(v1 << 20) >> 25) / 10 + 658];\n v5[(157 << 2) - v4] = v5[((u32)(*(u16 *)&gUnk_03005220 << 20) >> 25) / 10 + 690];\n }\n v5[597 - v4] = v5[((u32)(*(u16 *)&gUnk_03005220 << 20) >> 25) % 10 + 658];\n v5[629 - v4] = v5[((u32)(*(u16 *)&gUnk_03005220 << 20) >> 25) % 10 + 690];\n return v3;\n}\n", + "score": 127, + "maxScore": 181, + "compileErrors": null, + "breakdown": { + "insert": 45, + "delete": 20, + "replace": 5, + "opMismatch": 9, + "argMismatch": 48 + }, "quality": { - "score": 94, + "score": 88, "lines": 57, "gotos": 0, - "casts": 5, + "casts": 13, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 - }, - "errorMarkers": [ - "no scorable candidate for 'UpdateHUDCounterDisplay': agbcc failed: /c.c:1088: incompatible types in assignment" - ] + } }, "m2c": { "decompiler": "m2c", @@ -4922,10 +4984,22 @@ "/c.c:1101: invalid operands to binary <<" ] }, - "gapSize": null, + "gapSize": { + "decompiler": "asmlift", + "score": 127, + "maxScore": 181, + "ratio": 0.7016574585635359, + "kinds": { + "insert": 45, + "delete": 20, + "replace": 5, + "opMismatch": 9, + "argMismatch": 48 + } + }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `UpdateHUDCounterDisplay` — benchmark function kleod:UpdateHUDCounterDisplay:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateHUDCounterDisplay\n\t.type\t UpdateHUDCounterDisplay,function\n\t.thumb_func\nUpdateHUDCounterDisplay:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tldr\tr0, .L12\n\tldrb\tr1, [r0, #0xa]\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L3\t@cond_branch\n.L4:\n\tmov\tr5, #0x64\n\tb\t.L5\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgUnk_03004C20\n.L3:\n\tmov\tr5, #0x1e\n.L5:\n\tldr\tr1, .L14\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr2, r0, #0x19\n\tmov\tr8, r1\n\tcmp\tr5, r2\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x1\n\tmov\tr9, r1\n.L6:\n\tldrb\tr0, [r3, #0xa]\n\tcmp\tr0, #0x1\n\tbeq\t.L8\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L7\t@cond_branch\n.L8:\n\tmov\tr5, #0x1\n\tldr\tr6, .L14+0x4\n\tcmp\tr2, #0x63\n\tble\t.L10\t@cond_branch\n\tldr\tr2, .L14+0x8\n\tadd\tr1, r6, r2\n\tadd\tr2, r2, #0x82\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L14+0xc\n\tadd\tr1, r6, r0\n\tadd\tr2, r2, #0x40\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L10\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x4a4\n\t.word\t0x4e4\n.L7:\n\tmov\tr5, #0x0\n\tldr\tr6, .L16\n.L10:\n\tmov\tr7, r8\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tcmp\tr0, #0x9\n\tble\t.L11\t@cond_branch\n\tmov\tr4, #0x95\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr1, .L16+0x4\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr4, #0x9d\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n.L11:\n\tldr\tr4, .L16+0xc\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x4\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldr\tr4, .L16+0x10\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr0, r9\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgBgTilemapBufs\n\t.word\t0x292\n\t.word\t0x2b2\n\t.word\t0x255\n\t.word\t0x275\n.Lfe1:\n\t.size\t UpdateHUDCounterDisplay,.Lfe1-UpdateHUDCounterDisplay\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 UpdateHUDCounterDisplay(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateHUDCounterDisplay # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateHUDCounterDisplay` — benchmark function kleod:UpdateHUDCounterDisplay:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateHUDCounterDisplay:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateHUDCounterDisplay\n\t.type\t UpdateHUDCounterDisplay,function\n\t.thumb_func\nUpdateHUDCounterDisplay:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tldr\tr0, .L12\n\tldrb\tr1, [r0, #0xa]\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L3\t@cond_branch\n.L4:\n\tmov\tr5, #0x64\n\tb\t.L5\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgUnk_03004C20\n.L3:\n\tmov\tr5, #0x1e\n.L5:\n\tldr\tr1, .L14\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr2, r0, #0x19\n\tmov\tr8, r1\n\tcmp\tr5, r2\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x1\n\tmov\tr9, r1\n.L6:\n\tldrb\tr0, [r3, #0xa]\n\tcmp\tr0, #0x1\n\tbeq\t.L8\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L7\t@cond_branch\n.L8:\n\tmov\tr5, #0x1\n\tldr\tr6, .L14+0x4\n\tcmp\tr2, #0x63\n\tble\t.L10\t@cond_branch\n\tldr\tr2, .L14+0x8\n\tadd\tr1, r6, r2\n\tadd\tr2, r2, #0x82\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L14+0xc\n\tadd\tr1, r6, r0\n\tadd\tr2, r2, #0x40\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L10\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x4a4\n\t.word\t0x4e4\n.L7:\n\tmov\tr5, #0x0\n\tldr\tr6, .L16\n.L10:\n\tmov\tr7, r8\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tcmp\tr0, #0x9\n\tble\t.L11\t@cond_branch\n\tmov\tr4, #0x95\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr1, .L16+0x4\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr4, #0x9d\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n.L11:\n\tldr\tr4, .L16+0xc\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x4\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldr\tr4, .L16+0x10\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr0, r9\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgBgTilemapBufs\n\t.word\t0x292\n\t.word\t0x2b2\n\t.word\t0x255\n\t.word\t0x275\n.Lfe1:\n\t.size\t UpdateHUDCounterDisplay,.Lfe1-UpdateHUDCounterDisplay\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateHUDCounterDisplay # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateHUDCounterDisplay` — benchmark function kleod:UpdateHUDCounterDisplay:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateHUDCounterDisplay:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateHUDCounterDisplay\n\t.type\t UpdateHUDCounterDisplay,function\n\t.thumb_func\nUpdateHUDCounterDisplay:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tldr\tr0, .L12\n\tldrb\tr1, [r0, #0xa]\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L3\t@cond_branch\n.L4:\n\tmov\tr5, #0x64\n\tb\t.L5\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgUnk_03004C20\n.L3:\n\tmov\tr5, #0x1e\n.L5:\n\tldr\tr1, .L14\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr2, r0, #0x19\n\tmov\tr8, r1\n\tcmp\tr5, r2\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x1\n\tmov\tr9, r1\n.L6:\n\tldrb\tr0, [r3, #0xa]\n\tcmp\tr0, #0x1\n\tbeq\t.L8\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L7\t@cond_branch\n.L8:\n\tmov\tr5, #0x1\n\tldr\tr6, .L14+0x4\n\tcmp\tr2, #0x63\n\tble\t.L10\t@cond_branch\n\tldr\tr2, .L14+0x8\n\tadd\tr1, r6, r2\n\tadd\tr2, r2, #0x82\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L14+0xc\n\tadd\tr1, r6, r0\n\tadd\tr2, r2, #0x40\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L10\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x4a4\n\t.word\t0x4e4\n.L7:\n\tmov\tr5, #0x0\n\tldr\tr6, .L16\n.L10:\n\tmov\tr7, r8\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tcmp\tr0, #0x9\n\tble\t.L11\t@cond_branch\n\tmov\tr4, #0x95\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr1, .L16+0x4\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr4, #0x9d\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n.L11:\n\tldr\tr4, .L16+0xc\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x4\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldr\tr4, .L16+0x10\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr0, r9\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgBgTilemapBufs\n\t.word\t0x292\n\t.word\t0x2b2\n\t.word\t0x255\n\t.word\t0x275\n.Lfe1:\n\t.size\t UpdateHUDCounterDisplay,.Lfe1-UpdateHUDCounterDisplay\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateHUDCounterDisplay # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -5008,7 +5082,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `UpdateWorldMapNodeTile` — benchmark function kleod:UpdateWorldMapNodeTile:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeTile\n\t.type\t UpdateWorldMapNodeTile,function\n\t.thumb_func\nUpdateWorldMapNodeTile:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr6, .L6\n\tldr\tr4, .L6+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L6+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr0, r3, #0x6\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x3\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.L3:\n\tldr\tr6, .L8\n\tldr\tr4, .L8+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L8+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x4\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x5\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x6\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x7\n.L5:\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r6\n\tldrh\tr1, [r3]\n\tstrh\tr1, [r0]\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.Lfe1:\n\t.size\t UpdateWorldMapNodeTile,.Lfe1-UpdateWorldMapNodeTile\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid UpdateWorldMapNodeTile(u8 arg0);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateWorldMapNodeTile # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateWorldMapNodeTile` — benchmark function kleod:UpdateWorldMapNodeTile:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateWorldMapNodeTile:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeTile\n\t.type\t UpdateWorldMapNodeTile,function\n\t.thumb_func\nUpdateWorldMapNodeTile:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr6, .L6\n\tldr\tr4, .L6+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L6+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr0, r3, #0x6\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x3\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.L3:\n\tldr\tr6, .L8\n\tldr\tr4, .L8+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L8+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x4\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x5\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x6\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x7\n.L5:\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r6\n\tldrh\tr1, [r3]\n\tstrh\tr1, [r0]\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.Lfe1:\n\t.size\t UpdateWorldMapNodeTile,.Lfe1-UpdateWorldMapNodeTile\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateWorldMapNodeTile # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateWorldMapNodeTile` — benchmark function kleod:UpdateWorldMapNodeTile:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateWorldMapNodeTile:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeTile\n\t.type\t UpdateWorldMapNodeTile,function\n\t.thumb_func\nUpdateWorldMapNodeTile:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr6, .L6\n\tldr\tr4, .L6+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L6+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr0, r3, #0x6\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x3\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.L3:\n\tldr\tr6, .L8\n\tldr\tr4, .L8+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L8+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x4\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x5\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x6\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x7\n.L5:\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r6\n\tldrh\tr1, [r3]\n\tstrh\tr1, [r0]\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.Lfe1:\n\t.size\t UpdateWorldMapNodeTile,.Lfe1-UpdateWorldMapNodeTile\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateWorldMapNodeTile # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -5094,7 +5168,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `VBlankHandlerMinimal` — benchmark function kleod:VBlankHandlerMinimal:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVBlankHandlerMinimal\n\t.type\t VBlankHandlerMinimal,function\n\t.thumb_func\nVBlankHandlerMinimal:\n\tpush\t{lr}\n\tbl\tm4aSoundVSync\n\tbl\tm4aSoundMain\n\tldr\tr1, .L3\n\tmov\tr0, #0x1\n\tstrh\tr0, [r1]\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3007ff8\n.Lfe1:\n\t.size\t VBlankHandlerMinimal,.Lfe1-VBlankHandlerMinimal\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid m4aSoundVSync(void);\nvoid m4aSoundMain(void);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function VBlankHandlerMinimal # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `VBlankHandlerMinimal` — benchmark function kleod:VBlankHandlerMinimal:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:VBlankHandlerMinimal:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVBlankHandlerMinimal\n\t.type\t VBlankHandlerMinimal,function\n\t.thumb_func\nVBlankHandlerMinimal:\n\tpush\t{lr}\n\tbl\tm4aSoundVSync\n\tbl\tm4aSoundMain\n\tldr\tr1, .L3\n\tmov\tr0, #0x1\n\tstrh\tr0, [r1]\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3007ff8\n.Lfe1:\n\t.size\t VBlankHandlerMinimal,.Lfe1-VBlankHandlerMinimal\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"VBlankHandlerMinimal\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VBlankHandlerMinimal # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `VBlankHandlerMinimal` — benchmark function kleod:VBlankHandlerMinimal:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:VBlankHandlerMinimal:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVBlankHandlerMinimal\n\t.type\t VBlankHandlerMinimal,function\n\t.thumb_func\nVBlankHandlerMinimal:\n\tpush\t{lr}\n\tbl\tm4aSoundVSync\n\tbl\tm4aSoundMain\n\tldr\tr1, .L3\n\tmov\tr0, #0x1\n\tstrh\tr0, [r1]\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3007ff8\n.Lfe1:\n\t.size\t VBlankHandlerMinimal,.Lfe1-VBlankHandlerMinimal\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"VBlankHandlerMinimal\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VBlankHandlerMinimal # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -5176,7 +5250,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `WritePaletteColor` — benchmark function kleod:WritePaletteColor:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tWritePaletteColor\n\t.type\t WritePaletteColor,function\n\t.thumb_func\nWritePaletteColor:\n\tpush\t{r4, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr1, [r3, #0x2]\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, #0xa0\n\tlsl\tr2, r2, #0x13\n\tadd\tr1, r1, r2\n\tstrh\tr0, [r1]\n\tadd\tr3, r3, #0x5\n\tstr\tr3, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t WritePaletteColor,.Lfe1-WritePaletteColor\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function WritePaletteColor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `WritePaletteColor` — benchmark function kleod:WritePaletteColor:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:WritePaletteColor:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tWritePaletteColor\n\t.type\t WritePaletteColor,function\n\t.thumb_func\nWritePaletteColor:\n\tpush\t{r4, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr1, [r3, #0x2]\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, #0xa0\n\tlsl\tr2, r2, #0x13\n\tadd\tr1, r1, r2\n\tstrh\tr0, [r1]\n\tadd\tr3, r3, #0x5\n\tstr\tr3, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t WritePaletteColor,.Lfe1-WritePaletteColor\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"WritePaletteColor\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name WritePaletteColor # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `WritePaletteColor` — benchmark function kleod:WritePaletteColor:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:WritePaletteColor:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tWritePaletteColor\n\t.type\t WritePaletteColor,function\n\t.thumb_func\nWritePaletteColor:\n\tpush\t{r4, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr1, [r3, #0x2]\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, #0xa0\n\tlsl\tr2, r2, #0x13\n\tadd\tr1, r1, r2\n\tstrh\tr0, [r1]\n\tadd\tr3, r3, #0x5\n\tstr\tr3, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t WritePaletteColor,.Lfe1-WritePaletteColor\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"WritePaletteColor\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name WritePaletteColor # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -5253,7 +5327,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `CameraScissorSet` — benchmark function marioparty3:CameraScissorSet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel CameraScissorSet\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$v0, $a0, 0x3\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x4\n lui\t$v1, %hi(gCameraList)\n lw\t$v1, %lo(gCameraList)($v1)\n addu\t$v0, $v0, $v1\n lwc1\t$f0, 0($a1)\n swc1\t$f0, 144($v0)\n lwc1\t$f0, 4($a1)\n swc1\t$f0, 148($v0)\n lwc1\t$f0, 8($a1)\n swc1\t$f0, 152($v0)\n lwc1\t$f0, 12($a1)\n jr\t$ra\n swc1\t$f0, 156($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-3f9d594d88fa.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid CameraScissorSet(s16 camIndex, RectF *arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CameraScissorSet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CameraScissorSet` — benchmark function marioparty3:CameraScissorSet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:CameraScissorSet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x3\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x2\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x4\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\taddu\tv0,v0,v1\n 28:\tlwc1\t$f0,0(a1)\n 2c:\tswc1\t$f0,144(v0)\n 30:\tlwc1\t$f0,4(a1)\n 34:\tswc1\t$f0,148(v0)\n 38:\tlwc1\t$f0,8(a1)\n 3c:\tswc1\t$f0,152(v0)\n 40:\tlwc1\t$f0,12(a1)\n 44:\tjr\tra\n 48:\tswc1\t$f0,156(v0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-333d6c1dd230dd41/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c CameraScissorSet\n00000000 *UND*\t00000000 gCameraList\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 gCameraList\n00000020 R_MIPS_LO16 gCameraList\n\n\nContents of section .text:\n 0000 00042400 00042403 000410c0 00441021 ..$...$......D.!\n 0010 00021080 00441023 00021100 3c030000 .....D.#....<...\n 0020 8c630000 00431021 c4a00000 e4400090 .c...C.!.....@..\n 0030 c4a00004 e4400094 c4a00008 e4400098 .....@.......@..\n 0040 c4a0000c 03e00008 e440009c 00000000 .........@......\nContents of section .reginfo:\n 0000 8000003c 00000000 00000001 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"CameraScissorSet\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name CameraScissorSet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CameraScissorSet` — benchmark function marioparty3:CameraScissorSet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:CameraScissorSet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x3\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x2\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x4\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\taddu\tv0,v0,v1\n 28:\tlwc1\t$f0,0(a1)\n 2c:\tswc1\t$f0,144(v0)\n 30:\tlwc1\t$f0,4(a1)\n 34:\tswc1\t$f0,148(v0)\n 38:\tlwc1\t$f0,8(a1)\n 3c:\tswc1\t$f0,152(v0)\n 40:\tlwc1\t$f0,12(a1)\n 44:\tjr\tra\n 48:\tswc1\t$f0,156(v0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-333d6c1dd230dd41/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c CameraScissorSet\n00000000 *UND*\t00000000 gCameraList\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 gCameraList\n00000020 R_MIPS_LO16 gCameraList\n\n\nContents of section .text:\n 0000 00042400 00042403 000410c0 00441021 ..$...$......D.!\n 0010 00021080 00441023 00021100 3c030000 .....D.#....<...\n 0020 8c630000 00431021 c4a00000 e4400090 .c...C.!.....@..\n 0030 c4a00004 e4400094 c4a00008 e4400098 .....@.......@..\n 0040 c4a0000c 03e00008 e440009c 00000000 .........@......\nContents of section .reginfo:\n 0000 8000003c 00000000 00000001 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"CameraScissorSet\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name CameraScissorSet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -5343,7 +5417,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8000F024_FC24` — benchmark function marioparty3:func_8000F024_FC24:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F024_FC24\n lui\t$at, %hi(frameBufferPool)\n sw\t$a0, %lo(frameBufferPool)($at)\n lui\t$at, %hi(frameBufferCount)\n sh\t$a1, %lo(frameBufferCount)($at)\n lui\t$at, %hi(frameBufferSegmentID)\n jr\t$ra\n sh\t$a2, %lo(frameBufferSegmentID)($at)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F024_FC24 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F024_FC24` — benchmark function marioparty3:func_8000F024_FC24:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F024_FC24:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsw\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tjr\tra\n 18:\tsh\ta2,0(at)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f9d164df3a2c16f4/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_8000F024_FC24\n00000000 *UND*\t00000000 frameBufferPool\n00000000 *UND*\t00000000 frameBufferCount\n00000000 *UND*\t00000000 frameBufferSegmentID\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 frameBufferPool\n00000004 R_MIPS_LO16 frameBufferPool\n00000008 R_MIPS_HI16 frameBufferCount\n0000000c R_MIPS_LO16 frameBufferCount\n00000010 R_MIPS_HI16 frameBufferSegmentID\n00000018 R_MIPS_LO16 frameBufferSegmentID\n\n\nContents of section .text:\n 0000 3c010000 ac240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 03e00008 a4260000 00000000 <........&......\nContents of section .reginfo:\n 0000 80000072 00000000 00000000 00000000 ...r............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F024_FC24\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F024_FC24 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F024_FC24` — benchmark function marioparty3:func_8000F024_FC24:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F024_FC24:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsw\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tjr\tra\n 18:\tsh\ta2,0(at)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f9d164df3a2c16f4/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_8000F024_FC24\n00000000 *UND*\t00000000 frameBufferPool\n00000000 *UND*\t00000000 frameBufferCount\n00000000 *UND*\t00000000 frameBufferSegmentID\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 frameBufferPool\n00000004 R_MIPS_LO16 frameBufferPool\n00000008 R_MIPS_HI16 frameBufferCount\n0000000c R_MIPS_LO16 frameBufferCount\n00000010 R_MIPS_HI16 frameBufferSegmentID\n00000018 R_MIPS_LO16 frameBufferSegmentID\n\n\nContents of section .text:\n 0000 3c010000 ac240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 03e00008 a4260000 00000000 <........&......\nContents of section .reginfo:\n 0000 80000072 00000000 00000000 00000000 ...r............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F024_FC24\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F024_FC24 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -5449,7 +5523,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8000F04C_FC4C` — benchmark function marioparty3:func_8000F04C_FC4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F04C_FC4C\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThread3Stack)\n sw\t$v0, %lo(gThread3Stack)($at)\n addiu\t$a0, $a0, 4\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThreadOutStack)\n sw\t$v0, %lo(gThreadOutStack)($at)\n addiu\t$a0, $a0, 4\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThreadOutStackSize)\n sw\t$v0, %lo(gThreadOutStackSize)($at)\n lw\t$v0, 4($a0)\n lui\t$at, %hi(gThreadYieldStack)\n jr\t$ra\n sw\t$v0, %lo(gThreadYieldStack)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-5423b0a9a65c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8000F04C_FC4C(u64 **threadStacks);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F04C_FC4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F04C_FC4C` — benchmark function marioparty3:func_8000F04C_FC4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F04C_FC4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tlui\tat,0x0\n 8:\tsw\tv0,0(at)\n c:\taddiu\ta0,a0,4\n 10:\tlw\tv0,0(a0)\n 14:\tlui\tat,0x0\n 18:\tsw\tv0,0(at)\n 1c:\taddiu\ta0,a0,4\n 20:\tlw\tv0,0(a0)\n 24:\tlui\tat,0x0\n 28:\tsw\tv0,0(at)\n 2c:\tlw\tv0,4(a0)\n 30:\tlui\tat,0x0\n 34:\tjr\tra\n 38:\tsw\tv0,0(at)\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-7e5035f793b0f45c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_8000F04C_FC4C\n00000000 *UND*\t00000000 gThread3Stack\n00000000 *UND*\t00000000 gThreadOutStack\n00000000 *UND*\t00000000 gThreadOutStackSize\n00000000 *UND*\t00000000 gThreadYieldStack\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 gThread3Stack\n00000008 R_MIPS_LO16 gThread3Stack\n00000014 R_MIPS_HI16 gThreadOutStack\n00000018 R_MIPS_LO16 gThreadOutStack\n00000024 R_MIPS_HI16 gThreadOutStackSize\n00000028 R_MIPS_LO16 gThreadOutStackSize\n00000030 R_MIPS_HI16 gThreadYieldStack\n00000038 R_MIPS_LO16 gThreadYieldStack\n\n\nContents of section .text:\n 0000 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0010 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0020 8c820000 3c010000 ac220000 8c820004 ....<....\"......\n 0030 3c010000 03e00008 ac220000 00000000 <........\"......\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F04C_FC4C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F04C_FC4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F04C_FC4C` — benchmark function marioparty3:func_8000F04C_FC4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F04C_FC4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tlui\tat,0x0\n 8:\tsw\tv0,0(at)\n c:\taddiu\ta0,a0,4\n 10:\tlw\tv0,0(a0)\n 14:\tlui\tat,0x0\n 18:\tsw\tv0,0(at)\n 1c:\taddiu\ta0,a0,4\n 20:\tlw\tv0,0(a0)\n 24:\tlui\tat,0x0\n 28:\tsw\tv0,0(at)\n 2c:\tlw\tv0,4(a0)\n 30:\tlui\tat,0x0\n 34:\tjr\tra\n 38:\tsw\tv0,0(at)\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-7e5035f793b0f45c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_8000F04C_FC4C\n00000000 *UND*\t00000000 gThread3Stack\n00000000 *UND*\t00000000 gThreadOutStack\n00000000 *UND*\t00000000 gThreadOutStackSize\n00000000 *UND*\t00000000 gThreadYieldStack\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 gThread3Stack\n00000008 R_MIPS_LO16 gThread3Stack\n00000014 R_MIPS_HI16 gThreadOutStack\n00000018 R_MIPS_LO16 gThreadOutStack\n00000024 R_MIPS_HI16 gThreadOutStackSize\n00000028 R_MIPS_LO16 gThreadOutStackSize\n00000030 R_MIPS_HI16 gThreadYieldStack\n00000038 R_MIPS_LO16 gThreadYieldStack\n\n\nContents of section .text:\n 0000 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0010 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0020 8c820000 3c010000 ac220000 8c820004 ....<....\"......\n 0030 3c010000 03e00008 ac220000 00000000 <........\"......\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F04C_FC4C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F04C_FC4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -5535,7 +5609,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8000F088_FC88` — benchmark function marioparty3:func_8000F088_FC88:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F088_FC88\n lui\t$at, %hi(gUCodeAddresses)\n jr\t$ra\n sw\t$a0, %lo(gUCodeAddresses)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-c25019c2fe69.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8000F088_FC88(s32 *uCodeAdresses);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F088_FC88 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F088_FC88` — benchmark function marioparty3:func_8000F088_FC88:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F088_FC88:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsw\ta0,0(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6e75782630e57f66/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8000F088_FC88\n00000000 *UND*\t00000000 gUCodeAddresses\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gUCodeAddresses\n00000008 R_MIPS_LO16 gUCodeAddresses\n\n\nContents of section .text:\n 0000 3c010000 03e00008 ac240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F088_FC88\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F088_FC88 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F088_FC88` — benchmark function marioparty3:func_8000F088_FC88:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F088_FC88:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsw\ta0,0(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6e75782630e57f66/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8000F088_FC88\n00000000 *UND*\t00000000 gUCodeAddresses\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gUCodeAddresses\n00000008 R_MIPS_LO16 gUCodeAddresses\n\n\nContents of section .text:\n 0000 3c010000 03e00008 ac240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F088_FC88\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F088_FC88 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -5617,7 +5691,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80011460_12060` — benchmark function marioparty3:func_80011460_12060:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80011460_12060\n move\t$a3, $zero\n li\t$a2, 1\n lbu\t$v0, 0($a0)\n beqz\t$v0, .L54\n move\t$a1, $v0\n sll\t$v0, $a2, 0x10\n.L18:\n sra\t$v0, $v0, 0x10\n mult\t$v0, $a1\n mflo\t$v0\n addu\t$a3, $a3, $v0\n addiu\t$a0, $a0, 1\n addiu\t$v0, $a2, 1\n move\t$a2, $v0\n lbu\t$a1, 0($a0)\n sltu\t$v1, $zero, $a1\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 28\n and\t$v1, $v1, $v0\n bnezl\t$v1, .L18\n sll\t$v0, $a2, 0x10\n.L54:\n sll\t$v0, $a3, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80011460_12060 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80011460_12060` — benchmark function marioparty3:func_80011460_12060:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80011460_12060:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\ta3,zero\n 4:\tli\ta2,1\n 8:\tlbu\tv0,0(a0)\n c:\tbeqz\tv0,54 \n 10:\tmove\ta1,v0\n 14:\tsll\tv0,a2,0x10\n 18:\tsra\tv0,v0,0x10\n 1c:\tmult\tv0,a1\n 20:\tmflo\tv0\n 24:\taddu\ta3,a3,v0\n 28:\taddiu\ta0,a0,1\n 2c:\taddiu\tv0,a2,1\n 30:\tmove\ta2,v0\n 34:\tlbu\ta1,0(a0)\n 38:\tsltu\tv1,zero,a1\n 3c:\tsll\tv0,v0,0x10\n 40:\tsra\tv0,v0,0x10\n 44:\tslti\tv0,v0,28\n 48:\tand\tv1,v1,v0\n 4c:\tbnezl\tv1,18 \n 50:\tsll\tv0,a2,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tjr\tra\n 5c:\tsra\tv0,v0,0x10\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-be8a3ce746675614/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80011460_12060\n\n\nContents of section .text:\n 0000 00003821 24060001 90820000 10400011 ..8!$........@..\n 0010 00402821 00061400 00021403 00450018 .@(!.........E..\n 0020 00001012 00e23821 24840001 24c20001 ......8!$...$...\n 0030 00403021 90850000 0005182b 00021400 .@0!.......+....\n 0040 00021403 2842001c 00621824 5460fff2 ....(B...b.$T`..\n 0050 00061400 00071400 03e00008 00021403 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80011460_12060 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80011460_12060` — benchmark function marioparty3:func_80011460_12060:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80011460_12060:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\ta3,zero\n 4:\tli\ta2,1\n 8:\tlbu\tv0,0(a0)\n c:\tbeqz\tv0,54 \n 10:\tmove\ta1,v0\n 14:\tsll\tv0,a2,0x10\n 18:\tsra\tv0,v0,0x10\n 1c:\tmult\tv0,a1\n 20:\tmflo\tv0\n 24:\taddu\ta3,a3,v0\n 28:\taddiu\ta0,a0,1\n 2c:\taddiu\tv0,a2,1\n 30:\tmove\ta2,v0\n 34:\tlbu\ta1,0(a0)\n 38:\tsltu\tv1,zero,a1\n 3c:\tsll\tv0,v0,0x10\n 40:\tsra\tv0,v0,0x10\n 44:\tslti\tv0,v0,28\n 48:\tand\tv1,v1,v0\n 4c:\tbnezl\tv1,18 \n 50:\tsll\tv0,a2,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tjr\tra\n 5c:\tsra\tv0,v0,0x10\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-be8a3ce746675614/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80011460_12060\n\n\nContents of section .text:\n 0000 00003821 24060001 90820000 10400011 ..8!$........@..\n 0010 00402821 00061400 00021403 00450018 .@(!.........E..\n 0020 00001012 00e23821 24840001 24c20001 ......8!$...$...\n 0030 00403021 90850000 0005182b 00021400 .@0!.......+....\n 0040 00021403 2842001c 00621824 5460fff2 ....(B...b.$T`..\n 0050 00061400 00071400 03e00008 00021403 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80011460_12060 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -5704,7 +5778,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_800123F4_12FF4` — benchmark function marioparty3:func_800123F4_12FF4:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800123F4_12FF4\n lui\t$v0, %hi(D_800D2008_D2C08)\n lbu\t$v0, %lo(D_800D2008_D2C08)($v0)\n lui\t$at, %hi(D_800D418E_D4D8E)\n jr\t$ra\n sh\t$v0, %lo(D_800D418E_D4D8E)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-888e856682f4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800123F4_12FF4(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800123F4_12FF4 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800123F4_12FF4` — benchmark function marioparty3:func_800123F4_12FF4:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800123F4_12FF4:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlbu\tv0,0(v0)\n 8:\tlui\tat,0x0\n c:\tjr\tra\n 10:\tsh\tv0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-05c12408f5e201a5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 func_800123F4_12FF4\n00000000 *UND*\t00000000 D_800D2008_D2C08\n00000000 *UND*\t00000000 D_800D418E_D4D8E\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D2008_D2C08\n00000004 R_MIPS_LO16 D_800D2008_D2C08\n00000008 R_MIPS_HI16 D_800D418E_D4D8E\n00000010 R_MIPS_LO16 D_800D418E_D4D8E\n\n\nContents of section .text:\n 0000 3c020000 90420000 3c010000 03e00008 <....B..<.......\n 0010 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000006 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800123F4_12FF4\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800123F4_12FF4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800123F4_12FF4` — benchmark function marioparty3:func_800123F4_12FF4:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800123F4_12FF4:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlbu\tv0,0(v0)\n 8:\tlui\tat,0x0\n c:\tjr\tra\n 10:\tsh\tv0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-05c12408f5e201a5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 func_800123F4_12FF4\n00000000 *UND*\t00000000 D_800D2008_D2C08\n00000000 *UND*\t00000000 D_800D418E_D4D8E\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D2008_D2C08\n00000004 R_MIPS_LO16 D_800D2008_D2C08\n00000008 R_MIPS_HI16 D_800D418E_D4D8E\n00000010 R_MIPS_LO16 D_800D418E_D4D8E\n\n\nContents of section .text:\n 0000 3c020000 90420000 3c010000 03e00008 <....B..<.......\n 0010 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000006 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800123F4_12FF4\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800123F4_12FF4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -5788,7 +5862,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8001D330_1DF30` — benchmark function marioparty3:func_8001D330_1DF30:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001D330_1DF30\n lui\t$at, %hi(D_800A0A78_A1678)\n jr\t$ra\n sh\t$a0, %lo(D_800A0A78_A1678)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-f8dec0704e6a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8001D330_1DF30(s16 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001D330_1DF30 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001D330_1DF30` — benchmark function marioparty3:func_8001D330_1DF30:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8001D330_1DF30:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsh\ta0,0(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fda35e2082dacdbe/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8001D330_1DF30\n00000000 *UND*\t00000000 D_800A0A78_A1678\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800A0A78_A1678\n00000008 R_MIPS_LO16 D_800A0A78_A1678\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a4240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001D330_1DF30\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001D330_1DF30 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001D330_1DF30` — benchmark function marioparty3:func_8001D330_1DF30:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8001D330_1DF30:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsh\ta0,0(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fda35e2082dacdbe/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8001D330_1DF30\n00000000 *UND*\t00000000 D_800A0A78_A1678\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800A0A78_A1678\n00000008 R_MIPS_LO16 D_800A0A78_A1678\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a4240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001D330_1DF30\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001D330_1DF30 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -5876,7 +5950,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8001FBBC_207BC` — benchmark function marioparty3:func_8001FBBC_207BC:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001FBBC_207BC\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n lui\t$v1, %hi(HmfModelData)\n lw\t$v1, %lo(HmfModelData)($v1)\n sll\t$v0, $a0, 0x1\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x6\n addu\t$v0, $v0, $v1\n lw\t$v0, 180($v0)\n beqz\t$v0, .L38\n nop\n sb\t$a1, 0($v0)\n sb\t$a2, 1($v0)\n sb\t$a3, 2($v0)\n.L38:\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8001FBBC_207BC(s16 arg0, s8 arg1, s8 arg2, s8 arg3);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001FBBC_207BC # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001FBBC_207BC` — benchmark function marioparty3:func_8001FBBC_207BC:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8001FBBC_207BC:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tlui\tv1,0x0\n c:\tlw\tv1,0(v1)\n 10:\tsll\tv0,a0,0x1\n 14:\taddu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x6\n 1c:\taddu\tv0,v0,v1\n 20:\tlw\tv0,180(v0)\n 24:\tbeqz\tv0,38 \n 28:\tnop\n 2c:\tsb\ta1,0(v0)\n 30:\tsb\ta2,1(v0)\n 34:\tsb\ta3,2(v0)\n 38:\tjr\tra\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ecb67d8ea63f745/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001FBBC_207BC\n00000000 *UND*\t00000000 HmfModelData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HmfModelData\n0000000c R_MIPS_LO16 HmfModelData\n\n\nContents of section .text:\n 0000 00042400 00042403 3c030000 8c630000 ..$...$.<....c..\n 0010 00041040 00441021 00021180 00431021 ...@.D.!.....C.!\n 0020 8c4200b4 10400004 00000000 a0450000 .B...@.......E..\n 0030 a0460001 a0470002 03e00008 00000000 .F...G..........\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001FBBC_207BC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001FBBC_207BC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001FBBC_207BC` — benchmark function marioparty3:func_8001FBBC_207BC:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8001FBBC_207BC:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tlui\tv1,0x0\n c:\tlw\tv1,0(v1)\n 10:\tsll\tv0,a0,0x1\n 14:\taddu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x6\n 1c:\taddu\tv0,v0,v1\n 20:\tlw\tv0,180(v0)\n 24:\tbeqz\tv0,38 \n 28:\tnop\n 2c:\tsb\ta1,0(v0)\n 30:\tsb\ta2,1(v0)\n 34:\tsb\ta3,2(v0)\n 38:\tjr\tra\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ecb67d8ea63f745/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001FBBC_207BC\n00000000 *UND*\t00000000 HmfModelData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HmfModelData\n0000000c R_MIPS_LO16 HmfModelData\n\n\nContents of section .text:\n 0000 00042400 00042403 3c030000 8c630000 ..$...$.<....c..\n 0010 00041040 00441021 00021180 00431021 ...@.D.!.....C.!\n 0020 8c4200b4 10400004 00000000 a0450000 .B...@.......E..\n 0030 a0460001 a0470002 03e00008 00000000 .F...G..........\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001FBBC_207BC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001FBBC_207BC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -5958,7 +6032,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8002FD48_30948` — benchmark function marioparty3:func_8002FD48_30948:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002FD48_30948\n jr\t$ra\n sw\t$zero, 160($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8002FD48_30948(HmfData *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002FD48_30948 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002FD48_30948` — benchmark function marioparty3:func_8002FD48_30948:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8002FD48_30948:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\tzero,160(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ae562d6511b20a82/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_8002FD48_30948\n\n\nContents of section .text:\n 0000 03e00008 ac8000a0 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000010 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8002FD48_30948\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002FD48_30948 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002FD48_30948` — benchmark function marioparty3:func_8002FD48_30948:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8002FD48_30948:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\tzero,160(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ae562d6511b20a82/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_8002FD48_30948\n\n\nContents of section .text:\n 0000 03e00008 ac8000a0 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000010 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8002FD48_30948\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002FD48_30948 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -6049,7 +6123,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80045314_45F14` — benchmark function marioparty3:func_80045314_45F14:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045314_45F14\n lui\t$v1, %hi(omovl)\n lw\t$v1, %lo(omovl)($v1)\n li\t$v0, 2\n beq\t$v1, $v0, .L24\n li\t$v0, 3\n beq\t$v1, $v0, .L28\n li\t$v0, -20\n j\t.L28\n move\t$v0, $zero\n.L24:\n li\t$v0, 20\n.L28:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045314_45F14 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045314_45F14` — benchmark function marioparty3:func_80045314_45F14:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045314_45F14:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tli\tv0,2\n c:\tbeq\tv1,v0,24 \n 10:\tli\tv0,3\n 14:\tbeq\tv1,v0,28 \n 18:\tli\tv0,-20\n 1c:\tj\t28 \n 20:\tmove\tv0,zero\n 24:\tli\tv0,20\n 28:\tjr\tra\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fe5bd170329e178e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_80045314_45F14\n00000000 *UND*\t00000000 omovl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 omovl\n00000004 R_MIPS_LO16 omovl\n0000001c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 3c030000 8c630000 24020002 10620005 <....c..$....b..\n 0010 24020003 10620004 2402ffec 0800000a $....b..$.......\n 0020 00001021 24020014 03e00008 00000000 ...!$...........\nContents of section .reginfo:\n 0000 8000000c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045314_45F14 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045314_45F14` — benchmark function marioparty3:func_80045314_45F14:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045314_45F14:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tli\tv0,2\n c:\tbeq\tv1,v0,24 \n 10:\tli\tv0,3\n 14:\tbeq\tv1,v0,28 \n 18:\tli\tv0,-20\n 1c:\tj\t28 \n 20:\tmove\tv0,zero\n 24:\tli\tv0,20\n 28:\tjr\tra\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fe5bd170329e178e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_80045314_45F14\n00000000 *UND*\t00000000 omovl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 omovl\n00000004 R_MIPS_LO16 omovl\n0000001c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 3c030000 8c630000 24020002 10620005 <....c..$....b..\n 0010 24020003 10620004 2402ffec 0800000a $....b..$.......\n 0020 00001021 24020014 03e00008 00000000 ...!$...........\nContents of section .reginfo:\n 0000 8000000c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045314_45F14 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -6127,7 +6201,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80045350_45F50` — benchmark function marioparty3:func_80045350_45F50:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045350_45F50\n lui\t$v1, %hi(GwSystem)\n lb\t$v1, %lo(GwSystem)($v1)\n addiu\t$v1, $v1, -1\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_800A6D44_A7944)\n addu\t$v1, $v1, $v0\n lbu\t$v1, %lo(D_800A6D44_A7944)($v1)\n li\t$v0, 6\n beq\t$v1, $v0, .L64\n nop\n move\t$v1, $zero\n lui\t$a0, %hi(GwPlayer)\n addiu\t$a0, $a0, %lo(GwPlayer)\n sll\t$v0, $v1, 0x3\n.L40:\n subu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x3\n addu\t$v0, $v0, $a0\n sh\t$zero, 6($v0)\n sh\t$zero, 8($v0)\n addiu\t$v1, $v1, 1\n slti\t$v0, $v1, 4\n bnez\t$v0, .L40\n sll\t$v0, $v1, 0x3\n.L64:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-a3d2d0baeda1.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80045350_45F50(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045350_45F50 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045350_45F50` — benchmark function marioparty3:func_80045350_45F50:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045350_45F50:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlb\tv1,16(v1)\n 8:\taddiu\tv1,v1,-1\n c:\tsll\tv0,v1,0x2\n 10:\taddu\tv0,v0,v1\n 14:\tsll\tv0,v0,0x2\n 18:\tlui\tv1,0x0\n 1c:\taddu\tv1,v1,v0\n 20:\tlbu\tv1,0(v1)\n 24:\tli\tv0,6\n 28:\tbeq\tv1,v0,64 \n 2c:\tnop\n 30:\tmove\tv1,zero\n 34:\tlui\ta0,0x0\n 38:\taddiu\ta0,a0,0\n 3c:\tsll\tv0,v1,0x3\n 40:\tsubu\tv0,v0,v1\n 44:\tsll\tv0,v0,0x3\n 48:\taddu\tv0,v0,a0\n 4c:\tsh\tzero,6(v0)\n 50:\tsh\tzero,8(v0)\n 54:\taddiu\tv1,v1,1\n 58:\tslti\tv0,v1,4\n 5c:\tbnez\tv0,40 \n 60:\tsll\tv0,v1,0x3\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-42758b8683c841eb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80045350_45F50\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 D_800A6D44_A7944\n00000000 *UND*\t00000000 GwPlayer\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000004 R_MIPS_LO16 GwSystem\n00000018 R_MIPS_HI16 D_800A6D44_A7944\n00000020 R_MIPS_LO16 D_800A6D44_A7944\n00000034 R_MIPS_HI16 GwPlayer\n00000038 R_MIPS_LO16 GwPlayer\n\n\nContents of section .text:\n 0000 3c030000 80630010 2463ffff 00031080 <....c..$c......\n 0010 00431021 00021080 3c030000 00621821 .C.!....<....b.!\n 0020 90630000 24020006 1062000e 00000000 .c..$....b......\n 0030 00001821 3c040000 24840000 000310c0 ...!<...$.......\n 0040 00431023 000210c0 00441021 a4400006 .C.#.....D.!.@..\n 0050 a4400008 24630001 28620004 1440fff8 .@..$c..(b...@..\n 0060 000310c0 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80045350_45F50\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045350_45F50 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045350_45F50` — benchmark function marioparty3:func_80045350_45F50:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045350_45F50:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlb\tv1,16(v1)\n 8:\taddiu\tv1,v1,-1\n c:\tsll\tv0,v1,0x2\n 10:\taddu\tv0,v0,v1\n 14:\tsll\tv0,v0,0x2\n 18:\tlui\tv1,0x0\n 1c:\taddu\tv1,v1,v0\n 20:\tlbu\tv1,0(v1)\n 24:\tli\tv0,6\n 28:\tbeq\tv1,v0,64 \n 2c:\tnop\n 30:\tmove\tv1,zero\n 34:\tlui\ta0,0x0\n 38:\taddiu\ta0,a0,0\n 3c:\tsll\tv0,v1,0x3\n 40:\tsubu\tv0,v0,v1\n 44:\tsll\tv0,v0,0x3\n 48:\taddu\tv0,v0,a0\n 4c:\tsh\tzero,6(v0)\n 50:\tsh\tzero,8(v0)\n 54:\taddiu\tv1,v1,1\n 58:\tslti\tv0,v1,4\n 5c:\tbnez\tv0,40 \n 60:\tsll\tv0,v1,0x3\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-42758b8683c841eb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80045350_45F50\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 D_800A6D44_A7944\n00000000 *UND*\t00000000 GwPlayer\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000004 R_MIPS_LO16 GwSystem\n00000018 R_MIPS_HI16 D_800A6D44_A7944\n00000020 R_MIPS_LO16 D_800A6D44_A7944\n00000034 R_MIPS_HI16 GwPlayer\n00000038 R_MIPS_LO16 GwPlayer\n\n\nContents of section .text:\n 0000 3c030000 80630010 2463ffff 00031080 <....c..$c......\n 0010 00431021 00021080 3c030000 00621821 .C.!....<....b.!\n 0020 90630000 24020006 1062000e 00000000 .c..$....b......\n 0030 00001821 3c040000 24840000 000310c0 ...!<...$.......\n 0040 00431023 000210c0 00441021 a4400006 .C.#.....D.!.@..\n 0050 a4400008 24630001 28620004 1440fff8 .@..$c..(b...@..\n 0060 000310c0 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80045350_45F50\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045350_45F50 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -6211,7 +6285,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80045BF0_467F0` — benchmark function marioparty3:func_80045BF0_467F0:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045BF0_467F0\n move\t$v1, $zero\n andi\t$a0, $a0, 0xff\n.L8:\n lui\t$v0, %hi(D_800A1590_A2190)\n addu\t$v0, $v0, $v1\n lbu\t$v0, %lo(D_800A1590_A2190)($v0)\n beq\t$a0, $v0, .L2c\n sltiu\t$v0, $v1, 9\n addiu\t$v1, $v1, 1\n sltiu\t$v0, $v1, 9\n bnez\t$v0, .L8\n nop\n.L2c:\n beqzl\t$v0, .L34\n li\t$v1, -1\n.L34:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-60e502c4aebd.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 func_80045BF0_467F0(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045BF0_467F0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045BF0_467F0` — benchmark function marioparty3:func_80045BF0_467F0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045BF0_467F0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tandi\ta0,a0,0xff\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,v1\n 10:\tlbu\tv0,0(v0)\n 14:\tbeq\ta0,v0,2c \n 18:\tsltiu\tv0,v1,9\n 1c:\taddiu\tv1,v1,1\n 20:\tsltiu\tv0,v1,9\n 24:\tbnez\tv0,8 \n 28:\tnop\n 2c:\tbeqzl\tv0,34 \n 30:\tli\tv1,-1\n 34:\tjr\tra\n 38:\tmove\tv0,v1\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a29f6a37f2d335f7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_80045BF0_467F0\n00000000 *UND*\t00000000 D_800A1590_A2190\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800A1590_A2190\n00000010 R_MIPS_LO16 D_800A1590_A2190\n\n\nContents of section .text:\n 0000 00001821 308400ff 3c020000 00431021 ...!0...<....C.!\n 0010 90420000 10820005 2c620009 24630001 .B......,b..$c..\n 0020 2c620009 1440fff8 00000000 50400001 ,b...@......P@..\n 0030 2403ffff 03e00008 00601021 00000000 $........`.!....\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045BF0_467F0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045BF0_467F0` — benchmark function marioparty3:func_80045BF0_467F0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045BF0_467F0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tandi\ta0,a0,0xff\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,v1\n 10:\tlbu\tv0,0(v0)\n 14:\tbeq\ta0,v0,2c \n 18:\tsltiu\tv0,v1,9\n 1c:\taddiu\tv1,v1,1\n 20:\tsltiu\tv0,v1,9\n 24:\tbnez\tv0,8 \n 28:\tnop\n 2c:\tbeqzl\tv0,34 \n 30:\tli\tv1,-1\n 34:\tjr\tra\n 38:\tmove\tv0,v1\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a29f6a37f2d335f7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_80045BF0_467F0\n00000000 *UND*\t00000000 D_800A1590_A2190\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800A1590_A2190\n00000010 R_MIPS_LO16 D_800A1590_A2190\n\n\nContents of section .text:\n 0000 00001821 308400ff 3c020000 00431021 ...!0...<....C.!\n 0010 90420000 10820005 2c620009 24630001 .B......,b..$c..\n 0020 2c620009 1440fff8 00000000 50400001 ,b...@......P@..\n 0030 2403ffff 03e00008 00601021 00000000 $........`.!....\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045BF0_467F0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -6293,7 +6367,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80047E90_48A90` — benchmark function marioparty3:func_80047E90_48A90:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80047E90_48A90\n lw\t$v0, 16($a0)\n or\t$a1, $a1, $v0\n jr\t$ra\n sw\t$a1, 16($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80047E90_48A90(omObjData *obj, s32 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80047E90_48A90 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80047E90_48A90` — benchmark function marioparty3:func_80047E90_48A90:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80047E90_48A90:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,16(a0)\n 4:\tor\ta1,a1,v0\n 8:\tjr\tra\n c:\tsw\ta1,16(a0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-18006fbfe679d559/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_80047E90_48A90\n\n\nContents of section .text:\n 0000 8c820010 00a22825 03e00008 ac850010 ......(%........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80047E90_48A90\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80047E90_48A90 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80047E90_48A90` — benchmark function marioparty3:func_80047E90_48A90:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80047E90_48A90:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,16(a0)\n 4:\tor\ta1,a1,v0\n 8:\tjr\tra\n c:\tsw\ta1,16(a0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-18006fbfe679d559/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_80047E90_48A90\n\n\nContents of section .text:\n 0000 8c820010 00a22825 03e00008 ac850010 ......(%........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80047E90_48A90\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80047E90_48A90 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -6383,7 +6457,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8004A444_4B044` — benchmark function marioparty3:func_8004A444_4B044:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8004A444_4B044\n li\t$v0, 1\n lui\t$at, %hi(D_800A1780_A2380)\n sh\t$v0, %lo(D_800A1780_A2380)($at)\n li\t$v0, 4\n lui\t$at, %hi(D_800D0A3A_D163A)\n sh\t$v0, %lo(D_800D0A3A_D163A)($at)\n lui\t$at, %hi(D_800D1710_D2310)\n jr\t$ra\n sb\t$a0, %lo(D_800D1710_D2310)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-36a64acb471a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8004A444_4B044(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8004A444_4B044 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8004A444_4B044` — benchmark function marioparty3:func_8004A444_4B044:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8004A444_4B044:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tlui\tat,0x0\n 8:\tsh\tv0,0(at)\n c:\tli\tv0,4\n 10:\tlui\tat,0x0\n 14:\tsh\tv0,0(at)\n 18:\tlui\tat,0x0\n 1c:\tjr\tra\n 20:\tsb\ta0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-74d5e58386117089/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 func_8004A444_4B044\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n00000000 *UND*\t00000000 D_800D1710_D2310\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 D_800A1780_A2380\n00000008 R_MIPS_LO16 D_800A1780_A2380\n00000010 R_MIPS_HI16 D_800D0A3A_D163A\n00000014 R_MIPS_LO16 D_800D0A3A_D163A\n00000018 R_MIPS_HI16 D_800D1710_D2310\n00000020 R_MIPS_LO16 D_800D1710_D2310\n\n\nContents of section .text:\n 0000 24020001 3c010000 a4220000 24020004 $...<....\"..$...\n 0010 3c010000 a4220000 3c010000 03e00008 <....\"..<.......\n 0020 a0240000 00000000 00000000 00000000 .$..............\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8004A444_4B044\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8004A444_4B044 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8004A444_4B044` — benchmark function marioparty3:func_8004A444_4B044:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8004A444_4B044:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tlui\tat,0x0\n 8:\tsh\tv0,0(at)\n c:\tli\tv0,4\n 10:\tlui\tat,0x0\n 14:\tsh\tv0,0(at)\n 18:\tlui\tat,0x0\n 1c:\tjr\tra\n 20:\tsb\ta0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-74d5e58386117089/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 func_8004A444_4B044\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n00000000 *UND*\t00000000 D_800D1710_D2310\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 D_800A1780_A2380\n00000008 R_MIPS_LO16 D_800A1780_A2380\n00000010 R_MIPS_HI16 D_800D0A3A_D163A\n00000014 R_MIPS_LO16 D_800D0A3A_D163A\n00000018 R_MIPS_HI16 D_800D1710_D2310\n00000020 R_MIPS_LO16 D_800D1710_D2310\n\n\nContents of section .text:\n 0000 24020001 3c010000 a4220000 24020004 $...<....\"..$...\n 0010 3c010000 a4220000 3c010000 03e00008 <....\"..<.......\n 0020 a0240000 00000000 00000000 00000000 .$..............\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8004A444_4B044\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8004A444_4B044 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -6479,7 +6553,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8004A468_4B068` — benchmark function marioparty3:func_8004A468_4B068:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8004A468_4B068\n lui\t$at, %hi(D_800D4082_D4C82)\n sh\t$a0, %lo(D_800D4082_D4C82)($at)\n lui\t$at, %hi(D_800CD2F4_CDEF4)\n sh\t$a1, %lo(D_800CD2F4_CDEF4)($at)\n lui\t$at, %hi(D_800D6A56_D7656)\n sh\t$a2, %lo(D_800D6A56_D7656)($at)\n li\t$v0, 1\n lui\t$at, %hi(D_800A1780_A2380)\n sh\t$v0, %lo(D_800A1780_A2380)($at)\n li\t$v0, 4\n lui\t$at, %hi(D_800D0A3A_D163A)\n jr\t$ra\n sh\t$v0, %lo(D_800D0A3A_D163A)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-568fac34e668.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8004A468_4B068(u16 arg0, u16 arg1, u16 arg2);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8004A468_4B068 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8004A468_4B068` — benchmark function marioparty3:func_8004A468_4B068:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8004A468_4B068:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsh\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tsh\ta2,0(at)\n 18:\tli\tv0,1\n 1c:\tlui\tat,0x0\n 20:\tsh\tv0,0(at)\n 24:\tli\tv0,4\n 28:\tlui\tat,0x0\n 2c:\tjr\tra\n 30:\tsh\tv0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-de11bb2b49be74db/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8004A468_4B068\n00000000 *UND*\t00000000 D_800D4082_D4C82\n00000000 *UND*\t00000000 D_800CD2F4_CDEF4\n00000000 *UND*\t00000000 D_800D6A56_D7656\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D4082_D4C82\n00000004 R_MIPS_LO16 D_800D4082_D4C82\n00000008 R_MIPS_HI16 D_800CD2F4_CDEF4\n0000000c R_MIPS_LO16 D_800CD2F4_CDEF4\n00000010 R_MIPS_HI16 D_800D6A56_D7656\n00000014 R_MIPS_LO16 D_800D6A56_D7656\n0000001c R_MIPS_HI16 D_800A1780_A2380\n00000020 R_MIPS_LO16 D_800A1780_A2380\n00000028 R_MIPS_HI16 D_800D0A3A_D163A\n00000030 R_MIPS_LO16 D_800D0A3A_D163A\n\n\nContents of section .text:\n 0000 3c010000 a4240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 a4260000 24020001 3c010000 <....&..$...<...\n 0020 a4220000 24020004 3c010000 03e00008 .\"..$...<.......\n 0030 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8004A468_4B068\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8004A468_4B068 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8004A468_4B068` — benchmark function marioparty3:func_8004A468_4B068:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8004A468_4B068:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsh\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tsh\ta2,0(at)\n 18:\tli\tv0,1\n 1c:\tlui\tat,0x0\n 20:\tsh\tv0,0(at)\n 24:\tli\tv0,4\n 28:\tlui\tat,0x0\n 2c:\tjr\tra\n 30:\tsh\tv0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-de11bb2b49be74db/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8004A468_4B068\n00000000 *UND*\t00000000 D_800D4082_D4C82\n00000000 *UND*\t00000000 D_800CD2F4_CDEF4\n00000000 *UND*\t00000000 D_800D6A56_D7656\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D4082_D4C82\n00000004 R_MIPS_LO16 D_800D4082_D4C82\n00000008 R_MIPS_HI16 D_800CD2F4_CDEF4\n0000000c R_MIPS_LO16 D_800CD2F4_CDEF4\n00000010 R_MIPS_HI16 D_800D6A56_D7656\n00000014 R_MIPS_LO16 D_800D6A56_D7656\n0000001c R_MIPS_HI16 D_800A1780_A2380\n00000020 R_MIPS_LO16 D_800A1780_A2380\n00000028 R_MIPS_HI16 D_800D0A3A_D163A\n00000030 R_MIPS_LO16 D_800D0A3A_D163A\n\n\nContents of section .text:\n 0000 3c010000 a4240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 a4260000 24020001 3c010000 <....&..$...<...\n 0020 a4220000 24020004 3c010000 03e00008 .\"..$...<.......\n 0030 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8004A468_4B068\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8004A468_4B068 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -6555,7 +6629,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80052E14_53A14` — benchmark function marioparty3:func_80052E14_53A14:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80052E14_53A14\n lw\t$v0, 132($a0)\n sw\t$v0, 104($a0)\n lbu\t$v0, 136($a0)\n sb\t$v0, 108($a0)\n lhu\t$v0, 14($a0)\n sh\t$v0, 110($a0)\n lhu\t$v0, 138($a0)\n sh\t$v0, 114($a0)\n lhu\t$v0, 12($a0)\n sh\t$v0, 112($a0)\n lwc1\t$f0, 140($a0)\n swc1\t$f0, 116($a0)\n lwc1\t$f0, 16($a0)\n swc1\t$f0, 120($a0)\n lbu\t$v0, 146($a0)\n sb\t$v0, 126($a0)\n lhu\t$v0, 144($a0)\n sh\t$v0, 124($a0)\n sb\t$zero, 128($a0)\n jr\t$ra\n sb\t$zero, 127($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80052E14_53A14(HuSprite *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80052E14_53A14 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80052E14_53A14` — benchmark function marioparty3:func_80052E14_53A14:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80052E14_53A14:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,132(a0)\n 4:\tsw\tv0,104(a0)\n 8:\tlbu\tv0,136(a0)\n c:\tsb\tv0,108(a0)\n 10:\tlhu\tv0,14(a0)\n 14:\tsh\tv0,110(a0)\n 18:\tlhu\tv0,138(a0)\n 1c:\tsh\tv0,114(a0)\n 20:\tlhu\tv0,12(a0)\n 24:\tsh\tv0,112(a0)\n 28:\tlwc1\t$f0,140(a0)\n 2c:\tswc1\t$f0,116(a0)\n 30:\tlwc1\t$f0,16(a0)\n 34:\tswc1\t$f0,120(a0)\n 38:\tlbu\tv0,146(a0)\n 3c:\tsb\tv0,126(a0)\n 40:\tlhu\tv0,144(a0)\n 44:\tsh\tv0,124(a0)\n 48:\tsb\tzero,128(a0)\n 4c:\tjr\tra\n 50:\tsb\tzero,127(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-175e7c1a4c54ca05/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80052E14_53A14\n\n\nContents of section .text:\n 0000 8c820084 ac820068 90820088 a082006c .......h.......l\n 0010 9482000e a482006e 9482008a a4820072 .......n.......r\n 0020 9482000c a4820070 c480008c e4800074 .......p.......t\n 0030 c4800010 e4800078 90820092 a082007e .......x.......~\n 0040 94820090 a482007c a0800080 03e00008 .......|........\n 0050 a080007f 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80052E14_53A14\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80052E14_53A14 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80052E14_53A14` — benchmark function marioparty3:func_80052E14_53A14:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80052E14_53A14:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,132(a0)\n 4:\tsw\tv0,104(a0)\n 8:\tlbu\tv0,136(a0)\n c:\tsb\tv0,108(a0)\n 10:\tlhu\tv0,14(a0)\n 14:\tsh\tv0,110(a0)\n 18:\tlhu\tv0,138(a0)\n 1c:\tsh\tv0,114(a0)\n 20:\tlhu\tv0,12(a0)\n 24:\tsh\tv0,112(a0)\n 28:\tlwc1\t$f0,140(a0)\n 2c:\tswc1\t$f0,116(a0)\n 30:\tlwc1\t$f0,16(a0)\n 34:\tswc1\t$f0,120(a0)\n 38:\tlbu\tv0,146(a0)\n 3c:\tsb\tv0,126(a0)\n 40:\tlhu\tv0,144(a0)\n 44:\tsh\tv0,124(a0)\n 48:\tsb\tzero,128(a0)\n 4c:\tjr\tra\n 50:\tsb\tzero,127(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-175e7c1a4c54ca05/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80052E14_53A14\n\n\nContents of section .text:\n 0000 8c820084 ac820068 90820088 a082006c .......h.......l\n 0010 9482000e a482006e 9482008a a4820072 .......n.......r\n 0020 9482000c a4820070 c480008c e4800074 .......p.......t\n 0030 c4800010 e4800078 90820092 a082007e .......x.......~\n 0040 94820090 a482007c a0800080 03e00008 .......|........\n 0050 a080007f 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80052E14_53A14\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80052E14_53A14 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -6623,7 +6697,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_800560D8_56CD8` — benchmark function marioparty3:func_800560D8_56CD8:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800560D8_56CD8\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v1, %hi(D_800C9530_CA130)\n addu\t$v1, $v1, $a0\n lw\t$v1, %lo(D_800C9530_CA130)($v1)\n andi\t$a1, $a1, 0xffff\n sll\t$v0, $a1, 0x1\n addu\t$v0, $v0, $a1\n sll\t$v0, $v0, 0x2\n lw\t$v1, 0($v1)\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nHuSprite_Unk84_Unk00_Struct *func_800560D8_56CD8(s16 arg0, u16 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800560D8_56CD8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800560D8_56CD8` — benchmark function marioparty3:func_800560D8_56CD8:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800560D8_56CD8:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\tjr\tra\n 2c:\taddu\tv0,v0,v1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ccfed22fe178e2d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_800560D8_56CD8\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 03e00008 00431021 .....c.......C.!\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800560D8_56CD8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800560D8_56CD8` — benchmark function marioparty3:func_800560D8_56CD8:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800560D8_56CD8:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\tjr\tra\n 2c:\taddu\tv0,v0,v1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ccfed22fe178e2d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_800560D8_56CD8\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 03e00008 00431021 .....c.......C.!\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800560D8_56CD8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -6696,7 +6770,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8005614C_56D4C` — benchmark function marioparty3:func_8005614C_56D4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8005614C_56D4C\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v1, %hi(D_800C9530_CA130)\n addu\t$v1, $v1, $a0\n lw\t$v1, %lo(D_800C9530_CA130)($v1)\n andi\t$a1, $a1, 0xffff\n sll\t$v0, $a1, 0x1\n addu\t$v0, $v0, $a1\n sll\t$v0, $v0, 0x2\n lw\t$v1, 0($v1)\n addu\t$v0, $v0, $v1\n jr\t$ra\n lw\t$v0, 0($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_8005614C_56D4C(s16 arg0, u16 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8005614C_56D4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005614C_56D4C` — benchmark function marioparty3:func_8005614C_56D4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8005614C_56D4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\taddu\tv0,v0,v1\n 2c:\tjr\tra\n 30:\tlw\tv0,0(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ce007631d46caae3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8005614C_56D4C\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 00431021 03e00008 .....c...C.!....\n 0030 8c420000 00000000 00000000 00000000 .B..............\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8005614C_56D4C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8005614C_56D4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005614C_56D4C` — benchmark function marioparty3:func_8005614C_56D4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8005614C_56D4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\taddu\tv0,v0,v1\n 2c:\tjr\tra\n 30:\tlw\tv0,0(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ce007631d46caae3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8005614C_56D4C\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 00431021 03e00008 .....c...C.!....\n 0030 8c420000 00000000 00000000 00000000 .B..............\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8005614C_56D4C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8005614C_56D4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -6778,7 +6852,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80056254_56E54` — benchmark function marioparty3:func_80056254_56E54:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056254_56E54\n lw\t$v0, 0($a0)\n jr\t$ra\n lw\t$v0, 12($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80056254_56E54(HuSprite_Unk84_Struct **arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056254_56E54 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056254_56E54` — benchmark function marioparty3:func_80056254_56E54:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056254_56E54:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tjr\tra\n 8:\tlw\tv0,12(v0)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f915d8b63c68575e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_80056254_56E54\n\n\nContents of section .text:\n 0000 8c820000 03e00008 8c42000c 00000000 .........B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80056254_56E54\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056254_56E54 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056254_56E54` — benchmark function marioparty3:func_80056254_56E54:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056254_56E54:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tjr\tra\n 8:\tlw\tv0,12(v0)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f915d8b63c68575e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_80056254_56E54\n\n\nContents of section .text:\n 0000 8c820000 03e00008 8c42000c 00000000 .........B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80056254_56E54\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056254_56E54 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -6851,7 +6925,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80056260_56E60` — benchmark function marioparty3:func_80056260_56E60:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056260_56E60\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v0, %hi(D_800C9530_CA130)\n addu\t$v0, $v0, $a0\n lw\t$v0, %lo(D_800C9530_CA130)($v0)\n jr\t$ra\n lw\t$v0, 12($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80056260_56E60(s16 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056260_56E60 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056260_56E60` — benchmark function marioparty3:func_80056260_56E60:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056260_56E60:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tjr\tra\n 18:\tlw\tv0,12(v0)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c88c2e4abac83811/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_80056260_56E60\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 03e00008 8c42000c 00000000 .B.......B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80056260_56E60\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056260_56E60 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056260_56E60` — benchmark function marioparty3:func_80056260_56E60:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056260_56E60:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tjr\tra\n 18:\tlw\tv0,12(v0)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c88c2e4abac83811/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_80056260_56E60\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 03e00008 8c42000c 00000000 .B.......B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80056260_56E60\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056260_56E60 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -6938,7 +7012,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80056C98_57898` — benchmark function marioparty3:func_80056C98_57898:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056C98_57898\n lw\t$a1, 0($a0)\n lbu\t$v0, 0($a1)\n sll\t$v0, $v0, 0x18\n lbu\t$v1, 1($a1)\n sll\t$v1, $v1, 0x10\n addu\t$v0, $v0, $v1\n lbu\t$v1, 2($a1)\n sll\t$v1, $v1, 0x8\n addu\t$v0, $v0, $v1\n lbu\t$v1, 3($a1)\n addiu\t$a1, $a1, 4\n sw\t$a1, 0($a0)\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056C98_57898 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056C98_57898` — benchmark function marioparty3:func_80056C98_57898:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056C98_57898:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\ta1,0(a0)\n 4:\tlbu\tv0,0(a1)\n 8:\tsll\tv0,v0,0x18\n c:\tlbu\tv1,1(a1)\n 10:\tsll\tv1,v1,0x10\n 14:\taddu\tv0,v0,v1\n 18:\tlbu\tv1,2(a1)\n 1c:\tsll\tv1,v1,0x8\n 20:\taddu\tv0,v0,v1\n 24:\tlbu\tv1,3(a1)\n 28:\taddiu\ta1,a1,4\n 2c:\tsw\ta1,0(a0)\n 30:\tjr\tra\n 34:\taddu\tv0,v0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-0bc2346d0a617052/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 func_80056C98_57898\n\n\nContents of section .text:\n 0000 8c850000 90a20000 00021600 90a30001 ................\n 0010 00031c00 00431021 90a30002 00031a00 .....C.!........\n 0020 00431021 90a30003 24a50004 ac850000 .C.!....$.......\n 0030 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056C98_57898 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056C98_57898` — benchmark function marioparty3:func_80056C98_57898:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056C98_57898:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\ta1,0(a0)\n 4:\tlbu\tv0,0(a1)\n 8:\tsll\tv0,v0,0x18\n c:\tlbu\tv1,1(a1)\n 10:\tsll\tv1,v1,0x10\n 14:\taddu\tv0,v0,v1\n 18:\tlbu\tv1,2(a1)\n 1c:\tsll\tv1,v1,0x8\n 20:\taddu\tv0,v0,v1\n 24:\tlbu\tv1,3(a1)\n 28:\taddiu\ta1,a1,4\n 2c:\tsw\ta1,0(a0)\n 30:\tjr\tra\n 34:\taddu\tv0,v0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-0bc2346d0a617052/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 func_80056C98_57898\n\n\nContents of section .text:\n 0000 8c850000 90a20000 00021600 90a30001 ................\n 0010 00031c00 00431021 90a30002 00031a00 .....C.!........\n 0020 00431021 90a30003 24a50004 ac850000 .C.!....$.......\n 0030 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056C98_57898 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -7016,7 +7090,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_800570A8_57CA8` — benchmark function marioparty3:func_800570A8_57CA8:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800570A8_57CA8\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v0, %hi(HuSprGrpData)\n addu\t$v0, $v0, $a0\n lw\t$v0, %lo(HuSprGrpData)($v0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0xe\n addu\t$a1, $a1, $v0\n lw\t$a0, 16($a1)\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0xe\n lui\t$v0, %hi(D_800D0A50_D1650)\n addu\t$v0, $v0, $a2\n lw\t$v0, %lo(D_800D0A50_D1650)($v0)\n sw\t$v0, 152($a0)\n lui\t$at, 0x3f80\n mtc1\t$at, $f0\n nop\n swc1\t$f0, 252($a0)\n move\t$v1, $zero\n li\t$a1, 0xffff\n sll\t$v0, $v1, 0x1\n.L58:\n addu\t$v0, $v0, $a0\n sh\t$a1, 156($v0)\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $a0\n sw\t$zero, 188($v0)\n addiu\t$v1, $v1, 1\n slti\t$v0, $v1, 16\n bnezl\t$v0, .L58\n sll\t$v0, $v1, 0x1\n jr\t$ra\n sw\t$zero, 260($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-b2e749e20c8f.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800570A8_57CA8(s16 group, s16 member, s16 arg2);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800570A8_57CA8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800570A8_57CA8` — benchmark function marioparty3:func_800570A8_57CA8:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800570A8_57CA8:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tsll\ta1,a1,0x10\n 18:\tsra\ta1,a1,0xe\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\ta0,16(a1)\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0xe\n 2c:\tlui\tv0,0x0\n 30:\taddu\tv0,v0,a2\n 34:\tlw\tv0,0(v0)\n 38:\tsw\tv0,152(a0)\n 3c:\tlui\tat,0x3f80\n 40:\tmtc1\tat,$f0\n 44:\tnop\n 48:\tswc1\t$f0,252(a0)\n 4c:\tmove\tv1,zero\n 50:\tli\ta1,0xffff\n 54:\tsll\tv0,v1,0x1\n 58:\taddu\tv0,v0,a0\n 5c:\tsh\ta1,156(v0)\n 60:\tsll\tv0,v1,0x2\n 64:\taddu\tv0,v0,a0\n 68:\tsw\tzero,188(v0)\n 6c:\taddiu\tv1,v1,1\n 70:\tslti\tv0,v1,16\n 74:\tbnezl\tv0,58 \n 78:\tsll\tv0,v1,0x1\n 7c:\tjr\tra\n 80:\tsw\tzero,260(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c7814ced67c9c843/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800570A8_57CA8\n00000000 *UND*\t00000000 HuSprGrpData\n00000000 *UND*\t00000000 D_800D0A50_D1650\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HuSprGrpData\n00000010 R_MIPS_LO16 HuSprGrpData\n0000002c R_MIPS_HI16 D_800D0A50_D1650\n00000034 R_MIPS_LO16 D_800D0A50_D1650\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 00052c00 00052b83 00a22821 .B....,...+...(!\n 0020 8ca40010 00063400 00063383 3c020000 ......4...3.<...\n 0030 00461021 8c420000 ac820098 3c013f80 .F.!.B......<.?.\n 0040 44810000 00000000 e48000fc 00001821 D..............!\n 0050 3405ffff 00031040 00441021 a445009c 4......@.D.!.E..\n 0060 00031080 00441021 ac4000bc 24630001 .....D.!.@..$c..\n 0070 28620010 5440fff8 00031040 03e00008 (b..T@.....@....\n 0080 ac800104 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007e 00000000 00000001 00000000 ...~............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800570A8_57CA8\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800570A8_57CA8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800570A8_57CA8` — benchmark function marioparty3:func_800570A8_57CA8:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800570A8_57CA8:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tsll\ta1,a1,0x10\n 18:\tsra\ta1,a1,0xe\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\ta0,16(a1)\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0xe\n 2c:\tlui\tv0,0x0\n 30:\taddu\tv0,v0,a2\n 34:\tlw\tv0,0(v0)\n 38:\tsw\tv0,152(a0)\n 3c:\tlui\tat,0x3f80\n 40:\tmtc1\tat,$f0\n 44:\tnop\n 48:\tswc1\t$f0,252(a0)\n 4c:\tmove\tv1,zero\n 50:\tli\ta1,0xffff\n 54:\tsll\tv0,v1,0x1\n 58:\taddu\tv0,v0,a0\n 5c:\tsh\ta1,156(v0)\n 60:\tsll\tv0,v1,0x2\n 64:\taddu\tv0,v0,a0\n 68:\tsw\tzero,188(v0)\n 6c:\taddiu\tv1,v1,1\n 70:\tslti\tv0,v1,16\n 74:\tbnezl\tv0,58 \n 78:\tsll\tv0,v1,0x1\n 7c:\tjr\tra\n 80:\tsw\tzero,260(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c7814ced67c9c843/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800570A8_57CA8\n00000000 *UND*\t00000000 HuSprGrpData\n00000000 *UND*\t00000000 D_800D0A50_D1650\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HuSprGrpData\n00000010 R_MIPS_LO16 HuSprGrpData\n0000002c R_MIPS_HI16 D_800D0A50_D1650\n00000034 R_MIPS_LO16 D_800D0A50_D1650\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 00052c00 00052b83 00a22821 .B....,...+...(!\n 0020 8ca40010 00063400 00063383 3c020000 ......4...3.<...\n 0030 00461021 8c420000 ac820098 3c013f80 .F.!.B......<.?.\n 0040 44810000 00000000 e48000fc 00001821 D..............!\n 0050 3405ffff 00031040 00441021 a445009c 4......@.D.!.E..\n 0060 00031080 00441021 ac4000bc 24630001 .....D.!.@..$c..\n 0070 28620010 5440fff8 00031040 03e00008 (b..T@.....@....\n 0080 ac800104 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007e 00000000 00000001 00000000 ...~............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800570A8_57CA8\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800570A8_57CA8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -7088,7 +7162,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8005FA90_60690` — benchmark function marioparty3:func_8005FA90_60690:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8005FA90_60690\n move\t$t0, $zero\n lbu\t$a3, 0($a0)\n sll\t$a2, $t0, 0x10\n.Lc:\n sra\t$a1, $a2, 0x10\n lui\t$v0, %hi(D_800A232C_A2F2C)\n addu\t$v0, $v0, $a1\n lbu\t$v0, %lo(D_800A232C_A2F2C)($v0)\n bne\t$v0, $a3, .L50\n addiu\t$v0, $t0, 2\n lui\t$v1, %hi(D_800A232C_A2F2C)\n addu\t$v1, $v1, $a1\n lbu\t$v1, %lo(D_800A232C_A2F2C)($v1)\n lbu\t$v0, 1($a0)\n bnel\t$v1, $v0, .L50\n addiu\t$v0, $t0, 2\n srl\t$v0, $a2, 0x1f\n addu\t$v0, $a1, $v0\n srl\t$v0, $v0, 0x1\n j\t.L10c\n andi\t$v0, $v0, 0xff\n.L50:\n move\t$t0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 10\n bnez\t$v0, .Lc\n sll\t$a2, $t0, 0x10\n move\t$t0, $zero\n lui\t$t4, %hi(D_800A2344_A2F44)\n addiu\t$t4, $t4, %lo(D_800A2344_A2F44)\n lbu\t$t3, 0($a0)\n move\t$a3, $zero\n.L7c:\n sll\t$v1, $t0, 0x10\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $t4\n lw\t$t1, 0($v0)\n sll\t$t2, $v1, 0x4\n sll\t$a1, $a3, 0x10\n.L98:\n sra\t$a2, $a1, 0x10\n addu\t$v1, $t1, $a2\n lbu\t$v0, 0($v1)\n bne\t$v0, $t3, .Ld4\n addiu\t$v0, $a3, 2\n lbu\t$v1, 1($v1)\n lbu\t$v0, 1($a0)\n bnel\t$v1, $v0, .Ld4\n addiu\t$v0, $a3, 2\n srl\t$v0, $a1, 0x1f\n addu\t$v0, $a2, $v0\n sra\t$v0, $v0, 0x1\n addu\t$v0, $v0, $t2\n j\t.L10c\n andi\t$v0, $v0, 0xff\n.Ld4:\n move\t$a3, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 32\n bnez\t$v0, .L98\n sll\t$a1, $a3, 0x10\n addiu\t$v0, $t0, 1\n move\t$t0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 16\n bnezl\t$v0, .L7c\n move\t$a3, $zero\n li\t$v0, 16\n.L10c:\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-08282be5c7c2.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 func_8005FA90_60690(u8 *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8005FA90_60690 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005FA90_60690` — benchmark function marioparty3:func_8005FA90_60690:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8005FA90_60690:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,zero\n 4:\tlbu\ta3,0(a0)\n 8:\tsll\ta2,t0,0x10\n c:\tsra\ta1,a2,0x10\n 10:\tlui\tv0,0x0\n 14:\taddu\tv0,v0,a1\n 18:\tlbu\tv0,0(v0)\n 1c:\tbne\tv0,a3,50 \n 20:\taddiu\tv0,t0,2\n 24:\tlui\tv1,0x0\n 28:\taddu\tv1,v1,a1\n 2c:\tlbu\tv1,1(v1)\n 30:\tlbu\tv0,1(a0)\n 34:\tbnel\tv1,v0,50 \n 38:\taddiu\tv0,t0,2\n 3c:\tsrl\tv0,a2,0x1f\n 40:\taddu\tv0,a1,v0\n 44:\tsrl\tv0,v0,0x1\n 48:\tj\t10c \n 4c:\tandi\tv0,v0,0xff\n 50:\tmove\tt0,v0\n 54:\tsll\tv0,v0,0x10\n 58:\tsra\tv0,v0,0x10\n 5c:\tslti\tv0,v0,10\n 60:\tbnez\tv0,c \n 64:\tsll\ta2,t0,0x10\n 68:\tmove\tt0,zero\n 6c:\tlui\tt4,0x0\n 70:\taddiu\tt4,t4,0\n 74:\tlbu\tt3,0(a0)\n 78:\tmove\ta3,zero\n 7c:\tsll\tv1,t0,0x10\n 80:\tsra\tv1,v1,0x10\n 84:\tsll\tv0,v1,0x2\n 88:\taddu\tv0,v0,t4\n 8c:\tlw\tt1,0(v0)\n 90:\tsll\tt2,v1,0x4\n 94:\tsll\ta1,a3,0x10\n 98:\tsra\ta2,a1,0x10\n 9c:\taddu\tv1,t1,a2\n a0:\tlbu\tv0,0(v1)\n a4:\tbne\tv0,t3,d4 \n a8:\taddiu\tv0,a3,2\n ac:\tlbu\tv1,1(v1)\n b0:\tlbu\tv0,1(a0)\n b4:\tbnel\tv1,v0,d4 \n b8:\taddiu\tv0,a3,2\n bc:\tsrl\tv0,a1,0x1f\n c0:\taddu\tv0,a2,v0\n c4:\tsra\tv0,v0,0x1\n c8:\taddu\tv0,v0,t2\n cc:\tj\t10c \n d0:\tandi\tv0,v0,0xff\n d4:\tmove\ta3,v0\n d8:\tsll\tv0,v0,0x10\n dc:\tsra\tv0,v0,0x10\n e0:\tslti\tv0,v0,32\n e4:\tbnez\tv0,98 \n e8:\tsll\ta1,a3,0x10\n ec:\taddiu\tv0,t0,1\n f0:\tmove\tt0,v0\n f4:\tsll\tv0,v0,0x10\n f8:\tsra\tv0,v0,0x10\n fc:\tslti\tv0,v0,16\n 100:\tbnezl\tv0,7c \n 104:\tmove\ta3,zero\n 108:\tli\tv0,16\n 10c:\tjr\tra\n 110:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-9446791f5273df55/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000114 func_8005FA90_60690\n00000000 *UND*\t00000000 D_800A232C_A2F2C\n00000000 *UND*\t00000000 D_800A2344_A2F44\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 D_800A232C_A2F2C\n00000018 R_MIPS_LO16 D_800A232C_A2F2C\n00000024 R_MIPS_HI16 D_800A232C_A2F2C\n0000002c R_MIPS_LO16 D_800A232C_A2F2C\n00000048 R_MIPS_26 .text\n0000006c R_MIPS_HI16 D_800A2344_A2F44\n00000070 R_MIPS_LO16 D_800A2344_A2F44\n000000cc R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00004021 90870000 00083400 00062c03 ..@!......4...,.\n 0010 3c020000 00451021 90420000 1447000c <....E.!.B...G..\n 0020 25020002 3c030000 00651821 90630001 %...<....e.!.c..\n 0030 90820001 54620006 25020002 000617c2 ....Tb..%.......\n 0040 00a21021 00021042 08000043 304200ff ...!...B...C0B..\n 0050 00404021 00021400 00021403 2842000a .@@!........(B..\n 0060 1440ffea 00083400 00004021 3c0c0000 .@....4...@!<...\n 0070 258c0000 908b0000 00003821 00081c00 %.........8!....\n 0080 00031c03 00031080 004c1021 8c490000 .........L.!.I..\n 0090 00035100 00072c00 00053403 01261821 ..Q...,...4..&.!\n 00a0 90620000 144b000b 24e20002 90630001 .b...K..$....c..\n 00b0 90820001 54620007 24e20002 000517c2 ....Tb..$.......\n 00c0 00c21021 00021043 004a1021 08000043 ...!...C.J.!...C\n 00d0 304200ff 00403821 00021400 00021403 0B...@8!........\n 00e0 28420020 1440ffec 00072c00 25020001 (B. .@....,.%...\n 00f0 00404021 00021400 00021403 28420010 .@@!........(B..\n 0100 5440ffde 00003821 24020010 03e00008 T@....8!$.......\n 0110 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80001ffc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8005FA90_60690 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005FA90_60690` — benchmark function marioparty3:func_8005FA90_60690:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8005FA90_60690:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,zero\n 4:\tlbu\ta3,0(a0)\n 8:\tsll\ta2,t0,0x10\n c:\tsra\ta1,a2,0x10\n 10:\tlui\tv0,0x0\n 14:\taddu\tv0,v0,a1\n 18:\tlbu\tv0,0(v0)\n 1c:\tbne\tv0,a3,50 \n 20:\taddiu\tv0,t0,2\n 24:\tlui\tv1,0x0\n 28:\taddu\tv1,v1,a1\n 2c:\tlbu\tv1,1(v1)\n 30:\tlbu\tv0,1(a0)\n 34:\tbnel\tv1,v0,50 \n 38:\taddiu\tv0,t0,2\n 3c:\tsrl\tv0,a2,0x1f\n 40:\taddu\tv0,a1,v0\n 44:\tsrl\tv0,v0,0x1\n 48:\tj\t10c \n 4c:\tandi\tv0,v0,0xff\n 50:\tmove\tt0,v0\n 54:\tsll\tv0,v0,0x10\n 58:\tsra\tv0,v0,0x10\n 5c:\tslti\tv0,v0,10\n 60:\tbnez\tv0,c \n 64:\tsll\ta2,t0,0x10\n 68:\tmove\tt0,zero\n 6c:\tlui\tt4,0x0\n 70:\taddiu\tt4,t4,0\n 74:\tlbu\tt3,0(a0)\n 78:\tmove\ta3,zero\n 7c:\tsll\tv1,t0,0x10\n 80:\tsra\tv1,v1,0x10\n 84:\tsll\tv0,v1,0x2\n 88:\taddu\tv0,v0,t4\n 8c:\tlw\tt1,0(v0)\n 90:\tsll\tt2,v1,0x4\n 94:\tsll\ta1,a3,0x10\n 98:\tsra\ta2,a1,0x10\n 9c:\taddu\tv1,t1,a2\n a0:\tlbu\tv0,0(v1)\n a4:\tbne\tv0,t3,d4 \n a8:\taddiu\tv0,a3,2\n ac:\tlbu\tv1,1(v1)\n b0:\tlbu\tv0,1(a0)\n b4:\tbnel\tv1,v0,d4 \n b8:\taddiu\tv0,a3,2\n bc:\tsrl\tv0,a1,0x1f\n c0:\taddu\tv0,a2,v0\n c4:\tsra\tv0,v0,0x1\n c8:\taddu\tv0,v0,t2\n cc:\tj\t10c \n d0:\tandi\tv0,v0,0xff\n d4:\tmove\ta3,v0\n d8:\tsll\tv0,v0,0x10\n dc:\tsra\tv0,v0,0x10\n e0:\tslti\tv0,v0,32\n e4:\tbnez\tv0,98 \n e8:\tsll\ta1,a3,0x10\n ec:\taddiu\tv0,t0,1\n f0:\tmove\tt0,v0\n f4:\tsll\tv0,v0,0x10\n f8:\tsra\tv0,v0,0x10\n fc:\tslti\tv0,v0,16\n 100:\tbnezl\tv0,7c \n 104:\tmove\ta3,zero\n 108:\tli\tv0,16\n 10c:\tjr\tra\n 110:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-9446791f5273df55/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000114 func_8005FA90_60690\n00000000 *UND*\t00000000 D_800A232C_A2F2C\n00000000 *UND*\t00000000 D_800A2344_A2F44\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 D_800A232C_A2F2C\n00000018 R_MIPS_LO16 D_800A232C_A2F2C\n00000024 R_MIPS_HI16 D_800A232C_A2F2C\n0000002c R_MIPS_LO16 D_800A232C_A2F2C\n00000048 R_MIPS_26 .text\n0000006c R_MIPS_HI16 D_800A2344_A2F44\n00000070 R_MIPS_LO16 D_800A2344_A2F44\n000000cc R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00004021 90870000 00083400 00062c03 ..@!......4...,.\n 0010 3c020000 00451021 90420000 1447000c <....E.!.B...G..\n 0020 25020002 3c030000 00651821 90630001 %...<....e.!.c..\n 0030 90820001 54620006 25020002 000617c2 ....Tb..%.......\n 0040 00a21021 00021042 08000043 304200ff ...!...B...C0B..\n 0050 00404021 00021400 00021403 2842000a .@@!........(B..\n 0060 1440ffea 00083400 00004021 3c0c0000 .@....4...@!<...\n 0070 258c0000 908b0000 00003821 00081c00 %.........8!....\n 0080 00031c03 00031080 004c1021 8c490000 .........L.!.I..\n 0090 00035100 00072c00 00053403 01261821 ..Q...,...4..&.!\n 00a0 90620000 144b000b 24e20002 90630001 .b...K..$....c..\n 00b0 90820001 54620007 24e20002 000517c2 ....Tb..$.......\n 00c0 00c21021 00021043 004a1021 08000043 ...!...C.J.!...C\n 00d0 304200ff 00403821 00021400 00021403 0B...@8!........\n 00e0 28420020 1440ffec 00072c00 25020001 (B. .@....,.%...\n 00f0 00404021 00021400 00021403 28420010 .@@!........(B..\n 0100 5440ffde 00003821 24020010 03e00008 T@....8!$.......\n 0110 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80001ffc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8005FA90_60690 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -7121,7 +7195,7 @@ "asmlift": { "decompiler": "asmlift", "symbolMap": true, - "candidateLabel": "unsigned", + "candidateLabel": "signed", "symbolsUsed": [ { "name": "D_800CC69C_CD29C", @@ -7129,12 +7203,12 @@ } ], "outcome": "nonmatch", - "source": "void func_800600C0_60CC0(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n v0 = D_800CC69C_CD29C;\n if (a1 == 0) {\n v1 = ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] & -17;\n } else {\n v1 = ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] | 16;\n }\n ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] = v1;\n return;\n}\n", - "score": 38, - "maxScore": 39, + "source": "void func_800600C0_60CC0(s32 a0, s32 a1) {\n s32 v0;\n s32 v1;\n v0 = D_800CC69C_CD29C;\n if (a1 == 0) {\n v1 = ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] & -17;\n } else {\n v1 = ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] | 16;\n }\n ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] = v1;\n return;\n}\n", + "score": 41, + "maxScore": 42, "compileErrors": null, "breakdown": { - "insert": 20, + "insert": 23, "delete": 7, "replace": 4, "opMismatch": 0, @@ -7189,7 +7263,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_800600C0_60CC0` — benchmark function marioparty3:func_800600C0_60CC0:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800600C0_60CC0\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$v0, $a0, 0x2\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x5\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_800CC69C_CD29C)\n lw\t$v1, %lo(D_800CC69C_CD29C)($v1)\n beqz\t$a1, .L38\n addu\t$a0, $v0, $v1\n lw\t$v0, 56($a0)\n j\t.L44\n ori\t$v0, $v0, 0x10\n.L38:\n lw\t$v0, 56($a0)\n li\t$v1, -17\n and\t$v0, $v0, $v1\n.L44:\n jr\t$ra\n sw\t$v0, 56($a0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800600C0_60CC0(s16 winId, s32 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800600C0_60CC0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800600C0_60CC0` — benchmark function marioparty3:func_800600C0_60CC0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800600C0_60CC0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\tbeqz\ta1,38 \n 28:\taddu\ta0,v0,v1\n 2c:\tlw\tv0,56(a0)\n 30:\tj\t44 \n 34:\tori\tv0,v0,0x10\n 38:\tlw\tv0,56(a0)\n 3c:\tli\tv1,-17\n 40:\tand\tv0,v0,v1\n 44:\tjr\tra\n 48:\tsw\tv0,56(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ebcbb216a187e6c6/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_800600C0_60CC0\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 D_800CC69C_CD29C\n00000020 R_MIPS_LO16 D_800CC69C_CD29C\n00000030 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00042400 00042403 00041080 00441021 ..$...$......D.!\n 0010 00021140 00441023 00021080 3c030000 ...@.D.#....<...\n 0020 8c630000 10a00004 00432021 8c820038 .c.......C !...8\n 0030 08000011 34420010 8c820038 2403ffef ....4B.....8$...\n 0040 00431024 03e00008 ac820038 00000000 .C.$.......8....\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800600C0_60CC0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800600C0_60CC0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800600C0_60CC0` — benchmark function marioparty3:func_800600C0_60CC0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800600C0_60CC0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\tbeqz\ta1,38 \n 28:\taddu\ta0,v0,v1\n 2c:\tlw\tv0,56(a0)\n 30:\tj\t44 \n 34:\tori\tv0,v0,0x10\n 38:\tlw\tv0,56(a0)\n 3c:\tli\tv1,-17\n 40:\tand\tv0,v0,v1\n 44:\tjr\tra\n 48:\tsw\tv0,56(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ebcbb216a187e6c6/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_800600C0_60CC0\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 D_800CC69C_CD29C\n00000020 R_MIPS_LO16 D_800CC69C_CD29C\n00000030 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00042400 00042403 00041080 00441021 ..$...$......D.!\n 0010 00021140 00441023 00021080 3c030000 ...@.D.#....<...\n 0020 8c630000 10a00004 00432021 8c820038 .c.......C !...8\n 0030 08000011 34420010 8c820038 2403ffef ....4B.....8$...\n 0040 00431024 03e00008 ac820038 00000000 .C.$.......8....\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800600C0_60CC0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800600C0_60CC0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -7269,7 +7343,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8006014C_60D4C` — benchmark function marioparty3:func_8006014C_60D4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8006014C_60D4C\n lui\t$v1, %hi(D_800CC69C_CD29C)\n lw\t$v1, %lo(D_800CC69C_CD29C)($v1)\n sll\t$v0, $a0, 0x2\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x5\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n addu\t$v0, $v0, $v1\n jr\t$ra\n lb\t$v0, 49($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns8 func_8006014C_60D4C(s32 winId);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8006014C_60D4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8006014C_60D4C` — benchmark function marioparty3:func_8006014C_60D4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8006014C_60D4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\taddu\tv0,v0,v1\n 20:\tjr\tra\n 24:\tlb\tv0,49(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f52bf81a0ee885b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 func_8006014C_60D4C\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800CC69C_CD29C\n00000004 R_MIPS_LO16 D_800CC69C_CD29C\n\n\nContents of section .text:\n 0000 3c030000 8c630000 00041080 00441021 <....c.......D.!\n 0010 00021140 00441023 00021080 00431021 ...@.D.#.....C.!\n 0020 03e00008 80420031 00000000 00000000 .....B.1........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8006014C_60D4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8006014C_60D4C` — benchmark function marioparty3:func_8006014C_60D4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8006014C_60D4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\taddu\tv0,v0,v1\n 20:\tjr\tra\n 24:\tlb\tv0,49(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f52bf81a0ee885b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 func_8006014C_60D4C\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800CC69C_CD29C\n00000004 R_MIPS_LO16 D_800CC69C_CD29C\n\n\nContents of section .text:\n 0000 3c030000 8c630000 00041080 00441021 <....c.......D.!\n 0010 00021140 00441023 00021080 00431021 ...@.D.#.....C.!\n 0020 03e00008 80420031 00000000 00000000 .....B.1........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8006014C_60D4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -7351,7 +7425,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80071B40_72740` — benchmark function marioparty3:func_80071B40_72740:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80071B40_72740\n jr\t$ra\n sh\t$a1, 22($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80071B40_72740(ALVoice *voice, s16 priority);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80071B40_72740 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80071B40_72740` — benchmark function marioparty3:func_80071B40_72740:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80071B40_72740:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsh\ta1,22(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6172ae035c3f8dd3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_80071B40_72740\n\n\nContents of section .text:\n 0000 03e00008 a4850016 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80071B40_72740\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80071B40_72740 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80071B40_72740` — benchmark function marioparty3:func_80071B40_72740:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80071B40_72740:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsh\ta1,22(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6172ae035c3f8dd3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_80071B40_72740\n\n\nContents of section .text:\n 0000 03e00008 a4850016 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80071B40_72740\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80071B40_72740 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -7433,7 +7507,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8008A0D0_8ACD0` — benchmark function marioparty3:func_8008A0D0_8ACD0:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8008A0D0_8ACD0\n sw\t$zero, 60($a0)\n sw\t$zero, 56($a0)\n sw\t$zero, 52($a0)\n sw\t$zero, 48($a0)\n sw\t$zero, 44($a0)\n sw\t$zero, 40($a0)\n sw\t$zero, 36($a0)\n sw\t$zero, 32($a0)\n sw\t$zero, 24($a0)\n sw\t$zero, 16($a0)\n sw\t$zero, 12($a0)\n sw\t$zero, 4($a0)\n lui\t$v0, 0x1\n sw\t$v0, 20($a0)\n sw\t$v0, 0($a0)\n li\t$v0, 1\n sw\t$v0, 28($a0)\n jr\t$ra\n sw\t$v0, 8($a0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8008A0D0_8ACD0(Mtx *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8008A0D0_8ACD0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8008A0D0_8ACD0` — benchmark function marioparty3:func_8008A0D0_8ACD0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8008A0D0_8ACD0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,60(a0)\n 4:\tsw\tzero,56(a0)\n 8:\tsw\tzero,52(a0)\n c:\tsw\tzero,48(a0)\n 10:\tsw\tzero,44(a0)\n 14:\tsw\tzero,40(a0)\n 18:\tsw\tzero,36(a0)\n 1c:\tsw\tzero,32(a0)\n 20:\tsw\tzero,24(a0)\n 24:\tsw\tzero,16(a0)\n 28:\tsw\tzero,12(a0)\n 2c:\tsw\tzero,4(a0)\n 30:\tlui\tv0,0x1\n 34:\tsw\tv0,20(a0)\n 38:\tsw\tv0,0(a0)\n 3c:\tli\tv0,1\n 40:\tsw\tv0,28(a0)\n 44:\tjr\tra\n 48:\tsw\tv0,8(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cfcfe2081306cc0e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_8008A0D0_8ACD0\n\n\nContents of section .text:\n 0000 ac80003c ac800038 ac800034 ac800030 ...<...8...4...0\n 0010 ac80002c ac800028 ac800024 ac800020 ...,...(...$... \n 0020 ac800018 ac800010 ac80000c ac800004 ................\n 0030 3c020001 ac820014 ac820000 24020001 <...........$...\n 0040 ac82001c 03e00008 ac820008 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8008A0D0_8ACD0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8008A0D0_8ACD0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8008A0D0_8ACD0` — benchmark function marioparty3:func_8008A0D0_8ACD0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8008A0D0_8ACD0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,60(a0)\n 4:\tsw\tzero,56(a0)\n 8:\tsw\tzero,52(a0)\n c:\tsw\tzero,48(a0)\n 10:\tsw\tzero,44(a0)\n 14:\tsw\tzero,40(a0)\n 18:\tsw\tzero,36(a0)\n 1c:\tsw\tzero,32(a0)\n 20:\tsw\tzero,24(a0)\n 24:\tsw\tzero,16(a0)\n 28:\tsw\tzero,12(a0)\n 2c:\tsw\tzero,4(a0)\n 30:\tlui\tv0,0x1\n 34:\tsw\tv0,20(a0)\n 38:\tsw\tv0,0(a0)\n 3c:\tli\tv0,1\n 40:\tsw\tv0,28(a0)\n 44:\tjr\tra\n 48:\tsw\tv0,8(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cfcfe2081306cc0e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_8008A0D0_8ACD0\n\n\nContents of section .text:\n 0000 ac80003c ac800038 ac800034 ac800030 ...<...8...4...0\n 0010 ac80002c ac800028 ac800024 ac800020 ...,...(...$... \n 0020 ac800018 ac800010 ac80000c ac800004 ................\n 0030 3c020001 ac820014 ac820000 24020001 <...........$...\n 0040 ac82001c 03e00008 ac820008 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8008A0D0_8ACD0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8008A0D0_8ACD0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -7470,7 +7544,7 @@ } ], "outcome": "nonmatch", - "source": "s32 GWBoardRecordGet(s32 a0) {\n s32 v0;\n s32 v1;\n if (a0 << 16 < 0) a0 = GwSystem.current_board_index << 24 >> 24;\n if ((GwSystem.playMode & 1) != 0) {\n v0 = (a0 << 16 >> 16) * 9;\n v1 = (u32)&GwCommon + 31;\n } else {\n v0 = (a0 << 16 >> 16) * 9;\n v1 = (u32)&GwCommon + 85;\n }\n return v0 + v1;\n}\n", + "source": "s32 GWBoardRecordGet(s32 a0) {\n s32 v0;\n s32 v1;\n if (a0 << 16 < 0) a0 = (s32)(GwSystem.current_board_index << 24) >> 24;\n if ((GwSystem.playMode & 1) != 0) {\n v0 = (a0 << 16 >> 16) * 9;\n v1 = (u32)&GwCommon + 31;\n } else {\n v0 = (a0 << 16 >> 16) * 9;\n v1 = (u32)&GwCommon + 85;\n }\n return v0 + v1;\n}\n", "score": 20, "maxScore": 26, "compileErrors": null, @@ -7485,7 +7559,7 @@ "score": 100, "lines": 13, "gotos": 0, - "casts": 0, + "casts": 1, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -7526,7 +7600,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `GWBoardRecordGet` — benchmark function marioparty3:GWBoardRecordGet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GWBoardRecordGet\n move\t$v1, $a0\n sll\t$a0, $a0, 0x10\n bgez\t$a0, .L20\n nop\n lui\t$v0, %hi(GwSystem)\n lbu\t$v0, %lo(GwSystem)($v0)\n sll\t$v0, $v0, 0x18\n sra\t$v1, $v0, 0x18\n.L20:\n lui\t$v0, %hi(GwSystem)\n lbu\t$v0, %lo(GwSystem)($v0)\n andi\t$v0, $v0, 0x1\n bnez\t$v0, .L4c\n sll\t$v1, $v1, 0x10\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x3\n addu\t$v0, $v0, $v1\n lui\t$v1, %hi(GwCommon)\n j\t.L60\n addiu\t$v1, $v1, %lo(GwCommon)\n.L4c:\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x3\n addu\t$v0, $v0, $v1\n lui\t$v1, %hi(GwCommon)\n addiu\t$v1, $v1, %lo(GwCommon)\n.L60:\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GWBoardRecordGet # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GWBoardRecordGet` — benchmark function marioparty3:GWBoardRecordGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:GWBoardRecordGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tsll\ta0,a0,0x10\n 8:\tbgez\ta0,20 \n c:\tnop\n 10:\tlui\tv0,0x0\n 14:\tlbu\tv0,1(v0)\n 18:\tsll\tv0,v0,0x18\n 1c:\tsra\tv1,v0,0x18\n 20:\tlui\tv0,0x0\n 24:\tlbu\tv0,0(v0)\n 28:\tandi\tv0,v0,0x1\n 2c:\tbnez\tv0,4c \n 30:\tsll\tv1,v1,0x10\n 34:\tsra\tv1,v1,0x10\n 38:\tsll\tv0,v1,0x3\n 3c:\taddu\tv0,v0,v1\n 40:\tlui\tv1,0x0\n 44:\tj\t60 \n 48:\taddiu\tv1,v1,85\n 4c:\tsra\tv1,v1,0x10\n 50:\tsll\tv0,v1,0x3\n 54:\taddu\tv0,v0,v1\n 58:\tlui\tv1,0x0\n 5c:\taddiu\tv1,v1,31\n 60:\tjr\tra\n 64:\taddu\tv0,v0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-8ff646f69be78698/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000068 GWBoardRecordGet\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 GwCommon\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 GwSystem\n00000014 R_MIPS_LO16 GwSystem\n00000020 R_MIPS_HI16 GwSystem\n00000024 R_MIPS_LO16 GwSystem\n00000040 R_MIPS_HI16 GwCommon\n00000048 R_MIPS_LO16 GwCommon\n00000044 R_MIPS_26 .text\n00000058 R_MIPS_HI16 GwCommon\n0000005c R_MIPS_LO16 GwCommon\n\n\nContents of section .text:\n 0000 00801821 00042400 04810005 00000000 ...!..$.........\n 0010 3c020000 90420001 00021600 00021e03 <....B..........\n 0020 3c020000 90420000 30420001 14400007 <....B..0B...@..\n 0030 00031c00 00031c03 000310c0 00431021 .............C.!\n 0040 3c030000 08000018 24630055 00031c03 <.......$c.U....\n 0050 000310c0 00431021 3c030000 2463001f .....C.!<...$c..\n 0060 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name GWBoardRecordGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GWBoardRecordGet` — benchmark function marioparty3:GWBoardRecordGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:GWBoardRecordGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tsll\ta0,a0,0x10\n 8:\tbgez\ta0,20 \n c:\tnop\n 10:\tlui\tv0,0x0\n 14:\tlbu\tv0,1(v0)\n 18:\tsll\tv0,v0,0x18\n 1c:\tsra\tv1,v0,0x18\n 20:\tlui\tv0,0x0\n 24:\tlbu\tv0,0(v0)\n 28:\tandi\tv0,v0,0x1\n 2c:\tbnez\tv0,4c \n 30:\tsll\tv1,v1,0x10\n 34:\tsra\tv1,v1,0x10\n 38:\tsll\tv0,v1,0x3\n 3c:\taddu\tv0,v0,v1\n 40:\tlui\tv1,0x0\n 44:\tj\t60 \n 48:\taddiu\tv1,v1,85\n 4c:\tsra\tv1,v1,0x10\n 50:\tsll\tv0,v1,0x3\n 54:\taddu\tv0,v0,v1\n 58:\tlui\tv1,0x0\n 5c:\taddiu\tv1,v1,31\n 60:\tjr\tra\n 64:\taddu\tv0,v0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-8ff646f69be78698/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000068 GWBoardRecordGet\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 GwCommon\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 GwSystem\n00000014 R_MIPS_LO16 GwSystem\n00000020 R_MIPS_HI16 GwSystem\n00000024 R_MIPS_LO16 GwSystem\n00000040 R_MIPS_HI16 GwCommon\n00000048 R_MIPS_LO16 GwCommon\n00000044 R_MIPS_26 .text\n00000058 R_MIPS_HI16 GwCommon\n0000005c R_MIPS_LO16 GwCommon\n\n\nContents of section .text:\n 0000 00801821 00042400 04810005 00000000 ...!..$.........\n 0010 3c020000 90420001 00021600 00021e03 <....B..........\n 0020 3c020000 90420000 30420001 14400007 <....B..0B...@..\n 0030 00031c00 00031c03 000310c0 00431021 .............C.!\n 0040 3c030000 08000018 24630055 00031c03 <.......$c.U....\n 0050 000310c0 00431021 3c030000 2463001f .....C.!<...$c..\n 0060 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name GWBoardRecordGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -7610,7 +7684,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `GWMgNoSet` — benchmark function marioparty3:GWMgNoSet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GWMgNoSet\n lui\t$at, %hi(GwSystem)\n jr\t$ra\n sb\t$a0, %lo(GwSystem)($at)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GWMgNoSet # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GWMgNoSet` — benchmark function marioparty3:GWMgNoSet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:GWMgNoSet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsb\ta0,16(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a0e672d23a10fb4c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c GWMgNoSet\n00000000 *UND*\t00000000 GwSystem\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000008 R_MIPS_LO16 GwSystem\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a0240010 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GWMgNoSet\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name GWMgNoSet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GWMgNoSet` — benchmark function marioparty3:GWMgNoSet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:GWMgNoSet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsb\ta0,16(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a0e672d23a10fb4c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c GWMgNoSet\n00000000 *UND*\t00000000 GwSystem\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000008 R_MIPS_LO16 GwSystem\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a0240010 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GWMgNoSet\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name GWMgNoSet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -7688,7 +7762,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `HuMemUsedMemoryBlockGet` — benchmark function marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel HuMemUsedMemoryBlockGet\n move\t$v1, $a0\n move\t$a1, $zero\n.L8:\n lbu\t$v0, 5($v1)\n xori\t$v0, $v0, 0x1\n sltiu\t$v0, $v0, 1\n lw\t$v1, 12($v1)\n bne\t$v1, $a0, .L8\n addu\t$a1, $a1, $v0\n jr\t$ra\n move\t$v0, $a1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu32 HuMemUsedMemoryBlockGet(HeapNode *heap);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function HuMemUsedMemoryBlockGet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `HuMemUsedMemoryBlockGet` — benchmark function marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tlbu\tv0,5(v1)\n c:\txori\tv0,v0,0x1\n 10:\tsltiu\tv0,v0,1\n 14:\tlw\tv1,12(v1)\n 18:\tbne\tv1,a0,8 \n 1c:\taddu\ta1,a1,v0\n 20:\tjr\tra\n 24:\tmove\tv0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c8d399600d2a1b5d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 HuMemUsedMemoryBlockGet\n\n\nContents of section .text:\n 0000 00801821 00002821 90620005 38420001 ...!..(!.b..8B..\n 0010 2c420001 8c63000c 1464fffb 00a22821 ,B...c...d....(!\n 0020 03e00008 00a01021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name HuMemUsedMemoryBlockGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `HuMemUsedMemoryBlockGet` — benchmark function marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tlbu\tv0,5(v1)\n c:\txori\tv0,v0,0x1\n 10:\tsltiu\tv0,v0,1\n 14:\tlw\tv1,12(v1)\n 18:\tbne\tv1,a0,8 \n 1c:\taddu\ta1,a1,v0\n 20:\tjr\tra\n 24:\tmove\tv0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c8d399600d2a1b5d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 HuMemUsedMemoryBlockGet\n\n\nContents of section .text:\n 0000 00801821 00002821 90620005 38420001 ...!..(!.b..8B..\n 0010 2c420001 8c63000c 1464fffb 00a22821 ,B...c...d....(!\n 0020 03e00008 00a01021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name HuMemUsedMemoryBlockGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -7767,7 +7841,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `HuMemUsedMemorySizeGet` — benchmark function marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel HuMemUsedMemorySizeGet\n move\t$v1, $a0\n move\t$a1, $zero\n li\t$a2, 1\n.Lc:\n lbu\t$v0, 5($v1)\n bne\t$v0, $a2, .L20\n nop\n lw\t$v0, 0($v1)\n addu\t$a1, $a1, $v0\n.L20:\n lw\t$v1, 12($v1)\n bne\t$v1, $a0, .Lc\n nop\n jr\t$ra\n move\t$v0, $a1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu32 HuMemUsedMemorySizeGet(HeapNode *heap);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function HuMemUsedMemorySizeGet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `HuMemUsedMemorySizeGet` — benchmark function marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tli\ta2,1\n c:\tlbu\tv0,5(v1)\n 10:\tbne\tv0,a2,20 \n 14:\tnop\n 18:\tlw\tv0,0(v1)\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\tv1,12(v1)\n 24:\tbne\tv1,a0,c \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-73de7a10111e47ad/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 HuMemUsedMemorySizeGet\n\n\nContents of section .text:\n 0000 00801821 00002821 24060001 90620005 ...!..(!$....b..\n 0010 14460003 00000000 8c620000 00a22821 .F.......b....(!\n 0020 8c63000c 1464fff9 00000000 03e00008 .c...d..........\n 0030 00a01021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name HuMemUsedMemorySizeGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `HuMemUsedMemorySizeGet` — benchmark function marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tli\ta2,1\n c:\tlbu\tv0,5(v1)\n 10:\tbne\tv0,a2,20 \n 14:\tnop\n 18:\tlw\tv0,0(v1)\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\tv1,12(v1)\n 24:\tbne\tv1,a0,c \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-73de7a10111e47ad/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 HuMemUsedMemorySizeGet\n\n\nContents of section .text:\n 0000 00801821 00002821 24060001 90620005 ...!..(!$....b..\n 0010 14460003 00000000 8c620000 00a22821 .F.......b....(!\n 0020 8c63000c 1464fff9 00000000 03e00008 .c...d..........\n 0030 00a01021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name HuMemUsedMemorySizeGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -7850,7 +7924,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `UnlinkProcess` — benchmark function marioparty3:UnlinkProcess:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel UnlinkProcess\n lw\t$v1, 0($a1)\n beqz\t$v1, .L14\n nop\n lw\t$v0, 4($a1)\n sw\t$v0, 4($v1)\n.L14:\n lw\t$v1, 4($a1)\n beqz\t$v1, .L2c\n nop\n lw\t$v0, 0($a1)\n j\t.L34\n sw\t$v0, 0($v1)\n.L2c:\n lw\t$v0, 0($a1)\n sw\t$v0, 0($a0)\n.L34:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nstatic void UnlinkProcess(Process **root, Process *process);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UnlinkProcess # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `UnlinkProcess` — benchmark function marioparty3:UnlinkProcess:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:UnlinkProcess:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,0(a1)\n 4:\tbeqz\tv1,14 \n 8:\tnop\n c:\tlw\tv0,4(a1)\n 10:\tsw\tv0,4(v1)\n 14:\tlw\tv1,4(a1)\n 18:\tbeqz\tv1,2c \n 1c:\tnop\n 20:\tlw\tv0,0(a1)\n 24:\tj\t34 \n 28:\tsw\tv0,0(v1)\n 2c:\tlw\tv0,0(a1)\n 30:\tsw\tv0,0(a0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cc80fd6fc668362f/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l F .text\t0000003c UnlinkProcess\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8ca30000 10600003 00000000 8ca20004 .....`..........\n 0010 ac620004 8ca30004 10600004 00000000 .b.......`......\n 0020 8ca20000 0800000d ac620000 8ca20000 .........b......\n 0030 ac820000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"UnlinkProcess\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name UnlinkProcess # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `UnlinkProcess` — benchmark function marioparty3:UnlinkProcess:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:UnlinkProcess:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,0(a1)\n 4:\tbeqz\tv1,14 \n 8:\tnop\n c:\tlw\tv0,4(a1)\n 10:\tsw\tv0,4(v1)\n 14:\tlw\tv1,4(a1)\n 18:\tbeqz\tv1,2c \n 1c:\tnop\n 20:\tlw\tv0,0(a1)\n 24:\tj\t34 \n 28:\tsw\tv0,0(v1)\n 2c:\tlw\tv0,0(a1)\n 30:\tsw\tv0,0(a0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cc80fd6fc668362f/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l F .text\t0000003c UnlinkProcess\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8ca30000 10600003 00000000 8ca20004 .....`..........\n 0010 ac620004 8ca30004 10600004 00000000 .b.......`......\n 0020 8ca20000 0800000d ac620000 8ca20000 .........b......\n 0030 ac820000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"UnlinkProcess\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name UnlinkProcess # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -7922,7 +7996,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `CalcByteArraySum` — benchmark function pokeemerald:CalcByteArraySum:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcByteArraySum\n\t.type\t CalcByteArraySum,function\n\t.thumb_func\nCalcByteArraySum:\n\tpush\t{r4, lr}\n\tadd\tr4, r0, #0\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r4, r2\n\tldrb\tr0, [r0]\n\tadd\tr3, r3, r0\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, r1\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcByteArraySum,.Lfe1-CalcByteArraySum\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CalcByteArraySum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CalcByteArraySum` — benchmark function pokeemerald:CalcByteArraySum:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalcByteArraySum:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcByteArraySum\n\t.type\t CalcByteArraySum,function\n\t.thumb_func\nCalcByteArraySum:\n\tpush\t{r4, lr}\n\tadd\tr4, r0, #0\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r4, r2\n\tldrb\tr0, [r0]\n\tadd\tr3, r3, r0\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, r1\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcByteArraySum,.Lfe1-CalcByteArraySum\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalcByteArraySum # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CalcByteArraySum` — benchmark function pokeemerald:CalcByteArraySum:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalcByteArraySum:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcByteArraySum\n\t.type\t CalcByteArraySum,function\n\t.thumb_func\nCalcByteArraySum:\n\tpush\t{r4, lr}\n\tadd\tr4, r0, #0\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r4, r2\n\tldrb\tr0, [r0]\n\tadd\tr3, r3, r0\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, r1\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcByteArraySum,.Lfe1-CalcByteArraySum\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalcByteArraySum # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -7950,22 +8024,22 @@ "candidateLabel": "unsigned", "symbolsUsed": [], "outcome": "nonmatch", - "source": "s32 CalcCRC16(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n if (0 >= a1) {\n v4 = 4385;\n } else {\n v0 = 0;\n v1 = 4385;\n do {\n v2 = v1 ^ *(u8 *)(a0 + v0);\n v3 = 0;\n do {\n if ((v2 & 1) == 0) {\n v4 = v2 >> 1;\n } else {\n v4 = (u16)(v2 >> 1 ^ 33800);\n }\n v2 = v4;\n v3 = (u16)(v3 + 1);\n } while (v3 <= 7);\n v1 = v4;\n v0 = (u16)(v0 + 1);\n } while (v0 < a1);\n v4 = v1;\n }\n return (u16)~v4;\n}\n", + "source": "s32 CalcCRC16(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n if (0 >= a1) {\n v4 = 4385;\n } else {\n v0 = 0;\n v1 = 4385;\n do {\n v2 = v1 ^ *(u8 *)(a0 + v0);\n v3 = 0;\n do {\n if ((v2 & 1) == 0) {\n v4 = (u32)v2 >> 1;\n } else {\n v4 = (u16)((u32)v2 >> 1 ^ 33800);\n }\n v2 = v4;\n v3 = (u16)(v3 + 1);\n } while (v3 <= 7);\n v1 = v4;\n v0 = (u16)(v0 + 1);\n } while (v0 < a1);\n v4 = v1;\n }\n return (u16)~v4;\n}\n", "score": 45, "maxScore": 55, "compileErrors": null, "breakdown": { "insert": 13, "delete": 5, - "replace": 2, + "replace": 1, "opMismatch": 5, - "argMismatch": 20 + "argMismatch": 21 }, "quality": { - "score": 90, + "score": 86, "lines": 30, "gotos": 0, - "casts": 5, + "casts": 7, "unkGlue": 0, "rawMem": 1, "addrDeref": 0 @@ -7999,14 +8073,14 @@ "kinds": { "insert": 13, "delete": 5, - "replace": 2, + "replace": 1, "opMismatch": 5, - "argMismatch": 20 + "argMismatch": 21 } }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `CalcCRC16` — benchmark function pokeemerald:CalcCRC16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16\n\t.type\t CalcCRC16,function\n\t.thumb_func\nCalcCRC16:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L15\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbge\t.L4\t@cond_branch\n\tmov\tr6, #0x1\n\tldr\tr0, .L15+0x4\n\tadd\tr5, r0, #0\n.L6:\n\tadd\tr0, r7, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tmov\tr1, #0x0\n\tadd\tr3, r3, #0x1\n.L10:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r6\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tlsr\tr0, r2, #0x1\n\teor\tr0, r0, r5\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tb\t.L9\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t0x1121\n\t.word\t0x8408\n.L11:\n\tlsr\tr2, r2, #0x1\n.L9:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0x7\n\tbls\t.L10\t@cond_branch\n\tlsl\tr0, r3, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcCRC16,.Lfe1-CalcCRC16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CalcCRC16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CalcCRC16` — benchmark function pokeemerald:CalcCRC16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalcCRC16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16\n\t.type\t CalcCRC16,function\n\t.thumb_func\nCalcCRC16:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L15\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbge\t.L4\t@cond_branch\n\tmov\tr6, #0x1\n\tldr\tr0, .L15+0x4\n\tadd\tr5, r0, #0\n.L6:\n\tadd\tr0, r7, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tmov\tr1, #0x0\n\tadd\tr3, r3, #0x1\n.L10:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r6\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tlsr\tr0, r2, #0x1\n\teor\tr0, r0, r5\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tb\t.L9\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t0x1121\n\t.word\t0x8408\n.L11:\n\tlsr\tr2, r2, #0x1\n.L9:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0x7\n\tbls\t.L10\t@cond_branch\n\tlsl\tr0, r3, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcCRC16,.Lfe1-CalcCRC16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalcCRC16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CalcCRC16` — benchmark function pokeemerald:CalcCRC16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalcCRC16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16\n\t.type\t CalcCRC16,function\n\t.thumb_func\nCalcCRC16:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L15\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbge\t.L4\t@cond_branch\n\tmov\tr6, #0x1\n\tldr\tr0, .L15+0x4\n\tadd\tr5, r0, #0\n.L6:\n\tadd\tr0, r7, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tmov\tr1, #0x0\n\tadd\tr3, r3, #0x1\n.L10:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r6\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tlsr\tr0, r2, #0x1\n\teor\tr0, r0, r5\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tb\t.L9\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t0x1121\n\t.word\t0x8408\n.L11:\n\tlsr\tr2, r2, #0x1\n.L9:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0x7\n\tbls\t.L10\t@cond_branch\n\tlsl\tr0, r3, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcCRC16,.Lfe1-CalcCRC16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalcCRC16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -8090,7 +8164,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `CalcCRC16WithTable` — benchmark function pokeemerald:CalcCRC16WithTable:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t1, 0\n\t.type\t sCrc16Table,object\nsCrc16Table:\n\t.short\t0x0\n\t.short\t0x1189\n\t.short\t0x2312\n\t.short\t0x329b\n\t.short\t0x4624\n\t.short\t0x57ad\n\t.short\t0x6536\n\t.short\t0x74bf\n\t.short\t0x8c48\n\t.short\t0x9dc1\n\t.short\t0xaf5a\n\t.short\t0xbed3\n\t.short\t0xca6c\n\t.short\t0xdbe5\n\t.short\t0xe97e\n\t.short\t0xf8f7\n\t.short\t0x1081\n\t.short\t0x108\n\t.short\t0x3393\n\t.short\t0x221a\n\t.short\t0x56a5\n\t.short\t0x472c\n\t.short\t0x75b7\n\t.short\t0x643e\n\t.short\t0x9cc9\n\t.short\t0x8d40\n\t.short\t0xbfdb\n\t.short\t0xae52\n\t.short\t0xdaed\n\t.short\t0xcb64\n\t.short\t0xf9ff\n\t.short\t0xe876\n\t.short\t0x2102\n\t.short\t0x308b\n\t.short\t0x210\n\t.short\t0x1399\n\t.short\t0x6726\n\t.short\t0x76af\n\t.short\t0x4434\n\t.short\t0x55bd\n\t.short\t0xad4a\n\t.short\t0xbcc3\n\t.short\t0x8e58\n\t.short\t0x9fd1\n\t.short\t0xeb6e\n\t.short\t0xfae7\n\t.short\t0xc87c\n\t.short\t0xd9f5\n\t.short\t0x3183\n\t.short\t0x200a\n\t.short\t0x1291\n\t.short\t0x318\n\t.short\t0x77a7\n\t.short\t0x662e\n\t.short\t0x54b5\n\t.short\t0x453c\n\t.short\t0xbdcb\n\t.short\t0xac42\n\t.short\t0x9ed9\n\t.short\t0x8f50\n\t.short\t0xfbef\n\t.short\t0xea66\n\t.short\t0xd8fd\n\t.short\t0xc974\n\t.short\t0x4204\n\t.short\t0x538d\n\t.short\t0x6116\n\t.short\t0x709f\n\t.short\t0x420\n\t.short\t0x15a9\n\t.short\t0x2732\n\t.short\t0x36bb\n\t.short\t0xce4c\n\t.short\t0xdfc5\n\t.short\t0xed5e\n\t.short\t0xfcd7\n\t.short\t0x8868\n\t.short\t0x99e1\n\t.short\t0xab7a\n\t.short\t0xbaf3\n\t.short\t0x5285\n\t.short\t0x430c\n\t.short\t0x7197\n\t.short\t0x601e\n\t.short\t0x14a1\n\t.short\t0x528\n\t.short\t0x37b3\n\t.short\t0x263a\n\t.short\t0xdecd\n\t.short\t0xcf44\n\t.short\t0xfddf\n\t.short\t0xec56\n\t.short\t0x98e9\n\t.short\t0x8960\n\t.short\t0xbbfb\n\t.short\t0xaa72\n\t.short\t0x6306\n\t.short\t0x728f\n\t.short\t0x4014\n\t.short\t0x519d\n\t.short\t0x2522\n\t.short\t0x34ab\n\t.short\t0x630\n\t.short\t0x17b9\n\t.short\t0xef4e\n\t.short\t0xfec7\n\t.short\t0xcc5c\n\t.short\t0xddd5\n\t.short\t0xa96a\n\t.short\t0xb8e3\n\t.short\t0x8a78\n\t.short\t0x9bf1\n\t.short\t0x7387\n\t.short\t0x620e\n\t.short\t0x5095\n\t.short\t0x411c\n\t.short\t0x35a3\n\t.short\t0x242a\n\t.short\t0x16b1\n\t.short\t0x738\n\t.short\t0xffcf\n\t.short\t0xee46\n\t.short\t0xdcdd\n\t.short\t0xcd54\n\t.short\t0xb9eb\n\t.short\t0xa862\n\t.short\t0x9af9\n\t.short\t0x8b70\n\t.short\t0x8408\n\t.short\t0x9581\n\t.short\t0xa71a\n\t.short\t0xb693\n\t.short\t0xc22c\n\t.short\t0xd3a5\n\t.short\t0xe13e\n\t.short\t0xf0b7\n\t.short\t0x840\n\t.short\t0x19c9\n\t.short\t0x2b52\n\t.short\t0x3adb\n\t.short\t0x4e64\n\t.short\t0x5fed\n\t.short\t0x6d76\n\t.short\t0x7cff\n\t.short\t0x9489\n\t.short\t0x8500\n\t.short\t0xb79b\n\t.short\t0xa612\n\t.short\t0xd2ad\n\t.short\t0xc324\n\t.short\t0xf1bf\n\t.short\t0xe036\n\t.short\t0x18c1\n\t.short\t0x948\n\t.short\t0x3bd3\n\t.short\t0x2a5a\n\t.short\t0x5ee5\n\t.short\t0x4f6c\n\t.short\t0x7df7\n\t.short\t0x6c7e\n\t.short\t0xa50a\n\t.short\t0xb483\n\t.short\t0x8618\n\t.short\t0x9791\n\t.short\t0xe32e\n\t.short\t0xf2a7\n\t.short\t0xc03c\n\t.short\t0xd1b5\n\t.short\t0x2942\n\t.short\t0x38cb\n\t.short\t0xa50\n\t.short\t0x1bd9\n\t.short\t0x6f66\n\t.short\t0x7eef\n\t.short\t0x4c74\n\t.short\t0x5dfd\n\t.short\t0xb58b\n\t.short\t0xa402\n\t.short\t0x9699\n\t.short\t0x8710\n\t.short\t0xf3af\n\t.short\t0xe226\n\t.short\t0xd0bd\n\t.short\t0xc134\n\t.short\t0x39c3\n\t.short\t0x284a\n\t.short\t0x1ad1\n\t.short\t0xb58\n\t.short\t0x7fe7\n\t.short\t0x6e6e\n\t.short\t0x5cf5\n\t.short\t0x4d7c\n\t.short\t0xc60c\n\t.short\t0xd785\n\t.short\t0xe51e\n\t.short\t0xf497\n\t.short\t0x8028\n\t.short\t0x91a1\n\t.short\t0xa33a\n\t.short\t0xb2b3\n\t.short\t0x4a44\n\t.short\t0x5bcd\n\t.short\t0x6956\n\t.short\t0x78df\n\t.short\t0xc60\n\t.short\t0x1de9\n\t.short\t0x2f72\n\t.short\t0x3efb\n\t.short\t0xd68d\n\t.short\t0xc704\n\t.short\t0xf59f\n\t.short\t0xe416\n\t.short\t0x90a9\n\t.short\t0x8120\n\t.short\t0xb3bb\n\t.short\t0xa232\n\t.short\t0x5ac5\n\t.short\t0x4b4c\n\t.short\t0x79d7\n\t.short\t0x685e\n\t.short\t0x1ce1\n\t.short\t0xd68\n\t.short\t0x3ff3\n\t.short\t0x2e7a\n\t.short\t0xe70e\n\t.short\t0xf687\n\t.short\t0xc41c\n\t.short\t0xd595\n\t.short\t0xa12a\n\t.short\t0xb0a3\n\t.short\t0x8238\n\t.short\t0x93b1\n\t.short\t0x6b46\n\t.short\t0x7acf\n\t.short\t0x4854\n\t.short\t0x59dd\n\t.short\t0x2d62\n\t.short\t0x3ceb\n\t.short\t0xe70\n\t.short\t0x1ff9\n\t.short\t0xf78f\n\t.short\t0xe606\n\t.short\t0xd49d\n\t.short\t0xc514\n\t.short\t0xb1ab\n\t.short\t0xa022\n\t.short\t0x92b9\n\t.short\t0x8330\n\t.short\t0x7bc7\n\t.short\t0x6a4e\n\t.short\t0x58d5\n\t.short\t0x495c\n\t.short\t0x3de3\n\t.short\t0x2c6a\n\t.short\t0x1ef1\n\t.short\t0xf78\n\t.size\t sCrc16Table,512\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16WithTable\n\t.type\t CalcCRC16WithTable,function\n\t.thumb_func\nCalcCRC16WithTable:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L8\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L8+0x4\n.L6:\n\tlsr\tr1, r2, #0x8\n\tadd\tr0, r5, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tlsl\tr0, r2, #0x18\n\tlsr\tr0, r0, #0x17\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tadd\tr2, r0, #0\n\teor\tr2, r2, r1\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x1121\n\t.word\tsCrc16Table\n.Lfe1:\n\t.size\t CalcCRC16WithTable,.Lfe1-CalcCRC16WithTable\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-dbb6d12e4277.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu16 CalcCRC16WithTable(const u8 *data, u32 length);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CalcCRC16WithTable # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CalcCRC16WithTable` — benchmark function pokeemerald:CalcCRC16WithTable:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalcCRC16WithTable:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t1, 0\n\t.type\t sCrc16Table,object\nsCrc16Table:\n\t.short\t0x0\n\t.short\t0x1189\n\t.short\t0x2312\n\t.short\t0x329b\n\t.short\t0x4624\n\t.short\t0x57ad\n\t.short\t0x6536\n\t.short\t0x74bf\n\t.short\t0x8c48\n\t.short\t0x9dc1\n\t.short\t0xaf5a\n\t.short\t0xbed3\n\t.short\t0xca6c\n\t.short\t0xdbe5\n\t.short\t0xe97e\n\t.short\t0xf8f7\n\t.short\t0x1081\n\t.short\t0x108\n\t.short\t0x3393\n\t.short\t0x221a\n\t.short\t0x56a5\n\t.short\t0x472c\n\t.short\t0x75b7\n\t.short\t0x643e\n\t.short\t0x9cc9\n\t.short\t0x8d40\n\t.short\t0xbfdb\n\t.short\t0xae52\n\t.short\t0xdaed\n\t.short\t0xcb64\n\t.short\t0xf9ff\n\t.short\t0xe876\n\t.short\t0x2102\n\t.short\t0x308b\n\t.short\t0x210\n\t.short\t0x1399\n\t.short\t0x6726\n\t.short\t0x76af\n\t.short\t0x4434\n\t.short\t0x55bd\n\t.short\t0xad4a\n\t.short\t0xbcc3\n\t.short\t0x8e58\n\t.short\t0x9fd1\n\t.short\t0xeb6e\n\t.short\t0xfae7\n\t.short\t0xc87c\n\t.short\t0xd9f5\n\t.short\t0x3183\n\t.short\t0x200a\n\t.short\t0x1291\n\t.short\t0x318\n\t.short\t0x77a7\n\t.short\t0x662e\n\t.short\t0x54b5\n\t.short\t0x453c\n\t.short\t0xbdcb\n\t.short\t0xac42\n\t.short\t0x9ed9\n\t.short\t0x8f50\n\t.short\t0xfbef\n\t.short\t0xea66\n\t.short\t0xd8fd\n\t.short\t0xc974\n\t.short\t0x4204\n\t.short\t0x538d\n\t.short\t0x6116\n\t.short\t0x709f\n\t.short\t0x420\n\t.short\t0x15a9\n\t.short\t0x2732\n\t.short\t0x36bb\n\t.short\t0xce4c\n\t.short\t0xdfc5\n\t.short\t0xed5e\n\t.short\t0xfcd7\n\t.short\t0x8868\n\t.short\t0x99e1\n\t.short\t0xab7a\n\t.short\t0xbaf3\n\t.short\t0x5285\n\t.short\t0x430c\n\t.short\t0x7197\n\t.short\t0x601e\n\t.short\t0x14a1\n\t.short\t0x528\n\t.short\t0x37b3\n\t.short\t0x263a\n\t.short\t0xdecd\n\t.short\t0xcf44\n\t.short\t0xfddf\n\t.short\t0xec56\n\t.short\t0x98e9\n\t.short\t0x8960\n\t.short\t0xbbfb\n\t.short\t0xaa72\n\t.short\t0x6306\n\t.short\t0x728f\n\t.short\t0x4014\n\t.short\t0x519d\n\t.short\t0x2522\n\t.short\t0x34ab\n\t.short\t0x630\n\t.short\t0x17b9\n\t.short\t0xef4e\n\t.short\t0xfec7\n\t.short\t0xcc5c\n\t.short\t0xddd5\n\t.short\t0xa96a\n\t.short\t0xb8e3\n\t.short\t0x8a78\n\t.short\t0x9bf1\n\t.short\t0x7387\n\t.short\t0x620e\n\t.short\t0x5095\n\t.short\t0x411c\n\t.short\t0x35a3\n\t.short\t0x242a\n\t.short\t0x16b1\n\t.short\t0x738\n\t.short\t0xffcf\n\t.short\t0xee46\n\t.short\t0xdcdd\n\t.short\t0xcd54\n\t.short\t0xb9eb\n\t.short\t0xa862\n\t.short\t0x9af9\n\t.short\t0x8b70\n\t.short\t0x8408\n\t.short\t0x9581\n\t.short\t0xa71a\n\t.short\t0xb693\n\t.short\t0xc22c\n\t.short\t0xd3a5\n\t.short\t0xe13e\n\t.short\t0xf0b7\n\t.short\t0x840\n\t.short\t0x19c9\n\t.short\t0x2b52\n\t.short\t0x3adb\n\t.short\t0x4e64\n\t.short\t0x5fed\n\t.short\t0x6d76\n\t.short\t0x7cff\n\t.short\t0x9489\n\t.short\t0x8500\n\t.short\t0xb79b\n\t.short\t0xa612\n\t.short\t0xd2ad\n\t.short\t0xc324\n\t.short\t0xf1bf\n\t.short\t0xe036\n\t.short\t0x18c1\n\t.short\t0x948\n\t.short\t0x3bd3\n\t.short\t0x2a5a\n\t.short\t0x5ee5\n\t.short\t0x4f6c\n\t.short\t0x7df7\n\t.short\t0x6c7e\n\t.short\t0xa50a\n\t.short\t0xb483\n\t.short\t0x8618\n\t.short\t0x9791\n\t.short\t0xe32e\n\t.short\t0xf2a7\n\t.short\t0xc03c\n\t.short\t0xd1b5\n\t.short\t0x2942\n\t.short\t0x38cb\n\t.short\t0xa50\n\t.short\t0x1bd9\n\t.short\t0x6f66\n\t.short\t0x7eef\n\t.short\t0x4c74\n\t.short\t0x5dfd\n\t.short\t0xb58b\n\t.short\t0xa402\n\t.short\t0x9699\n\t.short\t0x8710\n\t.short\t0xf3af\n\t.short\t0xe226\n\t.short\t0xd0bd\n\t.short\t0xc134\n\t.short\t0x39c3\n\t.short\t0x284a\n\t.short\t0x1ad1\n\t.short\t0xb58\n\t.short\t0x7fe7\n\t.short\t0x6e6e\n\t.short\t0x5cf5\n\t.short\t0x4d7c\n\t.short\t0xc60c\n\t.short\t0xd785\n\t.short\t0xe51e\n\t.short\t0xf497\n\t.short\t0x8028\n\t.short\t0x91a1\n\t.short\t0xa33a\n\t.short\t0xb2b3\n\t.short\t0x4a44\n\t.short\t0x5bcd\n\t.short\t0x6956\n\t.short\t0x78df\n\t.short\t0xc60\n\t.short\t0x1de9\n\t.short\t0x2f72\n\t.short\t0x3efb\n\t.short\t0xd68d\n\t.short\t0xc704\n\t.short\t0xf59f\n\t.short\t0xe416\n\t.short\t0x90a9\n\t.short\t0x8120\n\t.short\t0xb3bb\n\t.short\t0xa232\n\t.short\t0x5ac5\n\t.short\t0x4b4c\n\t.short\t0x79d7\n\t.short\t0x685e\n\t.short\t0x1ce1\n\t.short\t0xd68\n\t.short\t0x3ff3\n\t.short\t0x2e7a\n\t.short\t0xe70e\n\t.short\t0xf687\n\t.short\t0xc41c\n\t.short\t0xd595\n\t.short\t0xa12a\n\t.short\t0xb0a3\n\t.short\t0x8238\n\t.short\t0x93b1\n\t.short\t0x6b46\n\t.short\t0x7acf\n\t.short\t0x4854\n\t.short\t0x59dd\n\t.short\t0x2d62\n\t.short\t0x3ceb\n\t.short\t0xe70\n\t.short\t0x1ff9\n\t.short\t0xf78f\n\t.short\t0xe606\n\t.short\t0xd49d\n\t.short\t0xc514\n\t.short\t0xb1ab\n\t.short\t0xa022\n\t.short\t0x92b9\n\t.short\t0x8330\n\t.short\t0x7bc7\n\t.short\t0x6a4e\n\t.short\t0x58d5\n\t.short\t0x495c\n\t.short\t0x3de3\n\t.short\t0x2c6a\n\t.short\t0x1ef1\n\t.short\t0xf78\n\t.size\t sCrc16Table,512\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16WithTable\n\t.type\t CalcCRC16WithTable,function\n\t.thumb_func\nCalcCRC16WithTable:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L8\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L8+0x4\n.L6:\n\tlsr\tr1, r2, #0x8\n\tadd\tr0, r5, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tlsl\tr0, r2, #0x18\n\tlsr\tr0, r0, #0x17\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tadd\tr2, r0, #0\n\teor\tr2, r2, r1\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x1121\n\t.word\tsCrc16Table\n.Lfe1:\n\t.size\t CalcCRC16WithTable,.Lfe1-CalcCRC16WithTable\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalcCRC16WithTable # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CalcCRC16WithTable` — benchmark function pokeemerald:CalcCRC16WithTable:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalcCRC16WithTable:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t1, 0\n\t.type\t sCrc16Table,object\nsCrc16Table:\n\t.short\t0x0\n\t.short\t0x1189\n\t.short\t0x2312\n\t.short\t0x329b\n\t.short\t0x4624\n\t.short\t0x57ad\n\t.short\t0x6536\n\t.short\t0x74bf\n\t.short\t0x8c48\n\t.short\t0x9dc1\n\t.short\t0xaf5a\n\t.short\t0xbed3\n\t.short\t0xca6c\n\t.short\t0xdbe5\n\t.short\t0xe97e\n\t.short\t0xf8f7\n\t.short\t0x1081\n\t.short\t0x108\n\t.short\t0x3393\n\t.short\t0x221a\n\t.short\t0x56a5\n\t.short\t0x472c\n\t.short\t0x75b7\n\t.short\t0x643e\n\t.short\t0x9cc9\n\t.short\t0x8d40\n\t.short\t0xbfdb\n\t.short\t0xae52\n\t.short\t0xdaed\n\t.short\t0xcb64\n\t.short\t0xf9ff\n\t.short\t0xe876\n\t.short\t0x2102\n\t.short\t0x308b\n\t.short\t0x210\n\t.short\t0x1399\n\t.short\t0x6726\n\t.short\t0x76af\n\t.short\t0x4434\n\t.short\t0x55bd\n\t.short\t0xad4a\n\t.short\t0xbcc3\n\t.short\t0x8e58\n\t.short\t0x9fd1\n\t.short\t0xeb6e\n\t.short\t0xfae7\n\t.short\t0xc87c\n\t.short\t0xd9f5\n\t.short\t0x3183\n\t.short\t0x200a\n\t.short\t0x1291\n\t.short\t0x318\n\t.short\t0x77a7\n\t.short\t0x662e\n\t.short\t0x54b5\n\t.short\t0x453c\n\t.short\t0xbdcb\n\t.short\t0xac42\n\t.short\t0x9ed9\n\t.short\t0x8f50\n\t.short\t0xfbef\n\t.short\t0xea66\n\t.short\t0xd8fd\n\t.short\t0xc974\n\t.short\t0x4204\n\t.short\t0x538d\n\t.short\t0x6116\n\t.short\t0x709f\n\t.short\t0x420\n\t.short\t0x15a9\n\t.short\t0x2732\n\t.short\t0x36bb\n\t.short\t0xce4c\n\t.short\t0xdfc5\n\t.short\t0xed5e\n\t.short\t0xfcd7\n\t.short\t0x8868\n\t.short\t0x99e1\n\t.short\t0xab7a\n\t.short\t0xbaf3\n\t.short\t0x5285\n\t.short\t0x430c\n\t.short\t0x7197\n\t.short\t0x601e\n\t.short\t0x14a1\n\t.short\t0x528\n\t.short\t0x37b3\n\t.short\t0x263a\n\t.short\t0xdecd\n\t.short\t0xcf44\n\t.short\t0xfddf\n\t.short\t0xec56\n\t.short\t0x98e9\n\t.short\t0x8960\n\t.short\t0xbbfb\n\t.short\t0xaa72\n\t.short\t0x6306\n\t.short\t0x728f\n\t.short\t0x4014\n\t.short\t0x519d\n\t.short\t0x2522\n\t.short\t0x34ab\n\t.short\t0x630\n\t.short\t0x17b9\n\t.short\t0xef4e\n\t.short\t0xfec7\n\t.short\t0xcc5c\n\t.short\t0xddd5\n\t.short\t0xa96a\n\t.short\t0xb8e3\n\t.short\t0x8a78\n\t.short\t0x9bf1\n\t.short\t0x7387\n\t.short\t0x620e\n\t.short\t0x5095\n\t.short\t0x411c\n\t.short\t0x35a3\n\t.short\t0x242a\n\t.short\t0x16b1\n\t.short\t0x738\n\t.short\t0xffcf\n\t.short\t0xee46\n\t.short\t0xdcdd\n\t.short\t0xcd54\n\t.short\t0xb9eb\n\t.short\t0xa862\n\t.short\t0x9af9\n\t.short\t0x8b70\n\t.short\t0x8408\n\t.short\t0x9581\n\t.short\t0xa71a\n\t.short\t0xb693\n\t.short\t0xc22c\n\t.short\t0xd3a5\n\t.short\t0xe13e\n\t.short\t0xf0b7\n\t.short\t0x840\n\t.short\t0x19c9\n\t.short\t0x2b52\n\t.short\t0x3adb\n\t.short\t0x4e64\n\t.short\t0x5fed\n\t.short\t0x6d76\n\t.short\t0x7cff\n\t.short\t0x9489\n\t.short\t0x8500\n\t.short\t0xb79b\n\t.short\t0xa612\n\t.short\t0xd2ad\n\t.short\t0xc324\n\t.short\t0xf1bf\n\t.short\t0xe036\n\t.short\t0x18c1\n\t.short\t0x948\n\t.short\t0x3bd3\n\t.short\t0x2a5a\n\t.short\t0x5ee5\n\t.short\t0x4f6c\n\t.short\t0x7df7\n\t.short\t0x6c7e\n\t.short\t0xa50a\n\t.short\t0xb483\n\t.short\t0x8618\n\t.short\t0x9791\n\t.short\t0xe32e\n\t.short\t0xf2a7\n\t.short\t0xc03c\n\t.short\t0xd1b5\n\t.short\t0x2942\n\t.short\t0x38cb\n\t.short\t0xa50\n\t.short\t0x1bd9\n\t.short\t0x6f66\n\t.short\t0x7eef\n\t.short\t0x4c74\n\t.short\t0x5dfd\n\t.short\t0xb58b\n\t.short\t0xa402\n\t.short\t0x9699\n\t.short\t0x8710\n\t.short\t0xf3af\n\t.short\t0xe226\n\t.short\t0xd0bd\n\t.short\t0xc134\n\t.short\t0x39c3\n\t.short\t0x284a\n\t.short\t0x1ad1\n\t.short\t0xb58\n\t.short\t0x7fe7\n\t.short\t0x6e6e\n\t.short\t0x5cf5\n\t.short\t0x4d7c\n\t.short\t0xc60c\n\t.short\t0xd785\n\t.short\t0xe51e\n\t.short\t0xf497\n\t.short\t0x8028\n\t.short\t0x91a1\n\t.short\t0xa33a\n\t.short\t0xb2b3\n\t.short\t0x4a44\n\t.short\t0x5bcd\n\t.short\t0x6956\n\t.short\t0x78df\n\t.short\t0xc60\n\t.short\t0x1de9\n\t.short\t0x2f72\n\t.short\t0x3efb\n\t.short\t0xd68d\n\t.short\t0xc704\n\t.short\t0xf59f\n\t.short\t0xe416\n\t.short\t0x90a9\n\t.short\t0x8120\n\t.short\t0xb3bb\n\t.short\t0xa232\n\t.short\t0x5ac5\n\t.short\t0x4b4c\n\t.short\t0x79d7\n\t.short\t0x685e\n\t.short\t0x1ce1\n\t.short\t0xd68\n\t.short\t0x3ff3\n\t.short\t0x2e7a\n\t.short\t0xe70e\n\t.short\t0xf687\n\t.short\t0xc41c\n\t.short\t0xd595\n\t.short\t0xa12a\n\t.short\t0xb0a3\n\t.short\t0x8238\n\t.short\t0x93b1\n\t.short\t0x6b46\n\t.short\t0x7acf\n\t.short\t0x4854\n\t.short\t0x59dd\n\t.short\t0x2d62\n\t.short\t0x3ceb\n\t.short\t0xe70\n\t.short\t0x1ff9\n\t.short\t0xf78f\n\t.short\t0xe606\n\t.short\t0xd49d\n\t.short\t0xc514\n\t.short\t0xb1ab\n\t.short\t0xa022\n\t.short\t0x92b9\n\t.short\t0x8330\n\t.short\t0x7bc7\n\t.short\t0x6a4e\n\t.short\t0x58d5\n\t.short\t0x495c\n\t.short\t0x3de3\n\t.short\t0x2c6a\n\t.short\t0x1ef1\n\t.short\t0xf78\n\t.size\t sCrc16Table,512\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16WithTable\n\t.type\t CalcCRC16WithTable,function\n\t.thumb_func\nCalcCRC16WithTable:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L8\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L8+0x4\n.L6:\n\tlsr\tr1, r2, #0x8\n\tadd\tr0, r5, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tlsl\tr0, r2, #0x18\n\tlsr\tr0, r0, #0x17\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tadd\tr2, r0, #0\n\teor\tr2, r2, r1\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x1121\n\t.word\tsCrc16Table\n.Lfe1:\n\t.size\t CalcCRC16WithTable,.Lfe1-CalcCRC16WithTable\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalcCRC16WithTable # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -8190,7 +8264,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `CalculatePPWithBonus` — benchmark function pokeemerald:CalculatePPWithBonus:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalculatePPWithBonus\n\t.type\t CalculatePPWithBonus,function\n\t.thumb_func\nCalculatePPWithBonus:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tldr\tr4, .L3\n\tlsl\tr3, r0, #0x1\n\tadd\tr3, r3, r0\n\tlsl\tr3, r3, #0x2\n\tadd\tr3, r3, r4\n\tldrb\tr4, [r3, #0x4]\n\tldr\tr0, .L3+0x4\n\tadd\tr0, r2, r0\n\tldrb\tr3, [r0]\n\tand\tr3, r3, r1\n\tlsl\tr2, r2, #0x1\n\tasr\tr3, r3, r2\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r3\n\tlsl\tr0, r0, #0x2\n\tmul\tr0, r0, r4\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tadd\tr4, r4, r0\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgBattleMoves\n\t.word\tgPPUpGetMask\n.Lfe1:\n\t.size\t CalculatePPWithBonus,.Lfe1-CalculatePPWithBonus\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CalculatePPWithBonus # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CalculatePPWithBonus` — benchmark function pokeemerald:CalculatePPWithBonus:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalculatePPWithBonus:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalculatePPWithBonus\n\t.type\t CalculatePPWithBonus,function\n\t.thumb_func\nCalculatePPWithBonus:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tldr\tr4, .L3\n\tlsl\tr3, r0, #0x1\n\tadd\tr3, r3, r0\n\tlsl\tr3, r3, #0x2\n\tadd\tr3, r3, r4\n\tldrb\tr4, [r3, #0x4]\n\tldr\tr0, .L3+0x4\n\tadd\tr0, r2, r0\n\tldrb\tr3, [r0]\n\tand\tr3, r3, r1\n\tlsl\tr2, r2, #0x1\n\tasr\tr3, r3, r2\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r3\n\tlsl\tr0, r0, #0x2\n\tmul\tr0, r0, r4\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tadd\tr4, r4, r0\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgBattleMoves\n\t.word\tgPPUpGetMask\n.Lfe1:\n\t.size\t CalculatePPWithBonus,.Lfe1-CalculatePPWithBonus\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalculatePPWithBonus # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CalculatePPWithBonus` — benchmark function pokeemerald:CalculatePPWithBonus:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalculatePPWithBonus:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalculatePPWithBonus\n\t.type\t CalculatePPWithBonus,function\n\t.thumb_func\nCalculatePPWithBonus:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tldr\tr4, .L3\n\tlsl\tr3, r0, #0x1\n\tadd\tr3, r3, r0\n\tlsl\tr3, r3, #0x2\n\tadd\tr3, r3, r4\n\tldrb\tr4, [r3, #0x4]\n\tldr\tr0, .L3+0x4\n\tadd\tr0, r2, r0\n\tldrb\tr3, [r0]\n\tand\tr3, r3, r1\n\tlsl\tr2, r2, #0x1\n\tasr\tr3, r3, r2\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r3\n\tlsl\tr0, r0, #0x2\n\tmul\tr0, r0, r4\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tadd\tr4, r4, r0\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgBattleMoves\n\t.word\tgPPUpGetMask\n.Lfe1:\n\t.size\t CalculatePPWithBonus,.Lfe1-CalculatePPWithBonus\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalculatePPWithBonus # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -8264,7 +8338,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `Cos2` — benchmark function pokeemerald:Cos2:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCos2\n\t.type\t Cos2,function\n\t.thumb_func\nCos2:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tmov\tr1, #0xb4\n\tlsl\tr1, r1, #0xf\n\tadd\tr0, r0, r1\n\tlsr\tr0, r0, #0x10\n\tbl\tSin2\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Cos2,.Lfe1-Cos2\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Cos2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `Cos2` — benchmark function pokeemerald:Cos2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:Cos2:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCos2\n\t.type\t Cos2,function\n\t.thumb_func\nCos2:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tmov\tr1, #0xb4\n\tlsl\tr1, r1, #0xf\n\tadd\tr0, r0, r1\n\tlsr\tr0, r0, #0x10\n\tbl\tSin2\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Cos2,.Lfe1-Cos2\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Cos2 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `Cos2` — benchmark function pokeemerald:Cos2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:Cos2:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCos2\n\t.type\t Cos2,function\n\t.thumb_func\nCos2:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tmov\tr1, #0xb4\n\tlsl\tr1, r1, #0xf\n\tadd\tr0, r0, r1\n\tlsr\tr0, r0, #0x10\n\tbl\tSin2\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Cos2,.Lfe1-Cos2\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Cos2 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -8292,22 +8366,22 @@ "candidateLabel": "unsigned", "symbolsUsed": [], "outcome": "nonmatch", - "source": "s32 CountTrailingZeroBits(u32 a0) {\n s32 v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n while ((v0 & 1) == 0) {\n v0 = v0 >> 1;\n v1 = (u8)(v1 + 1);\n if (v1 > 31) {\n v1 = 0;\n return v1;\n }\n }\n return v1;\n}\n", + "source": "s32 CountTrailingZeroBits(u32 a0) {\n s32 v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n while ((v0 & 1) == 0) {\n v0 = (u32)v0 >> 1;\n v1 = (u8)(v1 + 1);\n if (v1 > 31) {\n v1 = 0;\n return v1;\n }\n }\n return v1;\n}\n", "score": 19, "maxScore": 23, "compileErrors": null, "breakdown": { "insert": 6, "delete": 2, - "replace": 1, + "replace": 0, "opMismatch": 2, - "argMismatch": 8 + "argMismatch": 9 }, "quality": { "score": 100, "lines": 15, "gotos": 0, - "casts": 1, + "casts": 2, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -8352,7 +8426,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `CountTrailingZeroBits` — benchmark function pokeemerald:CountTrailingZeroBits:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountTrailingZeroBits\n\t.type\t CountTrailingZeroBits,function\n\t.thumb_func\nCountTrailingZeroBits:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tmov\tr3, #0x1\n.L6:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r3\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L10\n.L7:\n\tlsr\tr2, r2, #0x1\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0x1f\n\tbls\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n.L10:\n\tbx\tlr\n.Lfe1:\n\t.size\t CountTrailingZeroBits,.Lfe1-CountTrailingZeroBits\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CountTrailingZeroBits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CountTrailingZeroBits` — benchmark function pokeemerald:CountTrailingZeroBits:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CountTrailingZeroBits:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountTrailingZeroBits\n\t.type\t CountTrailingZeroBits,function\n\t.thumb_func\nCountTrailingZeroBits:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tmov\tr3, #0x1\n.L6:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r3\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L10\n.L7:\n\tlsr\tr2, r2, #0x1\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0x1f\n\tbls\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n.L10:\n\tbx\tlr\n.Lfe1:\n\t.size\t CountTrailingZeroBits,.Lfe1-CountTrailingZeroBits\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CountTrailingZeroBits # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `CountTrailingZeroBits` — benchmark function pokeemerald:CountTrailingZeroBits:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CountTrailingZeroBits:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountTrailingZeroBits\n\t.type\t CountTrailingZeroBits,function\n\t.thumb_func\nCountTrailingZeroBits:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tmov\tr3, #0x1\n.L6:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r3\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L10\n.L7:\n\tlsr\tr2, r2, #0x1\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0x1f\n\tbls\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n.L10:\n\tbx\tlr\n.Lfe1:\n\t.size\t CountTrailingZeroBits,.Lfe1-CountTrailingZeroBits\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CountTrailingZeroBits # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -8383,15 +8457,15 @@ "shape": "scalar u32" } ], - "outcome": "nonmatch", - "source": "s32 FeebasRandom(void) {\n s32 v0;\n v0 = sFeebasRngValue;\n sFeebasRngValue = 1103515245 * v0 + 12345;\n return 1103515245 * v0 + 12345 >> 16;\n}\n", - "score": 1, + "outcome": "match", + "source": "s32 FeebasRandom(void) {\n s32 v0;\n v0 = sFeebasRngValue;\n sFeebasRngValue = 1103515245 * v0 + 12345;\n return (u32)(1103515245 * v0 + 12345) >> 16;\n}\n", + "score": 0, "maxScore": 13, "compileErrors": null, "breakdown": { "insert": 0, "delete": 0, - "replace": 1, + "replace": 0, "opMismatch": 0, "argMismatch": 0 }, @@ -8399,7 +8473,7 @@ "score": 100, "lines": 6, "gotos": 0, - "casts": 1, + "casts": 2, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -8429,22 +8503,10 @@ "addrDeref": 0 } }, - "gapSize": { - "decompiler": "asmlift", - "score": 1, - "maxScore": 13, - "ratio": 0.07692307692307693, - "kinds": { - "insert": 0, - "delete": 0, - "replace": 1, - "opMismatch": 0, - "argMismatch": 0 - } - }, + "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `FeebasRandom` — benchmark function pokeemerald:FeebasRandom:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.type\t FeebasRandom,function\n\t.thumb_func\nFeebasRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tsFeebasRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x3039\n.Lfe1:\n\t.size\t FeebasRandom,.Lfe1-FeebasRandom\n\n\t.lcomm\tsFeebasRngValue,4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function FeebasRandom # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `FeebasRandom` — benchmark function pokeemerald:FeebasRandom:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:FeebasRandom:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.type\t FeebasRandom,function\n\t.thumb_func\nFeebasRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tsFeebasRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x3039\n.Lfe1:\n\t.size\t FeebasRandom,.Lfe1-FeebasRandom\n\n\t.lcomm\tsFeebasRngValue,4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name FeebasRandom # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `FeebasRandom` — benchmark function pokeemerald:FeebasRandom:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:FeebasRandom:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.type\t FeebasRandom,function\n\t.thumb_func\nFeebasRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tsFeebasRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x3039\n.Lfe1:\n\t.size\t FeebasRandom,.Lfe1-FeebasRandom\n\n\t.lcomm\tsFeebasRngValue,4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name FeebasRandom # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -8538,7 +8600,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `GetGenderFromSpeciesAndPersonality` — benchmark function pokeemerald:GetGenderFromSpeciesAndPersonality:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetGenderFromSpeciesAndPersonality\n\t.type\t GetGenderFromSpeciesAndPersonality,function\n\t.thumb_func\nGetGenderFromSpeciesAndPersonality:\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tldr\tr1, .L12\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0, #0x10]\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tcmp\tr0, #0\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, #0xff\n\tbgt\t.L3\t@cond_branch\n\tcmp\tr0, #0xfe\n\tbge\t.L11\t@cond_branch\n.L3:\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x10]\n\tmov\tr0, #0xff\n\tand\tr0, r0, r3\n\tcmp\tr1, r0\n\tbhi\t.L9\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L11\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgSpeciesInfo\n.L9:\n\tmov\tr0, #0xfe\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t GetGenderFromSpeciesAndPersonality,.Lfe1-GetGenderFromSpeciesAndPersonality\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GetGenderFromSpeciesAndPersonality # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GetGenderFromSpeciesAndPersonality` — benchmark function pokeemerald:GetGenderFromSpeciesAndPersonality:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:GetGenderFromSpeciesAndPersonality:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetGenderFromSpeciesAndPersonality\n\t.type\t GetGenderFromSpeciesAndPersonality,function\n\t.thumb_func\nGetGenderFromSpeciesAndPersonality:\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tldr\tr1, .L12\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0, #0x10]\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tcmp\tr0, #0\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, #0xff\n\tbgt\t.L3\t@cond_branch\n\tcmp\tr0, #0xfe\n\tbge\t.L11\t@cond_branch\n.L3:\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x10]\n\tmov\tr0, #0xff\n\tand\tr0, r0, r3\n\tcmp\tr1, r0\n\tbhi\t.L9\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L11\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgSpeciesInfo\n.L9:\n\tmov\tr0, #0xfe\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t GetGenderFromSpeciesAndPersonality,.Lfe1-GetGenderFromSpeciesAndPersonality\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetGenderFromSpeciesAndPersonality # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GetGenderFromSpeciesAndPersonality` — benchmark function pokeemerald:GetGenderFromSpeciesAndPersonality:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:GetGenderFromSpeciesAndPersonality:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetGenderFromSpeciesAndPersonality\n\t.type\t GetGenderFromSpeciesAndPersonality,function\n\t.thumb_func\nGetGenderFromSpeciesAndPersonality:\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tldr\tr1, .L12\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0, #0x10]\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tcmp\tr0, #0\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, #0xff\n\tbgt\t.L3\t@cond_branch\n\tcmp\tr0, #0xfe\n\tbge\t.L11\t@cond_branch\n.L3:\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x10]\n\tmov\tr0, #0xff\n\tand\tr0, r0, r3\n\tcmp\tr1, r0\n\tbhi\t.L9\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L11\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgSpeciesInfo\n.L9:\n\tmov\tr0, #0xfe\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t GetGenderFromSpeciesAndPersonality,.Lfe1-GetGenderFromSpeciesAndPersonality\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetGenderFromSpeciesAndPersonality # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -8632,7 +8694,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `GiveBerryPowder` — benchmark function pokeemerald:GiveBerryPowder:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGiveBerryPowder\n\t.type\t GiveBerryPowder,function\n\t.thumb_func\nGiveBerryPowder:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tldr\tr0, .L6\n\tldr\tr0, [r0]\n\tmov\tr1, #0xfa\n\tlsl\tr1, r1, #0x1\n\tadd\tr5, r0, r1\n\tadd\tr0, r5, #0\n\tbl\tDecryptBerryPowder\n\tadd\tr1, r0, r4\n\tldr\tr2, .L6+0x4\n\tcmp\tr1, r2\n\tbhi\t.L3\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x1\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgSaveBlock2Ptr\n\t.word\t0x1869f\n.L3:\n\tadd\tr0, r5, #0\n\tadd\tr1, r2, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GiveBerryPowder,.Lfe1-GiveBerryPowder\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-264361caa05e.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nbool8 GiveBerryPowder(u32 amountToAdd);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GiveBerryPowder # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GiveBerryPowder` — benchmark function pokeemerald:GiveBerryPowder:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:GiveBerryPowder:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGiveBerryPowder\n\t.type\t GiveBerryPowder,function\n\t.thumb_func\nGiveBerryPowder:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tldr\tr0, .L6\n\tldr\tr0, [r0]\n\tmov\tr1, #0xfa\n\tlsl\tr1, r1, #0x1\n\tadd\tr5, r0, r1\n\tadd\tr0, r5, #0\n\tbl\tDecryptBerryPowder\n\tadd\tr1, r0, r4\n\tldr\tr2, .L6+0x4\n\tcmp\tr1, r2\n\tbhi\t.L3\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x1\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgSaveBlock2Ptr\n\t.word\t0x1869f\n.L3:\n\tadd\tr0, r5, #0\n\tadd\tr1, r2, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GiveBerryPowder,.Lfe1-GiveBerryPowder\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GiveBerryPowder # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GiveBerryPowder` — benchmark function pokeemerald:GiveBerryPowder:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:GiveBerryPowder:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGiveBerryPowder\n\t.type\t GiveBerryPowder,function\n\t.thumb_func\nGiveBerryPowder:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tldr\tr0, .L6\n\tldr\tr0, [r0]\n\tmov\tr1, #0xfa\n\tlsl\tr1, r1, #0x1\n\tadd\tr5, r0, r1\n\tadd\tr0, r5, #0\n\tbl\tDecryptBerryPowder\n\tadd\tr1, r0, r4\n\tldr\tr2, .L6+0x4\n\tcmp\tr1, r2\n\tbhi\t.L3\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x1\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgSaveBlock2Ptr\n\t.word\t0x1869f\n.L3:\n\tadd\tr0, r5, #0\n\tadd\tr1, r2, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GiveBerryPowder,.Lfe1-GiveBerryPowder\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GiveBerryPowder # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -8716,7 +8778,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `IsStringLengthAtLeast` — benchmark function pokeemerald:IsStringLengthAtLeast:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tIsStringLengthAtLeast\n\t.type\t IsStringLengthAtLeast,function\n\t.thumb_func\nIsStringLengthAtLeast:\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tcmp\tr2, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0xff\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L9\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, r1\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t IsStringLengthAtLeast,.Lfe1-IsStringLengthAtLeast\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function IsStringLengthAtLeast # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `IsStringLengthAtLeast` — benchmark function pokeemerald:IsStringLengthAtLeast:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:IsStringLengthAtLeast:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tIsStringLengthAtLeast\n\t.type\t IsStringLengthAtLeast,function\n\t.thumb_func\nIsStringLengthAtLeast:\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tcmp\tr2, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0xff\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L9\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, r1\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t IsStringLengthAtLeast,.Lfe1-IsStringLengthAtLeast\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name IsStringLengthAtLeast # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `IsStringLengthAtLeast` — benchmark function pokeemerald:IsStringLengthAtLeast:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:IsStringLengthAtLeast:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tIsStringLengthAtLeast\n\t.type\t IsStringLengthAtLeast,function\n\t.thumb_func\nIsStringLengthAtLeast:\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tcmp\tr2, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0xff\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L9\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, r1\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t IsStringLengthAtLeast,.Lfe1-IsStringLengthAtLeast\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name IsStringLengthAtLeast # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -8808,7 +8870,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `LoadWordFromTwoHalfwords` — benchmark function pokeemerald:LoadWordFromTwoHalfwords:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tLoadWordFromTwoHalfwords\n\t.type\t LoadWordFromTwoHalfwords,function\n\t.thumb_func\nLoadWordFromTwoHalfwords:\n\tldrh\tr2, [r0]\n\tmov\tr3, #0x2\n\tldrsh\tr0, [r0, r3]\n\tlsl\tr0, r0, #0x10\n\torr\tr2, r2, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t LoadWordFromTwoHalfwords,.Lfe1-LoadWordFromTwoHalfwords\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function LoadWordFromTwoHalfwords # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `LoadWordFromTwoHalfwords` — benchmark function pokeemerald:LoadWordFromTwoHalfwords:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:LoadWordFromTwoHalfwords:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tLoadWordFromTwoHalfwords\n\t.type\t LoadWordFromTwoHalfwords,function\n\t.thumb_func\nLoadWordFromTwoHalfwords:\n\tldrh\tr2, [r0]\n\tmov\tr3, #0x2\n\tldrsh\tr0, [r0, r3]\n\tlsl\tr0, r0, #0x10\n\torr\tr2, r2, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t LoadWordFromTwoHalfwords,.Lfe1-LoadWordFromTwoHalfwords\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"LoadWordFromTwoHalfwords\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name LoadWordFromTwoHalfwords # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `LoadWordFromTwoHalfwords` — benchmark function pokeemerald:LoadWordFromTwoHalfwords:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:LoadWordFromTwoHalfwords:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tLoadWordFromTwoHalfwords\n\t.type\t LoadWordFromTwoHalfwords,function\n\t.thumb_func\nLoadWordFromTwoHalfwords:\n\tldrh\tr2, [r0]\n\tmov\tr3, #0x2\n\tldrsh\tr0, [r0, r3]\n\tlsl\tr0, r0, #0x10\n\torr\tr2, r2, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t LoadWordFromTwoHalfwords,.Lfe1-LoadWordFromTwoHalfwords\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"LoadWordFromTwoHalfwords\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name LoadWordFromTwoHalfwords # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -8896,7 +8958,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Div16` — benchmark function pokeemerald:MathUtil_Div16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16\n\t.type\t MathUtil_Div16,function\n\t.thumb_func\nMathUtil_Div16:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16,.Lfe1-MathUtil_Div16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Div16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Div16` — benchmark function pokeemerald:MathUtil_Div16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Div16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16\n\t.type\t MathUtil_Div16,function\n\t.thumb_func\nMathUtil_Div16:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16,.Lfe1-MathUtil_Div16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Div16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Div16` — benchmark function pokeemerald:MathUtil_Div16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Div16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16\n\t.type\t MathUtil_Div16,function\n\t.thumb_func\nMathUtil_Div16:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16,.Lfe1-MathUtil_Div16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Div16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -8984,7 +9046,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Div16Shift` — benchmark function pokeemerald:MathUtil_Div16Shift:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16Shift\n\t.type\t MathUtil_Div16Shift,function\n\t.thumb_func\nMathUtil_Div16Shift:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr0, r1, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr1, r2, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr0, r0, r3\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16Shift,.Lfe1-MathUtil_Div16Shift\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Div16Shift # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Div16Shift` — benchmark function pokeemerald:MathUtil_Div16Shift:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Div16Shift:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16Shift\n\t.type\t MathUtil_Div16Shift,function\n\t.thumb_func\nMathUtil_Div16Shift:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr0, r1, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr1, r2, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr0, r0, r3\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16Shift,.Lfe1-MathUtil_Div16Shift\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Div16Shift # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Div16Shift` — benchmark function pokeemerald:MathUtil_Div16Shift:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Div16Shift:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16Shift\n\t.type\t MathUtil_Div16Shift,function\n\t.thumb_func\nMathUtil_Div16Shift:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr0, r1, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr1, r2, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr0, r0, r3\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16Shift,.Lfe1-MathUtil_Div16Shift\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Div16Shift # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -9058,7 +9120,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Inv16` — benchmark function pokeemerald:MathUtil_Inv16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Inv16\n\t.type\t MathUtil_Inv16,function\n\t.thumb_func\nMathUtil_Inv16:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Inv16,.Lfe1-MathUtil_Inv16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Inv16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Inv16` — benchmark function pokeemerald:MathUtil_Inv16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Inv16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Inv16\n\t.type\t MathUtil_Inv16,function\n\t.thumb_func\nMathUtil_Inv16:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Inv16,.Lfe1-MathUtil_Inv16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Inv16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Inv16` — benchmark function pokeemerald:MathUtil_Inv16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Inv16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Inv16\n\t.type\t MathUtil_Inv16,function\n\t.thumb_func\nMathUtil_Inv16:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Inv16,.Lfe1-MathUtil_Inv16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Inv16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -9133,7 +9195,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Mul16` — benchmark function pokeemerald:MathUtil_Mul16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16\n\t.type\t MathUtil_Mul16,function\n\t.thumb_func\nMathUtil_Mul16:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MathUtil_Mul16,.Lfe1-MathUtil_Mul16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Mul16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Mul16` — benchmark function pokeemerald:MathUtil_Mul16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Mul16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16\n\t.type\t MathUtil_Mul16,function\n\t.thumb_func\nMathUtil_Mul16:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MathUtil_Mul16,.Lfe1-MathUtil_Mul16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Mul16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Mul16` — benchmark function pokeemerald:MathUtil_Mul16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Mul16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16\n\t.type\t MathUtil_Mul16,function\n\t.thumb_func\nMathUtil_Mul16:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MathUtil_Mul16,.Lfe1-MathUtil_Mul16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Mul16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -9221,7 +9283,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Mul16Shift` — benchmark function pokeemerald:MathUtil_Mul16Shift:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16Shift\n\t.type\t MathUtil_Mul16Shift,function\n\t.thumb_func\nMathUtil_Mul16Shift:\n\tpush\t{lr}\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr3, r3, #0x10\n\tasr\tr3, r3, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tmul\tr3, r3, r2\n\tmov\tr1, #0x1\n\tlsl\tr1, r1, r0\n\tadd\tr0, r3, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul16Shift,.Lfe1-MathUtil_Mul16Shift\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Mul16Shift # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Mul16Shift` — benchmark function pokeemerald:MathUtil_Mul16Shift:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Mul16Shift:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16Shift\n\t.type\t MathUtil_Mul16Shift,function\n\t.thumb_func\nMathUtil_Mul16Shift:\n\tpush\t{lr}\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr3, r3, #0x10\n\tasr\tr3, r3, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tmul\tr3, r3, r2\n\tmov\tr1, #0x1\n\tlsl\tr1, r1, r0\n\tadd\tr0, r3, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul16Shift,.Lfe1-MathUtil_Mul16Shift\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Mul16Shift # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Mul16Shift` — benchmark function pokeemerald:MathUtil_Mul16Shift:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Mul16Shift:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16Shift\n\t.type\t MathUtil_Mul16Shift,function\n\t.thumb_func\nMathUtil_Mul16Shift:\n\tpush\t{lr}\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr3, r3, #0x10\n\tasr\tr3, r3, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tmul\tr3, r3, r2\n\tmov\tr1, #0x1\n\tlsl\tr1, r1, r0\n\tadd\tr0, r3, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul16Shift,.Lfe1-MathUtil_Mul16Shift\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Mul16Shift # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -9247,7 +9309,7 @@ "decompiler": "asmlift", "symbolMap": true, "outcome": "declined", - "source": "s32 MathUtil_Mul32(s32 a0, s32 a1) {\n s32 v0;\n s32 v1;\n v0 = __muldi3(a0, a0 >> 31, a1, a1 >> 31);\n if (a0 >> 31 >= 0) {\n v1 = a0 >> 31;\n } else {\n v0 = 255 + v0;\n v1 = ASMLIFT_ERROR(\"unmodelled instruction 'adc'\", 0, a0 >> 31);\n }\n return v1 << 24 | v0 >> 8;\n}\n", + "source": "s32 MathUtil_Mul32(s32 a0, s32 a1) {\n s32 v0;\n s32 v1;\n v0 = __muldi3(a0, a0 >> 31, a1, a1 >> 31);\n if (a0 >> 31 >= 0) {\n v1 = a0 >> 31;\n } else {\n v0 = 255 + v0;\n v1 = ASMLIFT_ERROR(\"unmodelled instruction 'adc'\", 0, a0 >> 31);\n }\n return v1 << 24 | (u32)v0 >> 8;\n}\n", "score": null, "maxScore": null, "compileErrors": null, @@ -9255,7 +9317,7 @@ "score": 88, "lines": 12, "gotos": 0, - "casts": 0, + "casts": 1, "unkGlue": 1, "rawMem": 0, "addrDeref": 0 @@ -9287,7 +9349,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Mul32` — benchmark function pokeemerald:MathUtil_Mul32:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul32\n\t.type\t MathUtil_Mul32,function\n\t.thumb_func\nMathUtil_Mul32:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r1, #0\n\tadd\tr4, r0, #0\n\tasr\tr5, r0, #0x1f\n\tasr\tr3, r2, #0x1f\n\tadd\tr1, r5, #0\n\tadd\tr0, r4, #0\n\tbl\t__muldi3\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr7, r5, #0\n\tadd\tr6, r4, #0\n\tcmp\tr5, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr6, #0xff\n\tmov\tr7, #0\n\tadd\tr6, r6, r4\n\tadc\tr7, r7, r5\n.L3:\n\tlsl\tr3, r7, #0x18\n\tlsr\tr2, r6, #0x8\n\tadd\tr0, r3, #0\n\torr\tr0, r0, r2\n\tasr\tr1, r7, #0x8\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul32,.Lfe1-MathUtil_Mul32\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Mul32 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Mul32` — benchmark function pokeemerald:MathUtil_Mul32:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Mul32:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul32\n\t.type\t MathUtil_Mul32,function\n\t.thumb_func\nMathUtil_Mul32:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r1, #0\n\tadd\tr4, r0, #0\n\tasr\tr5, r0, #0x1f\n\tasr\tr3, r2, #0x1f\n\tadd\tr1, r5, #0\n\tadd\tr0, r4, #0\n\tbl\t__muldi3\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr7, r5, #0\n\tadd\tr6, r4, #0\n\tcmp\tr5, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr6, #0xff\n\tmov\tr7, #0\n\tadd\tr6, r6, r4\n\tadc\tr7, r7, r5\n.L3:\n\tlsl\tr3, r7, #0x18\n\tlsr\tr2, r6, #0x8\n\tadd\tr0, r3, #0\n\torr\tr0, r0, r2\n\tasr\tr1, r7, #0x8\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul32,.Lfe1-MathUtil_Mul32\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Mul32 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Mul32` — benchmark function pokeemerald:MathUtil_Mul32:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Mul32:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul32\n\t.type\t MathUtil_Mul32,function\n\t.thumb_func\nMathUtil_Mul32:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r1, #0\n\tadd\tr4, r0, #0\n\tasr\tr5, r0, #0x1f\n\tasr\tr3, r2, #0x1f\n\tadd\tr1, r5, #0\n\tadd\tr0, r4, #0\n\tbl\t__muldi3\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr7, r5, #0\n\tadd\tr6, r4, #0\n\tcmp\tr5, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr6, #0xff\n\tmov\tr7, #0\n\tadd\tr6, r6, r4\n\tadc\tr7, r7, r5\n.L3:\n\tlsl\tr3, r7, #0x18\n\tlsr\tr2, r6, #0x8\n\tadd\tr0, r3, #0\n\torr\tr0, r0, r2\n\tasr\tr1, r7, #0x8\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul32,.Lfe1-MathUtil_Mul32\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Mul32 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -9322,16 +9384,16 @@ } ], "outcome": "nonmatch", - "source": "s32 ModifyStatByNature(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n s32 v1;\n if ((a2 << 24) + (255 << 24) >> 24 > 4) {\n return (u16)a1;\n } else {\n v0 = gNatureStatTable[(u8)a2 + ((u8)a0 * 5 - 1)];\n switch ((s8)v0) {\n case -1:\n v1 = 90;\n return (u16)((u16)(v1 * (u16)a1) / 100);\n case 1:\n v1 = 110;\n return (u16)((u16)(v1 * (u16)a1) / 100);\n default:\n return (u16)a1;\n }\n }\n}\n", - "score": 47, - "maxScore": 60, + "source": "s32 ModifyStatByNature(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n s32 v1;\n if ((a2 << 24) + (255 << 24) >> 24 > 4) {\n return (u16)a1;\n } else {\n v0 = gNatureStatTable[0][(u8)a2 + ((u8)a0 * 5 - 1)];\n switch ((s8)v0) {\n case -1:\n v1 = 90;\n return (u16)((u16)(v1 * (u16)a1) / 100);\n case 1:\n v1 = 110;\n return (u16)((u16)(v1 * (u16)a1) / 100);\n default:\n return (u16)a1;\n }\n }\n}\n", + "score": 40, + "maxScore": 56, "compileErrors": null, "breakdown": { - "insert": 14, - "delete": 10, - "replace": 14, + "insert": 10, + "delete": 8, + "replace": 8, "opMismatch": 2, - "argMismatch": 7 + "argMismatch": 12 }, "quality": { "score": 84, @@ -9382,7 +9444,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `ModifyStatByNature` — benchmark function pokeemerald:ModifyStatByNature:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tModifyStatByNature\n\t.type\t ModifyStatByNature,function\n\t.thumb_func\nModifyStatByNature:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr0, #0xff\n\tlsl\tr0, r0, #0x18\n\tadd\tr2, r2, r0\n\tlsr\tr2, r2, #0x18\n\tcmp\tr2, #0x4\n\tbls\t.L3\t@cond_branch\n\tadd\tr0, r3, #0\n\tb\t.L9\n.L3:\n\tldr\tr0, .L11\n\tlsl\tr1, r4, #0x2\n\tadd\tr1, r1, r4\n\tsub\tr1, r1, #0x1\n\tadd\tr1, r5, r1\n\tadd\tr1, r1, r0\n\tldrb\tr1, [r1, #0]\n\tlsl\tr1, r1, #24\n\tasr\tr1, r1, #24\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr1, r0\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbne\t.L7\t@cond_branch\n\tmov\tr0, #0x6e\n\tb\t.L10\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\tgNatureStatTable\n.L6:\n\tmov\tr0, #0x5a\n.L10:\n\tmul\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tmov\tr1, #0x64\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L9\n.L7:\n\tadd\tr0, r3, #0\n.L9:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ModifyStatByNature,.Lfe1-ModifyStatByNature\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu16 ModifyStatByNature(u8 nature, u16 stat, u8 statIndex);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ModifyStatByNature # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ModifyStatByNature` — benchmark function pokeemerald:ModifyStatByNature:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:ModifyStatByNature:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tModifyStatByNature\n\t.type\t ModifyStatByNature,function\n\t.thumb_func\nModifyStatByNature:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr0, #0xff\n\tlsl\tr0, r0, #0x18\n\tadd\tr2, r2, r0\n\tlsr\tr2, r2, #0x18\n\tcmp\tr2, #0x4\n\tbls\t.L3\t@cond_branch\n\tadd\tr0, r3, #0\n\tb\t.L9\n.L3:\n\tldr\tr0, .L11\n\tlsl\tr1, r4, #0x2\n\tadd\tr1, r1, r4\n\tsub\tr1, r1, #0x1\n\tadd\tr1, r5, r1\n\tadd\tr1, r1, r0\n\tldrb\tr1, [r1, #0]\n\tlsl\tr1, r1, #24\n\tasr\tr1, r1, #24\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr1, r0\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbne\t.L7\t@cond_branch\n\tmov\tr0, #0x6e\n\tb\t.L10\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\tgNatureStatTable\n.L6:\n\tmov\tr0, #0x5a\n.L10:\n\tmul\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tmov\tr1, #0x64\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L9\n.L7:\n\tadd\tr0, r3, #0\n.L9:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ModifyStatByNature,.Lfe1-ModifyStatByNature\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ModifyStatByNature # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ModifyStatByNature` — benchmark function pokeemerald:ModifyStatByNature:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:ModifyStatByNature:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tModifyStatByNature\n\t.type\t ModifyStatByNature,function\n\t.thumb_func\nModifyStatByNature:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr0, #0xff\n\tlsl\tr0, r0, #0x18\n\tadd\tr2, r2, r0\n\tlsr\tr2, r2, #0x18\n\tcmp\tr2, #0x4\n\tbls\t.L3\t@cond_branch\n\tadd\tr0, r3, #0\n\tb\t.L9\n.L3:\n\tldr\tr0, .L11\n\tlsl\tr1, r4, #0x2\n\tadd\tr1, r1, r4\n\tsub\tr1, r1, #0x1\n\tadd\tr1, r5, r1\n\tadd\tr1, r1, r0\n\tldrb\tr1, [r1, #0]\n\tlsl\tr1, r1, #24\n\tasr\tr1, r1, #24\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr1, r0\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbne\t.L7\t@cond_branch\n\tmov\tr0, #0x6e\n\tb\t.L10\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\tgNatureStatTable\n.L6:\n\tmov\tr0, #0x5a\n.L10:\n\tmul\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tmov\tr1, #0x64\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L9\n.L7:\n\tadd\tr0, r3, #0\n.L9:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ModifyStatByNature,.Lfe1-ModifyStatByNature\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ModifyStatByNature # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -9463,7 +9525,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `PutFirstMemBlockHeader` — benchmark function pokeemerald:PutFirstMemBlockHeader:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutFirstMemBlockHeader\n\t.type\t PutFirstMemBlockHeader,function\n\t.thumb_func\nPutFirstMemBlockHeader:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr3, r3, #0x10\n\tadd\tr1, r2, #0\n\tbl\tPutMemBlockHeader\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t PutFirstMemBlockHeader,.Lfe1-PutFirstMemBlockHeader\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-92d4b72c07b6.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid PutFirstMemBlockHeader(void *block, u32 size);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function PutFirstMemBlockHeader # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `PutFirstMemBlockHeader` — benchmark function pokeemerald:PutFirstMemBlockHeader:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:PutFirstMemBlockHeader:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutFirstMemBlockHeader\n\t.type\t PutFirstMemBlockHeader,function\n\t.thumb_func\nPutFirstMemBlockHeader:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr3, r3, #0x10\n\tadd\tr1, r2, #0\n\tbl\tPutMemBlockHeader\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t PutFirstMemBlockHeader,.Lfe1-PutFirstMemBlockHeader\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"PutFirstMemBlockHeader\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name PutFirstMemBlockHeader # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `PutFirstMemBlockHeader` — benchmark function pokeemerald:PutFirstMemBlockHeader:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:PutFirstMemBlockHeader:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutFirstMemBlockHeader\n\t.type\t PutFirstMemBlockHeader,function\n\t.thumb_func\nPutFirstMemBlockHeader:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr3, r3, #0x10\n\tadd\tr1, r2, #0\n\tbl\tPutMemBlockHeader\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t PutFirstMemBlockHeader,.Lfe1-PutFirstMemBlockHeader\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"PutFirstMemBlockHeader\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name PutFirstMemBlockHeader # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -9543,7 +9605,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `PutMemBlockHeader` — benchmark function pokeemerald:PutMemBlockHeader:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutMemBlockHeader\n\t.type\t PutMemBlockHeader,function\n\t.thumb_func\nPutMemBlockHeader:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr4, .L3\n\tstrh\tr4, [r0, #0x2]\n\tstr\tr3, [r0, #0x4]\n\tstr\tr1, [r0, #0x8]\n\tstr\tr2, [r0, #0xc]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xa3a3\n.Lfe1:\n\t.size\t PutMemBlockHeader,.Lfe1-PutMemBlockHeader\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function PutMemBlockHeader # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `PutMemBlockHeader` — benchmark function pokeemerald:PutMemBlockHeader:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:PutMemBlockHeader:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutMemBlockHeader\n\t.type\t PutMemBlockHeader,function\n\t.thumb_func\nPutMemBlockHeader:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr4, .L3\n\tstrh\tr4, [r0, #0x2]\n\tstr\tr3, [r0, #0x4]\n\tstr\tr1, [r0, #0x8]\n\tstr\tr2, [r0, #0xc]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xa3a3\n.Lfe1:\n\t.size\t PutMemBlockHeader,.Lfe1-PutMemBlockHeader\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"PutMemBlockHeader\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name PutMemBlockHeader # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `PutMemBlockHeader` — benchmark function pokeemerald:PutMemBlockHeader:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:PutMemBlockHeader:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutMemBlockHeader\n\t.type\t PutMemBlockHeader,function\n\t.thumb_func\nPutMemBlockHeader:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr4, .L3\n\tstrh\tr4, [r0, #0x2]\n\tstr\tr3, [r0, #0x4]\n\tstr\tr1, [r0, #0x8]\n\tstr\tr2, [r0, #0xc]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xa3a3\n.Lfe1:\n\t.size\t PutMemBlockHeader,.Lfe1-PutMemBlockHeader\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"PutMemBlockHeader\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name PutMemBlockHeader # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -9579,15 +9641,15 @@ "shape": "scalar u32" } ], - "outcome": "nonmatch", - "source": "s32 Random(void) {\n s32 v0;\n v0 = gRngValue;\n gRngValue = 1103515245 * v0 + 24691;\n sRandCount = sRandCount + 1;\n return 1103515245 * v0 + 24691 >> 16;\n}\n", - "score": 1, + "outcome": "match", + "source": "s32 Random(void) {\n s32 v0;\n v0 = gRngValue;\n gRngValue = 1103515245 * v0 + 24691;\n sRandCount = sRandCount + 1;\n return (u32)(1103515245 * v0 + 24691) >> 16;\n}\n", + "score": 0, "maxScore": 18, "compileErrors": null, "breakdown": { "insert": 0, "delete": 0, - "replace": 1, + "replace": 0, "opMismatch": 0, "argMismatch": 0 }, @@ -9595,7 +9657,7 @@ "score": 100, "lines": 7, "gotos": 0, - "casts": 1, + "casts": 2, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -9625,22 +9687,10 @@ "addrDeref": 0 } }, - "gapSize": { - "decompiler": "asmlift", - "score": 1, - "maxScore": 18, - "ratio": 0.05555555555555555, - "kinds": { - "insert": 0, - "delete": 0, - "replace": 1, - "opMismatch": 0, - "argMismatch": 0 - } - }, + "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `Random` — benchmark function pokeemerald:Random:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tldr\tr2, .L3+0xc\n\tldr\tr1, [r2]\n\tadd\tr1, r1, #0x1\n\tstr\tr1, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x6073\n\t.word\tsRandCount\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\n\t.lcomm\tsRandCount,4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Random # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `Random` — benchmark function pokeemerald:Random:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:Random:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tldr\tr2, .L3+0xc\n\tldr\tr1, [r2]\n\tadd\tr1, r1, #0x1\n\tstr\tr1, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x6073\n\t.word\tsRandCount\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\n\t.lcomm\tsRandCount,4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Random # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `Random` — benchmark function pokeemerald:Random:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:Random:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tldr\tr2, .L3+0xc\n\tldr\tr1, [r2]\n\tadd\tr1, r1, #0x1\n\tstr\tr1, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x6073\n\t.word\tsRandCount\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\n\t.lcomm\tsRandCount,4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Random # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -9714,7 +9764,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `SetupBytecodeScript` — benchmark function pokeemerald:SetupBytecodeScript:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSetupBytecodeScript\n\t.type\t SetupBytecodeScript,function\n\t.thumb_func\nSetupBytecodeScript:\n\tstr\tr1, [r0, #0x8]\n\tmov\tr1, #0x1\n\tstrb\tr1, [r0, #0x1]\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t SetupBytecodeScript,.Lfe1-SetupBytecodeScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function SetupBytecodeScript # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `SetupBytecodeScript` — benchmark function pokeemerald:SetupBytecodeScript:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:SetupBytecodeScript:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSetupBytecodeScript\n\t.type\t SetupBytecodeScript,function\n\t.thumb_func\nSetupBytecodeScript:\n\tstr\tr1, [r0, #0x8]\n\tmov\tr1, #0x1\n\tstrb\tr1, [r0, #0x1]\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t SetupBytecodeScript,.Lfe1-SetupBytecodeScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name SetupBytecodeScript # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `SetupBytecodeScript` — benchmark function pokeemerald:SetupBytecodeScript:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:SetupBytecodeScript:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSetupBytecodeScript\n\t.type\t SetupBytecodeScript,function\n\t.thumb_func\nSetupBytecodeScript:\n\tstr\tr1, [r0, #0x8]\n\tmov\tr1, #0x1\n\tstrb\tr1, [r0, #0x1]\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t SetupBytecodeScript,.Lfe1-SetupBytecodeScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name SetupBytecodeScript # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -9809,7 +9859,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `Sin2` — benchmark function pokeemerald:Sin2:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSin2\n\t.type\t Sin2,function\n\t.thumb_func\nSin2:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__umodsi3\n\tadd\tr4, r0, #0\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__udivsi3\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldr\tr1, .L8\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r1\n\tldrh\tr1, [r4]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tlsl\tr0, r1, #0x10\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgSineDegreeTable\n.L3:\n\tlsl\tr0, r1, #0x10\n\tneg\tr0, r0\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sin2,.Lfe1-Sin2\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-3b544fd3decb.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns16 Sin2(u16 angle);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Sin2 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `Sin2` — benchmark function pokeemerald:Sin2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:Sin2:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSin2\n\t.type\t Sin2,function\n\t.thumb_func\nSin2:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__umodsi3\n\tadd\tr4, r0, #0\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__udivsi3\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldr\tr1, .L8\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r1\n\tldrh\tr1, [r4]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tlsl\tr0, r1, #0x10\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgSineDegreeTable\n.L3:\n\tlsl\tr0, r1, #0x10\n\tneg\tr0, r0\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sin2,.Lfe1-Sin2\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Sin2 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `Sin2` — benchmark function pokeemerald:Sin2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:Sin2:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSin2\n\t.type\t Sin2,function\n\t.thumb_func\nSin2:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__umodsi3\n\tadd\tr4, r0, #0\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__udivsi3\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldr\tr1, .L8\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r1\n\tldrh\tr1, [r4]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tlsl\tr0, r1, #0x10\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgSineDegreeTable\n.L3:\n\tlsl\tr0, r1, #0x10\n\tneg\tr0, r0\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sin2,.Lfe1-Sin2\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Sin2 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -9889,7 +9939,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `StopScript` — benchmark function pokeemerald:StopScript:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStopScript\n\t.type\t StopScript,function\n\t.thumb_func\nStopScript:\n\tmov\tr1, #0x0\n\tstrb\tr1, [r0, #0x1]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t StopScript,.Lfe1-StopScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StopScript # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StopScript` — benchmark function pokeemerald:StopScript:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StopScript:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStopScript\n\t.type\t StopScript,function\n\t.thumb_func\nStopScript:\n\tmov\tr1, #0x0\n\tstrb\tr1, [r0, #0x1]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t StopScript,.Lfe1-StopScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StopScript\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StopScript # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StopScript` — benchmark function pokeemerald:StopScript:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StopScript:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStopScript\n\t.type\t StopScript,function\n\t.thumb_func\nStopScript:\n\tmov\tr1, #0x0\n\tstrb\tr1, [r0, #0x1]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t StopScript,.Lfe1-StopScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StopScript\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StopScript # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -9969,7 +10019,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `StoreWordInTwoHalfwords` — benchmark function pokeemerald:StoreWordInTwoHalfwords:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStoreWordInTwoHalfwords\n\t.type\t StoreWordInTwoHalfwords,function\n\t.thumb_func\nStoreWordInTwoHalfwords:\n\tstrh\tr1, [r0]\n\tlsr\tr1, r1, #0x10\n\tstrh\tr1, [r0, #0x2]\n\tbx\tlr\n.Lfe1:\n\t.size\t StoreWordInTwoHalfwords,.Lfe1-StoreWordInTwoHalfwords\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StoreWordInTwoHalfwords # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StoreWordInTwoHalfwords` — benchmark function pokeemerald:StoreWordInTwoHalfwords:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StoreWordInTwoHalfwords:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStoreWordInTwoHalfwords\n\t.type\t StoreWordInTwoHalfwords,function\n\t.thumb_func\nStoreWordInTwoHalfwords:\n\tstrh\tr1, [r0]\n\tlsr\tr1, r1, #0x10\n\tstrh\tr1, [r0, #0x2]\n\tbx\tlr\n.Lfe1:\n\t.size\t StoreWordInTwoHalfwords,.Lfe1-StoreWordInTwoHalfwords\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StoreWordInTwoHalfwords\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StoreWordInTwoHalfwords # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StoreWordInTwoHalfwords` — benchmark function pokeemerald:StoreWordInTwoHalfwords:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StoreWordInTwoHalfwords:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStoreWordInTwoHalfwords\n\t.type\t StoreWordInTwoHalfwords,function\n\t.thumb_func\nStoreWordInTwoHalfwords:\n\tstrh\tr1, [r0]\n\tlsr\tr1, r1, #0x10\n\tstrh\tr1, [r0, #0x2]\n\tbx\tlr\n.Lfe1:\n\t.size\t StoreWordInTwoHalfwords,.Lfe1-StoreWordInTwoHalfwords\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StoreWordInTwoHalfwords\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StoreWordInTwoHalfwords # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -10046,7 +10096,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `StringAppend` — benchmark function pokeemerald:StringAppend:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringAppend\n\t.type\t StringAppend,function\n\t.thumb_func\nStringAppend:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n.L7:\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tStringCopy\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringAppend,.Lfe1-StringAppend\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-9801ce0c65ce.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 *StringAppend(u8 *dest, const u8 *src);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringAppend # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StringAppend` — benchmark function pokeemerald:StringAppend:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringAppend:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringAppend\n\t.type\t StringAppend,function\n\t.thumb_func\nStringAppend:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n.L7:\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tStringCopy\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringAppend,.Lfe1-StringAppend\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringAppend # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StringAppend` — benchmark function pokeemerald:StringAppend:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringAppend:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringAppend\n\t.type\t StringAppend,function\n\t.thumb_func\nStringAppend:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n.L7:\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tStringCopy\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringAppend,.Lfe1-StringAppend\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringAppend # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -10128,7 +10178,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `StringCompare` — benchmark function pokeemerald:StringCompare:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompare\n\t.type\t StringCompare,function\n\t.thumb_func\nStringCompare:\n\tadd\tr2, r0, #0\n\tb\t.L9\n.L5:\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L6:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L9:\n\tldrb\tr0, [r2]\n\tldrb\tr3, [r1]\n\tcmp\tr0, r3\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L8:\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCompare,.Lfe1-StringCompare\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringCompare # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StringCompare` — benchmark function pokeemerald:StringCompare:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCompare:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompare\n\t.type\t StringCompare,function\n\t.thumb_func\nStringCompare:\n\tadd\tr2, r0, #0\n\tb\t.L9\n.L5:\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L6:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L9:\n\tldrb\tr0, [r2]\n\tldrb\tr3, [r1]\n\tcmp\tr0, r3\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L8:\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCompare,.Lfe1-StringCompare\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCompare # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StringCompare` — benchmark function pokeemerald:StringCompare:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCompare:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompare\n\t.type\t StringCompare,function\n\t.thumb_func\nStringCompare:\n\tadd\tr2, r0, #0\n\tb\t.L9\n.L5:\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L6:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L9:\n\tldrb\tr0, [r2]\n\tldrb\tr3, [r1]\n\tcmp\tr0, r3\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L8:\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCompare,.Lfe1-StringCompare\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCompare # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -10204,7 +10254,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `StringCompareN` — benchmark function pokeemerald:StringCompareN:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompareN\n\t.type\t StringCompareN,function\n\t.thumb_func\nStringCompareN:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tb\t.L3\n.L5:\n\tcmp\tr0, #0xff\n\tbeq\t.L10\t@cond_branch\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n.L10:\n\tmov\tr0, #0x0\n\tb\t.L9\n.L3:\n\tldrb\tr0, [r3]\n\tldrb\tr4, [r1]\n\tcmp\tr0, r4\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r3]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L9:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCompareN,.Lfe1-StringCompareN\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringCompareN # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StringCompareN` — benchmark function pokeemerald:StringCompareN:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCompareN:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompareN\n\t.type\t StringCompareN,function\n\t.thumb_func\nStringCompareN:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tb\t.L3\n.L5:\n\tcmp\tr0, #0xff\n\tbeq\t.L10\t@cond_branch\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n.L10:\n\tmov\tr0, #0x0\n\tb\t.L9\n.L3:\n\tldrb\tr0, [r3]\n\tldrb\tr4, [r1]\n\tcmp\tr0, r4\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r3]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L9:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCompareN,.Lfe1-StringCompareN\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCompareN # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StringCompareN` — benchmark function pokeemerald:StringCompareN:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCompareN:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompareN\n\t.type\t StringCompareN,function\n\t.thumb_func\nStringCompareN:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tb\t.L3\n.L5:\n\tcmp\tr0, #0xff\n\tbeq\t.L10\t@cond_branch\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n.L10:\n\tmov\tr0, #0x0\n\tb\t.L9\n.L3:\n\tldrb\tr0, [r3]\n\tldrb\tr4, [r1]\n\tcmp\tr0, r4\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r3]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L9:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCompareN,.Lfe1-StringCompareN\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCompareN # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -10279,7 +10329,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `StringCopy` — benchmark function pokeemerald:StringCopy:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopy\n\t.type\t StringCopy,function\n\t.thumb_func\nStringCopy:\n\tadd\tr3, r0, #0\n\tb\t.L7\n.L5:\n\tstrb\tr2, [r3]\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr2, [r1]\n\tadd\tr0, r2, #0\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n\tstrb\tr0, [r3]\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCopy,.Lfe1-StringCopy\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringCopy # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StringCopy` — benchmark function pokeemerald:StringCopy:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCopy:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopy\n\t.type\t StringCopy,function\n\t.thumb_func\nStringCopy:\n\tadd\tr3, r0, #0\n\tb\t.L7\n.L5:\n\tstrb\tr2, [r3]\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr2, [r1]\n\tadd\tr0, r2, #0\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n\tstrb\tr0, [r3]\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCopy,.Lfe1-StringCopy\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCopy # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StringCopy` — benchmark function pokeemerald:StringCopy:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCopy:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopy\n\t.type\t StringCopy,function\n\t.thumb_func\nStringCopy:\n\tadd\tr3, r0, #0\n\tb\t.L7\n.L5:\n\tstrb\tr2, [r3]\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr2, [r1]\n\tadd\tr0, r2, #0\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n\tstrb\tr0, [r3]\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCopy,.Lfe1-StringCopy\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCopy # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -10362,7 +10412,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `StringCopyN` — benchmark function pokeemerald:StringCopyN:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopyN\n\t.type\t StringCopyN,function\n\t.thumb_func\nStringCopyN:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr3, #0x0\n\tadd\tr0, r5, #0\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tadd\tr1, r4, r3\n\tadd\tr0, r6, r3\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r2\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r4, r5\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCopyN,.Lfe1-StringCopyN\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringCopyN # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StringCopyN` — benchmark function pokeemerald:StringCopyN:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCopyN:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopyN\n\t.type\t StringCopyN,function\n\t.thumb_func\nStringCopyN:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr3, #0x0\n\tadd\tr0, r5, #0\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tadd\tr1, r4, r3\n\tadd\tr0, r6, r3\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r2\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r4, r5\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCopyN,.Lfe1-StringCopyN\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCopyN # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StringCopyN` — benchmark function pokeemerald:StringCopyN:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCopyN:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopyN\n\t.type\t StringCopyN,function\n\t.thumb_func\nStringCopyN:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr3, #0x0\n\tadd\tr0, r5, #0\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tadd\tr1, r4, r3\n\tadd\tr0, r6, r3\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r2\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r4, r5\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCopyN,.Lfe1-StringCopyN\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCopyN # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -10438,7 +10488,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `StringLength` — benchmark function pokeemerald:StringLength:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringLength\n\t.type\t StringLength,function\n\t.thumb_func\nStringLength:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tadd\tr0, r2, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringLength,.Lfe1-StringLength\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringLength # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StringLength` — benchmark function pokeemerald:StringLength:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringLength:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringLength\n\t.type\t StringLength,function\n\t.thumb_func\nStringLength:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tadd\tr0, r2, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringLength,.Lfe1-StringLength\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringLength # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `StringLength` — benchmark function pokeemerald:StringLength:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringLength:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringLength\n\t.type\t StringLength,function\n\t.thumb_func\nStringLength:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tadd\tr0, r2, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringLength,.Lfe1-StringLength\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringLength # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -10521,7 +10571,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `TranslateBigMonSizeTableIndex` — benchmark function pokeemerald:TranslateBigMonSizeTableIndex:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t2, 0\n\t.type\t sBigMonSizeTable,object\nsBigMonSizeTable:\n\t.short\t0x122\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0x0\n\t.space\t2\n\t.short\t0x12c\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xa\n\t.space\t2\n\t.short\t0x190\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0x6e\n\t.space\t2\n\t.short\t0x1f4\n\t.byte\t0x4\n\t.space\t1\n\t.short\t0x136\n\t.space\t2\n\t.short\t0x258\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0x2c6\n\t.space\t2\n\t.short\t0x2bc\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xa96\n\t.space\t2\n\t.short\t0x320\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0x1e1e\n\t.space\t2\n\t.short\t0x384\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x452e\n\t.space\t2\n\t.short\t0x3e8\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x7fc6\n\t.space\t2\n\t.short\t0x44c\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0xba5e\n\t.space\t2\n\t.short\t0x4b0\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xe16e\n\t.space\t2\n\t.short\t0x514\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0xf4f6\n\t.space\t2\n\t.short\t0x578\n\t.byte\t0x5\n\t.space\t1\n\t.short\t0xfcc6\n\t.space\t2\n\t.short\t0x5dc\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0xfeba\n\t.space\t2\n\t.short\t0x640\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xff82\n\t.space\t2\n\t.short\t0x6a4\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xffe6\n\t.space\t2\n\t.size\t sBigMonSizeTable,128\n.text\n\t.align\t2, 0\n\t.type\t TranslateBigMonSizeTableIndex,function\n\t.thumb_func\nTranslateBigMonSizeTableIndex:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tmov\tr1, #0x1\n\tldr\tr3, .L10\n.L6:\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x4]\n\tcmp\tr2, r0\n\tbcs\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tsBigMonSizeTable\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0xe\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r1, #0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t TranslateBigMonSizeTableIndex,.Lfe1-TranslateBigMonSizeTableIndex\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function TranslateBigMonSizeTableIndex # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `TranslateBigMonSizeTableIndex` — benchmark function pokeemerald:TranslateBigMonSizeTableIndex:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:TranslateBigMonSizeTableIndex:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t2, 0\n\t.type\t sBigMonSizeTable,object\nsBigMonSizeTable:\n\t.short\t0x122\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0x0\n\t.space\t2\n\t.short\t0x12c\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xa\n\t.space\t2\n\t.short\t0x190\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0x6e\n\t.space\t2\n\t.short\t0x1f4\n\t.byte\t0x4\n\t.space\t1\n\t.short\t0x136\n\t.space\t2\n\t.short\t0x258\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0x2c6\n\t.space\t2\n\t.short\t0x2bc\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xa96\n\t.space\t2\n\t.short\t0x320\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0x1e1e\n\t.space\t2\n\t.short\t0x384\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x452e\n\t.space\t2\n\t.short\t0x3e8\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x7fc6\n\t.space\t2\n\t.short\t0x44c\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0xba5e\n\t.space\t2\n\t.short\t0x4b0\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xe16e\n\t.space\t2\n\t.short\t0x514\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0xf4f6\n\t.space\t2\n\t.short\t0x578\n\t.byte\t0x5\n\t.space\t1\n\t.short\t0xfcc6\n\t.space\t2\n\t.short\t0x5dc\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0xfeba\n\t.space\t2\n\t.short\t0x640\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xff82\n\t.space\t2\n\t.short\t0x6a4\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xffe6\n\t.space\t2\n\t.size\t sBigMonSizeTable,128\n.text\n\t.align\t2, 0\n\t.type\t TranslateBigMonSizeTableIndex,function\n\t.thumb_func\nTranslateBigMonSizeTableIndex:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tmov\tr1, #0x1\n\tldr\tr3, .L10\n.L6:\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x4]\n\tcmp\tr2, r0\n\tbcs\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tsBigMonSizeTable\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0xe\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r1, #0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t TranslateBigMonSizeTableIndex,.Lfe1-TranslateBigMonSizeTableIndex\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name TranslateBigMonSizeTableIndex # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `TranslateBigMonSizeTableIndex` — benchmark function pokeemerald:TranslateBigMonSizeTableIndex:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:TranslateBigMonSizeTableIndex:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t2, 0\n\t.type\t sBigMonSizeTable,object\nsBigMonSizeTable:\n\t.short\t0x122\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0x0\n\t.space\t2\n\t.short\t0x12c\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xa\n\t.space\t2\n\t.short\t0x190\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0x6e\n\t.space\t2\n\t.short\t0x1f4\n\t.byte\t0x4\n\t.space\t1\n\t.short\t0x136\n\t.space\t2\n\t.short\t0x258\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0x2c6\n\t.space\t2\n\t.short\t0x2bc\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xa96\n\t.space\t2\n\t.short\t0x320\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0x1e1e\n\t.space\t2\n\t.short\t0x384\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x452e\n\t.space\t2\n\t.short\t0x3e8\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x7fc6\n\t.space\t2\n\t.short\t0x44c\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0xba5e\n\t.space\t2\n\t.short\t0x4b0\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xe16e\n\t.space\t2\n\t.short\t0x514\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0xf4f6\n\t.space\t2\n\t.short\t0x578\n\t.byte\t0x5\n\t.space\t1\n\t.short\t0xfcc6\n\t.space\t2\n\t.short\t0x5dc\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0xfeba\n\t.space\t2\n\t.short\t0x640\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xff82\n\t.space\t2\n\t.short\t0x6a4\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xffe6\n\t.space\t2\n\t.size\t sBigMonSizeTable,128\n.text\n\t.align\t2, 0\n\t.type\t TranslateBigMonSizeTableIndex,function\n\t.thumb_func\nTranslateBigMonSizeTableIndex:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tmov\tr1, #0x1\n\tldr\tr3, .L10\n.L6:\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x4]\n\tcmp\tr2, r0\n\tbcs\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tsBigMonSizeTable\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0xe\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r1, #0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t TranslateBigMonSizeTableIndex,.Lfe1-TranslateBigMonSizeTableIndex\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name TranslateBigMonSizeTableIndex # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -10596,7 +10646,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `AbsMax` — benchmark function sa3:AbsMax:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tAbsMax\n\t.type\t AbsMax,function\n\t.thumb_func\nAbsMax:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr2, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr2, r2\n.L3:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tneg\tr0, r0\n.L4:\n\tcmp\tr0, r2\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n.L6:\n\tbx\tlr\n.Lfe1:\n\t.size\t AbsMax,.Lfe1-AbsMax\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function AbsMax # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `AbsMax` — benchmark function sa3:AbsMax:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:AbsMax:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tAbsMax\n\t.type\t AbsMax,function\n\t.thumb_func\nAbsMax:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr2, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr2, r2\n.L3:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tneg\tr0, r0\n.L4:\n\tcmp\tr0, r2\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n.L6:\n\tbx\tlr\n.Lfe1:\n\t.size\t AbsMax,.Lfe1-AbsMax\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name AbsMax # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `AbsMax` — benchmark function sa3:AbsMax:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:AbsMax:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tAbsMax\n\t.type\t AbsMax,function\n\t.thumb_func\nAbsMax:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr2, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr2, r2\n.L3:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tneg\tr0, r0\n.L4:\n\tcmp\tr0, r2\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n.L6:\n\tbx\tlr\n.Lfe1:\n\t.size\t AbsMax,.Lfe1-AbsMax\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name AbsMax # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -10685,7 +10735,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `Base10DigitsToHexNibbles` — benchmark function sa3:Base10DigitsToHexNibbles:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tBase10DigitsToHexNibbles\n\t.type\t Base10DigitsToHexNibbles,function\n\t.thumb_func\nBase10DigitsToHexNibbles:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x0\n\tmov\tr5, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tmov\tr1, #0xa\n\tbl\tDiv\n\tlsl\tr1, r0, #0x2\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tsub\tr1, r4, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr0, r5, #0x2\n\tlsl\tr1, r1, r0\n\torr\tr6, r6, r1\n\tlsl\tr0, r6, #0x10\n\tlsr\tr6, r0, #0x10\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r6, #0\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Base10DigitsToHexNibbles,.Lfe1-Base10DigitsToHexNibbles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Base10DigitsToHexNibbles # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `Base10DigitsToHexNibbles` — benchmark function sa3:Base10DigitsToHexNibbles:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:Base10DigitsToHexNibbles:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tBase10DigitsToHexNibbles\n\t.type\t Base10DigitsToHexNibbles,function\n\t.thumb_func\nBase10DigitsToHexNibbles:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x0\n\tmov\tr5, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tmov\tr1, #0xa\n\tbl\tDiv\n\tlsl\tr1, r0, #0x2\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tsub\tr1, r4, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr0, r5, #0x2\n\tlsl\tr1, r1, r0\n\torr\tr6, r6, r1\n\tlsl\tr0, r6, #0x10\n\tlsr\tr6, r0, #0x10\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r6, #0\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Base10DigitsToHexNibbles,.Lfe1-Base10DigitsToHexNibbles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Base10DigitsToHexNibbles # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `Base10DigitsToHexNibbles` — benchmark function sa3:Base10DigitsToHexNibbles:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:Base10DigitsToHexNibbles:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tBase10DigitsToHexNibbles\n\t.type\t Base10DigitsToHexNibbles,function\n\t.thumb_func\nBase10DigitsToHexNibbles:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x0\n\tmov\tr5, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tmov\tr1, #0xa\n\tbl\tDiv\n\tlsl\tr1, r0, #0x2\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tsub\tr1, r4, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr0, r5, #0x2\n\tlsl\tr1, r1, r0\n\torr\tr6, r6, r1\n\tlsl\tr0, r6, #0x10\n\tlsr\tr6, r0, #0x10\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r6, #0\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Base10DigitsToHexNibbles,.Lfe1-Base10DigitsToHexNibbles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Base10DigitsToHexNibbles # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -10762,7 +10812,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `EwramFree` — benchmark function sa3:EwramFree:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramFree\n\t.type\t EwramFree,function\n\t.thumb_func\nEwramFree:\n\tpush\t{r4, lr}\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L12\n\tldr\tr0, [r0]\n\tcmp\tr0, r1\n\tbeq\t.L3\t@cond_branch\n\tsub\tr1, r1, #0x8\n\tldr\tr3, .L12+0x4\n\tadd\tr4, r3, #0\n\tcmp\tr1, r3\n\tbeq\t.L5\t@cond_branch\n.L7:\n\tadd\tr3, r4, #0\n\tldr\tr4, [r3]\n\tcmp\tr1, r4\n\tbne\t.L7\t@cond_branch\n.L5:\n\tldr\tr0, [r1, #0x4]\n\tcmp\tr0, #0\n\tbge\t.L9\t@cond_branch\n\tneg\tr0, r0\n\tstr\tr0, [r1, #0x4]\n.L9:\n\tldr\tr2, [r3, #0x4]\n\tadd\tr0, r3, r2\n\tcmp\tr0, r1\n\tbne\t.L10\t@cond_branch\n\tcmp\tr2, #0\n\tble\t.L10\t@cond_branch\n\tldr\tr0, [r4]\n\tstr\tr0, [r3]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr0, r2, r0\n\tstr\tr0, [r3, #0x4]\n\tadd\tr1, r3, #0\n.L10:\n\tldr\tr3, [r1, #0x4]\n\tadd\tr2, r1, r3\n\tldr\tr0, [r1]\n\tcmp\tr2, r0\n\tbne\t.L3\t@cond_branch\n\tldr\tr0, [r2, #0x4]\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tadd\tr0, r3, r0\n\tstr\tr0, [r1, #0x4]\n\tldr\tr0, [r2]\n\tstr\tr0, [r1]\n.L3:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tewram_end\n\t.word\tgEwramHeap\n.Lfe1:\n\t.size\t EwramFree,.Lfe1-EwramFree\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid EwramFree(void *p);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function EwramFree # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `EwramFree` — benchmark function sa3:EwramFree:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:EwramFree:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramFree\n\t.type\t EwramFree,function\n\t.thumb_func\nEwramFree:\n\tpush\t{r4, lr}\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L12\n\tldr\tr0, [r0]\n\tcmp\tr0, r1\n\tbeq\t.L3\t@cond_branch\n\tsub\tr1, r1, #0x8\n\tldr\tr3, .L12+0x4\n\tadd\tr4, r3, #0\n\tcmp\tr1, r3\n\tbeq\t.L5\t@cond_branch\n.L7:\n\tadd\tr3, r4, #0\n\tldr\tr4, [r3]\n\tcmp\tr1, r4\n\tbne\t.L7\t@cond_branch\n.L5:\n\tldr\tr0, [r1, #0x4]\n\tcmp\tr0, #0\n\tbge\t.L9\t@cond_branch\n\tneg\tr0, r0\n\tstr\tr0, [r1, #0x4]\n.L9:\n\tldr\tr2, [r3, #0x4]\n\tadd\tr0, r3, r2\n\tcmp\tr0, r1\n\tbne\t.L10\t@cond_branch\n\tcmp\tr2, #0\n\tble\t.L10\t@cond_branch\n\tldr\tr0, [r4]\n\tstr\tr0, [r3]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr0, r2, r0\n\tstr\tr0, [r3, #0x4]\n\tadd\tr1, r3, #0\n.L10:\n\tldr\tr3, [r1, #0x4]\n\tadd\tr2, r1, r3\n\tldr\tr0, [r1]\n\tcmp\tr2, r0\n\tbne\t.L3\t@cond_branch\n\tldr\tr0, [r2, #0x4]\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tadd\tr0, r3, r0\n\tstr\tr0, [r1, #0x4]\n\tldr\tr0, [r2]\n\tstr\tr0, [r1]\n.L3:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tewram_end\n\t.word\tgEwramHeap\n.Lfe1:\n\t.size\t EwramFree,.Lfe1-EwramFree\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"EwramFree\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EwramFree # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `EwramFree` — benchmark function sa3:EwramFree:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:EwramFree:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramFree\n\t.type\t EwramFree,function\n\t.thumb_func\nEwramFree:\n\tpush\t{r4, lr}\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L12\n\tldr\tr0, [r0]\n\tcmp\tr0, r1\n\tbeq\t.L3\t@cond_branch\n\tsub\tr1, r1, #0x8\n\tldr\tr3, .L12+0x4\n\tadd\tr4, r3, #0\n\tcmp\tr1, r3\n\tbeq\t.L5\t@cond_branch\n.L7:\n\tadd\tr3, r4, #0\n\tldr\tr4, [r3]\n\tcmp\tr1, r4\n\tbne\t.L7\t@cond_branch\n.L5:\n\tldr\tr0, [r1, #0x4]\n\tcmp\tr0, #0\n\tbge\t.L9\t@cond_branch\n\tneg\tr0, r0\n\tstr\tr0, [r1, #0x4]\n.L9:\n\tldr\tr2, [r3, #0x4]\n\tadd\tr0, r3, r2\n\tcmp\tr0, r1\n\tbne\t.L10\t@cond_branch\n\tcmp\tr2, #0\n\tble\t.L10\t@cond_branch\n\tldr\tr0, [r4]\n\tstr\tr0, [r3]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr0, r2, r0\n\tstr\tr0, [r3, #0x4]\n\tadd\tr1, r3, #0\n.L10:\n\tldr\tr3, [r1, #0x4]\n\tadd\tr2, r1, r3\n\tldr\tr0, [r1]\n\tcmp\tr2, r0\n\tbne\t.L3\t@cond_branch\n\tldr\tr0, [r2, #0x4]\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tadd\tr0, r3, r0\n\tstr\tr0, [r1, #0x4]\n\tldr\tr0, [r2]\n\tstr\tr0, [r1]\n.L3:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tewram_end\n\t.word\tgEwramHeap\n.Lfe1:\n\t.size\t EwramFree,.Lfe1-EwramFree\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"EwramFree\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EwramFree # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -10846,7 +10896,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `EwramInitHeap` — benchmark function sa3:EwramInitHeap:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramInitHeap\n\t.type\t EwramInitHeap,function\n\t.thumb_func\nEwramInitHeap:\n\tldr\tr0, .L3\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tldr\tr1, .L3+0x4\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgEwramHeap\n\t.word\t0x20080\n.Lfe1:\n\t.size\t EwramInitHeap,.Lfe1-EwramInitHeap\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid EwramInitHeap(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function EwramInitHeap # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `EwramInitHeap` — benchmark function sa3:EwramInitHeap:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:EwramInitHeap:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramInitHeap\n\t.type\t EwramInitHeap,function\n\t.thumb_func\nEwramInitHeap:\n\tldr\tr0, .L3\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tldr\tr1, .L3+0x4\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgEwramHeap\n\t.word\t0x20080\n.Lfe1:\n\t.size\t EwramInitHeap,.Lfe1-EwramInitHeap\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"EwramInitHeap\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EwramInitHeap # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `EwramInitHeap` — benchmark function sa3:EwramInitHeap:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:EwramInitHeap:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramInitHeap\n\t.type\t EwramInitHeap,function\n\t.thumb_func\nEwramInitHeap:\n\tldr\tr0, .L3\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tldr\tr1, .L3+0x4\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgEwramHeap\n\t.word\t0x20080\n.Lfe1:\n\t.size\t EwramInitHeap,.Lfe1-EwramInitHeap\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"EwramInitHeap\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EwramInitHeap # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -10918,7 +10968,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `EwramMalloc` — benchmark function sa3:EwramMalloc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramMalloc\n\t.type\t EwramMalloc,function\n\t.thumb_func\nEwramMalloc:\n\tadd\tr2, r0, #0\n\tadd\tr0, r2, #0x3\n\tlsr\tr2, r0, #0x2\n\tcmp\tr2, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r2, #0x2\n\tadd\tr2, r0, #0\n\tadd\tr2, r2, #0x8\n\tldr\tr3, .L14\n.L6:\n\tldr\tr1, [r3, #0x4]\n\tcmp\tr2, r1\n\tbhi\t.L7\t@cond_branch\n\tcmp\tr2, r1\n\tbne\t.L8\t@cond_branch\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgEwramHeap\n.L8:\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tcmp\tr0, r1\n\tbgt\t.L7\t@cond_branch\n\tadd\tr1, r3, r2\n\tldr\tr0, [r3]\n\tstr\tr0, [r1]\n\tldr\tr0, [r3, #0x4]\n\tsub\tr0, r0, r2\n\tstr\tr0, [r1, #0x4]\n\tstr\tr1, [r3]\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L7:\n\tldr\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr3, r0, #0\n\tb\t.L6\n.L3:\n\tldr\tr0, .L16\n\tldr\tr0, [r0]\n.L13:\n\tbx\tlr\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tewram_end\n.Lfe1:\n\t.size\t EwramMalloc,.Lfe1-EwramMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *EwramMalloc(u32 req);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function EwramMalloc # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `EwramMalloc` — benchmark function sa3:EwramMalloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:EwramMalloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramMalloc\n\t.type\t EwramMalloc,function\n\t.thumb_func\nEwramMalloc:\n\tadd\tr2, r0, #0\n\tadd\tr0, r2, #0x3\n\tlsr\tr2, r0, #0x2\n\tcmp\tr2, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r2, #0x2\n\tadd\tr2, r0, #0\n\tadd\tr2, r2, #0x8\n\tldr\tr3, .L14\n.L6:\n\tldr\tr1, [r3, #0x4]\n\tcmp\tr2, r1\n\tbhi\t.L7\t@cond_branch\n\tcmp\tr2, r1\n\tbne\t.L8\t@cond_branch\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgEwramHeap\n.L8:\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tcmp\tr0, r1\n\tbgt\t.L7\t@cond_branch\n\tadd\tr1, r3, r2\n\tldr\tr0, [r3]\n\tstr\tr0, [r1]\n\tldr\tr0, [r3, #0x4]\n\tsub\tr0, r0, r2\n\tstr\tr0, [r1, #0x4]\n\tstr\tr1, [r3]\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L7:\n\tldr\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr3, r0, #0\n\tb\t.L6\n.L3:\n\tldr\tr0, .L16\n\tldr\tr0, [r0]\n.L13:\n\tbx\tlr\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tewram_end\n.Lfe1:\n\t.size\t EwramMalloc,.Lfe1-EwramMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EwramMalloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `EwramMalloc` — benchmark function sa3:EwramMalloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:EwramMalloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramMalloc\n\t.type\t EwramMalloc,function\n\t.thumb_func\nEwramMalloc:\n\tadd\tr2, r0, #0\n\tadd\tr0, r2, #0x3\n\tlsr\tr2, r0, #0x2\n\tcmp\tr2, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r2, #0x2\n\tadd\tr2, r0, #0\n\tadd\tr2, r2, #0x8\n\tldr\tr3, .L14\n.L6:\n\tldr\tr1, [r3, #0x4]\n\tcmp\tr2, r1\n\tbhi\t.L7\t@cond_branch\n\tcmp\tr2, r1\n\tbne\t.L8\t@cond_branch\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgEwramHeap\n.L8:\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tcmp\tr0, r1\n\tbgt\t.L7\t@cond_branch\n\tadd\tr1, r3, r2\n\tldr\tr0, [r3]\n\tstr\tr0, [r1]\n\tldr\tr0, [r3, #0x4]\n\tsub\tr0, r0, r2\n\tstr\tr0, [r1, #0x4]\n\tstr\tr1, [r3]\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L7:\n\tldr\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr3, r0, #0\n\tb\t.L6\n.L3:\n\tldr\tr0, .L16\n\tldr\tr0, [r0]\n.L13:\n\tbx\tlr\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tewram_end\n.Lfe1:\n\t.size\t EwramMalloc,.Lfe1-EwramMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EwramMalloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -11008,7 +11058,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `GetInput` — benchmark function sa3:GetInput:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetInput\n\t.type\t GetInput,function\n\t.thumb_func\nGetInput:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tldr\tr7, .L16\n\tldr\tr0, .L16+0x4\n\tmov\tr9, r0\n\tldr\tr1, .L16+0x8\n\tmov\tr8, r1\n\tldr\tr4, .L16+0xc\n\tldr\tr0, .L16+0x10\n\tldrh\tr1, [r0]\n\tldr\tr2, .L16+0x14\n\tadd\tr0, r2, #0\n\tbic\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tldr\tr1, .L16+0x18\n\tstrh\tr0, [r1]\n\tldr\tr0, .L16+0x1c\n\tldrb\tr0, [r0, #0x8]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldrh\tr0, [r4]\n\tbl\tInputRecorderWrite\n\tb\t.L4\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgRepeatedKeysTestCounter\n\t.word\tgKeysFirstRepeatIntervals\n\t.word\tgKeysContinuedRepeatIntervals\n\t.word\tgInput\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgPhysicalInput\n\t.word\tgInputRecorder\n.L3:\n\tcmp\tr0, #0x2\n\tbne\t.L4\t@cond_branch\n\tbl\tInputRecorderRead\n\tstrh\tr0, [r4]\n.L4:\n\tldr\tr2, .L18\n\tldr\tr6, .L18+0x4\n\tldr\tr5, .L18+0x8\n\tldrh\tr3, [r6]\n\tldrh\tr4, [r5]\n\tadd\tr0, r3, #0\n\teor\tr0, r0, r4\n\tadd\tr1, r0, #0\n\tand\tr1, r1, r3\n\tstrh\tr1, [r2]\n\tldr\tr2, .L18+0xc\n\tand\tr0, r0, r4\n\tstrh\tr0, [r2]\n\tstrh\tr3, [r5]\n\tldr\tr0, .L18+0x10\n\tstrh\tr1, [r0]\n\tmov\tr1, #0x0\n\tmov\tip, r6\n\tmov\tr6, #0x1\n\tadd\tr5, r0, #0\n.L9:\n\tmov\tr3, ip\n\tldrh\tr0, [r3]\n\tlsl\tr1, r1, #0x18\n\tasr\tr2, r1, #0x18\n\tasr\tr0, r0, r2\n\tand\tr0, r0, r6\n\tadd\tr4, r1, #0\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tadd\tr0, r7, r2\n\tmov\tr3, r9\n\tadd\tr1, r3, r2\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r0]\n\tb\t.L8\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgPressedKeys\n\t.word\tgInput\n\t.word\tgPrevInput\n\t.word\tgReleasedKeys\n\t.word\tgRepeatedKeys\n.L10:\n\tadd\tr3, r7, r2\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tb\t.L15\n.L12:\n\tadd\tr0, r6, #0\n\tlsl\tr0, r0, r2\n\tldrh\tr1, [r5]\n\torr\tr0, r0, r1\n\tstrh\tr0, [r5]\n\tmov\tr1, r8\n\tadd\tr0, r1, r2\n\tldrb\tr0, [r0]\n.L15:\n\tstrb\tr0, [r3]\n.L8:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x11\n\tadd\tr0, r4, r2\n\tlsr\tr1, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tcmp\tr0, #0x9\n\tble\t.L9\t@cond_branch\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t GetInput,.Lfe1-GetInput\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-9580348e8bae.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid GetInput(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GetInput # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GetInput` — benchmark function sa3:GetInput:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:GetInput:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetInput\n\t.type\t GetInput,function\n\t.thumb_func\nGetInput:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tldr\tr7, .L16\n\tldr\tr0, .L16+0x4\n\tmov\tr9, r0\n\tldr\tr1, .L16+0x8\n\tmov\tr8, r1\n\tldr\tr4, .L16+0xc\n\tldr\tr0, .L16+0x10\n\tldrh\tr1, [r0]\n\tldr\tr2, .L16+0x14\n\tadd\tr0, r2, #0\n\tbic\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tldr\tr1, .L16+0x18\n\tstrh\tr0, [r1]\n\tldr\tr0, .L16+0x1c\n\tldrb\tr0, [r0, #0x8]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldrh\tr0, [r4]\n\tbl\tInputRecorderWrite\n\tb\t.L4\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgRepeatedKeysTestCounter\n\t.word\tgKeysFirstRepeatIntervals\n\t.word\tgKeysContinuedRepeatIntervals\n\t.word\tgInput\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgPhysicalInput\n\t.word\tgInputRecorder\n.L3:\n\tcmp\tr0, #0x2\n\tbne\t.L4\t@cond_branch\n\tbl\tInputRecorderRead\n\tstrh\tr0, [r4]\n.L4:\n\tldr\tr2, .L18\n\tldr\tr6, .L18+0x4\n\tldr\tr5, .L18+0x8\n\tldrh\tr3, [r6]\n\tldrh\tr4, [r5]\n\tadd\tr0, r3, #0\n\teor\tr0, r0, r4\n\tadd\tr1, r0, #0\n\tand\tr1, r1, r3\n\tstrh\tr1, [r2]\n\tldr\tr2, .L18+0xc\n\tand\tr0, r0, r4\n\tstrh\tr0, [r2]\n\tstrh\tr3, [r5]\n\tldr\tr0, .L18+0x10\n\tstrh\tr1, [r0]\n\tmov\tr1, #0x0\n\tmov\tip, r6\n\tmov\tr6, #0x1\n\tadd\tr5, r0, #0\n.L9:\n\tmov\tr3, ip\n\tldrh\tr0, [r3]\n\tlsl\tr1, r1, #0x18\n\tasr\tr2, r1, #0x18\n\tasr\tr0, r0, r2\n\tand\tr0, r0, r6\n\tadd\tr4, r1, #0\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tadd\tr0, r7, r2\n\tmov\tr3, r9\n\tadd\tr1, r3, r2\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r0]\n\tb\t.L8\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgPressedKeys\n\t.word\tgInput\n\t.word\tgPrevInput\n\t.word\tgReleasedKeys\n\t.word\tgRepeatedKeys\n.L10:\n\tadd\tr3, r7, r2\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tb\t.L15\n.L12:\n\tadd\tr0, r6, #0\n\tlsl\tr0, r0, r2\n\tldrh\tr1, [r5]\n\torr\tr0, r0, r1\n\tstrh\tr0, [r5]\n\tmov\tr1, r8\n\tadd\tr0, r1, r2\n\tldrb\tr0, [r0]\n.L15:\n\tstrb\tr0, [r3]\n.L8:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x11\n\tadd\tr0, r4, r2\n\tlsr\tr1, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tcmp\tr0, #0x9\n\tble\t.L9\t@cond_branch\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t GetInput,.Lfe1-GetInput\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GetInput\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetInput # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GetInput` — benchmark function sa3:GetInput:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:GetInput:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetInput\n\t.type\t GetInput,function\n\t.thumb_func\nGetInput:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tldr\tr7, .L16\n\tldr\tr0, .L16+0x4\n\tmov\tr9, r0\n\tldr\tr1, .L16+0x8\n\tmov\tr8, r1\n\tldr\tr4, .L16+0xc\n\tldr\tr0, .L16+0x10\n\tldrh\tr1, [r0]\n\tldr\tr2, .L16+0x14\n\tadd\tr0, r2, #0\n\tbic\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tldr\tr1, .L16+0x18\n\tstrh\tr0, [r1]\n\tldr\tr0, .L16+0x1c\n\tldrb\tr0, [r0, #0x8]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldrh\tr0, [r4]\n\tbl\tInputRecorderWrite\n\tb\t.L4\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgRepeatedKeysTestCounter\n\t.word\tgKeysFirstRepeatIntervals\n\t.word\tgKeysContinuedRepeatIntervals\n\t.word\tgInput\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgPhysicalInput\n\t.word\tgInputRecorder\n.L3:\n\tcmp\tr0, #0x2\n\tbne\t.L4\t@cond_branch\n\tbl\tInputRecorderRead\n\tstrh\tr0, [r4]\n.L4:\n\tldr\tr2, .L18\n\tldr\tr6, .L18+0x4\n\tldr\tr5, .L18+0x8\n\tldrh\tr3, [r6]\n\tldrh\tr4, [r5]\n\tadd\tr0, r3, #0\n\teor\tr0, r0, r4\n\tadd\tr1, r0, #0\n\tand\tr1, r1, r3\n\tstrh\tr1, [r2]\n\tldr\tr2, .L18+0xc\n\tand\tr0, r0, r4\n\tstrh\tr0, [r2]\n\tstrh\tr3, [r5]\n\tldr\tr0, .L18+0x10\n\tstrh\tr1, [r0]\n\tmov\tr1, #0x0\n\tmov\tip, r6\n\tmov\tr6, #0x1\n\tadd\tr5, r0, #0\n.L9:\n\tmov\tr3, ip\n\tldrh\tr0, [r3]\n\tlsl\tr1, r1, #0x18\n\tasr\tr2, r1, #0x18\n\tasr\tr0, r0, r2\n\tand\tr0, r0, r6\n\tadd\tr4, r1, #0\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tadd\tr0, r7, r2\n\tmov\tr3, r9\n\tadd\tr1, r3, r2\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r0]\n\tb\t.L8\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgPressedKeys\n\t.word\tgInput\n\t.word\tgPrevInput\n\t.word\tgReleasedKeys\n\t.word\tgRepeatedKeys\n.L10:\n\tadd\tr3, r7, r2\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tb\t.L15\n.L12:\n\tadd\tr0, r6, #0\n\tlsl\tr0, r0, r2\n\tldrh\tr1, [r5]\n\torr\tr0, r0, r1\n\tstrh\tr0, [r5]\n\tmov\tr1, r8\n\tadd\tr0, r1, r2\n\tldrb\tr0, [r0]\n.L15:\n\tstrb\tr0, [r3]\n.L8:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x11\n\tadd\tr0, r4, r2\n\tlsr\tr1, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tcmp\tr0, #0x9\n\tble\t.L9\t@cond_branch\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t GetInput,.Lfe1-GetInput\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GetInput\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetInput # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -11093,7 +11143,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `GetSaveSectorChecksum` — benchmark function sa3:GetSaveSectorChecksum:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetSaveSectorChecksum\n\t.type\t GetSaveSectorChecksum,function\n\t.thumb_func\nGetSaveSectorChecksum:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr4, #0xda\n\tlsl\tr4, r4, #0x2\n.L6:\n\tadd\tr0, r3, r1\n\tldr\tr0, [r0]\n\tadd\tr2, r2, r0\n\tadd\tr1, r1, #0x4\n\tcmp\tr1, r4\n\tbcc\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GetSaveSectorChecksum,.Lfe1-GetSaveSectorChecksum\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GetSaveSectorChecksum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GetSaveSectorChecksum` — benchmark function sa3:GetSaveSectorChecksum:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:GetSaveSectorChecksum:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetSaveSectorChecksum\n\t.type\t GetSaveSectorChecksum,function\n\t.thumb_func\nGetSaveSectorChecksum:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr4, #0xda\n\tlsl\tr4, r4, #0x2\n.L6:\n\tadd\tr0, r3, r1\n\tldr\tr0, [r0]\n\tadd\tr2, r2, r0\n\tadd\tr1, r1, #0x4\n\tcmp\tr1, r4\n\tbcc\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GetSaveSectorChecksum,.Lfe1-GetSaveSectorChecksum\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetSaveSectorChecksum # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GetSaveSectorChecksum` — benchmark function sa3:GetSaveSectorChecksum:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:GetSaveSectorChecksum:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetSaveSectorChecksum\n\t.type\t GetSaveSectorChecksum,function\n\t.thumb_func\nGetSaveSectorChecksum:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr4, #0xda\n\tlsl\tr4, r4, #0x2\n.L6:\n\tadd\tr0, r3, r1\n\tldr\tr0, [r0]\n\tadd\tr2, r2, r0\n\tadd\tr1, r1, #0x4\n\tcmp\tr1, r4\n\tbcc\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GetSaveSectorChecksum,.Lfe1-GetSaveSectorChecksum\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetSaveSectorChecksum # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -11127,22 +11177,22 @@ "candidateLabel": "unsigned", "symbolsUsed": [], "outcome": "nonmatch", - "source": "void numToASCII(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n u8 * v2;\n s32 v3;\n v0 = (u16)a1;\n v1 = 0;\n do {\n if ((v0 & 240 << 8) >> 12 <= 9) {\n v2 = (u8 *)(a0 + v1);\n v3 = ((v0 & 240 << 8) >> 12) + 48;\n } else {\n v2 = (u8 *)(a0 + v1);\n v3 = ((v0 & 240 << 8) >> 12) + 87;\n }\n *v2 = v3;\n v0 = v0 << 20 >> 16;\n v1 = (u8)(v1 + 1);\n } while (v1 <= 3);\n *(u8 *)(a0 + v1) = 0;\n return;\n}\n", - "score": 14, + "source": "void numToASCII(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n u8 * v2;\n s32 v3;\n v0 = (u16)a1;\n v1 = 0;\n do {\n if ((u32)(v0 & 240 << 8) >> 12 <= 9) {\n v2 = (u8 *)(a0 + v1);\n v3 = ((u32)(v0 & 240 << 8) >> 12) + 48;\n } else {\n v2 = (u8 *)(a0 + v1);\n v3 = ((u32)(v0 & 240 << 8) >> 12) + 87;\n }\n *v2 = v3;\n v0 = (u32)(v0 << 20) >> 16;\n v1 = (u8)(v1 + 1);\n } while (v1 <= 3);\n *(u8 *)(a0 + v1) = 0;\n return;\n}\n", + "score": 12, "maxScore": 31, "compileErrors": null, "breakdown": { "insert": 0, "delete": 0, - "replace": 2, + "replace": 0, "opMismatch": 2, "argMismatch": 10 }, "quality": { - "score": 90, + "score": 84, "lines": 22, "gotos": 0, - "casts": 5, + "casts": 9, "unkGlue": 0, "rawMem": 1, "addrDeref": 0 @@ -11172,20 +11222,20 @@ }, "gapSize": { "decompiler": "asmlift", - "score": 14, + "score": 12, "maxScore": 31, - "ratio": 0.45161290322580644, + "ratio": 0.3870967741935484, "kinds": { "insert": 0, "delete": 0, - "replace": 2, + "replace": 0, "opMismatch": 2, "argMismatch": 10 } }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `numToASCII` — benchmark function sa3:numToASCII:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnumToASCII\n\t.type\t numToASCII,function\n\t.thumb_func\nnumToASCII:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tmov\tr2, #0x0\n\tmov\tr5, #0xf0\n\tlsl\tr5, r5, #0x8\n.L6:\n\tadd\tr0, r3, #0\n\tand\tr0, r0, r5\n\tlsr\tr0, r0, #0xc\n\tcmp\tr0, #0x9\n\tbls\t.L7\t@cond_branch\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x57\n\tb\t.L10\n.L7:\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x30\n.L10:\n\tstrb\tr0, [r1]\n\tlsl\tr0, r3, #0x14\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr1, r4, r2\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t numToASCII,.Lfe1-numToASCII\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function numToASCII # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `numToASCII` — benchmark function sa3:numToASCII:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:numToASCII:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnumToASCII\n\t.type\t numToASCII,function\n\t.thumb_func\nnumToASCII:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tmov\tr2, #0x0\n\tmov\tr5, #0xf0\n\tlsl\tr5, r5, #0x8\n.L6:\n\tadd\tr0, r3, #0\n\tand\tr0, r0, r5\n\tlsr\tr0, r0, #0xc\n\tcmp\tr0, #0x9\n\tbls\t.L7\t@cond_branch\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x57\n\tb\t.L10\n.L7:\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x30\n.L10:\n\tstrb\tr0, [r1]\n\tlsl\tr0, r3, #0x14\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr1, r4, r2\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t numToASCII,.Lfe1-numToASCII\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"numToASCII\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name numToASCII # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `numToASCII` — benchmark function sa3:numToASCII:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:numToASCII:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnumToASCII\n\t.type\t numToASCII,function\n\t.thumb_func\nnumToASCII:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tmov\tr2, #0x0\n\tmov\tr5, #0xf0\n\tlsl\tr5, r5, #0x8\n.L6:\n\tadd\tr0, r3, #0\n\tand\tr0, r0, r5\n\tlsr\tr0, r0, #0xc\n\tcmp\tr0, #0x9\n\tbls\t.L7\t@cond_branch\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x57\n\tb\t.L10\n.L7:\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x30\n.L10:\n\tstrb\tr0, [r1]\n\tlsl\tr0, r3, #0x14\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr1, r4, r2\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t numToASCII,.Lfe1-numToASCII\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"numToASCII\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name numToASCII # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -11255,7 +11305,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `OamMalloc` — benchmark function sa3:OamMalloc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tOamMalloc\n\t.type\t OamMalloc,function\n\t.thumb_func\nOamMalloc:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1f\n\tbls\t.L3\t@cond_branch\n\tmov\tr5, #0x1f\n.L3:\n\tldr\tr0, .L8\n\tmov\tr1, #0x0\n\tldrsb\tr1, [r0, r1]\n\tadd\tr4, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L4\t@cond_branch\n\tldr\tr0, .L8+0x4\n\tldr\tr0, [r0]\n\tb\t.L5\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgOamFreeIndex\n\t.word\tiwram_end\n.L4:\n\tldr\tr0, .L10\n\tadd\tr2, r5, r0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tldr\tr1, .L10+0x4\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L10+0x8\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0]\n\tb\t.L7\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n.L6:\n\tldr\tr3, .L12\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldr\tr2, .L12+0x4\n\tadd\tr2, r5, r2\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n.L7:\n\tldrb\tr0, [r4]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4]\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tldr\tr1, .L12+0x8\n\tadd\tr0, r0, r1\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n\t.word\tgOamMallocBuffer+-0x8\n.Lfe1:\n\t.size\t OamMalloc,.Lfe1-OamMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-9580348e8bae.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nOamData *OamMalloc(u8 order);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function OamMalloc # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `OamMalloc` — benchmark function sa3:OamMalloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:OamMalloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tOamMalloc\n\t.type\t OamMalloc,function\n\t.thumb_func\nOamMalloc:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1f\n\tbls\t.L3\t@cond_branch\n\tmov\tr5, #0x1f\n.L3:\n\tldr\tr0, .L8\n\tmov\tr1, #0x0\n\tldrsb\tr1, [r0, r1]\n\tadd\tr4, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L4\t@cond_branch\n\tldr\tr0, .L8+0x4\n\tldr\tr0, [r0]\n\tb\t.L5\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgOamFreeIndex\n\t.word\tiwram_end\n.L4:\n\tldr\tr0, .L10\n\tadd\tr2, r5, r0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tldr\tr1, .L10+0x4\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L10+0x8\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0]\n\tb\t.L7\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n.L6:\n\tldr\tr3, .L12\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldr\tr2, .L12+0x4\n\tadd\tr2, r5, r2\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n.L7:\n\tldrb\tr0, [r4]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4]\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tldr\tr1, .L12+0x8\n\tadd\tr0, r0, r1\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n\t.word\tgOamMallocBuffer+-0x8\n.Lfe1:\n\t.size\t OamMalloc,.Lfe1-OamMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name OamMalloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `OamMalloc` — benchmark function sa3:OamMalloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:OamMalloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tOamMalloc\n\t.type\t OamMalloc,function\n\t.thumb_func\nOamMalloc:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1f\n\tbls\t.L3\t@cond_branch\n\tmov\tr5, #0x1f\n.L3:\n\tldr\tr0, .L8\n\tmov\tr1, #0x0\n\tldrsb\tr1, [r0, r1]\n\tadd\tr4, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L4\t@cond_branch\n\tldr\tr0, .L8+0x4\n\tldr\tr0, [r0]\n\tb\t.L5\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgOamFreeIndex\n\t.word\tiwram_end\n.L4:\n\tldr\tr0, .L10\n\tadd\tr2, r5, r0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tldr\tr1, .L10+0x4\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L10+0x8\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0]\n\tb\t.L7\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n.L6:\n\tldr\tr3, .L12\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldr\tr2, .L12+0x4\n\tadd\tr2, r5, r2\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n.L7:\n\tldrb\tr0, [r4]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4]\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tldr\tr1, .L12+0x8\n\tadd\tr0, r0, r1\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n\t.word\tgOamMallocBuffer+-0x8\n.Lfe1:\n\t.size\t OamMalloc,.Lfe1-OamMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name OamMalloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -11327,7 +11377,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `ProcessOamBuffers` — benchmark function sa3:ProcessOamBuffers:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessOamBuffers\n\t.type\t ProcessOamBuffers,function\n\t.thumb_func\nProcessOamBuffers:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x10\n\tldr\tr5, .L32\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tmov\tr3, #0x0\n\tldr\tr1, .L32+0x4\n\tmov\tsl, r1\n\tmov\tr2, sp\n\tadd\tr2, r2, #0x8\n\tstr\tr2, [sp, #0xc]\n.L6:\n\tldr\tr1, .L32+0x8\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tadd\tr6, r3, #0x1\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbeq\t.L5\t@cond_branch\n\tldr\tr4, .L32+0xc\n\tmov\tr8, r1\n\tldr\tr0, .L32+0x10\n\tmov\tip, r0\n\tldr\tr7, .L32+0x14\n.L9:\n\tasr\tr2, r2, #0x18\n\tlsl\tr3, r2, #0x3\n\tadd\tr3, r3, r7\n\tstr\tr3, [r4]\n\tstr\tr5, [r4, #0x4]\n\tldr\tr0, .L32+0x18\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr2, r2, ip\n\tmov\tr1, r9\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tstrb\tr1, [r2]\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tcmp\tr0, r8\n\tbne\t.L9\t@cond_branch\n.L5:\n\tadd\tr3, r6, #0\n\tcmp\tr3, #0x1f\n\tble\t.L6\t@cond_branch\n\tldr\tr2, .L32+0x1c\n\tldr\tr1, [r2]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L32+0x20\n\tldrb\tr3, [r0]\n\tlsl\tr0, r3, #0x3\n\tldr\tr1, .L32\n\tadd\tr5, r0, r1\n\tmov\tr2, sl\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr4, sp\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tadd\tr7, r1, #0\n\tldr\tr1, .L32+0xc\n\tldr\tr6, .L32+0x24\n.L15:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr5, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr3, r3, #0x1\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tblt\t.L15\t@cond_branch\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgOamBuffer\n\t.word\tgOamFirstPausedIndex\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t0x40000d4\n\t.word\tgOamMallocCopiedOrder\n\t.word\tgOamMallocBuffer\n\t.word\t-0x7ffffffd\n\t.word\tgFlags\n\t.word\tgOamFreeIndex\n\t.word\t-0x7efffffd\n.L12:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr1, .L34\n\tldrb\tr0, [r1]\n\tsub\tr3, r0, #0x1\n\tlsl\tr0, r3, #0x3\n\tldr\tr2, .L34+0x4\n\tadd\tr5, r0, r2\n\tcmp\tr3, #0\n\tblt\t.L20\t@cond_branch\n\tldr\tr2, .L34+0x8\n\tldr\tr6, .L34+0xc\n\tldr\tr0, .L34+0x4\n\tmov\tr1, #0xfe\n\tlsl\tr1, r1, #0x2\n\tadd\tr4, r0, r1\n\tadd\tr1, r5, #0\n.L22:\n\tstr\tr1, [r2]\n\tstr\tr4, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr1, r1, #0x8\n\tsub\tr3, r3, #0x1\n\tsub\tr4, r4, #0x8\n\tcmp\tr3, #0\n\tbge\t.L22\t@cond_branch\n.L20:\n\tldr\tr2, .L34\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x80\n\tsub\tr0, r0, r1\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n\tmov\tr3, #0x0\n\tldrb\tr0, [r1]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr5, sp\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr7, r2, #0\n\tldr\tr1, .L34+0x8\n\tadd\tr4, r0, #0\n\tldr\tr6, .L34+0x10\n\tldr\tr2, .L34+0x4\n.L27:\n\tstrh\tr7, [r5]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr2, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\t.code\t16\n\tadd\tr2, r2, #0x8\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r4\n\tblt\t.L27\t@cond_branch\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgOamFreeIndex\n\t.word\tgOamBuffer\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffd\n\t.word\t-0x7efffffd\n.L18:\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n.L17:\n\tmov\tr0, #0x0\n\tldr\tr2, .L36\n\tstrb\tr0, [r2]\n\tldr\tr1, .L36+0x4\n\tldr\tr0, [r1]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x7\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L30\t@cond_branch\n\tmov\tr4, #0x1\n\tneg\tr4, r4\n\tstr\tr4, [sp, #0x4]\n\tadd\tr0, sp, #0x4\n\tldr\tr5, .L36+0x8\n\tldr\tr1, .L36+0xc\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tstr\tr4, [sp, #0x8]\n\tldr\tr1, .L36+0x10\n\tldr\tr0, [sp, #0xc]\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tb\t.L31\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgOamFreeIndex\n\t.word\tgFlags\n\t.word\t0x5000008\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocOrders_EndIndex\n.L30:\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tstr\tr1, [sp, #0x8]\n\tldr\tr0, .L38\n\tldr\tr2, [sp, #0xc]\n\tstr\tr2, [r0]\n\tldr\tr2, .L38+0x4\n\tstr\tr2, [r0, #0x4]\n\tldr\tr2, .L38+0x8\n\tstr\tr2, [r0, #0x8]\n\tldr\tr3, [r0, #0x8]\n\tstr\tr1, [sp, #0x8]\n\tldr\tr1, [sp, #0xc]\n\tstr\tr1, [r0]\n\tldr\tr1, .L38+0xc\n\tstr\tr1, [r0, #0x4]\n\tstr\tr2, [r0, #0x8]\n\tldr\tr0, [r0, #0x8]\n.L31:\n\tadd\tsp, sp, #0x10\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0x40000d4\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t-0x7afffff8\n\t.word\tgOamMallocOrders_EndIndex\n.Lfe1:\n\t.size\t ProcessOamBuffers,.Lfe1-ProcessOamBuffers\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-0fac75cf4324.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid ProcessOamBuffers(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ProcessOamBuffers # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ProcessOamBuffers` — benchmark function sa3:ProcessOamBuffers:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:ProcessOamBuffers:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessOamBuffers\n\t.type\t ProcessOamBuffers,function\n\t.thumb_func\nProcessOamBuffers:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x10\n\tldr\tr5, .L32\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tmov\tr3, #0x0\n\tldr\tr1, .L32+0x4\n\tmov\tsl, r1\n\tmov\tr2, sp\n\tadd\tr2, r2, #0x8\n\tstr\tr2, [sp, #0xc]\n.L6:\n\tldr\tr1, .L32+0x8\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tadd\tr6, r3, #0x1\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbeq\t.L5\t@cond_branch\n\tldr\tr4, .L32+0xc\n\tmov\tr8, r1\n\tldr\tr0, .L32+0x10\n\tmov\tip, r0\n\tldr\tr7, .L32+0x14\n.L9:\n\tasr\tr2, r2, #0x18\n\tlsl\tr3, r2, #0x3\n\tadd\tr3, r3, r7\n\tstr\tr3, [r4]\n\tstr\tr5, [r4, #0x4]\n\tldr\tr0, .L32+0x18\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr2, r2, ip\n\tmov\tr1, r9\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tstrb\tr1, [r2]\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tcmp\tr0, r8\n\tbne\t.L9\t@cond_branch\n.L5:\n\tadd\tr3, r6, #0\n\tcmp\tr3, #0x1f\n\tble\t.L6\t@cond_branch\n\tldr\tr2, .L32+0x1c\n\tldr\tr1, [r2]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L32+0x20\n\tldrb\tr3, [r0]\n\tlsl\tr0, r3, #0x3\n\tldr\tr1, .L32\n\tadd\tr5, r0, r1\n\tmov\tr2, sl\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr4, sp\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tadd\tr7, r1, #0\n\tldr\tr1, .L32+0xc\n\tldr\tr6, .L32+0x24\n.L15:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr5, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr3, r3, #0x1\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tblt\t.L15\t@cond_branch\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgOamBuffer\n\t.word\tgOamFirstPausedIndex\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t0x40000d4\n\t.word\tgOamMallocCopiedOrder\n\t.word\tgOamMallocBuffer\n\t.word\t-0x7ffffffd\n\t.word\tgFlags\n\t.word\tgOamFreeIndex\n\t.word\t-0x7efffffd\n.L12:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr1, .L34\n\tldrb\tr0, [r1]\n\tsub\tr3, r0, #0x1\n\tlsl\tr0, r3, #0x3\n\tldr\tr2, .L34+0x4\n\tadd\tr5, r0, r2\n\tcmp\tr3, #0\n\tblt\t.L20\t@cond_branch\n\tldr\tr2, .L34+0x8\n\tldr\tr6, .L34+0xc\n\tldr\tr0, .L34+0x4\n\tmov\tr1, #0xfe\n\tlsl\tr1, r1, #0x2\n\tadd\tr4, r0, r1\n\tadd\tr1, r5, #0\n.L22:\n\tstr\tr1, [r2]\n\tstr\tr4, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr1, r1, #0x8\n\tsub\tr3, r3, #0x1\n\tsub\tr4, r4, #0x8\n\tcmp\tr3, #0\n\tbge\t.L22\t@cond_branch\n.L20:\n\tldr\tr2, .L34\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x80\n\tsub\tr0, r0, r1\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n\tmov\tr3, #0x0\n\tldrb\tr0, [r1]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr5, sp\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr7, r2, #0\n\tldr\tr1, .L34+0x8\n\tadd\tr4, r0, #0\n\tldr\tr6, .L34+0x10\n\tldr\tr2, .L34+0x4\n.L27:\n\tstrh\tr7, [r5]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr2, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\t.code\t16\n\tadd\tr2, r2, #0x8\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r4\n\tblt\t.L27\t@cond_branch\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgOamFreeIndex\n\t.word\tgOamBuffer\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffd\n\t.word\t-0x7efffffd\n.L18:\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n.L17:\n\tmov\tr0, #0x0\n\tldr\tr2, .L36\n\tstrb\tr0, [r2]\n\tldr\tr1, .L36+0x4\n\tldr\tr0, [r1]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x7\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L30\t@cond_branch\n\tmov\tr4, #0x1\n\tneg\tr4, r4\n\tstr\tr4, [sp, #0x4]\n\tadd\tr0, sp, #0x4\n\tldr\tr5, .L36+0x8\n\tldr\tr1, .L36+0xc\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tstr\tr4, [sp, #0x8]\n\tldr\tr1, .L36+0x10\n\tldr\tr0, [sp, #0xc]\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tb\t.L31\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgOamFreeIndex\n\t.word\tgFlags\n\t.word\t0x5000008\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocOrders_EndIndex\n.L30:\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tstr\tr1, [sp, #0x8]\n\tldr\tr0, .L38\n\tldr\tr2, [sp, #0xc]\n\tstr\tr2, [r0]\n\tldr\tr2, .L38+0x4\n\tstr\tr2, [r0, #0x4]\n\tldr\tr2, .L38+0x8\n\tstr\tr2, [r0, #0x8]\n\tldr\tr3, [r0, #0x8]\n\tstr\tr1, [sp, #0x8]\n\tldr\tr1, [sp, #0xc]\n\tstr\tr1, [r0]\n\tldr\tr1, .L38+0xc\n\tstr\tr1, [r0, #0x4]\n\tstr\tr2, [r0, #0x8]\n\tldr\tr0, [r0, #0x8]\n.L31:\n\tadd\tsp, sp, #0x10\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0x40000d4\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t-0x7afffff8\n\t.word\tgOamMallocOrders_EndIndex\n.Lfe1:\n\t.size\t ProcessOamBuffers,.Lfe1-ProcessOamBuffers\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ProcessOamBuffers # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `ProcessOamBuffers` — benchmark function sa3:ProcessOamBuffers:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:ProcessOamBuffers:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessOamBuffers\n\t.type\t ProcessOamBuffers,function\n\t.thumb_func\nProcessOamBuffers:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x10\n\tldr\tr5, .L32\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tmov\tr3, #0x0\n\tldr\tr1, .L32+0x4\n\tmov\tsl, r1\n\tmov\tr2, sp\n\tadd\tr2, r2, #0x8\n\tstr\tr2, [sp, #0xc]\n.L6:\n\tldr\tr1, .L32+0x8\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tadd\tr6, r3, #0x1\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbeq\t.L5\t@cond_branch\n\tldr\tr4, .L32+0xc\n\tmov\tr8, r1\n\tldr\tr0, .L32+0x10\n\tmov\tip, r0\n\tldr\tr7, .L32+0x14\n.L9:\n\tasr\tr2, r2, #0x18\n\tlsl\tr3, r2, #0x3\n\tadd\tr3, r3, r7\n\tstr\tr3, [r4]\n\tstr\tr5, [r4, #0x4]\n\tldr\tr0, .L32+0x18\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr2, r2, ip\n\tmov\tr1, r9\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tstrb\tr1, [r2]\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tcmp\tr0, r8\n\tbne\t.L9\t@cond_branch\n.L5:\n\tadd\tr3, r6, #0\n\tcmp\tr3, #0x1f\n\tble\t.L6\t@cond_branch\n\tldr\tr2, .L32+0x1c\n\tldr\tr1, [r2]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L32+0x20\n\tldrb\tr3, [r0]\n\tlsl\tr0, r3, #0x3\n\tldr\tr1, .L32\n\tadd\tr5, r0, r1\n\tmov\tr2, sl\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr4, sp\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tadd\tr7, r1, #0\n\tldr\tr1, .L32+0xc\n\tldr\tr6, .L32+0x24\n.L15:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr5, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr3, r3, #0x1\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tblt\t.L15\t@cond_branch\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgOamBuffer\n\t.word\tgOamFirstPausedIndex\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t0x40000d4\n\t.word\tgOamMallocCopiedOrder\n\t.word\tgOamMallocBuffer\n\t.word\t-0x7ffffffd\n\t.word\tgFlags\n\t.word\tgOamFreeIndex\n\t.word\t-0x7efffffd\n.L12:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr1, .L34\n\tldrb\tr0, [r1]\n\tsub\tr3, r0, #0x1\n\tlsl\tr0, r3, #0x3\n\tldr\tr2, .L34+0x4\n\tadd\tr5, r0, r2\n\tcmp\tr3, #0\n\tblt\t.L20\t@cond_branch\n\tldr\tr2, .L34+0x8\n\tldr\tr6, .L34+0xc\n\tldr\tr0, .L34+0x4\n\tmov\tr1, #0xfe\n\tlsl\tr1, r1, #0x2\n\tadd\tr4, r0, r1\n\tadd\tr1, r5, #0\n.L22:\n\tstr\tr1, [r2]\n\tstr\tr4, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr1, r1, #0x8\n\tsub\tr3, r3, #0x1\n\tsub\tr4, r4, #0x8\n\tcmp\tr3, #0\n\tbge\t.L22\t@cond_branch\n.L20:\n\tldr\tr2, .L34\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x80\n\tsub\tr0, r0, r1\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n\tmov\tr3, #0x0\n\tldrb\tr0, [r1]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr5, sp\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr7, r2, #0\n\tldr\tr1, .L34+0x8\n\tadd\tr4, r0, #0\n\tldr\tr6, .L34+0x10\n\tldr\tr2, .L34+0x4\n.L27:\n\tstrh\tr7, [r5]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr2, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\t.code\t16\n\tadd\tr2, r2, #0x8\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r4\n\tblt\t.L27\t@cond_branch\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgOamFreeIndex\n\t.word\tgOamBuffer\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffd\n\t.word\t-0x7efffffd\n.L18:\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n.L17:\n\tmov\tr0, #0x0\n\tldr\tr2, .L36\n\tstrb\tr0, [r2]\n\tldr\tr1, .L36+0x4\n\tldr\tr0, [r1]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x7\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L30\t@cond_branch\n\tmov\tr4, #0x1\n\tneg\tr4, r4\n\tstr\tr4, [sp, #0x4]\n\tadd\tr0, sp, #0x4\n\tldr\tr5, .L36+0x8\n\tldr\tr1, .L36+0xc\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tstr\tr4, [sp, #0x8]\n\tldr\tr1, .L36+0x10\n\tldr\tr0, [sp, #0xc]\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tb\t.L31\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgOamFreeIndex\n\t.word\tgFlags\n\t.word\t0x5000008\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocOrders_EndIndex\n.L30:\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tstr\tr1, [sp, #0x8]\n\tldr\tr0, .L38\n\tldr\tr2, [sp, #0xc]\n\tstr\tr2, [r0]\n\tldr\tr2, .L38+0x4\n\tstr\tr2, [r0, #0x4]\n\tldr\tr2, .L38+0x8\n\tstr\tr2, [r0, #0x8]\n\tldr\tr3, [r0, #0x8]\n\tstr\tr1, [sp, #0x8]\n\tldr\tr1, [sp, #0xc]\n\tstr\tr1, [r0]\n\tldr\tr1, .L38+0xc\n\tstr\tr1, [r0, #0x4]\n\tstr\tr2, [r0, #0x8]\n\tldr\tr0, [r0, #0x8]\n.L31:\n\tadd\tsp, sp, #0x10\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0x40000d4\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t-0x7afffff8\n\t.word\tgOamMallocOrders_EndIndex\n.Lfe1:\n\t.size\t ProcessOamBuffers,.Lfe1-ProcessOamBuffers\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ProcessOamBuffers # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -11395,7 +11445,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `Random` — benchmark function sa3:Random:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr3, .L3\n\tldr\tr1, .L3+0x4\n\tldr\tr0, [r3]\n\tldr\tr2, [r1]\n\tstr\tr2, [r3]\n\tldr\tr3, .L3+0x8\n\tadd\tr0, r0, r3\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldrh\tr0, [r1, #0x2]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n\t.word\t0x37119371\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-3c6c541b53d3.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu16 Random(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Random # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `Random` — benchmark function sa3:Random:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:Random:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr3, .L3\n\tldr\tr1, .L3+0x4\n\tldr\tr0, [r3]\n\tldr\tr2, [r1]\n\tstr\tr2, [r3]\n\tldr\tr3, .L3+0x8\n\tadd\tr0, r0, r3\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldrh\tr0, [r1, #0x2]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n\t.word\t0x37119371\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Random # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `Random` — benchmark function sa3:Random:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:Random:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr3, .L3\n\tldr\tr1, .L3+0x4\n\tldr\tr0, [r3]\n\tldr\tr2, [r1]\n\tstr\tr2, [r3]\n\tldr\tr3, .L3+0x8\n\tadd\tr0, r0, r3\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldrh\tr0, [r1, #0x2]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n\t.word\t0x37119371\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Random # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -11465,7 +11515,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8004418` — benchmark function sa3:sa2__sub_8004418:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.type\t unkFractions,object\n\t.size\t unkFractions,8\nunkFractions:\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x2\n\t.byte\t0x3\n\t.byte\t0x6\n\t.byte\t0x7\n\t.byte\t0x5\n\t.byte\t0x4\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8004418\n\t.type\t sa2__sub_8004418,function\n\t.thumb_func\nsa2__sub_8004418:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x8\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tmov\tr6, #0x0\n\tldr\tr1, .L15\n\tmov\tr0, sp\n\tmov\tr2, #0x8\n\tbl\tmemcpy\n\tlsl\tr0, r4, #0x10\n\tasr\tr1, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr2, r0, #0x10\n\tadd\tr0, r1, #0\n\torr\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tb\t.L4\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\tunkFractions\n.L3:\n\tcmp\tr1, #0\n\tbgt\t.L5\t@cond_branch\n\tneg\tr0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x4\n.L5:\n\tcmp\tr2, #0\n\tbgt\t.L6\t@cond_branch\n\tneg\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tadd\tr0, r6, #0x2\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L6:\n\tlsl\tr0, r4, #0x10\n\tasr\tr2, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr1, r0, #0x10\n\tcmp\tr2, r1\n\tblt\t.L7\t@cond_branch\n\tlsl\tr0, r1, #0x17\n\tlsr\tr5, r0, #0x10\n\tcmp\tr2, #0\n\tbne\t.L8\t@cond_branch\n\tadd\tr2, r5, #0\n\tb\t.L10\n.L8:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r2, #0\n\tb\t.L14\n.L7:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tlsl\tr0, r2, #0x17\n\tlsr\tr4, r0, #0x10\n\tcmp\tr1, #0\n\tbne\t.L11\t@cond_branch\n\tadd\tr2, r4, #0\n\tb\t.L10\n.L11:\n\tlsl\tr0, r4, #0x10\n\tasr\tr0, r0, #0x10\n.L14:\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L10:\n\tmov\tr0, sp\n\tadd\tr3, r0, r6\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr2, r1, #0x10\n.L13:\n\tldrb\tr1, [r3]\n\tlsl\tr1, r1, #0x7\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x16\n\tlsr\tr0, r0, #0x16\n.L4:\n\tadd\tsp, sp, #0x8\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8004418,.Lfe1-sa2__sub_8004418\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-4e7a3b17981a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns16 sa2__sub_8004418(s16 x, s16 y);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8004418 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8004418` — benchmark function sa3:sa2__sub_8004418:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8004418:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.type\t unkFractions,object\n\t.size\t unkFractions,8\nunkFractions:\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x2\n\t.byte\t0x3\n\t.byte\t0x6\n\t.byte\t0x7\n\t.byte\t0x5\n\t.byte\t0x4\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8004418\n\t.type\t sa2__sub_8004418,function\n\t.thumb_func\nsa2__sub_8004418:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x8\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tmov\tr6, #0x0\n\tldr\tr1, .L15\n\tmov\tr0, sp\n\tmov\tr2, #0x8\n\tbl\tmemcpy\n\tlsl\tr0, r4, #0x10\n\tasr\tr1, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr2, r0, #0x10\n\tadd\tr0, r1, #0\n\torr\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tb\t.L4\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\tunkFractions\n.L3:\n\tcmp\tr1, #0\n\tbgt\t.L5\t@cond_branch\n\tneg\tr0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x4\n.L5:\n\tcmp\tr2, #0\n\tbgt\t.L6\t@cond_branch\n\tneg\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tadd\tr0, r6, #0x2\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L6:\n\tlsl\tr0, r4, #0x10\n\tasr\tr2, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr1, r0, #0x10\n\tcmp\tr2, r1\n\tblt\t.L7\t@cond_branch\n\tlsl\tr0, r1, #0x17\n\tlsr\tr5, r0, #0x10\n\tcmp\tr2, #0\n\tbne\t.L8\t@cond_branch\n\tadd\tr2, r5, #0\n\tb\t.L10\n.L8:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r2, #0\n\tb\t.L14\n.L7:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tlsl\tr0, r2, #0x17\n\tlsr\tr4, r0, #0x10\n\tcmp\tr1, #0\n\tbne\t.L11\t@cond_branch\n\tadd\tr2, r4, #0\n\tb\t.L10\n.L11:\n\tlsl\tr0, r4, #0x10\n\tasr\tr0, r0, #0x10\n.L14:\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L10:\n\tmov\tr0, sp\n\tadd\tr3, r0, r6\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr2, r1, #0x10\n.L13:\n\tldrb\tr1, [r3]\n\tlsl\tr1, r1, #0x7\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x16\n\tlsr\tr0, r0, #0x16\n.L4:\n\tadd\tsp, sp, #0x8\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8004418,.Lfe1-sa2__sub_8004418\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8004418 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8004418` — benchmark function sa3:sa2__sub_8004418:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8004418:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.type\t unkFractions,object\n\t.size\t unkFractions,8\nunkFractions:\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x2\n\t.byte\t0x3\n\t.byte\t0x6\n\t.byte\t0x7\n\t.byte\t0x5\n\t.byte\t0x4\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8004418\n\t.type\t sa2__sub_8004418,function\n\t.thumb_func\nsa2__sub_8004418:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x8\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tmov\tr6, #0x0\n\tldr\tr1, .L15\n\tmov\tr0, sp\n\tmov\tr2, #0x8\n\tbl\tmemcpy\n\tlsl\tr0, r4, #0x10\n\tasr\tr1, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr2, r0, #0x10\n\tadd\tr0, r1, #0\n\torr\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tb\t.L4\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\tunkFractions\n.L3:\n\tcmp\tr1, #0\n\tbgt\t.L5\t@cond_branch\n\tneg\tr0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x4\n.L5:\n\tcmp\tr2, #0\n\tbgt\t.L6\t@cond_branch\n\tneg\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tadd\tr0, r6, #0x2\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L6:\n\tlsl\tr0, r4, #0x10\n\tasr\tr2, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr1, r0, #0x10\n\tcmp\tr2, r1\n\tblt\t.L7\t@cond_branch\n\tlsl\tr0, r1, #0x17\n\tlsr\tr5, r0, #0x10\n\tcmp\tr2, #0\n\tbne\t.L8\t@cond_branch\n\tadd\tr2, r5, #0\n\tb\t.L10\n.L8:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r2, #0\n\tb\t.L14\n.L7:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tlsl\tr0, r2, #0x17\n\tlsr\tr4, r0, #0x10\n\tcmp\tr1, #0\n\tbne\t.L11\t@cond_branch\n\tadd\tr2, r4, #0\n\tb\t.L10\n.L11:\n\tlsl\tr0, r4, #0x10\n\tasr\tr0, r0, #0x10\n.L14:\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L10:\n\tmov\tr0, sp\n\tadd\tr3, r0, r6\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr2, r1, #0x10\n.L13:\n\tldrb\tr1, [r3]\n\tlsl\tr1, r1, #0x7\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x16\n\tlsr\tr0, r0, #0x16\n.L4:\n\tadd\tsp, sp, #0x8\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8004418,.Lfe1-sa2__sub_8004418\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8004418 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -11541,7 +11591,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8007858` — benchmark function sa3:sa2__sub_8007858:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007858\n\t.type\t sa2__sub_8007858,function\n\t.thumb_func\nsa2__sub_8007858:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r3, #0\n\tldr\tr3, [sp, #0x14]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr6, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr4, r3, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tsub\tr4, r4, r5\n\tldr\tr1, .L7+0x14\n\tadd\tr0, r1, #0\n\tand\tr4, r4, r0\n\tand\tr7, r7, r0\n\tcmp\tr5, r6\n\tbcs\t.L4\t@cond_branch\n.L5:\n\tstrh\tr7, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r4, #0\n\tsub\tr1, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr4, r1, #0x10\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, r6\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007858,.Lfe1-sa2__sub_8007858\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8007858 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8007858` — benchmark function sa3:sa2__sub_8007858:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8007858:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007858\n\t.type\t sa2__sub_8007858,function\n\t.thumb_func\nsa2__sub_8007858:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r3, #0\n\tldr\tr3, [sp, #0x14]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr6, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr4, r3, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tsub\tr4, r4, r5\n\tldr\tr1, .L7+0x14\n\tadd\tr0, r1, #0\n\tand\tr4, r4, r0\n\tand\tr7, r7, r0\n\tcmp\tr5, r6\n\tbcs\t.L4\t@cond_branch\n.L5:\n\tstrh\tr7, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r4, #0\n\tsub\tr1, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr4, r1, #0x10\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, r6\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007858,.Lfe1-sa2__sub_8007858\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_8007858\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8007858 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8007858` — benchmark function sa3:sa2__sub_8007858:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8007858:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007858\n\t.type\t sa2__sub_8007858,function\n\t.thumb_func\nsa2__sub_8007858:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r3, #0\n\tldr\tr3, [sp, #0x14]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr6, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr4, r3, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tsub\tr4, r4, r5\n\tldr\tr1, .L7+0x14\n\tadd\tr0, r1, #0\n\tand\tr4, r4, r0\n\tand\tr7, r7, r0\n\tcmp\tr5, r6\n\tbcs\t.L4\t@cond_branch\n.L5:\n\tstrh\tr7, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r4, #0\n\tsub\tr1, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr4, r1, #0x10\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, r6\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007858,.Lfe1-sa2__sub_8007858\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_8007858\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8007858 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -11611,7 +11661,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80078D4` — benchmark function sa3:sa2__sub_80078D4:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80078D4\n\t.type\t sa2__sub_80078D4,function\n\t.thumb_func\nsa2__sub_80078D4:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x18]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr7, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tldr\tr2, .L4\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L4+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L4+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L4+0xc\n\tstrb\tr3, [r0]\n\tcmp\tr5, r7\n\tbcs\t.L3\t@cond_branch\n\tldr\tr2, .L4+0x10\n\tadd\tr1, r6, #0\n\tand\tr1, r1, r2\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r2\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tstr\tr1, [sp]\n\tldr\tr2, .L4+0x14\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldr\tr0, .L4+0x18\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2, #0x4]\n\tsub\tr0, r7, r5\n\tmov\tr1, #0x85\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n.L3:\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\t0x1ff\n\t.word\t0x40000d4\n\t.word\tgBgOffsetsHBlankPrimary\n.Lfe1:\n\t.size\t sa2__sub_80078D4,.Lfe1-sa2__sub_80078D4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80078D4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80078D4` — benchmark function sa3:sa2__sub_80078D4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80078D4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80078D4\n\t.type\t sa2__sub_80078D4,function\n\t.thumb_func\nsa2__sub_80078D4:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x18]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr7, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tldr\tr2, .L4\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L4+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L4+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L4+0xc\n\tstrb\tr3, [r0]\n\tcmp\tr5, r7\n\tbcs\t.L3\t@cond_branch\n\tldr\tr2, .L4+0x10\n\tadd\tr1, r6, #0\n\tand\tr1, r1, r2\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r2\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tstr\tr1, [sp]\n\tldr\tr2, .L4+0x14\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldr\tr0, .L4+0x18\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2, #0x4]\n\tsub\tr0, r7, r5\n\tmov\tr1, #0x85\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n.L3:\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\t0x1ff\n\t.word\t0x40000d4\n\t.word\tgBgOffsetsHBlankPrimary\n.Lfe1:\n\t.size\t sa2__sub_80078D4,.Lfe1-sa2__sub_80078D4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80078D4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80078D4` — benchmark function sa3:sa2__sub_80078D4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80078D4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80078D4\n\t.type\t sa2__sub_80078D4,function\n\t.thumb_func\nsa2__sub_80078D4:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x18]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr7, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tldr\tr2, .L4\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L4+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L4+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L4+0xc\n\tstrb\tr3, [r0]\n\tcmp\tr5, r7\n\tbcs\t.L3\t@cond_branch\n\tldr\tr2, .L4+0x10\n\tadd\tr1, r6, #0\n\tand\tr1, r1, r2\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r2\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tstr\tr1, [sp]\n\tldr\tr2, .L4+0x14\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldr\tr0, .L4+0x18\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2, #0x4]\n\tsub\tr0, r7, r5\n\tmov\tr1, #0x85\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n.L3:\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\t0x1ff\n\t.word\t0x40000d4\n\t.word\tgBgOffsetsHBlankPrimary\n.Lfe1:\n\t.size\t sa2__sub_80078D4,.Lfe1-sa2__sub_80078D4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80078D4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -11687,7 +11737,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8007958` — benchmark function sa3:sa2__sub_8007958:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007958\n\t.type\t sa2__sub_8007958,function\n\t.thumb_func\nsa2__sub_8007958:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x20]\n\tldr\tr5, [sp, #0x24]\n\tldr\tr6, [sp, #0x28]\n\tmov\tr8, r6\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr7, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tip, r2\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tmov\tr9, r5\n\tmov\tr1, r8\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r7, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tcmp\tr7, ip\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L7+0x14\n\tadd\tr3, r0, #0\n.L5:\n\tmov\tr1, r9\n\tadd\tr0, r1, r6\n\tand\tr0, r0, r3\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tstrh\tr5, [r2]\n\tadd\tr2, r2, #0x2\n\tlsl\tr1, r4, #0x18\n\tasr\tr1, r1, #0x18\n\tlsl\tr0, r6, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tneg\tr0, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr6, r0, #0x10\n\tneg\tr1, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr4, r1, #0x18\n\tadd\tr0, r7, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr7, r0, #0x18\n\tcmp\tr7, ip\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007958,.Lfe1-sa2__sub_8007958\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8007958 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8007958` — benchmark function sa3:sa2__sub_8007958:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8007958:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007958\n\t.type\t sa2__sub_8007958,function\n\t.thumb_func\nsa2__sub_8007958:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x20]\n\tldr\tr5, [sp, #0x24]\n\tldr\tr6, [sp, #0x28]\n\tmov\tr8, r6\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr7, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tip, r2\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tmov\tr9, r5\n\tmov\tr1, r8\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r7, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tcmp\tr7, ip\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L7+0x14\n\tadd\tr3, r0, #0\n.L5:\n\tmov\tr1, r9\n\tadd\tr0, r1, r6\n\tand\tr0, r0, r3\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tstrh\tr5, [r2]\n\tadd\tr2, r2, #0x2\n\tlsl\tr1, r4, #0x18\n\tasr\tr1, r1, #0x18\n\tlsl\tr0, r6, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tneg\tr0, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr6, r0, #0x10\n\tneg\tr1, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr4, r1, #0x18\n\tadd\tr0, r7, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr7, r0, #0x18\n\tcmp\tr7, ip\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007958,.Lfe1-sa2__sub_8007958\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_8007958\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8007958 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8007958` — benchmark function sa3:sa2__sub_8007958:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8007958:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007958\n\t.type\t sa2__sub_8007958,function\n\t.thumb_func\nsa2__sub_8007958:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x20]\n\tldr\tr5, [sp, #0x24]\n\tldr\tr6, [sp, #0x28]\n\tmov\tr8, r6\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr7, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tip, r2\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tmov\tr9, r5\n\tmov\tr1, r8\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r7, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tcmp\tr7, ip\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L7+0x14\n\tadd\tr3, r0, #0\n.L5:\n\tmov\tr1, r9\n\tadd\tr0, r1, r6\n\tand\tr0, r0, r3\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tstrh\tr5, [r2]\n\tadd\tr2, r2, #0x2\n\tlsl\tr1, r4, #0x18\n\tasr\tr1, r1, #0x18\n\tlsl\tr0, r6, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tneg\tr0, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr6, r0, #0x10\n\tneg\tr1, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr4, r1, #0x18\n\tadd\tr0, r7, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr7, r0, #0x18\n\tcmp\tr7, ip\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007958,.Lfe1-sa2__sub_8007958\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_8007958\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8007958 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -11727,7 +11777,7 @@ } ], "outcome": "nonmatch", - "source": "struct Struct0 { u16 field_0; u8 _pad0[6]; s32 field_8; s32 field_12; };\nstruct Struct1 { u16 field_0; u16 field_2; u16 field_4; s32 field_8; s32 field_12; };\nstruct Struct2 { u16 field_0; u8 _pad0[6]; s32 field_8; s32 field_12; };\nvoid sa2__sub_8083504(struct Struct0 * a0, struct Struct2 * a1, struct Struct1 * a2, u32 a3) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n s32 v6;\n u16 * p0;\n p0 = (u16 *)&gSineTable;\n v0 = *(s16 *)(a1 + 2);\n if (v0 == 128 << 3) {\n v4 = a0->field_8;\n } else {\n v1 = a0->field_8;\n a2->field_2 = *(s16 *)(a0 + 2) * v0 >> 10;\n v4 = v1 * v0 >> 10;\n }\n v2 = *(s16 *)(a1 + 4);\n if (v2 == 128 << 3) {\n v5 = a0->field_12;\n } else {\n v3 = a0->field_12;\n a2->field_4 = *(s16 *)(a0 + 4) * v2 >> 10;\n v5 = v3 * v2 >> 10;\n }\n if (a1->field_0 == 0) {\n a2->field_8 = a1->field_8 + v4;\n v6 = a1->field_12 + v5;\n } else {\n a2->field_8 = a1->field_8 + ((v4 * (p0[a1->field_0 + (128 << 1)] << 16 >> 22) >> 8) - ((p0[a1->field_0] << 16 >> 22) * v5 >> 8));\n v6 = a1->field_12 + ((v4 * (p0[a1->field_0] << 16 >> 22) >> 8) + ((p0[a1->field_0 + (128 << 1)] << 16 >> 22) * v5 >> 8));\n }\n a2->field_12 = v6;\n a2->field_0 = a1->field_0 + a0->field_0 & 1023;\n return;\n}\n", + "source": "struct Struct0 { u16 field_0; u8 _pad0[6]; s32 field_8; s32 field_12; };\nstruct Struct1 { u16 field_0; u16 field_2; u16 field_4; s32 field_8; s32 field_12; };\nstruct Struct2 { u16 field_0; u8 _pad0[6]; s32 field_8; s32 field_12; };\nvoid sa2__sub_8083504(struct Struct0 * a0, struct Struct2 * a1, struct Struct1 * a2, u32 a3) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n s32 v6;\n u16 * p0;\n p0 = (u16 *)&gSineTable;\n v0 = *(s16 *)(a1 + 2);\n if (v0 == 128 << 3) {\n v4 = a0->field_8;\n } else {\n v1 = a0->field_8;\n a2->field_2 = (s32)(*(s16 *)(a0 + 2) * v0) >> 10;\n v4 = v1 * v0 >> 10;\n }\n v2 = *(s16 *)(a1 + 4);\n if (v2 == 128 << 3) {\n v5 = a0->field_12;\n } else {\n v3 = a0->field_12;\n a2->field_4 = (s32)(*(s16 *)(a0 + 4) * v2) >> 10;\n v5 = v3 * v2 >> 10;\n }\n if (a1->field_0 == 0) {\n a2->field_8 = a1->field_8 + v4;\n v6 = a1->field_12 + v5;\n } else {\n a2->field_8 = a1->field_8 + ((v4 * (p0[a1->field_0 + (128 << 1)] << 16 >> 22) >> 8) - ((p0[a1->field_0] << 16 >> 22) * v5 >> 8));\n v6 = a1->field_12 + ((v4 * (p0[a1->field_0] << 16 >> 22) >> 8) + ((p0[a1->field_0 + (128 << 1)] << 16 >> 22) * v5 >> 8));\n }\n a2->field_12 = v6;\n a2->field_0 = a1->field_0 + a0->field_0 & 1023;\n return;\n}\n", "score": 85, "maxScore": 125, "compileErrors": null, @@ -11739,10 +11789,10 @@ "argMismatch": 39 }, "quality": { - "score": 78, + "score": 74, "lines": 40, "gotos": 0, - "casts": 5, + "casts": 7, "unkGlue": 0, "rawMem": 4, "addrDeref": 0 @@ -11787,7 +11837,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8083504` — benchmark function sa3:sa2__sub_8083504:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8083504\n\t.type\t sa2__sub_8083504,function\n\t.thumb_func\nsa2__sub_8083504:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tadd\tr7, r2, #0\n\tmov\tr0, #0x2\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, [r6, #0x8]\n\tmul\tr0, r0, r1\n\tasr\tr3, r0, #0xa\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x2]\n\tb\t.L4\n.L3:\n\tldr\tr3, [r6, #0x8]\n.L4:\n\tmov\tr0, #0x4\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, [r6, #0xc]\n\tmul\tr0, r0, r1\n\tasr\tr4, r0, #0xa\n\tmov\tr2, #0x4\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x4]\n\tb\t.L6\n.L5:\n\tldr\tr4, [r6, #0xc]\n.L6:\n\tldrh\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr0, .L10\n\tmov\tip, r0\n\tldrh\tr1, [r5]\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tmov\tr8, r2\n\tadd\tr0, r1, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tsub\tr2, r2, r0\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r2\n\tstr\tr0, [r7, #0x8]\n\tldrh\tr1, [r5]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tadd\tr1, r1, r8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tadd\tr2, r2, r0\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r2\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgSineTable\n.L7:\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r3\n\tstr\tr0, [r7, #0x8]\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r4\n.L9:\n\tstr\tr0, [r7, #0xc]\n\tldrh\tr0, [r5]\n\tldrh\tr6, [r6]\n\tadd\tr0, r0, r6\n\tldr\tr2, .L12\n\tadd\tr1, r2, #0\n\tand\tr0, r0, r1\n\tstrh\tr0, [r7]\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0x3ff\n.Lfe1:\n\t.size\t sa2__sub_8083504,.Lfe1-sa2__sub_8083504\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-13f369a7ed62.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8083504 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8083504` — benchmark function sa3:sa2__sub_8083504:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8083504:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8083504\n\t.type\t sa2__sub_8083504,function\n\t.thumb_func\nsa2__sub_8083504:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tadd\tr7, r2, #0\n\tmov\tr0, #0x2\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, [r6, #0x8]\n\tmul\tr0, r0, r1\n\tasr\tr3, r0, #0xa\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x2]\n\tb\t.L4\n.L3:\n\tldr\tr3, [r6, #0x8]\n.L4:\n\tmov\tr0, #0x4\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, [r6, #0xc]\n\tmul\tr0, r0, r1\n\tasr\tr4, r0, #0xa\n\tmov\tr2, #0x4\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x4]\n\tb\t.L6\n.L5:\n\tldr\tr4, [r6, #0xc]\n.L6:\n\tldrh\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr0, .L10\n\tmov\tip, r0\n\tldrh\tr1, [r5]\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tmov\tr8, r2\n\tadd\tr0, r1, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tsub\tr2, r2, r0\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r2\n\tstr\tr0, [r7, #0x8]\n\tldrh\tr1, [r5]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tadd\tr1, r1, r8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tadd\tr2, r2, r0\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r2\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgSineTable\n.L7:\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r3\n\tstr\tr0, [r7, #0x8]\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r4\n.L9:\n\tstr\tr0, [r7, #0xc]\n\tldrh\tr0, [r5]\n\tldrh\tr6, [r6]\n\tadd\tr0, r0, r6\n\tldr\tr2, .L12\n\tadd\tr1, r2, #0\n\tand\tr0, r0, r1\n\tstrh\tr0, [r7]\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0x3ff\n.Lfe1:\n\t.size\t sa2__sub_8083504,.Lfe1-sa2__sub_8083504\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_8083504\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8083504 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8083504` — benchmark function sa3:sa2__sub_8083504:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8083504:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8083504\n\t.type\t sa2__sub_8083504,function\n\t.thumb_func\nsa2__sub_8083504:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tadd\tr7, r2, #0\n\tmov\tr0, #0x2\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, [r6, #0x8]\n\tmul\tr0, r0, r1\n\tasr\tr3, r0, #0xa\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x2]\n\tb\t.L4\n.L3:\n\tldr\tr3, [r6, #0x8]\n.L4:\n\tmov\tr0, #0x4\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, [r6, #0xc]\n\tmul\tr0, r0, r1\n\tasr\tr4, r0, #0xa\n\tmov\tr2, #0x4\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x4]\n\tb\t.L6\n.L5:\n\tldr\tr4, [r6, #0xc]\n.L6:\n\tldrh\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr0, .L10\n\tmov\tip, r0\n\tldrh\tr1, [r5]\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tmov\tr8, r2\n\tadd\tr0, r1, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tsub\tr2, r2, r0\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r2\n\tstr\tr0, [r7, #0x8]\n\tldrh\tr1, [r5]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tadd\tr1, r1, r8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tadd\tr2, r2, r0\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r2\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgSineTable\n.L7:\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r3\n\tstr\tr0, [r7, #0x8]\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r4\n.L9:\n\tstr\tr0, [r7, #0xc]\n\tldrh\tr0, [r5]\n\tldrh\tr6, [r6]\n\tadd\tr0, r0, r6\n\tldr\tr2, .L12\n\tadd\tr1, r2, #0\n\tand\tr0, r0, r1\n\tstrh\tr0, [r7]\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0x3ff\n.Lfe1:\n\t.size\t sa2__sub_8083504,.Lfe1-sa2__sub_8083504\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_8083504\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8083504 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -11880,7 +11930,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80838CC` — benchmark function sa3:sa2__sub_80838CC:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80838CC\n\t.type\t sa2__sub_80838CC,function\n\t.thumb_func\nsa2__sub_80838CC:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x0\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x2\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x4\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x4]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x6\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr5, #0x4\n\tldrsh\tr4, [r0, r5]\n\tmov\tr6, #0x4\n\tldrsh\tr0, [r1, r6]\n\tmul\tr0, r0, r4\n\tsub\tr3, r3, r0\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x6]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_80838CC,.Lfe1-sa2__sub_80838CC\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80838CC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80838CC` — benchmark function sa3:sa2__sub_80838CC:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80838CC:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80838CC\n\t.type\t sa2__sub_80838CC,function\n\t.thumb_func\nsa2__sub_80838CC:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x0\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x2\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x4\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x4]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x6\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr5, #0x4\n\tldrsh\tr4, [r0, r5]\n\tmov\tr6, #0x4\n\tldrsh\tr0, [r1, r6]\n\tmul\tr0, r0, r4\n\tsub\tr3, r3, r0\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x6]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_80838CC,.Lfe1-sa2__sub_80838CC\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_80838CC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80838CC # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80838CC` — benchmark function sa3:sa2__sub_80838CC:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80838CC:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80838CC\n\t.type\t sa2__sub_80838CC,function\n\t.thumb_func\nsa2__sub_80838CC:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x0\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x2\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x4\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x4]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x6\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr5, #0x4\n\tldrsh\tr4, [r0, r5]\n\tmov\tr6, #0x4\n\tldrsh\tr0, [r1, r6]\n\tmul\tr0, r0, r4\n\tsub\tr3, r3, r0\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x6]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_80838CC,.Lfe1-sa2__sub_80838CC\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_80838CC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80838CC # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -11973,7 +12023,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_808399C` — benchmark function sa3:sa2__sub_808399C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808399C\n\t.type\t sa2__sub_808399C,function\n\t.thumb_func\nsa2__sub_808399C:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr4, #0x0\n\tldrsh\tr2, [r1, r4]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr6, [r0, r7]\n\tmov\tr4, #0x6\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr5, [r0, r7]\n\tmov\tr4, #0x4\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr4, [r0, r7]\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tsub\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x2\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x2]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x4\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x4]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x6\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr6, #0x2\n\tldrsh\tr3, [r1, r6]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr1, [r1, r7]\n\tmul\tr1, r1, r4\n\tsub\tr2, r2, r1\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_808399C,.Lfe1-sa2__sub_808399C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_808399C # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_808399C` — benchmark function sa3:sa2__sub_808399C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_808399C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808399C\n\t.type\t sa2__sub_808399C,function\n\t.thumb_func\nsa2__sub_808399C:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr4, #0x0\n\tldrsh\tr2, [r1, r4]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr6, [r0, r7]\n\tmov\tr4, #0x6\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr5, [r0, r7]\n\tmov\tr4, #0x4\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr4, [r0, r7]\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tsub\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x2\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x2]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x4\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x4]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x6\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr6, #0x2\n\tldrsh\tr3, [r1, r6]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr1, [r1, r7]\n\tmul\tr1, r1, r4\n\tsub\tr2, r2, r1\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_808399C,.Lfe1-sa2__sub_808399C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_808399C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_808399C # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_808399C` — benchmark function sa3:sa2__sub_808399C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_808399C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808399C\n\t.type\t sa2__sub_808399C,function\n\t.thumb_func\nsa2__sub_808399C:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr4, #0x0\n\tldrsh\tr2, [r1, r4]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr6, [r0, r7]\n\tmov\tr4, #0x6\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr5, [r0, r7]\n\tmov\tr4, #0x4\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr4, [r0, r7]\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tsub\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x2\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x2]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x4\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x4]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x6\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr6, #0x2\n\tldrsh\tr3, [r1, r6]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr1, [r1, r7]\n\tmul\tr1, r1, r4\n\tsub\tr2, r2, r1\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_808399C,.Lfe1-sa2__sub_808399C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_808399C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_808399C # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -12001,22 +12051,22 @@ "candidateLabel": "unsigned", "symbolsUsed": [], "outcome": "nonmatch", - "source": "s32 sa2__sub_808558C(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n if ((u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) <= 1 << (u8)a2 >> 1) {\n v0 = (u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) << 16;\n } else {\n v0 = (u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) - (1 << (u8)a2) << 16;\n }\n return v0 >> 16;\n}\n", - "score": 23, - "maxScore": 27, + "source": "s32 sa2__sub_808558C(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n if ((u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) <= (u32)(1 << (u8)a2) >> 1) {\n v0 = (u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) << 16;\n } else {\n v0 = (u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) - (1 << (u8)a2) << 16;\n }\n return v0 >> 16;\n}\n", + "score": 22, + "maxScore": 26, "compileErrors": null, "breakdown": { - "insert": 2, - "delete": 9, + "insert": 1, + "delete": 8, "replace": 4, "opMismatch": 1, - "argMismatch": 7 + "argMismatch": 8 }, "quality": { "score": 88, "lines": 9, "gotos": 0, - "casts": 14, + "casts": 15, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -12061,7 +12111,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_808558C` — benchmark function sa3:sa2__sub_808558C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808558C\n\t.type\t sa2__sub_808558C,function\n\t.thumb_func\nsa2__sub_808558C:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr4, #0x1\n\tlsl\tr4, r4, r2\n\tsub\tr1, r4, #0x1\n\tsub\tr0, r3, r0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tlsr\tr0, r4, #0x1\n\tcmp\tr3, r0\n\tbls\t.L3\t@cond_branch\n\tsub\tr0, r3, r4\n\tlsl\tr0, r0, #0x10\n\tb\t.L7\n.L3:\n\tlsl\tr0, r3, #0x10\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_808558C,.Lfe1-sa2__sub_808558C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_808558C # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_808558C` — benchmark function sa3:sa2__sub_808558C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_808558C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808558C\n\t.type\t sa2__sub_808558C,function\n\t.thumb_func\nsa2__sub_808558C:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr4, #0x1\n\tlsl\tr4, r4, r2\n\tsub\tr1, r4, #0x1\n\tsub\tr0, r3, r0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tlsr\tr0, r4, #0x1\n\tcmp\tr3, r0\n\tbls\t.L3\t@cond_branch\n\tsub\tr0, r3, r4\n\tlsl\tr0, r0, #0x10\n\tb\t.L7\n.L3:\n\tlsl\tr0, r3, #0x10\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_808558C,.Lfe1-sa2__sub_808558C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_808558C # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_808558C` — benchmark function sa3:sa2__sub_808558C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_808558C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808558C\n\t.type\t sa2__sub_808558C,function\n\t.thumb_func\nsa2__sub_808558C:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr4, #0x1\n\tlsl\tr4, r4, r2\n\tsub\tr1, r4, #0x1\n\tsub\tr0, r3, r0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tlsr\tr0, r4, #0x1\n\tcmp\tr3, r0\n\tbls\t.L3\t@cond_branch\n\tsub\tr0, r3, r4\n\tlsl\tr0, r0, #0x10\n\tb\t.L7\n.L3:\n\tlsl\tr0, r3, #0x10\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_808558C,.Lfe1-sa2__sub_808558C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_808558C # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -12085,10 +12135,10 @@ "asmlift": { "decompiler": "asmlift", "symbolMap": true, - "candidateLabel": "unsigned", + "candidateLabel": "signed", "symbolsUsed": [], "outcome": "nonmatch", - "source": "s32 sa2__sub_80855C0(u32 a0, u32 a1, u32 a2, u32 a3, u32 a4) {\n return a0 - __ashrdi3(__muldi3(a2, a2 >> 31, a0 - a1, a0 - a1 >> 31), a2 >> 31, (u8)a3, a0 - a1 >> 31);\n}\n", + "source": "s32 sa2__sub_80855C0(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4) {\n return a0 - __ashrdi3(__muldi3(a2, a2 >> 31, a0 - a1, a0 - a1 >> 31), a2 >> 31, (u8)a3, a0 - a1 >> 31);\n}\n", "score": 31, "maxScore": 38, "compileErrors": null, @@ -12148,7 +12198,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80855C0` — benchmark function sa3:sa2__sub_80855C0:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80855C0\n\t.type\t sa2__sub_80855C0,function\n\t.thumb_func\nsa2__sub_80855C0:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr6, r8\n\tpush\t{r6}\n\tmov\tr8, r0\n\tadd\tr4, r1, #0\n\tadd\tr0, r2, #0\n\tlsl\tr6, r3, #0x18\n\tlsr\tr6, r6, #0x18\n\tasr\tr1, r0, #0x1f\n\tmov\tr2, r8\n\tsub\tr4, r2, r4\n\tasr\tr5, r4, #0x1f\n\tadd\tr3, r5, #0\n\tadd\tr2, r4, #0\n\tbl\t__muldi3\n\tadd\tr2, r6, #0\n\tbl\t__ashrdi3\n\tmov\tr2, r8\n\tsub\tr2, r2, r0\n\tmov\tr8, r2\n\tmov\tr0, r8\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80855C0,.Lfe1-sa2__sub_80855C0\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80855C0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80855C0` — benchmark function sa3:sa2__sub_80855C0:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80855C0:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80855C0\n\t.type\t sa2__sub_80855C0,function\n\t.thumb_func\nsa2__sub_80855C0:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr6, r8\n\tpush\t{r6}\n\tmov\tr8, r0\n\tadd\tr4, r1, #0\n\tadd\tr0, r2, #0\n\tlsl\tr6, r3, #0x18\n\tlsr\tr6, r6, #0x18\n\tasr\tr1, r0, #0x1f\n\tmov\tr2, r8\n\tsub\tr4, r2, r4\n\tasr\tr5, r4, #0x1f\n\tadd\tr3, r5, #0\n\tadd\tr2, r4, #0\n\tbl\t__muldi3\n\tadd\tr2, r6, #0\n\tbl\t__ashrdi3\n\tmov\tr2, r8\n\tsub\tr2, r2, r0\n\tmov\tr8, r2\n\tmov\tr0, r8\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80855C0,.Lfe1-sa2__sub_80855C0\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80855C0 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80855C0` — benchmark function sa3:sa2__sub_80855C0:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80855C0:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80855C0\n\t.type\t sa2__sub_80855C0,function\n\t.thumb_func\nsa2__sub_80855C0:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr6, r8\n\tpush\t{r6}\n\tmov\tr8, r0\n\tadd\tr4, r1, #0\n\tadd\tr0, r2, #0\n\tlsl\tr6, r3, #0x18\n\tlsr\tr6, r6, #0x18\n\tasr\tr1, r0, #0x1f\n\tmov\tr2, r8\n\tsub\tr4, r2, r4\n\tasr\tr5, r4, #0x1f\n\tadd\tr3, r5, #0\n\tadd\tr2, r4, #0\n\tbl\t__muldi3\n\tadd\tr2, r6, #0\n\tbl\t__ashrdi3\n\tmov\tr2, r8\n\tsub\tr2, r2, r0\n\tmov\tr8, r2\n\tmov\tr0, r8\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80855C0,.Lfe1-sa2__sub_80855C0\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80855C0 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -12230,7 +12280,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085654` — benchmark function sa3:sa2__sub_8085654:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085654\n\t.type\t sa2__sub_8085654,function\n\t.thumb_func\nsa2__sub_8085654:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr4, r0, #0\n\tmov\tr8, r1\n\tadd\tr6, r2, #0\n\tldr\tr0, [sp, #0x18]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr7, r3, #0x18\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n.L3:\n\tadd\tr0, r6, #0\n\tasr\tr1, r6, #0x1f\n\tmov\tr3, r8\n\tsub\tr2, r4, r3\n\tasr\tr3, r2, #0x1f\n\tbl\t__muldi3\n\tadd\tr2, r7, #0\n\tbl\t__ashrdi3\n\tsub\tr4, r4, r0\n\tsub\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0xff\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r4, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8085654,.Lfe1-sa2__sub_8085654\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085654 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085654` — benchmark function sa3:sa2__sub_8085654:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085654:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085654\n\t.type\t sa2__sub_8085654,function\n\t.thumb_func\nsa2__sub_8085654:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr4, r0, #0\n\tmov\tr8, r1\n\tadd\tr6, r2, #0\n\tldr\tr0, [sp, #0x18]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr7, r3, #0x18\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n.L3:\n\tadd\tr0, r6, #0\n\tasr\tr1, r6, #0x1f\n\tmov\tr3, r8\n\tsub\tr2, r4, r3\n\tasr\tr3, r2, #0x1f\n\tbl\t__muldi3\n\tadd\tr2, r7, #0\n\tbl\t__ashrdi3\n\tsub\tr4, r4, r0\n\tsub\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0xff\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r4, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8085654,.Lfe1-sa2__sub_8085654\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085654 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085654` — benchmark function sa3:sa2__sub_8085654:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085654:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085654\n\t.type\t sa2__sub_8085654,function\n\t.thumb_func\nsa2__sub_8085654:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr4, r0, #0\n\tmov\tr8, r1\n\tadd\tr6, r2, #0\n\tldr\tr0, [sp, #0x18]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr7, r3, #0x18\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n.L3:\n\tadd\tr0, r6, #0\n\tasr\tr1, r6, #0x1f\n\tmov\tr3, r8\n\tsub\tr2, r4, r3\n\tasr\tr3, r2, #0x1f\n\tbl\t__muldi3\n\tadd\tr2, r7, #0\n\tbl\t__ashrdi3\n\tsub\tr4, r4, r0\n\tsub\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0xff\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r4, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8085654,.Lfe1-sa2__sub_8085654\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085654 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -12304,7 +12354,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80856DC` — benchmark function sa3:sa2__sub_80856DC:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856DC\n\t.type\t sa2__sub_80856DC,function\n\t.thumb_func\nsa2__sub_80856DC:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r3, #0x3\n\tsub\tr0, r0, r3\n\tlsl\tr3, r1, #0x1\n\tadd\tr3, r3, r1\n\tlsl\tr3, r3, #0x1\n\tadd\tr0, r0, r3\n\tsub\tr0, r0, r2\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856DC,.Lfe1-sa2__sub_80856DC\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80856DC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80856DC` — benchmark function sa3:sa2__sub_80856DC:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80856DC:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856DC\n\t.type\t sa2__sub_80856DC,function\n\t.thumb_func\nsa2__sub_80856DC:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r3, #0x3\n\tsub\tr0, r0, r3\n\tlsl\tr3, r1, #0x1\n\tadd\tr3, r3, r1\n\tlsl\tr3, r3, #0x1\n\tadd\tr0, r0, r3\n\tsub\tr0, r0, r2\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856DC,.Lfe1-sa2__sub_80856DC\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80856DC # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80856DC` — benchmark function sa3:sa2__sub_80856DC:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80856DC:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856DC\n\t.type\t sa2__sub_80856DC,function\n\t.thumb_func\nsa2__sub_80856DC:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r3, #0x3\n\tsub\tr0, r0, r3\n\tlsl\tr3, r1, #0x1\n\tadd\tr3, r3, r1\n\tlsl\tr3, r3, #0x1\n\tadd\tr0, r0, r3\n\tsub\tr0, r0, r2\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856DC,.Lfe1-sa2__sub_80856DC\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80856DC # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -12378,7 +12428,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80856F8` — benchmark function sa3:sa2__sub_80856F8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856F8\n\t.type\t sa2__sub_80856F8,function\n\t.thumb_func\nsa2__sub_80856F8:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r3\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856F8,.Lfe1-sa2__sub_80856F8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80856F8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80856F8` — benchmark function sa3:sa2__sub_80856F8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80856F8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856F8\n\t.type\t sa2__sub_80856F8,function\n\t.thumb_func\nsa2__sub_80856F8:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r3\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856F8,.Lfe1-sa2__sub_80856F8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80856F8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80856F8` — benchmark function sa3:sa2__sub_80856F8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80856F8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856F8\n\t.type\t sa2__sub_80856F8,function\n\t.thumb_func\nsa2__sub_80856F8:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r3\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856F8,.Lfe1-sa2__sub_80856F8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80856F8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -12452,7 +12502,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085714` — benchmark function sa3:sa2__sub_8085714:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085714\n\t.type\t sa2__sub_8085714,function\n\t.thumb_func\nsa2__sub_8085714:\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r0, r1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085714,.Lfe1-sa2__sub_8085714\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085714 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085714` — benchmark function sa3:sa2__sub_8085714:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085714:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085714\n\t.type\t sa2__sub_8085714,function\n\t.thumb_func\nsa2__sub_8085714:\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r0, r1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085714,.Lfe1-sa2__sub_8085714\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085714 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085714` — benchmark function sa3:sa2__sub_8085714:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085714:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085714\n\t.type\t sa2__sub_8085714,function\n\t.thumb_func\nsa2__sub_8085714:\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r0, r1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085714,.Lfe1-sa2__sub_8085714\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085714 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -12526,7 +12576,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085720` — benchmark function sa3:sa2__sub_8085720:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085720\n\t.type\t sa2__sub_8085720,function\n\t.thumb_func\nsa2__sub_8085720:\n\tlsl\tr1, r1, #0x3\n\tsub\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tasr\tr1, r1, #0x3\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085720,.Lfe1-sa2__sub_8085720\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085720 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085720` — benchmark function sa3:sa2__sub_8085720:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085720:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085720\n\t.type\t sa2__sub_8085720,function\n\t.thumb_func\nsa2__sub_8085720:\n\tlsl\tr1, r1, #0x3\n\tsub\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tasr\tr1, r1, #0x3\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085720,.Lfe1-sa2__sub_8085720\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085720 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085720` — benchmark function sa3:sa2__sub_8085720:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085720:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085720\n\t.type\t sa2__sub_8085720,function\n\t.thumb_func\nsa2__sub_8085720:\n\tlsl\tr1, r1, #0x3\n\tsub\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tasr\tr1, r1, #0x3\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085720,.Lfe1-sa2__sub_8085720\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085720 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -12599,7 +12649,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085758` — benchmark function sa3:sa2__sub_8085758:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085758\n\t.type\t sa2__sub_8085758,function\n\t.thumb_func\nsa2__sub_8085758:\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085758,.Lfe1-sa2__sub_8085758\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085758 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085758` — benchmark function sa3:sa2__sub_8085758:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085758:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085758\n\t.type\t sa2__sub_8085758,function\n\t.thumb_func\nsa2__sub_8085758:\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085758,.Lfe1-sa2__sub_8085758\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085758 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085758` — benchmark function sa3:sa2__sub_8085758:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085758:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085758\n\t.type\t sa2__sub_8085758,function\n\t.thumb_func\nsa2__sub_8085758:\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085758,.Lfe1-sa2__sub_8085758\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085758 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -12673,7 +12723,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085798` — benchmark function sa3:sa2__sub_8085798:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085798\n\t.type\t sa2__sub_8085798,function\n\t.thumb_func\nsa2__sub_8085798:\n\tsub\tr0, r2, r0\n\tasr\tr2, r0, #0x1\n\tadd\tr0, r0, r2\n\tasr\tr1, r1, #0x1\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085798,.Lfe1-sa2__sub_8085798\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085798 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085798` — benchmark function sa3:sa2__sub_8085798:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085798:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085798\n\t.type\t sa2__sub_8085798,function\n\t.thumb_func\nsa2__sub_8085798:\n\tsub\tr0, r2, r0\n\tasr\tr2, r0, #0x1\n\tadd\tr0, r0, r2\n\tasr\tr1, r1, #0x1\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085798,.Lfe1-sa2__sub_8085798\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085798 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085798` — benchmark function sa3:sa2__sub_8085798:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085798:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085798\n\t.type\t sa2__sub_8085798,function\n\t.thumb_func\nsa2__sub_8085798:\n\tsub\tr0, r2, r0\n\tasr\tr2, r0, #0x1\n\tadd\tr0, r0, r2\n\tasr\tr1, r1, #0x1\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085798,.Lfe1-sa2__sub_8085798\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085798 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -12747,7 +12797,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_808595C` — benchmark function sa3:sa2__sub_808595C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808595C\n\t.type\t sa2__sub_808595C,function\n\t.thumb_func\nsa2__sub_808595C:\n\tsub\tr0, r1, r0\n\tsub\tr2, r2, r1\n\tsub\tr2, r2, r0\n\tasr\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_808595C,.Lfe1-sa2__sub_808595C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_808595C # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_808595C` — benchmark function sa3:sa2__sub_808595C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_808595C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808595C\n\t.type\t sa2__sub_808595C,function\n\t.thumb_func\nsa2__sub_808595C:\n\tsub\tr0, r1, r0\n\tsub\tr2, r2, r1\n\tsub\tr2, r2, r0\n\tasr\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_808595C,.Lfe1-sa2__sub_808595C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_808595C # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_808595C` — benchmark function sa3:sa2__sub_808595C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_808595C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808595C\n\t.type\t sa2__sub_808595C,function\n\t.thumb_func\nsa2__sub_808595C:\n\tsub\tr0, r1, r0\n\tsub\tr2, r2, r1\n\tsub\tr2, r2, r0\n\tasr\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_808595C,.Lfe1-sa2__sub_808595C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_808595C # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -12835,7 +12885,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `SeedRng` — benchmark function sa3:SeedRng:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSeedRng\n\t.type\t SeedRng,function\n\t.thumb_func\nSeedRng:\n\tldr\tr2, .L3\n\tstr\tr0, [r2]\n\tldr\tr0, .L3+0x4\n\tstr\tr1, [r0]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n.Lfe1:\n\t.size\t SeedRng,.Lfe1-SeedRng\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function SeedRng # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `SeedRng` — benchmark function sa3:SeedRng:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:SeedRng:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSeedRng\n\t.type\t SeedRng,function\n\t.thumb_func\nSeedRng:\n\tldr\tr2, .L3\n\tstr\tr0, [r2]\n\tldr\tr0, .L3+0x4\n\tstr\tr1, [r0]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n.Lfe1:\n\t.size\t SeedRng,.Lfe1-SeedRng\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"SeedRng\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name SeedRng # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `SeedRng` — benchmark function sa3:SeedRng:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:SeedRng:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSeedRng\n\t.type\t SeedRng,function\n\t.thumb_func\nSeedRng:\n\tldr\tr2, .L3\n\tstr\tr0, [r2]\n\tldr\tr0, .L3+0x4\n\tstr\tr1, [r0]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n.Lfe1:\n\t.size\t SeedRng,.Lfe1-SeedRng\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"SeedRng\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name SeedRng # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -12923,7 +12973,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `VerifyFlashSector_Core` — benchmark function sa3:VerifyFlashSector_Core:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVerifyFlashSector_Core\n\t.type\t VerifyFlashSector_Core,function\n\t.thumb_func\nVerifyFlashSector_Core:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr2, r2, #0x1\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr2, r0\n\tbeq\t.L4\t@cond_branch\n\tadd\tr5, r0, #0\n.L5:\n\tldrb\tr1, [r3]\n\tldrb\tr0, [r4]\n\tadd\tr4, r4, #0x1\n\tadd\tr3, r3, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r3, #0x1\n\tb\t.L8\n.L3:\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, r5\n\tbne\t.L5\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L8:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t VerifyFlashSector_Core,.Lfe1-VerifyFlashSector_Core\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function VerifyFlashSector_Core # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `VerifyFlashSector_Core` — benchmark function sa3:VerifyFlashSector_Core:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:VerifyFlashSector_Core:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVerifyFlashSector_Core\n\t.type\t VerifyFlashSector_Core,function\n\t.thumb_func\nVerifyFlashSector_Core:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr2, r2, #0x1\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr2, r0\n\tbeq\t.L4\t@cond_branch\n\tadd\tr5, r0, #0\n.L5:\n\tldrb\tr1, [r3]\n\tldrb\tr0, [r4]\n\tadd\tr4, r4, #0x1\n\tadd\tr3, r3, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r3, #0x1\n\tb\t.L8\n.L3:\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, r5\n\tbne\t.L5\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L8:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t VerifyFlashSector_Core,.Lfe1-VerifyFlashSector_Core\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VerifyFlashSector_Core # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `VerifyFlashSector_Core` — benchmark function sa3:VerifyFlashSector_Core:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:VerifyFlashSector_Core:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVerifyFlashSector_Core\n\t.type\t VerifyFlashSector_Core,function\n\t.thumb_func\nVerifyFlashSector_Core:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr2, r2, #0x1\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr2, r0\n\tbeq\t.L4\t@cond_branch\n\tadd\tr5, r0, #0\n.L5:\n\tldrb\tr1, [r3]\n\tldrb\tr0, [r4]\n\tadd\tr4, r4, #0x1\n\tadd\tr3, r3, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r3, #0x1\n\tb\t.L8\n.L3:\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, r5\n\tbne\t.L5\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L8:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t VerifyFlashSector_Core,.Lfe1-VerifyFlashSector_Core\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VerifyFlashSector_Core # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -12961,22 +13011,22 @@ } ], "outcome": "nonmatch", - "source": "s32 VramGetTotalAllocatedTiles(void) {\n s32 v0;\n s32 v1;\n s32 v2;\n v0 = gVramHeapMaxTileSlots;\n if (0 >= v0 >> 2) {\n v2 = 0;\n } else {\n v1 = 0;\n v2 = 0;\n do {\n if (gVramHeapState[v1] != 0) {\n v2 = (u16)(v2 + gVramHeapState[v1]);\n v1 = (u16)(gVramHeapState[v1] + (v1 + 65535));\n }\n v1 = (u16)(v1 + 1);\n } while (v1 < v0 >> 2);\n }\n return v2 << 18 >> 16;\n}\n", - "score": 25, + "source": "s32 VramGetTotalAllocatedTiles(void) {\n s32 v0;\n s32 v1;\n s32 v2;\n v0 = gVramHeapMaxTileSlots;\n if (0 >= (u32)v0 >> 2) {\n v2 = 0;\n } else {\n v1 = 0;\n v2 = 0;\n do {\n if (gVramHeapState[v1] != 0) {\n v2 = (u16)(v2 + gVramHeapState[v1]);\n v1 = (u16)(gVramHeapState[v1] + (v1 + 65535));\n }\n v1 = (u16)(v1 + 1);\n } while (v1 < (u32)v0 >> 2);\n }\n return (u32)(v2 << 18) >> 16;\n}\n", + "score": 22, "maxScore": 43, "compileErrors": null, "breakdown": { "insert": 6, "delete": 4, - "replace": 2, - "opMismatch": 2, + "replace": 0, + "opMismatch": 1, "argMismatch": 11 }, "quality": { - "score": 96, + "score": 90, "lines": 20, "gotos": 0, - "casts": 4, + "casts": 7, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -13021,7 +13071,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `VramGetTotalAllocatedTiles` — benchmark function sa3:VramGetTotalAllocatedTiles:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramGetTotalAllocatedTiles\n\t.type\t VramGetTotalAllocatedTiles,function\n\t.thumb_func\nVramGetTotalAllocatedTiles:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tldr\tr0, .L9\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L9+0x4\n\tadd\tr4, r0, #0\n\tldr\tr0, .L9+0x8\n\tadd\tr5, r0, #0\n.L6:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, r5\n\tadd\tr0, r1, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tcmp\tr2, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tlsl\tr0, r3, #0x12\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\t0xffff\n.Lfe1:\n\t.size\t VramGetTotalAllocatedTiles,.Lfe1-VramGetTotalAllocatedTiles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-648ffdb40ca9.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu16 VramGetTotalAllocatedTiles(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function VramGetTotalAllocatedTiles # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `VramGetTotalAllocatedTiles` — benchmark function sa3:VramGetTotalAllocatedTiles:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:VramGetTotalAllocatedTiles:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramGetTotalAllocatedTiles\n\t.type\t VramGetTotalAllocatedTiles,function\n\t.thumb_func\nVramGetTotalAllocatedTiles:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tldr\tr0, .L9\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L9+0x4\n\tadd\tr4, r0, #0\n\tldr\tr0, .L9+0x8\n\tadd\tr5, r0, #0\n.L6:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, r5\n\tadd\tr0, r1, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tcmp\tr2, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tlsl\tr0, r3, #0x12\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\t0xffff\n.Lfe1:\n\t.size\t VramGetTotalAllocatedTiles,.Lfe1-VramGetTotalAllocatedTiles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VramGetTotalAllocatedTiles # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `VramGetTotalAllocatedTiles` — benchmark function sa3:VramGetTotalAllocatedTiles:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:VramGetTotalAllocatedTiles:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramGetTotalAllocatedTiles\n\t.type\t VramGetTotalAllocatedTiles,function\n\t.thumb_func\nVramGetTotalAllocatedTiles:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tldr\tr0, .L9\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L9+0x4\n\tadd\tr4, r0, #0\n\tldr\tr0, .L9+0x8\n\tadd\tr5, r0, #0\n.L6:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, r5\n\tadd\tr0, r1, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tcmp\tr2, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tlsl\tr0, r3, #0x12\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\t0xffff\n.Lfe1:\n\t.size\t VramGetTotalAllocatedTiles,.Lfe1-VramGetTotalAllocatedTiles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VramGetTotalAllocatedTiles # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -13106,7 +13156,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `VramMalloc` — benchmark function sa3:VramMalloc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramMalloc\n\t.type\t VramMalloc,function\n\t.thumb_func\nVramMalloc:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tr5, r0, #0\n\tadd\tr0, r5, #0x3\n\tlsr\tr5, r0, #0x2\n\tmov\tr4, #0x0\n\tldr\tr1, .L20\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tmov\tr9, r1\n\tcmp\tr4, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tmov\tr8, r0\n.L6:\n\tlsl\tr1, r4, #0x1\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tldrh\tr2, [r0]\n\tcmp\tr2, #0\n\tbne\t.L7\t@cond_branch\n\tmov\tr3, #0x0\n\tldr\tr7, .L20\n\tmov\tip, r7\n\tldr\tr0, .L20+0x4\n\tmov\tsl, r0\n\tldr\tr6, .L20+0x8\n\tb\t.L8\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\tewram_end\n.L10:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n.L8:\n\tcmp\tr3, r5\n\tbcs\t.L9\t@cond_branch\n\tadd\tr2, r4, r3\n\tmov\tr7, ip\n\tldrh\tr0, [r7]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr2, r0\n\tblt\t.L12\t@cond_branch\n\tldr\tr0, [r6]\n\tb\t.L19\n.L12:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, sl\n\tldrh\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n.L9:\n\tcmp\tr3, r5\n\tbne\t.L5\t@cond_branch\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tstrh\tr5, [r0]\n\tldr\tr0, .L22\n\tlsl\tr1, r4, #0x7\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tb\t.L19\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgVramHeapStartAddr\n.L7:\n\tldr\tr7, .L24\n\tadd\tr0, r4, r7\n\tadd\tr0, r2, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr1, r9\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr4, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L24+0x4\n\tldr\tr0, [r0]\n.L19:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\t0xffff\n\t.word\tewram_end\n.Lfe1:\n\t.size\t VramMalloc,.Lfe1-VramMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-648ffdb40ca9.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *VramMalloc(u32 numTiles);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function VramMalloc # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `VramMalloc` — benchmark function sa3:VramMalloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:VramMalloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramMalloc\n\t.type\t VramMalloc,function\n\t.thumb_func\nVramMalloc:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tr5, r0, #0\n\tadd\tr0, r5, #0x3\n\tlsr\tr5, r0, #0x2\n\tmov\tr4, #0x0\n\tldr\tr1, .L20\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tmov\tr9, r1\n\tcmp\tr4, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tmov\tr8, r0\n.L6:\n\tlsl\tr1, r4, #0x1\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tldrh\tr2, [r0]\n\tcmp\tr2, #0\n\tbne\t.L7\t@cond_branch\n\tmov\tr3, #0x0\n\tldr\tr7, .L20\n\tmov\tip, r7\n\tldr\tr0, .L20+0x4\n\tmov\tsl, r0\n\tldr\tr6, .L20+0x8\n\tb\t.L8\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\tewram_end\n.L10:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n.L8:\n\tcmp\tr3, r5\n\tbcs\t.L9\t@cond_branch\n\tadd\tr2, r4, r3\n\tmov\tr7, ip\n\tldrh\tr0, [r7]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr2, r0\n\tblt\t.L12\t@cond_branch\n\tldr\tr0, [r6]\n\tb\t.L19\n.L12:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, sl\n\tldrh\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n.L9:\n\tcmp\tr3, r5\n\tbne\t.L5\t@cond_branch\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tstrh\tr5, [r0]\n\tldr\tr0, .L22\n\tlsl\tr1, r4, #0x7\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tb\t.L19\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgVramHeapStartAddr\n.L7:\n\tldr\tr7, .L24\n\tadd\tr0, r4, r7\n\tadd\tr0, r2, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr1, r9\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr4, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L24+0x4\n\tldr\tr0, [r0]\n.L19:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\t0xffff\n\t.word\tewram_end\n.Lfe1:\n\t.size\t VramMalloc,.Lfe1-VramMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VramMalloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `VramMalloc` — benchmark function sa3:VramMalloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:VramMalloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramMalloc\n\t.type\t VramMalloc,function\n\t.thumb_func\nVramMalloc:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tr5, r0, #0\n\tadd\tr0, r5, #0x3\n\tlsr\tr5, r0, #0x2\n\tmov\tr4, #0x0\n\tldr\tr1, .L20\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tmov\tr9, r1\n\tcmp\tr4, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tmov\tr8, r0\n.L6:\n\tlsl\tr1, r4, #0x1\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tldrh\tr2, [r0]\n\tcmp\tr2, #0\n\tbne\t.L7\t@cond_branch\n\tmov\tr3, #0x0\n\tldr\tr7, .L20\n\tmov\tip, r7\n\tldr\tr0, .L20+0x4\n\tmov\tsl, r0\n\tldr\tr6, .L20+0x8\n\tb\t.L8\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\tewram_end\n.L10:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n.L8:\n\tcmp\tr3, r5\n\tbcs\t.L9\t@cond_branch\n\tadd\tr2, r4, r3\n\tmov\tr7, ip\n\tldrh\tr0, [r7]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr2, r0\n\tblt\t.L12\t@cond_branch\n\tldr\tr0, [r6]\n\tb\t.L19\n.L12:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, sl\n\tldrh\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n.L9:\n\tcmp\tr3, r5\n\tbne\t.L5\t@cond_branch\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tstrh\tr5, [r0]\n\tldr\tr0, .L22\n\tlsl\tr1, r4, #0x7\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tb\t.L19\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgVramHeapStartAddr\n.L7:\n\tldr\tr7, .L24\n\tadd\tr0, r4, r7\n\tadd\tr0, r2, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr1, r9\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr4, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L24+0x4\n\tldr\tr0, [r0]\n.L19:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\t0xffff\n\t.word\tewram_end\n.Lfe1:\n\t.size\t VramMalloc,.Lfe1-VramMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VramMalloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -13204,7 +13254,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80014440_15040` — benchmark function snowboardkids2:func_80014440_15040:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80014440_15040\n lui\t$v0, %hi(gDefaultFontPalette)\n addiu\t$v0, $v0, %lo(gDefaultFontPalette)\n sh\t$zero, 0($v0)\n li\t$a0, 1\n li\t$a1, 0xffff\n addiu\t$v1, $v0, 2\n.L18:\n sh\t$a1, 0($v1)\n addiu\t$a0, $a0, 1\n slti\t$v0, $a0, 256\n bnez\t$v0, .L18\n addiu\t$v1, $v1, 2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80014440_15040 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80014440_15040` — benchmark function snowboardkids2:func_80014440_15040:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80014440_15040:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\taddiu\tv0,v0,0\n 8:\tsh\tzero,0(v0)\n c:\tli\ta0,1\n 10:\tli\ta1,0xffff\n 14:\taddiu\tv1,v0,2\n 18:\tsh\ta1,0(v1)\n 1c:\taddiu\ta0,a0,1\n 20:\tslti\tv0,a0,256\n 24:\tbnez\tv0,18 \n 28:\taddiu\tv1,v1,2\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-4d63b4a654117c31/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_80014440_15040\n00000000 *UND*\t00000000 gDefaultFontPalette\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gDefaultFontPalette\n00000004 R_MIPS_LO16 gDefaultFontPalette\n\n\nContents of section .text:\n 0000 3c020000 24420000 a4400000 24040001 <...$B...@..$...\n 0010 3405ffff 24430002 a4650000 24840001 4...$C...e..$...\n 0020 28820100 1440fffc 24630002 03e00008 (....@..$c......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80014440_15040\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80014440_15040 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80014440_15040` — benchmark function snowboardkids2:func_80014440_15040:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80014440_15040:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\taddiu\tv0,v0,0\n 8:\tsh\tzero,0(v0)\n c:\tli\ta0,1\n 10:\tli\ta1,0xffff\n 14:\taddiu\tv1,v0,2\n 18:\tsh\ta1,0(v1)\n 1c:\taddiu\ta0,a0,1\n 20:\tslti\tv0,a0,256\n 24:\tbnez\tv0,18 \n 28:\taddiu\tv1,v1,2\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-4d63b4a654117c31/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_80014440_15040\n00000000 *UND*\t00000000 gDefaultFontPalette\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gDefaultFontPalette\n00000004 R_MIPS_LO16 gDefaultFontPalette\n\n\nContents of section .text:\n 0000 3c020000 24420000 a4400000 24040001 <...$B...@..$...\n 0010 3405ffff 24430002 a4650000 24840001 4...$C...e..$...\n 0020 28820100 1440fffc 24630002 03e00008 (....@..$c......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80014440_15040\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80014440_15040 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -13286,7 +13336,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_800154A8_160A8` — benchmark function snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800154A8_160A8\n andi\t$a1, $a1, 0xffff\n beqz\t$a1, .L24\n nop\n addu\t$a1, $a1, $a0\n sb\t$zero, 0($a0)\n.L14:\n addiu\t$a0, $a0, 1\n slt\t$v0, $a0, $a1\n bnezl\t$v0, .L14\n sb\t$zero, 0($a0)\n.L24:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800154A8_160A8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800154A8_160A8` — benchmark function snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta1,a1,0xffff\n 4:\tbeqz\ta1,24 \n 8:\tnop\n c:\taddu\ta1,a1,a0\n 10:\tsb\tzero,0(a0)\n 14:\taddiu\ta0,a0,1\n 18:\tslt\tv0,a0,a1\n 1c:\tbnezl\tv0,14 \n 20:\tsb\tzero,0(a0)\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dd25ecd019108913/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_800154A8_160A8\n\n\nContents of section .text:\n 0000 30a5ffff 10a00007 00000000 00a42821 0.............(!\n 0010 a0800000 24840001 0085102a 5440fffd ....$......*T@..\n 0020 a0800000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800154A8_160A8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800154A8_160A8` — benchmark function snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta1,a1,0xffff\n 4:\tbeqz\ta1,24 \n 8:\tnop\n c:\taddu\ta1,a1,a0\n 10:\tsb\tzero,0(a0)\n 14:\taddiu\ta0,a0,1\n 18:\tslt\tv0,a0,a1\n 1c:\tbnezl\tv0,14 \n 20:\tsb\tzero,0(a0)\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dd25ecd019108913/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_800154A8_160A8\n\n\nContents of section .text:\n 0000 30a5ffff 10a00007 00000000 00a42821 0.............(!\n 0010 a0800000 24840001 0085102a 5440fffd ....$......*T@..\n 0020 a0800000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800154A8_160A8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -13376,7 +13426,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_800167B0_173B0` — benchmark function snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800167B0_173B0\n addiu\t$sp, $sp, -24\n move\t$a3, $a0\n sw\t$ra, 16($sp)\n lbu\t$v0, 12($a3)\n bnez\t$v0, .L60\n addiu\t$v0, $v0, -1\n lbu\t$v0, 13($a3)\n addiu\t$v0, $v0, 1\n sb\t$v0, 13($a3)\n andi\t$v0, $v0, 0x1\n bnez\t$v0, .L48\n nop\n lbu\t$v0, 14($a3)\n addiu\t$v0, $v0, 1\n andi\t$v0, $v0, 0x1\n sb\t$v0, 14($a3)\n addiu\t$v0, $v0, 7\n sh\t$v0, 8($a3)\n.L48:\n lbu\t$v1, 13($a3)\n li\t$v0, 16\n bne\t$v1, $v0, .L68\n li\t$a0, 8\n li\t$v0, 30\n sb\t$zero, 13($a3)\n.L60:\n sb\t$v0, 12($a3)\n li\t$a0, 8\n.L68:\n lui\t$a2, %hi(func_8000FED0_10AD0)\n addiu\t$a2, $a2, %lo(func_8000FED0_10AD0)\n jal\tdebugEnqueueCallback\n li\t$a1, 1\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-02e6b011bd38.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800167B0_173B0(Struct16728 *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800167B0_173B0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800167B0_173B0` — benchmark function snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tmove\ta3,a0\n 8:\tsw\tra,16(sp)\n c:\tlbu\tv0,12(a3)\n 10:\tbnez\tv0,60 \n 14:\taddiu\tv0,v0,-1\n 18:\tlbu\tv0,13(a3)\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\tv0,13(a3)\n 24:\tandi\tv0,v0,0x1\n 28:\tbnez\tv0,48 \n 2c:\tnop\n 30:\tlbu\tv0,14(a3)\n 34:\taddiu\tv0,v0,1\n 38:\tandi\tv0,v0,0x1\n 3c:\tsb\tv0,14(a3)\n 40:\taddiu\tv0,v0,7\n 44:\tsh\tv0,8(a3)\n 48:\tlbu\tv1,13(a3)\n 4c:\tli\tv0,16\n 50:\tbne\tv1,v0,68 \n 54:\tli\ta0,8\n 58:\tli\tv0,30\n 5c:\tsb\tzero,13(a3)\n 60:\tsb\tv0,12(a3)\n 64:\tli\ta0,8\n 68:\tlui\ta2,0x0\n 6c:\taddiu\ta2,a2,0\n 70:\tjal\t0 \n 74:\tli\ta1,1\n 78:\tlw\tra,16(sp)\n 7c:\tjr\tra\n 80:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0966834a6ef2f06d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800167B0_173B0\n00000000 *UND*\t00000000 func_8000FED0_10AD0\n00000000 *UND*\t00000000 debugEnqueueCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000068 R_MIPS_HI16 func_8000FED0_10AD0\n0000006c R_MIPS_LO16 func_8000FED0_10AD0\n00000070 R_MIPS_26 debugEnqueueCallback\n\n\nContents of section .text:\n 0000 27bdffe8 00803821 afbf0010 90e2000c '.....8!........\n 0010 14400013 2442ffff 90e2000d 24420001 .@..$B......$B..\n 0020 a0e2000d 30420001 14400007 00000000 ....0B...@......\n 0030 90e2000e 24420001 30420001 a0e2000e ....$B..0B......\n 0040 24420007 a4e20008 90e3000d 24020010 $B..........$...\n 0050 14620005 24040008 2402001e a0e0000d .b..$...$.......\n 0060 a0e2000c 24040008 3c060000 24c60000 ....$...<...$...\n 0070 0c000000 24050001 8fbf0010 03e00008 ....$...........\n 0080 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800167B0_173B0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800167B0_173B0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800167B0_173B0` — benchmark function snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tmove\ta3,a0\n 8:\tsw\tra,16(sp)\n c:\tlbu\tv0,12(a3)\n 10:\tbnez\tv0,60 \n 14:\taddiu\tv0,v0,-1\n 18:\tlbu\tv0,13(a3)\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\tv0,13(a3)\n 24:\tandi\tv0,v0,0x1\n 28:\tbnez\tv0,48 \n 2c:\tnop\n 30:\tlbu\tv0,14(a3)\n 34:\taddiu\tv0,v0,1\n 38:\tandi\tv0,v0,0x1\n 3c:\tsb\tv0,14(a3)\n 40:\taddiu\tv0,v0,7\n 44:\tsh\tv0,8(a3)\n 48:\tlbu\tv1,13(a3)\n 4c:\tli\tv0,16\n 50:\tbne\tv1,v0,68 \n 54:\tli\ta0,8\n 58:\tli\tv0,30\n 5c:\tsb\tzero,13(a3)\n 60:\tsb\tv0,12(a3)\n 64:\tli\ta0,8\n 68:\tlui\ta2,0x0\n 6c:\taddiu\ta2,a2,0\n 70:\tjal\t0 \n 74:\tli\ta1,1\n 78:\tlw\tra,16(sp)\n 7c:\tjr\tra\n 80:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0966834a6ef2f06d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800167B0_173B0\n00000000 *UND*\t00000000 func_8000FED0_10AD0\n00000000 *UND*\t00000000 debugEnqueueCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000068 R_MIPS_HI16 func_8000FED0_10AD0\n0000006c R_MIPS_LO16 func_8000FED0_10AD0\n00000070 R_MIPS_26 debugEnqueueCallback\n\n\nContents of section .text:\n 0000 27bdffe8 00803821 afbf0010 90e2000c '.....8!........\n 0010 14400013 2442ffff 90e2000d 24420001 .@..$B......$B..\n 0020 a0e2000d 30420001 14400007 00000000 ....0B...@......\n 0030 90e2000e 24420001 30420001 a0e2000e ....$B..0B......\n 0040 24420007 a4e20008 90e3000d 24020010 $B..........$...\n 0050 14620005 24040008 2402001e a0e0000d .b..$...$.......\n 0060 a0e2000c 24040008 3c060000 24c60000 ....$...<...$...\n 0070 0c000000 24050001 8fbf0010 03e00008 ....$...........\n 0080 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800167B0_173B0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800167B0_173B0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -13451,7 +13501,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80018DC0_199C0` — benchmark function snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80018DC0_199C0\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tallocateTaskMemory\n li\t$a0, 4\n sb\t$zero, 2($v0)\n lui\t$v1, %hi(D_800A8CC8_A0038)\n lbu\t$v1, %lo(D_800A8CC8_A0038)($v1)\n sh\t$zero, 0($v0)\n li\t$v0, 4\n beq\t$v1, $v0, .L34\n nop\n jal\tfunc_800574A0_580A0\n li\t$a0, 2\n.L34:\n lui\t$v0, %hi(D_800A8CC8_A0038)\n lbu\t$v0, %lo(D_800A8CC8_A0038)($v0)\n sll\t$v0, $v0, 0x2\n lui\t$a0, %hi(D_8008D78C_8E38C)\n addu\t$a0, $a0, $v0\n lw\t$a0, %lo(D_8008D78C_8E38C)($a0)\n jal\tcreateTaskQueue\n li\t$a1, 90\n lui\t$a0, %hi(func_80018E2C_19A2C)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80018E2C_19A2C)\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-163252facba5.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80018DC0_199C0(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80018DC0_199C0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80018DC0_199C0` — benchmark function snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tli\ta0,4\n 10:\tsb\tzero,2(v0)\n 14:\tlui\tv1,0x0\n 18:\tlbu\tv1,0(v1)\n 1c:\tsh\tzero,0(v0)\n 20:\tli\tv0,4\n 24:\tbeq\tv1,v0,34 \n 28:\tnop\n 2c:\tjal\t0 \n 30:\tli\ta0,2\n 34:\tlui\tv0,0x0\n 38:\tlbu\tv0,0(v0)\n 3c:\tsll\tv0,v0,0x2\n 40:\tlui\ta0,0x0\n 44:\taddu\ta0,a0,v0\n 48:\tlw\ta0,0(a0)\n 4c:\tjal\t0 \n 50:\tli\ta1,90\n 54:\tlui\ta0,0x0\n 58:\tjal\t0 \n 5c:\taddiu\ta0,a0,0\n 60:\tlw\tra,16(sp)\n 64:\tjr\tra\n 68:\taddiu\tsp,sp,24\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-72d0c8d03e081c13/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80018DC0_199C0\n00000000 *UND*\t00000000 allocateTaskMemory\n00000000 *UND*\t00000000 D_800A8CC8_A0038\n00000000 *UND*\t00000000 func_800574A0_580A0\n00000000 *UND*\t00000000 D_8008D78C_8E38C\n00000000 *UND*\t00000000 createTaskQueue\n00000000 *UND*\t00000000 func_80018E2C_19A2C\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 allocateTaskMemory\n00000014 R_MIPS_HI16 D_800A8CC8_A0038\n00000018 R_MIPS_LO16 D_800A8CC8_A0038\n0000002c R_MIPS_26 func_800574A0_580A0\n00000034 R_MIPS_HI16 D_800A8CC8_A0038\n00000038 R_MIPS_LO16 D_800A8CC8_A0038\n00000040 R_MIPS_HI16 D_8008D78C_8E38C\n00000048 R_MIPS_LO16 D_8008D78C_8E38C\n0000004c R_MIPS_26 createTaskQueue\n00000054 R_MIPS_HI16 func_80018E2C_19A2C\n0000005c R_MIPS_LO16 func_80018E2C_19A2C\n00000058 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 24040004 '...........$...\n 0010 a0400002 3c030000 90630000 a4400000 .@..<....c...@..\n 0020 24020004 10620003 00000000 0c000000 $....b..........\n 0030 24040002 3c020000 90420000 00021080 $...<....B......\n 0040 3c040000 00822021 8c840000 0c000000 <..... !........\n 0050 2405005a 3c040000 0c000000 24840000 $..Z<.......$...\n 0060 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80018DC0_199C0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80018DC0_199C0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80018DC0_199C0` — benchmark function snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tli\ta0,4\n 10:\tsb\tzero,2(v0)\n 14:\tlui\tv1,0x0\n 18:\tlbu\tv1,0(v1)\n 1c:\tsh\tzero,0(v0)\n 20:\tli\tv0,4\n 24:\tbeq\tv1,v0,34 \n 28:\tnop\n 2c:\tjal\t0 \n 30:\tli\ta0,2\n 34:\tlui\tv0,0x0\n 38:\tlbu\tv0,0(v0)\n 3c:\tsll\tv0,v0,0x2\n 40:\tlui\ta0,0x0\n 44:\taddu\ta0,a0,v0\n 48:\tlw\ta0,0(a0)\n 4c:\tjal\t0 \n 50:\tli\ta1,90\n 54:\tlui\ta0,0x0\n 58:\tjal\t0 \n 5c:\taddiu\ta0,a0,0\n 60:\tlw\tra,16(sp)\n 64:\tjr\tra\n 68:\taddiu\tsp,sp,24\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-72d0c8d03e081c13/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80018DC0_199C0\n00000000 *UND*\t00000000 allocateTaskMemory\n00000000 *UND*\t00000000 D_800A8CC8_A0038\n00000000 *UND*\t00000000 func_800574A0_580A0\n00000000 *UND*\t00000000 D_8008D78C_8E38C\n00000000 *UND*\t00000000 createTaskQueue\n00000000 *UND*\t00000000 func_80018E2C_19A2C\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 allocateTaskMemory\n00000014 R_MIPS_HI16 D_800A8CC8_A0038\n00000018 R_MIPS_LO16 D_800A8CC8_A0038\n0000002c R_MIPS_26 func_800574A0_580A0\n00000034 R_MIPS_HI16 D_800A8CC8_A0038\n00000038 R_MIPS_LO16 D_800A8CC8_A0038\n00000040 R_MIPS_HI16 D_8008D78C_8E38C\n00000048 R_MIPS_LO16 D_8008D78C_8E38C\n0000004c R_MIPS_26 createTaskQueue\n00000054 R_MIPS_HI16 func_80018E2C_19A2C\n0000005c R_MIPS_LO16 func_80018E2C_19A2C\n00000058 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 24040004 '...........$...\n 0010 a0400002 3c030000 90630000 a4400000 .@..<....c...@..\n 0020 24020004 10620003 00000000 0c000000 $....b..........\n 0030 24040002 3c020000 90420000 00021080 $...<....B......\n 0040 3c040000 00822021 8c840000 0c000000 <..... !........\n 0050 2405005a 3c040000 0c000000 24840000 $..Z<.......$...\n 0060 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80018DC0_199C0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80018DC0_199C0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -13529,7 +13579,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8001BCDC_1C8DC` — benchmark function snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001BCDC_1C8DC\n addiu\t$sp, $sp, -32\n sw\t$ra, 24($sp)\n jal\tgetCurrentAllocation\n nop\n move\t$t0, $v0\n move\t$a2, $zero\n.L18:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v0, 8($v0)\n move\t$a1, $zero\n blez\t$v0, .L68\n move\t$a0, $zero\n move\t$a3, $v0\n addu\t$v0, $t0, $a0\n.L38:\n lbu\t$v0, 1434($v0)\n xori\t$v1, $v0, 0x1\n sltiu\t$v1, $v1, 1\n xori\t$v0, $v0, 0x3\n sltiu\t$v0, $v0, 1\n or\t$v1, $v1, $v0\n bnezl\t$v1, .L58\n addiu\t$a1, $a1, 1\n.L58:\n addiu\t$a0, $a0, 1\n slt\t$v0, $a0, $a3\n bnez\t$v0, .L38\n addu\t$v0, $t0, $a0\n.L68:\n andi\t$v0, $a1, 0xff\n bnezl\t$v0, .L80\n addiu\t$a2, $a2, 1\n addu\t$v0, $t0, $a2\n sb\t$zero, 1464($v0)\n addiu\t$a2, $a2, 1\n.L80:\n slti\t$v0, $a2, 9\n bnez\t$v0, .L18\n nop\n lw\t$ra, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001BCDC_1C8DC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001BCDC_1C8DC` — benchmark function snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\tra,24(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tmove\tt0,v0\n 14:\tmove\ta2,zero\n 18:\tlui\tv0,0x0\n 1c:\tlw\tv0,0(v0)\n 20:\tlbu\tv0,8(v0)\n 24:\tmove\ta1,zero\n 28:\tblez\tv0,68 \n 2c:\tmove\ta0,zero\n 30:\tmove\ta3,v0\n 34:\taddu\tv0,t0,a0\n 38:\tlbu\tv0,1434(v0)\n 3c:\txori\tv1,v0,0x1\n 40:\tsltiu\tv1,v1,1\n 44:\txori\tv0,v0,0x3\n 48:\tsltiu\tv0,v0,1\n 4c:\tor\tv1,v1,v0\n 50:\tbnezl\tv1,58 \n 54:\taddiu\ta1,a1,1\n 58:\taddiu\ta0,a0,1\n 5c:\tslt\tv0,a0,a3\n 60:\tbnez\tv0,38 \n 64:\taddu\tv0,t0,a0\n 68:\tandi\tv0,a1,0xff\n 6c:\tbnezl\tv0,80 \n 70:\taddiu\ta2,a2,1\n 74:\taddu\tv0,t0,a2\n 78:\tsb\tzero,1464(v0)\n 7c:\taddiu\ta2,a2,1\n 80:\tslti\tv0,a2,9\n 84:\tbnez\tv0,18 \n 88:\tnop\n 8c:\tlw\tra,24(sp)\n 90:\tjr\tra\n 94:\taddiu\tsp,sp,32\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3b0d9b3084dd05cc/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000098 func_8001BCDC_1C8DC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 D_800AFE8C_A71FC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_HI16 D_800AFE8C_A71FC\n0000001c R_MIPS_LO16 D_800AFE8C_A71FC\n\n\nContents of section .text:\n 0000 27bdffe0 afbf0018 0c000000 00000000 '...............\n 0010 00404021 00003021 3c020000 8c420000 .@@!..0!<....B..\n 0020 90420008 00002821 1840000f 00002021 .B....(!.@.... !\n 0030 00403821 01041021 9042059a 38430001 .@8!...!.B..8C..\n 0040 2c630001 38420003 2c420001 00621825 ,c..8B..,B...b.%\n 0050 54600001 24a50001 24840001 0087102a T`..$...$......*\n 0060 1440fff5 01041021 30a200ff 54400004 .@.....!0...T@..\n 0070 24c60001 01061021 a04005b8 24c60001 $......!.@..$...\n 0080 28c20009 1440ffe4 00000000 8fbf0018 (....@..........\n 0090 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001BCDC_1C8DC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001BCDC_1C8DC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001BCDC_1C8DC` — benchmark function snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\tra,24(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tmove\tt0,v0\n 14:\tmove\ta2,zero\n 18:\tlui\tv0,0x0\n 1c:\tlw\tv0,0(v0)\n 20:\tlbu\tv0,8(v0)\n 24:\tmove\ta1,zero\n 28:\tblez\tv0,68 \n 2c:\tmove\ta0,zero\n 30:\tmove\ta3,v0\n 34:\taddu\tv0,t0,a0\n 38:\tlbu\tv0,1434(v0)\n 3c:\txori\tv1,v0,0x1\n 40:\tsltiu\tv1,v1,1\n 44:\txori\tv0,v0,0x3\n 48:\tsltiu\tv0,v0,1\n 4c:\tor\tv1,v1,v0\n 50:\tbnezl\tv1,58 \n 54:\taddiu\ta1,a1,1\n 58:\taddiu\ta0,a0,1\n 5c:\tslt\tv0,a0,a3\n 60:\tbnez\tv0,38 \n 64:\taddu\tv0,t0,a0\n 68:\tandi\tv0,a1,0xff\n 6c:\tbnezl\tv0,80 \n 70:\taddiu\ta2,a2,1\n 74:\taddu\tv0,t0,a2\n 78:\tsb\tzero,1464(v0)\n 7c:\taddiu\ta2,a2,1\n 80:\tslti\tv0,a2,9\n 84:\tbnez\tv0,18 \n 88:\tnop\n 8c:\tlw\tra,24(sp)\n 90:\tjr\tra\n 94:\taddiu\tsp,sp,32\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3b0d9b3084dd05cc/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000098 func_8001BCDC_1C8DC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 D_800AFE8C_A71FC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_HI16 D_800AFE8C_A71FC\n0000001c R_MIPS_LO16 D_800AFE8C_A71FC\n\n\nContents of section .text:\n 0000 27bdffe0 afbf0018 0c000000 00000000 '...............\n 0010 00404021 00003021 3c020000 8c420000 .@@!..0!<....B..\n 0020 90420008 00002821 1840000f 00002021 .B....(!.@.... !\n 0030 00403821 01041021 9042059a 38430001 .@8!...!.B..8C..\n 0040 2c630001 38420003 2c420001 00621825 ,c..8B..,B...b.%\n 0050 54600001 24a50001 24840001 0087102a T`..$...$......*\n 0060 1440fff5 01041021 30a200ff 54400004 .@.....!0...T@..\n 0070 24c60001 01061021 a04005b8 24c60001 $......!.@..$...\n 0080 28c20009 1440ffe4 00000000 8fbf0018 (....@..........\n 0090 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001BCDC_1C8DC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001BCDC_1C8DC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -13617,7 +13667,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8001BD74_1C974` — benchmark function snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001BD74_1C974\n lb\t$v1, 0($a0)\n li\t$v0, 3\n bne\t$v1, $v0, .L1c\n li\t$v0, 8\n li\t$v0, 2\n j\t.L38\n sb\t$v0, 0($a0)\n.L1c:\n bne\t$v1, $v0, .L30\n li\t$v0, 4\n li\t$v0, 7\n j\t.L38\n sb\t$v0, 0($a0)\n.L30:\n beql\t$v1, $v0, .L38\n sb\t$zero, 0($a0)\n.L38:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001BD74_1C974 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001BD74_1C974` — benchmark function snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlb\tv1,0(a0)\n 4:\tli\tv0,3\n 8:\tbne\tv1,v0,1c \n c:\tli\tv0,8\n 10:\tli\tv0,2\n 14:\tj\t38 \n 18:\tsb\tv0,0(a0)\n 1c:\tbne\tv1,v0,30 \n 20:\tli\tv0,4\n 24:\tli\tv0,7\n 28:\tj\t38 \n 2c:\tsb\tv0,0(a0)\n 30:\tbeql\tv1,v0,38 \n 34:\tsb\tzero,0(a0)\n 38:\tjr\tra\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-bf8de6181edf7df5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001BD74_1C974\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 .text\n00000028 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 80830000 24020003 14620004 24020008 ....$....b..$...\n 0010 24020002 0800000e a0820000 14620004 $............b..\n 0020 24020004 24020007 0800000e a0820000 $...$...........\n 0030 50620001 a0800000 03e00008 00000000 Pb..............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001BD74_1C974\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001BD74_1C974 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001BD74_1C974` — benchmark function snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlb\tv1,0(a0)\n 4:\tli\tv0,3\n 8:\tbne\tv1,v0,1c \n c:\tli\tv0,8\n 10:\tli\tv0,2\n 14:\tj\t38 \n 18:\tsb\tv0,0(a0)\n 1c:\tbne\tv1,v0,30 \n 20:\tli\tv0,4\n 24:\tli\tv0,7\n 28:\tj\t38 \n 2c:\tsb\tv0,0(a0)\n 30:\tbeql\tv1,v0,38 \n 34:\tsb\tzero,0(a0)\n 38:\tjr\tra\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-bf8de6181edf7df5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001BD74_1C974\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 .text\n00000028 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 80830000 24020003 14620004 24020008 ....$....b..$...\n 0010 24020002 0800000e a0820000 14620004 $............b..\n 0020 24020004 24020007 0800000e a0820000 $...$...........\n 0030 50620001 a0800000 03e00008 00000000 Pb..............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001BD74_1C974\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001BD74_1C974 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -13706,7 +13756,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80021C00_22800` — benchmark function snowboardkids2:func_80021C00_22800:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80021C00_22800\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tfunc_80069810_6A410\n nop\n sll\t$v0, $v0, 0x10\n sra\t$v1, $v0, 0x10\n li\t$v0, 255\n bne\t$v1, $v0, .L38\n li\t$v0, 1\n lui\t$a0, %hi(func_80021D00_22900)\n jal\tterminateSchedulerWithCallback\n addiu\t$a0, $a0, %lo(func_80021D00_22900)\n j\t.L4c\n nop\n.L38:\n bne\t$v1, $v0, .L4c\n nop\n lui\t$a0, %hi(func_80021C58_22858)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80021C58_22858)\n.L4c:\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-c3df422c9dc8.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80021C00_22800(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80021C00_22800 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80021C00_22800` — benchmark function snowboardkids2:func_80021C00_22800:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80021C00_22800:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tsll\tv0,v0,0x10\n 14:\tsra\tv1,v0,0x10\n 18:\tli\tv0,255\n 1c:\tbne\tv1,v0,38 \n 20:\tli\tv0,1\n 24:\tlui\ta0,0x0\n 28:\tjal\t0 \n 2c:\taddiu\ta0,a0,0\n 30:\tj\t4c \n 34:\tnop\n 38:\tbne\tv1,v0,4c \n 3c:\tnop\n 40:\tlui\ta0,0x0\n 44:\tjal\t0 \n 48:\taddiu\ta0,a0,0\n 4c:\tlw\tra,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1bbfd2db97d42027/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80021C00_22800\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021D00_22900\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n00000000 *UND*\t00000000 func_80021C58_22858\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 func_80069810_6A410\n00000024 R_MIPS_HI16 func_80021D00_22900\n0000002c R_MIPS_LO16 func_80021D00_22900\n00000028 R_MIPS_26 terminateSchedulerWithCallback\n00000030 R_MIPS_26 .text\n00000040 R_MIPS_HI16 func_80021C58_22858\n00000048 R_MIPS_LO16 func_80021C58_22858\n00000044 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 00021400 00021c03 240200ff 14620006 ........$....b..\n 0020 24020001 3c040000 0c000000 24840000 $...<.......$...\n 0030 08000013 00000000 14620004 00000000 .........b......\n 0040 3c040000 0c000000 24840000 8fbf0010 <.......$.......\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80021C00_22800\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80021C00_22800 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80021C00_22800` — benchmark function snowboardkids2:func_80021C00_22800:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80021C00_22800:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tsll\tv0,v0,0x10\n 14:\tsra\tv1,v0,0x10\n 18:\tli\tv0,255\n 1c:\tbne\tv1,v0,38 \n 20:\tli\tv0,1\n 24:\tlui\ta0,0x0\n 28:\tjal\t0 \n 2c:\taddiu\ta0,a0,0\n 30:\tj\t4c \n 34:\tnop\n 38:\tbne\tv1,v0,4c \n 3c:\tnop\n 40:\tlui\ta0,0x0\n 44:\tjal\t0 \n 48:\taddiu\ta0,a0,0\n 4c:\tlw\tra,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1bbfd2db97d42027/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80021C00_22800\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021D00_22900\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n00000000 *UND*\t00000000 func_80021C58_22858\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 func_80069810_6A410\n00000024 R_MIPS_HI16 func_80021D00_22900\n0000002c R_MIPS_LO16 func_80021D00_22900\n00000028 R_MIPS_26 terminateSchedulerWithCallback\n00000030 R_MIPS_26 .text\n00000040 R_MIPS_HI16 func_80021C58_22858\n00000048 R_MIPS_LO16 func_80021C58_22858\n00000044 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 00021400 00021c03 240200ff 14620006 ........$....b..\n 0020 24020001 3c040000 0c000000 24840000 $...<.......$...\n 0030 08000013 00000000 14620004 00000000 .........b......\n 0040 3c040000 0c000000 24840000 8fbf0010 <.......$.......\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80021C00_22800\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80021C00_22800 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -13795,7 +13845,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80021D88_22988` — benchmark function snowboardkids2:func_80021D88_22988:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80021D88_22988\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tgetCurrentAllocation\n nop\n jal\tfunc_80069810_6A410\n nop\n sll\t$v0, $v0, 0x10\n sra\t$v1, $v0, 0x10\n li\t$v0, 1\n bne\t$v1, $v0, .L40\n li\t$v0, 255\n lui\t$a0, %hi(func_80021DE8_229E8)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80021DE8_229E8)\n j\t.L54\n nop\n.L40:\n bne\t$v1, $v0, .L54\n nop\n lui\t$a0, %hi(func_80022108_22D08)\n jal\tterminateSchedulerWithCallback\n addiu\t$a0, $a0, %lo(func_80022108_22D08)\n.L54:\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-e0cb1bd24f0c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80021D88_22988(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80021D88_22988 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80021D88_22988` — benchmark function snowboardkids2:func_80021D88_22988:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80021D88_22988:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tjal\t0 \n 14:\tnop\n 18:\tsll\tv0,v0,0x10\n 1c:\tsra\tv1,v0,0x10\n 20:\tli\tv0,1\n 24:\tbne\tv1,v0,40 \n 28:\tli\tv0,255\n 2c:\tlui\ta0,0x0\n 30:\tjal\t0 \n 34:\taddiu\ta0,a0,0\n 38:\tj\t54 \n 3c:\tnop\n 40:\tbne\tv1,v0,54 \n 44:\tnop\n 48:\tlui\ta0,0x0\n 4c:\tjal\t0 \n 50:\taddiu\ta0,a0,0\n 54:\tlw\tra,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-a50ccb5d3e41fbec/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80021D88_22988\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021DE8_229E8\n00000000 *UND*\t00000000 setGameStateHandler\n00000000 *UND*\t00000000 func_80022108_22D08\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000010 R_MIPS_26 func_80069810_6A410\n0000002c R_MIPS_HI16 func_80021DE8_229E8\n00000034 R_MIPS_LO16 func_80021DE8_229E8\n00000030 R_MIPS_26 setGameStateHandler\n00000038 R_MIPS_26 .text\n00000048 R_MIPS_HI16 func_80022108_22D08\n00000050 R_MIPS_LO16 func_80022108_22D08\n0000004c R_MIPS_26 terminateSchedulerWithCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 0c000000 00000000 00021400 00021c03 ................\n 0020 24020001 14620006 240200ff 3c040000 $....b..$...<...\n 0030 0c000000 24840000 08000015 00000000 ....$...........\n 0040 14620004 00000000 3c040000 0c000000 .b......<.......\n 0050 24840000 8fbf0010 03e00008 27bd0018 $...........'...\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80021D88_22988\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80021D88_22988 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80021D88_22988` — benchmark function snowboardkids2:func_80021D88_22988:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80021D88_22988:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tjal\t0 \n 14:\tnop\n 18:\tsll\tv0,v0,0x10\n 1c:\tsra\tv1,v0,0x10\n 20:\tli\tv0,1\n 24:\tbne\tv1,v0,40 \n 28:\tli\tv0,255\n 2c:\tlui\ta0,0x0\n 30:\tjal\t0 \n 34:\taddiu\ta0,a0,0\n 38:\tj\t54 \n 3c:\tnop\n 40:\tbne\tv1,v0,54 \n 44:\tnop\n 48:\tlui\ta0,0x0\n 4c:\tjal\t0 \n 50:\taddiu\ta0,a0,0\n 54:\tlw\tra,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-a50ccb5d3e41fbec/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80021D88_22988\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021DE8_229E8\n00000000 *UND*\t00000000 setGameStateHandler\n00000000 *UND*\t00000000 func_80022108_22D08\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000010 R_MIPS_26 func_80069810_6A410\n0000002c R_MIPS_HI16 func_80021DE8_229E8\n00000034 R_MIPS_LO16 func_80021DE8_229E8\n00000030 R_MIPS_26 setGameStateHandler\n00000038 R_MIPS_26 .text\n00000048 R_MIPS_HI16 func_80022108_22D08\n00000050 R_MIPS_LO16 func_80022108_22D08\n0000004c R_MIPS_26 terminateSchedulerWithCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 0c000000 00000000 00021400 00021c03 ................\n 0020 24020001 14620006 240200ff 3c040000 $....b..$...<...\n 0030 0c000000 24840000 08000015 00000000 ....$...........\n 0040 14620004 00000000 3c040000 0c000000 .b......<.......\n 0050 24840000 8fbf0010 03e00008 27bd0018 $...........'...\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80021D88_22988\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80021D88_22988 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -13866,7 +13916,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80028BB0_297B0` — benchmark function snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80028BB0_297B0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n sb\t$zero, 94($s0)\n sb\t$zero, 97($s0)\n jal\trandB\n sb\t$zero, 98($s0)\n lhu\t$a1, 44($s0)\n addiu\t$a0, $s0, 4\n andi\t$v0, $v0, 0xf\n jal\tcreateYRotationMatrix\n sh\t$v0, 90($s0)\n jal\tfunc_8002A290_2AE90\n move\t$a0, $s0\n lui\t$a0, %hi(func_80028C08_29808)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80028C08_29808)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80028BB0_297B0(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80028BB0_297B0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80028BB0_297B0` — benchmark function snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\tlhu\ta1,44(s0)\n 24:\taddiu\ta0,s0,4\n 28:\tandi\tv0,v0,0xf\n 2c:\tjal\t0 \n 30:\tsh\tv0,90(s0)\n 34:\tjal\t0 \n 38:\tmove\ta0,s0\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,20(sp)\n 4c:\tlw\ts0,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-02d774e5b23e4379/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80028BB0_297B0\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028C08_29808\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n0000002c R_MIPS_26 createYRotationMatrix\n00000034 R_MIPS_26 func_8002A290_2AE90\n0000003c R_MIPS_HI16 func_80028C08_29808\n00000044 R_MIPS_LO16 func_80028C08_29808\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 9605002c 26040004 3042000f 0c000000 ...,&...0B......\n 0030 a602005a 0c000000 02002021 3c040000 ...Z...... !<...\n 0040 0c000000 24840000 8fbf0014 8fb00010 ....$...........\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a0010034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80028BB0_297B0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80028BB0_297B0` — benchmark function snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\tlhu\ta1,44(s0)\n 24:\taddiu\ta0,s0,4\n 28:\tandi\tv0,v0,0xf\n 2c:\tjal\t0 \n 30:\tsh\tv0,90(s0)\n 34:\tjal\t0 \n 38:\tmove\ta0,s0\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,20(sp)\n 4c:\tlw\ts0,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-02d774e5b23e4379/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80028BB0_297B0\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028C08_29808\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n0000002c R_MIPS_26 createYRotationMatrix\n00000034 R_MIPS_26 func_8002A290_2AE90\n0000003c R_MIPS_HI16 func_80028C08_29808\n00000044 R_MIPS_LO16 func_80028C08_29808\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 9605002c 26040004 3042000f 0c000000 ...,&...0B......\n 0030 a602005a 0c000000 02002021 3c040000 ...Z...... !<...\n 0040 0c000000 24840000 8fbf0014 8fb00010 ....$...........\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a0010034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80028BB0_297B0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -13937,7 +13987,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80028D90_29990` — benchmark function snowboardkids2:func_80028D90_29990:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80028D90_29990\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n sb\t$zero, 94($s0)\n sb\t$zero, 97($s0)\n jal\trandB\n sb\t$zero, 98($s0)\n addiu\t$a0, $s0, 4\n lhu\t$v1, 90($s0)\n lhu\t$a1, 44($s0)\n andi\t$v0, $v0, 0xf\n addu\t$v1, $v1, $v0\n jal\tcreateYRotationMatrix\n sh\t$v1, 90($s0)\n jal\tfunc_8002A290_2AE90\n move\t$a0, $s0\n lui\t$a0, %hi(func_80028DF0_299F0)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80028DF0_299F0)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80028D90_29990(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80028D90_29990 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80028D90_29990` — benchmark function snowboardkids2:func_80028D90_29990:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80028D90_29990:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\taddiu\ta0,s0,4\n 24:\tlhu\tv1,90(s0)\n 28:\tlhu\ta1,44(s0)\n 2c:\tandi\tv0,v0,0xf\n 30:\taddu\tv1,v1,v0\n 34:\tjal\t0 \n 38:\tsh\tv1,90(s0)\n 3c:\tjal\t0 \n 40:\tmove\ta0,s0\n 44:\tlui\ta0,0x0\n 48:\tjal\t0 \n 4c:\taddiu\ta0,a0,0\n 50:\tlw\tra,20(sp)\n 54:\tlw\ts0,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-49adcb1d8c59c3fb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80028D90_29990\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028DF0_299F0\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n00000034 R_MIPS_26 createYRotationMatrix\n0000003c R_MIPS_26 func_8002A290_2AE90\n00000044 R_MIPS_HI16 func_80028DF0_299F0\n0000004c R_MIPS_LO16 func_80028DF0_299F0\n00000048 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 26040004 9603005a 9605002c 3042000f &......Z...,0B..\n 0030 00621821 0c000000 a603005a 0c000000 .b.!.......Z....\n 0040 02002021 3c040000 0c000000 24840000 .. !<.......$...\n 0050 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a001003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80028D90_29990 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80028D90_29990` — benchmark function snowboardkids2:func_80028D90_29990:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80028D90_29990:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\taddiu\ta0,s0,4\n 24:\tlhu\tv1,90(s0)\n 28:\tlhu\ta1,44(s0)\n 2c:\tandi\tv0,v0,0xf\n 30:\taddu\tv1,v1,v0\n 34:\tjal\t0 \n 38:\tsh\tv1,90(s0)\n 3c:\tjal\t0 \n 40:\tmove\ta0,s0\n 44:\tlui\ta0,0x0\n 48:\tjal\t0 \n 4c:\taddiu\ta0,a0,0\n 50:\tlw\tra,20(sp)\n 54:\tlw\ts0,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-49adcb1d8c59c3fb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80028D90_29990\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028DF0_299F0\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n00000034 R_MIPS_26 createYRotationMatrix\n0000003c R_MIPS_26 func_8002A290_2AE90\n00000044 R_MIPS_HI16 func_80028DF0_299F0\n0000004c R_MIPS_LO16 func_80028DF0_299F0\n00000048 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 26040004 9603005a 9605002c 3042000f &......Z...,0B..\n 0030 00621821 0c000000 a603005a 0c000000 .b.!.......Z....\n 0040 02002021 3c040000 0c000000 24840000 .. !<.......$...\n 0050 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a001003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80028D90_29990 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -14021,7 +14071,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8002A2D0_2AED0` — benchmark function snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002A2D0_2AED0\n addiu\t$sp, $sp, -32\n sw\t$s0, 24($sp)\n sw\t$ra, 28($sp)\n jal\tgetCurrentAllocation\n move\t$s0, $a0\n lw\t$a0, 0($s0)\n jal\tapplyTransformToModel\n addiu\t$a1, $s0, 4\n lh\t$v1, 80($s0)\n lh\t$v0, 82($s0)\n beq\t$v1, $v0, .L44\n move\t$a2, $v1\n lw\t$a0, 0($s0)\n lh\t$a1, 80($s0)\n jal\tsetModelAnimation\n sh\t$a2, 82($s0)\n sb\t$zero, 98($s0)\n.L44:\n lb\t$v1, 98($s0)\n li\t$v0, -1\n beq\t$v1, $v0, .L60\n move\t$v0, $zero\n lw\t$a0, 0($s0)\n jal\tclearModelRotation\n nop\n.L60:\n beqz\t$v0, .La0\n li\t$v1, 1\n lbu\t$v0, 98($s0)\n sb\t$v1, 55($s0)\n lh\t$v1, 80($s0)\n andi\t$v0, $v0, 0x7f\n addiu\t$v0, $v0, 1\n sb\t$v0, 98($s0)\n li\t$v0, 152\n bne\t$v1, $v0, .La0\n li\t$v0, 2\n lbu\t$v1, 94($s0)\n beq\t$v1, $v0, .L9c\n li\t$v0, 144\n lhu\t$v0, 88($s0)\n.L9c:\n sh\t$v0, 80($s0)\n.La0:\n jal\tupdateModelGeometry\n lw\t$a0, 0($s0)\n lw\t$ra, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8002A2D0_2AED0(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002A2D0_2AED0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002A2D0_2AED0` — benchmark function snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,24(sp)\n 8:\tsw\tra,28(sp)\n c:\tjal\t0 \n 10:\tmove\ts0,a0\n 14:\tlw\ta0,0(s0)\n 18:\tjal\t0 \n 1c:\taddiu\ta1,s0,4\n 20:\tlh\tv1,80(s0)\n 24:\tlh\tv0,82(s0)\n 28:\tbeq\tv1,v0,44 \n 2c:\tmove\ta2,v1\n 30:\tlw\ta0,0(s0)\n 34:\tlh\ta1,80(s0)\n 38:\tjal\t0 \n 3c:\tsh\ta2,82(s0)\n 40:\tsb\tzero,98(s0)\n 44:\tlb\tv1,98(s0)\n 48:\tli\tv0,-1\n 4c:\tbeq\tv1,v0,60 \n 50:\tmove\tv0,zero\n 54:\tlw\ta0,0(s0)\n 58:\tjal\t0 \n 5c:\tnop\n 60:\tbeqz\tv0,a0 \n 64:\tli\tv1,1\n 68:\tlbu\tv0,98(s0)\n 6c:\tsb\tv1,55(s0)\n 70:\tlh\tv1,80(s0)\n 74:\tandi\tv0,v0,0x7f\n 78:\taddiu\tv0,v0,1\n 7c:\tsb\tv0,98(s0)\n 80:\tli\tv0,152\n 84:\tbne\tv1,v0,a0 \n 88:\tli\tv0,2\n 8c:\tlbu\tv1,94(s0)\n 90:\tbeq\tv1,v0,9c \n 94:\tli\tv0,144\n 98:\tlhu\tv0,88(s0)\n 9c:\tsh\tv0,80(s0)\n a0:\tjal\t0 \n a4:\tlw\ta0,0(s0)\n a8:\tlw\tra,28(sp)\n ac:\tlw\ts0,24(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,32\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3384bda726611237/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002A2D0_2AED0\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 applyTransformToModel\n00000000 *UND*\t00000000 setModelAnimation\n00000000 *UND*\t00000000 clearModelRotation\n00000000 *UND*\t00000000 updateModelGeometry\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_26 applyTransformToModel\n00000038 R_MIPS_26 setModelAnimation\n00000058 R_MIPS_26 clearModelRotation\n000000a0 R_MIPS_26 updateModelGeometry\n\n\nContents of section .text:\n 0000 27bdffe0 afb00018 afbf001c 0c000000 '...............\n 0010 00808021 8e040000 0c000000 26050004 ...!........&...\n 0020 86030050 86020052 10620006 00603021 ...P...R.b...`0!\n 0030 8e040000 86050050 0c000000 a6060052 .......P.......R\n 0040 a2000062 82030062 2402ffff 10620004 ...b...b$....b..\n 0050 00001021 8e040000 0c000000 00000000 ...!............\n 0060 1040000f 24030001 92020062 a2030037 .@..$......b...7\n 0070 86030050 3042007f 24420001 a2020062 ...P0B..$B.....b\n 0080 24020098 14620006 24020002 9203005e $....b..$......^\n 0090 10620002 24020090 96020058 a6020050 .b..$......X...P\n 00a0 0c000000 8e040000 8fbf001c 8fb00018 ................\n 00b0 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a001007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002A2D0_2AED0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002A2D0_2AED0` — benchmark function snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,24(sp)\n 8:\tsw\tra,28(sp)\n c:\tjal\t0 \n 10:\tmove\ts0,a0\n 14:\tlw\ta0,0(s0)\n 18:\tjal\t0 \n 1c:\taddiu\ta1,s0,4\n 20:\tlh\tv1,80(s0)\n 24:\tlh\tv0,82(s0)\n 28:\tbeq\tv1,v0,44 \n 2c:\tmove\ta2,v1\n 30:\tlw\ta0,0(s0)\n 34:\tlh\ta1,80(s0)\n 38:\tjal\t0 \n 3c:\tsh\ta2,82(s0)\n 40:\tsb\tzero,98(s0)\n 44:\tlb\tv1,98(s0)\n 48:\tli\tv0,-1\n 4c:\tbeq\tv1,v0,60 \n 50:\tmove\tv0,zero\n 54:\tlw\ta0,0(s0)\n 58:\tjal\t0 \n 5c:\tnop\n 60:\tbeqz\tv0,a0 \n 64:\tli\tv1,1\n 68:\tlbu\tv0,98(s0)\n 6c:\tsb\tv1,55(s0)\n 70:\tlh\tv1,80(s0)\n 74:\tandi\tv0,v0,0x7f\n 78:\taddiu\tv0,v0,1\n 7c:\tsb\tv0,98(s0)\n 80:\tli\tv0,152\n 84:\tbne\tv1,v0,a0 \n 88:\tli\tv0,2\n 8c:\tlbu\tv1,94(s0)\n 90:\tbeq\tv1,v0,9c \n 94:\tli\tv0,144\n 98:\tlhu\tv0,88(s0)\n 9c:\tsh\tv0,80(s0)\n a0:\tjal\t0 \n a4:\tlw\ta0,0(s0)\n a8:\tlw\tra,28(sp)\n ac:\tlw\ts0,24(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,32\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3384bda726611237/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002A2D0_2AED0\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 applyTransformToModel\n00000000 *UND*\t00000000 setModelAnimation\n00000000 *UND*\t00000000 clearModelRotation\n00000000 *UND*\t00000000 updateModelGeometry\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_26 applyTransformToModel\n00000038 R_MIPS_26 setModelAnimation\n00000058 R_MIPS_26 clearModelRotation\n000000a0 R_MIPS_26 updateModelGeometry\n\n\nContents of section .text:\n 0000 27bdffe0 afb00018 afbf001c 0c000000 '...............\n 0010 00808021 8e040000 0c000000 26050004 ...!........&...\n 0020 86030050 86020052 10620006 00603021 ...P...R.b...`0!\n 0030 8e040000 86050050 0c000000 a6060052 .......P.......R\n 0040 a2000062 82030062 2402ffff 10620004 ...b...b$....b..\n 0050 00001021 8e040000 0c000000 00000000 ...!............\n 0060 1040000f 24030001 92020062 a2030037 .@..$......b...7\n 0070 86030050 3042007f 24420001 a2020062 ...P0B..$B.....b\n 0080 24020098 14620006 24020002 9203005e $....b..$......^\n 0090 10620002 24020090 96020058 a6020050 .b..$......X...P\n 00a0 0c000000 8e040000 8fbf001c 8fb00018 ................\n 00b0 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a001007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002A2D0_2AED0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -14094,7 +14144,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8002A390_2AF90` — benchmark function snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002A390_2AF90\n addiu\t$sp, $sp, -32\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 24($sp)\n jal\tgetCurrentAllocation\n sw\t$s1, 20($sp)\n lbu\t$v1, 94($s0)\n move\t$s1, $v0\n slti\t$v0, $v1, 5\n beqzl\t$v0, .L44\n li\t$v0, 68\n bnez\t$v1, .Lc0\n nop\n beqz\t$v1, .L54\n move\t$v0, $zero\n j\t.L108\n nop\n.L44:\n beq\t$v1, $v0, .Le0\n move\t$v0, $zero\n j\t.L108\n nop\n.L54:\n lbu\t$a1, 93($s0)\n jal\tfunc_8002A4AC_2B0AC\n addiu\t$a0, $s0, 4\n bnez\t$v0, .L108\n li\t$v0, 1\n lbu\t$v0, 1057($s1)\n bnez\t$v0, .L108\n move\t$v0, $zero\n lw\t$a0, 24($s0)\n lw\t$a1, 32($s0)\n jal\tfunc_8002ACFC_2B8FC\n lh\t$a2, 46($s0)\n beqz\t$v0, .L108\n move\t$v0, $zero\n lhu\t$v0, 80($s0)\n lbu\t$v1, 93($s0)\n sh\t$v0, 84($s0)\n li\t$v0, 5\n bnel\t$v1, $v0, .Lac\n sh\t$zero, 80($s0)\n li\t$v0, 33\n sh\t$v0, 80($s0)\n.Lac:\n lbu\t$v1, 94($s0)\n li\t$v0, 68\n sb\t$v0, 94($s0)\n j\t.L104\n sb\t$v1, 97($s0)\n.Lc0:\n jal\tfunc_8002A7CC_2B3CC\n move\t$a0, $s0\n beqz\t$v0, .L108\n move\t$v0, $zero\n lbu\t$v0, 94($s0)\n sb\t$zero, 94($s0)\n j\t.L104\n sb\t$v0, 97($s0)\n.Le0:\n jal\tfunc_8002A7CC_2B3CC\n move\t$a0, $s0\n beqz\t$v0, .L108\n move\t$v0, $zero\n lbu\t$v0, 94($s0)\n lhu\t$v1, 84($s0)\n sb\t$zero, 94($s0)\n sb\t$v0, 97($s0)\n sh\t$v1, 80($s0)\n.L104:\n move\t$v0, $zero\n.L108:\n lw\t$ra, 24($sp)\n lw\t$s1, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002A390_2AF90 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002A390_2AF90` — benchmark function snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,24(sp)\n 10:\tjal\t0 \n 14:\tsw\ts1,20(sp)\n 18:\tlbu\tv1,94(s0)\n 1c:\tmove\ts1,v0\n 20:\tslti\tv0,v1,5\n 24:\tbeqzl\tv0,44 \n 28:\tli\tv0,68\n 2c:\tbnez\tv1,c0 \n 30:\tnop\n 34:\tbeqz\tv1,54 \n 38:\tmove\tv0,zero\n 3c:\tj\t108 \n 40:\tnop\n 44:\tbeq\tv1,v0,e0 \n 48:\tmove\tv0,zero\n 4c:\tj\t108 \n 50:\tnop\n 54:\tlbu\ta1,93(s0)\n 58:\tjal\t0 \n 5c:\taddiu\ta0,s0,4\n 60:\tbnez\tv0,108 \n 64:\tli\tv0,1\n 68:\tlbu\tv0,1057(s1)\n 6c:\tbnez\tv0,108 \n 70:\tmove\tv0,zero\n 74:\tlw\ta0,24(s0)\n 78:\tlw\ta1,32(s0)\n 7c:\tjal\t0 \n 80:\tlh\ta2,46(s0)\n 84:\tbeqz\tv0,108 \n 88:\tmove\tv0,zero\n 8c:\tlhu\tv0,80(s0)\n 90:\tlbu\tv1,93(s0)\n 94:\tsh\tv0,84(s0)\n 98:\tli\tv0,5\n 9c:\tbnel\tv1,v0,ac \n a0:\tsh\tzero,80(s0)\n a4:\tli\tv0,33\n a8:\tsh\tv0,80(s0)\n ac:\tlbu\tv1,94(s0)\n b0:\tli\tv0,68\n b4:\tsb\tv0,94(s0)\n b8:\tj\t104 \n bc:\tsb\tv1,97(s0)\n c0:\tjal\t0 \n c4:\tmove\ta0,s0\n c8:\tbeqz\tv0,108 \n cc:\tmove\tv0,zero\n d0:\tlbu\tv0,94(s0)\n d4:\tsb\tzero,94(s0)\n d8:\tj\t104 \n dc:\tsb\tv0,97(s0)\n e0:\tjal\t0 \n e4:\tmove\ta0,s0\n e8:\tbeqz\tv0,108 \n ec:\tmove\tv0,zero\n f0:\tlbu\tv0,94(s0)\n f4:\tlhu\tv1,84(s0)\n f8:\tsb\tzero,94(s0)\n fc:\tsb\tv0,97(s0)\n 100:\tsh\tv1,80(s0)\n 104:\tmove\tv0,zero\n 108:\tlw\tra,24(sp)\n 10c:\tlw\ts1,20(sp)\n 110:\tlw\ts0,16(sp)\n 114:\tjr\tra\n 118:\taddiu\tsp,sp,32\n 11c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e91a09b3f45124d2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000011c func_8002A390_2AF90\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8002A4AC_2B0AC\n00000000 *UND*\t00000000 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 func_8002A7CC_2B3CC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 getCurrentAllocation\n0000003c R_MIPS_26 .text\n0000004c R_MIPS_26 .text\n00000058 R_MIPS_26 func_8002A4AC_2B0AC\n0000007c R_MIPS_26 func_8002ACFC_2B8FC\n000000b8 R_MIPS_26 .text\n000000c0 R_MIPS_26 func_8002A7CC_2B3CC\n000000d8 R_MIPS_26 .text\n000000e0 R_MIPS_26 func_8002A7CC_2B3CC\n\n\nContents of section .text:\n 0000 27bdffe0 afb00010 00808021 afbf0018 '..........!....\n 0010 0c000000 afb10014 9203005e 00408821 ...........^.@.!\n 0020 28620005 50400007 24020044 14600024 (b..P@..$..D.`.$\n 0030 00000000 10600007 00001021 08000042 .....`.....!...B\n 0040 00000000 10620026 00001021 08000042 .....b.&...!...B\n 0050 00000000 9205005d 0c000000 26040004 .......]....&...\n 0060 14400029 24020001 92220421 14400026 .@.)$....\".!.@.&\n 0070 00001021 8e040018 8e050020 0c000000 ...!....... ....\n 0080 8606002e 10400020 00001021 96020050 .....@. ...!...P\n 0090 9203005d a6020054 24020005 54620003 ...]...T$...Tb..\n 00a0 a6000050 24020021 a6020050 9203005e ...P$..!...P...^\n 00b0 24020044 a202005e 08000041 a2030061 $..D...^...A...a\n 00c0 0c000000 02002021 1040000f 00001021 ...... !.@.....!\n 00d0 9202005e a200005e 08000041 a2020061 ...^...^...A...a\n 00e0 0c000000 02002021 10400007 00001021 ...... !.@.....!\n 00f0 9202005e 96030054 a200005e a2020061 ...^...T...^...a\n 0100 a6030050 00001021 8fbf0018 8fb10014 ...P...!........\n 0110 8fb00010 03e00008 27bd0020 00000000 ........'.. ....\nContents of section .reginfo:\n 0000 a003007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002A390_2AF90 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002A390_2AF90` — benchmark function snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,24(sp)\n 10:\tjal\t0 \n 14:\tsw\ts1,20(sp)\n 18:\tlbu\tv1,94(s0)\n 1c:\tmove\ts1,v0\n 20:\tslti\tv0,v1,5\n 24:\tbeqzl\tv0,44 \n 28:\tli\tv0,68\n 2c:\tbnez\tv1,c0 \n 30:\tnop\n 34:\tbeqz\tv1,54 \n 38:\tmove\tv0,zero\n 3c:\tj\t108 \n 40:\tnop\n 44:\tbeq\tv1,v0,e0 \n 48:\tmove\tv0,zero\n 4c:\tj\t108 \n 50:\tnop\n 54:\tlbu\ta1,93(s0)\n 58:\tjal\t0 \n 5c:\taddiu\ta0,s0,4\n 60:\tbnez\tv0,108 \n 64:\tli\tv0,1\n 68:\tlbu\tv0,1057(s1)\n 6c:\tbnez\tv0,108 \n 70:\tmove\tv0,zero\n 74:\tlw\ta0,24(s0)\n 78:\tlw\ta1,32(s0)\n 7c:\tjal\t0 \n 80:\tlh\ta2,46(s0)\n 84:\tbeqz\tv0,108 \n 88:\tmove\tv0,zero\n 8c:\tlhu\tv0,80(s0)\n 90:\tlbu\tv1,93(s0)\n 94:\tsh\tv0,84(s0)\n 98:\tli\tv0,5\n 9c:\tbnel\tv1,v0,ac \n a0:\tsh\tzero,80(s0)\n a4:\tli\tv0,33\n a8:\tsh\tv0,80(s0)\n ac:\tlbu\tv1,94(s0)\n b0:\tli\tv0,68\n b4:\tsb\tv0,94(s0)\n b8:\tj\t104 \n bc:\tsb\tv1,97(s0)\n c0:\tjal\t0 \n c4:\tmove\ta0,s0\n c8:\tbeqz\tv0,108 \n cc:\tmove\tv0,zero\n d0:\tlbu\tv0,94(s0)\n d4:\tsb\tzero,94(s0)\n d8:\tj\t104 \n dc:\tsb\tv0,97(s0)\n e0:\tjal\t0 \n e4:\tmove\ta0,s0\n e8:\tbeqz\tv0,108 \n ec:\tmove\tv0,zero\n f0:\tlbu\tv0,94(s0)\n f4:\tlhu\tv1,84(s0)\n f8:\tsb\tzero,94(s0)\n fc:\tsb\tv0,97(s0)\n 100:\tsh\tv1,80(s0)\n 104:\tmove\tv0,zero\n 108:\tlw\tra,24(sp)\n 10c:\tlw\ts1,20(sp)\n 110:\tlw\ts0,16(sp)\n 114:\tjr\tra\n 118:\taddiu\tsp,sp,32\n 11c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e91a09b3f45124d2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000011c func_8002A390_2AF90\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8002A4AC_2B0AC\n00000000 *UND*\t00000000 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 func_8002A7CC_2B3CC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 getCurrentAllocation\n0000003c R_MIPS_26 .text\n0000004c R_MIPS_26 .text\n00000058 R_MIPS_26 func_8002A4AC_2B0AC\n0000007c R_MIPS_26 func_8002ACFC_2B8FC\n000000b8 R_MIPS_26 .text\n000000c0 R_MIPS_26 func_8002A7CC_2B3CC\n000000d8 R_MIPS_26 .text\n000000e0 R_MIPS_26 func_8002A7CC_2B3CC\n\n\nContents of section .text:\n 0000 27bdffe0 afb00010 00808021 afbf0018 '..........!....\n 0010 0c000000 afb10014 9203005e 00408821 ...........^.@.!\n 0020 28620005 50400007 24020044 14600024 (b..P@..$..D.`.$\n 0030 00000000 10600007 00001021 08000042 .....`.....!...B\n 0040 00000000 10620026 00001021 08000042 .....b.&...!...B\n 0050 00000000 9205005d 0c000000 26040004 .......]....&...\n 0060 14400029 24020001 92220421 14400026 .@.)$....\".!.@.&\n 0070 00001021 8e040018 8e050020 0c000000 ...!....... ....\n 0080 8606002e 10400020 00001021 96020050 .....@. ...!...P\n 0090 9203005d a6020054 24020005 54620003 ...]...T$...Tb..\n 00a0 a6000050 24020021 a6020050 9203005e ...P$..!...P...^\n 00b0 24020044 a202005e 08000041 a2030061 $..D...^...A...a\n 00c0 0c000000 02002021 1040000f 00001021 ...... !.@.....!\n 00d0 9202005e a200005e 08000041 a2020061 ...^...^...A...a\n 00e0 0c000000 02002021 10400007 00001021 ...... !.@.....!\n 00f0 9202005e 96030054 a200005e a2020061 ...^...T...^...a\n 0100 a6030050 00001021 8fbf0018 8fb10014 ...P...!........\n 0110 8fb00010 03e00008 27bd0020 00000000 ........'.. ....\nContents of section .reginfo:\n 0000 a003007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002A390_2AF90 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -14165,7 +14215,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8002ACFC_2B8FC` — benchmark function snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002ACFC_2B8FC\n addiu\t$sp, $sp, -40\n sw\t$s2, 24($sp)\n move\t$s2, $a0\n sw\t$s3, 28($sp)\n move\t$s3, $a1\n sw\t$s0, 16($sp)\n move\t$s0, $a2\n sw\t$ra, 32($sp)\n jal\tgetCurrentAllocation\n sw\t$s1, 20($sp)\n move\t$s1, $v0\n lw\t$a0, 1004($s1)\n lw\t$a1, 1008($s1)\n move\t$a2, $s2\n jal\tfunc_8006D21C_6DE1C\n move\t$a3, $s3\n sll\t$s0, $s0, 0x10\n sra\t$s0, $s0, 0x10\n addiu\t$v1, $s0, -568\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n slt\t$v1, $v1, $a0\n beqz\t$v1, .L98\n addiu\t$v0, $s0, 568\n slt\t$v0, $a0, $v0\n beqz\t$v0, .L9c\n move\t$v0, $zero\n lw\t$a0, 1004($s1)\n lw\t$a1, 1008($s1)\n subu\t$a0, $a0, $s2\n jal\tdistance_2d\n subu\t$a1, $a1, $s3\n lui\t$v1, 0x28\n slt\t$v1, $v1, $v0\n bnez\t$v1, .L9c\n move\t$v0, $zero\n j\t.L9c\n li\t$v0, 1\n.L98:\n move\t$v0, $zero\n.L9c:\n lw\t$ra, 32($sp)\n lw\t$s3, 28($sp)\n lw\t$s2, 24($sp)\n lw\t$s1, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002ACFC_2B8FC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002ACFC_2B8FC` — benchmark function snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,24(sp)\n 8:\tmove\ts2,a0\n c:\tsw\ts3,28(sp)\n 10:\tmove\ts3,a1\n 14:\tsw\ts0,16(sp)\n 18:\tmove\ts0,a2\n 1c:\tsw\tra,32(sp)\n 20:\tjal\t0 \n 24:\tsw\ts1,20(sp)\n 28:\tmove\ts1,v0\n 2c:\tlw\ta0,1004(s1)\n 30:\tlw\ta1,1008(s1)\n 34:\tmove\ta2,s2\n 38:\tjal\t0 \n 3c:\tmove\ta3,s3\n 40:\tsll\ts0,s0,0x10\n 44:\tsra\ts0,s0,0x10\n 48:\taddiu\tv1,s0,-568\n 4c:\tsll\tv0,v0,0x10\n 50:\tsra\ta0,v0,0x10\n 54:\tslt\tv1,v1,a0\n 58:\tbeqz\tv1,98 \n 5c:\taddiu\tv0,s0,568\n 60:\tslt\tv0,a0,v0\n 64:\tbeqz\tv0,9c \n 68:\tmove\tv0,zero\n 6c:\tlw\ta0,1004(s1)\n 70:\tlw\ta1,1008(s1)\n 74:\tsubu\ta0,a0,s2\n 78:\tjal\t0 \n 7c:\tsubu\ta1,a1,s3\n 80:\tlui\tv1,0x28\n 84:\tslt\tv1,v1,v0\n 88:\tbnez\tv1,9c \n 8c:\tmove\tv0,zero\n 90:\tj\t9c \n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tlw\tra,32(sp)\n a0:\tlw\ts3,28(sp)\n a4:\tlw\ts2,24(sp)\n a8:\tlw\ts1,20(sp)\n ac:\tlw\ts0,16(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,40\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0e839e3e93bac188/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8006D21C_6DE1C\n00000000 *UND*\t00000000 distance_2d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 getCurrentAllocation\n00000038 R_MIPS_26 func_8006D21C_6DE1C\n00000078 R_MIPS_26 distance_2d\n00000090 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffd8 afb20018 00809021 afb3001c '..........!....\n 0010 00a09821 afb00010 00c08021 afbf0020 ...!.......!... \n 0020 0c000000 afb10014 00408821 8e2403ec .........@.!.$..\n 0030 8e2503f0 02403021 0c000000 02603821 .%...@0!.....`8!\n 0040 00108400 00108403 2603fdc8 00021400 ........&.......\n 0050 00022403 0064182a 1060000f 26020238 ..$..d.*.`..&..8\n 0060 0082102a 1040000d 00001021 8e2403ec ...*.@.....!.$..\n 0070 8e2503f0 00922023 0c000000 00b32823 .%.... #......(#\n 0080 3c030028 0062182a 14600004 00001021 <..(.b.*.`.....!\n 0090 08000027 24020001 00001021 8fbf0020 ...'$......!... \n 00a0 8fb3001c 8fb20018 8fb10014 8fb00010 ................\n 00b0 03e00008 27bd0028 00000000 00000000 ....'..(........\nContents of section .reginfo:\n 0000 a00f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002ACFC_2B8FC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002ACFC_2B8FC` — benchmark function snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,24(sp)\n 8:\tmove\ts2,a0\n c:\tsw\ts3,28(sp)\n 10:\tmove\ts3,a1\n 14:\tsw\ts0,16(sp)\n 18:\tmove\ts0,a2\n 1c:\tsw\tra,32(sp)\n 20:\tjal\t0 \n 24:\tsw\ts1,20(sp)\n 28:\tmove\ts1,v0\n 2c:\tlw\ta0,1004(s1)\n 30:\tlw\ta1,1008(s1)\n 34:\tmove\ta2,s2\n 38:\tjal\t0 \n 3c:\tmove\ta3,s3\n 40:\tsll\ts0,s0,0x10\n 44:\tsra\ts0,s0,0x10\n 48:\taddiu\tv1,s0,-568\n 4c:\tsll\tv0,v0,0x10\n 50:\tsra\ta0,v0,0x10\n 54:\tslt\tv1,v1,a0\n 58:\tbeqz\tv1,98 \n 5c:\taddiu\tv0,s0,568\n 60:\tslt\tv0,a0,v0\n 64:\tbeqz\tv0,9c \n 68:\tmove\tv0,zero\n 6c:\tlw\ta0,1004(s1)\n 70:\tlw\ta1,1008(s1)\n 74:\tsubu\ta0,a0,s2\n 78:\tjal\t0 \n 7c:\tsubu\ta1,a1,s3\n 80:\tlui\tv1,0x28\n 84:\tslt\tv1,v1,v0\n 88:\tbnez\tv1,9c \n 8c:\tmove\tv0,zero\n 90:\tj\t9c \n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tlw\tra,32(sp)\n a0:\tlw\ts3,28(sp)\n a4:\tlw\ts2,24(sp)\n a8:\tlw\ts1,20(sp)\n ac:\tlw\ts0,16(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,40\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0e839e3e93bac188/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8006D21C_6DE1C\n00000000 *UND*\t00000000 distance_2d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 getCurrentAllocation\n00000038 R_MIPS_26 func_8006D21C_6DE1C\n00000078 R_MIPS_26 distance_2d\n00000090 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffd8 afb20018 00809021 afb3001c '..........!....\n 0010 00a09821 afb00010 00c08021 afbf0020 ...!.......!... \n 0020 0c000000 afb10014 00408821 8e2403ec .........@.!.$..\n 0030 8e2503f0 02403021 0c000000 02603821 .%...@0!.....`8!\n 0040 00108400 00108403 2603fdc8 00021400 ........&.......\n 0050 00022403 0064182a 1060000f 26020238 ..$..d.*.`..&..8\n 0060 0082102a 1040000d 00001021 8e2403ec ...*.@.....!.$..\n 0070 8e2503f0 00922023 0c000000 00b32823 .%.... #......(#\n 0080 3c030028 0062182a 14600004 00001021 <..(.b.*.`.....!\n 0090 08000027 24020001 00001021 8fbf0020 ...'$......!... \n 00a0 8fb3001c 8fb20018 8fb10014 8fb00010 ................\n 00b0 03e00008 27bd0028 00000000 00000000 ....'..(........\nContents of section .reginfo:\n 0000 a00f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002ACFC_2B8FC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -14249,7 +14299,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8002ADB4_2B9B4` — benchmark function snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002ADB4_2B9B4\n move\t$t0, $a0\n sll\t$v0, $a0, 0x10\n sra\t$a2, $v0, 0x10\n sll\t$v0, $a1, 0x10\n sra\t$v1, $v0, 0x10\n beq\t$a2, $v1, .Lc0\n move\t$a3, $a1\n subu\t$v0, $a2, $v1\n bltzl\t$v0, .L28\n negu\t$v0, $v0\n.L28:\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 4097\n bnez\t$v0, .L50\n sll\t$v0, $t0, 0x10\n slt\t$v0, $v1, $a2\n beqzl\t$v0, .L4c\n addiu\t$t0, $a0, 8192\n addiu\t$a3, $a1, 8192\n.L4c:\n sll\t$v0, $t0, 0x10\n.L50:\n sra\t$a1, $v0, 0x10\n sll\t$v0, $a3, 0x10\n sra\t$v1, $v0, 0x10\n subu\t$v0, $a1, $v1\n bgez\t$v0, .L6c\n move\t$a2, $v0\n negu\t$a2, $a2\n.L6c:\n sll\t$v0, $a2, 0x10\n sra\t$a0, $v0, 0x10\n slti\t$v0, $a0, 2731\n bnezl\t$v0, .L88\n slt\t$v0, $v1, $a1\n j\t.Lc0\n addiu\t$a3, $a3, 4096\n.L88:\n xori\t$v0, $v0, 0x1\n negu\t$v0, $v0\n ori\t$v1, $v0, 0x1\n slti\t$v0, $a0, 128\n bnez\t$v0, .Lac\n nop\n sll\t$v0, $v1, 0x7\n j\t.Lc0\n addu\t$a3, $a3, $v0\n.Lac:\n nop\n mult\t$a2, $v1\n mflo\t$v0\n addu\t$v0, $a3, $v0\n andi\t$a3, $v0, 0x1fff\n.Lc0:\n sll\t$v0, $a3, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002ADB4_2B9B4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002ADB4_2B9B4` — benchmark function snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,a0\n 4:\tsll\tv0,a0,0x10\n 8:\tsra\ta2,v0,0x10\n c:\tsll\tv0,a1,0x10\n 10:\tsra\tv1,v0,0x10\n 14:\tbeq\ta2,v1,c0 \n 18:\tmove\ta3,a1\n 1c:\tsubu\tv0,a2,v1\n 20:\tbltzl\tv0,28 \n 24:\tnegu\tv0,v0\n 28:\tsll\tv0,v0,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tslti\tv0,v0,4097\n 34:\tbnez\tv0,50 \n 38:\tsll\tv0,t0,0x10\n 3c:\tslt\tv0,v1,a2\n 40:\tbeqzl\tv0,4c \n 44:\taddiu\tt0,a0,8192\n 48:\taddiu\ta3,a1,8192\n 4c:\tsll\tv0,t0,0x10\n 50:\tsra\ta1,v0,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tsra\tv1,v0,0x10\n 5c:\tsubu\tv0,a1,v1\n 60:\tbgez\tv0,6c \n 64:\tmove\ta2,v0\n 68:\tnegu\ta2,a2\n 6c:\tsll\tv0,a2,0x10\n 70:\tsra\ta0,v0,0x10\n 74:\tslti\tv0,a0,2731\n 78:\tbnezl\tv0,88 \n 7c:\tslt\tv0,v1,a1\n 80:\tj\tc0 \n 84:\taddiu\ta3,a3,4096\n 88:\txori\tv0,v0,0x1\n 8c:\tnegu\tv0,v0\n 90:\tori\tv1,v0,0x1\n 94:\tslti\tv0,a0,128\n 98:\tbnez\tv0,ac \n 9c:\tnop\n a0:\tsll\tv0,v1,0x7\n a4:\tj\tc0 \n a8:\taddu\ta3,a3,v0\n ac:\tnop\n b0:\tmult\ta2,v1\n b4:\tmflo\tv0\n b8:\taddu\tv0,a3,v0\n bc:\tandi\ta3,v0,0x1fff\n c0:\tsll\tv0,a3,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-032753bac235c323/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000cc func_8002ADB4_2B9B4\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000080 R_MIPS_26 .text\n000000a4 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00804021 00041400 00023403 00051400 ..@!......4.....\n 0010 00021c03 10c3002a 00a03821 00c31023 .......*..8!...#\n 0020 04420001 00021023 00021400 00021403 .B.....#........\n 0030 28421001 14400006 00081400 0066102a (B...@.......f.*\n 0040 50400002 24882000 24a72000 00081400 P@..$. .$. .....\n 0050 00022c03 00071400 00021c03 00a31023 ..,............#\n 0060 04410002 00403021 00063023 00061400 .A...@0!..0#....\n 0070 00022403 28820aab 54400003 0065102a ..$.(...T@...e.*\n 0080 08000030 24e71000 38420001 00021023 ...0$...8B.....#\n 0090 34430001 28820080 14400004 00000000 4C..(....@......\n 00a0 000311c0 08000030 00e23821 00000000 .......0..8!....\n 00b0 00c30018 00001012 00e21021 30471fff ...........!0G..\n 00c0 00071400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002ADB4_2B9B4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002ADB4_2B9B4` — benchmark function snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,a0\n 4:\tsll\tv0,a0,0x10\n 8:\tsra\ta2,v0,0x10\n c:\tsll\tv0,a1,0x10\n 10:\tsra\tv1,v0,0x10\n 14:\tbeq\ta2,v1,c0 \n 18:\tmove\ta3,a1\n 1c:\tsubu\tv0,a2,v1\n 20:\tbltzl\tv0,28 \n 24:\tnegu\tv0,v0\n 28:\tsll\tv0,v0,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tslti\tv0,v0,4097\n 34:\tbnez\tv0,50 \n 38:\tsll\tv0,t0,0x10\n 3c:\tslt\tv0,v1,a2\n 40:\tbeqzl\tv0,4c \n 44:\taddiu\tt0,a0,8192\n 48:\taddiu\ta3,a1,8192\n 4c:\tsll\tv0,t0,0x10\n 50:\tsra\ta1,v0,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tsra\tv1,v0,0x10\n 5c:\tsubu\tv0,a1,v1\n 60:\tbgez\tv0,6c \n 64:\tmove\ta2,v0\n 68:\tnegu\ta2,a2\n 6c:\tsll\tv0,a2,0x10\n 70:\tsra\ta0,v0,0x10\n 74:\tslti\tv0,a0,2731\n 78:\tbnezl\tv0,88 \n 7c:\tslt\tv0,v1,a1\n 80:\tj\tc0 \n 84:\taddiu\ta3,a3,4096\n 88:\txori\tv0,v0,0x1\n 8c:\tnegu\tv0,v0\n 90:\tori\tv1,v0,0x1\n 94:\tslti\tv0,a0,128\n 98:\tbnez\tv0,ac \n 9c:\tnop\n a0:\tsll\tv0,v1,0x7\n a4:\tj\tc0 \n a8:\taddu\ta3,a3,v0\n ac:\tnop\n b0:\tmult\ta2,v1\n b4:\tmflo\tv0\n b8:\taddu\tv0,a3,v0\n bc:\tandi\ta3,v0,0x1fff\n c0:\tsll\tv0,a3,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-032753bac235c323/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000cc func_8002ADB4_2B9B4\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000080 R_MIPS_26 .text\n000000a4 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00804021 00041400 00023403 00051400 ..@!......4.....\n 0010 00021c03 10c3002a 00a03821 00c31023 .......*..8!...#\n 0020 04420001 00021023 00021400 00021403 .B.....#........\n 0030 28421001 14400006 00081400 0066102a (B...@.......f.*\n 0040 50400002 24882000 24a72000 00081400 P@..$. .$. .....\n 0050 00022c03 00071400 00021c03 00a31023 ..,............#\n 0060 04410002 00403021 00063023 00061400 .A...@0!..0#....\n 0070 00022403 28820aab 54400003 0065102a ..$.(...T@...e.*\n 0080 08000030 24e71000 38420001 00021023 ...0$...8B.....#\n 0090 34430001 28820080 14400004 00000000 4C..(....@......\n 00a0 000311c0 08000030 00e23821 00000000 .......0..8!....\n 00b0 00c30018 00001012 00e21021 30471fff ...........!0G..\n 00c0 00071400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002ADB4_2B9B4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -14338,7 +14388,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8002B4B8_2C0B8` — benchmark function snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002B4B8_2C0B8\n andi\t$a0, $a0, 0x1fff\n andi\t$a1, $a1, 0x1fff\n subu\t$a1, $a1, $a0\n andi\t$a1, $a1, 0x1fff\n slti\t$v0, $a1, 4097\n bnez\t$v0, .L20\n move\t$v1, $a1\n ori\t$v1, $a1, 0xe000\n.L20:\n sll\t$v0, $v1, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002B4B8_2C0B8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002B4B8_2C0B8` — benchmark function snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0x1fff\n 4:\tandi\ta1,a1,0x1fff\n 8:\tsubu\ta1,a1,a0\n c:\tandi\ta1,a1,0x1fff\n 10:\tslti\tv0,a1,4097\n 14:\tbnez\tv0,20 \n 18:\tmove\tv1,a1\n 1c:\tori\tv1,a1,0xe000\n 20:\tsll\tv0,v1,0x10\n 24:\tjr\tra\n 28:\tsra\tv0,v0,0x10\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e937fcabf56e4964/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_8002B4B8_2C0B8\n\n\nContents of section .text:\n 0000 30841fff 30a51fff 00a42823 30a51fff 0...0.....(#0...\n 0010 28a21001 14400002 00a01821 34a3e000 (....@.....!4...\n 0020 00031400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002B4B8_2C0B8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002B4B8_2C0B8` — benchmark function snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0x1fff\n 4:\tandi\ta1,a1,0x1fff\n 8:\tsubu\ta1,a1,a0\n c:\tandi\ta1,a1,0x1fff\n 10:\tslti\tv0,a1,4097\n 14:\tbnez\tv0,20 \n 18:\tmove\tv1,a1\n 1c:\tori\tv1,a1,0xe000\n 20:\tsll\tv0,v1,0x10\n 24:\tjr\tra\n 28:\tsra\tv0,v0,0x10\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e937fcabf56e4964/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_8002B4B8_2C0B8\n\n\nContents of section .text:\n 0000 30841fff 30a51fff 00a42823 30a51fff 0...0.....(#0...\n 0010 28a21001 14400002 00a01821 34a3e000 (....@.....!4...\n 0020 00031400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002B4B8_2C0B8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -14414,7 +14464,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_8002BE94_2CA94` — benchmark function snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002BE94_2CA94\n addiu\t$sp, $sp, -40\n sw\t$s2, 32($sp)\n move\t$s2, $a0\n sw\t$ra, 36($sp)\n sw\t$s1, 28($sp)\n sw\t$s0, 24($sp)\n lbu\t$v0, 213($s2)\n blez\t$v0, .L48\n move\t$s1, $zero\n move\t$s0, $s2\n.L28:\n lw\t$a0, 0($s0)\n jal\tdestroySceneModel\n addiu\t$s1, $s1, 1\n sw\t$v0, 0($s0)\n lbu\t$v0, 213($s2)\n slt\t$v0, $s1, $v0\n bnez\t$v0, .L28\n addiu\t$s0, $s0, 100\n.L48:\n lw\t$ra, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002BE94_2CA94 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002BE94_2CA94` — benchmark function snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,32(sp)\n 8:\tmove\ts2,a0\n c:\tsw\tra,36(sp)\n 10:\tsw\ts1,28(sp)\n 14:\tsw\ts0,24(sp)\n 18:\tlbu\tv0,213(s2)\n 1c:\tblez\tv0,48 \n 20:\tmove\ts1,zero\n 24:\tmove\ts0,s2\n 28:\tlw\ta0,0(s0)\n 2c:\tjal\t0 \n 30:\taddiu\ts1,s1,1\n 34:\tsw\tv0,0(s0)\n 38:\tlbu\tv0,213(s2)\n 3c:\tslt\tv0,s1,v0\n 40:\tbnez\tv0,28 \n 44:\taddiu\ts0,s0,100\n 48:\tlw\tra,36(sp)\n 4c:\tlw\ts2,32(sp)\n 50:\tlw\ts1,28(sp)\n 54:\tlw\ts0,24(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,40\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-768f1f5763ffb52a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_8002BE94_2CA94\n00000000 *UND*\t00000000 destroySceneModel\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 destroySceneModel\n\n\nContents of section .text:\n 0000 27bdffd8 afb20020 00809021 afbf0024 '...... ...!...$\n 0010 afb1001c afb00018 924200d5 1840000a .........B...@..\n 0020 00008821 02408021 8e040000 0c000000 ...!.@.!........\n 0030 26310001 ae020000 924200d5 0222102a &1.......B...\".*\n 0040 1440fff9 26100064 8fbf0024 8fb20020 .@..&..d...$... \n 0050 8fb1001c 8fb00018 03e00008 27bd0028 ............'..(\nContents of section .reginfo:\n 0000 a0070014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8002BE94_2CA94\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002BE94_2CA94 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002BE94_2CA94` — benchmark function snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,32(sp)\n 8:\tmove\ts2,a0\n c:\tsw\tra,36(sp)\n 10:\tsw\ts1,28(sp)\n 14:\tsw\ts0,24(sp)\n 18:\tlbu\tv0,213(s2)\n 1c:\tblez\tv0,48 \n 20:\tmove\ts1,zero\n 24:\tmove\ts0,s2\n 28:\tlw\ta0,0(s0)\n 2c:\tjal\t0 \n 30:\taddiu\ts1,s1,1\n 34:\tsw\tv0,0(s0)\n 38:\tlbu\tv0,213(s2)\n 3c:\tslt\tv0,s1,v0\n 40:\tbnez\tv0,28 \n 44:\taddiu\ts0,s0,100\n 48:\tlw\tra,36(sp)\n 4c:\tlw\ts2,32(sp)\n 50:\tlw\ts1,28(sp)\n 54:\tlw\ts0,24(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,40\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-768f1f5763ffb52a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_8002BE94_2CA94\n00000000 *UND*\t00000000 destroySceneModel\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 destroySceneModel\n\n\nContents of section .text:\n 0000 27bdffd8 afb20020 00809021 afbf0024 '...... ...!...$\n 0010 afb1001c afb00018 924200d5 1840000a .........B...@..\n 0020 00008821 02408021 8e040000 0c000000 ...!.@.!........\n 0030 26310001 ae020000 924200d5 0222102a &1.......B...\".*\n 0040 1440fff9 26100064 8fbf0024 8fb20020 .@..&..d...$... \n 0050 8fb1001c 8fb00018 03e00008 27bd0028 ............'..(\nContents of section .reginfo:\n 0000 a0070014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8002BE94_2CA94\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002BE94_2CA94 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -14487,7 +14537,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80035F80_36B80` — benchmark function snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80035F80_36B80\n addiu\t$sp, $sp, -24\n andi\t$a0, $a0, 0xff\n li\t$v0, 1\n bne\t$a0, $v0, .L2c\n sw\t$ra, 16($sp)\n lui\t$a0, %hi(_459E00_ROM_START)\n addiu\t$a0, $a0, %lo(_459E00_ROM_START)\n lui\t$a1, %hi(_459E00_ROM_END)\n addiu\t$a1, $a1, %lo(_459E00_ROM_END)\n j\t.L40\n li\t$a2, 8936\n.L2c:\n lui\t$a0, %hi(_3F6950_ROM_START)\n addiu\t$a0, $a0, %lo(_3F6950_ROM_START)\n lui\t$a1, %hi(_3F6950_ROM_END)\n addiu\t$a1, $a1, %lo(_3F6950_ROM_END)\n li\t$a2, 1288\n.L40:\n jal\tloadCompressedData\n nop\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-cd71a6e037df.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80035F80_36B80(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80035F80_36B80 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80035F80_36B80` — benchmark function snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tandi\ta0,a0,0xff\n 8:\tli\tv0,1\n c:\tbne\ta0,v0,2c \n 10:\tsw\tra,16(sp)\n 14:\tlui\ta0,0x0\n 18:\taddiu\ta0,a0,0\n 1c:\tlui\ta1,0x0\n 20:\taddiu\ta1,a1,0\n 24:\tj\t40 \n 28:\tli\ta2,8936\n 2c:\tlui\ta0,0x0\n 30:\taddiu\ta0,a0,0\n 34:\tlui\ta1,0x0\n 38:\taddiu\ta1,a1,0\n 3c:\tli\ta2,1288\n 40:\tjal\t0 \n 44:\tnop\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-307c44b8cf52b911/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80035F80_36B80\n00000000 *UND*\t00000000 _459E00_ROM_START\n00000000 *UND*\t00000000 _459E00_ROM_END\n00000000 *UND*\t00000000 _3F6950_ROM_START\n00000000 *UND*\t00000000 _3F6950_ROM_END\n00000000 *UND*\t00000000 loadCompressedData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_HI16 _459E00_ROM_START\n00000018 R_MIPS_LO16 _459E00_ROM_START\n0000001c R_MIPS_HI16 _459E00_ROM_END\n00000020 R_MIPS_LO16 _459E00_ROM_END\n00000024 R_MIPS_26 .text\n0000002c R_MIPS_HI16 _3F6950_ROM_START\n00000030 R_MIPS_LO16 _3F6950_ROM_START\n00000034 R_MIPS_HI16 _3F6950_ROM_END\n00000038 R_MIPS_LO16 _3F6950_ROM_END\n00000040 R_MIPS_26 loadCompressedData\n\n\nContents of section .text:\n 0000 27bdffe8 308400ff 24020001 14820007 '...0...$.......\n 0010 afbf0010 3c040000 24840000 3c050000 ....<...$...<...\n 0020 24a50000 08000010 240622e8 3c040000 $.......$.\".<...\n 0030 24840000 3c050000 24a50000 24060508 $...<...$...$...\n 0040 0c000000 00000000 8fbf0010 03e00008 ................\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80035F80_36B80 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80035F80_36B80` — benchmark function snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tandi\ta0,a0,0xff\n 8:\tli\tv0,1\n c:\tbne\ta0,v0,2c \n 10:\tsw\tra,16(sp)\n 14:\tlui\ta0,0x0\n 18:\taddiu\ta0,a0,0\n 1c:\tlui\ta1,0x0\n 20:\taddiu\ta1,a1,0\n 24:\tj\t40 \n 28:\tli\ta2,8936\n 2c:\tlui\ta0,0x0\n 30:\taddiu\ta0,a0,0\n 34:\tlui\ta1,0x0\n 38:\taddiu\ta1,a1,0\n 3c:\tli\ta2,1288\n 40:\tjal\t0 \n 44:\tnop\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-307c44b8cf52b911/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80035F80_36B80\n00000000 *UND*\t00000000 _459E00_ROM_START\n00000000 *UND*\t00000000 _459E00_ROM_END\n00000000 *UND*\t00000000 _3F6950_ROM_START\n00000000 *UND*\t00000000 _3F6950_ROM_END\n00000000 *UND*\t00000000 loadCompressedData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_HI16 _459E00_ROM_START\n00000018 R_MIPS_LO16 _459E00_ROM_START\n0000001c R_MIPS_HI16 _459E00_ROM_END\n00000020 R_MIPS_LO16 _459E00_ROM_END\n00000024 R_MIPS_26 .text\n0000002c R_MIPS_HI16 _3F6950_ROM_START\n00000030 R_MIPS_LO16 _3F6950_ROM_START\n00000034 R_MIPS_HI16 _3F6950_ROM_END\n00000038 R_MIPS_LO16 _3F6950_ROM_END\n00000040 R_MIPS_26 loadCompressedData\n\n\nContents of section .text:\n 0000 27bdffe8 308400ff 24020001 14820007 '...0...$.......\n 0010 afbf0010 3c040000 24840000 3c050000 ....<...$...<...\n 0020 24a50000 08000010 240622e8 3c040000 $.......$.\".<...\n 0030 24840000 3c050000 24a50000 24060508 $...<...$...$...\n 0040 0c000000 00000000 8fbf0010 03e00008 ................\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80035F80_36B80 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -14567,7 +14617,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80037FE0_38BE0` — benchmark function snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80037FE0_38BE0\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n andi\t$a0, $a0, 0xff\n addu\t$v0, $v0, $a0\n lbu\t$v0, 16($v0)\n xori\t$v0, $v0, 0x1\n jr\t$ra\n sltiu\t$v0, $v0, 1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80037FE0_38BE0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80037FE0_38BE0` — benchmark function snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlw\tv0,0(v0)\n 8:\tandi\ta0,a0,0xff\n c:\taddu\tv0,v0,a0\n 10:\tlbu\tv0,16(v0)\n 14:\txori\tv0,v0,0x1\n 18:\tjr\tra\n 1c:\tsltiu\tv0,v0,1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ce80f7f2e88c6fb7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 func_80037FE0_38BE0\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 EepromSaveData\n00000004 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 3c020000 8c420000 308400ff 00441021 <....B..0....D.!\n 0010 90420010 38420001 03e00008 2c420001 .B..8B......,B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80037FE0_38BE0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80037FE0_38BE0` — benchmark function snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlw\tv0,0(v0)\n 8:\tandi\ta0,a0,0xff\n c:\taddu\tv0,v0,a0\n 10:\tlbu\tv0,16(v0)\n 14:\txori\tv0,v0,0x1\n 18:\tjr\tra\n 1c:\tsltiu\tv0,v0,1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ce80f7f2e88c6fb7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 func_80037FE0_38BE0\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 EepromSaveData\n00000004 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 3c020000 8c420000 308400ff 00441021 <....B..0....D.!\n 0010 90420010 38420001 03e00008 2c420001 .B..8B......,B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80037FE0_38BE0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -14662,7 +14712,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80038000_38C00` — benchmark function snowboardkids2:func_80038000_38C00:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80038000_38C00\n andi\t$a0, $a0, 0xff\n sltiu\t$v0, $a0, 6\n bnez\t$v0, .L50\n li\t$v0, 1\n li\t$v0, 6\n bne\t$a0, $v0, .L2c\n li\t$v0, 7\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n j\t.L50\n lbu\t$v0, 78($v0)\n.L2c:\n beq\t$a0, $v0, .L44\n nop\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n j\t.L50\n lbu\t$v0, 80($v0)\n.L44:\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n lbu\t$v0, 79($v0)\n.L50:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80038000_38C00 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80038000_38C00` — benchmark function snowboardkids2:func_80038000_38C00:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80038000_38C00:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0xff\n 4:\tsltiu\tv0,a0,6\n 8:\tbnez\tv0,50 \n c:\tli\tv0,1\n 10:\tli\tv0,6\n 14:\tbne\ta0,v0,2c \n 18:\tli\tv0,7\n 1c:\tlui\tv0,0x0\n 20:\tlw\tv0,0(v0)\n 24:\tj\t50 \n 28:\tlbu\tv0,78(v0)\n 2c:\tbeq\ta0,v0,44 \n 30:\tnop\n 34:\tlui\tv0,0x0\n 38:\tlw\tv0,0(v0)\n 3c:\tj\t50 \n 40:\tlbu\tv0,80(v0)\n 44:\tlui\tv0,0x0\n 48:\tlw\tv0,0(v0)\n 4c:\tlbu\tv0,79(v0)\n 50:\tjr\tra\n 54:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-deab83b78ab9ef69/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80038000_38C00\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 EepromSaveData\n00000020 R_MIPS_LO16 EepromSaveData\n00000024 R_MIPS_26 .text\n00000034 R_MIPS_HI16 EepromSaveData\n00000038 R_MIPS_LO16 EepromSaveData\n0000003c R_MIPS_26 .text\n00000044 R_MIPS_HI16 EepromSaveData\n00000048 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 308400ff 2c820006 14400011 24020001 0...,....@..$...\n 0010 24020006 14820005 24020007 3c020000 $.......$...<...\n 0020 8c420000 08000014 9042004e 10820005 .B.......B.N....\n 0030 00000000 3c020000 8c420000 08000014 ....<....B......\n 0040 90420050 3c020000 8c420000 9042004f .B.P<....B...B.O\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80038000_38C00 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80038000_38C00` — benchmark function snowboardkids2:func_80038000_38C00:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80038000_38C00:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0xff\n 4:\tsltiu\tv0,a0,6\n 8:\tbnez\tv0,50 \n c:\tli\tv0,1\n 10:\tli\tv0,6\n 14:\tbne\ta0,v0,2c \n 18:\tli\tv0,7\n 1c:\tlui\tv0,0x0\n 20:\tlw\tv0,0(v0)\n 24:\tj\t50 \n 28:\tlbu\tv0,78(v0)\n 2c:\tbeq\ta0,v0,44 \n 30:\tnop\n 34:\tlui\tv0,0x0\n 38:\tlw\tv0,0(v0)\n 3c:\tj\t50 \n 40:\tlbu\tv0,80(v0)\n 44:\tlui\tv0,0x0\n 48:\tlw\tv0,0(v0)\n 4c:\tlbu\tv0,79(v0)\n 50:\tjr\tra\n 54:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-deab83b78ab9ef69/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80038000_38C00\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 EepromSaveData\n00000020 R_MIPS_LO16 EepromSaveData\n00000024 R_MIPS_26 .text\n00000034 R_MIPS_HI16 EepromSaveData\n00000038 R_MIPS_LO16 EepromSaveData\n0000003c R_MIPS_26 .text\n00000044 R_MIPS_HI16 EepromSaveData\n00000048 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 308400ff 2c820006 14400011 24020001 0...,....@..$...\n 0010 24020006 14820005 24020007 3c020000 $.......$...<...\n 0020 8c420000 08000014 9042004e 10820005 .B.......B.N....\n 0030 00000000 3c020000 8c420000 08000014 ....<....B......\n 0040 90420050 3c020000 8c420000 9042004f .B.P<....B...B.O\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80038000_38C00 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -14732,7 +14782,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_80051C80_52880` — benchmark function snowboardkids2:func_80051C80_52880:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80051C80_52880\n addiu\t$sp, $sp, -64\n sw\t$s3, 52($sp)\n move\t$s3, $a0\n sw\t$s4, 56($sp)\n move\t$s4, $a1\n sw\t$ra, 60($sp)\n sw\t$s2, 48($sp)\n sw\t$s1, 44($sp)\n sw\t$s0, 40($sp)\n lw\t$a0, 0($s3)\n jal\tdistance_2d\n lw\t$a1, 8($s3)\n move\t$v1, $v0\n lui\t$v0, 0x1\n ori\t$v0, $v0, 0xffff\n slt\t$v0, $v0, $v1\n bnez\t$v0, .Lb4\n nop\n beqz\t$v1, .Lac\n lui\t$s2, 0x2\n lw\t$v0, 0($s3)\n mult\t$v0, $s2\n move\t$s1, $v1\n sra\t$s0, $v1, 0x1f\n move\t$a2, $s0\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n move\t$a3, $s1\n lw\t$a0, 8($s3)\n mult\t$a0, $s2\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 0($s3)\n j\t.Lb4\n sw\t$v1, 8($s3)\n.Lac:\n lui\t$v0, 0x2\n sw\t$v0, 8($s3)\n.Lb4:\n lw\t$a0, 0($s3)\n lw\t$a1, 4($s3)\n jal\tdistance_3d\n lw\t$a2, 8($s3)\n move\t$v1, $v0\n beqz\t$v1, .L14c\n move\t$s1, $v1\n lw\t$v0, 0($s3)\n mult\t$v0, $s4\n sra\t$s0, $v1, 0x1f\n move\t$a2, $s0\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n move\t$a3, $s1\n lw\t$a0, 4($s3)\n mult\t$a0, $s4\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 0($s3)\n lw\t$a0, 8($s3)\n mult\t$a0, $s4\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 4($s3)\n sw\t$v1, 8($s3)\n.L14c:\n lw\t$ra, 60($sp)\n lw\t$s4, 56($sp)\n lw\t$s3, 52($sp)\n lw\t$s2, 48($sp)\n lw\t$s1, 44($sp)\n lw\t$s0, 40($sp)\n jr\t$ra\n addiu\t$sp, $sp, 64\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80051C80_52880 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80051C80_52880` — benchmark function snowboardkids2:func_80051C80_52880:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80051C80_52880:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\ts3,52(sp)\n 8:\tmove\ts3,a0\n c:\tsw\ts4,56(sp)\n 10:\tmove\ts4,a1\n 14:\tsw\tra,60(sp)\n 18:\tsw\ts2,48(sp)\n 1c:\tsw\ts1,44(sp)\n 20:\tsw\ts0,40(sp)\n 24:\tlw\ta0,0(s3)\n 28:\tjal\t0 \n 2c:\tlw\ta1,8(s3)\n 30:\tmove\tv1,v0\n 34:\tlui\tv0,0x1\n 38:\tori\tv0,v0,0xffff\n 3c:\tslt\tv0,v0,v1\n 40:\tbnez\tv0,b4 \n 44:\tnop\n 48:\tbeqz\tv1,ac \n 4c:\tlui\ts2,0x2\n 50:\tlw\tv0,0(s3)\n 54:\tmult\tv0,s2\n 58:\tmove\ts1,v1\n 5c:\tsra\ts0,v1,0x1f\n 60:\tmove\ta2,s0\n 64:\tmfhi\ta0\n 68:\tmflo\ta1\n\t...\n 74:\tjal\t0 \n 78:\tmove\ta3,s1\n 7c:\tlw\ta0,8(s3)\n 80:\tmult\ta0,s2\n 84:\tmove\ta2,s0\n 88:\tmove\ta3,s1\n 8c:\tmfhi\ta0\n 90:\tmflo\ta1\n\t...\n 9c:\tjal\t0 \n a0:\tsw\tv1,0(s3)\n a4:\tj\tb4 \n a8:\tsw\tv1,8(s3)\n ac:\tlui\tv0,0x2\n b0:\tsw\tv0,8(s3)\n b4:\tlw\ta0,0(s3)\n b8:\tlw\ta1,4(s3)\n bc:\tjal\t0 \n c0:\tlw\ta2,8(s3)\n c4:\tmove\tv1,v0\n c8:\tbeqz\tv1,14c \n cc:\tmove\ts1,v1\n d0:\tlw\tv0,0(s3)\n d4:\tmult\tv0,s4\n d8:\tsra\ts0,v1,0x1f\n dc:\tmove\ta2,s0\n e0:\tmfhi\ta0\n e4:\tmflo\ta1\n\t...\n f0:\tjal\t0 \n f4:\tmove\ta3,s1\n f8:\tlw\ta0,4(s3)\n fc:\tmult\ta0,s4\n 100:\tmove\ta2,s0\n 104:\tmove\ta3,s1\n 108:\tmfhi\ta0\n 10c:\tmflo\ta1\n\t...\n 118:\tjal\t0 \n 11c:\tsw\tv1,0(s3)\n 120:\tlw\ta0,8(s3)\n 124:\tmult\ta0,s4\n 128:\tmove\ta2,s0\n 12c:\tmove\ta3,s1\n 130:\tmfhi\ta0\n 134:\tmflo\ta1\n\t...\n 140:\tjal\t0 \n 144:\tsw\tv1,4(s3)\n 148:\tsw\tv1,8(s3)\n 14c:\tlw\tra,60(sp)\n 150:\tlw\ts4,56(sp)\n 154:\tlw\ts3,52(sp)\n 158:\tlw\ts2,48(sp)\n 15c:\tlw\ts1,44(sp)\n 160:\tlw\ts0,40(sp)\n 164:\tjr\tra\n 168:\taddiu\tsp,sp,64\n 16c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dab5be0e70b1fe00/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 *UND*\t00000000 __divdi3\n00000000 g F .text\t0000016c func_80051C80_52880\n00000000 *UND*\t00000000 distance_2d\n00000000 *UND*\t00000000 distance_3d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000028 R_MIPS_26 distance_2d\n00000074 R_MIPS_26 __divdi3\n0000009c R_MIPS_26 __divdi3\n000000a4 R_MIPS_26 .text\n000000bc R_MIPS_26 distance_3d\n000000f0 R_MIPS_26 __divdi3\n00000118 R_MIPS_26 __divdi3\n00000140 R_MIPS_26 __divdi3\n\n\nContents of section .text:\n 0000 27bdffc0 afb30034 00809821 afb40038 '......4...!...8\n 0010 00a0a021 afbf003c afb20030 afb1002c ...!...<...0...,\n 0020 afb00028 8e640000 0c000000 8e650008 ...(.d.......e..\n 0030 00401821 3c020001 3442ffff 0043102a .@.!<...4B...C.*\n 0040 1440001c 00000000 10600018 3c120002 .@.......`..<...\n 0050 8e620000 00520018 00608821 000387c3 .b...R...`.!....\n 0060 02003021 00002010 00002812 00000000 ..0!.. ...(.....\n 0070 00000000 0c000000 02203821 8e640008 ......... 8!.d..\n 0080 00920018 02003021 02203821 00002010 ......0!. 8!.. .\n 0090 00002812 00000000 00000000 0c000000 ..(.............\n 00a0 ae630000 0800002d ae630008 3c020002 .c.....-.c..<...\n 00b0 ae620008 8e640000 8e650004 0c000000 .b...d...e......\n 00c0 8e660008 00401821 10600020 00608821 .f...@.!.`. .`.!\n 00d0 8e620000 00540018 000387c3 02003021 .b...T........0!\n 00e0 00002010 00002812 00000000 00000000 .. ...(.........\n 00f0 0c000000 02203821 8e640004 00940018 ..... 8!.d......\n 0100 02003021 02203821 00002010 00002812 ..0!. 8!.. ...(.\n 0110 00000000 00000000 0c000000 ae630000 .............c..\n 0120 8e640008 00940018 02003021 02203821 .d........0!. 8!\n 0130 00002010 00002812 00000000 00000000 .. ...(.........\n 0140 0c000000 ae630004 ae630008 8fbf003c .....c...c.....<\n 0150 8fb40038 8fb30034 8fb20030 8fb1002c ...8...4...0...,\n 0160 8fb00028 03e00008 27bd0040 00000000 ...(....'..@....\nContents of section .reginfo:\n 0000 a01f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80051C80_52880 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_80051C80_52880` — benchmark function snowboardkids2:func_80051C80_52880:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80051C80_52880:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\ts3,52(sp)\n 8:\tmove\ts3,a0\n c:\tsw\ts4,56(sp)\n 10:\tmove\ts4,a1\n 14:\tsw\tra,60(sp)\n 18:\tsw\ts2,48(sp)\n 1c:\tsw\ts1,44(sp)\n 20:\tsw\ts0,40(sp)\n 24:\tlw\ta0,0(s3)\n 28:\tjal\t0 \n 2c:\tlw\ta1,8(s3)\n 30:\tmove\tv1,v0\n 34:\tlui\tv0,0x1\n 38:\tori\tv0,v0,0xffff\n 3c:\tslt\tv0,v0,v1\n 40:\tbnez\tv0,b4 \n 44:\tnop\n 48:\tbeqz\tv1,ac \n 4c:\tlui\ts2,0x2\n 50:\tlw\tv0,0(s3)\n 54:\tmult\tv0,s2\n 58:\tmove\ts1,v1\n 5c:\tsra\ts0,v1,0x1f\n 60:\tmove\ta2,s0\n 64:\tmfhi\ta0\n 68:\tmflo\ta1\n\t...\n 74:\tjal\t0 \n 78:\tmove\ta3,s1\n 7c:\tlw\ta0,8(s3)\n 80:\tmult\ta0,s2\n 84:\tmove\ta2,s0\n 88:\tmove\ta3,s1\n 8c:\tmfhi\ta0\n 90:\tmflo\ta1\n\t...\n 9c:\tjal\t0 \n a0:\tsw\tv1,0(s3)\n a4:\tj\tb4 \n a8:\tsw\tv1,8(s3)\n ac:\tlui\tv0,0x2\n b0:\tsw\tv0,8(s3)\n b4:\tlw\ta0,0(s3)\n b8:\tlw\ta1,4(s3)\n bc:\tjal\t0 \n c0:\tlw\ta2,8(s3)\n c4:\tmove\tv1,v0\n c8:\tbeqz\tv1,14c \n cc:\tmove\ts1,v1\n d0:\tlw\tv0,0(s3)\n d4:\tmult\tv0,s4\n d8:\tsra\ts0,v1,0x1f\n dc:\tmove\ta2,s0\n e0:\tmfhi\ta0\n e4:\tmflo\ta1\n\t...\n f0:\tjal\t0 \n f4:\tmove\ta3,s1\n f8:\tlw\ta0,4(s3)\n fc:\tmult\ta0,s4\n 100:\tmove\ta2,s0\n 104:\tmove\ta3,s1\n 108:\tmfhi\ta0\n 10c:\tmflo\ta1\n\t...\n 118:\tjal\t0 \n 11c:\tsw\tv1,0(s3)\n 120:\tlw\ta0,8(s3)\n 124:\tmult\ta0,s4\n 128:\tmove\ta2,s0\n 12c:\tmove\ta3,s1\n 130:\tmfhi\ta0\n 134:\tmflo\ta1\n\t...\n 140:\tjal\t0 \n 144:\tsw\tv1,4(s3)\n 148:\tsw\tv1,8(s3)\n 14c:\tlw\tra,60(sp)\n 150:\tlw\ts4,56(sp)\n 154:\tlw\ts3,52(sp)\n 158:\tlw\ts2,48(sp)\n 15c:\tlw\ts1,44(sp)\n 160:\tlw\ts0,40(sp)\n 164:\tjr\tra\n 168:\taddiu\tsp,sp,64\n 16c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dab5be0e70b1fe00/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 *UND*\t00000000 __divdi3\n00000000 g F .text\t0000016c func_80051C80_52880\n00000000 *UND*\t00000000 distance_2d\n00000000 *UND*\t00000000 distance_3d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000028 R_MIPS_26 distance_2d\n00000074 R_MIPS_26 __divdi3\n0000009c R_MIPS_26 __divdi3\n000000a4 R_MIPS_26 .text\n000000bc R_MIPS_26 distance_3d\n000000f0 R_MIPS_26 __divdi3\n00000118 R_MIPS_26 __divdi3\n00000140 R_MIPS_26 __divdi3\n\n\nContents of section .text:\n 0000 27bdffc0 afb30034 00809821 afb40038 '......4...!...8\n 0010 00a0a021 afbf003c afb20030 afb1002c ...!...<...0...,\n 0020 afb00028 8e640000 0c000000 8e650008 ...(.d.......e..\n 0030 00401821 3c020001 3442ffff 0043102a .@.!<...4B...C.*\n 0040 1440001c 00000000 10600018 3c120002 .@.......`..<...\n 0050 8e620000 00520018 00608821 000387c3 .b...R...`.!....\n 0060 02003021 00002010 00002812 00000000 ..0!.. ...(.....\n 0070 00000000 0c000000 02203821 8e640008 ......... 8!.d..\n 0080 00920018 02003021 02203821 00002010 ......0!. 8!.. .\n 0090 00002812 00000000 00000000 0c000000 ..(.............\n 00a0 ae630000 0800002d ae630008 3c020002 .c.....-.c..<...\n 00b0 ae620008 8e640000 8e650004 0c000000 .b...d...e......\n 00c0 8e660008 00401821 10600020 00608821 .f...@.!.`. .`.!\n 00d0 8e620000 00540018 000387c3 02003021 .b...T........0!\n 00e0 00002010 00002812 00000000 00000000 .. ...(.........\n 00f0 0c000000 02203821 8e640004 00940018 ..... 8!.d......\n 0100 02003021 02203821 00002010 00002812 ..0!. 8!.. ...(.\n 0110 00000000 00000000 0c000000 ae630000 .............c..\n 0120 8e640008 00940018 02003021 02203821 .d........0!. 8!\n 0130 00002010 00002812 00000000 00000000 .. ...(.........\n 0140 0c000000 ae630004 ae630008 8fbf003c .....c...c.....<\n 0150 8fb40038 8fb30034 8fb20030 8fb1002c ...8...4...0...,\n 0160 8fb00028 03e00008 27bd0040 00000000 ...(....'..@....\nContents of section .reginfo:\n 0000 a01f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80051C80_52880 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -14818,7 +14868,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_800B0DC0_1DCF60` — benchmark function snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B0DC0_1DCF60\n lw\t$v0, 4($a0)\n addu\t$v0, $v0, $a0\n jr\t$ra\n lw\t$v0, 0($v0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B0DC0_1DCF60 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B0DC0_1DCF60` — benchmark function snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,4(a0)\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tlw\tv0,0(v0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-b8ee1bad664b02b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_800B0DC0_1DCF60\n\n\nContents of section .text:\n 0000 8c820004 00441021 03e00008 8c420000 .....D.!.....B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B0DC0_1DCF60 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B0DC0_1DCF60` — benchmark function snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,4(a0)\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tlw\tv0,0(v0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-b8ee1bad664b02b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_800B0DC0_1DCF60\n\n\nContents of section .text:\n 0000 8c820004 00441021 03e00008 8c420000 .....D.!.....B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B0DC0_1DCF60 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -14900,7 +14950,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_800B4B30_1E1BE0` — benchmark function snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B4B30_1E1BE0\n addiu\t$sp, $sp, -40\n sw\t$s1, 28($sp)\n move\t$s1, $a1\n sw\t$s2, 32($sp)\n move\t$s2, $a2\n sll\t$a3, $a3, 0x10\n sw\t$s0, 24($sp)\n sra\t$s0, $a3, 0x10\n bgtz\t$s0, .L60\n sw\t$ra, 36($sp)\n sll\t$a0, $a0, 0x10\n jal\tfunc_800B4AFC_1E1BAC\n sra\t$a0, $a0, 0x10\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n sll\t$a1, $s1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$a2, $s2, 0x10\n sra\t$a2, $a2, 0x10\n addiu\t$a2, $a2, 128\n jal\tfunc_80058360_58F60\n move\t$a3, $zero\n j\t.L94\n nop\n.L60:\n sll\t$a0, $a0, 0x10\n jal\tfunc_800B4AFC_1E1BAC\n sra\t$a0, $a0, 0x10\n sw\t$s0, 16($sp)\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n sll\t$a1, $s1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$a2, $s2, 0x10\n sra\t$a2, $a2, 0x10\n addiu\t$a2, $a2, 128\n jal\tfunc_80057DF0_589F0\n move\t$a3, $zero\n.L94:\n lw\t$ra, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-7a362db8d24a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800B4B30_1E1BE0(s16 arg0, s16 arg1, s16 arg2, s16 arg3);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B4B30_1E1BE0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B4B30_1E1BE0` — benchmark function snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts1,28(sp)\n 8:\tmove\ts1,a1\n c:\tsw\ts2,32(sp)\n 10:\tmove\ts2,a2\n 14:\tsll\ta3,a3,0x10\n 18:\tsw\ts0,24(sp)\n 1c:\tsra\ts0,a3,0x10\n 20:\tbgtz\ts0,60 \n 24:\tsw\tra,36(sp)\n 28:\tsll\ta0,a0,0x10\n 2c:\tjal\t0 \n 30:\tsra\ta0,a0,0x10\n 34:\tsll\tv0,v0,0x10\n 38:\tsra\ta0,v0,0x10\n 3c:\tsll\ta1,s1,0x10\n 40:\tsra\ta1,a1,0x10\n 44:\tsll\ta2,s2,0x10\n 48:\tsra\ta2,a2,0x10\n 4c:\taddiu\ta2,a2,128\n 50:\tjal\t0 \n 54:\tmove\ta3,zero\n 58:\tj\t94 \n 5c:\tnop\n 60:\tsll\ta0,a0,0x10\n 64:\tjal\t0 \n 68:\tsra\ta0,a0,0x10\n 6c:\tsw\ts0,16(sp)\n 70:\tsll\tv0,v0,0x10\n 74:\tsra\ta0,v0,0x10\n 78:\tsll\ta1,s1,0x10\n 7c:\tsra\ta1,a1,0x10\n 80:\tsll\ta2,s2,0x10\n 84:\tsra\ta2,a2,0x10\n 88:\taddiu\ta2,a2,128\n 8c:\tjal\t0 \n 90:\tmove\ta3,zero\n 94:\tlw\tra,36(sp)\n 98:\tlw\ts2,32(sp)\n 9c:\tlw\ts1,28(sp)\n a0:\tlw\ts0,24(sp)\n a4:\tjr\tra\n a8:\taddiu\tsp,sp,40\n ac:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-12749b0eb3179cef/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000ac func_800B4B30_1E1BE0\n00000000 *UND*\t00000000 func_800B4AFC_1E1BAC\n00000000 *UND*\t00000000 func_80058360_58F60\n00000000 *UND*\t00000000 func_80057DF0_589F0\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 func_800B4AFC_1E1BAC\n00000050 R_MIPS_26 func_80058360_58F60\n00000058 R_MIPS_26 .text\n00000064 R_MIPS_26 func_800B4AFC_1E1BAC\n0000008c R_MIPS_26 func_80057DF0_589F0\n\n\nContents of section .text:\n 0000 27bdffd8 afb1001c 00a08821 afb20020 '..........!... \n 0010 00c09021 00073c00 afb00018 00078403 ...!..<.........\n 0020 1e00000f afbf0024 00042400 0c000000 .......$..$.....\n 0030 00042403 00021400 00022403 00112c00 ..$.......$...,.\n 0040 00052c03 00123400 00063403 24c60080 ..,...4...4.$...\n 0050 0c000000 00003821 08000025 00000000 ......8!...%....\n 0060 00042400 0c000000 00042403 afb00010 ..$.......$.....\n 0070 00021400 00022403 00112c00 00052c03 ......$...,...,.\n 0080 00123400 00063403 24c60080 0c000000 ..4...4.$.......\n 0090 00003821 8fbf0024 8fb20020 8fb1001c ..8!...$... ....\n 00a0 8fb00018 03e00008 27bd0028 00000000 ........'..(....\nContents of section .reginfo:\n 0000 a00700f4 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B4B30_1E1BE0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B4B30_1E1BE0` — benchmark function snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts1,28(sp)\n 8:\tmove\ts1,a1\n c:\tsw\ts2,32(sp)\n 10:\tmove\ts2,a2\n 14:\tsll\ta3,a3,0x10\n 18:\tsw\ts0,24(sp)\n 1c:\tsra\ts0,a3,0x10\n 20:\tbgtz\ts0,60 \n 24:\tsw\tra,36(sp)\n 28:\tsll\ta0,a0,0x10\n 2c:\tjal\t0 \n 30:\tsra\ta0,a0,0x10\n 34:\tsll\tv0,v0,0x10\n 38:\tsra\ta0,v0,0x10\n 3c:\tsll\ta1,s1,0x10\n 40:\tsra\ta1,a1,0x10\n 44:\tsll\ta2,s2,0x10\n 48:\tsra\ta2,a2,0x10\n 4c:\taddiu\ta2,a2,128\n 50:\tjal\t0 \n 54:\tmove\ta3,zero\n 58:\tj\t94 \n 5c:\tnop\n 60:\tsll\ta0,a0,0x10\n 64:\tjal\t0 \n 68:\tsra\ta0,a0,0x10\n 6c:\tsw\ts0,16(sp)\n 70:\tsll\tv0,v0,0x10\n 74:\tsra\ta0,v0,0x10\n 78:\tsll\ta1,s1,0x10\n 7c:\tsra\ta1,a1,0x10\n 80:\tsll\ta2,s2,0x10\n 84:\tsra\ta2,a2,0x10\n 88:\taddiu\ta2,a2,128\n 8c:\tjal\t0 \n 90:\tmove\ta3,zero\n 94:\tlw\tra,36(sp)\n 98:\tlw\ts2,32(sp)\n 9c:\tlw\ts1,28(sp)\n a0:\tlw\ts0,24(sp)\n a4:\tjr\tra\n a8:\taddiu\tsp,sp,40\n ac:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-12749b0eb3179cef/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000ac func_800B4B30_1E1BE0\n00000000 *UND*\t00000000 func_800B4AFC_1E1BAC\n00000000 *UND*\t00000000 func_80058360_58F60\n00000000 *UND*\t00000000 func_80057DF0_589F0\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 func_800B4AFC_1E1BAC\n00000050 R_MIPS_26 func_80058360_58F60\n00000058 R_MIPS_26 .text\n00000064 R_MIPS_26 func_800B4AFC_1E1BAC\n0000008c R_MIPS_26 func_80057DF0_589F0\n\n\nContents of section .text:\n 0000 27bdffd8 afb1001c 00a08821 afb20020 '..........!... \n 0010 00c09021 00073c00 afb00018 00078403 ...!..<.........\n 0020 1e00000f afbf0024 00042400 0c000000 .......$..$.....\n 0030 00042403 00021400 00022403 00112c00 ..$.......$...,.\n 0040 00052c03 00123400 00063403 24c60080 ..,...4...4.$...\n 0050 0c000000 00003821 08000025 00000000 ......8!...%....\n 0060 00042400 0c000000 00042403 afb00010 ..$.......$.....\n 0070 00021400 00022403 00112c00 00052c03 ......$...,...,.\n 0080 00123400 00063403 24c60080 0c000000 ..4...4.$.......\n 0090 00003821 8fbf0024 8fb20020 8fb1001c ..8!...$... ....\n 00a0 8fb00018 03e00008 27bd0028 00000000 ........'..(....\nContents of section .reginfo:\n 0000 a00700f4 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B4B30_1E1BE0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -14974,7 +15024,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_800B5B7C_1E2C2C` — benchmark function snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B5B7C_1E2C2C\n sh\t$zero, 32($a0)\n sh\t$zero, 34($a0)\n sh\t$zero, 36($a0)\n sh\t$zero, 38($a0)\n sh\t$zero, 40($a0)\n sh\t$zero, 42($a0)\n sh\t$zero, 44($a0)\n sh\t$zero, 46($a0)\n sh\t$zero, 48($a0)\n sh\t$zero, 50($a0)\n sw\t$zero, 52($a0)\n sw\t$zero, 56($a0)\n sw\t$zero, 60($a0)\n sw\t$zero, 64($a0)\n sw\t$zero, 68($a0)\n sw\t$zero, 72($a0)\n sw\t$zero, 76($a0)\n sw\t$zero, 80($a0)\n sw\t$zero, 84($a0)\n sh\t$zero, 88($a0)\n sh\t$zero, 90($a0)\n sh\t$zero, 92($a0)\n sh\t$zero, 94($a0)\n sh\t$zero, 96($a0)\n sh\t$zero, 98($a0)\n sw\t$zero, 100($a0)\n sw\t$zero, 104($a0)\n sh\t$zero, 108($a0)\n sh\t$a1, 110($a0)\n sb\t$zero, 112($a0)\n jr\t$ra\n sb\t$zero, 113($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B5B7C_1E2C2C # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B5B7C_1E2C2C` — benchmark function snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsh\tzero,32(a0)\n 4:\tsh\tzero,34(a0)\n 8:\tsh\tzero,36(a0)\n c:\tsh\tzero,38(a0)\n 10:\tsh\tzero,40(a0)\n 14:\tsh\tzero,42(a0)\n 18:\tsh\tzero,44(a0)\n 1c:\tsh\tzero,46(a0)\n 20:\tsh\tzero,48(a0)\n 24:\tsh\tzero,50(a0)\n 28:\tsw\tzero,52(a0)\n 2c:\tsw\tzero,56(a0)\n 30:\tsw\tzero,60(a0)\n 34:\tsw\tzero,64(a0)\n 38:\tsw\tzero,68(a0)\n 3c:\tsw\tzero,72(a0)\n 40:\tsw\tzero,76(a0)\n 44:\tsw\tzero,80(a0)\n 48:\tsw\tzero,84(a0)\n 4c:\tsh\tzero,88(a0)\n 50:\tsh\tzero,90(a0)\n 54:\tsh\tzero,92(a0)\n 58:\tsh\tzero,94(a0)\n 5c:\tsh\tzero,96(a0)\n 60:\tsh\tzero,98(a0)\n 64:\tsw\tzero,100(a0)\n 68:\tsw\tzero,104(a0)\n 6c:\tsh\tzero,108(a0)\n 70:\tsh\ta1,110(a0)\n 74:\tsb\tzero,112(a0)\n 78:\tjr\tra\n 7c:\tsb\tzero,113(a0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0fd05b0dfbce2e59/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000080 func_800B5B7C_1E2C2C\n\n\nContents of section .text:\n 0000 a4800020 a4800022 a4800024 a4800026 ... ...\"...$...&\n 0010 a4800028 a480002a a480002c a480002e ...(...*...,....\n 0020 a4800030 a4800032 ac800034 ac800038 ...0...2...4...8\n 0030 ac80003c ac800040 ac800044 ac800048 ...<...@...D...H\n 0040 ac80004c ac800050 ac800054 a4800058 ...L...P...T...X\n 0050 a480005a a480005c a480005e a4800060 ...Z...\\...^...`\n 0060 a4800062 ac800064 ac800068 a480006c ...b...d...h...l\n 0070 a485006e a0800070 03e00008 a0800071 ...n...p.......q\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B5B7C_1E2C2C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B5B7C_1E2C2C` — benchmark function snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsh\tzero,32(a0)\n 4:\tsh\tzero,34(a0)\n 8:\tsh\tzero,36(a0)\n c:\tsh\tzero,38(a0)\n 10:\tsh\tzero,40(a0)\n 14:\tsh\tzero,42(a0)\n 18:\tsh\tzero,44(a0)\n 1c:\tsh\tzero,46(a0)\n 20:\tsh\tzero,48(a0)\n 24:\tsh\tzero,50(a0)\n 28:\tsw\tzero,52(a0)\n 2c:\tsw\tzero,56(a0)\n 30:\tsw\tzero,60(a0)\n 34:\tsw\tzero,64(a0)\n 38:\tsw\tzero,68(a0)\n 3c:\tsw\tzero,72(a0)\n 40:\tsw\tzero,76(a0)\n 44:\tsw\tzero,80(a0)\n 48:\tsw\tzero,84(a0)\n 4c:\tsh\tzero,88(a0)\n 50:\tsh\tzero,90(a0)\n 54:\tsh\tzero,92(a0)\n 58:\tsh\tzero,94(a0)\n 5c:\tsh\tzero,96(a0)\n 60:\tsh\tzero,98(a0)\n 64:\tsw\tzero,100(a0)\n 68:\tsw\tzero,104(a0)\n 6c:\tsh\tzero,108(a0)\n 70:\tsh\ta1,110(a0)\n 74:\tsb\tzero,112(a0)\n 78:\tjr\tra\n 7c:\tsb\tzero,113(a0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0fd05b0dfbce2e59/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000080 func_800B5B7C_1E2C2C\n\n\nContents of section .text:\n 0000 a4800020 a4800022 a4800024 a4800026 ... ...\"...$...&\n 0010 a4800028 a480002a a480002c a480002e ...(...*...,....\n 0020 a4800030 a4800032 ac800034 ac800038 ...0...2...4...8\n 0030 ac80003c ac800040 ac800044 ac800048 ...<...@...D...H\n 0040 ac80004c ac800050 ac800054 a4800058 ...L...P...T...X\n 0050 a480005a a480005c a480005e a4800060 ...Z...\\...^...`\n 0060 a4800062 ac800064 ac800068 a480006c ...b...d...h...l\n 0070 a485006e a0800070 03e00008 a0800071 ...n...p.......q\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B5B7C_1E2C2C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -15048,7 +15098,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_800B68F4_1E39A4` — benchmark function snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B68F4_1E39A4\n sw\t$a1, 96($a0)\n sw\t$a1, 84($a0)\n sw\t$a2, 100($a0)\n sw\t$a2, 88($a0)\n sw\t$a3, 104($a0)\n jr\t$ra\n sw\t$a3, 92($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B68F4_1E39A4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B68F4_1E39A4` — benchmark function snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,96(a0)\n 4:\tsw\ta1,84(a0)\n 8:\tsw\ta2,100(a0)\n c:\tsw\ta2,88(a0)\n 10:\tsw\ta3,104(a0)\n 14:\tjr\tra\n 18:\tsw\ta3,92(a0)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-025493b1a49c21ff/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_800B68F4_1E39A4\n\n\nContents of section .text:\n 0000 ac850060 ac850054 ac860064 ac860058 ...`...T...d...X\n 0010 ac870068 03e00008 ac87005c 00000000 ...h.......\\....\nContents of section .reginfo:\n 0000 800000f0 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B68F4_1E39A4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B68F4_1E39A4` — benchmark function snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,96(a0)\n 4:\tsw\ta1,84(a0)\n 8:\tsw\ta2,100(a0)\n c:\tsw\ta2,88(a0)\n 10:\tsw\ta3,104(a0)\n 14:\tjr\tra\n 18:\tsw\ta3,92(a0)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-025493b1a49c21ff/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_800B68F4_1E39A4\n\n\nContents of section .text:\n 0000 ac850060 ac850054 ac860064 ac860058 ...`...T...d...X\n 0010 ac870068 03e00008 ac87005c 00000000 ...h.......\\....\nContents of section .reginfo:\n 0000 800000f0 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B68F4_1E39A4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -15119,7 +15169,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_800B7620_1E46D0` — benchmark function snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B7620_1E46D0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n lw\t$a0, 36($s0)\n sw\t$a1, 148($s0)\n lw\t$a1, 44($s0)\n li\t$v0, 6\n sb\t$v0, 0($s0)\n sh\t$a3, 146($s0)\n sh\t$a2, 132($s0)\n jal\tatan2Fixed\n sh\t$a2, 134($s0)\n sll\t$a0, $v0, 0x10\n sra\t$a0, $a0, 0x10\n addiu\t$a0, $a0, 4096\n andi\t$a0, $a0, 0x1fff\n jal\tapproximateCos\n sw\t$a0, 156($s0)\n sll\t$v1, $v0, 0x2\n bnez\t$v1, .Lb8\n sra\t$v1, $v1, 0x8\n lh\t$a0, 158($s0)\n jal\tapproximateSin\n nop\n lw\t$v1, 36($s0)\n sll\t$v0, $v0, 0x2\n sra\t$v0, $v0, 0x8\n sll\t$v1, $v1, 0x8\n div\t$zero, $v1, $v0\n bnez\t$v0, .L84\n nop\n break\t0x7\n.L84:\n li\t$at, -1\n bne\t$v0, $at, .L9c\n lui\t$at, 0x8000\n bne\t$v1, $at, .L9c\n nop\n break\t0x6\n.L9c:\n mflo\t$v1\n bltzl\t$v1, .Lb0\n negu\t$v1, $v1\n.Lb0:\n j\t.L100\n sw\t$v1, 152($s0)\n.Lb8:\n lw\t$v0, 44($s0)\n sll\t$v0, $v0, 0x8\n div\t$zero, $v0, $v1\n bnez\t$v1, .Ld0\n nop\n break\t0x7\n.Ld0:\n li\t$at, -1\n bne\t$v1, $at, .Le8\n lui\t$at, 0x8000\n bne\t$v0, $at, .Le8\n nop\n break\t0x6\n.Le8:\n mflo\t$v0\n bltzl\t$v0, .Lfc\n negu\t$v0, $v0\n.Lfc:\n sw\t$v0, 152($s0)\n.L100:\n lw\t$v0, 148($s0)\n blez\t$v0, .L118\n nop\n lw\t$v0, 156($s0)\n j\t.L128\n addiu\t$v0, $v0, 2048\n.L118:\n bgez\t$v0, .L130\n nop\n lw\t$v0, 156($s0)\n addiu\t$v0, $v0, -2048\n.L128:\n andi\t$v0, $v0, 0x1fff\n sh\t$v0, 122($s0)\n.L130:\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B7620_1E46D0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B7620_1E46D0` — benchmark function snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tlw\ta0,36(s0)\n 14:\tsw\ta1,148(s0)\n 18:\tlw\ta1,44(s0)\n 1c:\tli\tv0,6\n 20:\tsb\tv0,0(s0)\n 24:\tsh\ta3,146(s0)\n 28:\tsh\ta2,132(s0)\n 2c:\tjal\t0 \n 30:\tsh\ta2,134(s0)\n 34:\tsll\ta0,v0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\taddiu\ta0,a0,4096\n 40:\tandi\ta0,a0,0x1fff\n 44:\tjal\t0 \n 48:\tsw\ta0,156(s0)\n 4c:\tsll\tv1,v0,0x2\n 50:\tbnez\tv1,b8 \n 54:\tsra\tv1,v1,0x8\n 58:\tlh\ta0,158(s0)\n 5c:\tjal\t0 \n 60:\tnop\n 64:\tlw\tv1,36(s0)\n 68:\tsll\tv0,v0,0x2\n 6c:\tsra\tv0,v0,0x8\n 70:\tsll\tv1,v1,0x8\n 74:\tdiv\tzero,v1,v0\n 78:\tbnez\tv0,84 \n 7c:\tnop\n 80:\tbreak\t0x7\n 84:\tli\tat,-1\n 88:\tbne\tv0,at,9c \n 8c:\tlui\tat,0x8000\n 90:\tbne\tv1,at,9c \n 94:\tnop\n 98:\tbreak\t0x6\n 9c:\tmflo\tv1\n\t...\n a8:\tbltzl\tv1,b0 \n ac:\tnegu\tv1,v1\n b0:\tj\t100 \n b4:\tsw\tv1,152(s0)\n b8:\tlw\tv0,44(s0)\n bc:\tsll\tv0,v0,0x8\n c0:\tdiv\tzero,v0,v1\n c4:\tbnez\tv1,d0 \n c8:\tnop\n cc:\tbreak\t0x7\n d0:\tli\tat,-1\n d4:\tbne\tv1,at,e8 \n d8:\tlui\tat,0x8000\n dc:\tbne\tv0,at,e8 \n e0:\tnop\n e4:\tbreak\t0x6\n e8:\tmflo\tv0\n\t...\n f4:\tbltzl\tv0,fc \n f8:\tnegu\tv0,v0\n fc:\tsw\tv0,152(s0)\n 100:\tlw\tv0,148(s0)\n 104:\tblez\tv0,118 \n 108:\tnop\n 10c:\tlw\tv0,156(s0)\n 110:\tj\t128 \n 114:\taddiu\tv0,v0,2048\n 118:\tbgez\tv0,130 \n 11c:\tnop\n 120:\tlw\tv0,156(s0)\n 124:\taddiu\tv0,v0,-2048\n 128:\tandi\tv0,v0,0x1fff\n 12c:\tsh\tv0,122(s0)\n 130:\tlw\tra,20(sp)\n 134:\tlw\ts0,16(sp)\n 138:\tjr\tra\n 13c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-73e26b51fe075bc1/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000140 func_800B7620_1E46D0\n00000000 *UND*\t00000000 atan2Fixed\n00000000 *UND*\t00000000 approximateCos\n00000000 *UND*\t00000000 approximateSin\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 atan2Fixed\n00000044 R_MIPS_26 approximateCos\n0000005c R_MIPS_26 approximateSin\n000000b0 R_MIPS_26 .text\n00000110 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 8e040024 ae050094 8e05002c 24020006 ...$.......,$...\n 0020 a2020000 a6070092 a6060084 0c000000 ................\n 0030 a6060086 00022400 00042403 24841000 ......$...$.$...\n 0040 30841fff 0c000000 ae04009c 00021880 0...............\n 0050 14600019 00031a03 8604009e 0c000000 .`..............\n 0060 00000000 8e030024 00021080 00021203 .......$........\n 0070 00031a00 0062001a 14400002 00000000 .....b...@......\n 0080 0007000d 2401ffff 14410004 3c018000 ....$....A..<...\n 0090 14610002 00000000 0006000d 00001812 .a..............\n 00a0 00000000 00000000 04620001 00031823 .........b.....#\n 00b0 08000040 ae030098 8e02002c 00021200 ...@.......,....\n 00c0 0043001a 14600002 00000000 0007000d .C...`..........\n 00d0 2401ffff 14610004 3c018000 14410002 $....a..<....A..\n 00e0 00000000 0006000d 00001012 00000000 ................\n 00f0 00000000 04420001 00021023 ae020098 .....B.....#....\n 0100 8e020094 18400004 00000000 8e02009c .....@..........\n 0110 0800004a 24420800 04410005 00000000 ...J$B...A......\n 0120 8e02009c 2442f800 30421fff a602007a ....$B..0B.....z\n 0130 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a00100fe 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B7620_1E46D0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B7620_1E46D0` — benchmark function snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tlw\ta0,36(s0)\n 14:\tsw\ta1,148(s0)\n 18:\tlw\ta1,44(s0)\n 1c:\tli\tv0,6\n 20:\tsb\tv0,0(s0)\n 24:\tsh\ta3,146(s0)\n 28:\tsh\ta2,132(s0)\n 2c:\tjal\t0 \n 30:\tsh\ta2,134(s0)\n 34:\tsll\ta0,v0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\taddiu\ta0,a0,4096\n 40:\tandi\ta0,a0,0x1fff\n 44:\tjal\t0 \n 48:\tsw\ta0,156(s0)\n 4c:\tsll\tv1,v0,0x2\n 50:\tbnez\tv1,b8 \n 54:\tsra\tv1,v1,0x8\n 58:\tlh\ta0,158(s0)\n 5c:\tjal\t0 \n 60:\tnop\n 64:\tlw\tv1,36(s0)\n 68:\tsll\tv0,v0,0x2\n 6c:\tsra\tv0,v0,0x8\n 70:\tsll\tv1,v1,0x8\n 74:\tdiv\tzero,v1,v0\n 78:\tbnez\tv0,84 \n 7c:\tnop\n 80:\tbreak\t0x7\n 84:\tli\tat,-1\n 88:\tbne\tv0,at,9c \n 8c:\tlui\tat,0x8000\n 90:\tbne\tv1,at,9c \n 94:\tnop\n 98:\tbreak\t0x6\n 9c:\tmflo\tv1\n\t...\n a8:\tbltzl\tv1,b0 \n ac:\tnegu\tv1,v1\n b0:\tj\t100 \n b4:\tsw\tv1,152(s0)\n b8:\tlw\tv0,44(s0)\n bc:\tsll\tv0,v0,0x8\n c0:\tdiv\tzero,v0,v1\n c4:\tbnez\tv1,d0 \n c8:\tnop\n cc:\tbreak\t0x7\n d0:\tli\tat,-1\n d4:\tbne\tv1,at,e8 \n d8:\tlui\tat,0x8000\n dc:\tbne\tv0,at,e8 \n e0:\tnop\n e4:\tbreak\t0x6\n e8:\tmflo\tv0\n\t...\n f4:\tbltzl\tv0,fc \n f8:\tnegu\tv0,v0\n fc:\tsw\tv0,152(s0)\n 100:\tlw\tv0,148(s0)\n 104:\tblez\tv0,118 \n 108:\tnop\n 10c:\tlw\tv0,156(s0)\n 110:\tj\t128 \n 114:\taddiu\tv0,v0,2048\n 118:\tbgez\tv0,130 \n 11c:\tnop\n 120:\tlw\tv0,156(s0)\n 124:\taddiu\tv0,v0,-2048\n 128:\tandi\tv0,v0,0x1fff\n 12c:\tsh\tv0,122(s0)\n 130:\tlw\tra,20(sp)\n 134:\tlw\ts0,16(sp)\n 138:\tjr\tra\n 13c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-73e26b51fe075bc1/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000140 func_800B7620_1E46D0\n00000000 *UND*\t00000000 atan2Fixed\n00000000 *UND*\t00000000 approximateCos\n00000000 *UND*\t00000000 approximateSin\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 atan2Fixed\n00000044 R_MIPS_26 approximateCos\n0000005c R_MIPS_26 approximateSin\n000000b0 R_MIPS_26 .text\n00000110 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 8e040024 ae050094 8e05002c 24020006 ...$.......,$...\n 0020 a2020000 a6070092 a6060084 0c000000 ................\n 0030 a6060086 00022400 00042403 24841000 ......$...$.$...\n 0040 30841fff 0c000000 ae04009c 00021880 0...............\n 0050 14600019 00031a03 8604009e 0c000000 .`..............\n 0060 00000000 8e030024 00021080 00021203 .......$........\n 0070 00031a00 0062001a 14400002 00000000 .....b...@......\n 0080 0007000d 2401ffff 14410004 3c018000 ....$....A..<...\n 0090 14610002 00000000 0006000d 00001812 .a..............\n 00a0 00000000 00000000 04620001 00031823 .........b.....#\n 00b0 08000040 ae030098 8e02002c 00021200 ...@.......,....\n 00c0 0043001a 14600002 00000000 0007000d .C...`..........\n 00d0 2401ffff 14610004 3c018000 14410002 $....a..<....A..\n 00e0 00000000 0006000d 00001012 00000000 ................\n 00f0 00000000 04420001 00021023 ae020098 .....B.....#....\n 0100 8e020094 18400004 00000000 8e02009c .....@..........\n 0110 0800004a 24420800 04410005 00000000 ...J$B...A......\n 0120 8e02009c 2442f800 30421fff a602007a ....$B..0B.....z\n 0130 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a00100fe 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B7620_1E46D0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -15189,7 +15239,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_800B7760_1E4810` — benchmark function snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B7760_1E4810\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n blezl\t$a2, .L54\n sw\t$a1, 84($a0)\n lw\t$v0, 84($a0)\n subu\t$v0, $a1, $v0\n div\t$zero, $v0, $a2\n bnez\t$a2, .L28\n nop\n break\t0x7\n.L28:\n li\t$at, -1\n bne\t$a2, $at, .L40\n lui\t$at, 0x8000\n bne\t$v0, $at, .L40\n nop\n break\t0x6\n.L40:\n mflo\t$v0\n sw\t$a1, 96($a0)\n nop\n j\t.L5c\n sw\t$v0, 108($a0)\n.L54:\n sw\t$a1, 96($a0)\n sw\t$zero, 108($a0)\n.L5c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B7760_1E4810 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B7760_1E4810` — benchmark function snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta2,a2,0x10\n 4:\tsra\ta2,a2,0x10\n 8:\tblezl\ta2,54 \n c:\tsw\ta1,84(a0)\n 10:\tlw\tv0,84(a0)\n 14:\tsubu\tv0,a1,v0\n 18:\tdiv\tzero,v0,a2\n 1c:\tbnez\ta2,28 \n 20:\tnop\n 24:\tbreak\t0x7\n 28:\tli\tat,-1\n 2c:\tbne\ta2,at,40 \n 30:\tlui\tat,0x8000\n 34:\tbne\tv0,at,40 \n 38:\tnop\n 3c:\tbreak\t0x6\n 40:\tmflo\tv0\n 44:\tsw\ta1,96(a0)\n 48:\tnop\n 4c:\tj\t5c \n 50:\tsw\tv0,108(a0)\n 54:\tsw\ta1,96(a0)\n 58:\tsw\tzero,108(a0)\n 5c:\tjr\tra\n 60:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-7077fb1721cb5369/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000064 func_800B7760_1E4810\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000004c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00063400 00063403 58c00012 ac850054 ..4...4.X......T\n 0010 8c820054 00a21023 0046001a 14c00002 ...T...#.F......\n 0020 00000000 0007000d 2401ffff 14c10004 ........$.......\n 0030 3c018000 14410002 00000000 0006000d <....A..........\n 0040 00001012 ac850060 00000000 08000017 .......`........\n 0050 ac82006c ac850060 ac80006c 03e00008 ...l...`...l....\n 0060 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B7760_1E4810 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B7760_1E4810` — benchmark function snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta2,a2,0x10\n 4:\tsra\ta2,a2,0x10\n 8:\tblezl\ta2,54 \n c:\tsw\ta1,84(a0)\n 10:\tlw\tv0,84(a0)\n 14:\tsubu\tv0,a1,v0\n 18:\tdiv\tzero,v0,a2\n 1c:\tbnez\ta2,28 \n 20:\tnop\n 24:\tbreak\t0x7\n 28:\tli\tat,-1\n 2c:\tbne\ta2,at,40 \n 30:\tlui\tat,0x8000\n 34:\tbne\tv0,at,40 \n 38:\tnop\n 3c:\tbreak\t0x6\n 40:\tmflo\tv0\n 44:\tsw\ta1,96(a0)\n 48:\tnop\n 4c:\tj\t5c \n 50:\tsw\tv0,108(a0)\n 54:\tsw\ta1,96(a0)\n 58:\tsw\tzero,108(a0)\n 5c:\tjr\tra\n 60:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-7077fb1721cb5369/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000064 func_800B7760_1E4810\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000004c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00063400 00063403 58c00012 ac850054 ..4...4.X......T\n 0010 8c820054 00a21023 0046001a 14c00002 ...T...#.F......\n 0020 00000000 0007000d 2401ffff 14c10004 ........$.......\n 0030 3c018000 14410002 00000000 0006000d <....A..........\n 0040 00001012 ac850060 00000000 08000017 .......`........\n 0050 ac82006c ac850060 ac80006c 03e00008 ...l...`...l....\n 0060 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B7760_1E4810 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -15258,7 +15308,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_800B93F0_1E64A0` — benchmark function snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B93F0_1E64A0\n beqzl\t$a0, .L8\n li\t$a0, 1\n.L8:\n lui\t$v0, 0x400\n div\t$zero, $v0, $a0\n bnez\t$a0, .L1c\n nop\n break\t0x7\n.L1c:\n li\t$at, -1\n bne\t$a0, $at, .L34\n lui\t$at, 0x8000\n bne\t$v0, $at, .L34\n nop\n break\t0x6\n.L34:\n mflo\t$a0\n slti\t$v0, $a0, 16384\n nop\n beqzl\t$v0, .L48\n li\t$a0, 16384\n.L48:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B93F0_1E64A0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B93F0_1E64A0` — benchmark function snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqzl\ta0,8 \n 4:\tli\ta0,1\n 8:\tlui\tv0,0x400\n c:\tdiv\tzero,v0,a0\n 10:\tbnez\ta0,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta0,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\tv0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmflo\ta0\n 38:\tslti\tv0,a0,16384\n 3c:\tnop\n 40:\tbeqzl\tv0,48 \n 44:\tli\ta0,16384\n 48:\tjr\tra\n 4c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-224f646ab8fe4f42/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 func_800B93F0_1E64A0\n\n\nContents of section .text:\n 0000 50800001 24040001 3c020400 0044001a P...$...<....D..\n 0010 14800002 00000000 0007000d 2401ffff ............$...\n 0020 14810004 3c018000 14410002 00000000 ....<....A......\n 0030 0006000d 00002012 28824000 00000000 ...... .(.@.....\n 0040 50400001 24044000 03e00008 00801021 P@..$.@........!\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B93F0_1E64A0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B93F0_1E64A0` — benchmark function snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqzl\ta0,8 \n 4:\tli\ta0,1\n 8:\tlui\tv0,0x400\n c:\tdiv\tzero,v0,a0\n 10:\tbnez\ta0,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta0,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\tv0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmflo\ta0\n 38:\tslti\tv0,a0,16384\n 3c:\tnop\n 40:\tbeqzl\tv0,48 \n 44:\tli\ta0,16384\n 48:\tjr\tra\n 4c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-224f646ab8fe4f42/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 func_800B93F0_1E64A0\n\n\nContents of section .text:\n 0000 50800001 24040001 3c020400 0044001a P...$...<....D..\n 0010 14800002 00000000 0007000d 2401ffff ............$...\n 0020 14810004 3c018000 14410002 00000000 ....<....A......\n 0030 0006000d 00002012 28824000 00000000 ...... .(.@.....\n 0040 50400001 24044000 03e00008 00801021 P@..$.@........!\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B93F0_1E64A0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -15325,7 +15375,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `func_800B9C20_1E6CD0` — benchmark function snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B9C20_1E6CD0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n jal\tfreeNodeMemory\n lw\t$a0, 160($s0)\n lw\t$a0, 8($s0)\n jal\tfreeNodeMemory\n sw\t$v0, 160($s0)\n lw\t$a0, 12($s0)\n jal\tfreeNodeMemory\n sw\t$v0, 8($s0)\n sw\t$v0, 12($s0)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B9C20_1E6CD0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B9C20_1E6CD0` — benchmark function snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tjal\t0 \n 14:\tlw\ta0,160(s0)\n 18:\tlw\ta0,8(s0)\n 1c:\tjal\t0 \n 20:\tsw\tv0,160(s0)\n 24:\tlw\ta0,12(s0)\n 28:\tjal\t0 \n 2c:\tsw\tv0,8(s0)\n 30:\tsw\tv0,12(s0)\n 34:\tlw\tra,20(sp)\n 38:\tlw\ts0,16(sp)\n 3c:\tjr\tra\n 40:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-089cd7a701ec1012/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000044 func_800B9C20_1E6CD0\n00000000 *UND*\t00000000 freeNodeMemory\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 freeNodeMemory\n0000001c R_MIPS_26 freeNodeMemory\n00000028 R_MIPS_26 freeNodeMemory\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 0c000000 8e0400a0 8e040008 0c000000 ................\n 0020 ae0200a0 8e04000c 0c000000 ae020008 ................\n 0030 ae02000c 8fbf0014 8fb00010 03e00008 ................\n 0040 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B9C20_1E6CD0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B9C20_1E6CD0` — benchmark function snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tjal\t0 \n 14:\tlw\ta0,160(s0)\n 18:\tlw\ta0,8(s0)\n 1c:\tjal\t0 \n 20:\tsw\tv0,160(s0)\n 24:\tlw\ta0,12(s0)\n 28:\tjal\t0 \n 2c:\tsw\tv0,8(s0)\n 30:\tsw\tv0,12(s0)\n 34:\tlw\tra,20(sp)\n 38:\tlw\ts0,16(sp)\n 3c:\tjr\tra\n 40:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-089cd7a701ec1012/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000044 func_800B9C20_1E6CD0\n00000000 *UND*\t00000000 freeNodeMemory\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 freeNodeMemory\n0000001c R_MIPS_26 freeNodeMemory\n00000028 R_MIPS_26 freeNodeMemory\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 0c000000 8e0400a0 8e040008 0c000000 ................\n 0020 ae0200a0 8e04000c 0c000000 ae020008 ................\n 0030 ae02000c 8fbf0014 8fb00010 03e00008 ................\n 0040 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B9C20_1E6CD0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -15403,7 +15453,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `GenericTriggerInit` — benchmark function snowboardkids2:GenericTriggerInit:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GenericTriggerInit\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n lbu\t$v1, 0($a0)\n li\t$v0, -104\n sb\t$zero, 1($a0)\n sh\t$zero, 4($a0)\n sh\t$v0, 6($a0)\n sh\t$zero, 8($a0)\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_8008D714_8E314)\n addiu\t$v1, $v1, %lo(D_8008D714_8E314)\n addu\t$v0, $v0, $v1\n sw\t$v0, 12($a0)\n lui\t$a0, %hi(GenericTriggerCheck)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(GenericTriggerCheck)\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-179f8d5e0521.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid GenericTriggerInit(EventTrigger *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GenericTriggerInit # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GenericTriggerInit` — benchmark function snowboardkids2:GenericTriggerInit:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:GenericTriggerInit:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tlbu\tv1,0(a0)\n c:\tli\tv0,-104\n 10:\tsb\tzero,1(a0)\n 14:\tsh\tzero,4(a0)\n 18:\tsh\tv0,6(a0)\n 1c:\tsh\tzero,8(a0)\n 20:\tsll\tv0,v1,0x2\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\tv0,v0,v1\n 38:\tsw\tv0,12(a0)\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-17b75d3a9e5de8d3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 GenericTriggerInit\n00000000 *UND*\t00000000 D_8008D714_8E314\n00000000 *UND*\t00000000 GenericTriggerCheck\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 D_8008D714_8E314\n00000030 R_MIPS_LO16 D_8008D714_8E314\n0000003c R_MIPS_HI16 GenericTriggerCheck\n00000044 R_MIPS_LO16 GenericTriggerCheck\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 90830000 2402ff98 '...........$...\n 0010 a0800001 a4800004 a4820006 a4800008 ................\n 0020 00031080 00431021 00021080 3c030000 .....C.!....<...\n 0030 24630000 00431021 ac82000c 3c040000 $c...C.!....<...\n 0040 0c000000 24840000 8fbf0010 03e00008 ....$...........\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GenericTriggerInit\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GenericTriggerInit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `GenericTriggerInit` — benchmark function snowboardkids2:GenericTriggerInit:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:GenericTriggerInit:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tlbu\tv1,0(a0)\n c:\tli\tv0,-104\n 10:\tsb\tzero,1(a0)\n 14:\tsh\tzero,4(a0)\n 18:\tsh\tv0,6(a0)\n 1c:\tsh\tzero,8(a0)\n 20:\tsll\tv0,v1,0x2\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\tv0,v0,v1\n 38:\tsw\tv0,12(a0)\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-17b75d3a9e5de8d3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 GenericTriggerInit\n00000000 *UND*\t00000000 D_8008D714_8E314\n00000000 *UND*\t00000000 GenericTriggerCheck\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 D_8008D714_8E314\n00000030 R_MIPS_LO16 D_8008D714_8E314\n0000003c R_MIPS_HI16 GenericTriggerCheck\n00000044 R_MIPS_LO16 GenericTriggerCheck\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 90830000 2402ff98 '...........$...\n 0010 a0800001 a4800004 a4820006 a4800008 ................\n 0020 00031080 00431021 00021080 3c030000 .....C.!....<...\n 0030 24630000 00431021 ac82000c 3c040000 $c...C.!....<...\n 0040 0c000000 24840000 8fbf0010 03e00008 ....$...........\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GenericTriggerInit\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GenericTriggerInit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -15498,7 +15548,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `getTableEntryByU16Index` — benchmark function snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel getTableEntryByU16Index\n lw\t$v1, 4($a0)\n addiu\t$a3, $a0, 8\n andi\t$a1, $a1, 0xffff\n sll\t$a1, $a1, 0x4\n sll\t$v1, $v1, 0x4\n addu\t$v1, $a3, $v1\n addu\t$a3, $a3, $a1\n lw\t$v0, 0($a3)\n addu\t$a0, $a0, $v0\n sw\t$a0, 0($a2)\n lhu\t$v0, 4($a3)\n sll\t$v0, $v0, 0x5\n addu\t$v1, $v1, $v0\n sw\t$v1, 4($a2)\n lhu\t$v0, 6($a3)\n sh\t$v0, 8($a2)\n lhu\t$v0, 8($a3)\n jr\t$ra\n sh\t$v0, 10($a2)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function getTableEntryByU16Index # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `getTableEntryByU16Index` — benchmark function snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,4(a0)\n 4:\taddiu\ta3,a0,8\n 8:\tandi\ta1,a1,0xffff\n c:\tsll\ta1,a1,0x4\n 10:\tsll\tv1,v1,0x4\n 14:\taddu\tv1,a3,v1\n 18:\taddu\ta3,a3,a1\n 1c:\tlw\tv0,0(a3)\n 20:\taddu\ta0,a0,v0\n 24:\tsw\ta0,0(a2)\n 28:\tlhu\tv0,4(a3)\n 2c:\tsll\tv0,v0,0x5\n 30:\taddu\tv1,v1,v0\n 34:\tsw\tv1,4(a2)\n 38:\tlhu\tv0,6(a3)\n 3c:\tsh\tv0,8(a2)\n 40:\tlhu\tv0,8(a3)\n 44:\tjr\tra\n 48:\tsh\tv0,10(a2)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-38e285a16bb25525/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c getTableEntryByU16Index\n\n\nContents of section .text:\n 0000 8c830004 24870008 30a5ffff 00052900 ....$...0.....).\n 0010 00031900 00e31821 00e53821 8ce20000 .......!..8!....\n 0020 00822021 acc40000 94e20004 00021140 .. !...........@\n 0030 00621821 acc30004 94e20006 a4c20008 .b.!............\n 0040 94e20008 03e00008 a4c2000a 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"getTableEntryByU16Index\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name getTableEntryByU16Index # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `getTableEntryByU16Index` — benchmark function snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,4(a0)\n 4:\taddiu\ta3,a0,8\n 8:\tandi\ta1,a1,0xffff\n c:\tsll\ta1,a1,0x4\n 10:\tsll\tv1,v1,0x4\n 14:\taddu\tv1,a3,v1\n 18:\taddu\ta3,a3,a1\n 1c:\tlw\tv0,0(a3)\n 20:\taddu\ta0,a0,v0\n 24:\tsw\ta0,0(a2)\n 28:\tlhu\tv0,4(a3)\n 2c:\tsll\tv0,v0,0x5\n 30:\taddu\tv1,v1,v0\n 34:\tsw\tv1,4(a2)\n 38:\tlhu\tv0,6(a3)\n 3c:\tsh\tv0,8(a2)\n 40:\tlhu\tv0,8(a3)\n 44:\tjr\tra\n 48:\tsh\tv0,10(a2)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-38e285a16bb25525/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c getTableEntryByU16Index\n\n\nContents of section .text:\n 0000 8c830004 24870008 30a5ffff 00052900 ....$...0.....).\n 0010 00031900 00e31821 00e53821 8ce20000 .......!..8!....\n 0020 00822021 acc40000 94e20004 00021140 .. !...........@\n 0030 00621821 acc30004 94e20006 a4c20008 .b.!............\n 0040 94e20008 03e00008 a4c2000a 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"getTableEntryByU16Index\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name getTableEntryByU16Index # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -15576,7 +15626,7 @@ "gapSize": null, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `initSteppedMatrixController` — benchmark function snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel initSteppedMatrixController\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n addiu\t$a0, $s0, 4\n lui\t$a1, %hi(identityMatrix)\n addiu\t$a1, $a1, %lo(identityMatrix)\n sw\t$ra, 20($sp)\n jal\tmemcpy\n li\t$a2, 32\n lui\t$a0, %hi(cleanupSteppedMatrixController)\n addiu\t$a0, $a0, %lo(cleanupSteppedMatrixController)\n sh\t$zero, 36($s0)\n jal\tsetCleanupCallback\n sh\t$zero, 40($s0)\n lui\t$a0, %hi(updateSteppedMatrixController)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(updateSteppedMatrixController)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-1f4f9d8c2067.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid initSteppedMatrixController(SteppedMatrixState *state);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function initSteppedMatrixController # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `initSteppedMatrixController` — benchmark function snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\taddiu\ta0,s0,4\n 10:\tlui\ta1,0x0\n 14:\taddiu\ta1,a1,0\n 18:\tsw\tra,20(sp)\n 1c:\tjal\t0 \n 20:\tli\ta2,32\n 24:\tlui\ta0,0x0\n 28:\taddiu\ta0,a0,0\n 2c:\tsh\tzero,36(s0)\n 30:\tjal\t0 \n 34:\tsh\tzero,40(s0)\n 38:\tlui\ta0,0x0\n 3c:\tjal\t0 \n 40:\taddiu\ta0,a0,0\n 44:\tlw\tra,20(sp)\n 48:\tlw\ts0,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1f9fb46d4e427117/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 initSteppedMatrixController\n00000000 *UND*\t00000000 identityMatrix\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 cleanupSteppedMatrixController\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 updateSteppedMatrixController\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 identityMatrix\n00000014 R_MIPS_LO16 identityMatrix\n0000001c R_MIPS_26 memcpy\n00000024 R_MIPS_HI16 cleanupSteppedMatrixController\n00000028 R_MIPS_LO16 cleanupSteppedMatrixController\n00000030 R_MIPS_26 setCleanupCallback\n00000038 R_MIPS_HI16 updateSteppedMatrixController\n00000040 R_MIPS_LO16 updateSteppedMatrixController\n0000003c R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 26040004 '..........!&...\n 0010 3c050000 24a50000 afbf0014 0c000000 <...$...........\n 0020 24060020 3c040000 24840000 a6000024 $.. <...$......$\n 0030 0c000000 a6000028 3c040000 0c000000 .......(<.......\n 0040 24840000 8fbf0014 8fb00010 03e00008 $...............\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"initSteppedMatrixController\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name initSteppedMatrixController # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `initSteppedMatrixController` — benchmark function snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\taddiu\ta0,s0,4\n 10:\tlui\ta1,0x0\n 14:\taddiu\ta1,a1,0\n 18:\tsw\tra,20(sp)\n 1c:\tjal\t0 \n 20:\tli\ta2,32\n 24:\tlui\ta0,0x0\n 28:\taddiu\ta0,a0,0\n 2c:\tsh\tzero,36(s0)\n 30:\tjal\t0 \n 34:\tsh\tzero,40(s0)\n 38:\tlui\ta0,0x0\n 3c:\tjal\t0 \n 40:\taddiu\ta0,a0,0\n 44:\tlw\tra,20(sp)\n 48:\tlw\ts0,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1f9fb46d4e427117/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 initSteppedMatrixController\n00000000 *UND*\t00000000 identityMatrix\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 cleanupSteppedMatrixController\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 updateSteppedMatrixController\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 identityMatrix\n00000014 R_MIPS_LO16 identityMatrix\n0000001c R_MIPS_26 memcpy\n00000024 R_MIPS_HI16 cleanupSteppedMatrixController\n00000028 R_MIPS_LO16 cleanupSteppedMatrixController\n00000030 R_MIPS_26 setCleanupCallback\n00000038 R_MIPS_HI16 updateSteppedMatrixController\n00000040 R_MIPS_LO16 updateSteppedMatrixController\n0000003c R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 26040004 '..........!&...\n 0010 3c050000 24a50000 afbf0014 0c000000 <...$...........\n 0020 24060020 3c040000 24840000 a6000024 $.. <...$......$\n 0030 0c000000 a6000028 3c040000 0c000000 .......(<.......\n 0040 24840000 8fbf0014 8fb00010 03e00008 $...............\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"initSteppedMatrixController\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name initSteppedMatrixController # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -15667,7 +15717,7 @@ }, "scripts": { "m2c": "#!/usr/bin/env bash\n# Reproduce m2c on `loadAssetGroupResources` — benchmark function snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loadAssetGroupResources\n addiu\t$sp, $sp, -48\n sw\t$s3, 36($sp)\n move\t$s3, $a0\n sw\t$ra, 40($sp)\n sw\t$s2, 32($sp)\n sw\t$s1, 28($sp)\n sw\t$s0, 24($sp)\n lbu\t$v1, 196($s3)\n sll\t$v0, $v1, 0x1\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(assetGroupTable)\n addiu\t$v1, $v1, %lo(assetGroupTable)\n addu\t$s2, $v0, $v1\n lw\t$s0, 0($s2)\n lui\t$a0, %hi(freeAssetGroupResources)\n addiu\t$a0, $a0, %lo(freeAssetGroupResources)\n jal\tsetCleanupCallback\n move\t$s1, $zero\n sw\t$zero, 16($s3)\n sw\t$zero, 12($s3)\n lbu\t$a0, 8($s2)\n jal\tallocateNodeMemory\n sll\t$a0, $a0, 0x2\n sw\t$v0, 4($s3)\n lbu\t$v0, 8($s2)\n blez\t$v0, .La8\n nop\n.L70:\n lw\t$a0, 0($s0)\n lw\t$a1, 4($s0)\n lw\t$a2, 8($s0)\n jal\tloadCompressedData\n addiu\t$s0, $s0, 12\n lw\t$v1, 4($s3)\n sll\t$a0, $s1, 0x2\n addu\t$a0, $a0, $v1\n sw\t$v0, 0($a0)\n lbu\t$v0, 8($s2)\n addiu\t$s1, $s1, 1\n slt\t$v0, $s1, $v0\n bnez\t$v0, .L70\n nop\n.La8:\n lui\t$a0, %hi(func_80003184_3D84)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80003184_3D84)\n lw\t$ra, 40($sp)\n lw\t$s3, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 48\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-96e61b4ff9f1.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid loadAssetGroupResources(AssetGroupTaskData *taskData);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loadAssetGroupResources # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n", - "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `loadAssetGroupResources` — benchmark function snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-48\n 4:\tsw\ts3,36(sp)\n 8:\tmove\ts3,a0\n c:\tsw\tra,40(sp)\n 10:\tsw\ts2,32(sp)\n 14:\tsw\ts1,28(sp)\n 18:\tsw\ts0,24(sp)\n 1c:\tlbu\tv1,196(s3)\n 20:\tsll\tv0,v1,0x1\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\ts2,v0,v1\n 38:\tlw\ts0,0(s2)\n 3c:\tlui\ta0,0x0\n 40:\taddiu\ta0,a0,0\n 44:\tjal\t0 \n 48:\tmove\ts1,zero\n 4c:\tsw\tzero,16(s3)\n 50:\tsw\tzero,12(s3)\n 54:\tlbu\ta0,8(s2)\n 58:\tjal\t0 \n 5c:\tsll\ta0,a0,0x2\n 60:\tsw\tv0,4(s3)\n 64:\tlbu\tv0,8(s2)\n 68:\tblez\tv0,a8 \n 6c:\tnop\n 70:\tlw\ta0,0(s0)\n 74:\tlw\ta1,4(s0)\n 78:\tlw\ta2,8(s0)\n 7c:\tjal\t0 \n 80:\taddiu\ts0,s0,12\n 84:\tlw\tv1,4(s3)\n 88:\tsll\ta0,s1,0x2\n 8c:\taddu\ta0,a0,v1\n 90:\tsw\tv0,0(a0)\n 94:\tlbu\tv0,8(s2)\n 98:\taddiu\ts1,s1,1\n 9c:\tslt\tv0,s1,v0\n a0:\tbnez\tv0,70 \n a4:\tnop\n a8:\tlui\ta0,0x0\n ac:\tjal\t0 \n b0:\taddiu\ta0,a0,0\n b4:\tlw\tra,40(sp)\n b8:\tlw\ts3,36(sp)\n bc:\tlw\ts2,32(sp)\n c0:\tlw\ts1,28(sp)\n c4:\tlw\ts0,24(sp)\n c8:\tjr\tra\n cc:\taddiu\tsp,sp,48\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ea902f2bbc2f0c1a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000d0 loadAssetGroupResources\n00000000 *UND*\t00000000 assetGroupTable\n00000000 *UND*\t00000000 freeAssetGroupResources\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 allocateNodeMemory\n00000000 *UND*\t00000000 loadCompressedData\n00000000 *UND*\t00000000 func_80003184_3D84\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 assetGroupTable\n00000030 R_MIPS_LO16 assetGroupTable\n0000003c R_MIPS_HI16 freeAssetGroupResources\n00000040 R_MIPS_LO16 freeAssetGroupResources\n00000044 R_MIPS_26 setCleanupCallback\n00000058 R_MIPS_26 allocateNodeMemory\n0000007c R_MIPS_26 loadCompressedData\n000000a8 R_MIPS_HI16 func_80003184_3D84\n000000b0 R_MIPS_LO16 func_80003184_3D84\n000000ac R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffd0 afb30024 00809821 afbf0028 '......$...!...(\n 0010 afb20020 afb1001c afb00018 926300c4 ... .........c..\n 0020 00031040 00431021 00021080 3c030000 ...@.C.!....<...\n 0030 24630000 00439021 8e500000 3c040000 $c...C.!.P..<...\n 0040 24840000 0c000000 00008821 ae600010 $..........!.`..\n 0050 ae60000c 92440008 0c000000 00042080 .`...D........ .\n 0060 ae620004 92420008 1840000f 00000000 .b...B...@......\n 0070 8e040000 8e050004 8e060008 0c000000 ................\n 0080 2610000c 8e630004 00112080 00832021 &....c.... ... !\n 0090 ac820000 92420008 26310001 0222102a .....B..&1...\".*\n 00a0 1440fff3 00000000 3c040000 0c000000 .@......<.......\n 00b0 24840000 8fbf0028 8fb30024 8fb20020 $......(...$... \n 00c0 8fb1001c 8fb00018 03e00008 27bd0030 ............'..0\nContents of section .reginfo:\n 0000 a00f007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"loadAssetGroupResources\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name loadAssetGroupResources # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" + "asmlift": "#!/usr/bin/env bash\n# Reproduce asmlift on `loadAssetGroupResources` — benchmark function snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-48\n 4:\tsw\ts3,36(sp)\n 8:\tmove\ts3,a0\n c:\tsw\tra,40(sp)\n 10:\tsw\ts2,32(sp)\n 14:\tsw\ts1,28(sp)\n 18:\tsw\ts0,24(sp)\n 1c:\tlbu\tv1,196(s3)\n 20:\tsll\tv0,v1,0x1\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\ts2,v0,v1\n 38:\tlw\ts0,0(s2)\n 3c:\tlui\ta0,0x0\n 40:\taddiu\ta0,a0,0\n 44:\tjal\t0 \n 48:\tmove\ts1,zero\n 4c:\tsw\tzero,16(s3)\n 50:\tsw\tzero,12(s3)\n 54:\tlbu\ta0,8(s2)\n 58:\tjal\t0 \n 5c:\tsll\ta0,a0,0x2\n 60:\tsw\tv0,4(s3)\n 64:\tlbu\tv0,8(s2)\n 68:\tblez\tv0,a8 \n 6c:\tnop\n 70:\tlw\ta0,0(s0)\n 74:\tlw\ta1,4(s0)\n 78:\tlw\ta2,8(s0)\n 7c:\tjal\t0 \n 80:\taddiu\ts0,s0,12\n 84:\tlw\tv1,4(s3)\n 88:\tsll\ta0,s1,0x2\n 8c:\taddu\ta0,a0,v1\n 90:\tsw\tv0,0(a0)\n 94:\tlbu\tv0,8(s2)\n 98:\taddiu\ts1,s1,1\n 9c:\tslt\tv0,s1,v0\n a0:\tbnez\tv0,70 \n a4:\tnop\n a8:\tlui\ta0,0x0\n ac:\tjal\t0 \n b0:\taddiu\ta0,a0,0\n b4:\tlw\tra,40(sp)\n b8:\tlw\ts3,36(sp)\n bc:\tlw\ts2,32(sp)\n c0:\tlw\ts1,28(sp)\n c4:\tlw\ts0,24(sp)\n c8:\tjr\tra\n cc:\taddiu\tsp,sp,48\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ea902f2bbc2f0c1a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000d0 loadAssetGroupResources\n00000000 *UND*\t00000000 assetGroupTable\n00000000 *UND*\t00000000 freeAssetGroupResources\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 allocateNodeMemory\n00000000 *UND*\t00000000 loadCompressedData\n00000000 *UND*\t00000000 func_80003184_3D84\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 assetGroupTable\n00000030 R_MIPS_LO16 assetGroupTable\n0000003c R_MIPS_HI16 freeAssetGroupResources\n00000040 R_MIPS_LO16 freeAssetGroupResources\n00000044 R_MIPS_26 setCleanupCallback\n00000058 R_MIPS_26 allocateNodeMemory\n0000007c R_MIPS_26 loadCompressedData\n000000a8 R_MIPS_HI16 func_80003184_3D84\n000000b0 R_MIPS_LO16 func_80003184_3D84\n000000ac R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffd0 afb30024 00809821 afbf0028 '......$...!...(\n 0010 afb20020 afb1001c afb00018 926300c4 ... .........c..\n 0020 00031040 00431021 00021080 3c030000 ...@.C.!....<...\n 0030 24630000 00439021 8e500000 3c040000 $c...C.!.P..<...\n 0040 24840000 0c000000 00008821 ae600010 $..........!.`..\n 0050 ae60000c 92440008 0c000000 00042080 .`...D........ .\n 0060 ae620004 92420008 1840000f 00000000 .b...B...@......\n 0070 8e040000 8e050004 8e060008 0c000000 ................\n 0080 2610000c 8e630004 00112080 00832021 &....c.... ... !\n 0090 ac820000 92420008 26310001 0222102a .....B..&1...\".*\n 00a0 1440fff3 00000000 3c040000 0c000000 .@......<.......\n 00b0 24840000 8fbf0028 8fb30024 8fb20020 $......(...$... \n 00c0 8fb1001c 8fb00018 03e00008 27bd0030 ............'..0\nContents of section .reginfo:\n 0000 a00f007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"loadAssetGroupResources\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name loadAssetGroupResources # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n" } }, { @@ -18002,14 +18052,14 @@ "decompiler": "asmlift", "candidateLabel": "unsigned", "outcome": "nonmatch", - "source": "s32 avg2(u32 a0, u32 a1) {\n return (a0 + a1 >> 31) + (a0 + a1) >> 1;\n}\n", - "score": 2, + "source": "s32 avg2(u32 a0, u32 a1) {\n return (s32)((a0 + a1 >> 31) + (a0 + a1)) >> 1;\n}\n", + "score": 1, "maxScore": 5, "compileErrors": null, "breakdown": { "insert": 0, "delete": 0, - "replace": 1, + "replace": 0, "opMismatch": 0, "argMismatch": 1 }, @@ -18017,7 +18067,7 @@ "score": 100, "lines": 3, "gotos": 0, - "casts": 0, + "casts": 1, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -18048,7 +18098,7 @@ } }, "gapSize": { - "decompiler": "m2c", + "decompiler": "asmlift", "score": 1, "maxScore": 5, "ratio": 0.2, @@ -21983,22 +22033,22 @@ "decompiler": "asmlift", "candidateLabel": "signed", "outcome": "nonmatch", - "source": "s32 continueloop(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 <= 0) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n do {\n if (*v0 >> 31 == 0) v1 = v1 + *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n", + "source": "s32 continueloop(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 <= 0) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n do {\n if ((u32)*v0 >> 31 == 0) v1 = v1 + *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n", "score": 12, "maxScore": 16, "compileErrors": null, "breakdown": { "insert": 4, "delete": 2, - "replace": 1, + "replace": 0, "opMismatch": 2, - "argMismatch": 3 + "argMismatch": 4 }, "quality": { "score": 100, "lines": 18, "gotos": 0, - "casts": 0, + "casts": 1, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -22280,24 +22330,24 @@ "asmDump": "\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000003c countdown\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 countdown\n\n\nContents of section .text:\n 0000 2c030000 38800000 4081002c 5460e8ff ,...8...@..,T`..\n 0010 7c0903a6 41820014 38840008 4200fffc |...A...8...B...\n 0020 70630007 41820010 7c6903a6 38840001 pc..A...|i..8...\n 0030 4200fffc 7c832378 4e800020 B...|.#xN.. \nContents of section .mwcats.text:\n 0000 0200003c 00000000 ...<.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n", "asmlift": { "decompiler": "asmlift", - "candidateLabel": "unsigned", + "candidateLabel": "signed", "outcome": "nonmatch", - "source": "s32 countdown(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n if (a0 >> 3 == 0) {\n v0 = 0;\n v2 = v0;\n v3 = a0;\n do {\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n v0 = v2;\n } else {\n v0 = 0;\n v1 = a0 >> 3;\n do {\n v0 = v0 + 8;\n v1 = v1 - 1;\n } while (v1 != 0);\n if ((a0 & 7) == 0) {\n v0 = v0;\n } else {\n v0 = v0;\n a0 = a0 & 7;\n v2 = v0;\n v3 = a0;\n do {\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n v0 = v2;\n }\n }\n }\n return v0;\n}\n", - "score": 25, + "source": "s32 countdown(s32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n if ((u32)a0 >> 3 == 0) {\n v0 = 0;\n v2 = v0;\n v3 = a0;\n do {\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n v0 = v2;\n } else {\n v0 = 0;\n v1 = (u32)a0 >> 3;\n do {\n v0 = v0 + 8;\n v1 = v1 - 1;\n } while (v1 != 0);\n if ((a0 & 7) == 0) {\n v0 = v0;\n } else {\n v0 = v0;\n a0 = a0 & 7;\n v2 = v0;\n v3 = a0;\n do {\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n v0 = v2;\n }\n }\n }\n return v0;\n}\n", + "score": 24, "maxScore": 27, "compileErrors": null, "breakdown": { "insert": 12, "delete": 1, - "replace": 5, - "opMismatch": 3, - "argMismatch": 4 + "replace": 4, + "opMismatch": 4, + "argMismatch": 3 }, "quality": { "score": 100, "lines": 41, "gotos": 0, - "casts": 0, + "casts": 2, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -23478,7 +23528,7 @@ "decompiler": "asmlift", "candidateLabel": "unsigned", "outcome": "nonmatch", - "source": "s32 div2(u32 a0) {\n s32 v0;\n if (a0 >= 0) {\n v0 = a0 >> 1;\n } else {\n v0 = a0 + 1 >> 1;\n }\n return v0;\n}\n", + "source": "s32 div2(u32 a0) {\n s32 v0;\n if (a0 >= 0) {\n v0 = (s32)a0 >> 1;\n } else {\n v0 = (s32)(a0 + 1) >> 1;\n }\n return v0;\n}\n", "score": 5, "maxScore": 6, "compileErrors": null, @@ -23493,7 +23543,7 @@ "score": 100, "lines": 9, "gotos": 0, - "casts": 0, + "casts": 2, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -23550,14 +23600,14 @@ "decompiler": "asmlift", "candidateLabel": "unsigned", "outcome": "nonmatch", - "source": "s32 div2(u32 a0) {\n return (a0 >> 31) + a0 >> 1;\n}\n", - "score": 2, + "source": "s32 div2(u32 a0) {\n return (s32)((a0 >> 31) + a0) >> 1;\n}\n", + "score": 1, "maxScore": 4, "compileErrors": null, "breakdown": { "insert": 0, "delete": 0, - "replace": 1, + "replace": 0, "opMismatch": 0, "argMismatch": 1 }, @@ -23565,7 +23615,7 @@ "score": 100, "lines": 3, "gotos": 0, - "casts": 0, + "casts": 1, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -23596,7 +23646,7 @@ } }, "gapSize": { - "decompiler": "m2c", + "decompiler": "asmlift", "score": 1, "maxScore": 4, "ratio": 0.25, @@ -29852,18 +29902,18 @@ "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-98282641ffdcb40b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 i2ll\n\n\nContents of section .text:\n 0000 00801021 00401821 03e00008 000217c3 ...!.@.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n", "asmlift": { "decompiler": "asmlift", - "candidateLabel": "unsigned", + "candidateLabel": "signed", "outcome": "nonmatch", - "source": "s32 i2ll(u32 a0) {\n return a0 >> 31;\n}\n", + "source": "s32 i2ll(s32 a0) {\n return a0 >> 31;\n}\n", "score": 3, "maxScore": 4, "compileErrors": null, "breakdown": { "insert": 0, "delete": 2, - "replace": 1, + "replace": 0, "opMismatch": 0, - "argMismatch": 0 + "argMismatch": 1 }, "quality": { "score": 100, @@ -29907,9 +29957,9 @@ "kinds": { "insert": 0, "delete": 2, - "replace": 1, + "replace": 0, "opMismatch": 0, - "argMismatch": 0 + "argMismatch": 1 } }, "scripts": { @@ -35218,22 +35268,22 @@ "decompiler": "asmlift", "candidateLabel": "signed", "outcome": "nonmatch", - "source": "void memcpy1(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n s32 v1;\n u8 * v2;\n u8 * v3;\n s32 v4;\n if (a2 > 0) {\n if (a2 <= 8) {\n v0 = 0;\n } else {\n v0 = 0;\n for (v1 = a2 + -8 + 7 >> 3; v1 != 0; v1 = v1 - 1) {\n *(u8 *)(a0 + v0) = *(u8 *)(a1 + v0);\n ((u8 *)(a0 + v0))[1] = ((u8 *)(a1 + v0))[1];\n ((u8 *)(a0 + v0))[2] = ((u8 *)(a1 + v0))[2];\n ((u8 *)(a0 + v0))[3] = ((u8 *)(a1 + v0))[3];\n ((u8 *)(a0 + v0))[4] = ((u8 *)(a1 + v0))[4];\n ((u8 *)(a0 + v0))[5] = ((u8 *)(a1 + v0))[5];\n ((u8 *)(a0 + v0))[6] = ((u8 *)(a1 + v0))[6];\n ((u8 *)(a0 + v0))[7] = ((u8 *)(a1 + v0))[7];\n v0 = v0 + 8;\n }\n }\n if (v0 < a2) {\n v4 = a2 - v0;\n v2 = (u8 *)(a1 + v0);\n v3 = (u8 *)(a0 + v0);\n do {\n *v3 = *v2;\n v2 = v2 + 1;\n v3 = v3 + 1;\n v4 = v4 - 1;\n } while (v4 != 0);\n return;\n } else {\n return;\n }\n } else {\n return;\n }\n}\n", + "source": "void memcpy1(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n s32 v1;\n u8 * v2;\n u8 * v3;\n s32 v4;\n if (a2 > 0) {\n if (a2 <= 8) {\n v0 = 0;\n } else {\n v0 = 0;\n for (v1 = (u32)(a2 + -8 + 7) >> 3; v1 != 0; v1 = v1 - 1) {\n *(u8 *)(a0 + v0) = *(u8 *)(a1 + v0);\n ((u8 *)(a0 + v0))[1] = ((u8 *)(a1 + v0))[1];\n ((u8 *)(a0 + v0))[2] = ((u8 *)(a1 + v0))[2];\n ((u8 *)(a0 + v0))[3] = ((u8 *)(a1 + v0))[3];\n ((u8 *)(a0 + v0))[4] = ((u8 *)(a1 + v0))[4];\n ((u8 *)(a0 + v0))[5] = ((u8 *)(a1 + v0))[5];\n ((u8 *)(a0 + v0))[6] = ((u8 *)(a1 + v0))[6];\n ((u8 *)(a0 + v0))[7] = ((u8 *)(a1 + v0))[7];\n v0 = v0 + 8;\n }\n }\n if (v0 < a2) {\n v4 = a2 - v0;\n v2 = (u8 *)(a1 + v0);\n v3 = (u8 *)(a0 + v0);\n do {\n *v3 = *v2;\n v2 = v2 + 1;\n v3 = v3 + 1;\n v4 = v4 - 1;\n } while (v4 != 0);\n return;\n } else {\n return;\n }\n } else {\n return;\n }\n}\n", "score": 80, "maxScore": 91, "compileErrors": null, "breakdown": { "insert": 48, "delete": 3, - "replace": 2, - "opMismatch": 4, + "replace": 3, + "opMismatch": 3, "argMismatch": 23 }, "quality": { "score": 80, "lines": 41, "gotos": 0, - "casts": 18, + "casts": 19, "unkGlue": 0, "rawMem": 2, "addrDeref": 0 @@ -35269,8 +35319,8 @@ "kinds": { "insert": 48, "delete": 3, - "replace": 2, - "opMismatch": 4, + "replace": 3, + "opMismatch": 3, "argMismatch": 23 } }, @@ -35555,7 +35605,7 @@ "decompiler": "asmlift", "candidateLabel": "signed", "outcome": "nonmatch", - "source": "void memset1(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n s32 v1;\n u8 * v2;\n s32 v3;\n if (a1 > 0) {\n if (a1 <= 8) {\n v0 = 0;\n } else {\n v0 = 0;\n for (v1 = a1 + -8 + 7 >> 3; v1 != 0; v1 = v1 - 1) {\n *(u8 *)(a0 + v0) = a2;\n ((u8 *)(a0 + v0))[1] = a2;\n ((u8 *)(a0 + v0))[2] = a2;\n ((u8 *)(a0 + v0))[3] = a2;\n ((u8 *)(a0 + v0))[4] = a2;\n ((u8 *)(a0 + v0))[5] = a2;\n ((u8 *)(a0 + v0))[6] = a2;\n ((u8 *)(a0 + v0))[7] = a2;\n v0 = v0 + 8;\n }\n }\n if (v0 < a1) {\n v3 = a1 - v0;\n v2 = (u8 *)(a0 + v0);\n do {\n *v2 = a2;\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n return;\n } else {\n return;\n }\n } else {\n return;\n }\n}\n", + "source": "void memset1(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n s32 v1;\n u8 * v2;\n s32 v3;\n if (a1 > 0) {\n if (a1 <= 8) {\n v0 = 0;\n } else {\n v0 = 0;\n for (v1 = (u32)(a1 + -8 + 7) >> 3; v1 != 0; v1 = v1 - 1) {\n *(u8 *)(a0 + v0) = a2;\n ((u8 *)(a0 + v0))[1] = a2;\n ((u8 *)(a0 + v0))[2] = a2;\n ((u8 *)(a0 + v0))[3] = a2;\n ((u8 *)(a0 + v0))[4] = a2;\n ((u8 *)(a0 + v0))[5] = a2;\n ((u8 *)(a0 + v0))[6] = a2;\n ((u8 *)(a0 + v0))[7] = a2;\n v0 = v0 + 8;\n }\n }\n if (v0 < a1) {\n v3 = a1 - v0;\n v2 = (u8 *)(a0 + v0);\n do {\n *v2 = a2;\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n return;\n } else {\n return;\n }\n } else {\n return;\n }\n}\n", "score": 75, "maxScore": 83, "compileErrors": null, @@ -35570,7 +35620,7 @@ "score": 84, "lines": 38, "gotos": 0, - "casts": 9, + "casts": 10, "unkGlue": 0, "rawMem": 1, "addrDeref": 0 @@ -38833,7 +38883,7 @@ "decompiler": "asmlift", "candidateLabel": "signed", "outcome": "nonmatch", - "source": "s32 nestedloop(s32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n s32 v6;\n s32 v7;\n s32 v8;\n s32 v9;\n s32 v10;\n v9 = 0;\n v10 = 0;\n for (v8 = 0; v8 < a0; v8 = v8 + 1) {\n if (a0 > 0) {\n if (a0 <= 8) {\n v0 = 0;\n } else {\n v0 = 0;\n v1 = v9;\n v2 = 0;\n for (v3 = a0 + -8 + 7 >> 3; v3 != 0; v3 = v3 - 1) {\n v1 = v1 + v2 + v8 * (v0 + 1) + v8 * (v0 + 2) + v8 * (v0 + 3) + v8 * (v0 + 4) + v8 * (v0 + 5) + v8 * (v0 + 6) + v8 * (v0 + 7);\n v2 = v2 + v10;\n v0 = v0 + 8;\n }\n v9 = v1;\n }\n v4 = v9;\n v6 = v0;\n v5 = v0 * v8;\n for (v7 = a0 - v0; v7 != 0; v7 = v7 - 1) {\n v4 = v4 + v5;\n v5 = v5 + v8;\n v6 = v6 + 1;\n }\n v9 = v4;\n }\n v10 = v10 + 8;\n }\n return v9;\n}\n", + "source": "s32 nestedloop(s32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n s32 v6;\n s32 v7;\n s32 v8;\n s32 v9;\n s32 v10;\n v9 = 0;\n v10 = 0;\n for (v8 = 0; v8 < a0; v8 = v8 + 1) {\n if (a0 > 0) {\n if (a0 <= 8) {\n v0 = 0;\n } else {\n v0 = 0;\n v1 = v9;\n v2 = 0;\n for (v3 = (u32)(a0 + -8 + 7) >> 3; v3 != 0; v3 = v3 - 1) {\n v1 = v1 + v2 + v8 * (v0 + 1) + v8 * (v0 + 2) + v8 * (v0 + 3) + v8 * (v0 + 4) + v8 * (v0 + 5) + v8 * (v0 + 6) + v8 * (v0 + 7);\n v2 = v2 + v10;\n v0 = v0 + 8;\n }\n v9 = v1;\n }\n v4 = v9;\n v6 = v0;\n v5 = v0 * v8;\n for (v7 = a0 - v0; v7 != 0; v7 = v7 - 1) {\n v4 = v4 + v5;\n v5 = v5 + v8;\n v6 = v6 + 1;\n }\n v9 = v4;\n }\n v10 = v10 + 8;\n }\n return v9;\n}\n", "score": 142, "maxScore": 152, "compileErrors": null, @@ -38848,7 +38898,7 @@ "score": 100, "lines": 43, "gotos": 0, - "casts": 0, + "casts": 1, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 @@ -39677,18 +39727,18 @@ "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 promsh\n\n\nContents of section .text:\n 0000 afa40000 afa50004 00052c00 00042400 ..........,...$.\n 0010 00042403 00052c03 03e00008 00851021 ..$...,........!\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 07000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000020 20200001 00000001 ....... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 30383663 33313038 33353238 ef-5086c31083528\n 0130 3238372f 7265662e 63007072 6f6d7368 287/ref.c.promsh\n 0140 00000000 70726f6d 73680000 00000000 ....promsh......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000008 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n", "asmlift": { "decompiler": "asmlift", - "candidateLabel": "unsigned", + "candidateLabel": "signed", "outcome": "nonmatch", - "source": "s32 promsh(u32 a0, u32 a1) {\n return (a0 << 16 >> 16) + (a1 << 16 >> 16);\n}\n", + "source": "s32 promsh(s32 a0, s32 a1) {\n return (a0 << 16 >> 16) + (a1 << 16 >> 16);\n}\n", "score": 7, "maxScore": 8, "compileErrors": null, "breakdown": { "insert": 0, "delete": 2, - "replace": 2, + "replace": 0, "opMismatch": 0, - "argMismatch": 3 + "argMismatch": 5 }, "quality": { "score": 100, @@ -42099,18 +42149,18 @@ "asmDump": "\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 sextb\n\n\nContents of section .text:\n 0000 afa40000 00042600 03e00008 00041603 ......&.........\nContents of section .options:\n 0000 01200000 00000000 a0000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 33333262 35643665 30373736 ef-4332b5d6e0776\n 0130 6639332f 7265662e 63007365 78746200 f93/ref.c.sextb.\n 0140 73657874 62000000 00000000 00000001 sextb...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n", "asmlift": { "decompiler": "asmlift", - "candidateLabel": "unsigned", + "candidateLabel": "signed", "outcome": "nonmatch", - "source": "s32 sextb(u32 a0) {\n return a0 << 24 >> 24;\n}\n", + "source": "s32 sextb(s32 a0) {\n return a0 << 24 >> 24;\n}\n", "score": 3, "maxScore": 4, "compileErrors": null, "breakdown": { "insert": 0, "delete": 1, - "replace": 1, + "replace": 0, "opMismatch": 0, - "argMismatch": 1 + "argMismatch": 2 }, "quality": { "score": 100, @@ -43612,18 +43662,18 @@ "asmDump": "\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 sign\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sign\n\n\nContents of section .text:\n 0000 2c030000 4081000c 38600001 4e800020 ,...@...8`..N.. \n 0010 7c63fe70 4e800020 |c.pN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n", "asmlift": { "decompiler": "asmlift", - "candidateLabel": "unsigned", + "candidateLabel": "signed", "outcome": "nonmatch", - "source": "s32 sign(u32 a0) {\n if (a0 > 0) {\n return 1;\n } else {\n return a0 >> 31;\n }\n}\n", + "source": "s32 sign(s32 a0) {\n if (a0 > 0) {\n return 1;\n } else {\n return a0 >> 31;\n }\n}\n", "score": 6, - "maxScore": 7, + "maxScore": 8, "compileErrors": null, "breakdown": { - "insert": 1, - "delete": 1, - "replace": 3, + "insert": 2, + "delete": 2, + "replace": 0, "opMismatch": 1, - "argMismatch": 0 + "argMismatch": 1 }, "quality": { "score": 100, @@ -43662,14 +43712,14 @@ "gapSize": { "decompiler": "asmlift", "score": 6, - "maxScore": 7, - "ratio": 0.8571428571428571, + "maxScore": 8, + "ratio": 0.75, "kinds": { - "insert": 1, - "delete": 1, - "replace": 3, + "insert": 2, + "delete": 2, + "replace": 0, "opMismatch": 1, - "argMismatch": 0 + "argMismatch": 1 } }, "scripts": { @@ -43697,14 +43747,14 @@ "decompiler": "asmlift", "candidateLabel": "signed", "outcome": "nonmatch", - "source": "s32 signum(s32 a0) {\n s32 v0;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n v0 = 1;\n }\n return v0 - (a0 >> 31);\n}\n", - "score": 4, + "source": "s32 signum(s32 a0) {\n s32 v0;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n v0 = 1;\n }\n return v0 - ((u32)a0 >> 31);\n}\n", + "score": 3, "maxScore": 7, "compileErrors": null, "breakdown": { "insert": 0, "delete": 0, - "replace": 1, + "replace": 0, "opMismatch": 1, "argMismatch": 2 }, @@ -43712,7 +43762,7 @@ "score": 100, "lines": 9, "gotos": 0, - "casts": 0, + "casts": 1, "unkGlue": 0, "rawMem": 0, "addrDeref": 0 diff --git a/apps/web/src/data/summary.json b/apps/web/src/data/summary.json index 78e3bbca..55a4f645 100644 --- a/apps/web/src/data/summary.json +++ b/apps/web/src/data/summary.json @@ -1,10 +1,10 @@ { "total": 675, "match": { - "asmlift": 343, + "asmlift": 345, "m2c": 340 }, - "commit": "f309fec083fbc669836a6aea250dcea84532eecd", + "commit": "005cccf2660e8bd7aa845c3eddffcfac7d6f21a7", "m2cCommit": "94098d4de68c2fcc13fb8cf1096a1520eb171abe", "dirty": false } diff --git a/apps/web/src/pages/benchmark/data/results.json b/apps/web/src/pages/benchmark/data/results.json index af73d000..706d1e33 100644 --- a/apps/web/src/pages/benchmark/data/results.json +++ b/apps/web/src/pages/benchmark/data/results.json @@ -1 +1 @@ -{"meta":{"generatedAt":"2026-08-02T12:05:10.669Z","toolchains":["ido7.1","agbcc","gcc2.7.2","gcc2.7.2kmc","mwcc_242_81"],"counts":{"total":675,"synthetic":483,"real":192},"asmlift":{"commit":"f309fec083fbc669836a6aea250dcea84532eecd","dirty":false},"m2c":{"commit":"94098d4de68c2fcc13fb8cf1096a1520eb171abe"}},"results":[{"id":"af:add_calc_short_angle3:ido7.1","sym":"add_calc_short_angle3","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","arithmetic","branch"],"loc":31,"refSource":"s16 add_calc_short_angle3(s16* pValue, s16 target, f32 fraction, s16 maxStep, s16 minStep) {\n f32 stepSize;\n s32 uTarget;\n s32 newValue;\n s32 uValue;\n\n if (target != *pValue) {\n uValue = (u16)*pValue;\n uTarget = (u16)target;\n\n if (uValue > uTarget) {\n uTarget += 0x10000;\n }\n\n stepSize = (uTarget - uValue) * fraction;\n\n if (stepSize > maxStep) {\n stepSize = maxStep;\n } else if (stepSize < minStep) {\n stepSize = minStep;\n }\n\n newValue = uValue + (s32)stepSize;\n if (newValue > uTarget) {\n newValue = uTarget;\n }\n *pValue = newValue;\n }\n\n return target - *pValue;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L533-L563","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta3,12(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta1,a1,0x10\n 14:\tmtc1\ta2,$f12\n 18:\tbeq\ta1,v1,bc \n 1c:\tandi\tv0,v1,0xffff\n 20:\tandi\ta3,a1,0xffff\n 24:\tslt\tat,a3,v0\n 28:\tbeqz\tat,38 \n 2c:\tmove\ta2,a3\n 30:\tlui\tat,0x1\n 34:\taddu\ta2,a3,at\n 38:\tsubu\tt6,a2,v0\n 3c:\tmtc1\tt6,$f4\n 40:\tlh\tt7,14(sp)\n 44:\tlh\tt8,18(sp)\n 48:\tcvt.s.w\t$f6,$f4\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f14,$f8\n 58:\tmul.s\t$f2,$f6,$f12\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tmov.s\t$f0,$f2\n 64:\tbc1fl\t78 \n 68:\tmtc1\tt8,$f10\n 6c:\tb\t94 \n 70:\tmov.s\t$f0,$f14\n 74:\tmtc1\tt8,$f10\n 78:\tnop\n 7c:\tcvt.s.w\t$f12,$f10\n 80:\tc.lt.s\t$f2,$f12\n 84:\tnop\n 88:\tbc1fl\t98 \n 8c:\ttrunc.w.s\t$f16,$f0\n 90:\tmov.s\t$f0,$f12\n 94:\ttrunc.w.s\t$f16,$f0\n 98:\tmfc1\tt0,$f16\n 9c:\tnop\n a0:\taddu\ta3,t0,v0\n a4:\tslt\tat,a2,a3\n a8:\tbeqzl\tat,b8 \n ac:\tsh\ta3,0(a0)\n b0:\tmove\ta3,a2\n b4:\tsh\ta3,0(a0)\n b8:\tlh\tv1,0(a0)\n bc:\tsubu\tv0,a1,v1\n c0:\tsll\tv0,v0,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000cc add_calc_short_angle3\n\n\nContents of section .text:\n 0000 afa50004 afa7000c 84830000 00052c00 ..............,.\n 0010 00052c03 44866000 10a30028 3062ffff ..,.D.`....(0b..\n 0020 30a7ffff 00e2082a 10200003 00e03025 0......*. ....0%\n 0030 3c010001 00e13021 00c27023 448e2000 <.....0!..p#D. .\n 0040 87af000e 87b80012 468021a0 448f4000 ........F.!.D.@.\n 0050 00000000 468043a0 460c3082 4602703c ....F.C.F.0.F.p<\n 0060 46001006 45020004 44985000 10000009 F...E...D.P.....\n 0070 46007006 44985000 00000000 46805320 F.p.D.P.....F.S \n 0080 460c103c 00000000 45020003 4600040d F..<....E...F...\n 0090 46006006 4600040d 44088000 00000000 F.`.F...D.......\n 00a0 01023821 00c7082a 50200003 a4870000 ..8!...*P ......\n 00b0 00c03825 a4870000 84830000 00a31023 ..8%...........#\n 00c0 00021400 03e00008 00021403 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a100c1fe 00000000 . ..............\n 0010 0003f5df 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a100c1fe 00000000 0003f5df 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000033 0000001c 00000248 p......3.......H\n 0010 00000005 000003bc 00000001 00000264 ...............d\n 0020 00000004 00000298 00000000 00000000 ................\n 0030 00000011 000002c8 00000040 0000030c ...........@....\n 0040 00000018 0000034c 00000001 00000364 .......L.......d\n 0050 00000000 00000000 00000001 000003ac ................\n 0060 0150b250 101011f0 21211020 d012f010 .P.P....!!. ....\n 0070 f0111116 10231210 21230000 00000000 .....#..!#......\n 0080 00000001 00000000 00000000 00000000 ................\n 0090 ffffffff 00000000 00000000 00000000 ................\n 00a0 001d001f 00000004 0000001b 00000000 ................\n 00b0 00000001 00000000 2c200004 0000002a ........, .....*\n 00c0 00000000 1820000f 0000002a 000000cc ..... .....*....\n 00d0 20200001 00000001 00000000 20200000 .......... ..\n 00e0 02000000 03000000 04000000 05000000 ................\n 00f0 06000000 07000000 08000000 09000000 ................\n 0100 20000000 21000000 0a000000 0b000000 ...!...........\n 0110 0b000000 1a000000 00000000 00000003 ................\n 0120 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0130 7265616c 2d69646f 2d623633 30333139 real-ido-b630319\n 0140 36336333 61656233 662f752e 69006164 63c3aeb3f/u.i.ad\n 0150 645f6361 6c635f73 686f7274 5f616e67 d_calc_short_ang\n 0160 6c653300 6164645f 63616c63 5f73686f le3.add_calc_sho\n 0170 72745f61 6e676c65 33000000 00000000 rt_angle3.......\n 0180 00000001 00000000 00000040 00000000 ...........@....\n 0190 00000004 00000000 00000033 00000000 ...........3....\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 0000001a 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000000 00000000 . ..............\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'add_calc_short_angle3' — lift: cannot lift 'add_calc_short_angle3': unmodelled control transfer 'bc1fl' at 0x64 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta1,4(sp) */\n/* 4:\tsw\ta3,12(sp) */\n/* 8:\tlh\tv1,0(a0) */\n/* c:\tsll\ta1,a1,0x10 */\n/* 10:\tsra\ta1,a1,0x10 */\n/* 14:\tmtc1\ta2,$f12 */\n/* 18:\tbeq\ta1,v1,bc */\n/* 1c:\tandi\tv0,v1,0xffff */\n/* 20:\tandi\ta3,a1,0xffff */\n/* 24:\tslt\tat,a3,v0 */\n/* 28:\tbeqz\tat,38 */\n/* 2c:\tmove\ta2,a3 */\n/* 30:\tlui\tat,0x1 */\n/* 34:\taddu\ta2,a3,at */\n/* 38:\tsubu\tt6,a2,v0 */\n/* 3c:\tmtc1\tt6,$f4 */\n/* 40:\tlh\tt7,14(sp) */\n/* 44:\tlh\tt8,18(sp) */\n/* 48:\tcvt.s.w\t$f6,$f4 */\n/* 4c:\tmtc1\tt7,$f8 */\n/* 50:\tnop */\n/* 54:\tcvt.s.w\t$f14,$f8 */\n/* 58:\tmul.s\t$f2,$f6,$f12 */\n/* 5c:\tc.lt.s\t$f14,$f2 */\n/* 60:\tmov.s\t$f0,$f2 */\n/* 64:\tbc1fl\t78 */\n/* 68:\tmtc1\tt8,$f10 */\n/* 6c:\tb\t94 */\n/* 70:\tmov.s\t$f0,$f14 */\n/* 74:\tmtc1\tt8,$f10 */\n/* 78:\tnop */\n/* 7c:\tcvt.s.w\t$f12,$f10 */\n/* 80:\tc.lt.s\t$f2,$f12 */\n/* 84:\tnop */\n/* 88:\tbc1fl\t98 */\n/* 8c:\ttrunc.w.s\t$f16,$f0 */\n/* 90:\tmov.s\t$f0,$f12 */\n/* 94:\ttrunc.w.s\t$f16,$f0 */\n/* 98:\tmfc1\tt0,$f16 */\n/* 9c:\tnop */\n/* a0:\taddu\ta3,t0,v0 */\n/* a4:\tslt\tat,a2,a3 */\n/* a8:\tbeqzl\tat,b8 */\n/* ac:\tsh\ta3,0(a0) */\n/* b0:\tmove\ta3,a2 */\n/* b4:\tsh\ta3,0(a0) */\n/* b8:\tlh\tv1,0(a0) */\n/* bc:\tsubu\tv0,a1,v1 */\n/* c0:\tsll\tv0,v0,0x10 */\n/* c4:\tjr\tra */\n/* c8:\tsra\tv0,v0,0x10 */\n/* cc:\tnop */\nvoid add_calc_short_angle3(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'add_calc_short_angle3': unmodelled control transfer 'bc1fl' at 0x64 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":60,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'add_calc_short_angle3': unmodelled control transfer 'bc1fl' at 0x64 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 add_calc_short_angle3(s16 *arg0, s16 arg1, f32 arg2, s16 arg3, s16 arg4) {\n f32 temp_f12;\n f32 temp_f14;\n f32 temp_f2;\n f32 var_f0;\n s16 temp_a3;\n s16 temp_v1;\n s16 var_a2;\n s16 var_a3;\n s32 temp_v0;\n\n temp_v1 = *arg0;\n temp_v0 = temp_v1 & 0xFFFF;\n if (arg1 != temp_v1) {\n temp_a3 = arg1 & 0xFFFF;\n var_a2 = temp_a3;\n if (temp_a3 < temp_v0) {\n var_a2 = temp_a3 + 0x10000;\n }\n temp_f14 = (f32) arg3;\n temp_f2 = (f32) (var_a2 - temp_v0) * arg2;\n var_f0 = temp_f2;\n if (temp_f14 < temp_f2) {\n var_f0 = temp_f14;\n } else {\n temp_f12 = (f32) arg4;\n if (temp_f2 < temp_f12) {\n var_f0 = temp_f12;\n }\n }\n var_a3 = (s32) var_f0 + temp_v0;\n if (var_a2 < var_a3) {\n var_a3 = var_a2;\n }\n *arg0 = var_a3;\n }\n return (s16) (arg1 - *arg0);\n}\n","score":35,"maxScore":62,"compileErrors":null,"breakdown":{"insert":11,"delete":1,"replace":4,"opMismatch":0,"argMismatch":19},"quality":{"score":100,"lines":37,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":35,"maxScore":62,"ratio":0.5645161290322581,"kinds":{"insert":11,"delete":1,"replace":4,"opMismatch":0,"argMismatch":19}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add_calc_short_angle3` — benchmark function af:add_calc_short_angle3:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc_short_angle3\n sw\t$a1, 4($sp)\n sw\t$a3, 12($sp)\n lh\t$v1, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n mtc1\t$a2, $f12\n beq\t$a1, $v1, .Lbc\n andi\t$v0, $v1, 0xffff\n andi\t$a3, $a1, 0xffff\n slt\t$at, $a3, $v0\n beqz\t$at, .L38\n move\t$a2, $a3\n lui\t$at, 0x1\n addu\t$a2, $a3, $at\n.L38:\n subu\t$t6, $a2, $v0\n mtc1\t$t6, $f4\n lh\t$t7, 14($sp)\n lh\t$t8, 18($sp)\n cvt.s.w\t$f6, $f4\n mtc1\t$t7, $f8\n nop\n cvt.s.w\t$f14, $f8\n mul.s\t$f2, $f6, $f12\n c.lt.s\t$f14, $f2\n mov.s\t$f0, $f2\n bc1fl\t.L78\n mtc1\t$t8, $f10\n b\t.L94\n mov.s\t$f0, $f14\n mtc1\t$t8, $f10\n.L78:\n nop\n cvt.s.w\t$f12, $f10\n c.lt.s\t$f2, $f12\n nop\n bc1fl\t.L98\n trunc.w.s\t$f16, $f0\n mov.s\t$f0, $f12\n.L94:\n trunc.w.s\t$f16, $f0\n.L98:\n mfc1\t$t0, $f16\n nop\n addu\t$a3, $t0, $v0\n slt\t$at, $a2, $a3\n beqzl\t$at, .Lb8\n sh\t$a3, 0($a0)\n move\t$a3, $a2\n sh\t$a3, 0($a0)\n.Lb8:\n lh\t$v1, 0($a0)\n.Lbc:\n subu\t$v0, $a1, $v1\n sll\t$v0, $v0, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc_short_angle3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc_short_angle3` — benchmark function af:add_calc_short_angle3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc_short_angle3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta3,12(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta1,a1,0x10\n 14:\tmtc1\ta2,$f12\n 18:\tbeq\ta1,v1,bc \n 1c:\tandi\tv0,v1,0xffff\n 20:\tandi\ta3,a1,0xffff\n 24:\tslt\tat,a3,v0\n 28:\tbeqz\tat,38 \n 2c:\tmove\ta2,a3\n 30:\tlui\tat,0x1\n 34:\taddu\ta2,a3,at\n 38:\tsubu\tt6,a2,v0\n 3c:\tmtc1\tt6,$f4\n 40:\tlh\tt7,14(sp)\n 44:\tlh\tt8,18(sp)\n 48:\tcvt.s.w\t$f6,$f4\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f14,$f8\n 58:\tmul.s\t$f2,$f6,$f12\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tmov.s\t$f0,$f2\n 64:\tbc1fl\t78 \n 68:\tmtc1\tt8,$f10\n 6c:\tb\t94 \n 70:\tmov.s\t$f0,$f14\n 74:\tmtc1\tt8,$f10\n 78:\tnop\n 7c:\tcvt.s.w\t$f12,$f10\n 80:\tc.lt.s\t$f2,$f12\n 84:\tnop\n 88:\tbc1fl\t98 \n 8c:\ttrunc.w.s\t$f16,$f0\n 90:\tmov.s\t$f0,$f12\n 94:\ttrunc.w.s\t$f16,$f0\n 98:\tmfc1\tt0,$f16\n 9c:\tnop\n a0:\taddu\ta3,t0,v0\n a4:\tslt\tat,a2,a3\n a8:\tbeqzl\tat,b8 \n ac:\tsh\ta3,0(a0)\n b0:\tmove\ta3,a2\n b4:\tsh\ta3,0(a0)\n b8:\tlh\tv1,0(a0)\n bc:\tsubu\tv0,a1,v1\n c0:\tsll\tv0,v0,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000cc add_calc_short_angle3\n\n\nContents of section .text:\n 0000 afa50004 afa7000c 84830000 00052c00 ..............,.\n 0010 00052c03 44866000 10a30028 3062ffff ..,.D.`....(0b..\n 0020 30a7ffff 00e2082a 10200003 00e03025 0......*. ....0%\n 0030 3c010001 00e13021 00c27023 448e2000 <.....0!..p#D. .\n 0040 87af000e 87b80012 468021a0 448f4000 ........F.!.D.@.\n 0050 00000000 468043a0 460c3082 4602703c ....F.C.F.0.F.p<\n 0060 46001006 45020004 44985000 10000009 F...E...D.P.....\n 0070 46007006 44985000 00000000 46805320 F.p.D.P.....F.S \n 0080 460c103c 00000000 45020003 4600040d F..<....E...F...\n 0090 46006006 4600040d 44088000 00000000 F.`.F...D.......\n 00a0 01023821 00c7082a 50200003 a4870000 ..8!...*P ......\n 00b0 00c03825 a4870000 84830000 00a31023 ..8%...........#\n 00c0 00021400 03e00008 00021403 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a100c1fe 00000000 . ..............\n 0010 0003f5df 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a100c1fe 00000000 0003f5df 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000033 0000001c 00000248 p......3.......H\n 0010 00000005 000003bc 00000001 00000264 ...............d\n 0020 00000004 00000298 00000000 00000000 ................\n 0030 00000011 000002c8 00000040 0000030c ...........@....\n 0040 00000018 0000034c 00000001 00000364 .......L.......d\n 0050 00000000 00000000 00000001 000003ac ................\n 0060 0150b250 101011f0 21211020 d012f010 .P.P....!!. ....\n 0070 f0111116 10231210 21230000 00000000 .....#..!#......\n 0080 00000001 00000000 00000000 00000000 ................\n 0090 ffffffff 00000000 00000000 00000000 ................\n 00a0 001d001f 00000004 0000001b 00000000 ................\n 00b0 00000001 00000000 2c200004 0000002a ........, .....*\n 00c0 00000000 1820000f 0000002a 000000cc ..... .....*....\n 00d0 20200001 00000001 00000000 20200000 .......... ..\n 00e0 02000000 03000000 04000000 05000000 ................\n 00f0 06000000 07000000 08000000 09000000 ................\n 0100 20000000 21000000 0a000000 0b000000 ...!...........\n 0110 0b000000 1a000000 00000000 00000003 ................\n 0120 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0130 7265616c 2d69646f 2d623633 30333139 real-ido-b630319\n 0140 36336333 61656233 662f752e 69006164 63c3aeb3f/u.i.ad\n 0150 645f6361 6c635f73 686f7274 5f616e67 d_calc_short_ang\n 0160 6c653300 6164645f 63616c63 5f73686f le3.add_calc_sho\n 0170 72745f61 6e676c65 33000000 00000000 rt_angle3.......\n 0180 00000001 00000000 00000040 00000000 ...........@....\n 0190 00000004 00000000 00000033 00000000 ...........3....\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 0000001a 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000000 00000000 . ..............\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc_short_angle3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:add_calc0:ido7.1","sym":"add_calc0","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","pointer"],"loc":11,"refSource":"void add_calc0(f32* pValue, f32 fraction, f32 step) {\n f32 stepSize = *pValue * fraction;\n\n if (stepSize > step) {\n stepSize = step;\n } else if (stepSize < -step) {\n stepSize = -step;\n }\n\n *pValue -= stepSize;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L425-L435","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f2,0(a0)\n 8:\tmtc1\ta2,$f14\n c:\tmul.s\t$f0,$f2,$f12\n 10:\tc.lt.s\t$f14,$f0\n 14:\tnop\n 18:\tbc1fl\t2c \n 1c:\tneg.s\t$f12,$f14\n 20:\tb\t40 \n 24:\tmov.s\t$f0,$f14\n 28:\tneg.s\t$f12,$f14\n 2c:\tc.lt.s\t$f0,$f12\n 30:\tnop\n 34:\tbc1fl\t44 \n 38:\tsub.s\t$f4,$f2,$f0\n 3c:\tmov.s\t$f0,$f12\n 40:\tsub.s\t$f4,$f2,$f0\n 44:\tjr\tra\n 48:\tswc1\t$f4,0(a0)\n 4c:\tnop\n","proto":{"add_calc0":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c add_calc0\n\n\nContents of section .text:\n 0000 44856000 c4820000 44867000 460c1002 D.`.....D.p.F...\n 0010 4600703c 00000000 45020004 46007307 F.p<....E...F.s.\n 0020 10000007 46007006 46007307 460c003c ....F.p.F.s.F..<\n 0030 00000000 45020003 46001101 46006006 ....E...F...F.`.\n 0040 46001101 03e00008 e4840000 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00007037 00000000 00000000 00007ff0 ..p7............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00007037 00000000 ...p......p7....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 0000000c 000001b8 p...............\n 0010 00000005 00000304 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000034 0000026c .......(...4...l\n 0040 0000000c 000002a0 00000001 000002ac ................\n 0050 00000000 00000000 00000001 000002f4 ................\n 0060 0010f010 13111410 2010f000 00000000 ........ .......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000001 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000004c ..... .....*...L\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d626438 32373063 real-ido-bd8270c\n 0130 37326164 64626664 642f752e 69006164 72addbfdd/u.i.ad\n 0140 645f6361 6c633000 6164645f 63616c63 d_calc0.add_calc\n 0150 30000000 00000000 00000001 00000000 0...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 00000013 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000b 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'add_calc0' — lift: cannot lift 'add_calc0': unmodelled control transfer 'bc1fl' at 0x18 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta1,$f12 */\n/* 4:\tlwc1\t$f2,0(a0) */\n/* 8:\tmtc1\ta2,$f14 */\n/* c:\tmul.s\t$f0,$f2,$f12 */\n/* 10:\tc.lt.s\t$f14,$f0 */\n/* 14:\tnop */\n/* 18:\tbc1fl\t2c */\n/* 1c:\tneg.s\t$f12,$f14 */\n/* 20:\tb\t40 */\n/* 24:\tmov.s\t$f0,$f14 */\n/* 28:\tneg.s\t$f12,$f14 */\n/* 2c:\tc.lt.s\t$f0,$f12 */\n/* 30:\tnop */\n/* 34:\tbc1fl\t44 */\n/* 38:\tsub.s\t$f4,$f2,$f0 */\n/* 3c:\tmov.s\t$f0,$f12 */\n/* 40:\tsub.s\t$f4,$f2,$f0 */\n/* 44:\tjr\tra */\n/* 48:\tswc1\t$f4,0(a0) */\n/* 4c:\tnop */\nvoid add_calc0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'add_calc0': unmodelled control transfer 'bc1fl' at 0x18 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":28,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'add_calc0': unmodelled control transfer 'bc1fl' at 0x18 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void add_calc0(f32 *arg0, f32 arg1, f32 arg2) {\n f32 temp_f12;\n f32 temp_f2;\n f32 var_f0;\n\n temp_f2 = *arg0;\n var_f0 = temp_f2 * arg1;\n if (arg2 < var_f0) {\n var_f0 = arg2;\n } else {\n temp_f12 = -arg2;\n if (var_f0 < temp_f12) {\n var_f0 = temp_f12;\n }\n }\n *arg0 = temp_f2 - var_f0;\n}\n","score":15,"maxScore":21,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":2,"opMismatch":0,"argMismatch":11},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":15,"maxScore":21,"ratio":0.7142857142857143,"kinds":{"insert":2,"delete":0,"replace":2,"opMismatch":0,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add_calc0` — benchmark function af:add_calc0:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc0\n mtc1\t$a1, $f12\n lwc1\t$f2, 0($a0)\n mtc1\t$a2, $f14\n mul.s\t$f0, $f2, $f12\n c.lt.s\t$f14, $f0\n nop\n bc1fl\t.L2c\n neg.s\t$f12, $f14\n b\t.L40\n mov.s\t$f0, $f14\n neg.s\t$f12, $f14\n.L2c:\n c.lt.s\t$f0, $f12\n nop\n bc1fl\t.L44\n sub.s\t$f4, $f2, $f0\n mov.s\t$f0, $f12\n.L40:\n sub.s\t$f4, $f2, $f0\n.L44:\n jr\t$ra\n swc1\t$f4, 0($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc0` — benchmark function af:add_calc0:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc0:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f2,0(a0)\n 8:\tmtc1\ta2,$f14\n c:\tmul.s\t$f0,$f2,$f12\n 10:\tc.lt.s\t$f14,$f0\n 14:\tnop\n 18:\tbc1fl\t2c \n 1c:\tneg.s\t$f12,$f14\n 20:\tb\t40 \n 24:\tmov.s\t$f0,$f14\n 28:\tneg.s\t$f12,$f14\n 2c:\tc.lt.s\t$f0,$f12\n 30:\tnop\n 34:\tbc1fl\t44 \n 38:\tsub.s\t$f4,$f2,$f0\n 3c:\tmov.s\t$f0,$f12\n 40:\tsub.s\t$f4,$f2,$f0\n 44:\tjr\tra\n 48:\tswc1\t$f4,0(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c add_calc0\n\n\nContents of section .text:\n 0000 44856000 c4820000 44867000 460c1002 D.`.....D.p.F...\n 0010 4600703c 00000000 45020004 46007307 F.p<....E...F.s.\n 0020 10000007 46007006 46007307 460c003c ....F.p.F.s.F..<\n 0030 00000000 45020003 46001101 46006006 ....E...F...F.`.\n 0040 46001101 03e00008 e4840000 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00007037 00000000 00000000 00007ff0 ..p7............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00007037 00000000 ...p......p7....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 0000000c 000001b8 p...............\n 0010 00000005 00000304 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000034 0000026c .......(...4...l\n 0040 0000000c 000002a0 00000001 000002ac ................\n 0050 00000000 00000000 00000001 000002f4 ................\n 0060 0010f010 13111410 2010f000 00000000 ........ .......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000001 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000004c ..... .....*...L\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d626438 32373063 real-ido-bd8270c\n 0130 37326164 64626664 642f752e 69006164 72addbfdd/u.i.ad\n 0140 645f6361 6c633000 6164645f 63616c63 d_calc0.add_calc\n 0150 30000000 00000000 00000001 00000000 0...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 00000013 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000b 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add_calc0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:add_calc2:ido7.1","sym":"add_calc2","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","pointer"],"loc":14,"refSource":"void add_calc2(f32* pValue, f32 target, f32 fraction, f32 step) {\n f32 stepSize;\n if (*pValue != target) {\n stepSize = fraction * (target - *pValue);\n\n if (stepSize > step) {\n stepSize = step;\n } else if (stepSize < -step) {\n stepSize = -step;\n }\n\n *pValue += stepSize;\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L410-L423","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tc.eq.s\t$f12,$f0\n 14:\tnop\n 18:\tbc1t\t68 \n 1c:\tnop\n 20:\tsub.s\t$f4,$f12,$f0\n 24:\tlwc1\t$f6,12(sp)\n 28:\tlwc1\t$f12,12(sp)\n 2c:\tmul.s\t$f2,$f4,$f14\n 30:\tc.lt.s\t$f6,$f2\n 34:\tnop\n 38:\tbc1fl\t4c \n 3c:\tneg.s\t$f12,$f12\n 40:\tb\t60 \n 44:\tmov.s\t$f2,$f6\n 48:\tneg.s\t$f12,$f12\n 4c:\tc.lt.s\t$f2,$f12\n 50:\tnop\n 54:\tbc1fl\t64 \n 58:\tadd.s\t$f8,$f0,$f2\n 5c:\tmov.s\t$f2,$f12\n 60:\tadd.s\t$f8,$f0,$f2\n 64:\tswc1\t$f8,0(a0)\n 68:\tjr\tra\n 6c:\tnop\n","proto":{"add_calc2":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000070 add_calc2\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 46006032 00000000 45010013 00000000 F.`2....E.......\n 0020 46006101 c7a6000c c7ac000c 460e2082 F.a.........F. .\n 0030 4602303c 00000000 45020004 46006307 F.0<....E...F.c.\n 0040 10000007 46003086 46006307 460c103c ....F.0.F.c.F..<\n 0050 00000000 45020003 46020200 46006086 ....E...F...F.`.\n 0060 46020200 e4880000 03e00008 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 0000737d 00000000 00000000 00007ff0 ..s}............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 0000737d 00000000 ..........s}....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001c 00000010 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e8 .......(........\n 0020 00000004 0000021c 00000000 00000000 ................\n 0030 00000011 0000024c 00000034 00000290 .......L...4....\n 0040 0000000c 000002c4 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 0120e023 101020d0 13111410 21210000 . .#.. .....!!..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000001 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000070 20200001 00000001 00000000 ...p ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d356161 nch-real-ido-5aa\n 0130 63353333 32623061 63613537 642f752e c5332b0aca57d/u.\n 0140 69006164 645f6361 6c633200 6164645f i.add_calc2.add_\n 0150 63616c63 32000000 00000000 00000001 calc2...........\n 0160 00000000 00000034 00000000 00000004 .......4........\n 0170 00000000 0000001c 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000e ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'add_calc2' — lift: cannot lift 'add_calc2': unmodelled control transfer 'bc1t' at 0x18 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta3,12(sp) */\n/* 4:\tmtc1\ta1,$f12 */\n/* 8:\tlwc1\t$f0,0(a0) */\n/* c:\tmtc1\ta2,$f14 */\n/* 10:\tc.eq.s\t$f12,$f0 */\n/* 14:\tnop */\n/* 18:\tbc1t\t68 */\n/* 1c:\tnop */\n/* 20:\tsub.s\t$f4,$f12,$f0 */\n/* 24:\tlwc1\t$f6,12(sp) */\n/* 28:\tlwc1\t$f12,12(sp) */\n/* 2c:\tmul.s\t$f2,$f4,$f14 */\n/* 30:\tc.lt.s\t$f6,$f2 */\n/* 34:\tnop */\n/* 38:\tbc1fl\t4c */\n/* 3c:\tneg.s\t$f12,$f12 */\n/* 40:\tb\t60 */\n/* 44:\tmov.s\t$f2,$f6 */\n/* 48:\tneg.s\t$f12,$f12 */\n/* 4c:\tc.lt.s\t$f2,$f12 */\n/* 50:\tnop */\n/* 54:\tbc1fl\t64 */\n/* 58:\tadd.s\t$f8,$f0,$f2 */\n/* 5c:\tmov.s\t$f2,$f12 */\n/* 60:\tadd.s\t$f8,$f0,$f2 */\n/* 64:\tswc1\t$f8,0(a0) */\n/* 68:\tjr\tra */\n/* 6c:\tnop */\nvoid add_calc2(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'add_calc2': unmodelled control transfer 'bc1t' at 0x18 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":36,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'add_calc2': unmodelled control transfer 'bc1t' at 0x18 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void add_calc2(f32 *arg0, f32 arg1, f32 arg2, f32 arg3) {\n f32 temp_f0;\n f32 temp_f12;\n f32 var_f2;\n\n temp_f0 = *arg0;\n if (arg1 != temp_f0) {\n var_f2 = (arg1 - temp_f0) * arg2;\n if (arg3 < var_f2) {\n var_f2 = arg3;\n } else {\n temp_f12 = -arg3;\n if (var_f2 < temp_f12) {\n var_f2 = temp_f12;\n }\n }\n *arg0 = temp_f0 + var_f2;\n }\n}\n","score":4,"maxScore":28,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":28,"ratio":0.14285714285714285,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add_calc2` — benchmark function af:add_calc2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc2\n sw\t$a3, 12($sp)\n mtc1\t$a1, $f12\n lwc1\t$f0, 0($a0)\n mtc1\t$a2, $f14\n c.eq.s\t$f12, $f0\n nop\n bc1t\t.L68\n nop\n sub.s\t$f4, $f12, $f0\n lwc1\t$f6, 12($sp)\n lwc1\t$f12, 12($sp)\n mul.s\t$f2, $f4, $f14\n c.lt.s\t$f6, $f2\n nop\n bc1fl\t.L4c\n neg.s\t$f12, $f12\n b\t.L60\n mov.s\t$f2, $f6\n neg.s\t$f12, $f12\n.L4c:\n c.lt.s\t$f2, $f12\n nop\n bc1fl\t.L64\n add.s\t$f8, $f0, $f2\n mov.s\t$f2, $f12\n.L60:\n add.s\t$f8, $f0, $f2\n.L64:\n swc1\t$f8, 0($a0)\n.L68:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc2` — benchmark function af:add_calc2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc2:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tc.eq.s\t$f12,$f0\n 14:\tnop\n 18:\tbc1t\t68 \n 1c:\tnop\n 20:\tsub.s\t$f4,$f12,$f0\n 24:\tlwc1\t$f6,12(sp)\n 28:\tlwc1\t$f12,12(sp)\n 2c:\tmul.s\t$f2,$f4,$f14\n 30:\tc.lt.s\t$f6,$f2\n 34:\tnop\n 38:\tbc1fl\t4c \n 3c:\tneg.s\t$f12,$f12\n 40:\tb\t60 \n 44:\tmov.s\t$f2,$f6\n 48:\tneg.s\t$f12,$f12\n 4c:\tc.lt.s\t$f2,$f12\n 50:\tnop\n 54:\tbc1fl\t64 \n 58:\tadd.s\t$f8,$f0,$f2\n 5c:\tmov.s\t$f2,$f12\n 60:\tadd.s\t$f8,$f0,$f2\n 64:\tswc1\t$f8,0(a0)\n 68:\tjr\tra\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000070 add_calc2\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 46006032 00000000 45010013 00000000 F.`2....E.......\n 0020 46006101 c7a6000c c7ac000c 460e2082 F.a.........F. .\n 0030 4602303c 00000000 45020004 46006307 F.0<....E...F.c.\n 0040 10000007 46003086 46006307 460c103c ....F.0.F.c.F..<\n 0050 00000000 45020003 46020200 46006086 ....E...F...F.`.\n 0060 46020200 e4880000 03e00008 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 0000737d 00000000 00000000 00007ff0 ..s}............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 0000737d 00000000 ..........s}....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001c 00000010 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e8 .......(........\n 0020 00000004 0000021c 00000000 00000000 ................\n 0030 00000011 0000024c 00000034 00000290 .......L...4....\n 0040 0000000c 000002c4 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 0120e023 101020d0 13111410 21210000 . .#.. .....!!..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000001 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000070 20200001 00000001 00000000 ...p ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d356161 nch-real-ido-5aa\n 0130 63353333 32623061 63613537 642f752e c5332b0aca57d/u.\n 0140 69006164 645f6361 6c633200 6164645f i.add_calc2.add_\n 0150 63616c63 32000000 00000000 00000001 calc2...........\n 0160 00000000 00000034 00000000 00000004 .......4........\n 0170 00000000 0000001c 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000e ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add_calc2\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:adds:ido7.1","sym":"adds","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","branch","pointer"],"loc":16,"refSource":"void adds(s16* pValue, s16 target, s16 scale, s16 maxStep) {\n s16 diff = target - *pValue;\n diff /= scale;\n\n if (diff > maxStep) {\n *pValue += maxStep;\n return;\n }\n\n if (diff < -maxStep) {\n *pValue -= maxStep;\n return;\n }\n\n *pValue += diff;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L565-L580","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tsw\ta3,12(sp)\n c:\tlh\tv1,0(a0)\n 10:\tsll\ta1,a1,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tsubu\tv0,a1,v1\n 1c:\tsll\tv0,v0,0x10\n 20:\tsra\tv0,v0,0x10\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0x10\n 2c:\tdiv\tzero,v0,a2\n 30:\tsll\ta3,a3,0x10\n 34:\tsra\ta3,a3,0x10\n 38:\tbnez\ta2,44 \n 3c:\tnop\n 40:\tbreak\t0x7\n 44:\tli\tat,-1\n 48:\tbne\ta2,at,5c \n 4c:\tlui\tat,0x8000\n 50:\tbne\tv0,at,5c \n 54:\tnop\n 58:\tbreak\t0x6\n 5c:\tmflo\tv0\n 60:\tsll\tv0,v0,0x10\n 64:\tsra\tv0,v0,0x10\n 68:\tslt\tat,a3,v0\n 6c:\tbeqz\tat,80 \n 70:\tnegu\tt7,a3\n 74:\taddu\tt6,v1,a3\n 78:\tjr\tra\n 7c:\tsh\tt6,0(a0)\n 80:\tslt\tat,v0,t7\n 84:\tbeqz\tat,98 \n 88:\taddu\tt9,v1,v0\n 8c:\tsubu\tt8,v1,a3\n 90:\tjr\tra\n 94:\tsh\tt8,0(a0)\n 98:\tsh\tt9,0(a0)\n 9c:\tjr\tra\n a0:\tnop\n\t...\n","proto":{"adds":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 adds\n\n\nContents of section .text:\n 0000 afa50004 afa60008 afa7000c 84830000 ................\n 0010 00052c00 00052c03 00a31023 00021400 ..,...,....#....\n 0020 00021403 00063400 00063403 0046001a ......4...4..F..\n 0030 00073c00 00073c03 14c00002 00000000 ..<...<.........\n 0040 0007000d 2401ffff 14c10004 3c018000 ....$.......<...\n 0050 14410002 00000000 0006000d 00001012 .A..............\n 0060 00021400 00021403 00e2082a 10200004 ...........*. ..\n 0070 00077823 00677021 03e00008 a48e0000 ..x#.gp!........\n 0080 004f082a 10200004 0062c821 0067c023 .O.*. ...b.!.g.#\n 0090 03e00008 a4980000 a4990000 03e00008 ................\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c0fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c0fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000018 00000218 p......)........\n 0010 00000005 00000368 00000001 00000230 .......h.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 00000030 000002d8 ...........0....\n 0040 00000008 00000308 00000001 00000310 ................\n 0050 00000000 00000000 00000001 00000358 ...............X\n 0060 0210f112 f120e128 021140d0 10f03140 ..... .(..@...1@\n 0070 d010f030 11000000 00000000 00000001 ...0............\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000001 0000000d 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000a4 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d316135 32303738 66643466 -ido-1a52078fd4f\n 0140 39646139 332f752e 69006164 64730000 9da93/u.i.adds..\n 0150 61646473 00000000 00000000 00000001 adds............\n 0160 00000000 0000002f 00000000 00000004 ......./........\n 0170 00000000 00000029 00000000 00000000 .......)........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000015 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"nonmatch","source":"void adds(s16 * a0, s32 a1, s32 a2, s32 a3) {\n s32 v0;\n v0 = *a0;\n if (a3 << 16 >> 16 < ((a1 << 16 >> 16) - v0 << 16 >> 16) / (a2 << 16 >> 16) << 16 >> 16) {\n *a0 = v0 + (a3 << 16 >> 16);\n return;\n } else {\n if (((a1 << 16 >> 16) - v0 << 16 >> 16) / (a2 << 16 >> 16) << 16 >> 16 < -(a3 << 16 >> 16)) {\n *a0 = v0 - (a3 << 16 >> 16);\n return;\n } else {\n *a0 = v0 + (((a1 << 16 >> 16) - v0 << 16 >> 16) / (a2 << 16 >> 16) << 16 >> 16);\n return;\n }\n }\n}\n","score":32,"maxScore":44,"compileErrors":null,"breakdown":{"insert":3,"delete":6,"replace":0,"opMismatch":0,"argMismatch":23},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void adds(s16 *arg0, s16 arg1, s16 arg2, s16 arg3) {\n s16 temp_v1;\n s32 temp_lo;\n\n temp_v1 = *arg0;\n temp_lo = (s16) (arg1 - temp_v1) / arg2;\n if (arg3 < (s16) temp_lo) {\n *arg0 = temp_v1 + arg3;\n return;\n }\n if ((s16) temp_lo < -arg3) {\n *arg0 = temp_v1 - arg3;\n return;\n }\n *arg0 = temp_v1 + (s16) temp_lo;\n}\n","score":24,"maxScore":44,"compileErrors":null,"breakdown":{"insert":3,"delete":3,"replace":0,"opMismatch":0,"argMismatch":18},"quality":{"score":96,"lines":15,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":24,"maxScore":44,"ratio":0.5454545454545454,"kinds":{"insert":3,"delete":3,"replace":0,"opMismatch":0,"argMismatch":18}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `adds` — benchmark function af:adds:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel adds\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n sw\t$a3, 12($sp)\n lh\t$v1, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n subu\t$v0, $a1, $v1\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n div\t$zero, $v0, $a2\n sll\t$a3, $a3, 0x10\n sra\t$a3, $a3, 0x10\n bnez\t$a2, .L44\n nop\n break\t0x7\n.L44:\n li\t$at, -1\n bne\t$a2, $at, .L5c\n lui\t$at, 0x8000\n bne\t$v0, $at, .L5c\n nop\n break\t0x6\n.L5c:\n mflo\t$v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slt\t$at, $a3, $v0\n beqz\t$at, .L80\n negu\t$t7, $a3\n addu\t$t6, $v1, $a3\n jr\t$ra\n sh\t$t6, 0($a0)\n.L80:\n slt\t$at, $v0, $t7\n beqz\t$at, .L98\n addu\t$t9, $v1, $v0\n subu\t$t8, $v1, $a3\n jr\t$ra\n sh\t$t8, 0($a0)\n.L98:\n sh\t$t9, 0($a0)\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function adds # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `adds` — benchmark function af:adds:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:adds:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tsw\ta3,12(sp)\n c:\tlh\tv1,0(a0)\n 10:\tsll\ta1,a1,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tsubu\tv0,a1,v1\n 1c:\tsll\tv0,v0,0x10\n 20:\tsra\tv0,v0,0x10\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0x10\n 2c:\tdiv\tzero,v0,a2\n 30:\tsll\ta3,a3,0x10\n 34:\tsra\ta3,a3,0x10\n 38:\tbnez\ta2,44 \n 3c:\tnop\n 40:\tbreak\t0x7\n 44:\tli\tat,-1\n 48:\tbne\ta2,at,5c \n 4c:\tlui\tat,0x8000\n 50:\tbne\tv0,at,5c \n 54:\tnop\n 58:\tbreak\t0x6\n 5c:\tmflo\tv0\n 60:\tsll\tv0,v0,0x10\n 64:\tsra\tv0,v0,0x10\n 68:\tslt\tat,a3,v0\n 6c:\tbeqz\tat,80 \n 70:\tnegu\tt7,a3\n 74:\taddu\tt6,v1,a3\n 78:\tjr\tra\n 7c:\tsh\tt6,0(a0)\n 80:\tslt\tat,v0,t7\n 84:\tbeqz\tat,98 \n 88:\taddu\tt9,v1,v0\n 8c:\tsubu\tt8,v1,a3\n 90:\tjr\tra\n 94:\tsh\tt8,0(a0)\n 98:\tsh\tt9,0(a0)\n 9c:\tjr\tra\n a0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 adds\n\n\nContents of section .text:\n 0000 afa50004 afa60008 afa7000c 84830000 ................\n 0010 00052c00 00052c03 00a31023 00021400 ..,...,....#....\n 0020 00021403 00063400 00063403 0046001a ......4...4..F..\n 0030 00073c00 00073c03 14c00002 00000000 ..<...<.........\n 0040 0007000d 2401ffff 14c10004 3c018000 ....$.......<...\n 0050 14410002 00000000 0006000d 00001012 .A..............\n 0060 00021400 00021403 00e2082a 10200004 ...........*. ..\n 0070 00077823 00677021 03e00008 a48e0000 ..x#.gp!........\n 0080 004f082a 10200004 0062c821 0067c023 .O.*. ...b.!.g.#\n 0090 03e00008 a4980000 a4990000 03e00008 ................\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c0fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c0fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000018 00000218 p......)........\n 0010 00000005 00000368 00000001 00000230 .......h.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 00000030 000002d8 ...........0....\n 0040 00000008 00000308 00000001 00000310 ................\n 0050 00000000 00000000 00000001 00000358 ...............X\n 0060 0210f112 f120e128 021140d0 10f03140 ..... .(..@...1@\n 0070 d010f030 11000000 00000000 00000001 ...0............\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000001 0000000d 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000a4 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d316135 32303738 66643466 -ido-1a52078fd4f\n 0140 39646139 332f752e 69006164 64730000 9da93/u.i.adds..\n 0150 61646473 00000000 00000000 00000001 adds............\n 0160 00000000 0000002f 00000000 00000004 ......./........\n 0170 00000000 00000029 00000000 00000000 .......)........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000015 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"adds\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name adds # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_angle:ido7.1","sym":"chase_angle","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","call","global"],"loc":20,"refSource":"s32 chase_angle(s16* pValue, s16 target, s16 step) {\n if (step != 0) {\n f32 updateScale = game_GameFrame_2F;\n\n if ((s16)(*pValue - target) > 0) {\n step = -step;\n }\n\n *pValue += (s16)(step * updateScale);\n\n if (((s16)(*pValue - target) * step) >= 0) {\n *pValue = target;\n return TRUE;\n }\n } else if (*pValue == target) {\n return TRUE;\n }\n\n return FALSE;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L51-L70","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,98 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tlui\tat,0x0\n 24:\tlwc1\t$f0,0(at)\n 28:\tsubu\tt6,v0,a1\n 2c:\tsll\tt7,t6,0x10\n 30:\tsra\tt8,t7,0x10\n 34:\tblezl\tt8,4c \n 38:\tmtc1\ta2,$f4\n 3c:\tnegu\ta2,a2\n 40:\tsll\ta2,a2,0x10\n 44:\tsra\ta2,a2,0x10\n 48:\tmtc1\ta2,$f4\n 4c:\tnop\n 50:\tcvt.s.w\t$f6,$f4\n 54:\tmul.s\t$f8,$f6,$f0\n 58:\ttrunc.w.s\t$f10,$f8\n 5c:\tmfc1\tt2,$f10\n 60:\tnop\n 64:\taddu\tt3,v0,t2\n 68:\tsh\tt3,0(a0)\n 6c:\tlh\tt4,0(a0)\n 70:\tli\tv0,1\n 74:\tsubu\tt5,t4,a1\n 78:\tsll\tt6,t5,0x10\n 7c:\tsra\tt7,t6,0x10\n 80:\tmultu\tt7,a2\n 84:\tmflo\tt8\n 88:\tbltzl\tt8,b0 \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tsh\ta1,0(a0)\n 98:\tlh\tt9,0(a0)\n 9c:\tbnel\ta1,t9,b0 \n a0:\tmove\tv0,zero\n a4:\tjr\tra\n a8:\tli\tv0,1\n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000c0 .text\n00000000 g F .text\t000000b8 chase_angle\n00000000 O *UND*\t00000004 game_GameFrame_2F\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_HI16 game_GameFrame_2F\n00000024 R_MIPS_LO16 game_GameFrame_2F\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00020 00052c03 84820000 ..4.... ..,.....\n 0020 3c010000 c4200000 00457023 000e7c00 <.... ...Ep#..|.\n 0030 000fc403 5b000005 44862000 00063023 ....[...D. ...0#\n 0040 00063400 00063403 44862000 00000000 ..4...4.D. .....\n 0050 468021a0 46003202 4600428d 440a5000 F.!.F.2.F.B.D.P.\n 0060 00000000 004a5821 a48b0000 848c0000 .....JX!........\n 0070 24020001 01856823 000d7400 000e7c03 $.....h#..t...|.\n 0080 01e60019 0000c012 07020009 00001025 ...............%\n 0090 03e00008 a4850000 84990000 54b90004 ............T...\n 00a0 00001025 03e00008 24020001 00001025 ...%....$......%\n 00b0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300fc76 00000000 . .........v....\n 0010 00000fd1 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300fc76 00000000 00000fd1 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002e 00000010 00000268 p..............h\n 0010 00000006 000003e0 00000001 00000278 ...............x\n 0020 00000004 000002ac 00000000 00000000 ................\n 0030 00000011 000002dc 00000038 00000320 ...........8... \n 0040 00000020 00000358 00000001 00000378 ... ...X.......x\n 0050 00000000 00000000 00000002 000003c0 ................\n 0060 0410f030 f1141228 1020e620 f0321122 ...0...(. . .2.\"\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000004 00000012 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000b8 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d616634 nch-real-ido-af4\n 0130 61653161 35363662 62633664 312f752e ae1a566bbc6d1/u.\n 0140 69006368 6173655f 616e676c 65000000 i.chase_angle...\n 0150 63686173 655f616e 676c6500 67616d65 chase_angle.game\n 0160 5f47616d 65467261 6d655f32 46000000 _GameFrame_2F...\n 0170 00000000 00000001 00000000 00000036 ...............6\n 0180 00000000 00000004 00000000 0000002e ................\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000010 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000c ..... ..........\n 01d0 00000000 04cfffff 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 7fffffff 00000000 7fffffff 00000001 ................\n 0200 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'chase_angle' — lift: cannot lift 'chase_angle': unmodelled control transfer 'blezl' at 0x34 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta2,8(sp) */\n/* 4:\tsll\ta2,a2,0x10 */\n/* 8:\tsw\ta1,4(sp) */\n/* c:\tsll\ta1,a1,0x10 */\n/* 10:\tsra\ta2,a2,0x10 */\n/* 14:\tbeqz\ta2,98 */\n/* 18:\tsra\ta1,a1,0x10 */\n/* 1c:\tlh\tv0,0(a0) */\n/* 20:\tlui\tat,0x0 */\n/* 24:\tlwc1\t$f0,0(at) */\n/* 28:\tsubu\tt6,v0,a1 */\n/* 2c:\tsll\tt7,t6,0x10 */\n/* 30:\tsra\tt8,t7,0x10 */\n/* 34:\tblezl\tt8,4c */\n/* 38:\tmtc1\ta2,$f4 */\n/* 3c:\tnegu\ta2,a2 */\n/* 40:\tsll\ta2,a2,0x10 */\n/* 44:\tsra\ta2,a2,0x10 */\n/* 48:\tmtc1\ta2,$f4 */\n/* 4c:\tnop */\n/* 50:\tcvt.s.w\t$f6,$f4 */\n/* 54:\tmul.s\t$f8,$f6,$f0 */\n/* 58:\ttrunc.w.s\t$f10,$f8 */\n/* 5c:\tmfc1\tt2,$f10 */\n/* 60:\tnop */\n/* 64:\taddu\tt3,v0,t2 */\n/* 68:\tsh\tt3,0(a0) */\n/* 6c:\tlh\tt4,0(a0) */\n/* 70:\tli\tv0,1 */\n/* 74:\tsubu\tt5,t4,a1 */\n/* 78:\tsll\tt6,t5,0x10 */\n/* 7c:\tsra\tt7,t6,0x10 */\n/* 80:\tmultu\tt7,a2 */\n/* 84:\tmflo\tt8 */\n/* 88:\tbltzl\tt8,b0 */\n/* 8c:\tmove\tv0,zero */\n/* 90:\tjr\tra */\n/* 94:\tsh\ta1,0(a0) */\n/* 98:\tlh\tt9,0(a0) */\n/* 9c:\tbnel\ta1,t9,b0 */\n/* a0:\tmove\tv0,zero */\n/* a4:\tjr\tra */\n/* a8:\tli\tv0,1 */\n/* ac:\tmove\tv0,zero */\n/* b0:\tjr\tra */\n/* b4:\tnop */\n/* \t... */\nvoid chase_angle(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'chase_angle': unmodelled control transfer 'blezl' at 0x34 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":55,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'chase_angle': unmodelled control transfer 'blezl' at 0x34 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern f32 game_GameFrame_2F;\n\ns32 chase_angle(s16 *arg0, s16 arg1, s16 arg2) {\n s16 temp_v0;\n s16 var_a2;\n\n var_a2 = arg2;\n if (var_a2 != 0) {\n temp_v0 = *arg0;\n if ((s16) (temp_v0 - arg1) > 0) {\n var_a2 *= -1;\n }\n *arg0 = temp_v0 + (s32) ((f32) var_a2 * game_GameFrame_2F);\n if (((s16) (*arg0 - arg1) * var_a2) >= 0) {\n *arg0 = arg1;\n return 1;\n }\n /* Duplicate return node #7. Try simplifying control flow for better match */\n return 0;\n }\n if (arg1 == *arg0) {\n return 1;\n }\n return 0;\n}\n","score":47,"maxScore":62,"compileErrors":null,"breakdown":{"insert":16,"delete":13,"replace":2,"opMismatch":0,"argMismatch":16},"quality":{"score":98,"lines":23,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":47,"maxScore":62,"ratio":0.7580645161290323,"kinds":{"insert":16,"delete":13,"replace":2,"opMismatch":0,"argMismatch":16}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_angle` — benchmark function af:chase_angle:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_angle\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .L98\n sra\t$a1, $a1, 0x10\n lh\t$v0, 0($a0)\n lui\t$at, %hi(game_GameFrame_2F)\n lwc1\t$f0, %lo(game_GameFrame_2F)($at)\n subu\t$t6, $v0, $a1\n sll\t$t7, $t6, 0x10\n sra\t$t8, $t7, 0x10\n blezl\t$t8, .L4c\n mtc1\t$a2, $f4\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n mtc1\t$a2, $f4\n.L4c:\n nop\n cvt.s.w\t$f6, $f4\n mul.s\t$f8, $f6, $f0\n trunc.w.s\t$f10, $f8\n mfc1\t$t2, $f10\n nop\n addu\t$t3, $v0, $t2\n sh\t$t3, 0($a0)\n lh\t$t4, 0($a0)\n li\t$v0, 1\n subu\t$t5, $t4, $a1\n sll\t$t6, $t5, 0x10\n sra\t$t7, $t6, 0x10\n multu\t$t7, $a2\n mflo\t$t8\n bltzl\t$t8, .Lb0\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.L98:\n lh\t$t9, 0($a0)\n bnel\t$a1, $t9, .Lb0\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.Lb0:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_angle # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_angle` — benchmark function af:chase_angle:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_angle:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,98 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tlui\tat,0x0\n 24:\tlwc1\t$f0,0(at)\n 28:\tsubu\tt6,v0,a1\n 2c:\tsll\tt7,t6,0x10\n 30:\tsra\tt8,t7,0x10\n 34:\tblezl\tt8,4c \n 38:\tmtc1\ta2,$f4\n 3c:\tnegu\ta2,a2\n 40:\tsll\ta2,a2,0x10\n 44:\tsra\ta2,a2,0x10\n 48:\tmtc1\ta2,$f4\n 4c:\tnop\n 50:\tcvt.s.w\t$f6,$f4\n 54:\tmul.s\t$f8,$f6,$f0\n 58:\ttrunc.w.s\t$f10,$f8\n 5c:\tmfc1\tt2,$f10\n 60:\tnop\n 64:\taddu\tt3,v0,t2\n 68:\tsh\tt3,0(a0)\n 6c:\tlh\tt4,0(a0)\n 70:\tli\tv0,1\n 74:\tsubu\tt5,t4,a1\n 78:\tsll\tt6,t5,0x10\n 7c:\tsra\tt7,t6,0x10\n 80:\tmultu\tt7,a2\n 84:\tmflo\tt8\n 88:\tbltzl\tt8,b0 \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tsh\ta1,0(a0)\n 98:\tlh\tt9,0(a0)\n 9c:\tbnel\ta1,t9,b0 \n a0:\tmove\tv0,zero\n a4:\tjr\tra\n a8:\tli\tv0,1\n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000c0 .text\n00000000 g F .text\t000000b8 chase_angle\n00000000 O *UND*\t00000004 game_GameFrame_2F\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_HI16 game_GameFrame_2F\n00000024 R_MIPS_LO16 game_GameFrame_2F\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00020 00052c03 84820000 ..4.... ..,.....\n 0020 3c010000 c4200000 00457023 000e7c00 <.... ...Ep#..|.\n 0030 000fc403 5b000005 44862000 00063023 ....[...D. ...0#\n 0040 00063400 00063403 44862000 00000000 ..4...4.D. .....\n 0050 468021a0 46003202 4600428d 440a5000 F.!.F.2.F.B.D.P.\n 0060 00000000 004a5821 a48b0000 848c0000 .....JX!........\n 0070 24020001 01856823 000d7400 000e7c03 $.....h#..t...|.\n 0080 01e60019 0000c012 07020009 00001025 ...............%\n 0090 03e00008 a4850000 84990000 54b90004 ............T...\n 00a0 00001025 03e00008 24020001 00001025 ...%....$......%\n 00b0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300fc76 00000000 . .........v....\n 0010 00000fd1 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300fc76 00000000 00000fd1 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002e 00000010 00000268 p..............h\n 0010 00000006 000003e0 00000001 00000278 ...............x\n 0020 00000004 000002ac 00000000 00000000 ................\n 0030 00000011 000002dc 00000038 00000320 ...........8... \n 0040 00000020 00000358 00000001 00000378 ... ...X.......x\n 0050 00000000 00000000 00000002 000003c0 ................\n 0060 0410f030 f1141228 1020e620 f0321122 ...0...(. . .2.\"\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000004 00000012 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000b8 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d616634 nch-real-ido-af4\n 0130 61653161 35363662 62633664 312f752e ae1a566bbc6d1/u.\n 0140 69006368 6173655f 616e676c 65000000 i.chase_angle...\n 0150 63686173 655f616e 676c6500 67616d65 chase_angle.game\n 0160 5f47616d 65467261 6d655f32 46000000 _GameFrame_2F...\n 0170 00000000 00000001 00000000 00000036 ...............6\n 0180 00000000 00000004 00000000 0000002e ................\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000010 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000c ..... ..........\n 01d0 00000000 04cfffff 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 7fffffff 00000000 7fffffff 00000001 ................\n 0200 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_angle # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_f:ido7.1","sym":"chase_f","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","call"],"loc":19,"refSource":"s32 chase_f(f32* pValue, f32 target, f32 step) {\n if (step) {\n if (*pValue > target) {\n step = -step;\n }\n\n *pValue += step;\n\n if ((step * (*pValue - target)) >= 0.0f) {\n *pValue = target;\n return TRUE;\n }\n } else {\n if (*pValue == target) {\n return TRUE;\n }\n }\n return FALSE;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L92-L110","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta2,$f12\n 4:\tmtc1\tzero,$f4\n 8:\tmtc1\ta1,$f14\n c:\tc.eq.s\t$f12,$f4\n 10:\tnop\n 14:\tbc1tl\t6c \n 18:\tlwc1\t$f4,0(a0)\n 1c:\tlwc1\t$f0,0(a0)\n 20:\tli\tv0,1\n 24:\tc.lt.s\t$f14,$f0\n 28:\tnop\n 2c:\tbc1fl\t3c \n 30:\tadd.s\t$f6,$f0,$f12\n 34:\tneg.s\t$f12,$f12\n 38:\tadd.s\t$f6,$f0,$f12\n 3c:\tmtc1\tzero,$f18\n 40:\tswc1\t$f6,0(a0)\n 44:\tlwc1\t$f8,0(a0)\n 48:\tsub.s\t$f10,$f8,$f14\n 4c:\tmul.s\t$f16,$f10,$f12\n 50:\tc.le.s\t$f18,$f16\n 54:\tnop\n 58:\tbc1fl\t88 \n 5c:\tmove\tv0,zero\n 60:\tjr\tra\n 64:\tswc1\t$f14,0(a0)\n 68:\tlwc1\t$f4,0(a0)\n 6c:\tc.eq.s\t$f14,$f4\n 70:\tnop\n 74:\tbc1fl\t88 \n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tli\tv0,1\n 84:\tmove\tv0,zero\n 88:\tjr\tra\n 8c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000090 chase_f\n\n\nContents of section .text:\n 0000 44866000 44802000 44857000 46046032 D.`.D. .D.p.F.`2\n 0010 00000000 45030015 c4840000 c4800000 ....E...........\n 0020 24020001 4600703c 00000000 45020003 $...F.p<....E...\n 0030 460c0180 46006307 460c0180 44809000 F...F.c.F...D...\n 0040 e4860000 c4880000 460e4281 460c5402 ........F.B.F.T.\n 0050 4610903e 00000000 4502000b 00001025 F..>....E......%\n 0060 03e00008 e48e0000 c4840000 46047032 ............F.p2\n 0070 00000000 45020004 00001025 03e00008 ....E......%....\n 0080 24020001 00001025 03e00008 00000000 $......%........\nContents of section .options:\n 0000 01200000 00000000 80000074 00000000 . .........t....\n 0010 00077dd1 00000000 00000000 00007ff0 ..}.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00077dd1 00000000 ...t......}.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000024 00000014 000001f8 p......$........\n 0010 00000005 00000348 00000001 0000020c .......H........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000034 000002b4 .......p...4....\n 0040 00000008 000002e8 00000001 000002f0 ................\n 0050 00000000 00000000 00000001 00000338 ...............8\n 0060 0010f013 1060a310 2010f016 20f04411 .....`.. ... .D.\n 0070 32000000 00000000 00000001 00000000 2...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000090 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d383936 32613031 66623762 32616536 -8962a01fb7b2ae6\n 0140 312f752e 69006368 6173655f 66000000 1/u.i.chase_f...\n 0150 63686173 655f6600 00000000 00000001 chase_f.........\n 0160 00000000 00000032 00000000 00000004 .......2........\n 0170 00000000 00000024 00000000 00000000 .......$........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000011 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'chase_f' — lift: cannot lift 'chase_f': unmodelled control transfer 'bc1tl' at 0x14 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta2,$f12 */\n/* 4:\tmtc1\tzero,$f4 */\n/* 8:\tmtc1\ta1,$f14 */\n/* c:\tc.eq.s\t$f12,$f4 */\n/* 10:\tnop */\n/* 14:\tbc1tl\t6c */\n/* 18:\tlwc1\t$f4,0(a0) */\n/* 1c:\tlwc1\t$f0,0(a0) */\n/* 20:\tli\tv0,1 */\n/* 24:\tc.lt.s\t$f14,$f0 */\n/* 28:\tnop */\n/* 2c:\tbc1fl\t3c */\n/* 30:\tadd.s\t$f6,$f0,$f12 */\n/* 34:\tneg.s\t$f12,$f12 */\n/* 38:\tadd.s\t$f6,$f0,$f12 */\n/* 3c:\tmtc1\tzero,$f18 */\n/* 40:\tswc1\t$f6,0(a0) */\n/* 44:\tlwc1\t$f8,0(a0) */\n/* 48:\tsub.s\t$f10,$f8,$f14 */\n/* 4c:\tmul.s\t$f16,$f10,$f12 */\n/* 50:\tc.le.s\t$f18,$f16 */\n/* 54:\tnop */\n/* 58:\tbc1fl\t88 */\n/* 5c:\tmove\tv0,zero */\n/* 60:\tjr\tra */\n/* 64:\tswc1\t$f14,0(a0) */\n/* 68:\tlwc1\t$f4,0(a0) */\n/* 6c:\tc.eq.s\t$f14,$f4 */\n/* 70:\tnop */\n/* 74:\tbc1fl\t88 */\n/* 78:\tmove\tv0,zero */\n/* 7c:\tjr\tra */\n/* 80:\tli\tv0,1 */\n/* 84:\tmove\tv0,zero */\n/* 88:\tjr\tra */\n/* 8c:\tnop */\nvoid chase_f(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'chase_f': unmodelled control transfer 'bc1tl' at 0x14 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":44,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'chase_f': unmodelled control transfer 'bc1tl' at 0x14 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 chase_f(f32 *arg0, f32 arg1, f32 arg2) {\n f32 temp_f0;\n f32 var_f12;\n\n var_f12 = arg2;\n if (var_f12 != 0.0f) {\n temp_f0 = *arg0;\n if (arg1 < temp_f0) {\n var_f12 = -var_f12;\n }\n *arg0 = temp_f0 + var_f12;\n if (((*arg0 - arg1) * var_f12) >= 0.0f) {\n *arg0 = arg1;\n return 1;\n }\n /* Duplicate return node #7. Try simplifying control flow for better match */\n return 0;\n }\n if (arg1 == *arg0) {\n return 1;\n }\n return 0;\n}\n","score":26,"maxScore":41,"compileErrors":null,"breakdown":{"insert":5,"delete":4,"replace":4,"opMismatch":0,"argMismatch":13},"quality":{"score":100,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":26,"maxScore":41,"ratio":0.6341463414634146,"kinds":{"insert":5,"delete":4,"replace":4,"opMismatch":0,"argMismatch":13}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_f` — benchmark function af:chase_f:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_f\n mtc1\t$a2, $f12\n mtc1\t$zero, $f4\n mtc1\t$a1, $f14\n c.eq.s\t$f12, $f4\n nop\n bc1tl\t.L6c\n lwc1\t$f4, 0($a0)\n lwc1\t$f0, 0($a0)\n li\t$v0, 1\n c.lt.s\t$f14, $f0\n nop\n bc1fl\t.L3c\n add.s\t$f6, $f0, $f12\n neg.s\t$f12, $f12\n add.s\t$f6, $f0, $f12\n.L3c:\n mtc1\t$zero, $f18\n swc1\t$f6, 0($a0)\n lwc1\t$f8, 0($a0)\n sub.s\t$f10, $f8, $f14\n mul.s\t$f16, $f10, $f12\n c.le.s\t$f18, $f16\n nop\n bc1fl\t.L88\n move\t$v0, $zero\n jr\t$ra\n swc1\t$f14, 0($a0)\n lwc1\t$f4, 0($a0)\n.L6c:\n c.eq.s\t$f14, $f4\n nop\n bc1fl\t.L88\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L88:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_f # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_f` — benchmark function af:chase_f:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_f:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta2,$f12\n 4:\tmtc1\tzero,$f4\n 8:\tmtc1\ta1,$f14\n c:\tc.eq.s\t$f12,$f4\n 10:\tnop\n 14:\tbc1tl\t6c \n 18:\tlwc1\t$f4,0(a0)\n 1c:\tlwc1\t$f0,0(a0)\n 20:\tli\tv0,1\n 24:\tc.lt.s\t$f14,$f0\n 28:\tnop\n 2c:\tbc1fl\t3c \n 30:\tadd.s\t$f6,$f0,$f12\n 34:\tneg.s\t$f12,$f12\n 38:\tadd.s\t$f6,$f0,$f12\n 3c:\tmtc1\tzero,$f18\n 40:\tswc1\t$f6,0(a0)\n 44:\tlwc1\t$f8,0(a0)\n 48:\tsub.s\t$f10,$f8,$f14\n 4c:\tmul.s\t$f16,$f10,$f12\n 50:\tc.le.s\t$f18,$f16\n 54:\tnop\n 58:\tbc1fl\t88 \n 5c:\tmove\tv0,zero\n 60:\tjr\tra\n 64:\tswc1\t$f14,0(a0)\n 68:\tlwc1\t$f4,0(a0)\n 6c:\tc.eq.s\t$f14,$f4\n 70:\tnop\n 74:\tbc1fl\t88 \n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tli\tv0,1\n 84:\tmove\tv0,zero\n 88:\tjr\tra\n 8c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000090 chase_f\n\n\nContents of section .text:\n 0000 44866000 44802000 44857000 46046032 D.`.D. .D.p.F.`2\n 0010 00000000 45030015 c4840000 c4800000 ....E...........\n 0020 24020001 4600703c 00000000 45020003 $...F.p<....E...\n 0030 460c0180 46006307 460c0180 44809000 F...F.c.F...D...\n 0040 e4860000 c4880000 460e4281 460c5402 ........F.B.F.T.\n 0050 4610903e 00000000 4502000b 00001025 F..>....E......%\n 0060 03e00008 e48e0000 c4840000 46047032 ............F.p2\n 0070 00000000 45020004 00001025 03e00008 ....E......%....\n 0080 24020001 00001025 03e00008 00000000 $......%........\nContents of section .options:\n 0000 01200000 00000000 80000074 00000000 . .........t....\n 0010 00077dd1 00000000 00000000 00007ff0 ..}.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00077dd1 00000000 ...t......}.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000024 00000014 000001f8 p......$........\n 0010 00000005 00000348 00000001 0000020c .......H........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000034 000002b4 .......p...4....\n 0040 00000008 000002e8 00000001 000002f0 ................\n 0050 00000000 00000000 00000001 00000338 ...............8\n 0060 0010f013 1060a310 2010f016 20f04411 .....`.. ... .D.\n 0070 32000000 00000000 00000001 00000000 2...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000090 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d383936 32613031 66623762 32616536 -8962a01fb7b2ae6\n 0140 312f752e 69006368 6173655f 66000000 1/u.i.chase_f...\n 0150 63686173 655f6600 00000000 00000001 chase_f.........\n 0160 00000000 00000032 00000000 00000004 .......2........\n 0170 00000000 00000024 00000000 00000000 .......$........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000011 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_f # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_f3:ido7.1","sym":"chase_f3","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","call"],"loc":20,"refSource":"s32 chase_f3(f32* pValue, f32 target, f32 incrStep, f32 decrStep) {\n f32 step = (target >= *pValue) ? incrStep : decrStep;\n\n if (step != 0.0f) {\n if (target < *pValue) {\n step = -step;\n }\n\n *pValue += step;\n\n if (((*pValue - target) * step) >= 0) {\n *pValue = target;\n return 1;\n }\n } else if (target == *pValue) {\n return 1;\n }\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L175-L194","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tmtc1\tzero,$f4\n 14:\tc.le.s\t$f0,$f12\n 18:\tlwc1\t$f2,12(sp)\n 1c:\tbc1f\t2c \n 20:\tnop\n 24:\tb\t2c \n 28:\tmov.s\t$f2,$f14\n 2c:\tc.eq.s\t$f2,$f4\n 30:\tnop\n 34:\tbc1tl\t84 \n 38:\tc.eq.s\t$f12,$f0\n 3c:\tc.lt.s\t$f12,$f0\n 40:\tli\tv0,1\n 44:\tbc1fl\t54 \n 48:\tadd.s\t$f6,$f0,$f2\n 4c:\tneg.s\t$f2,$f2\n 50:\tadd.s\t$f6,$f0,$f2\n 54:\tmtc1\tzero,$f18\n 58:\tswc1\t$f6,0(a0)\n 5c:\tlwc1\t$f8,0(a0)\n 60:\tsub.s\t$f10,$f8,$f12\n 64:\tmul.s\t$f16,$f10,$f2\n 68:\tc.le.s\t$f18,$f16\n 6c:\tnop\n 70:\tbc1fl\t9c \n 74:\tmove\tv0,zero\n 78:\tjr\tra\n 7c:\tswc1\t$f12,0(a0)\n 80:\tc.eq.s\t$f12,$f0\n 84:\tnop\n 88:\tbc1fl\t9c \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 chase_f3\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 44802000 460c003e c7a2000c 45000003 D. .F..>....E...\n 0020 00000000 10000001 46007086 46041032 ........F.p.F..2\n 0030 00000000 45030013 46006032 4600603c ....E...F.`2F.`<\n 0040 24020001 45020003 46020180 46001087 $...E...F...F...\n 0050 46020180 44809000 e4860000 c4880000 F...D...........\n 0060 460c4281 46025402 4610903e 00000000 F.B.F.T.F..>....\n 0070 4502000a 00001025 03e00008 e48c0000 E......%........\n 0080 46006032 00000000 45020004 00001025 F.`2....E......%\n 0090 03e00008 24020001 00001025 03e00008 ....$......%....\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000f4 00000000 . ..............\n 0010 00075ddd 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f4 00000000 00075ddd 00000000 ..........].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000014 00000218 p......)........\n 0010 00000005 0000036c 00000001 0000022c .......l.......,\n 0020 00000004 00000260 00000000 00000000 .......`........\n 0030 00000011 00000290 00000034 000002d4 ...........4....\n 0040 0000000c 00000308 00000001 00000314 ................\n 0050 00000000 00000000 00000001 0000035c ...............\\\n 0060 0110f020 f5131060 a1102010 f01620f0 ... ...`.. ... .\n 0070 33112200 00000000 00000001 00000000 3.\".............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000010 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000a4 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d626264 61656530 30653961 31393062 -bbdaee00e9a190b\n 0140 382f752e 69006368 6173655f 66330000 8/u.i.chase_f3..\n 0150 63686173 655f6633 00000000 00000000 chase_f3........\n 0160 00000001 00000000 00000033 00000000 ...........3....\n 0170 00000004 00000000 00000029 00000000 ...........)....\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000013 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'chase_f3' — lift: cannot lift 'chase_f3': unmodelled control transfer 'bc1f' at 0x1c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta3,12(sp) */\n/* 4:\tmtc1\ta1,$f12 */\n/* 8:\tlwc1\t$f0,0(a0) */\n/* c:\tmtc1\ta2,$f14 */\n/* 10:\tmtc1\tzero,$f4 */\n/* 14:\tc.le.s\t$f0,$f12 */\n/* 18:\tlwc1\t$f2,12(sp) */\n/* 1c:\tbc1f\t2c */\n/* 20:\tnop */\n/* 24:\tb\t2c */\n/* 28:\tmov.s\t$f2,$f14 */\n/* 2c:\tc.eq.s\t$f2,$f4 */\n/* 30:\tnop */\n/* 34:\tbc1tl\t84 */\n/* 38:\tc.eq.s\t$f12,$f0 */\n/* 3c:\tc.lt.s\t$f12,$f0 */\n/* 40:\tli\tv0,1 */\n/* 44:\tbc1fl\t54 */\n/* 48:\tadd.s\t$f6,$f0,$f2 */\n/* 4c:\tneg.s\t$f2,$f2 */\n/* 50:\tadd.s\t$f6,$f0,$f2 */\n/* 54:\tmtc1\tzero,$f18 */\n/* 58:\tswc1\t$f6,0(a0) */\n/* 5c:\tlwc1\t$f8,0(a0) */\n/* 60:\tsub.s\t$f10,$f8,$f12 */\n/* 64:\tmul.s\t$f16,$f10,$f2 */\n/* 68:\tc.le.s\t$f18,$f16 */\n/* 6c:\tnop */\n/* 70:\tbc1fl\t9c */\n/* 74:\tmove\tv0,zero */\n/* 78:\tjr\tra */\n/* 7c:\tswc1\t$f12,0(a0) */\n/* 80:\tc.eq.s\t$f12,$f0 */\n/* 84:\tnop */\n/* 88:\tbc1fl\t9c */\n/* 8c:\tmove\tv0,zero */\n/* 90:\tjr\tra */\n/* 94:\tli\tv0,1 */\n/* 98:\tmove\tv0,zero */\n/* 9c:\tjr\tra */\n/* a0:\tnop */\n/* \t... */\nvoid chase_f3(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'chase_f3': unmodelled control transfer 'bc1f' at 0x1c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":50,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'chase_f3': unmodelled control transfer 'bc1f' at 0x1c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 chase_f3(f32 *arg0, f32 arg1, f32 arg2, f32 arg3) {\n f32 temp_f0;\n f32 var_f2;\n\n temp_f0 = *arg0;\n var_f2 = arg3;\n if (temp_f0 <= arg1) {\n var_f2 = arg2;\n }\n if (var_f2 != 0.0f) {\n if (arg1 < temp_f0) {\n var_f2 = -var_f2;\n }\n *arg0 = temp_f0 + var_f2;\n if (((*arg0 - arg1) * var_f2) >= 0.0f) {\n *arg0 = arg1;\n return 1;\n }\n /* Duplicate return node #9. Try simplifying control flow for better match */\n return 0;\n }\n if (arg1 == temp_f0) {\n return 1;\n }\n return 0;\n}\n","score":33,"maxScore":47,"compileErrors":null,"breakdown":{"insert":6,"delete":8,"replace":4,"opMismatch":0,"argMismatch":15},"quality":{"score":100,"lines":25,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":33,"maxScore":47,"ratio":0.7021276595744681,"kinds":{"insert":6,"delete":8,"replace":4,"opMismatch":0,"argMismatch":15}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_f3` — benchmark function af:chase_f3:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_f3\n sw\t$a3, 12($sp)\n mtc1\t$a1, $f12\n lwc1\t$f0, 0($a0)\n mtc1\t$a2, $f14\n mtc1\t$zero, $f4\n c.le.s\t$f0, $f12\n lwc1\t$f2, 12($sp)\n bc1f\t.L2c\n nop\n b\t.L2c\n mov.s\t$f2, $f14\n.L2c:\n c.eq.s\t$f2, $f4\n nop\n bc1tl\t.L84\n c.eq.s\t$f12, $f0\n c.lt.s\t$f12, $f0\n li\t$v0, 1\n bc1fl\t.L54\n add.s\t$f6, $f0, $f2\n neg.s\t$f2, $f2\n add.s\t$f6, $f0, $f2\n.L54:\n mtc1\t$zero, $f18\n swc1\t$f6, 0($a0)\n lwc1\t$f8, 0($a0)\n sub.s\t$f10, $f8, $f12\n mul.s\t$f16, $f10, $f2\n c.le.s\t$f18, $f16\n nop\n bc1fl\t.L9c\n move\t$v0, $zero\n jr\t$ra\n swc1\t$f12, 0($a0)\n c.eq.s\t$f12, $f0\n.L84:\n nop\n bc1fl\t.L9c\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L9c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_f3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_f3` — benchmark function af:chase_f3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_f3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tmtc1\tzero,$f4\n 14:\tc.le.s\t$f0,$f12\n 18:\tlwc1\t$f2,12(sp)\n 1c:\tbc1f\t2c \n 20:\tnop\n 24:\tb\t2c \n 28:\tmov.s\t$f2,$f14\n 2c:\tc.eq.s\t$f2,$f4\n 30:\tnop\n 34:\tbc1tl\t84 \n 38:\tc.eq.s\t$f12,$f0\n 3c:\tc.lt.s\t$f12,$f0\n 40:\tli\tv0,1\n 44:\tbc1fl\t54 \n 48:\tadd.s\t$f6,$f0,$f2\n 4c:\tneg.s\t$f2,$f2\n 50:\tadd.s\t$f6,$f0,$f2\n 54:\tmtc1\tzero,$f18\n 58:\tswc1\t$f6,0(a0)\n 5c:\tlwc1\t$f8,0(a0)\n 60:\tsub.s\t$f10,$f8,$f12\n 64:\tmul.s\t$f16,$f10,$f2\n 68:\tc.le.s\t$f18,$f16\n 6c:\tnop\n 70:\tbc1fl\t9c \n 74:\tmove\tv0,zero\n 78:\tjr\tra\n 7c:\tswc1\t$f12,0(a0)\n 80:\tc.eq.s\t$f12,$f0\n 84:\tnop\n 88:\tbc1fl\t9c \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 chase_f3\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 44802000 460c003e c7a2000c 45000003 D. .F..>....E...\n 0020 00000000 10000001 46007086 46041032 ........F.p.F..2\n 0030 00000000 45030013 46006032 4600603c ....E...F.`2F.`<\n 0040 24020001 45020003 46020180 46001087 $...E...F...F...\n 0050 46020180 44809000 e4860000 c4880000 F...D...........\n 0060 460c4281 46025402 4610903e 00000000 F.B.F.T.F..>....\n 0070 4502000a 00001025 03e00008 e48c0000 E......%........\n 0080 46006032 00000000 45020004 00001025 F.`2....E......%\n 0090 03e00008 24020001 00001025 03e00008 ....$......%....\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000f4 00000000 . ..............\n 0010 00075ddd 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f4 00000000 00075ddd 00000000 ..........].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000014 00000218 p......)........\n 0010 00000005 0000036c 00000001 0000022c .......l.......,\n 0020 00000004 00000260 00000000 00000000 .......`........\n 0030 00000011 00000290 00000034 000002d4 ...........4....\n 0040 0000000c 00000308 00000001 00000314 ................\n 0050 00000000 00000000 00000001 0000035c ...............\\\n 0060 0110f020 f5131060 a1102010 f01620f0 ... ...`.. ... .\n 0070 33112200 00000000 00000001 00000000 3.\".............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000010 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000a4 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d626264 61656530 30653961 31393062 -bbdaee00e9a190b\n 0140 382f752e 69006368 6173655f 66330000 8/u.i.chase_f3..\n 0150 63686173 655f6633 00000000 00000000 chase_f3........\n 0160 00000001 00000000 00000033 00000000 ...........3....\n 0170 00000004 00000000 00000029 00000000 ...........)....\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000013 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_f3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_s:ido7.1","sym":"chase_s","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch","arithmetic","pointer"],"loc":19,"refSource":"s32 chase_s(s16* pValue, s16 target, s16 step) {\n if (step) {\n if (*pValue > target) {\n step = -step;\n }\n\n *pValue += step;\n\n if ((step * (*pValue - target)) >= 0) {\n *pValue = target;\n return TRUE;\n }\n } else {\n if (*pValue == target) {\n return TRUE;\n }\n }\n return FALSE;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L72-L90","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,64 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tslt\tat,a1,v0\n 24:\tbeqzl\tat,3c \n 28:\taddu\tt6,v0,a2\n 2c:\tnegu\ta2,a2\n 30:\tsll\ta2,a2,0x10\n 34:\tsra\ta2,a2,0x10\n 38:\taddu\tt6,v0,a2\n 3c:\tsh\tt6,0(a0)\n 40:\tlh\tt7,0(a0)\n 44:\tli\tv0,1\n 48:\tsubu\tt8,t7,a1\n 4c:\tmultu\tt8,a2\n 50:\tmflo\tt9\n 54:\tbltzl\tt9,7c \n 58:\tmove\tv0,zero\n 5c:\tjr\tra\n 60:\tsh\ta1,0(a0)\n 64:\tlh\tt0,0(a0)\n 68:\tbnel\ta1,t0,7c \n 6c:\tmove\tv0,zero\n 70:\tjr\tra\n 74:\tli\tv0,1\n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000084 chase_s\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00013 00052c03 84820000 ..4.......,.....\n 0020 00a2082a 50200005 00467021 00063023 ...*P ...Fp!..0#\n 0030 00063400 00063403 00467021 a48e0000 ..4...4..Fp!....\n 0040 848f0000 24020001 01e5c023 03060019 ....$......#....\n 0050 0000c812 07220009 00001025 03e00008 .....\".....%....\n 0060 a4850000 84880000 54a80004 00001025 ........T......%\n 0070 03e00008 24020001 00001025 03e00008 ....$......%....\n 0080 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c176 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c176 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000021 00000010 000001f8 p......!........\n 0010 00000005 00000344 00000001 00000208 .......D........\n 0020 00000004 0000023c 00000000 00000000 .......<........\n 0030 00000011 0000026c 00000034 000002b0 .......l...4....\n 0040 00000008 000002e4 00000001 000002ec ................\n 0050 00000000 00000000 00000001 00000334 ...............4\n 0060 0410f023 12211020 e420f042 11320000 ...#.!. . .B.2..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000011 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000084 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d663334 nch-real-ido-f34\n 0130 37633865 38353533 31393935 392f752e 7c8e855319959/u.\n 0140 69006368 6173655f 73000000 63686173 i.chase_s...chas\n 0150 655f7300 00000000 00000001 00000000 e_s.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000021 00000000 00000000 00000001 ...!............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000e 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'chase_s' — lift: cannot lift 'chase_s': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta2,8(sp) */\n/* 4:\tsll\ta2,a2,0x10 */\n/* 8:\tsw\ta1,4(sp) */\n/* c:\tsll\ta1,a1,0x10 */\n/* 10:\tsra\ta2,a2,0x10 */\n/* 14:\tbeqz\ta2,64 */\n/* 18:\tsra\ta1,a1,0x10 */\n/* 1c:\tlh\tv0,0(a0) */\n/* 20:\tslt\tat,a1,v0 */\n/* 24:\tbeqzl\tat,3c */\n/* 28:\taddu\tt6,v0,a2 */\n/* 2c:\tnegu\ta2,a2 */\n/* 30:\tsll\ta2,a2,0x10 */\n/* 34:\tsra\ta2,a2,0x10 */\n/* 38:\taddu\tt6,v0,a2 */\n/* 3c:\tsh\tt6,0(a0) */\n/* 40:\tlh\tt7,0(a0) */\n/* 44:\tli\tv0,1 */\n/* 48:\tsubu\tt8,t7,a1 */\n/* 4c:\tmultu\tt8,a2 */\n/* 50:\tmflo\tt9 */\n/* 54:\tbltzl\tt9,7c */\n/* 58:\tmove\tv0,zero */\n/* 5c:\tjr\tra */\n/* 60:\tsh\ta1,0(a0) */\n/* 64:\tlh\tt0,0(a0) */\n/* 68:\tbnel\ta1,t0,7c */\n/* 6c:\tmove\tv0,zero */\n/* 70:\tjr\tra */\n/* 74:\tli\tv0,1 */\n/* 78:\tmove\tv0,zero */\n/* 7c:\tjr\tra */\n/* 80:\tnop */\n/* \t... */\nvoid chase_s(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'chase_s': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":42,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'chase_s': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 chase_s(s16 *arg0, s16 arg1, s16 arg2) {\n s16 temp_v0;\n s16 var_a2;\n\n var_a2 = arg2;\n if (var_a2 != 0) {\n temp_v0 = *arg0;\n if (arg1 < temp_v0) {\n var_a2 *= -1;\n }\n *arg0 = temp_v0 + var_a2;\n if (((*arg0 - arg1) * var_a2) >= 0) {\n *arg0 = arg1;\n return 1;\n }\n /* Duplicate return node #7. Try simplifying control flow for better match */\n return 0;\n }\n if (arg1 == *arg0) {\n return 1;\n }\n return 0;\n}\n","score":22,"maxScore":40,"compileErrors":null,"breakdown":{"insert":7,"delete":3,"replace":2,"opMismatch":0,"argMismatch":10},"quality":{"score":100,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":22,"maxScore":40,"ratio":0.55,"kinds":{"insert":7,"delete":3,"replace":2,"opMismatch":0,"argMismatch":10}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_s` — benchmark function af:chase_s:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .L64\n sra\t$a1, $a1, 0x10\n lh\t$v0, 0($a0)\n slt\t$at, $a1, $v0\n beqzl\t$at, .L3c\n addu\t$t6, $v0, $a2\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n addu\t$t6, $v0, $a2\n.L3c:\n sh\t$t6, 0($a0)\n lh\t$t7, 0($a0)\n li\t$v0, 1\n subu\t$t8, $t7, $a1\n multu\t$t8, $a2\n mflo\t$t9\n bltzl\t$t9, .L7c\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.L64:\n lh\t$t0, 0($a0)\n bnel\t$a1, $t0, .L7c\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L7c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s` — benchmark function af:chase_s:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,64 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tslt\tat,a1,v0\n 24:\tbeqzl\tat,3c \n 28:\taddu\tt6,v0,a2\n 2c:\tnegu\ta2,a2\n 30:\tsll\ta2,a2,0x10\n 34:\tsra\ta2,a2,0x10\n 38:\taddu\tt6,v0,a2\n 3c:\tsh\tt6,0(a0)\n 40:\tlh\tt7,0(a0)\n 44:\tli\tv0,1\n 48:\tsubu\tt8,t7,a1\n 4c:\tmultu\tt8,a2\n 50:\tmflo\tt9\n 54:\tbltzl\tt9,7c \n 58:\tmove\tv0,zero\n 5c:\tjr\tra\n 60:\tsh\ta1,0(a0)\n 64:\tlh\tt0,0(a0)\n 68:\tbnel\ta1,t0,7c \n 6c:\tmove\tv0,zero\n 70:\tjr\tra\n 74:\tli\tv0,1\n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000084 chase_s\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00013 00052c03 84820000 ..4.......,.....\n 0020 00a2082a 50200005 00467021 00063023 ...*P ...Fp!..0#\n 0030 00063400 00063403 00467021 a48e0000 ..4...4..Fp!....\n 0040 848f0000 24020001 01e5c023 03060019 ....$......#....\n 0050 0000c812 07220009 00001025 03e00008 .....\".....%....\n 0060 a4850000 84880000 54a80004 00001025 ........T......%\n 0070 03e00008 24020001 00001025 03e00008 ....$......%....\n 0080 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c176 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c176 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000021 00000010 000001f8 p......!........\n 0010 00000005 00000344 00000001 00000208 .......D........\n 0020 00000004 0000023c 00000000 00000000 .......<........\n 0030 00000011 0000026c 00000034 000002b0 .......l...4....\n 0040 00000008 000002e4 00000001 000002ec ................\n 0050 00000000 00000000 00000001 00000334 ...............4\n 0060 0410f023 12211020 e420f042 11320000 ...#.!. . .B.2..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000011 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000084 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d663334 nch-real-ido-f34\n 0130 37633865 38353533 31393935 392f752e 7c8e855319959/u.\n 0140 69006368 6173655f 73000000 63686173 i.chase_s...chas\n 0150 655f7300 00000000 00000001 00000000 e_s.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000021 00000000 00000000 00000001 ...!............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000e 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_s2:ido7.1","sym":"chase_s2","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","pointer","branch"],"loc":10,"refSource":"s32 chase_s2(s16* pValue, s16 limit, s16 step) {\n s16 prev = *pValue;\n\n *pValue += step;\n if ((*pValue - limit) * (prev - limit) <= 0) {\n *pValue = limit;\n return 1;\n }\n return 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L124-L133","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta2,a2,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\taddu\tt6,v1,a2\n 18:\tsh\tt6,0(a0)\n 1c:\tlh\tt7,0(a0)\n 20:\tsll\ta1,a1,0x10\n 24:\tsra\ta1,a1,0x10\n 28:\tsll\tv0,v1,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tsubu\tt9,v0,a1\n 34:\tsubu\tt8,t7,a1\n 38:\tmultu\tt8,t9\n 3c:\tmove\tv0,zero\n 40:\tmflo\tt0\n 44:\tbgtz\tt0,58 \n 48:\tnop\n 4c:\tsh\ta1,0(a0)\n 50:\tjr\tra\n 54:\tli\tv0,1\n 58:\tjr\tra\n 5c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000060 chase_s2\n\n\nContents of section .text:\n 0000 afa50004 afa60008 84830000 00063400 ..............4.\n 0010 00063403 00667021 a48e0000 848f0000 ..4..fp!........\n 0020 00052c00 00052c03 00031400 00021403 ..,...,.........\n 0030 0045c823 01e5c023 03190019 00001025 .E.#...#.......%\n 0040 00004012 1d000004 00000000 a4850000 ..@.............\n 0050 03e00008 24020001 03e00008 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 a300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000018 00000010 000001c8 p...............\n 0010 00000005 00000318 00000001 000001d8 ................\n 0020 00000004 0000020c 00000000 00000000 ................\n 0030 00000011 0000023c 00000034 00000280 .......<...4....\n 0040 0000000c 000002b4 00000001 000002c0 ................\n 0050 00000000 00000000 00000001 00000308 ................\n 0060 0110f121 10d11122 40c21011 21000000 ...!...\"@...!...\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000009 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000060 20200001 00000001 00000000 ...` ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d643230 nch-real-ido-d20\n 0130 63333538 62353263 32376664 632f752e c358b52c27fdc/u.\n 0140 69006368 6173655f 73320000 63686173 i.chase_s2..chas\n 0150 655f7332 00000000 00000000 00000001 e_s2............\n 0160 00000000 00000033 00000000 00000004 .......3........\n 0170 00000000 00000018 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000d ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 chase_s2(s16 * a0, u32 a1, u32 a2) {\n s32 v0;\n v0 = *a0;\n *a0 = v0 + (a2 << 16 >> 16);\n if ((*a0 - (a1 << 16 >> 16)) * ((v0 << 16 >> 16) - (a1 << 16 >> 16)) <= 0) {\n *a0 = a1 << 16 >> 16;\n return 1;\n } else {\n return 0;\n }\n}\n","score":18,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":3,"opMismatch":0,"argMismatch":13},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 chase_s2(s16 *arg0, s16 arg1, s16 arg2) {\n s16 temp_v1;\n\n temp_v1 = *arg0;\n *arg0 = temp_v1 + arg2;\n if (((*arg0 - arg1) * (temp_v1 - arg1)) <= 0) {\n *arg0 = arg1;\n return 1;\n }\n return 0;\n}\n","score":4,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":10,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":24,"ratio":0.16666666666666666,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_s2` — benchmark function af:chase_s2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s2\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n lh\t$v1, 0($a0)\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n addu\t$t6, $v1, $a2\n sh\t$t6, 0($a0)\n lh\t$t7, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$v0, $v1, 0x10\n sra\t$v0, $v0, 0x10\n subu\t$t9, $v0, $a1\n subu\t$t8, $t7, $a1\n multu\t$t8, $t9\n move\t$v0, $zero\n mflo\t$t0\n bgtz\t$t0, .L58\n nop\n sh\t$a1, 0($a0)\n jr\t$ra\n li\t$v0, 1\n.L58:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s2` — benchmark function af:chase_s2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s2:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta2,a2,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\taddu\tt6,v1,a2\n 18:\tsh\tt6,0(a0)\n 1c:\tlh\tt7,0(a0)\n 20:\tsll\ta1,a1,0x10\n 24:\tsra\ta1,a1,0x10\n 28:\tsll\tv0,v1,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tsubu\tt9,v0,a1\n 34:\tsubu\tt8,t7,a1\n 38:\tmultu\tt8,t9\n 3c:\tmove\tv0,zero\n 40:\tmflo\tt0\n 44:\tbgtz\tt0,58 \n 48:\tnop\n 4c:\tsh\ta1,0(a0)\n 50:\tjr\tra\n 54:\tli\tv0,1\n 58:\tjr\tra\n 5c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000060 chase_s2\n\n\nContents of section .text:\n 0000 afa50004 afa60008 84830000 00063400 ..............4.\n 0010 00063403 00667021 a48e0000 848f0000 ..4..fp!........\n 0020 00052c00 00052c03 00031400 00021403 ..,...,.........\n 0030 0045c823 01e5c023 03190019 00001025 .E.#...#.......%\n 0040 00004012 1d000004 00000000 a4850000 ..@.............\n 0050 03e00008 24020001 03e00008 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 a300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000018 00000010 000001c8 p...............\n 0010 00000005 00000318 00000001 000001d8 ................\n 0020 00000004 0000020c 00000000 00000000 ................\n 0030 00000011 0000023c 00000034 00000280 .......<...4....\n 0040 0000000c 000002b4 00000001 000002c0 ................\n 0050 00000000 00000000 00000001 00000308 ................\n 0060 0110f121 10d11122 40c21011 21000000 ...!...\"@...!...\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000009 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000060 20200001 00000001 00000000 ...` ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d643230 nch-real-ido-d20\n 0130 63333538 62353263 32376664 632f752e c358b52c27fdc/u.\n 0140 69006368 6173655f 73320000 63686173 i.chase_s2..chas\n 0150 655f7332 00000000 00000000 00000001 e_s2............\n 0160 00000000 00000033 00000000 00000004 .......3........\n 0170 00000000 00000018 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000d ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_s3:ido7.1","sym":"chase_s3","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch","arithmetic","pointer","nested"],"loc":28,"refSource":"s32 chase_s3(s16* pValue, s16 target, s16 step) {\n if (step) {\n s32 diff = target - *pValue;\n\n if (diff < 0) {\n step = -step;\n }\n\n if (diff >= 0x8000) {\n step = -step;\n diff = -0xFFFF - -diff;\n } else if (diff <= -0x8000) {\n step = -step;\n diff += 0xFFFF;\n }\n\n *pValue += step;\n\n if ((diff * step) <= 0) {\n *pValue = target;\n return TRUE;\n }\n\n } else if (target == *pValue) {\n return TRUE;\n }\n return FALSE;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L135-L162","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,a4 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv1,0(a0)\n 20:\tli\tat,0x8000\n 24:\tlui\tt7,0xffff\n 28:\tsubu\tv0,a1,v1\n 2c:\tbgez\tv0,40 \n 30:\tslt\tat,v0,at\n 34:\tnegu\ta2,a2\n 38:\tsll\ta2,a2,0x10\n 3c:\tsra\ta2,a2,0x10\n 40:\tbnez\tat,60 \n 44:\tnegu\tt6,v0\n 48:\tnegu\ta2,a2\n 4c:\tsll\ta2,a2,0x10\n 50:\tori\tt7,t7,0x1\n 54:\tsra\ta2,a2,0x10\n 58:\tb\t80 \n 5c:\tsubu\tv0,t7,t6\n 60:\tslti\tat,v0,-32767\n 64:\tbeqz\tat,80 \n 68:\tnop\n 6c:\tnegu\ta2,a2\n 70:\tsll\ta2,a2,0x10\n 74:\tli\tat,0xffff\n 78:\tsra\ta2,a2,0x10\n 7c:\taddu\tv0,v0,at\n 80:\tmultu\ta2,v0\n 84:\taddu\tt8,v1,a2\n 88:\tsh\tt8,0(a0)\n 8c:\tli\tv0,1\n 90:\tmflo\tt9\n 94:\tbgtzl\tt9,bc \n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tsh\ta1,0(a0)\n a4:\tlh\tt0,0(a0)\n a8:\tbnel\ta1,t0,bc \n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tli\tv0,1\n b8:\tmove\tv0,zero\n bc:\tjr\tra\n c0:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c4 chase_s3\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00023 00052c03 84830000 ..4....#..,.....\n 0020 34018000 3c0fffff 00a31023 04410004 4...<......#.A..\n 0030 0041082a 00063023 00063400 00063403 .A.*..0#..4...4.\n 0040 14200007 00027023 00063023 00063400 . ....p#..0#..4.\n 0050 35ef0001 00063403 10000009 01ee1023 5.....4........#\n 0060 28418001 10200006 00000000 00063023 (A... ........0#\n 0070 00063400 3401ffff 00063403 00411021 ..4.4.....4..A.!\n 0080 00c20019 0066c021 a4980000 24020001 .....f.!....$...\n 0090 0000c812 5f200009 00001025 03e00008 ...._ .....%....\n 00a0 a4850000 84880000 54a80004 00001025 ........T......%\n 00b0 03e00008 24020001 00001025 03e00008 ....$......%....\n 00c0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c17e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000031 00000020 00000238 p......1... ...8\n 0010 00000005 00000398 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 0000000c 00000334 00000001 00000340 .......4.......@\n 0050 00000000 00000000 00000001 00000388 ................\n 0060 0410f020 4020a010 30e22020 f110f011 ... @ ..0. ....\n 0070 121110f0 1030f130 e220f032 11220000 .....0.0. .2.\"..\n 0080 00000000 00000001 00000000 00000000 ................\n 0090 00000000 ffffffff 00000000 00000000 ................\n 00a0 00000000 001d001f 00000002 00000017 ................\n 00b0 00000000 00000001 00000000 2c200004 ............, ..\n 00c0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00d0 000000c4 20200001 00000001 00000000 .... ..........\n 00e0 20200000 02000000 03000000 04000000 ..............\n 00f0 05000000 06000000 07000000 08000000 ................\n 0100 09000000 20000000 21000000 0a000000 .... ...!.......\n 0110 0b000000 0b000000 1a000000 00000000 ................\n 0120 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0130 6e63682d 7265616c 2d69646f 2d383035 nch-real-ido-805\n 0140 36623232 64303864 62646363 662f752e 6b22d08dbdccf/u.\n 0150 69006368 6173655f 73330000 63686173 i.chase_s3..chas\n 0160 655f7333 00000000 00000000 00000001 e_s3............\n 0170 00000000 00000033 00000000 00000004 .......3........\n 0180 00000000 00000031 00000000 00000000 .......1........\n 0190 00000001 00000000 00000011 00000000 ................\n 01a0 00000000 01800000 00000000 0000001e ................\n 01b0 00000000 00000000 00000000 18200001 ............. ..\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 00000000 7fffffff 00000000 ................\n 01e0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'chase_s3' — lift: cannot lift 'chase_s3': unmodelled control transfer 'bgtzl' at 0x94 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta2,8(sp) */\n/* 4:\tsll\ta2,a2,0x10 */\n/* 8:\tsw\ta1,4(sp) */\n/* c:\tsll\ta1,a1,0x10 */\n/* 10:\tsra\ta2,a2,0x10 */\n/* 14:\tbeqz\ta2,a4 */\n/* 18:\tsra\ta1,a1,0x10 */\n/* 1c:\tlh\tv1,0(a0) */\n/* 20:\tli\tat,0x8000 */\n/* 24:\tlui\tt7,0xffff */\n/* 28:\tsubu\tv0,a1,v1 */\n/* 2c:\tbgez\tv0,40 */\n/* 30:\tslt\tat,v0,at */\n/* 34:\tnegu\ta2,a2 */\n/* 38:\tsll\ta2,a2,0x10 */\n/* 3c:\tsra\ta2,a2,0x10 */\n/* 40:\tbnez\tat,60 */\n/* 44:\tnegu\tt6,v0 */\n/* 48:\tnegu\ta2,a2 */\n/* 4c:\tsll\ta2,a2,0x10 */\n/* 50:\tori\tt7,t7,0x1 */\n/* 54:\tsra\ta2,a2,0x10 */\n/* 58:\tb\t80 */\n/* 5c:\tsubu\tv0,t7,t6 */\n/* 60:\tslti\tat,v0,-32767 */\n/* 64:\tbeqz\tat,80 */\n/* 68:\tnop */\n/* 6c:\tnegu\ta2,a2 */\n/* 70:\tsll\ta2,a2,0x10 */\n/* 74:\tli\tat,0xffff */\n/* 78:\tsra\ta2,a2,0x10 */\n/* 7c:\taddu\tv0,v0,at */\n/* 80:\tmultu\ta2,v0 */\n/* 84:\taddu\tt8,v1,a2 */\n/* 88:\tsh\tt8,0(a0) */\n/* 8c:\tli\tv0,1 */\n/* 90:\tmflo\tt9 */\n/* 94:\tbgtzl\tt9,bc */\n/* 98:\tmove\tv0,zero */\n/* 9c:\tjr\tra */\n/* a0:\tsh\ta1,0(a0) */\n/* a4:\tlh\tt0,0(a0) */\n/* a8:\tbnel\ta1,t0,bc */\n/* ac:\tmove\tv0,zero */\n/* b0:\tjr\tra */\n/* b4:\tli\tv0,1 */\n/* b8:\tmove\tv0,zero */\n/* bc:\tjr\tra */\n/* c0:\tnop */\n/* \t... */\nvoid chase_s3(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'chase_s3': unmodelled control transfer 'bgtzl' at 0x94 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":58,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'chase_s3': unmodelled control transfer 'bgtzl' at 0x94 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 chase_s3(s16 *arg0, s16 arg1, s16 arg2) {\n s16 temp_v1;\n s16 var_a2;\n s32 var_v0;\n\n var_a2 = arg2;\n if (var_a2 != 0) {\n temp_v1 = *arg0;\n var_v0 = arg1 - temp_v1;\n if (var_v0 < 0) {\n var_a2 *= -1;\n }\n if (var_v0 >= 0x8000) {\n var_a2 *= -1;\n var_v0 = 0xFFFF0001 - -var_v0;\n } else if (var_v0 < -0x7FFF) {\n var_a2 *= -1;\n var_v0 += 0xFFFF;\n }\n *arg0 = temp_v1 + var_a2;\n if ((var_a2 * var_v0) <= 0) {\n *arg0 = arg1;\n return 1;\n }\n /* Duplicate return node #11. Try simplifying control flow for better match */\n return 0;\n }\n if (arg1 == *arg0) {\n return 1;\n }\n return 0;\n}\n","score":50,"maxScore":69,"compileErrors":null,"breakdown":{"insert":20,"delete":10,"replace":6,"opMismatch":0,"argMismatch":14},"quality":{"score":100,"lines":31,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":50,"maxScore":69,"ratio":0.7246376811594203,"kinds":{"insert":20,"delete":10,"replace":6,"opMismatch":0,"argMismatch":14}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_s3` — benchmark function af:chase_s3:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s3\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .La4\n sra\t$a1, $a1, 0x10\n lh\t$v1, 0($a0)\n li\t$at, 0x8000\n lui\t$t7, 0xffff\n subu\t$v0, $a1, $v1\n bgez\t$v0, .L40\n slt\t$at, $v0, $at\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n.L40:\n bnez\t$at, .L60\n negu\t$t6, $v0\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n ori\t$t7, $t7, 0x1\n sra\t$a2, $a2, 0x10\n b\t.L80\n subu\t$v0, $t7, $t6\n.L60:\n slti\t$at, $v0, -32767\n beqz\t$at, .L80\n nop\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n li\t$at, 0xffff\n sra\t$a2, $a2, 0x10\n addu\t$v0, $v0, $at\n.L80:\n multu\t$a2, $v0\n addu\t$t8, $v1, $a2\n sh\t$t8, 0($a0)\n li\t$v0, 1\n mflo\t$t9\n bgtzl\t$t9, .Lbc\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.La4:\n lh\t$t0, 0($a0)\n bnel\t$a1, $t0, .Lbc\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.Lbc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s3` — benchmark function af:chase_s3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,a4 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv1,0(a0)\n 20:\tli\tat,0x8000\n 24:\tlui\tt7,0xffff\n 28:\tsubu\tv0,a1,v1\n 2c:\tbgez\tv0,40 \n 30:\tslt\tat,v0,at\n 34:\tnegu\ta2,a2\n 38:\tsll\ta2,a2,0x10\n 3c:\tsra\ta2,a2,0x10\n 40:\tbnez\tat,60 \n 44:\tnegu\tt6,v0\n 48:\tnegu\ta2,a2\n 4c:\tsll\ta2,a2,0x10\n 50:\tori\tt7,t7,0x1\n 54:\tsra\ta2,a2,0x10\n 58:\tb\t80 \n 5c:\tsubu\tv0,t7,t6\n 60:\tslti\tat,v0,-32767\n 64:\tbeqz\tat,80 \n 68:\tnop\n 6c:\tnegu\ta2,a2\n 70:\tsll\ta2,a2,0x10\n 74:\tli\tat,0xffff\n 78:\tsra\ta2,a2,0x10\n 7c:\taddu\tv0,v0,at\n 80:\tmultu\ta2,v0\n 84:\taddu\tt8,v1,a2\n 88:\tsh\tt8,0(a0)\n 8c:\tli\tv0,1\n 90:\tmflo\tt9\n 94:\tbgtzl\tt9,bc \n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tsh\ta1,0(a0)\n a4:\tlh\tt0,0(a0)\n a8:\tbnel\ta1,t0,bc \n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tli\tv0,1\n b8:\tmove\tv0,zero\n bc:\tjr\tra\n c0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c4 chase_s3\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00023 00052c03 84830000 ..4....#..,.....\n 0020 34018000 3c0fffff 00a31023 04410004 4...<......#.A..\n 0030 0041082a 00063023 00063400 00063403 .A.*..0#..4...4.\n 0040 14200007 00027023 00063023 00063400 . ....p#..0#..4.\n 0050 35ef0001 00063403 10000009 01ee1023 5.....4........#\n 0060 28418001 10200006 00000000 00063023 (A... ........0#\n 0070 00063400 3401ffff 00063403 00411021 ..4.4.....4..A.!\n 0080 00c20019 0066c021 a4980000 24020001 .....f.!....$...\n 0090 0000c812 5f200009 00001025 03e00008 ...._ .....%....\n 00a0 a4850000 84880000 54a80004 00001025 ........T......%\n 00b0 03e00008 24020001 00001025 03e00008 ....$......%....\n 00c0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c17e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000031 00000020 00000238 p......1... ...8\n 0010 00000005 00000398 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 0000000c 00000334 00000001 00000340 .......4.......@\n 0050 00000000 00000000 00000001 00000388 ................\n 0060 0410f020 4020a010 30e22020 f110f011 ... @ ..0. ....\n 0070 121110f0 1030f130 e220f032 11220000 .....0.0. .2.\"..\n 0080 00000000 00000001 00000000 00000000 ................\n 0090 00000000 ffffffff 00000000 00000000 ................\n 00a0 00000000 001d001f 00000002 00000017 ................\n 00b0 00000000 00000001 00000000 2c200004 ............, ..\n 00c0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00d0 000000c4 20200001 00000001 00000000 .... ..........\n 00e0 20200000 02000000 03000000 04000000 ..............\n 00f0 05000000 06000000 07000000 08000000 ................\n 0100 09000000 20000000 21000000 0a000000 .... ...!.......\n 0110 0b000000 0b000000 1a000000 00000000 ................\n 0120 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0130 6e63682d 7265616c 2d69646f 2d383035 nch-real-ido-805\n 0140 36623232 64303864 62646363 662f752e 6b22d08dbdccf/u.\n 0150 69006368 6173655f 73330000 63686173 i.chase_s3..chas\n 0160 655f7333 00000000 00000000 00000001 e_s3............\n 0170 00000000 00000033 00000000 00000004 .......3........\n 0180 00000000 00000031 00000000 00000000 .......1........\n 0190 00000001 00000000 00000011 00000000 ................\n 01a0 00000000 01800000 00000000 0000001e ................\n 01b0 00000000 00000000 00000000 18200001 ............. ..\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 00000000 7fffffff 00000000 ................\n 01e0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:check_percent_abs:ido7.1","sym":"check_percent_abs","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","nested"],"loc":20,"refSource":"f32 check_percent_abs(f32 x, f32 min, f32 max, f32 scale, s32 shiftMin) {\n if ((-min <= x) && (x <= min)) {\n return 0.0f;\n }\n if (x >= max) {\n return 1.0f;\n }\n if (x <= -max) {\n return -1.0f;\n }\n if (shiftMin) {\n if (x > 0.0f) {\n return (x - min) * scale;\n } else {\n return (x + min) * scale;\n }\n } else {\n return x * scale;\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L652-L671","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg.s\t$f4,$f14\n 4:\tsw\ta2,8(sp)\n 8:\tc.le.s\t$f4,$f12\n c:\tsw\ta3,12(sp)\n 10:\tlwc1\t$f6,8(sp)\n 14:\tbc1fl\t3c \n 18:\tc.le.s\t$f6,$f12\n 1c:\tc.le.s\t$f12,$f14\n 20:\tnop\n 24:\tbc1fl\t3c \n 28:\tc.le.s\t$f6,$f12\n 2c:\tmtc1\tzero,$f0\n 30:\tjr\tra\n 34:\tnop\n 38:\tc.le.s\t$f6,$f12\n 3c:\tlui\tat,0x3f80\n 40:\tlwc1\t$f8,8(sp)\n 44:\tbc1fl\t5c \n 48:\tneg.s\t$f10,$f8\n 4c:\tmtc1\tat,$f0\n 50:\tjr\tra\n 54:\tnop\n 58:\tneg.s\t$f10,$f8\n 5c:\tlui\tat,0xbf80\n 60:\tc.le.s\t$f12,$f10\n 64:\tlw\tt6,16(sp)\n 68:\tbc1f\t7c \n 6c:\tnop\n 70:\tmtc1\tat,$f0\n 74:\tjr\tra\n 78:\tnop\n 7c:\tbeqz\tt6,bc \n 80:\tlwc1\t$f10,12(sp)\n 84:\tmtc1\tzero,$f16\n 88:\tnop\n 8c:\tc.lt.s\t$f16,$f12\n 90:\tnop\n 94:\tbc1fl\tb0 \n 98:\tadd.s\t$f6,$f12,$f14\n 9c:\tsub.s\t$f18,$f12,$f14\n a0:\tlwc1\t$f4,12(sp)\n a4:\tjr\tra\n a8:\tmul.s\t$f0,$f18,$f4\n ac:\tadd.s\t$f6,$f12,$f14\n b0:\tlwc1\t$f8,12(sp)\n b4:\tjr\tra\n b8:\tmul.s\t$f0,$f6,$f8\n bc:\tmul.s\t$f0,$f12,$f10\n c0:\tjr\tra\n c4:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c8 check_percent_abs\n\n\nContents of section .text:\n 0000 46007107 afa60008 460c203e afa7000c F.q.....F. >....\n 0010 c7a60008 45020009 460c303e 460e603e ....E...F.0>F.`>\n 0020 00000000 45020005 460c303e 44800000 ....E...F.0>D...\n 0030 03e00008 00000000 460c303e 3c013f80 ........F.0><.?.\n 0040 c7a80008 45020005 46004287 44810000 ....E...F.B.D...\n 0050 03e00008 00000000 46004287 3c01bf80 ........F.B.<...\n 0060 460a603e 8fae0010 45000004 00000000 F.`>....E.......\n 0070 44810000 03e00008 00000000 11c0000f D...............\n 0080 c7aa000c 44808000 00000000 460c803c ....D.......F..<\n 0090 00000000 45020006 460e6180 460e6481 ....E...F.a.F.d.\n 00a0 c7a4000c 03e00008 46049002 460e6180 ........F...F.a.\n 00b0 c7a8000c 03e00008 46083002 460a6002 ........F.0.F.`.\n 00c0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00040c2 00000000 . ........@.....\n 0010 000d5df3 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00040c2 00000000 000d5df3 00000000 ..@.......].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000032 00000018 00000248 p......2.......H\n 0010 00000005 000003b0 00000001 00000260 ...............`\n 0020 00000004 00000294 00000000 00000000 ................\n 0030 00000011 000002c4 0000003c 00000308 ...........<....\n 0040 00000014 00000344 00000001 00000358 .......D.......X\n 0050 00000000 00000000 00000001 000003a0 ................\n 0060 10f010f0 40d51220 1020d112 2010f030 ....@.. . .. ..0\n 0070 d1122070 a5132332 00000000 00000001 .. p..#2........\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000002 00000013 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000c8 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d636665 33636534 65663339 -ido-cfe3ce4ef39\n 0140 37396662 342f752e 69006368 65636b5f 79fb4/u.i.check_\n 0150 70657263 656e745f 61627300 63686563 percent_abs.chec\n 0160 6b5f7065 7263656e 745f6162 73000000 k_percent_abs...\n 0170 00000000 00000001 00000000 0000003c ...............<\n 0180 00000000 00000004 00000000 00000032 ...............2\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000018 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 00000000 ..... ..........\n 01d0 00000000 00000000 00000000 00000000 ................\n 01e0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'check_percent_abs' — lift: cannot lift 'check_percent_abs': unmodelled control transfer 'bc1fl' at 0x14 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tneg.s\t$f4,$f14 */\n/* 4:\tsw\ta2,8(sp) */\n/* 8:\tc.le.s\t$f4,$f12 */\n/* c:\tsw\ta3,12(sp) */\n/* 10:\tlwc1\t$f6,8(sp) */\n/* 14:\tbc1fl\t3c */\n/* 18:\tc.le.s\t$f6,$f12 */\n/* 1c:\tc.le.s\t$f12,$f14 */\n/* 20:\tnop */\n/* 24:\tbc1fl\t3c */\n/* 28:\tc.le.s\t$f6,$f12 */\n/* 2c:\tmtc1\tzero,$f0 */\n/* 30:\tjr\tra */\n/* 34:\tnop */\n/* 38:\tc.le.s\t$f6,$f12 */\n/* 3c:\tlui\tat,0x3f80 */\n/* 40:\tlwc1\t$f8,8(sp) */\n/* 44:\tbc1fl\t5c */\n/* 48:\tneg.s\t$f10,$f8 */\n/* 4c:\tmtc1\tat,$f0 */\n/* 50:\tjr\tra */\n/* 54:\tnop */\n/* 58:\tneg.s\t$f10,$f8 */\n/* 5c:\tlui\tat,0xbf80 */\n/* 60:\tc.le.s\t$f12,$f10 */\n/* 64:\tlw\tt6,16(sp) */\n/* 68:\tbc1f\t7c */\n/* 6c:\tnop */\n/* 70:\tmtc1\tat,$f0 */\n/* 74:\tjr\tra */\n/* 78:\tnop */\n/* 7c:\tbeqz\tt6,bc */\n/* 80:\tlwc1\t$f10,12(sp) */\n/* 84:\tmtc1\tzero,$f16 */\n/* 88:\tnop */\n/* 8c:\tc.lt.s\t$f16,$f12 */\n/* 90:\tnop */\n/* 94:\tbc1fl\tb0 */\n/* 98:\tadd.s\t$f6,$f12,$f14 */\n/* 9c:\tsub.s\t$f18,$f12,$f14 */\n/* a0:\tlwc1\t$f4,12(sp) */\n/* a4:\tjr\tra */\n/* a8:\tmul.s\t$f0,$f18,$f4 */\n/* ac:\tadd.s\t$f6,$f12,$f14 */\n/* b0:\tlwc1\t$f8,12(sp) */\n/* b4:\tjr\tra */\n/* b8:\tmul.s\t$f0,$f6,$f8 */\n/* bc:\tmul.s\t$f0,$f12,$f10 */\n/* c0:\tjr\tra */\n/* c4:\tnop */\n/* \t... */\nvoid check_percent_abs(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'check_percent_abs': unmodelled control transfer 'bc1fl' at 0x14 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":59,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'check_percent_abs': unmodelled control transfer 'bc1fl' at 0x14 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 check_percent_abs(f32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) {\n if ((-arg1 <= arg0) && (arg0 <= arg1)) {\n return 0.0f;\n }\n if (arg2 <= arg0) {\n return 1.0f;\n }\n if (arg0 <= -arg2) {\n return -1.0f;\n }\n if (arg4 != 0) {\n if (arg0 > 0.0f) {\n return (arg0 - arg1) * arg3;\n }\n return (arg0 + arg1) * arg3;\n }\n return arg0 * arg3;\n}\n","score":0,"maxScore":50,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `check_percent_abs` — benchmark function af:check_percent_abs:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel check_percent_abs\n neg.s\t$f4, $f14\n sw\t$a2, 8($sp)\n c.le.s\t$f4, $f12\n sw\t$a3, 12($sp)\n lwc1\t$f6, 8($sp)\n bc1fl\t.L3c\n c.le.s\t$f6, $f12\n c.le.s\t$f12, $f14\n nop\n bc1fl\t.L3c\n c.le.s\t$f6, $f12\n mtc1\t$zero, $f0\n jr\t$ra\n nop\n c.le.s\t$f6, $f12\n.L3c:\n lui\t$at, 0x3f80\n lwc1\t$f8, 8($sp)\n bc1fl\t.L5c\n neg.s\t$f10, $f8\n mtc1\t$at, $f0\n jr\t$ra\n nop\n neg.s\t$f10, $f8\n.L5c:\n lui\t$at, 0xbf80\n c.le.s\t$f12, $f10\n lw\t$t6, 16($sp)\n bc1f\t.L7c\n nop\n mtc1\t$at, $f0\n jr\t$ra\n nop\n.L7c:\n beqz\t$t6, .Lbc\n lwc1\t$f10, 12($sp)\n mtc1\t$zero, $f16\n nop\n c.lt.s\t$f16, $f12\n nop\n bc1fl\t.Lb0\n add.s\t$f6, $f12, $f14\n sub.s\t$f18, $f12, $f14\n lwc1\t$f4, 12($sp)\n jr\t$ra\n mul.s\t$f0, $f18, $f4\n add.s\t$f6, $f12, $f14\n.Lb0:\n lwc1\t$f8, 12($sp)\n jr\t$ra\n mul.s\t$f0, $f6, $f8\n.Lbc:\n mul.s\t$f0, $f12, $f10\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function check_percent_abs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `check_percent_abs` — benchmark function af:check_percent_abs:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:check_percent_abs:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg.s\t$f4,$f14\n 4:\tsw\ta2,8(sp)\n 8:\tc.le.s\t$f4,$f12\n c:\tsw\ta3,12(sp)\n 10:\tlwc1\t$f6,8(sp)\n 14:\tbc1fl\t3c \n 18:\tc.le.s\t$f6,$f12\n 1c:\tc.le.s\t$f12,$f14\n 20:\tnop\n 24:\tbc1fl\t3c \n 28:\tc.le.s\t$f6,$f12\n 2c:\tmtc1\tzero,$f0\n 30:\tjr\tra\n 34:\tnop\n 38:\tc.le.s\t$f6,$f12\n 3c:\tlui\tat,0x3f80\n 40:\tlwc1\t$f8,8(sp)\n 44:\tbc1fl\t5c \n 48:\tneg.s\t$f10,$f8\n 4c:\tmtc1\tat,$f0\n 50:\tjr\tra\n 54:\tnop\n 58:\tneg.s\t$f10,$f8\n 5c:\tlui\tat,0xbf80\n 60:\tc.le.s\t$f12,$f10\n 64:\tlw\tt6,16(sp)\n 68:\tbc1f\t7c \n 6c:\tnop\n 70:\tmtc1\tat,$f0\n 74:\tjr\tra\n 78:\tnop\n 7c:\tbeqz\tt6,bc \n 80:\tlwc1\t$f10,12(sp)\n 84:\tmtc1\tzero,$f16\n 88:\tnop\n 8c:\tc.lt.s\t$f16,$f12\n 90:\tnop\n 94:\tbc1fl\tb0 \n 98:\tadd.s\t$f6,$f12,$f14\n 9c:\tsub.s\t$f18,$f12,$f14\n a0:\tlwc1\t$f4,12(sp)\n a4:\tjr\tra\n a8:\tmul.s\t$f0,$f18,$f4\n ac:\tadd.s\t$f6,$f12,$f14\n b0:\tlwc1\t$f8,12(sp)\n b4:\tjr\tra\n b8:\tmul.s\t$f0,$f6,$f8\n bc:\tmul.s\t$f0,$f12,$f10\n c0:\tjr\tra\n c4:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c8 check_percent_abs\n\n\nContents of section .text:\n 0000 46007107 afa60008 460c203e afa7000c F.q.....F. >....\n 0010 c7a60008 45020009 460c303e 460e603e ....E...F.0>F.`>\n 0020 00000000 45020005 460c303e 44800000 ....E...F.0>D...\n 0030 03e00008 00000000 460c303e 3c013f80 ........F.0><.?.\n 0040 c7a80008 45020005 46004287 44810000 ....E...F.B.D...\n 0050 03e00008 00000000 46004287 3c01bf80 ........F.B.<...\n 0060 460a603e 8fae0010 45000004 00000000 F.`>....E.......\n 0070 44810000 03e00008 00000000 11c0000f D...............\n 0080 c7aa000c 44808000 00000000 460c803c ....D.......F..<\n 0090 00000000 45020006 460e6180 460e6481 ....E...F.a.F.d.\n 00a0 c7a4000c 03e00008 46049002 460e6180 ........F...F.a.\n 00b0 c7a8000c 03e00008 46083002 460a6002 ........F.0.F.`.\n 00c0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00040c2 00000000 . ........@.....\n 0010 000d5df3 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00040c2 00000000 000d5df3 00000000 ..@.......].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000032 00000018 00000248 p......2.......H\n 0010 00000005 000003b0 00000001 00000260 ...............`\n 0020 00000004 00000294 00000000 00000000 ................\n 0030 00000011 000002c4 0000003c 00000308 ...........<....\n 0040 00000014 00000344 00000001 00000358 .......D.......X\n 0050 00000000 00000000 00000001 000003a0 ................\n 0060 10f010f0 40d51220 1020d112 2010f030 ....@.. . .. ..0\n 0070 d1122070 a5132332 00000000 00000001 .. p..#2........\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000002 00000013 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000c8 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d636665 33636534 65663339 -ido-cfe3ce4ef39\n 0140 37396662 342f752e 69006368 65636b5f 79fb4/u.i.check_\n 0150 70657263 656e745f 61627300 63686563 percent_abs.chec\n 0160 6b5f7065 7263656e 745f6162 73000000 k_percent_abs...\n 0170 00000000 00000001 00000000 0000003c ...............<\n 0180 00000000 00000004 00000000 00000032 ...............2\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000018 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 00000000 ..... ..........\n 01d0 00000000 00000000 00000000 00000000 ................\n 01e0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name check_percent_abs # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:get_percent:ido7.1","sym":"get_percent","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","branch","float"],"loc":18,"refSource":"f32 get_percent(s32 max, s32 min, s32 x) {\n f32 denom;\n f32 percent;\n\n percent = 1.0f;\n if (x < min) {\n percent = 0.0f;\n } else if (x < max) {\n denom = (f32)(max - min);\n if (denom != 0.0f) {\n percent = (f32)(x - min) / denom;\n if (percent > 1.0f) {\n percent = 1.0f;\n }\n }\n }\n return percent;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L737-L754","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x3f80\n 4:\tmtc1\tat,$f14\n 8:\tslt\tat,a2,a1\n c:\tbeqz\tat,20 \n 10:\tmov.s\t$f2,$f14\n 14:\tmtc1\tzero,$f2\n 18:\tjr\tra\n 1c:\tmov.s\t$f0,$f2\n 20:\tslt\tat,a2,a0\n 24:\tbeqz\tat,70 \n 28:\tsubu\tt6,a0,a1\n 2c:\tmtc1\tt6,$f4\n 30:\tmtc1\tzero,$f6\n 34:\tsubu\tt7,a2,a1\n 38:\tcvt.s.w\t$f0,$f4\n 3c:\tc.eq.s\t$f6,$f0\n 40:\tnop\n 44:\tbc1t\t70 \n 48:\tnop\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f10,$f8\n 58:\tdiv.s\t$f2,$f10,$f0\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tnop\n 64:\tbc1f\t70 \n 68:\tnop\n 6c:\tmov.s\t$f2,$f14\n 70:\tjr\tra\n 74:\tmov.s\t$f0,$f2\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 get_percent\n\n\nContents of section .text:\n 0000 3c013f80 44817000 00c5082a 10200004 <.?.D.p....*. ..\n 0010 46007086 44801000 03e00008 46001006 F.p.D.......F...\n 0020 00c4082a 10200012 00857023 448e2000 ...*. ....p#D. .\n 0030 44803000 00c57823 46802020 46003032 D.0...x#F. F.02\n 0040 00000000 4501000a 00000000 448f4000 ....E.......D.@.\n 0050 00000000 468042a0 46005083 4602703c ....F.B.F.P.F.p<\n 0060 00000000 45000002 00000000 46007086 ....E.......F.p.\n 0070 03e00008 46001006 00000000 00000000 ....F...........\nContents of section .options:\n 0000 01200000 00000000 8000c072 00000000 . .........r....\n 0010 00004d5f 00000000 00000000 00007ff0 ..M_............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c072 00000000 00004d5f 00000000 ...r......M_....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000014 000001f8 p...............\n 0010 00000005 00000350 00000001 0000020c .......P........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000038 000002b4 .......p...8....\n 0040 0000000c 000002ec 00000001 000002f8 ................\n 0050 00000000 00000000 00000001 00000340 ...............@\n 0060 0141f020 81000a81 fff72210 f4131310 .A. ......\".....\n 0070 41000000 00000000 00000001 00000000 A...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000078 20200001 00000001 ...*...x ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d336439 33326462 34353639 64613436 -3d932db4569da46\n 0140 662f752e 69006765 745f7065 7263656e f/u.i.get_percen\n 0150 74000000 6765745f 70657263 656e7400 t...get_percent.\n 0160 00000000 00000001 00000000 00000036 ...............6\n 0170 00000000 00000004 00000000 0000001e ................\n 0180 00000000 00000000 00000001 00000000 ................\n 0190 00000011 00000000 00000000 01800000 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 00000000 18200001 00000000 00000000 ..... ..........\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'get_percent' — lift: cannot lift 'get_percent': unmodelled control transfer 'bc1t' at 0x44 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlui\tat,0x3f80 */\n/* 4:\tmtc1\tat,$f14 */\n/* 8:\tslt\tat,a2,a1 */\n/* c:\tbeqz\tat,20 */\n/* 10:\tmov.s\t$f2,$f14 */\n/* 14:\tmtc1\tzero,$f2 */\n/* 18:\tjr\tra */\n/* 1c:\tmov.s\t$f0,$f2 */\n/* 20:\tslt\tat,a2,a0 */\n/* 24:\tbeqz\tat,70 */\n/* 28:\tsubu\tt6,a0,a1 */\n/* 2c:\tmtc1\tt6,$f4 */\n/* 30:\tmtc1\tzero,$f6 */\n/* 34:\tsubu\tt7,a2,a1 */\n/* 38:\tcvt.s.w\t$f0,$f4 */\n/* 3c:\tc.eq.s\t$f6,$f0 */\n/* 40:\tnop */\n/* 44:\tbc1t\t70 */\n/* 48:\tnop */\n/* 4c:\tmtc1\tt7,$f8 */\n/* 50:\tnop */\n/* 54:\tcvt.s.w\t$f10,$f8 */\n/* 58:\tdiv.s\t$f2,$f10,$f0 */\n/* 5c:\tc.lt.s\t$f14,$f2 */\n/* 60:\tnop */\n/* 64:\tbc1f\t70 */\n/* 68:\tnop */\n/* 6c:\tmov.s\t$f2,$f14 */\n/* 70:\tjr\tra */\n/* 74:\tmov.s\t$f0,$f2 */\n/* \t... */\nvoid get_percent(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'get_percent': unmodelled control transfer 'bc1t' at 0x44 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":39,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'get_percent': unmodelled control transfer 'bc1t' at 0x44 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"f32 get_percent(s32 arg0, s32 arg1, s32 arg2) {\n f32 temp_f0;\n f32 var_f2;\n\n var_f2 = 1.0f;\n if (arg2 < arg1) {\n return 0.0f;\n }\n if (arg2 < arg0) {\n temp_f0 = (f32) (arg0 - arg1);\n if (temp_f0 != 0.0f) {\n var_f2 = (f32) (arg2 - arg1) / temp_f0;\n if (var_f2 > 1.0f) {\n var_f2 = 1.0f;\n }\n }\n }\n return var_f2;\n}\n","score":12,"maxScore":33,"compileErrors":null,"breakdown":{"insert":3,"delete":2,"replace":4,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":12,"maxScore":33,"ratio":0.36363636363636365,"kinds":{"insert":3,"delete":2,"replace":4,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `get_percent` — benchmark function af:get_percent:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel get_percent\n lui\t$at, 0x3f80\n mtc1\t$at, $f14\n slt\t$at, $a2, $a1\n beqz\t$at, .L20\n mov.s\t$f2, $f14\n mtc1\t$zero, $f2\n jr\t$ra\n mov.s\t$f0, $f2\n.L20:\n slt\t$at, $a2, $a0\n beqz\t$at, .L70\n subu\t$t6, $a0, $a1\n mtc1\t$t6, $f4\n mtc1\t$zero, $f6\n subu\t$t7, $a2, $a1\n cvt.s.w\t$f0, $f4\n c.eq.s\t$f6, $f0\n nop\n bc1t\t.L70\n nop\n mtc1\t$t7, $f8\n nop\n cvt.s.w\t$f10, $f8\n div.s\t$f2, $f10, $f0\n c.lt.s\t$f14, $f2\n nop\n bc1f\t.L70\n nop\n mov.s\t$f2, $f14\n.L70:\n jr\t$ra\n mov.s\t$f0, $f2\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function get_percent # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `get_percent` — benchmark function af:get_percent:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:get_percent:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x3f80\n 4:\tmtc1\tat,$f14\n 8:\tslt\tat,a2,a1\n c:\tbeqz\tat,20 \n 10:\tmov.s\t$f2,$f14\n 14:\tmtc1\tzero,$f2\n 18:\tjr\tra\n 1c:\tmov.s\t$f0,$f2\n 20:\tslt\tat,a2,a0\n 24:\tbeqz\tat,70 \n 28:\tsubu\tt6,a0,a1\n 2c:\tmtc1\tt6,$f4\n 30:\tmtc1\tzero,$f6\n 34:\tsubu\tt7,a2,a1\n 38:\tcvt.s.w\t$f0,$f4\n 3c:\tc.eq.s\t$f6,$f0\n 40:\tnop\n 44:\tbc1t\t70 \n 48:\tnop\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f10,$f8\n 58:\tdiv.s\t$f2,$f10,$f0\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tnop\n 64:\tbc1f\t70 \n 68:\tnop\n 6c:\tmov.s\t$f2,$f14\n 70:\tjr\tra\n 74:\tmov.s\t$f0,$f2\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 get_percent\n\n\nContents of section .text:\n 0000 3c013f80 44817000 00c5082a 10200004 <.?.D.p....*. ..\n 0010 46007086 44801000 03e00008 46001006 F.p.D.......F...\n 0020 00c4082a 10200012 00857023 448e2000 ...*. ....p#D. .\n 0030 44803000 00c57823 46802020 46003032 D.0...x#F. F.02\n 0040 00000000 4501000a 00000000 448f4000 ....E.......D.@.\n 0050 00000000 468042a0 46005083 4602703c ....F.B.F.P.F.p<\n 0060 00000000 45000002 00000000 46007086 ....E.......F.p.\n 0070 03e00008 46001006 00000000 00000000 ....F...........\nContents of section .options:\n 0000 01200000 00000000 8000c072 00000000 . .........r....\n 0010 00004d5f 00000000 00000000 00007ff0 ..M_............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c072 00000000 00004d5f 00000000 ...r......M_....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000014 000001f8 p...............\n 0010 00000005 00000350 00000001 0000020c .......P........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000038 000002b4 .......p...8....\n 0040 0000000c 000002ec 00000001 000002f8 ................\n 0050 00000000 00000000 00000001 00000340 ...............@\n 0060 0141f020 81000a81 fff72210 f4131310 .A. ......\".....\n 0070 41000000 00000000 00000001 00000000 A...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000078 20200001 00000001 ...*...x ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d336439 33326462 34353639 64613436 -3d932db4569da46\n 0140 662f752e 69006765 745f7065 7263656e f/u.i.get_percen\n 0150 74000000 6765745f 70657263 656e7400 t...get_percent.\n 0160 00000000 00000001 00000000 00000036 ...............6\n 0170 00000000 00000004 00000000 0000001e ................\n 0180 00000000 00000000 00000001 00000000 ................\n 0190 00000011 00000000 00000000 01800000 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 00000000 18200001 00000000 00000000 ..... ..........\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name get_percent # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:gfxopen:ido7.1","sym":"gfxopen","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["pointer","arithmetic"],"loc":3,"refSource":"Gfx* gfxopen(Gfx* gfxHead) {\n return gfxHead + 1;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/gfxalloc.c#L4-L6","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddiu\tv0,a0,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 gfxopen\n\n\nContents of section .text:\n 0000 03e00008 24820008 00000000 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 11000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000008 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d636633 31393232 62396531 63623137 -cf31922b9e1cb17\n 0130 652f752e 69006766 786f7065 6e000000 e/u.i.gfxopen...\n 0140 6766786f 70656e00 00000000 00000001 gfxopen.........\n 0150 00000000 00000032 00000000 00000004 .......2........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 gfxopen(u32 a0) {\n return a0 + 8;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 gfxopen(s32 arg0) {\n return arg0 + 8;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `gfxopen` — benchmark function af:gfxopen:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel gfxopen\n jr\t$ra\n addiu\t$v0, $a0, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function gfxopen # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `gfxopen` — benchmark function af:gfxopen:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:gfxopen:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddiu\tv0,a0,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 gfxopen\n\n\nContents of section .text:\n 0000 03e00008 24820008 00000000 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 11000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000008 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d636633 31393232 62396531 63623137 -cf31922b9e1cb17\n 0130 652f752e 69006766 786f7065 6e000000 e/u.i.gfxopen...\n 0140 6766786f 70656e00 00000000 00000001 gfxopen.........\n 0150 00000000 00000032 00000000 00000004 .......2........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name gfxopen # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:inter_float:ido7.1","sym":"inter_float","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","call"],"loc":9,"refSource":"void inter_float(f32* pValue, f32 arg1, s32 stepCount) {\n if (stepCount <= 0) {\n *pValue = arg1;\n } else {\n f32 diff = arg1 - *pValue;\n\n *pValue += diff / stepCount;\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L196-L204","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tbgtzl\ta2,18 \n 8:\tmtc1\ta2,$f4\n c:\tjr\tra\n 10:\tswc1\t$f12,0(a0)\n 14:\tmtc1\ta2,$f4\n 18:\tlwc1\t$f2,0(a0)\n 1c:\tcvt.s.w\t$f6,$f4\n 20:\tsub.s\t$f0,$f12,$f2\n 24:\tdiv.s\t$f8,$f0,$f6\n 28:\tadd.s\t$f10,$f2,$f8\n 2c:\tswc1\t$f10,0(a0)\n 30:\tjr\tra\n 34:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000038 inter_float\n\n\nContents of section .text:\n 0000 44856000 5cc00004 44862000 03e00008 D.`.\\...D. .....\n 0010 e48c0000 44862000 c4820000 468021a0 ....D. .....F.!.\n 0020 46026001 46060203 46081280 e48a0000 F.`.F...F.......\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00001fd7 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00001fd7 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000e 0000000c 000001b8 p...............\n 0010 00000005 00000308 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000038 0000026c .......(...8...l\n 0040 0000000c 000002a4 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 00111130 f010f012 21000000 00000000 ...0....!.......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 00000038 ..... .....*...8\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d646434 38643136 real-ido-dd48d16\n 0130 36626162 37663466 362f752e 6900696e 6bab7f4f6/u.i.in\n 0140 7465725f 666c6f61 74000000 696e7465 ter_float...inte\n 0150 725f666c 6f617400 00000000 00000001 r_float.........\n 0160 00000000 00000036 00000000 00000004 .......6........\n 0170 00000000 0000000e 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000009 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'inter_float' — lift: cannot lift 'inter_float': unmodelled control transfer 'bgtzl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta1,$f12 */\n/* 4:\tbgtzl\ta2,18 */\n/* 8:\tmtc1\ta2,$f4 */\n/* c:\tjr\tra */\n/* 10:\tswc1\t$f12,0(a0) */\n/* 14:\tmtc1\ta2,$f4 */\n/* 18:\tlwc1\t$f2,0(a0) */\n/* 1c:\tcvt.s.w\t$f6,$f4 */\n/* 20:\tsub.s\t$f0,$f12,$f2 */\n/* 24:\tdiv.s\t$f8,$f0,$f6 */\n/* 28:\tadd.s\t$f10,$f2,$f8 */\n/* 2c:\tswc1\t$f10,0(a0) */\n/* 30:\tjr\tra */\n/* 34:\tnop */\n/* \t... */\nvoid inter_float(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'inter_float': unmodelled control transfer 'bgtzl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'inter_float': unmodelled control transfer 'bgtzl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void inter_float(f32 *arg0, f32 arg1, s32 arg2) {\n f32 temp_f2;\n\n if (arg2 <= 0) {\n *arg0 = arg1;\n return;\n }\n temp_f2 = *arg0;\n *arg0 = temp_f2 + ((arg1 - temp_f2) / (f32) arg2);\n}\n","score":8,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":8},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":8,"maxScore":14,"ratio":0.5714285714285714,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":8}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `inter_float` — benchmark function af:inter_float:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel inter_float\n mtc1\t$a1, $f12\n bgtzl\t$a2, .L18\n mtc1\t$a2, $f4\n jr\t$ra\n swc1\t$f12, 0($a0)\n mtc1\t$a2, $f4\n.L18:\n lwc1\t$f2, 0($a0)\n cvt.s.w\t$f6, $f4\n sub.s\t$f0, $f12, $f2\n div.s\t$f8, $f0, $f6\n add.s\t$f10, $f2, $f8\n swc1\t$f10, 0($a0)\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function inter_float # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `inter_float` — benchmark function af:inter_float:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:inter_float:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tbgtzl\ta2,18 \n 8:\tmtc1\ta2,$f4\n c:\tjr\tra\n 10:\tswc1\t$f12,0(a0)\n 14:\tmtc1\ta2,$f4\n 18:\tlwc1\t$f2,0(a0)\n 1c:\tcvt.s.w\t$f6,$f4\n 20:\tsub.s\t$f0,$f12,$f2\n 24:\tdiv.s\t$f8,$f0,$f6\n 28:\tadd.s\t$f10,$f2,$f8\n 2c:\tswc1\t$f10,0(a0)\n 30:\tjr\tra\n 34:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000038 inter_float\n\n\nContents of section .text:\n 0000 44856000 5cc00004 44862000 03e00008 D.`.\\...D. .....\n 0010 e48c0000 44862000 c4820000 468021a0 ....D. .....F.!.\n 0020 46026001 46060203 46081280 e48a0000 F.`.F...F.......\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00001fd7 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00001fd7 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000e 0000000c 000001b8 p...............\n 0010 00000005 00000308 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000038 0000026c .......(...8...l\n 0040 0000000c 000002a4 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 00111130 f010f012 21000000 00000000 ...0....!.......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 00000038 ..... .....*...8\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d646434 38643136 real-ido-dd48d16\n 0130 36626162 37663466 362f752e 6900696e 6bab7f4f6/u.i.in\n 0140 7465725f 666c6f61 74000000 696e7465 ter_float...inte\n 0150 725f666c 6f617400 00000000 00000001 r_float.........\n 0160 00000000 00000036 00000000 00000004 .......6........\n 0170 00000000 0000000e 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000009 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name inter_float # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:lbRk_IsKyuurekiLeapYear:ido7.1","sym":"lbRk_IsKyuurekiLeapYear","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["array","branch","arithmetic"],"loc":7,"refSource":"s32 lbRk_IsKyuurekiLeapYear(s32 year) {\n if (l_lbRk_leapdays[year - lbRk_YEAR_MIN] != 0) {\n return 1;\n };\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L69-L75","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a0,0x2\n 4:\tlui\tt7,0x0\n 8:\taddu\tt7,t7,t6\n c:\tlw\tt7,-8000(t7)\n 10:\tmove\tv0,zero\n 14:\tbeqz\tt7,24 \n 18:\tnop\n 1c:\tjr\tra\n 20:\tli\tv0,1\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/af/ctx-a9b48a7c4c9b.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c lbRk_IsKyuurekiLeapYear\n00000000 O *UND*\t00000084 l_lbRk_leapdays\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 l_lbRk_leapdays\n0000000c R_MIPS_LO16 l_lbRk_leapdays\n\n\nContents of section .text:\n 0000 00047080 3c0f0000 01ee7821 8defe0c0 ..p.<.....x!....\n 0010 00001025 11e00003 00000000 03e00008 ...%............\n 0020 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000008 000001e8 p...............\n 0010 00000006 0000036c 00000001 000001f0 .......l........\n 0020 00000004 00000224 00000000 00000000 .......$........\n 0030 00000011 00000254 00000044 00000298 .......T...D....\n 0040 00000028 000002dc 00000001 00000304 ...(............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 1330d111 21000000 00000000 00000001 .0..!...........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000002c 20200001 . .....*..., ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d356135 31643436 34373565 -ido-5a51d46475e\n 0130 33623231 342f752e 69006c62 526b5f49 3b214/u.i.lbRk_I\n 0140 734b7975 7572656b 694c6561 70596561 sKyuurekiLeapYea\n 0150 72000000 6c62526b 5f49734b 79757572 r...lbRk_IsKyuur\n 0160 656b694c 65617059 65617200 6c5f6c62 ekiLeapYear.l_lb\n 0170 526b5f6c 65617064 61797300 00000000 Rk_leapdays.....\n 0180 00000001 00000000 00000042 00000000 ...........B....\n 0190 00000004 00000000 0000000b 00000000 ................\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 00000005 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000018 00000000 . ..............\n 01e0 04cfffff 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 7fffffff ................\n 0200 00000000 7fffffff 00000001 00000000 ................\n 0210 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 lbRk_IsKyuurekiLeapYear(u32 a0) {\n if (((s32 *)(0 + (a0 << 2)))[-2000] != 0) {\n return 1;\n } else {\n return 0;\n }\n}\n","score":3,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 lbRk_IsKyuurekiLeapYear(s32 year) {\n if (l_lbRk_leapdays[year] != 0) {\n return 1;\n }\n return 0;\n}\n","score":2,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":11,"ratio":0.18181818181818182,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lbRk_IsKyuurekiLeapYear` — benchmark function af:lbRk_IsKyuurekiLeapYear:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_IsKyuurekiLeapYear\n sll\t$t6, $a0, 0x2\n lui\t$t7, %hi(l_lbRk_leapdays)\n addu\t$t7, $t7, $t6\n lw\t$t7, %lo(l_lbRk_leapdays)($t7)\n move\t$v0, $zero\n beqz\t$t7, .L24\n nop\n jr\t$ra\n li\t$v0, 1\n.L24:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-a9b48a7c4c9b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 lbRk_IsKyuurekiLeapYear(s32 year);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_IsKyuurekiLeapYear # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_IsKyuurekiLeapYear` — benchmark function af:lbRk_IsKyuurekiLeapYear:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_IsKyuurekiLeapYear:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a0,0x2\n 4:\tlui\tt7,0x0\n 8:\taddu\tt7,t7,t6\n c:\tlw\tt7,-8000(t7)\n 10:\tmove\tv0,zero\n 14:\tbeqz\tt7,24 \n 18:\tnop\n 1c:\tjr\tra\n 20:\tli\tv0,1\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c lbRk_IsKyuurekiLeapYear\n00000000 O *UND*\t00000084 l_lbRk_leapdays\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 l_lbRk_leapdays\n0000000c R_MIPS_LO16 l_lbRk_leapdays\n\n\nContents of section .text:\n 0000 00047080 3c0f0000 01ee7821 8defe0c0 ..p.<.....x!....\n 0010 00001025 11e00003 00000000 03e00008 ...%............\n 0020 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000008 000001e8 p...............\n 0010 00000006 0000036c 00000001 000001f0 .......l........\n 0020 00000004 00000224 00000000 00000000 .......$........\n 0030 00000011 00000254 00000044 00000298 .......T...D....\n 0040 00000028 000002dc 00000001 00000304 ...(............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 1330d111 21000000 00000000 00000001 .0..!...........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000002c 20200001 . .....*..., ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d356135 31643436 34373565 -ido-5a51d46475e\n 0130 33623231 342f752e 69006c62 526b5f49 3b214/u.i.lbRk_I\n 0140 734b7975 7572656b 694c6561 70596561 sKyuurekiLeapYea\n 0150 72000000 6c62526b 5f49734b 79757572 r...lbRk_IsKyuur\n 0160 656b694c 65617059 65617200 6c5f6c62 ekiLeapYear.l_lb\n 0170 526b5f6c 65617064 61797300 00000000 Rk_leapdays.....\n 0180 00000001 00000000 00000042 00000000 ...........B....\n 0190 00000004 00000000 0000000b 00000000 ................\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 00000005 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000018 00000000 . ..............\n 01e0 04cfffff 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 7fffffff ................\n 0200 00000000 7fffffff 00000001 00000000 ................\n 0210 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_IsKyuurekiLeapYear # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:lbRk_IsLeapMonth:ido7.1","sym":"lbRk_IsLeapMonth","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch","arithmetic"],"loc":7,"refSource":"s32 lbRk_IsLeapMonth(s32 month) {\n if (month == lbRk_KYUU_LEAP_MONTH) {\n return 1;\n }\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L77-L83","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,13\n 4:\tbne\ta0,at,14 \n 8:\tmove\tv0,zero\n c:\tjr\tra\n 10:\tli\tv0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c lbRk_IsLeapMonth\n\n\nContents of section .text:\n 0000 2401000d 14810003 00001025 03e00008 $..........%....\n 0010 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000198 p...............\n 0010 00000005 000002ec 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 0000003c 00000244 ...........<...D\n 0040 00000014 00000280 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1130e121 00000000 00000001 00000000 .0.!............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 0000001c 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d626639 33623861 30623438 66396139 -bf93b8a0b48f9a9\n 0130 612f752e 69006c62 526b5f49 734c6561 a/u.i.lbRk_IsLea\n 0140 704d6f6e 74680000 6c62526b 5f49734c pMonth..lbRk_IsL\n 0150 6561704d 6f6e7468 00000000 00000000 eapMonth........\n 0160 00000001 00000000 0000003b 00000000 ...........;....\n 0170 00000004 00000000 00000007 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000004 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 lbRk_IsLeapMonth(u32 a0) {\n if (a0 == 13) {\n return 1;\n } else {\n return 0;\n }\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 lbRk_IsLeapMonth(s32 arg0) {\n if (arg0 == 0xD) {\n return 1;\n }\n return 0;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lbRk_IsLeapMonth` — benchmark function af:lbRk_IsLeapMonth:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_IsLeapMonth\n li\t$at, 13\n bne\t$a0, $at, .L14\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_IsLeapMonth # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_IsLeapMonth` — benchmark function af:lbRk_IsLeapMonth:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_IsLeapMonth:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,13\n 4:\tbne\ta0,at,14 \n 8:\tmove\tv0,zero\n c:\tjr\tra\n 10:\tli\tv0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c lbRk_IsLeapMonth\n\n\nContents of section .text:\n 0000 2401000d 14810003 00001025 03e00008 $..........%....\n 0010 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000198 p...............\n 0010 00000005 000002ec 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 0000003c 00000244 ...........<...D\n 0040 00000014 00000280 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1130e121 00000000 00000001 00000000 .0.!............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 0000001c 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d626639 33623861 30623438 66396139 -bf93b8a0b48f9a9\n 0130 612f752e 69006c62 526b5f49 734c6561 a/u.i.lbRk_IsLea\n 0140 704d6f6e 74680000 6c62526b 5f49734c pMonth..lbRk_IsL\n 0150 6561704d 6f6e7468 00000000 00000000 eapMonth........\n 0160 00000001 00000000 0000003b 00000000 ...........;....\n 0170 00000004 00000000 00000007 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000004 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_IsLeapMonth # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:lbRk_SeirekiDays:ido7.1","sym":"lbRk_SeirekiDays","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["array","arithmetic","branch"],"loc":9,"refSource":"s32 lbRk_SeirekiDays(s32 year, s32 month) {\n s32 idx = 0;\n\n if ((year % 4) == 0) {\n idx = 1;\n }\n\n return t_seiyo_days_tbl[idx][month];\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L51-L59","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\tt6,a0,0x3\n 4:\tbnez\tt6,10 \n 8:\tmove\tv1,zero\n c:\tli\tv1,1\n 10:\tsll\tt7,v1,0x2\n 14:\tsubu\tt7,t7,v1\n 18:\tsll\tt7,t7,0x2\n 1c:\taddu\tt7,t7,v1\n 20:\taddu\tt8,t7,a1\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t8\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/af/ctx-8aa31dab04e4.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 lbRk_SeirekiDays\n00000000 O *UND*\t0000001a t_seiyo_days_tbl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 t_seiyo_days_tbl\n00000030 R_MIPS_LO16 t_seiyo_days_tbl\n\n\nContents of section .text:\n 0000 308e0003 15c00002 00001825 24030001 0..........%$...\n 0010 00037880 01e37823 000f7880 01e37821 ..x...x#..x...x!\n 0020 01e5c021 3c020000 00581021 03e00008 ...!<....X.!....\n 0030 90420000 00000000 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 8100c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001f8 p...............\n 0010 00000006 0000036c 00000001 000001fc .......l........\n 0020 00000004 00000230 00000000 00000000 .......0........\n 0030 00000011 00000260 0000003c 000002a4 .......`...<....\n 0040 00000024 000002e0 00000001 00000304 ...$............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 21f02028 00000000 00000001 00000000 !. (............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000009 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000034 20200001 00000001 ...*...4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363334 39303562 35613031 64633739 -634905b5a01dc79\n 0130 652f752e 69006c62 526b5f53 65697265 e/u.i.lbRk_Seire\n 0140 6b694461 79730000 6c62526b 5f536569 kiDays..lbRk_Sei\n 0150 72656b69 44617973 00745f73 6569796f rekiDays.t_seiyo\n 0160 5f646179 735f7462 6c000000 00000000 _days_tbl.......\n 0170 00000001 00000000 0000003b 00000000 ...........;....\n 0180 00000004 00000000 0000000d 00000000 ................\n 0190 00000000 00000001 00000000 00000011 ................\n 01a0 00000000 00000000 01800000 00000000 ................\n 01b0 00000004 00000000 00000000 00000000 ................\n 01c0 18200001 00000000 00000011 00000000 . ..............\n 01d0 04cfffff 00000000 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 7fffffff 00000001 00000000 ................\n 0200 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'lbRk_SeirekiDays' — lift: cannot lift 'lbRk_SeirekiDays': %hi(t_seiyo_days_tbl) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tandi\tt6,a0,0x3 */\n/* 4:\tbnez\tt6,10 */\n/* 8:\tmove\tv1,zero */\n/* c:\tli\tv1,1 */\n/* 10:\tsll\tt7,v1,0x2 */\n/* 14:\tsubu\tt7,t7,v1 */\n/* 18:\tsll\tt7,t7,0x2 */\n/* 1c:\taddu\tt7,t7,v1 */\n/* 20:\taddu\tt8,t7,a1 */\n/* 24:\tlui\tv0,0x0 */\n/* 28:\taddu\tv0,v0,t8 */\n/* 2c:\tjr\tra */\n/* 30:\tlbu\tv0,0(v0) */\n/* \t... */\nvoid lbRk_SeirekiDays(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'lbRk_SeirekiDays': %hi(t_seiyo_days_tbl) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'lbRk_SeirekiDays': %hi(t_seiyo_days_tbl) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 lbRk_SeirekiDays(s32 year, s32 month) {\n s32 var_v1;\n\n var_v1 = 0;\n if (!(year & 3)) {\n var_v1 = 1;\n }\n return (s32) (*t_seiyo_days_tbl)[(var_v1 * 0xD) + month];\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lbRk_SeirekiDays` — benchmark function af:lbRk_SeirekiDays:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_SeirekiDays\n andi\t$t6, $a0, 0x3\n bnez\t$t6, .L10\n move\t$v1, $zero\n li\t$v1, 1\n.L10:\n sll\t$t7, $v1, 0x2\n subu\t$t7, $t7, $v1\n sll\t$t7, $t7, 0x2\n addu\t$t7, $t7, $v1\n addu\t$t8, $t7, $a1\n lui\t$v0, %hi(t_seiyo_days_tbl)\n addu\t$v0, $v0, $t8\n jr\t$ra\n lbu\t$v0, %lo(t_seiyo_days_tbl)($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-8aa31dab04e4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 lbRk_SeirekiDays(s32 year, s32 month);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_SeirekiDays # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_SeirekiDays` — benchmark function af:lbRk_SeirekiDays:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_SeirekiDays:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\tt6,a0,0x3\n 4:\tbnez\tt6,10 \n 8:\tmove\tv1,zero\n c:\tli\tv1,1\n 10:\tsll\tt7,v1,0x2\n 14:\tsubu\tt7,t7,v1\n 18:\tsll\tt7,t7,0x2\n 1c:\taddu\tt7,t7,v1\n 20:\taddu\tt8,t7,a1\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t8\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 lbRk_SeirekiDays\n00000000 O *UND*\t0000001a t_seiyo_days_tbl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 t_seiyo_days_tbl\n00000030 R_MIPS_LO16 t_seiyo_days_tbl\n\n\nContents of section .text:\n 0000 308e0003 15c00002 00001825 24030001 0..........%$...\n 0010 00037880 01e37823 000f7880 01e37821 ..x...x#..x...x!\n 0020 01e5c021 3c020000 00581021 03e00008 ...!<....X.!....\n 0030 90420000 00000000 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 8100c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001f8 p...............\n 0010 00000006 0000036c 00000001 000001fc .......l........\n 0020 00000004 00000230 00000000 00000000 .......0........\n 0030 00000011 00000260 0000003c 000002a4 .......`...<....\n 0040 00000024 000002e0 00000001 00000304 ...$............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 21f02028 00000000 00000001 00000000 !. (............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000009 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000034 20200001 00000001 ...*...4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363334 39303562 35613031 64633739 -634905b5a01dc79\n 0130 652f752e 69006c62 526b5f53 65697265 e/u.i.lbRk_Seire\n 0140 6b694461 79730000 6c62526b 5f536569 kiDays..lbRk_Sei\n 0150 72656b69 44617973 00745f73 6569796f rekiDays.t_seiyo\n 0160 5f646179 735f7462 6c000000 00000000 _days_tbl.......\n 0170 00000001 00000000 0000003b 00000000 ...........;....\n 0180 00000004 00000000 0000000d 00000000 ................\n 0190 00000000 00000001 00000000 00000011 ................\n 01a0 00000000 00000000 01800000 00000000 ................\n 01b0 00000004 00000000 00000000 00000000 ................\n 01c0 18200001 00000000 00000011 00000000 . ..............\n 01d0 04cfffff 00000000 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 7fffffff 00000001 00000000 ................\n 0200 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_SeirekiDays # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:limiter:ido7.1","sym":"limiter","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","macro"],"loc":7,"refSource":"f32 limiter(f32 val, f32 max) {\n if (val < 0.0f) {\n return CLAMP_MIN(val, -max);\n } else {\n return CLAMP_MAX(val, max);\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L50-L56","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f14,$f12\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f12,$f0\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f14,$f12\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 limiter\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460c703c 46007007 4600603c E...F.p: */\n/* 0:\tmtc1\tzero,$f4 */\n/* 4:\tnop */\n/* 8:\tc.lt.s\t$f12,$f4 */\n/* c:\tnop */\n/* 10:\tbc1fl\t44 */\n/* 14:\tc.lt.s\t$f14,$f12 */\n/* 18:\tneg.s\t$f0,$f14 */\n/* 1c:\tc.lt.s\t$f12,$f0 */\n/* 20:\tnop */\n/* 24:\tbc1fl\t38 */\n/* 28:\tmov.s\t$f2,$f12 */\n/* 2c:\tjr\tra */\n/* 30:\tnop */\n/* 34:\tmov.s\t$f2,$f12 */\n/* 38:\tjr\tra */\n/* 3c:\tmov.s\t$f0,$f2 */\n/* 40:\tc.lt.s\t$f14,$f12 */\n/* 44:\tnop */\n/* 48:\tbc1fl\t5c */\n/* 4c:\tmov.s\t$f2,$f12 */\n/* 50:\tb\t5c */\n/* 54:\tmov.s\t$f2,$f14 */\n/* 58:\tmov.s\t$f2,$f12 */\n/* 5c:\tmov.s\t$f0,$f2 */\n/* 60:\tjr\tra */\n/* 64:\tnop */\n/* \t... */\nvoid limiter(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'limiter': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":35,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'limiter': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"f32 limiter(f32 arg0, f32 arg1) {\n f32 temp_f0;\n f32 var_f2;\n\n if (arg0 < 0.0f) {\n temp_f0 = -arg1;\n if (arg0 < temp_f0) {\n return temp_f0;\n }\n return arg0;\n }\n if (arg1 < arg0) {\n var_f2 = arg1;\n } else {\n var_f2 = arg0;\n }\n return var_f2;\n}\n","score":8,"maxScore":27,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":8,"maxScore":27,"ratio":0.2962962962962963,"kinds":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `limiter` — benchmark function af:limiter:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel limiter\n mtc1\t$zero, $f4\n nop\n c.lt.s\t$f12, $f4\n nop\n bc1fl\t.L44\n c.lt.s\t$f14, $f12\n neg.s\t$f0, $f14\n c.lt.s\t$f12, $f0\n nop\n bc1fl\t.L38\n mov.s\t$f2, $f12\n jr\t$ra\n nop\n mov.s\t$f2, $f12\n.L38:\n jr\t$ra\n mov.s\t$f0, $f2\n c.lt.s\t$f14, $f12\n.L44:\n nop\n bc1fl\t.L5c\n mov.s\t$f2, $f12\n b\t.L5c\n mov.s\t$f2, $f14\n mov.s\t$f2, $f12\n.L5c:\n mov.s\t$f0, $f2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function limiter # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `limiter` — benchmark function af:limiter:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:limiter:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f14,$f12\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f12,$f0\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f14,$f12\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 limiter\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460c703c 46007007 4600603c E...F.pprev = NULL;\n this->next = NULL;\n return this;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/listalloc.c#L4-L8","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,0(a0)\n 4:\tsw\tzero,4(a0)\n 8:\tjr\tra\n c:\tmove\tv0,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ListAlloc_Init\n\n\nContents of section .text:\n 0000 ac800000 ac800004 03e00008 00801025 ...............%\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000188 p...............\n 0010 00000005 000002d8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 0000003c 00000234 ...........<...4\n 0040 00000010 00000270 00000001 00000280 .......p........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 10101100 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000007 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000010 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d613563 33653965 64653539 61393439 -a5c3e9ede59a949\n 0130 382f752e 69004c69 7374416c 6c6f635f 8/u.i.ListAlloc_\n 0140 496e6974 00000000 4c697374 416c6c6f Init....ListAllo\n 0150 635f496e 69740000 00000000 00000001 c_Init..........\n 0160 00000000 00000039 00000000 00000004 .......9........\n 0170 00000000 00000004 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000003 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 * ListAlloc_Init(s32 * a0) {\n *a0 = 0;\n a0[1] = 0;\n return a0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *ListAlloc_Init(void *arg0) {\n arg0->unk0 = 0;\n arg0->unk4 = 0;\n return arg0;\n}\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 5: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 6: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ListAlloc_Init` — benchmark function af:ListAlloc_Init:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ListAlloc_Init\n sw\t$zero, 0($a0)\n sw\t$zero, 4($a0)\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ListAlloc_Init # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ListAlloc_Init` — benchmark function af:ListAlloc_Init:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:ListAlloc_Init:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,0(a0)\n 4:\tsw\tzero,4(a0)\n 8:\tjr\tra\n c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ListAlloc_Init\n\n\nContents of section .text:\n 0000 ac800000 ac800004 03e00008 00801025 ...............%\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000188 p...............\n 0010 00000005 000002d8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 0000003c 00000234 ...........<...4\n 0040 00000010 00000270 00000001 00000280 .......p........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 10101100 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000007 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000010 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d613563 33653965 64653539 61393439 -a5c3e9ede59a949\n 0130 382f752e 69004c69 7374416c 6c6f635f 8/u.i.ListAlloc_\n 0140 496e6974 00000000 4c697374 416c6c6f Init....ListAllo\n 0150 635f496e 69740000 00000000 00000001 c_Init..........\n 0160 00000000 00000039 00000000 00000004 .......9........\n 0170 00000000 00000004 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000003 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ListAlloc_Init # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mem_clear:ido7.1","sym":"mem_clear","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","pointer","memory"],"loc":5,"refSource":"void mem_clear(u8* ptr, size_t len, u8 value) {\n size_t i;\n\n for (i = 0; i < len; i++) {*ptr++ = value;}\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L23-L29","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tandi\ta2,a2,0xff\n 8:\tbeqz\ta1,4c \n c:\tmove\tv0,zero\n 10:\tandi\ta3,a1,0x3\n 14:\tbeqz\ta3,30 \n 18:\tmove\tv1,a3\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\ta2,0(a0)\n 24:\tbne\tv1,v0,1c \n 28:\taddiu\ta0,a0,1\n 2c:\tbeq\tv0,a1,4c \n 30:\taddiu\tv0,v0,4\n 34:\tsb\ta2,0(a0)\n 38:\tsb\ta2,1(a0)\n 3c:\tsb\ta2,2(a0)\n 40:\tsb\ta2,3(a0)\n 44:\tbne\tv0,a1,30 \n 48:\taddiu\ta0,a0,4\n 4c:\tjr\tra\n 50:\tnop\n\t...\n","proto":{"mem_clear":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000054 mem_clear\n\n\nContents of section .text:\n 0000 afa60008 30c600ff 10a00010 00001025 ....0..........%\n 0010 30a70003 10e00006 00e01825 24420001 0..........%$B..\n 0020 a0860000 1462fffd 24840001 10450007 .....b..$....E..\n 0030 24420004 a0860000 a0860001 a0860002 $B..............\n 0040 a0860003 1445fffa 24840004 03e00008 .....E..$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000015 00000004 000001c8 p...............\n 0010 00000005 0000030c 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 0000000c 000002a8 00000001 000002b4 ................\n 0050 00000000 00000000 00000001 000002fc ................\n 0060 01280711 00000000 00000001 00000000 .(..............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000054 20200001 00000001 ...*...T ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363563 30383663 32383062 37393133 -65c086c280b7913\n 0130 312f752e 69006d65 6d5f636c 65617200 1/u.i.mem_clear.\n 0140 6d656d5f 636c6561 72000000 00000000 mem_clear.......\n 0150 00000001 00000000 00000034 00000000 ...........4....\n 0160 00000004 00000000 00000015 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000004 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'mem_clear' — lift: cannot lift 'mem_clear': branch to 0x30 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta2,8(sp) */\n/* 4:\tandi\ta2,a2,0xff */\n/* 8:\tbeqz\ta1,4c */\n/* c:\tmove\tv0,zero */\n/* 10:\tandi\ta3,a1,0x3 */\n/* 14:\tbeqz\ta3,30 */\n/* 18:\tmove\tv1,a3 */\n/* 1c:\taddiu\tv0,v0,1 */\n/* 20:\tsb\ta2,0(a0) */\n/* 24:\tbne\tv1,v0,1c */\n/* 28:\taddiu\ta0,a0,1 */\n/* 2c:\tbeq\tv0,a1,4c */\n/* 30:\taddiu\tv0,v0,4 */\n/* 34:\tsb\ta2,0(a0) */\n/* 38:\tsb\ta2,1(a0) */\n/* 3c:\tsb\ta2,2(a0) */\n/* 40:\tsb\ta2,3(a0) */\n/* 44:\tbne\tv0,a1,30 */\n/* 48:\taddiu\ta0,a0,4 */\n/* 4c:\tjr\tra */\n/* 50:\tnop */\n/* \t... */\nvoid mem_clear(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'mem_clear': branch to 0x30 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":30,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'mem_clear': branch to 0x30 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 mem_clear(s8 *arg0, s32 arg1, s32 arg2) {\n s32 temp_a3;\n s32 var_v0;\n s8 *var_a0;\n s8 temp_a2;\n\n var_a0 = arg0;\n temp_a2 = arg2 & 0xFF;\n var_v0 = 0;\n if (arg1 != 0) {\n temp_a3 = arg1 & 3;\n if (temp_a3 != 0) {\n do {\n var_v0 += 1;\n *var_a0 = temp_a2;\n var_a0 += 1;\n } while (temp_a3 != var_v0);\n if (var_v0 != arg1) {\n goto loop_6;\n }\n return var_v0 + 4;\n }\n do {\nloop_6:\n var_v0 += 4;\n var_a0->unk0 = temp_a2;\n var_a0->unk1 = temp_a2;\n var_a0->unk2 = temp_a2;\n var_a0->unk3 = temp_a2;\n var_a0 += 4;\n } while (var_v0 != arg1);\n /* Duplicate return node #7. Try simplifying control flow for better match */\n return var_v0;\n }\n return var_v0;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":88,"lines":35,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 2: Syntax Error","cfe: Error: /c.i, line 3: Empty declaration specifiers","cfe: Error: /c.i, line 4: Syntax Error","cfe: Error: /c.i, line 4: Empty declaration specifiers","cfe: Error: /c.i, line 5: Syntax Error"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mem_clear` — benchmark function af:mem_clear:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_clear\n sw\t$a2, 8($sp)\n andi\t$a2, $a2, 0xff\n beqz\t$a1, .L4c\n move\t$v0, $zero\n andi\t$a3, $a1, 0x3\n beqz\t$a3, .L30\n move\t$v1, $a3\n.L1c:\n addiu\t$v0, $v0, 1\n sb\t$a2, 0($a0)\n bne\t$v1, $v0, .L1c\n addiu\t$a0, $a0, 1\n beq\t$v0, $a1, .L4c\n.L30:\n addiu\t$v0, $v0, 4\n sb\t$a2, 0($a0)\n sb\t$a2, 1($a0)\n sb\t$a2, 2($a0)\n sb\t$a2, 3($a0)\n bne\t$v0, $a1, .L30\n addiu\t$a0, $a0, 4\n.L4c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_clear # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mem_clear` — benchmark function af:mem_clear:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_clear:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tandi\ta2,a2,0xff\n 8:\tbeqz\ta1,4c \n c:\tmove\tv0,zero\n 10:\tandi\ta3,a1,0x3\n 14:\tbeqz\ta3,30 \n 18:\tmove\tv1,a3\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\ta2,0(a0)\n 24:\tbne\tv1,v0,1c \n 28:\taddiu\ta0,a0,1\n 2c:\tbeq\tv0,a1,4c \n 30:\taddiu\tv0,v0,4\n 34:\tsb\ta2,0(a0)\n 38:\tsb\ta2,1(a0)\n 3c:\tsb\ta2,2(a0)\n 40:\tsb\ta2,3(a0)\n 44:\tbne\tv0,a1,30 \n 48:\taddiu\ta0,a0,4\n 4c:\tjr\tra\n 50:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000054 mem_clear\n\n\nContents of section .text:\n 0000 afa60008 30c600ff 10a00010 00001025 ....0..........%\n 0010 30a70003 10e00006 00e01825 24420001 0..........%$B..\n 0020 a0860000 1462fffd 24840001 10450007 .....b..$....E..\n 0030 24420004 a0860000 a0860001 a0860002 $B..............\n 0040 a0860003 1445fffa 24840004 03e00008 .....E..$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000015 00000004 000001c8 p...............\n 0010 00000005 0000030c 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 0000000c 000002a8 00000001 000002b4 ................\n 0050 00000000 00000000 00000001 000002fc ................\n 0060 01280711 00000000 00000001 00000000 .(..............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000054 20200001 00000001 ...*...T ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363563 30383663 32383062 37393133 -65c086c280b7913\n 0130 312f752e 69006d65 6d5f636c 65617200 1/u.i.mem_clear.\n 0140 6d656d5f 636c6561 72000000 00000000 mem_clear.......\n 0150 00000001 00000000 00000034 00000000 ...........4....\n 0160 00000004 00000000 00000015 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000004 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"mem_clear\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_clear # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mem_cmp:ido7.1","sym":"mem_cmp","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","pointer","branch"],"loc":11,"refSource":"s32 mem_cmp(u8* ptr1, u8* ptr2, size_t len) {\n while (len != 0) {\n if (*ptr1 != *ptr2) {\n return 0;\n }\n ptr1++;\n ptr2++;\n len--;\n }\n return 1;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L31-L41","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,c8 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,44 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a0)\n 18:\tlbu\tt7,0(a1)\n 1c:\taddiu\ta0,a0,1\n 20:\taddiu\ta2,a2,-1\n 24:\tbeq\tt6,t7,34 \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,zero\n 34:\tbne\tv0,a2,14 \n 38:\taddiu\ta1,a1,1\n 3c:\tbeqzl\ta2,cc \n 40:\tli\tv0,1\n 44:\tlbu\tt8,0(a0)\n 48:\tlbu\tt9,0(a1)\n 4c:\taddiu\ta2,a2,-4\n 50:\tbeql\tt8,t9,64 \n 54:\tlbu\tt0,1(a0)\n 58:\tjr\tra\n 5c:\tmove\tv0,zero\n 60:\tlbu\tt0,1(a0)\n 64:\tlbu\tt1,1(a1)\n 68:\taddiu\ta0,a0,1\n 6c:\taddiu\ta1,a1,1\n 70:\tbeql\tt0,t1,84 \n 74:\tlbu\tt2,1(a0)\n 78:\tjr\tra\n 7c:\tmove\tv0,zero\n 80:\tlbu\tt2,1(a0)\n 84:\tlbu\tt3,1(a1)\n 88:\taddiu\ta0,a0,1\n 8c:\taddiu\ta1,a1,1\n 90:\tbeql\tt2,t3,a4 \n 94:\tlbu\tt4,1(a0)\n 98:\tjr\tra\n 9c:\tmove\tv0,zero\n a0:\tlbu\tt4,1(a0)\n a4:\tlbu\tt5,1(a1)\n a8:\taddiu\ta0,a0,1\n ac:\taddiu\ta0,a0,1\n b0:\tbeq\tt4,t5,c0 \n b4:\taddiu\ta1,a1,1\n b8:\tjr\tra\n bc:\tmove\tv0,zero\n c0:\tbnez\ta2,44 \n c4:\taddiu\ta1,a1,1\n c8:\tli\tv0,1\n cc:\tjr\tra\n d0:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000e0 .text\n00000000 g F .text\t000000d4 mem_cmp\n\n\nContents of section .text:\n 0000 10c00031 30c30003 00031823 1060000d ...10......#.`..\n 0010 00661021 908e0000 90af0000 24840001 .f.!........$...\n 0020 24c6ffff 11cf0003 00000000 03e00008 $...............\n 0030 00001025 1446fff7 24a50001 50c00023 ...%.F..$...P..#\n 0040 24020001 90980000 90b90000 24c6fffc $...........$...\n 0050 53190004 90880001 03e00008 00001025 S..............%\n 0060 90880001 90a90001 24840001 24a50001 ........$...$...\n 0070 51090004 908a0001 03e00008 00001025 Q..............%\n 0080 908a0001 90ab0001 24840001 24a50001 ........$...$...\n 0090 514b0004 908c0001 03e00008 00001025 QK.............%\n 00a0 908c0001 90ad0001 24840001 24840001 ........$...$...\n 00b0 118d0003 24a50001 03e00008 00001025 ....$..........%\n 00c0 14c0ffe0 24a50001 24020001 03e00008 ....$...$.......\n 00d0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300ff7c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300ff7c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000035 00000010 00000248 p......5.......H\n 0010 00000005 00000394 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 00000008 00000334 00000001 0000033c .......4.......<\n 0050 00000000 00000000 00000001 00000384 ................\n 0060 180711f0 1111e140 10b80803 82000800 .......@........\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000003 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000d4 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d343330 nch-real-ido-430\n 0130 33663032 61306666 39666434 302f752e 3f02a0ff9fd40/u.\n 0140 69006d65 6d5f636d 70000000 6d656d5f i.mem_cmp...mem_\n 0150 636d7000 00000000 00000001 00000000 cmp.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000035 00000000 00000000 00000001 ...5............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000f 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'mem_cmp' — lift: cannot lift 'mem_cmp': unmodelled control transfer 'beqzl' at 0x3c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tbeqz\ta2,c8 */\n/* 4:\tandi\tv1,a2,0x3 */\n/* 8:\tnegu\tv1,v1 */\n/* c:\tbeqz\tv1,44 */\n/* 10:\taddu\tv0,v1,a2 */\n/* 14:\tlbu\tt6,0(a0) */\n/* 18:\tlbu\tt7,0(a1) */\n/* 1c:\taddiu\ta0,a0,1 */\n/* 20:\taddiu\ta2,a2,-1 */\n/* 24:\tbeq\tt6,t7,34 */\n/* 28:\tnop */\n/* 2c:\tjr\tra */\n/* 30:\tmove\tv0,zero */\n/* 34:\tbne\tv0,a2,14 */\n/* 38:\taddiu\ta1,a1,1 */\n/* 3c:\tbeqzl\ta2,cc */\n/* 40:\tli\tv0,1 */\n/* 44:\tlbu\tt8,0(a0) */\n/* 48:\tlbu\tt9,0(a1) */\n/* 4c:\taddiu\ta2,a2,-4 */\n/* 50:\tbeql\tt8,t9,64 */\n/* 54:\tlbu\tt0,1(a0) */\n/* 58:\tjr\tra */\n/* 5c:\tmove\tv0,zero */\n/* 60:\tlbu\tt0,1(a0) */\n/* 64:\tlbu\tt1,1(a1) */\n/* 68:\taddiu\ta0,a0,1 */\n/* 6c:\taddiu\ta1,a1,1 */\n/* 70:\tbeql\tt0,t1,84 */\n/* 74:\tlbu\tt2,1(a0) */\n/* 78:\tjr\tra */\n/* 7c:\tmove\tv0,zero */\n/* 80:\tlbu\tt2,1(a0) */\n/* 84:\tlbu\tt3,1(a1) */\n/* 88:\taddiu\ta0,a0,1 */\n/* 8c:\taddiu\ta1,a1,1 */\n/* 90:\tbeql\tt2,t3,a4 */\n/* 94:\tlbu\tt4,1(a0) */\n/* 98:\tjr\tra */\n/* 9c:\tmove\tv0,zero */\n/* a0:\tlbu\tt4,1(a0) */\n/* a4:\tlbu\tt5,1(a1) */\n/* a8:\taddiu\ta0,a0,1 */\n/* ac:\taddiu\ta0,a0,1 */\n/* b0:\tbeq\tt4,t5,c0 */\n/* b4:\taddiu\ta1,a1,1 */\n/* b8:\tjr\tra */\n/* bc:\tmove\tv0,zero */\n/* c0:\tbnez\ta2,44 */\n/* c4:\taddiu\ta1,a1,1 */\n/* c8:\tli\tv0,1 */\n/* cc:\tjr\tra */\n/* d0:\tnop */\n/* \t... */\nvoid mem_cmp(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'mem_cmp': unmodelled control transfer 'beqzl' at 0x3c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":62,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'mem_cmp': unmodelled control transfer 'beqzl' at 0x3c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 mem_cmp(u8 *arg0, u8 *arg1, s32 arg2) {\n s32 temp_v0;\n s32 temp_v1;\n s32 var_a2;\n u8 *var_a0;\n u8 *var_a1;\n u8 temp_t6;\n void *temp_a0;\n void *temp_a0_2;\n void *temp_a1;\n void *temp_a1_2;\n\n var_a0 = arg0;\n var_a1 = arg1;\n var_a2 = arg2;\n if (var_a2 != 0) {\n temp_v1 = -(var_a2 & 3);\n temp_v0 = temp_v1 + var_a2;\n if (temp_v1 != 0) {\nloop_2:\n temp_t6 = *var_a0;\n var_a0 += 1;\n var_a2 -= 1;\n if (temp_t6 != *var_a1) {\n return 0;\n }\n var_a1 += 1;\n if (temp_v0 == var_a2) {\n if (var_a2 != 0) {\n goto loop_6;\n }\n /* Duplicate return node #15. Try simplifying control flow for better match */\n return 1;\n }\n goto loop_2;\n }\nloop_6:\n var_a2 -= 4;\n if (var_a0->unk0 != var_a1->unk0) {\n return 0;\n }\n temp_a0 = var_a0 + 1;\n temp_a1 = var_a1 + 1;\n if (var_a0->unk1 != var_a1->unk1) {\n return 0;\n }\n temp_a0_2 = temp_a0 + 1;\n temp_a1_2 = temp_a1 + 1;\n if (temp_a0->unk1 != temp_a1->unk1) {\n return 0;\n }\n var_a0 = temp_a0_2 + 1 + 1;\n if (temp_a0_2->unk1 != temp_a1_2->unk1) {\n return 0;\n }\n var_a1 = temp_a1_2 + 1 + 1;\n if (var_a2 == 0) {\n /* Duplicate return node #15. Try simplifying control flow for better match */\n return 1;\n }\n goto loop_6;\n }\n return 1;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":68,"lines":63,"gotos":3,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 39: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 44: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 47: Unacceptable operand of '+'.","cfe: Error: /c.i, line 48: Unacceptable operand of '+'.","cfe: Error: /c.i, line 49: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mem_cmp` — benchmark function af:mem_cmp:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_cmp\n beqz\t$a2, .Lc8\n andi\t$v1, $a2, 0x3\n negu\t$v1, $v1\n beqz\t$v1, .L44\n addu\t$v0, $v1, $a2\n.L14:\n lbu\t$t6, 0($a0)\n lbu\t$t7, 0($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a2, $a2, -1\n beq\t$t6, $t7, .L34\n nop\n jr\t$ra\n move\t$v0, $zero\n.L34:\n bne\t$v0, $a2, .L14\n addiu\t$a1, $a1, 1\n beqzl\t$a2, .Lcc\n li\t$v0, 1\n.L44:\n lbu\t$t8, 0($a0)\n lbu\t$t9, 0($a1)\n addiu\t$a2, $a2, -4\n beql\t$t8, $t9, .L64\n lbu\t$t0, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t0, 1($a0)\n.L64:\n lbu\t$t1, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a1, $a1, 1\n beql\t$t0, $t1, .L84\n lbu\t$t2, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t2, 1($a0)\n.L84:\n lbu\t$t3, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a1, $a1, 1\n beql\t$t2, $t3, .La4\n lbu\t$t4, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t4, 1($a0)\n.La4:\n lbu\t$t5, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a0, $a0, 1\n beq\t$t4, $t5, .Lc0\n addiu\t$a1, $a1, 1\n jr\t$ra\n move\t$v0, $zero\n.Lc0:\n bnez\t$a2, .L44\n addiu\t$a1, $a1, 1\n.Lc8:\n li\t$v0, 1\n.Lcc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_cmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mem_cmp` — benchmark function af:mem_cmp:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_cmp:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,c8 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,44 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a0)\n 18:\tlbu\tt7,0(a1)\n 1c:\taddiu\ta0,a0,1\n 20:\taddiu\ta2,a2,-1\n 24:\tbeq\tt6,t7,34 \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,zero\n 34:\tbne\tv0,a2,14 \n 38:\taddiu\ta1,a1,1\n 3c:\tbeqzl\ta2,cc \n 40:\tli\tv0,1\n 44:\tlbu\tt8,0(a0)\n 48:\tlbu\tt9,0(a1)\n 4c:\taddiu\ta2,a2,-4\n 50:\tbeql\tt8,t9,64 \n 54:\tlbu\tt0,1(a0)\n 58:\tjr\tra\n 5c:\tmove\tv0,zero\n 60:\tlbu\tt0,1(a0)\n 64:\tlbu\tt1,1(a1)\n 68:\taddiu\ta0,a0,1\n 6c:\taddiu\ta1,a1,1\n 70:\tbeql\tt0,t1,84 \n 74:\tlbu\tt2,1(a0)\n 78:\tjr\tra\n 7c:\tmove\tv0,zero\n 80:\tlbu\tt2,1(a0)\n 84:\tlbu\tt3,1(a1)\n 88:\taddiu\ta0,a0,1\n 8c:\taddiu\ta1,a1,1\n 90:\tbeql\tt2,t3,a4 \n 94:\tlbu\tt4,1(a0)\n 98:\tjr\tra\n 9c:\tmove\tv0,zero\n a0:\tlbu\tt4,1(a0)\n a4:\tlbu\tt5,1(a1)\n a8:\taddiu\ta0,a0,1\n ac:\taddiu\ta0,a0,1\n b0:\tbeq\tt4,t5,c0 \n b4:\taddiu\ta1,a1,1\n b8:\tjr\tra\n bc:\tmove\tv0,zero\n c0:\tbnez\ta2,44 \n c4:\taddiu\ta1,a1,1\n c8:\tli\tv0,1\n cc:\tjr\tra\n d0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000e0 .text\n00000000 g F .text\t000000d4 mem_cmp\n\n\nContents of section .text:\n 0000 10c00031 30c30003 00031823 1060000d ...10......#.`..\n 0010 00661021 908e0000 90af0000 24840001 .f.!........$...\n 0020 24c6ffff 11cf0003 00000000 03e00008 $...............\n 0030 00001025 1446fff7 24a50001 50c00023 ...%.F..$...P..#\n 0040 24020001 90980000 90b90000 24c6fffc $...........$...\n 0050 53190004 90880001 03e00008 00001025 S..............%\n 0060 90880001 90a90001 24840001 24a50001 ........$...$...\n 0070 51090004 908a0001 03e00008 00001025 Q..............%\n 0080 908a0001 90ab0001 24840001 24a50001 ........$...$...\n 0090 514b0004 908c0001 03e00008 00001025 QK.............%\n 00a0 908c0001 90ad0001 24840001 24840001 ........$...$...\n 00b0 118d0003 24a50001 03e00008 00001025 ....$..........%\n 00c0 14c0ffe0 24a50001 24020001 03e00008 ....$...$.......\n 00d0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300ff7c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300ff7c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000035 00000010 00000248 p......5.......H\n 0010 00000005 00000394 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 00000008 00000334 00000001 0000033c .......4.......<\n 0050 00000000 00000000 00000001 00000384 ................\n 0060 180711f0 1111e140 10b80803 82000800 .......@........\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000003 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000d4 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d343330 nch-real-ido-430\n 0130 33663032 61306666 39666434 302f752e 3f02a0ff9fd40/u.\n 0140 69006d65 6d5f636d 70000000 6d656d5f i.mem_cmp...mem_\n 0150 636d7000 00000000 00000001 00000000 cmp.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000035 00000000 00000000 00000001 ...5............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000f 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_cmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mem_copy:ido7.1","sym":"mem_copy","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","pointer","memory"],"loc":8,"refSource":"void mem_copy(u8* dest, u8* src, size_t len) {\n while (len != 0) {\n *dest = *src;\n src++;\n dest++;\n len--;\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L14-L21","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,64 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,34 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a1)\n 18:\taddiu\ta2,a2,-1\n 1c:\taddiu\ta1,a1,1\n 20:\taddiu\ta0,a0,1\n 24:\tbne\tv0,a2,14 \n 28:\tsb\tt6,-1(a0)\n 2c:\tbeqz\ta2,64 \n 30:\tnop\n 34:\tlbu\tt7,0(a1)\n 38:\taddiu\ta2,a2,-4\n 3c:\taddiu\ta1,a1,4\n 40:\tsb\tt7,0(a0)\n 44:\tlbu\tt8,-3(a1)\n 48:\taddiu\ta0,a0,4\n 4c:\tsb\tt8,-3(a0)\n 50:\tlbu\tt9,-2(a1)\n 54:\tsb\tt9,-2(a0)\n 58:\tlbu\tt0,-1(a1)\n 5c:\tbnez\ta2,34 \n 60:\tsb\tt0,-1(a0)\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\n","proto":{"mem_copy":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t0000006c mem_copy\n\n\nContents of section .text:\n 0000 10c00018 30c30003 00031823 10600009 ....0......#.`..\n 0010 00661021 90ae0000 24c6ffff 24a50001 .f.!....$...$...\n 0020 24840001 1446fffb a08effff 10c0000d $....F..........\n 0030 00000000 90af0000 24c6fffc 24a50004 ........$...$...\n 0040 a08f0000 90b8fffd 24840004 a098fffd ........$.......\n 0050 90b9fffe a099fffe 90a8ffff 14c0fff5 ................\n 0060 a088ffff 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001b 00000008 000001d8 p...............\n 0010 00000005 00000320 00000001 000001e0 ....... ........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000034 00000288 .......D...4....\n 0040 0000000c 000002bc 00000001 000002c8 ................\n 0050 00000000 00000000 00000001 00000310 ................\n 0060 180310f1 10f76100 00000000 00000001 ......a.........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000006c 20200001 . .....*...l ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d323863 66653965 30643932 -ido-28cfe9e0d92\n 0130 39393438 322f752e 69006d65 6d5f636f 99482/u.i.mem_co\n 0140 70790000 6d656d5f 636f7079 00000000 py..mem_copy....\n 0150 00000000 00000001 00000000 00000033 ...............3\n 0160 00000000 00000004 00000000 0000001b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000007 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'mem_copy' — structure: cannot structure 'mem_copy': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tbeqz\ta2,64 */\n/* 4:\tandi\tv1,a2,0x3 */\n/* 8:\tnegu\tv1,v1 */\n/* c:\tbeqz\tv1,34 */\n/* 10:\taddu\tv0,v1,a2 */\n/* 14:\tlbu\tt6,0(a1) */\n/* 18:\taddiu\ta2,a2,-1 */\n/* 1c:\taddiu\ta1,a1,1 */\n/* 20:\taddiu\ta0,a0,1 */\n/* 24:\tbne\tv0,a2,14 */\n/* 28:\tsb\tt6,-1(a0) */\n/* 2c:\tbeqz\ta2,64 */\n/* 30:\tnop */\n/* 34:\tlbu\tt7,0(a1) */\n/* 38:\taddiu\ta2,a2,-4 */\n/* 3c:\taddiu\ta1,a1,4 */\n/* 40:\tsb\tt7,0(a0) */\n/* 44:\tlbu\tt8,-3(a1) */\n/* 48:\taddiu\ta0,a0,4 */\n/* 4c:\tsb\tt8,-3(a0) */\n/* 50:\tlbu\tt9,-2(a1) */\n/* 54:\tsb\tt9,-2(a0) */\n/* 58:\tlbu\tt0,-1(a1) */\n/* 5c:\tbnez\ta2,34 */\n/* 60:\tsb\tt0,-1(a0) */\n/* 64:\tjr\tra */\n/* 68:\tnop */\n/* 6c:\tnop */\nvoid mem_copy(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'mem_copy': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":36,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'mem_copy': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void mem_copy(u8 *arg0, u8 *arg1, s32 arg2) {\n s32 temp_v0;\n s32 temp_v1;\n s32 var_a2;\n u8 *var_a0;\n u8 *var_a1;\n u8 temp_t6;\n u8 temp_t7;\n\n var_a0 = arg0;\n var_a1 = arg1;\n var_a2 = arg2;\n if (var_a2 != 0) {\n temp_v1 = -(var_a2 & 3);\n temp_v0 = temp_v1 + var_a2;\n if (temp_v1 != 0) {\n do {\n temp_t6 = *var_a1;\n var_a2 -= 1;\n var_a1 += 1;\n var_a0 += 1;\n var_a0->unk-1 = temp_t6;\n } while (temp_v0 != var_a2);\n if (var_a2 != 0) {\n goto loop_4;\n }\n } else {\n do {\nloop_4:\n temp_t7 = *var_a1;\n var_a2 -= 4;\n var_a1 += 4;\n *var_a0 = temp_t7;\n var_a0 += 4;\n var_a0->unk-3 = (u8) var_a1->unk-3;\n var_a0->unk-2 = (u8) var_a1->unk-2;\n var_a0->unk-1 = (u8) var_a1->unk-1;\n } while (var_a2 != 0);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":86,"lines":40,"gotos":1,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 2: Syntax Error","cfe: Error: /c.i, line 3: Empty declaration specifiers","cfe: Error: /c.i, line 4: Syntax Error","cfe: Error: /c.i, line 4: Empty declaration specifiers","cfe: Error: /c.i, line 5: Syntax Error"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mem_copy` — benchmark function af:mem_copy:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_copy\n beqz\t$a2, .L64\n andi\t$v1, $a2, 0x3\n negu\t$v1, $v1\n beqz\t$v1, .L34\n addu\t$v0, $v1, $a2\n.L14:\n lbu\t$t6, 0($a1)\n addiu\t$a2, $a2, -1\n addiu\t$a1, $a1, 1\n addiu\t$a0, $a0, 1\n bne\t$v0, $a2, .L14\n sb\t$t6, -1($a0)\n beqz\t$a2, .L64\n nop\n.L34:\n lbu\t$t7, 0($a1)\n addiu\t$a2, $a2, -4\n addiu\t$a1, $a1, 4\n sb\t$t7, 0($a0)\n lbu\t$t8, -3($a1)\n addiu\t$a0, $a0, 4\n sb\t$t8, -3($a0)\n lbu\t$t9, -2($a1)\n sb\t$t9, -2($a0)\n lbu\t$t0, -1($a1)\n bnez\t$a2, .L34\n sb\t$t0, -1($a0)\n.L64:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_copy # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mem_copy` — benchmark function af:mem_copy:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_copy:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,64 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,34 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a1)\n 18:\taddiu\ta2,a2,-1\n 1c:\taddiu\ta1,a1,1\n 20:\taddiu\ta0,a0,1\n 24:\tbne\tv0,a2,14 \n 28:\tsb\tt6,-1(a0)\n 2c:\tbeqz\ta2,64 \n 30:\tnop\n 34:\tlbu\tt7,0(a1)\n 38:\taddiu\ta2,a2,-4\n 3c:\taddiu\ta1,a1,4\n 40:\tsb\tt7,0(a0)\n 44:\tlbu\tt8,-3(a1)\n 48:\taddiu\ta0,a0,4\n 4c:\tsb\tt8,-3(a0)\n 50:\tlbu\tt9,-2(a1)\n 54:\tsb\tt9,-2(a0)\n 58:\tlbu\tt0,-1(a1)\n 5c:\tbnez\ta2,34 \n 60:\tsb\tt0,-1(a0)\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t0000006c mem_copy\n\n\nContents of section .text:\n 0000 10c00018 30c30003 00031823 10600009 ....0......#.`..\n 0010 00661021 90ae0000 24c6ffff 24a50001 .f.!....$...$...\n 0020 24840001 1446fffb a08effff 10c0000d $....F..........\n 0030 00000000 90af0000 24c6fffc 24a50004 ........$...$...\n 0040 a08f0000 90b8fffd 24840004 a098fffd ........$.......\n 0050 90b9fffe a099fffe 90a8ffff 14c0fff5 ................\n 0060 a088ffff 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001b 00000008 000001d8 p...............\n 0010 00000005 00000320 00000001 000001e0 ....... ........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000034 00000288 .......D...4....\n 0040 0000000c 000002bc 00000001 000002c8 ................\n 0050 00000000 00000000 00000001 00000310 ................\n 0060 180310f1 10f76100 00000000 00000001 ......a.........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000006c 20200001 . .....*...l ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d323863 66653965 30643932 -ido-28cfe9e0d92\n 0130 39393438 322f752e 69006d65 6d5f636f 99482/u.i.mem_co\n 0140 70790000 6d656d5f 636f7079 00000000 py..mem_copy....\n 0150 00000000 00000001 00000000 00000033 ...............3\n 0160 00000000 00000004 00000000 0000001b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000007 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"mem_copy\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_copy # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mRmTp_ItemNo2FtrSize:ido7.1","sym":"mRmTp_ItemNo2FtrSize","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["array","arithmetic","branch"],"loc":7,"refSource":"s32 mRmTp_ItemNo2FtrSize(u16 name) {\n if (name >= 0x1000 && name < 0x1ECD) {\n UNUSED s32 scoped;\n return mRmTp_ftr_size[(name - 0x1000) >> 2];\n }\n return 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_room_type.c#L455-L461","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tandi\ta0,a0,0xffff\n 8:\tslti\tat,a0,4096\n c:\tbnez\tat,34 \n 10:\tmove\tv0,zero\n 14:\tslti\tat,a0,7885\n 18:\tbeqz\tat,34 \n 1c:\taddiu\tt6,a0,-4096\n 20:\tsra\tt7,t6,0x2\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t7\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/af/ctx-2e2cc0cb59b4.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t0000003c mRmTp_ItemNo2FtrSize\n00000000 O *UND*\t00000000 mRmTp_ftr_size\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 mRmTp_ftr_size\n00000030 R_MIPS_LO16 mRmTp_ftr_size\n\n\nContents of section .text:\n 0000 afa40000 3084ffff 28811000 14200009 ....0...(.... ..\n 0010 00001025 28811ecd 10200006 248ef000 ...%(.... ..$...\n 0020 000e7883 3c020000 004f1021 03e00008 ..x.<....O.!....\n 0030 90420000 03e00008 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 a000c016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a000c016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000f 00000008 000001f8 p...............\n 0010 00000006 00000374 00000001 00000200 .......t........\n 0020 00000004 00000234 00000000 00000000 .......4........\n 0030 00000011 00000264 00000040 000002a8 .......d...@....\n 0040 00000024 000002e8 00000001 0000030c ...$............\n 0050 00000000 00000000 00000002 00000354 ...............T\n 0060 011140c1 25210000 00000000 00000001 ..@.%!..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000003c 20200001 . .....*...< ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d386261 63613133 35653337 -ido-8baca135e37\n 0130 66323333 332f752e 69006d52 6d54705f f2333/u.i.mRmTp_\n 0140 4974656d 4e6f3246 74725369 7a650000 ItemNo2FtrSize..\n 0150 6d526d54 705f4974 656d4e6f 32467472 mRmTp_ItemNo2Ftr\n 0160 53697a65 006d526d 54705f66 74725f73 Size.mRmTp_ftr_s\n 0170 697a6500 00000000 00000001 00000000 ize.............\n 0180 0000003f 00000000 00000004 00000000 ...?............\n 0190 0000000f 00000000 00000000 00000001 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 01800000 00000000 00000006 00000000 ................\n 01c0 00000000 00000000 18200001 00000000 ......... ......\n 01d0 00000015 00000000 04cfffff 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 7fffffff 00000000 7fffffff ................\n 0200 00000001 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'mRmTp_ItemNo2FtrSize' — lift: cannot lift 'mRmTp_ItemNo2FtrSize': %hi(mRmTp_ftr_size) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta0,0(sp) */\n/* 4:\tandi\ta0,a0,0xffff */\n/* 8:\tslti\tat,a0,4096 */\n/* c:\tbnez\tat,34 */\n/* 10:\tmove\tv0,zero */\n/* 14:\tslti\tat,a0,7885 */\n/* 18:\tbeqz\tat,34 */\n/* 1c:\taddiu\tt6,a0,-4096 */\n/* 20:\tsra\tt7,t6,0x2 */\n/* 24:\tlui\tv0,0x0 */\n/* 28:\taddu\tv0,v0,t7 */\n/* 2c:\tjr\tra */\n/* 30:\tlbu\tv0,0(v0) */\n/* 34:\tjr\tra */\n/* 38:\tnop */\n/* 3c:\tnop */\nvoid mRmTp_ItemNo2FtrSize(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'mRmTp_ItemNo2FtrSize': %hi(mRmTp_ftr_size) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":24,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'mRmTp_ItemNo2FtrSize': %hi(mRmTp_ftr_size) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 mRmTp_ItemNo2FtrSize(u16 name) {\n s32 temp_a0;\n\n temp_a0 = name & 0xFFFF;\n if ((temp_a0 >= 0x1000) && (temp_a0 < 0x1ECD)) {\n return (s32) mRmTp_ftr_size[(s32) (temp_a0 - 0x1000) >> 2];\n }\n return 0;\n}\n","score":7,"maxScore":16,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":8,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":7,"maxScore":16,"ratio":0.4375,"kinds":{"insert":1,"delete":1,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mRmTp_ItemNo2FtrSize` — benchmark function af:mRmTp_ItemNo2FtrSize:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mRmTp_ItemNo2FtrSize\n sw\t$a0, 0($sp)\n andi\t$a0, $a0, 0xffff\n slti\t$at, $a0, 4096\n bnez\t$at, .L34\n move\t$v0, $zero\n slti\t$at, $a0, 7885\n beqz\t$at, .L34\n addiu\t$t6, $a0, -4096\n sra\t$t7, $t6, 0x2\n lui\t$v0, %hi(mRmTp_ftr_size)\n addu\t$v0, $v0, $t7\n jr\t$ra\n lbu\t$v0, %lo(mRmTp_ftr_size)($v0)\n.L34:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-2e2cc0cb59b4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 mRmTp_ItemNo2FtrSize(u16 name);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mRmTp_ItemNo2FtrSize # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mRmTp_ItemNo2FtrSize` — benchmark function af:mRmTp_ItemNo2FtrSize:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mRmTp_ItemNo2FtrSize:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tandi\ta0,a0,0xffff\n 8:\tslti\tat,a0,4096\n c:\tbnez\tat,34 \n 10:\tmove\tv0,zero\n 14:\tslti\tat,a0,7885\n 18:\tbeqz\tat,34 \n 1c:\taddiu\tt6,a0,-4096\n 20:\tsra\tt7,t6,0x2\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t7\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t0000003c mRmTp_ItemNo2FtrSize\n00000000 O *UND*\t00000000 mRmTp_ftr_size\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 mRmTp_ftr_size\n00000030 R_MIPS_LO16 mRmTp_ftr_size\n\n\nContents of section .text:\n 0000 afa40000 3084ffff 28811000 14200009 ....0...(.... ..\n 0010 00001025 28811ecd 10200006 248ef000 ...%(.... ..$...\n 0020 000e7883 3c020000 004f1021 03e00008 ..x.<....O.!....\n 0030 90420000 03e00008 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 a000c016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a000c016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000f 00000008 000001f8 p...............\n 0010 00000006 00000374 00000001 00000200 .......t........\n 0020 00000004 00000234 00000000 00000000 .......4........\n 0030 00000011 00000264 00000040 000002a8 .......d...@....\n 0040 00000024 000002e8 00000001 0000030c ...$............\n 0050 00000000 00000000 00000002 00000354 ...............T\n 0060 011140c1 25210000 00000000 00000001 ..@.%!..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000003c 20200001 . .....*...< ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d386261 63613133 35653337 -ido-8baca135e37\n 0130 66323333 332f752e 69006d52 6d54705f f2333/u.i.mRmTp_\n 0140 4974656d 4e6f3246 74725369 7a650000 ItemNo2FtrSize..\n 0150 6d526d54 705f4974 656d4e6f 32467472 mRmTp_ItemNo2Ftr\n 0160 53697a65 006d526d 54705f66 74725f73 Size.mRmTp_ftr_s\n 0170 697a6500 00000000 00000001 00000000 ize.............\n 0180 0000003f 00000000 00000004 00000000 ...?............\n 0190 0000000f 00000000 00000000 00000001 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 01800000 00000000 00000006 00000000 ................\n 01c0 00000000 00000000 18200001 00000000 ......... ......\n 01d0 00000015 00000000 04cfffff 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 7fffffff 00000000 7fffffff ................\n 0200 00000001 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mRmTp_ItemNo2FtrSize # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:never_zero:ido7.1","sym":"never_zero","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","macro"],"loc":7,"refSource":"f32 never_zero(f32 val, f32 min) {\n if (val < 0.0f) {\n return CLAMP_MAX(val, -min);\n } else {\n return CLAMP_MIN(val, min);\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L38-L44","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f12,$f14\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f0,$f12\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f12,$f14\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 never_zero\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460e603c 46007007 460c003c E...F.`: */\n/* 0:\tmtc1\tzero,$f4 */\n/* 4:\tnop */\n/* 8:\tc.lt.s\t$f12,$f4 */\n/* c:\tnop */\n/* 10:\tbc1fl\t44 */\n/* 14:\tc.lt.s\t$f12,$f14 */\n/* 18:\tneg.s\t$f0,$f14 */\n/* 1c:\tc.lt.s\t$f0,$f12 */\n/* 20:\tnop */\n/* 24:\tbc1fl\t38 */\n/* 28:\tmov.s\t$f2,$f12 */\n/* 2c:\tjr\tra */\n/* 30:\tnop */\n/* 34:\tmov.s\t$f2,$f12 */\n/* 38:\tjr\tra */\n/* 3c:\tmov.s\t$f0,$f2 */\n/* 40:\tc.lt.s\t$f12,$f14 */\n/* 44:\tnop */\n/* 48:\tbc1fl\t5c */\n/* 4c:\tmov.s\t$f2,$f12 */\n/* 50:\tb\t5c */\n/* 54:\tmov.s\t$f2,$f14 */\n/* 58:\tmov.s\t$f2,$f12 */\n/* 5c:\tmov.s\t$f0,$f2 */\n/* 60:\tjr\tra */\n/* 64:\tnop */\n/* \t... */\nvoid never_zero(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'never_zero': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":35,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'never_zero': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"f32 never_zero(f32 arg0, f32 arg1) {\n f32 temp_f0;\n f32 var_f2;\n\n if (arg0 < 0.0f) {\n temp_f0 = -arg1;\n if (temp_f0 < arg0) {\n return temp_f0;\n }\n return arg0;\n }\n if (arg0 < arg1) {\n var_f2 = arg1;\n } else {\n var_f2 = arg0;\n }\n return var_f2;\n}\n","score":8,"maxScore":27,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":8,"maxScore":27,"ratio":0.2962962962962963,"kinds":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `never_zero` — benchmark function af:never_zero:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel never_zero\n mtc1\t$zero, $f4\n nop\n c.lt.s\t$f12, $f4\n nop\n bc1fl\t.L44\n c.lt.s\t$f12, $f14\n neg.s\t$f0, $f14\n c.lt.s\t$f0, $f12\n nop\n bc1fl\t.L38\n mov.s\t$f2, $f12\n jr\t$ra\n nop\n mov.s\t$f2, $f12\n.L38:\n jr\t$ra\n mov.s\t$f0, $f2\n c.lt.s\t$f12, $f14\n.L44:\n nop\n bc1fl\t.L5c\n mov.s\t$f2, $f12\n b\t.L5c\n mov.s\t$f2, $f14\n mov.s\t$f2, $f12\n.L5c:\n mov.s\t$f0, $f2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function never_zero # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `never_zero` — benchmark function af:never_zero:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:never_zero:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f12,$f14\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f0,$f12\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f12,$f14\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 never_zero\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460e603c 46007007 460c003c E...F.`r = src->r;\n dest->g = src->g;\n dest->b = src->b;\n dest->a = src->a;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L582-L587","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tt6,0(a1)\n 4:\tsb\tt6,0(a0)\n 8:\tlbu\tt7,1(a1)\n c:\tsb\tt7,1(a0)\n 10:\tlbu\tt8,2(a1)\n 14:\tsb\tt8,2(a0)\n 18:\tlbu\tt9,3(a1)\n 1c:\tjr\tra\n 20:\tsb\tt9,3(a0)\n\t...\n","proto":{"rgba_t_move":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 rgba_t_move\n\n\nContents of section .text:\n 0000 90ae0000 a08e0000 90af0001 a08f0001 ................\n 0010 90b80002 a0980002 90b90003 03e00008 ................\n 0020 a0990003 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000008 000001a8 p...............\n 0010 00000005 000002f4 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000038 00000258 ...........8...X\n 0040 0000000c 00000290 00000001 0000029c ................\n 0050 00000000 00000000 00000001 000002e4 ................\n 0060 11111110 10f00000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000024 20200001 . .....*...$ ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d633834 30663132 30663065 -ido-c840f120f0e\n 0130 37363932 372f752e 69007267 62615f74 76927/u.i.rgba_t\n 0140 5f6d6f76 65000000 72676261 5f745f6d _move...rgba_t_m\n 0150 6f766500 00000000 00000001 00000000 ove.............\n 0160 00000036 00000000 00000004 00000000 ...6............\n 0170 00000009 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000006 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void rgba_t_move(u8 * a0, u8 * a1) {\n *a0 = *a1;\n a0[1] = a1[1];\n a0[2] = a1[2];\n a0[3] = a1[3];\n return;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void rgba_t_move(void *arg0, void *arg1) {\n arg0->unk0 = (u8) arg1->unk0;\n arg0->unk1 = (u8) arg1->unk1;\n arg0->unk2 = (u8) arg1->unk2;\n arg0->unk3 = (u8) arg1->unk3;\n}\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":96,"lines":6,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 3: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 4: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 5: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 6: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rgba_t_move` — benchmark function af:rgba_t_move:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rgba_t_move\n lbu\t$t6, 0($a1)\n sb\t$t6, 0($a0)\n lbu\t$t7, 1($a1)\n sb\t$t7, 1($a0)\n lbu\t$t8, 2($a1)\n sb\t$t8, 2($a0)\n lbu\t$t9, 3($a1)\n jr\t$ra\n sb\t$t9, 3($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rgba_t_move # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rgba_t_move` — benchmark function af:rgba_t_move:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:rgba_t_move:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tt6,0(a1)\n 4:\tsb\tt6,0(a0)\n 8:\tlbu\tt7,1(a1)\n c:\tsb\tt7,1(a0)\n 10:\tlbu\tt8,2(a1)\n 14:\tsb\tt8,2(a0)\n 18:\tlbu\tt9,3(a1)\n 1c:\tjr\tra\n 20:\tsb\tt9,3(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 rgba_t_move\n\n\nContents of section .text:\n 0000 90ae0000 a08e0000 90af0001 a08f0001 ................\n 0010 90b80002 a0980002 90b90003 03e00008 ................\n 0020 a0990003 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000008 000001a8 p...............\n 0010 00000005 000002f4 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000038 00000258 ...........8...X\n 0040 0000000c 00000290 00000001 0000029c ................\n 0050 00000000 00000000 00000001 000002e4 ................\n 0060 11111110 10f00000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000024 20200001 . .....*...$ ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d633834 30663132 30663065 -ido-c840f120f0e\n 0130 37363932 372f752e 69007267 62615f74 76927/u.i.rgba_t\n 0140 5f6d6f76 65000000 72676261 5f745f6d _move...rgba_t_m\n 0150 6f766500 00000000 00000001 00000000 ove.............\n 0160 00000036 00000000 00000004 00000000 ...6............\n 0170 00000009 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000006 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"rgba_t_move\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name rgba_t_move # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:search_position_angleY:ido7.1","sym":"search_position_angleY","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","float","call"],"loc":6,"refSource":"s16 search_position_angleY(xyz_t* subtrahend, xyz_t* minuend) {\n f32 diffX = minuend->x - subtrahend->x;\n f32 diffZ = minuend->z - subtrahend->z;\n\n return atans_table(diffZ, diffX);\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L287-L292","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tlwc1\t$f6,0(a0)\n c:\tlwc1\t$f4,0(a1)\n 10:\tlwc1\t$f10,8(a0)\n 14:\tlwc1\t$f8,8(a1)\n 18:\tsub.s\t$f14,$f4,$f6\n 1c:\tjal\t0 \n 20:\tsub.s\t$f12,$f8,$f10\n 24:\tlw\tra,20(sp)\n 28:\taddiu\tsp,sp,24\n 2c:\tjr\tra\n 30:\tnop\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/af/ctx-d8e5c4388b36.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 search_position_angleY\n00000000 F *UND*\t00000000 atans_table\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 atans_table\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 c4860000 c4a40000 '...............\n 0010 c48a0008 c4a80008 46062381 0c000000 ........F.#.....\n 0020 460a4301 8fbf0014 27bd0018 03e00008 F.C.....'.......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000030 00000000 . .........0....\n 0010 0000f550 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000030 00000000 0000f550 00000000 ...0.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001f0 p...............\n 0010 00000006 00000370 00000001 000001f8 .......p........\n 0020 00000004 0000022c 00000000 00000000 .......,........\n 0030 00000011 0000025c 00000044 000002a0 .......\\...D....\n 0040 00000024 000002e4 00000001 00000308 ...$............\n 0050 00000000 00000000 00000002 00000350 ...............P\n 0060 011111f0 20f01300 00000000 00000001 .... ...........\n 0070 00000000 80000000 fffffffc ffffffff ................\n 0080 00000000 00000000 00000018 001d001f ................\n 0090 00000004 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d623762 34646365 32343233 -ido-b7b4dce2423\n 0130 38363332 352f752e 69007365 61726368 86325/u.i.search\n 0140 5f706f73 6974696f 6e5f616e 676c6559 _position_angleY\n 0150 00000000 73656172 63685f70 6f736974 ....search_posit\n 0160 696f6e5f 616e676c 65590061 74616e73 ion_angleY.atans\n 0170 5f746162 6c650000 00000000 00000001 _table..........\n 0180 00000000 00000041 00000000 00000004 .......A........\n 0190 00000000 0000000d 00000000 00000000 ................\n 01a0 00000001 00000000 00000011 00000000 ................\n 01b0 00000000 01800000 00000000 00000007 ................\n 01c0 00000000 00000000 00000000 18200001 ............. ..\n 01d0 00000000 00000017 00000000 18cfffff ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 7fffffff 00000000 ................\n 0200 7fffffff 00000001 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'search_position_angleY' — lift: cannot lift 'search_position_angleY': function call 'jal' at 0x1c — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,20(sp) */\n/* 8:\tlwc1\t$f6,0(a0) */\n/* c:\tlwc1\t$f4,0(a1) */\n/* 10:\tlwc1\t$f10,8(a0) */\n/* 14:\tlwc1\t$f8,8(a1) */\n/* 18:\tsub.s\t$f14,$f4,$f6 */\n/* 1c:\tjal\t0 */\n/* 20:\tsub.s\t$f12,$f8,$f10 */\n/* 24:\tlw\tra,20(sp) */\n/* 28:\taddiu\tsp,sp,24 */\n/* 2c:\tjr\tra */\n/* 30:\tnop */\n/* \t... */\nvoid search_position_angleY(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'search_position_angleY': function call 'jal' at 0x1c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'search_position_angleY': function call 'jal' at 0x1c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 search_position_angleY(xyz_t *subtrahend, xyz_t *minuend) {\n return atans_table(minuend->z - subtrahend->z, minuend->x - subtrahend->x);\n}\n","score":6,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":13,"ratio":0.46153846153846156,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `search_position_angleY` — benchmark function af:search_position_angleY:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel search_position_angleY\n addiu\t$sp, $sp, -24\n sw\t$ra, 20($sp)\n lwc1\t$f6, 0($a0)\n lwc1\t$f4, 0($a1)\n lwc1\t$f10, 8($a0)\n lwc1\t$f8, 8($a1)\n sub.s\t$f14, $f4, $f6\n jal\tatans_table\n sub.s\t$f12, $f8, $f10\n lw\t$ra, 20($sp)\n addiu\t$sp, $sp, 24\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-d8e5c4388b36.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns16 search_position_angleY(xyz_t* subtrahend, xyz_t* minuend);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function search_position_angleY # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `search_position_angleY` — benchmark function af:search_position_angleY:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:search_position_angleY:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tlwc1\t$f6,0(a0)\n c:\tlwc1\t$f4,0(a1)\n 10:\tlwc1\t$f10,8(a0)\n 14:\tlwc1\t$f8,8(a1)\n 18:\tsub.s\t$f14,$f4,$f6\n 1c:\tjal\t0 \n 20:\tsub.s\t$f12,$f8,$f10\n 24:\tlw\tra,20(sp)\n 28:\taddiu\tsp,sp,24\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 search_position_angleY\n00000000 F *UND*\t00000000 atans_table\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 atans_table\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 c4860000 c4a40000 '...............\n 0010 c48a0008 c4a80008 46062381 0c000000 ........F.#.....\n 0020 460a4301 8fbf0014 27bd0018 03e00008 F.C.....'.......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000030 00000000 . .........0....\n 0010 0000f550 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000030 00000000 0000f550 00000000 ...0.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001f0 p...............\n 0010 00000006 00000370 00000001 000001f8 .......p........\n 0020 00000004 0000022c 00000000 00000000 .......,........\n 0030 00000011 0000025c 00000044 000002a0 .......\\...D....\n 0040 00000024 000002e4 00000001 00000308 ...$............\n 0050 00000000 00000000 00000002 00000350 ...............P\n 0060 011111f0 20f01300 00000000 00000001 .... ...........\n 0070 00000000 80000000 fffffffc ffffffff ................\n 0080 00000000 00000000 00000018 001d001f ................\n 0090 00000004 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d623762 34646365 32343233 -ido-b7b4dce2423\n 0130 38363332 352f752e 69007365 61726368 86325/u.i.search\n 0140 5f706f73 6974696f 6e5f616e 676c6559 _position_angleY\n 0150 00000000 73656172 63685f70 6f736974 ....search_posit\n 0160 696f6e5f 616e676c 65590061 74616e73 ion_angleY.atans\n 0170 5f746162 6c650000 00000000 00000001 _table..........\n 0180 00000000 00000041 00000000 00000004 .......A........\n 0190 00000000 0000000d 00000000 00000000 ................\n 01a0 00000001 00000000 00000011 00000000 ................\n 01b0 00000000 01800000 00000000 00000007 ................\n 01c0 00000000 00000000 00000000 18200001 ............. ..\n 01d0 00000000 00000017 00000000 18cfffff ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 7fffffff 00000000 ................\n 0200 7fffffff 00000001 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name search_position_angleY # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:spolar2world:ido7.1","sym":"spolar2world","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","float","call"],"loc":16,"refSource":"xyz_t spolar2world(VecSph* sph) {\n xyz_t v;\n f32 sinPitch;\n f32 cosPitch = cos_s(sph->pitch);\n f32 sinYaw;\n f32 cosYaw = cos_s(sph->yaw);\n\n sinPitch = sin_s(sph->pitch);\n sinYaw = sin_s(sph->yaw);\n\n v.x = sph->r * sinPitch * sinYaw;\n v.y = sph->r * cosPitch;\n v.z = sph->r * sinPitch * cosYaw;\n\n return v;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L82-L97","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\tra,28(sp)\n 8:\tsw\ts0,24(sp)\n c:\tsw\ta0,64(sp)\n 10:\tmove\ts0,a1\n 14:\tjal\t0 \n 18:\tlh\ta0,4(a1)\n 1c:\tswc1\t$f0,44(sp)\n 20:\tjal\t0 \n 24:\tlh\ta0,6(s0)\n 28:\tswc1\t$f0,36(sp)\n 2c:\tjal\t0 \n 30:\tlh\ta0,4(s0)\n 34:\tlh\ta0,6(s0)\n 38:\tjal\t0 \n 3c:\tswc1\t$f0,48(sp)\n 40:\tlwc1\t$f2,48(sp)\n 44:\tlwc1\t$f4,0(s0)\n 48:\tlwc1\t$f16,44(sp)\n 4c:\taddiu\tt6,sp,52\n 50:\tmul.s\t$f6,$f4,$f2\n 54:\tlw\tv0,64(sp)\n 58:\tmul.s\t$f8,$f6,$f0\n 5c:\tswc1\t$f8,52(sp)\n 60:\tlwc1\t$f10,0(s0)\n 64:\tlwc1\t$f8,36(sp)\n 68:\tmul.s\t$f18,$f10,$f16\n 6c:\tswc1\t$f18,56(sp)\n 70:\tlwc1\t$f4,0(s0)\n 74:\tmul.s\t$f6,$f4,$f2\n 78:\tmul.s\t$f10,$f6,$f8\n 7c:\tswc1\t$f10,60(sp)\n 80:\tlw\tt8,0(t6)\n 84:\tsw\tt8,0(v0)\n 88:\tlw\tt7,4(t6)\n 8c:\tsw\tt7,4(v0)\n 90:\tlw\tt8,8(t6)\n 94:\tsw\tt8,8(v0)\n 98:\tlw\tra,28(sp)\n 9c:\tlw\ts0,24(sp)\n a0:\taddiu\tsp,sp,64\n a4:\tjr\tra\n a8:\tnop\n ac:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000ac spolar2world\n00000000 F *UND*\t00000000 cos_s\n00000000 F *UND*\t00000000 sin_s\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 cos_s\n00000020 R_MIPS_26 cos_s\n0000002c R_MIPS_26 sin_s\n00000038 R_MIPS_26 sin_s\n\n\nContents of section .text:\n 0000 27bdffc0 afbf001c afb00018 afa40040 '..............@\n 0010 00a08025 0c000000 84a40004 e7a0002c ...%...........,\n 0020 0c000000 86040006 e7a00024 0c000000 ...........$....\n 0030 86040004 86040006 0c000000 e7a00030 ...............0\n 0040 c7a20030 c6040000 c7b0002c 27ae0034 ...0.......,'..4\n 0050 46022182 8fa20040 46003202 e7a80034 F.!....@F.2....4\n 0060 c60a0000 c7a80024 46105482 e7b20038 .......$F.T....8\n 0070 c6040000 46022182 46083282 e7aa003c ....F.!.F.2....<\n 0080 8dd80000 ac580000 8dcf0004 ac4f0004 .....X.......O..\n 0090 8dd80008 ac580008 8fbf001c 8fb00018 .....X..........\n 00a0 27bd0040 03e00008 00000000 00000000 '..@............\nContents of section .options:\n 0000 01200000 00000000 a101c034 00000000 . .........4....\n 0010 000d0fd5 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a101c034 00000000 000d0fd5 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002b 00000014 00000278 p......+.......x\n 0010 00000007 00000400 00000001 0000028c ................\n 0020 00000004 000002c0 00000000 00000000 ................\n 0030 00000011 000002f0 00000038 00000334 ...........8...4\n 0040 0000001c 0000036c 00000001 00000388 .......l........\n 0050 00000000 00000000 00000003 000003d0 ................\n 0060 04322211 13101020 d0f01110 10f11318 .2\".... ........\n 0070 01000000 00000000 00000001 00000000 ................\n 0080 80010000 ffffffdc ffffffff 00000000 ................\n 0090 00000000 00000040 001d001f 00000007 .......@........\n 00a0 00000012 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000ac 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d326130 31346637 32346334 37373737 -2a014f724c47777\n 0140 622f752e 69007370 6f6c6172 32776f72 b/u.i.spolar2wor\n 0150 6c640000 73706f6c 61723277 6f726c64 ld..spolar2world\n 0160 00636f73 5f730073 696e5f73 00000000 .cos_s.sin_s....\n 0170 00000000 00000001 00000000 00000037 ...............7\n 0180 00000000 00000004 00000000 0000002b ...............+\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000011 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000d ..... ..........\n 01d0 00000000 18cfffff 00000000 00000013 ................\n 01e0 00000000 18cfffff 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 7fffffff 00000000 7fffffff 00000001 ................\n 0210 7fffffff 00000002 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'spolar2world' — lift: cannot lift 'spolar2world': function call 'jal' at 0x14 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-64 */\n/* 4:\tsw\tra,28(sp) */\n/* 8:\tsw\ts0,24(sp) */\n/* c:\tsw\ta0,64(sp) */\n/* 10:\tmove\ts0,a1 */\n/* 14:\tjal\t0 */\n/* 18:\tlh\ta0,4(a1) */\n/* 1c:\tswc1\t$f0,44(sp) */\n/* 20:\tjal\t0 */\n/* 24:\tlh\ta0,6(s0) */\n/* 28:\tswc1\t$f0,36(sp) */\n/* 2c:\tjal\t0 */\n/* 30:\tlh\ta0,4(s0) */\n/* 34:\tlh\ta0,6(s0) */\n/* 38:\tjal\t0 */\n/* 3c:\tswc1\t$f0,48(sp) */\n/* 40:\tlwc1\t$f2,48(sp) */\n/* 44:\tlwc1\t$f4,0(s0) */\n/* 48:\tlwc1\t$f16,44(sp) */\n/* 4c:\taddiu\tt6,sp,52 */\n/* 50:\tmul.s\t$f6,$f4,$f2 */\n/* 54:\tlw\tv0,64(sp) */\n/* 58:\tmul.s\t$f8,$f6,$f0 */\n/* 5c:\tswc1\t$f8,52(sp) */\n/* 60:\tlwc1\t$f10,0(s0) */\n/* 64:\tlwc1\t$f8,36(sp) */\n/* 68:\tmul.s\t$f18,$f10,$f16 */\n/* 6c:\tswc1\t$f18,56(sp) */\n/* 70:\tlwc1\t$f4,0(s0) */\n/* 74:\tmul.s\t$f6,$f4,$f2 */\n/* 78:\tmul.s\t$f10,$f6,$f8 */\n/* 7c:\tswc1\t$f10,60(sp) */\n/* 80:\tlw\tt8,0(t6) */\n/* 84:\tsw\tt8,0(v0) */\n/* 88:\tlw\tt7,4(t6) */\n/* 8c:\tsw\tt7,4(v0) */\n/* 90:\tlw\tt8,8(t6) */\n/* 94:\tsw\tt8,8(v0) */\n/* 98:\tlw\tra,28(sp) */\n/* 9c:\tlw\ts0,24(sp) */\n/* a0:\taddiu\tsp,sp,64 */\n/* a4:\tjr\tra */\n/* a8:\tnop */\n/* ac:\tnop */\nvoid spolar2world(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'spolar2world': function call 'jal' at 0x14 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":52,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'spolar2world': function call 'jal' at 0x14 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"f32 cos_s(s16); /* extern */\nf32 sin_s(s16); /* extern */\n\nvoid spolar2world(void *arg0, void *arg1) {\n f32 sp3C;\n f32 sp38;\n f32 sp34;\n f32 sp30;\n f32 sp2C;\n f32 sp24;\n\n sp2C = cos_s(arg1->unk4);\n sp24 = cos_s(arg1->unk6);\n sp30 = sin_s(arg1->unk4);\n sp34 = arg1->unk0 * sp30 * sin_s(arg1->unk6);\n sp38 = arg1->unk0 * sp2C;\n sp3C = arg1->unk0 * sp30 * sp24;\n arg0->unk0 = (f32) sp34.unk0;\n arg0->unk4 = (s32) sp34.unk4;\n arg0->unk8 = (s32) sp34.unk8;\n}\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":96,"lines":19,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 23: Syntax Error","cfe: Error: /c.i, line 24: Syntax Error"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `spolar2world` — benchmark function af:spolar2world:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel spolar2world\n addiu\t$sp, $sp, -64\n sw\t$ra, 28($sp)\n sw\t$s0, 24($sp)\n sw\t$a0, 64($sp)\n move\t$s0, $a1\n jal\tcos_s\n lh\t$a0, 4($a1)\n swc1\t$f0, 44($sp)\n jal\tcos_s\n lh\t$a0, 6($s0)\n swc1\t$f0, 36($sp)\n jal\tsin_s\n lh\t$a0, 4($s0)\n lh\t$a0, 6($s0)\n jal\tsin_s\n swc1\t$f0, 48($sp)\n lwc1\t$f2, 48($sp)\n lwc1\t$f4, 0($s0)\n lwc1\t$f16, 44($sp)\n addiu\t$t6, $sp, 52\n mul.s\t$f6, $f4, $f2\n lw\t$v0, 64($sp)\n mul.s\t$f8, $f6, $f0\n swc1\t$f8, 52($sp)\n lwc1\t$f10, 0($s0)\n lwc1\t$f8, 36($sp)\n mul.s\t$f18, $f10, $f16\n swc1\t$f18, 56($sp)\n lwc1\t$f4, 0($s0)\n mul.s\t$f6, $f4, $f2\n mul.s\t$f10, $f6, $f8\n swc1\t$f10, 60($sp)\n lw\t$t8, 0($t6)\n sw\t$t8, 0($v0)\n lw\t$t7, 4($t6)\n sw\t$t7, 4($v0)\n lw\t$t8, 8($t6)\n sw\t$t8, 8($v0)\n lw\t$ra, 28($sp)\n lw\t$s0, 24($sp)\n addiu\t$sp, $sp, 64\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function spolar2world # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `spolar2world` — benchmark function af:spolar2world:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:spolar2world:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\tra,28(sp)\n 8:\tsw\ts0,24(sp)\n c:\tsw\ta0,64(sp)\n 10:\tmove\ts0,a1\n 14:\tjal\t0 \n 18:\tlh\ta0,4(a1)\n 1c:\tswc1\t$f0,44(sp)\n 20:\tjal\t0 \n 24:\tlh\ta0,6(s0)\n 28:\tswc1\t$f0,36(sp)\n 2c:\tjal\t0 \n 30:\tlh\ta0,4(s0)\n 34:\tlh\ta0,6(s0)\n 38:\tjal\t0 \n 3c:\tswc1\t$f0,48(sp)\n 40:\tlwc1\t$f2,48(sp)\n 44:\tlwc1\t$f4,0(s0)\n 48:\tlwc1\t$f16,44(sp)\n 4c:\taddiu\tt6,sp,52\n 50:\tmul.s\t$f6,$f4,$f2\n 54:\tlw\tv0,64(sp)\n 58:\tmul.s\t$f8,$f6,$f0\n 5c:\tswc1\t$f8,52(sp)\n 60:\tlwc1\t$f10,0(s0)\n 64:\tlwc1\t$f8,36(sp)\n 68:\tmul.s\t$f18,$f10,$f16\n 6c:\tswc1\t$f18,56(sp)\n 70:\tlwc1\t$f4,0(s0)\n 74:\tmul.s\t$f6,$f4,$f2\n 78:\tmul.s\t$f10,$f6,$f8\n 7c:\tswc1\t$f10,60(sp)\n 80:\tlw\tt8,0(t6)\n 84:\tsw\tt8,0(v0)\n 88:\tlw\tt7,4(t6)\n 8c:\tsw\tt7,4(v0)\n 90:\tlw\tt8,8(t6)\n 94:\tsw\tt8,8(v0)\n 98:\tlw\tra,28(sp)\n 9c:\tlw\ts0,24(sp)\n a0:\taddiu\tsp,sp,64\n a4:\tjr\tra\n a8:\tnop\n ac:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000ac spolar2world\n00000000 F *UND*\t00000000 cos_s\n00000000 F *UND*\t00000000 sin_s\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 cos_s\n00000020 R_MIPS_26 cos_s\n0000002c R_MIPS_26 sin_s\n00000038 R_MIPS_26 sin_s\n\n\nContents of section .text:\n 0000 27bdffc0 afbf001c afb00018 afa40040 '..............@\n 0010 00a08025 0c000000 84a40004 e7a0002c ...%...........,\n 0020 0c000000 86040006 e7a00024 0c000000 ...........$....\n 0030 86040004 86040006 0c000000 e7a00030 ...............0\n 0040 c7a20030 c6040000 c7b0002c 27ae0034 ...0.......,'..4\n 0050 46022182 8fa20040 46003202 e7a80034 F.!....@F.2....4\n 0060 c60a0000 c7a80024 46105482 e7b20038 .......$F.T....8\n 0070 c6040000 46022182 46083282 e7aa003c ....F.!.F.2....<\n 0080 8dd80000 ac580000 8dcf0004 ac4f0004 .....X.......O..\n 0090 8dd80008 ac580008 8fbf001c 8fb00018 .....X..........\n 00a0 27bd0040 03e00008 00000000 00000000 '..@............\nContents of section .options:\n 0000 01200000 00000000 a101c034 00000000 . .........4....\n 0010 000d0fd5 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a101c034 00000000 000d0fd5 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002b 00000014 00000278 p......+.......x\n 0010 00000007 00000400 00000001 0000028c ................\n 0020 00000004 000002c0 00000000 00000000 ................\n 0030 00000011 000002f0 00000038 00000334 ...........8...4\n 0040 0000001c 0000036c 00000001 00000388 .......l........\n 0050 00000000 00000000 00000003 000003d0 ................\n 0060 04322211 13101020 d0f01110 10f11318 .2\".... ........\n 0070 01000000 00000000 00000001 00000000 ................\n 0080 80010000 ffffffdc ffffffff 00000000 ................\n 0090 00000000 00000040 001d001f 00000007 .......@........\n 00a0 00000012 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000ac 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d326130 31346637 32346334 37373737 -2a014f724c47777\n 0140 622f752e 69007370 6f6c6172 32776f72 b/u.i.spolar2wor\n 0150 6c640000 73706f6c 61723277 6f726c64 ld..spolar2world\n 0160 00636f73 5f730073 696e5f73 00000000 .cos_s.sin_s....\n 0170 00000000 00000001 00000000 00000037 ...............7\n 0180 00000000 00000004 00000000 0000002b ...............+\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000011 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000d ..... ..........\n 01d0 00000000 18cfffff 00000000 00000013 ................\n 01e0 00000000 18cfffff 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 7fffffff 00000000 7fffffff 00000001 ................\n 0210 7fffffff 00000002 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name spolar2world # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:ValueSet__s_xyz:ido7.1","sym":"ValueSet__s_xyz","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","bitfield","cast"],"loc":8,"refSource":"void ValueSet__s_xyz(u8* ptr, ValueSet* value_set) {\n s_xyz* vec = (s_xyz*)(ptr + value_set->offset);\n s16 val = value_set->value;\n\n vec->z = val;\n vec->y = val;\n vec->x = val;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L357-L364","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlhu\tt6,0(a1)\n 4:\tlh\tv1,2(a1)\n 8:\tandi\tt7,t6,0x7ff\n c:\taddu\tv0,t7,a0\n 10:\tsh\tv1,4(v0)\n 14:\tsh\tv1,2(v0)\n 18:\tjr\tra\n 1c:\tsh\tv1,0(v0)\n","proto":{"ValueSet__s_xyz":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 ValueSet__s_xyz\n\n\nContents of section .text:\n 0000 94ae0000 84a30002 31cf07ff 01e41021 ........1......!\n 0010 a4430004 a4430002 03e00008 a4430000 .C...C.......C..\nContents of section .options:\n 0000 01200000 00000000 8000c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000008 00000198 p...............\n 0010 00000005 000002ec 00000001 000001a0 ................\n 0020 00000004 000001d4 00000000 00000000 ................\n 0030 00000011 00000204 0000003c 00000248 ...........<...H\n 0040 00000010 00000284 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1010f120 1020f000 00000000 00000001 ... . ..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000006 0000000c 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000020 20200001 . .....*... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d363432 39343636 64386465 -ido-6429466d8de\n 0130 30653065 362f752e 69005661 6c756553 0e0e6/u.i.ValueS\n 0140 65745f5f 735f7879 7a000000 56616c75 et__s_xyz...Valu\n 0150 65536574 5f5f735f 78797a00 00000000 eSet__s_xyz.....\n 0160 00000001 00000000 0000003a 00000000 ...........:....\n 0170 00000004 00000000 00000008 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000007 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void ValueSet__s_xyz(u32 a0, u16 * a1) {\n s32 v0;\n s32 v1;\n v0 = *a1;\n v1 = a1[1];\n ((u16 *)((v0 & 2047) + a0))[2] = v1;\n ((u16 *)((v0 & 2047) + a0))[1] = v1;\n *(u16 *)((v0 & 2047) + a0) = v1;\n return;\n}\n","score":7,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":94,"lines":10,"gotos":0,"casts":3,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void ValueSet__s_xyz(s32 arg0, void *arg1) {\n s16 temp_v1;\n void *temp_v0;\n\n temp_v1 = arg1->unk2;\n temp_v0 = (arg1->unk0 & 0x7FF) + arg0;\n temp_v0->unk4 = temp_v1;\n temp_v0->unk2 = temp_v1;\n temp_v0->unk0 = temp_v1;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 9: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 10: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 11: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 12: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 13: Selector requires struct/union pointer as left hand side"]},"gapSize":{"decompiler":"asmlift","score":7,"maxScore":8,"ratio":0.875,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ValueSet__s_xyz` — benchmark function af:ValueSet__s_xyz:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ValueSet__s_xyz\n lhu\t$t6, 0($a1)\n lh\t$v1, 2($a1)\n andi\t$t7, $t6, 0x7ff\n addu\t$v0, $t7, $a0\n sh\t$v1, 4($v0)\n sh\t$v1, 2($v0)\n jr\t$ra\n sh\t$v1, 0($v0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ValueSet__s_xyz # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ValueSet__s_xyz` — benchmark function af:ValueSet__s_xyz:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:ValueSet__s_xyz:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlhu\tt6,0(a1)\n 4:\tlh\tv1,2(a1)\n 8:\tandi\tt7,t6,0x7ff\n c:\taddu\tv0,t7,a0\n 10:\tsh\tv1,4(v0)\n 14:\tsh\tv1,2(v0)\n 18:\tjr\tra\n 1c:\tsh\tv1,0(v0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 ValueSet__s_xyz\n\n\nContents of section .text:\n 0000 94ae0000 84a30002 31cf07ff 01e41021 ........1......!\n 0010 a4430004 a4430002 03e00008 a4430000 .C...C.......C..\nContents of section .options:\n 0000 01200000 00000000 8000c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000008 00000198 p...............\n 0010 00000005 000002ec 00000001 000001a0 ................\n 0020 00000004 000001d4 00000000 00000000 ................\n 0030 00000011 00000204 0000003c 00000248 ...........<...H\n 0040 00000010 00000284 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1010f120 1020f000 00000000 00000001 ... . ..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000006 0000000c 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000020 20200001 . .....*... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d363432 39343636 64386465 -ido-6429466d8de\n 0130 30653065 362f752e 69005661 6c756553 0e0e6/u.i.ValueS\n 0140 65745f5f 735f7879 7a000000 56616c75 et__s_xyz...Valu\n 0150 65536574 5f5f735f 78797a00 00000000 eSet__s_xyz.....\n 0160 00000001 00000000 0000003a 00000000 ...........:....\n 0170 00000004 00000000 00000008 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000007 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ValueSet__s_xyz\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ValueSet__s_xyz # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_add:ido7.1","sym":"xyz_t_add","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct"],"loc":5,"refSource":"void xyz_t_add(xyz_t* augend, xyz_t* addend, xyz_t* total) {\n total->x = augend->x + addend->x;\n total->y = augend->y + addend->y;\n total->z = augend->z + addend->z;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L236-L240","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tadd.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tadd.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tadd.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_add\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062200 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105480 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062200 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d656339 66643861 32343532 -ido-ec9fd8a2452\n 0130 38613731 392f752e 69007879 7a5f745f 8a719/u.i.xyz_t_\n 0140 61646400 78797a5f 745f6164 64000000 add.xyz_t_add...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_add' — lift: cannot lift 'xyz_t_add @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlwc1\t$f4,0(a0) */\n/* 4:\tlwc1\t$f6,0(a1) */\n/* 8:\tadd.s\t$f8,$f4,$f6 */\n/* c:\tswc1\t$f8,0(a2) */\n/* 10:\tlwc1\t$f16,4(a1) */\n/* 14:\tlwc1\t$f10,4(a0) */\n/* 18:\tadd.s\t$f18,$f10,$f16 */\n/* 1c:\tswc1\t$f18,4(a2) */\n/* 20:\tlwc1\t$f6,8(a1) */\n/* 24:\tlwc1\t$f4,8(a0) */\n/* 28:\tadd.s\t$f8,$f4,$f6 */\n/* 2c:\tjr\tra */\n/* 30:\tswc1\t$f8,8(a2) */\n/* \t... */\nvoid xyz_t_add(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_add @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_add @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_add(void *arg0, void *arg1, void *arg2) {\n arg2->unk0 = (f32) (arg0->unk0 + arg1->unk0);\n arg2->unk4 = (f32) (arg0->unk4 + arg1->unk4);\n arg2->unk8 = (f32) (arg0->unk8 + arg1->unk8);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 3: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 4: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 5: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `xyz_t_add` — benchmark function af:xyz_t_add:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_add\n lwc1\t$f4, 0($a0)\n lwc1\t$f6, 0($a1)\n add.s\t$f8, $f4, $f6\n swc1\t$f8, 0($a2)\n lwc1\t$f16, 4($a1)\n lwc1\t$f10, 4($a0)\n add.s\t$f18, $f10, $f16\n swc1\t$f18, 4($a2)\n lwc1\t$f6, 8($a1)\n lwc1\t$f4, 8($a0)\n add.s\t$f8, $f4, $f6\n jr\t$ra\n swc1\t$f8, 8($a2)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_add # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_add` — benchmark function af:xyz_t_add:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_add:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tadd.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tadd.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tadd.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_add\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062200 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105480 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062200 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d656339 66643861 32343532 -ido-ec9fd8a2452\n 0130 38613731 392f752e 69007879 7a5f745f 8a719/u.i.xyz_t_\n 0140 61646400 78797a5f 745f6164 64000000 add.xyz_t_add...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_add # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_mult_v:ido7.1","sym":"xyz_t_mult_v","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","float"],"loc":5,"refSource":"void xyz_t_mult_v(xyz_t* multiplicand, f32 multiplier) {\n multiplicand->x *= multiplier;\n multiplicand->y *= multiplier;\n multiplicand->z *= multiplier;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L254-L258","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f4,0(a0)\n 8:\tlwc1\t$f8,4(a0)\n c:\tlwc1\t$f16,8(a0)\n 10:\tmul.s\t$f6,$f4,$f12\n 14:\tmul.s\t$f10,$f8,$f12\n 18:\tmul.s\t$f18,$f16,$f12\n 1c:\tswc1\t$f6,0(a0)\n 20:\tswc1\t$f10,4(a0)\n 24:\tjr\tra\n 28:\tswc1\t$f18,8(a0)\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c xyz_t_mult_v\n\n\nContents of section .text:\n 0000 44856000 c4840000 c4880004 c4900008 D.`.............\n 0010 460c2182 460c4282 460c8482 e4860000 F.!.F.B.F.......\n 0020 e48a0004 03e00008 e4920008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 000d1dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 000d1dd0 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 0000000c 000001a8 p...............\n 0010 00000005 000002fc 00000001 000001b4 ................\n 0020 00000004 000001e8 00000000 00000000 ................\n 0030 00000011 00000218 00000038 0000025c ...........8...\\\n 0040 00000010 00000294 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 00101010 e01010e0 1020f000 00000000 ......... ......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000006 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000002c ..... .....*...,\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d356562 61356236 real-ido-5eba5b6\n 0130 39663537 39666461 632f752e 69007879 9f579fdac/u.i.xy\n 0140 7a5f745f 6d756c74 5f760000 78797a5f z_t_mult_v..xyz_\n 0150 745f6d75 6c745f76 00000000 00000000 t_mult_v........\n 0160 00000001 00000000 00000037 00000000 ...........7....\n 0170 00000004 00000000 0000000b 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 0000000b 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_mult_v' — lift: cannot lift 'xyz_t_mult_v @0x4': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta1,$f12 */\n/* 4:\tlwc1\t$f4,0(a0) */\n/* 8:\tlwc1\t$f8,4(a0) */\n/* c:\tlwc1\t$f16,8(a0) */\n/* 10:\tmul.s\t$f6,$f4,$f12 */\n/* 14:\tmul.s\t$f10,$f8,$f12 */\n/* 18:\tmul.s\t$f18,$f16,$f12 */\n/* 1c:\tswc1\t$f6,0(a0) */\n/* 20:\tswc1\t$f10,4(a0) */\n/* 24:\tjr\tra */\n/* 28:\tswc1\t$f18,8(a0) */\n/* 2c:\tnop */\nvoid xyz_t_mult_v(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_mult_v @0x4': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_mult_v @0x4': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_mult_v(void *arg0, f32 arg1) {\n arg0->unk0 = (f32) (arg0->unk0 * arg1);\n arg0->unk4 = (f32) (arg0->unk4 * arg1);\n arg0->unk8 = (f32) (arg0->unk8 * arg1);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 3: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 4: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 5: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `xyz_t_mult_v` — benchmark function af:xyz_t_mult_v:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_mult_v\n mtc1\t$a1, $f12\n lwc1\t$f4, 0($a0)\n lwc1\t$f8, 4($a0)\n lwc1\t$f16, 8($a0)\n mul.s\t$f6, $f4, $f12\n mul.s\t$f10, $f8, $f12\n mul.s\t$f18, $f16, $f12\n swc1\t$f6, 0($a0)\n swc1\t$f10, 4($a0)\n jr\t$ra\n swc1\t$f18, 8($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_mult_v # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_mult_v` — benchmark function af:xyz_t_mult_v:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_mult_v:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f4,0(a0)\n 8:\tlwc1\t$f8,4(a0)\n c:\tlwc1\t$f16,8(a0)\n 10:\tmul.s\t$f6,$f4,$f12\n 14:\tmul.s\t$f10,$f8,$f12\n 18:\tmul.s\t$f18,$f16,$f12\n 1c:\tswc1\t$f6,0(a0)\n 20:\tswc1\t$f10,4(a0)\n 24:\tjr\tra\n 28:\tswc1\t$f18,8(a0)\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c xyz_t_mult_v\n\n\nContents of section .text:\n 0000 44856000 c4840000 c4880004 c4900008 D.`.............\n 0010 460c2182 460c4282 460c8482 e4860000 F.!.F.B.F.......\n 0020 e48a0004 03e00008 e4920008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 000d1dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 000d1dd0 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 0000000c 000001a8 p...............\n 0010 00000005 000002fc 00000001 000001b4 ................\n 0020 00000004 000001e8 00000000 00000000 ................\n 0030 00000011 00000218 00000038 0000025c ...........8...\\\n 0040 00000010 00000294 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 00101010 e01010e0 1020f000 00000000 ......... ......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000006 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000002c ..... .....*...,\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d356562 61356236 real-ido-5eba5b6\n 0130 39663537 39666461 632f752e 69007879 9f579fdac/u.i.xy\n 0140 7a5f745f 6d756c74 5f760000 78797a5f z_t_mult_v..xyz_\n 0150 745f6d75 6c745f76 00000000 00000000 t_mult_v........\n 0160 00000001 00000000 00000037 00000000 ...........7....\n 0170 00000004 00000000 0000000b 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 0000000b 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_mult_v # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_sub_ss:ido7.1","sym":"xyz_t_sub_ss","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct"],"loc":5,"refSource":"void xyz_t_sub_ss(xyz_t* dest, s_xyz* minuend, s_xyz* subtrahend) {\n dest->x = minuend->x - subtrahend->x;\n dest->y = minuend->y - subtrahend->y;\n dest->z = minuend->z - subtrahend->z;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L248-L252","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tt6,0(a1)\n 4:\tlh\tt7,0(a2)\n 8:\tsubu\tt8,t6,t7\n c:\tmtc1\tt8,$f4\n 10:\tnop\n 14:\tcvt.s.w\t$f6,$f4\n 18:\tswc1\t$f6,0(a0)\n 1c:\tlh\tt0,2(a2)\n 20:\tlh\tt9,2(a1)\n 24:\tsubu\tt1,t9,t0\n 28:\tmtc1\tt1,$f8\n 2c:\tnop\n 30:\tcvt.s.w\t$f10,$f8\n 34:\tswc1\t$f10,4(a0)\n 38:\tlh\tt3,4(a2)\n 3c:\tlh\tt2,4(a1)\n 40:\tsubu\tt4,t2,t3\n 44:\tmtc1\tt4,$f16\n 48:\tnop\n 4c:\tcvt.s.w\t$f18,$f16\n 50:\tjr\tra\n 54:\tswc1\t$f18,8(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000058 xyz_t_sub_ss\n\n\nContents of section .text:\n 0000 84ae0000 84cf0000 01cfc023 44982000 ...........#D. .\n 0010 00000000 468021a0 e4860000 84c80002 ....F.!.........\n 0020 84b90002 03284823 44894000 00000000 .....(H#D.@.....\n 0030 468042a0 e48a0004 84cb0004 84aa0004 F.B.............\n 0040 014b6023 448c8000 00000000 468084a0 .K`#D.......F...\n 0050 03e00008 e4920008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300df70 00000000 . .........p....\n 0010 000d0dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300df70 00000000 000d0dd0 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000016 00000008 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e0 .......(........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000038 00000288 .......D...8....\n 0040 00000010 000002c0 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 16161510 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000008 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000058 20200001 . .....*...X ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d643433 35353733 66633865 -ido-d435573fc8e\n 0130 32643164 662f752e 69007879 7a5f745f 2d1df/u.i.xyz_t_\n 0140 7375625f 73730000 78797a5f 745f7375 sub_ss..xyz_t_su\n 0150 625f7373 00000000 00000000 00000001 b_ss............\n 0160 00000000 00000037 00000000 00000004 .......7........\n 0170 00000000 00000016 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000005 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_sub_ss' — lift: cannot lift 'xyz_t_sub_ss @0x14': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlh\tt6,0(a1) */\n/* 4:\tlh\tt7,0(a2) */\n/* 8:\tsubu\tt8,t6,t7 */\n/* c:\tmtc1\tt8,$f4 */\n/* 10:\tnop */\n/* 14:\tcvt.s.w\t$f6,$f4 */\n/* 18:\tswc1\t$f6,0(a0) */\n/* 1c:\tlh\tt0,2(a2) */\n/* 20:\tlh\tt9,2(a1) */\n/* 24:\tsubu\tt1,t9,t0 */\n/* 28:\tmtc1\tt1,$f8 */\n/* 2c:\tnop */\n/* 30:\tcvt.s.w\t$f10,$f8 */\n/* 34:\tswc1\t$f10,4(a0) */\n/* 38:\tlh\tt3,4(a2) */\n/* 3c:\tlh\tt2,4(a1) */\n/* 40:\tsubu\tt4,t2,t3 */\n/* 44:\tmtc1\tt4,$f16 */\n/* 48:\tnop */\n/* 4c:\tcvt.s.w\t$f18,$f16 */\n/* 50:\tjr\tra */\n/* 54:\tswc1\t$f18,8(a0) */\n/* \t... */\nvoid xyz_t_sub_ss(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_sub_ss @0x14': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":31,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_sub_ss @0x14': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_sub_ss(void *arg0, void *arg1, void *arg2) {\n arg0->unk0 = (f32) (arg1->unk0 - arg2->unk0);\n arg0->unk4 = (f32) (arg1->unk2 - arg2->unk2);\n arg0->unk8 = (f32) (arg1->unk4 - arg2->unk4);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 5: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 6: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 7: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `xyz_t_sub_ss` — benchmark function af:xyz_t_sub_ss:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_sub_ss\n lh\t$t6, 0($a1)\n lh\t$t7, 0($a2)\n subu\t$t8, $t6, $t7\n mtc1\t$t8, $f4\n nop\n cvt.s.w\t$f6, $f4\n swc1\t$f6, 0($a0)\n lh\t$t0, 2($a2)\n lh\t$t9, 2($a1)\n subu\t$t1, $t9, $t0\n mtc1\t$t1, $f8\n nop\n cvt.s.w\t$f10, $f8\n swc1\t$f10, 4($a0)\n lh\t$t3, 4($a2)\n lh\t$t2, 4($a1)\n subu\t$t4, $t2, $t3\n mtc1\t$t4, $f16\n nop\n cvt.s.w\t$f18, $f16\n jr\t$ra\n swc1\t$f18, 8($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_sub_ss # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_sub_ss` — benchmark function af:xyz_t_sub_ss:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_sub_ss:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tt6,0(a1)\n 4:\tlh\tt7,0(a2)\n 8:\tsubu\tt8,t6,t7\n c:\tmtc1\tt8,$f4\n 10:\tnop\n 14:\tcvt.s.w\t$f6,$f4\n 18:\tswc1\t$f6,0(a0)\n 1c:\tlh\tt0,2(a2)\n 20:\tlh\tt9,2(a1)\n 24:\tsubu\tt1,t9,t0\n 28:\tmtc1\tt1,$f8\n 2c:\tnop\n 30:\tcvt.s.w\t$f10,$f8\n 34:\tswc1\t$f10,4(a0)\n 38:\tlh\tt3,4(a2)\n 3c:\tlh\tt2,4(a1)\n 40:\tsubu\tt4,t2,t3\n 44:\tmtc1\tt4,$f16\n 48:\tnop\n 4c:\tcvt.s.w\t$f18,$f16\n 50:\tjr\tra\n 54:\tswc1\t$f18,8(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000058 xyz_t_sub_ss\n\n\nContents of section .text:\n 0000 84ae0000 84cf0000 01cfc023 44982000 ...........#D. .\n 0010 00000000 468021a0 e4860000 84c80002 ....F.!.........\n 0020 84b90002 03284823 44894000 00000000 .....(H#D.@.....\n 0030 468042a0 e48a0004 84cb0004 84aa0004 F.B.............\n 0040 014b6023 448c8000 00000000 468084a0 .K`#D.......F...\n 0050 03e00008 e4920008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300df70 00000000 . .........p....\n 0010 000d0dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300df70 00000000 000d0dd0 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000016 00000008 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e0 .......(........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000038 00000288 .......D...8....\n 0040 00000010 000002c0 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 16161510 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000008 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000058 20200001 . .....*...X ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d643433 35353733 66633865 -ido-d435573fc8e\n 0130 32643164 662f752e 69007879 7a5f745f 2d1df/u.i.xyz_t_\n 0140 7375625f 73730000 78797a5f 745f7375 sub_ss..xyz_t_su\n 0150 625f7373 00000000 00000000 00000001 b_ss............\n 0160 00000000 00000037 00000000 00000004 .......7........\n 0170 00000000 00000016 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000005 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_sub_ss # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_sub:ido7.1","sym":"xyz_t_sub","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","field","float"],"loc":5,"refSource":"void xyz_t_sub(xyz_t* minuend, xyz_t* subtrahend, xyz_t* diff) {\n diff->x = minuend->x - subtrahend->x;\n diff->y = minuend->y - subtrahend->y;\n diff->z = minuend->z - subtrahend->z;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L242-L246","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tsub.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tsub.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tsub.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\n","proto":{"xyz_t_sub":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_sub\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062201 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105481 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062201 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d383532 37346662 37623236 -ido-85274fb7b26\n 0130 63633439 392f752e 69007879 7a5f745f cc499/u.i.xyz_t_\n 0140 73756200 78797a5f 745f7375 62000000 sub.xyz_t_sub...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_sub' — lift: cannot lift 'xyz_t_sub @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlwc1\t$f4,0(a0) */\n/* 4:\tlwc1\t$f6,0(a1) */\n/* 8:\tsub.s\t$f8,$f4,$f6 */\n/* c:\tswc1\t$f8,0(a2) */\n/* 10:\tlwc1\t$f16,4(a1) */\n/* 14:\tlwc1\t$f10,4(a0) */\n/* 18:\tsub.s\t$f18,$f10,$f16 */\n/* 1c:\tswc1\t$f18,4(a2) */\n/* 20:\tlwc1\t$f6,8(a1) */\n/* 24:\tlwc1\t$f4,8(a0) */\n/* 28:\tsub.s\t$f8,$f4,$f6 */\n/* 2c:\tjr\tra */\n/* 30:\tswc1\t$f8,8(a2) */\n/* \t... */\nvoid xyz_t_sub(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_sub @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_sub @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_sub(void *arg0, void *arg1, void *arg2) {\n arg2->unk0 = (f32) (arg0->unk0 - arg1->unk0);\n arg2->unk4 = (f32) (arg0->unk4 - arg1->unk4);\n arg2->unk8 = (f32) (arg0->unk8 - arg1->unk8);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 3: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 4: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 5: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `xyz_t_sub` — benchmark function af:xyz_t_sub:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_sub\n lwc1\t$f4, 0($a0)\n lwc1\t$f6, 0($a1)\n sub.s\t$f8, $f4, $f6\n swc1\t$f8, 0($a2)\n lwc1\t$f16, 4($a1)\n lwc1\t$f10, 4($a0)\n sub.s\t$f18, $f10, $f16\n swc1\t$f18, 4($a2)\n lwc1\t$f6, 8($a1)\n lwc1\t$f4, 8($a0)\n sub.s\t$f8, $f4, $f6\n jr\t$ra\n swc1\t$f8, 8($a2)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_sub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_sub` — benchmark function af:xyz_t_sub:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: cd0c6784945e7f89093cf1da7094629f45435ccfa7083ae42ee79d2ba9c7bdd2\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_sub:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tsub.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tsub.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tsub.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_sub\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062201 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105481 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062201 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d383532 37346662 37623236 -ido-85274fb7b26\n 0130 63633439 392f752e 69007879 7a5f745f cc499/u.i.xyz_t_\n 0140 73756200 78797a5f 745f7375 62000000 sub.xyz_t_sub...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"xyz_t_sub\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_sub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:CheckTileCollisionVertical:agbcc","sym":"CheckTileCollisionVertical","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","struct","branch","pointer","memory"],"loc":20,"refSource":"struct Unk_08014184 *CheckTileCollisionVertical(struct Unk_08014184 *arg0, u16 arg1, u16 arg2, u8 arg3) {\n u32 var_r3;\n struct Unk_08014184 var_r4;\n\n for (var_r3 = gUnk_03004D80->unk2; var_r3 < gUnk_03004D80->unk0; var_r3++) {\n if ((arg2 >= gUnk_03004D80->unk4[var_r3].unk2) && (gUnk_03004D80->unk4[var_r3].unk6 >= (arg2 - arg3))\n && (arg1 < (gUnk_03004D80->unk4[var_r3].unk0 + 3)) && ((gUnk_03004D80->unk4[var_r3].unk0 - 3) < arg1)) {\n var_r4.unk0 = gUnk_03004D80->unk4[var_r3].unk0 - 3;\n var_r4.unk2 = gUnk_03004D80->unk4[var_r3].unk8;\n *arg0 = var_r4;\n goto exit;\n return arg0;\n }\n }\n\n var_r4.unk0 = -1;\n *arg0 = var_r4;\nexit:\n return arg0;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_1.c#L43-L62","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckTileCollisionVertical\n\t.type\t CheckTileCollisionVertical,function\n\t.thumb_func\nCheckTileCollisionVertical:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x4\n\tmov\tip, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr1, r1, #0x10\n\tstr\tr1, [sp]\n\tlsl\tr2, r2, #0x10\n\tlsr\tr6, r2, #0x10\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr9, r3\n\tldr\tr0, .L10\n\tmov\tsl, r0\n\tldr\tr0, [r0]\n\tldrh\tr3, [r0, #0x2]\n\tldrh\tr1, [r0]\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n\tmov\tr8, r0\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r3\n\tlsl\tr5, r0, #0x2\n.L6:\n\tmov\tr7, r8\n\tldr\tr0, [r7, #0x4]\n\tadd\tr2, r5, r0\n\tldrh\tr0, [r2, #0x2]\n\tcmp\tr6, r0\n\tbcc\t.L5\t@cond_branch\n\tldrh\tr1, [r2, #0x6]\n\tmov\tr7, r9\n\tsub\tr0, r6, r7\n\tcmp\tr1, r0\n\tblt\t.L5\t@cond_branch\n\tldrh\tr1, [r2]\n\tadd\tr0, r1, #0x3\n\tldr\tr7, [sp]\n\tcmp\tr7, r0\n\tbge\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x3\n\tcmp\tr0, r7\n\tbge\t.L5\t@cond_branch\n\tlsl\tr1, r0, #0x10\n\tlsr\tr1, r1, #0x10\n\tldr\tr0, .L10+0x4\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tldrb\tr1, [r2, #0x8]\n\tlsl\tr1, r1, #0x10\n\tldr\tr0, .L10+0x8\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tmov\tr0, ip\n\tstr\tr4, [r0]\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03004D80\n\t.word\t-0x10000\n\t.word\t-0xff0001\n.L5:\n\tadd\tr5, r5, #0xc\n\tadd\tr3, r3, #0x1\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tldrh\tr0, [r0]\n\tcmp\tr3, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L12\n\torr\tr4, r4, r0\n\tmov\tr7, ip\n\tstr\tr4, [r7]\n.L8:\n\tmov\tr0, ip\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t CheckTileCollisionVertical,.Lfe1-CheckTileCollisionVertical\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'CheckTileCollisionVertical' — lift: cannot lift 'CheckTileCollisionVertical': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tCheckTileCollisionVertical */\n/* \t.type\t CheckTileCollisionVertical,function */\n/* \t.thumb_func */\n/* CheckTileCollisionVertical: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, sl */\n/* \tmov\tr6, r9 */\n/* \tmov\tr5, r8 */\n/* \tpush\t{r5, r6, r7} */\n/* \tadd\tsp, sp, #-0x4 */\n/* \tmov\tip, r0 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr1, r1, #0x10 */\n/* \tstr\tr1, [sp] */\n/* \tlsl\tr2, r2, #0x10 */\n/* \tlsr\tr6, r2, #0x10 */\n/* \tlsl\tr3, r3, #0x18 */\n/* \tlsr\tr3, r3, #0x18 */\n/* \tmov\tr9, r3 */\n/* \tldr\tr0, .L10 */\n/* \tmov\tsl, r0 */\n/* \tldr\tr0, [r0] */\n/* \tldrh\tr3, [r0, #0x2] */\n/* \tldrh\tr1, [r0] */\n/* \tcmp\tr3, r1 */\n/* \tbcs\t.L4\t@cond_branch */\n/* \tmov\tr8, r0 */\n/* \tlsl\tr0, r3, #0x1 */\n/* \tadd\tr0, r0, r3 */\n/* \tlsl\tr5, r0, #0x2 */\n/* .L6: */\n/* \tmov\tr7, r8 */\n/* \tldr\tr0, [r7, #0x4] */\n/* \tadd\tr2, r5, r0 */\n/* \tldrh\tr0, [r2, #0x2] */\n/* \tcmp\tr6, r0 */\n/* \tbcc\t.L5\t@cond_branch */\n/* \tldrh\tr1, [r2, #0x6] */\n/* \tmov\tr7, r9 */\n/* \tsub\tr0, r6, r7 */\n/* \tcmp\tr1, r0 */\n/* \tblt\t.L5\t@cond_branch */\n/* \tldrh\tr1, [r2] */\n/* \tadd\tr0, r1, #0x3 */\n/* \tldr\tr7, [sp] */\n/* \tcmp\tr7, r0 */\n/* \tbge\t.L5\t@cond_branch */\n/* \tsub\tr0, r1, #0x3 */\n/* \tcmp\tr0, r7 */\n/* \tbge\t.L5\t@cond_branch */\n/* \tlsl\tr1, r0, #0x10 */\n/* \tlsr\tr1, r1, #0x10 */\n/* \tldr\tr0, .L10+0x4 */\n/* \tand\tr4, r4, r0 */\n/* \torr\tr4, r4, r1 */\n/* \tldrb\tr1, [r2, #0x8] */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tldr\tr0, .L10+0x8 */\n/* \tand\tr4, r4, r0 */\n/* \torr\tr4, r4, r1 */\n/* \tmov\tr0, ip */\n/* \tstr\tr4, [r0] */\n/* \tb\t.L8 */\n/* .L11: */\n/* \t.align\t2, 0 */\n/* .L10: */\n/* \t.word\tgUnk_03004D80 */\n/* \t.word\t-0x10000 */\n/* \t.word\t-0xff0001 */\n/* .L5: */\n/* \tadd\tr5, r5, #0xc */\n/* \tadd\tr3, r3, #0x1 */\n/* \tmov\tr1, sl */\n/* \tldr\tr0, [r1] */\n/* \tldrh\tr0, [r0] */\n/* \tcmp\tr3, r0 */\n/* \tbcc\t.L6\t@cond_branch */\n/* .L4: */\n/* \tldr\tr0, .L12 */\n/* \torr\tr4, r4, r0 */\n/* \tmov\tr7, ip */\n/* \tstr\tr4, [r7] */\n/* .L8: */\n/* \tmov\tr0, ip */\n/* \tadd\tsp, sp, #0x4 */\n/* \tpop\t{r3, r4, r5} */\n/* \tmov\tr8, r3 */\n/* \tmov\tr9, r4 */\n/* \tmov\tsl, r5 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .L13: */\n/* \t.align\t2, 0 */\n/* .L12: */\n/* \t.word\t0xffff */\n/* .Lfe1: */\n/* \t.size\t CheckTileCollisionVertical,.Lfe1-CheckTileCollisionVertical */\n/* .text */\n/* \t.align\t2, 0 */\nvoid CheckTileCollisionVertical(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'CheckTileCollisionVertical': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":110,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'CheckTileCollisionVertical': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern void *gUnk_03004D80;\n\ns32 *CheckTileCollisionVertical(s32 *arg0, u16 arg1, u16 arg2, u8 arg3) {\n s32 temp_r0;\n s32 var_r5;\n u16 temp_r1;\n u16 temp_r6;\n u16 var_r3;\n void *temp_r2;\n\n unksp0 = (s32) arg1;\n temp_r6 = arg2;\n var_r3 = gUnk_03004D80->unk2;\n if ((u32) var_r3 < (u32) gUnk_03004D80->unk0) {\n var_r5 = var_r3 * 0xC;\nloop_2:\n temp_r2 = var_r5 + gUnk_03004D80->unk4;\n if (((u32) temp_r6 >= (u32) temp_r2->unk2) && ((s32) temp_r2->unk6 >= (s32) (temp_r6 - arg3)) && (temp_r1 = temp_r2->unk0, (unksp0 < (s32) (temp_r1 + 3))) && (temp_r0 = temp_r1 - 3, (temp_r0 < unksp0))) {\n *arg0 = (((saved_reg_r4 & 0xFFFF0000) | (u16) temp_r0) & 0xFF00FFFF) | (temp_r2->unk8 << 0x10);\n } else {\n var_r5 += 0xC;\n var_r3 += 1;\n if ((u32) var_r3 >= (u32) gUnk_03004D80->unk0) {\n goto block_8;\n }\n goto loop_2;\n }\n } else {\nblock_8:\n *arg0 = saved_reg_r4 | 0xFFFF;\n }\n return arg0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":64,"lines":31,"gotos":2,"casts":9,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1077: conflicting types for `gUnk_03004D80'","/c.c:563: previous declaration of `gUnk_03004D80'","/c.c:1087: `unksp0' undeclared (first use in this function)","/c.c:1087: (Each undeclared identifier is reported only once","/c.c:1087: for each function it appears in.)"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CheckTileCollisionVertical` — benchmark function kleod:CheckTileCollisionVertical:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckTileCollisionVertical\n\t.type\t CheckTileCollisionVertical,function\n\t.thumb_func\nCheckTileCollisionVertical:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x4\n\tmov\tip, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr1, r1, #0x10\n\tstr\tr1, [sp]\n\tlsl\tr2, r2, #0x10\n\tlsr\tr6, r2, #0x10\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr9, r3\n\tldr\tr0, .L10\n\tmov\tsl, r0\n\tldr\tr0, [r0]\n\tldrh\tr3, [r0, #0x2]\n\tldrh\tr1, [r0]\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n\tmov\tr8, r0\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r3\n\tlsl\tr5, r0, #0x2\n.L6:\n\tmov\tr7, r8\n\tldr\tr0, [r7, #0x4]\n\tadd\tr2, r5, r0\n\tldrh\tr0, [r2, #0x2]\n\tcmp\tr6, r0\n\tbcc\t.L5\t@cond_branch\n\tldrh\tr1, [r2, #0x6]\n\tmov\tr7, r9\n\tsub\tr0, r6, r7\n\tcmp\tr1, r0\n\tblt\t.L5\t@cond_branch\n\tldrh\tr1, [r2]\n\tadd\tr0, r1, #0x3\n\tldr\tr7, [sp]\n\tcmp\tr7, r0\n\tbge\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x3\n\tcmp\tr0, r7\n\tbge\t.L5\t@cond_branch\n\tlsl\tr1, r0, #0x10\n\tlsr\tr1, r1, #0x10\n\tldr\tr0, .L10+0x4\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tldrb\tr1, [r2, #0x8]\n\tlsl\tr1, r1, #0x10\n\tldr\tr0, .L10+0x8\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tmov\tr0, ip\n\tstr\tr4, [r0]\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03004D80\n\t.word\t-0x10000\n\t.word\t-0xff0001\n.L5:\n\tadd\tr5, r5, #0xc\n\tadd\tr3, r3, #0x1\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tldrh\tr0, [r0]\n\tcmp\tr3, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L12\n\torr\tr4, r4, r0\n\tmov\tr7, ip\n\tstr\tr4, [r7]\n.L8:\n\tmov\tr0, ip\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t CheckTileCollisionVertical,.Lfe1-CheckTileCollisionVertical\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CheckTileCollisionVertical # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CheckTileCollisionVertical` — benchmark function kleod:CheckTileCollisionVertical:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:CheckTileCollisionVertical:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckTileCollisionVertical\n\t.type\t CheckTileCollisionVertical,function\n\t.thumb_func\nCheckTileCollisionVertical:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x4\n\tmov\tip, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr1, r1, #0x10\n\tstr\tr1, [sp]\n\tlsl\tr2, r2, #0x10\n\tlsr\tr6, r2, #0x10\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr9, r3\n\tldr\tr0, .L10\n\tmov\tsl, r0\n\tldr\tr0, [r0]\n\tldrh\tr3, [r0, #0x2]\n\tldrh\tr1, [r0]\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n\tmov\tr8, r0\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r3\n\tlsl\tr5, r0, #0x2\n.L6:\n\tmov\tr7, r8\n\tldr\tr0, [r7, #0x4]\n\tadd\tr2, r5, r0\n\tldrh\tr0, [r2, #0x2]\n\tcmp\tr6, r0\n\tbcc\t.L5\t@cond_branch\n\tldrh\tr1, [r2, #0x6]\n\tmov\tr7, r9\n\tsub\tr0, r6, r7\n\tcmp\tr1, r0\n\tblt\t.L5\t@cond_branch\n\tldrh\tr1, [r2]\n\tadd\tr0, r1, #0x3\n\tldr\tr7, [sp]\n\tcmp\tr7, r0\n\tbge\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x3\n\tcmp\tr0, r7\n\tbge\t.L5\t@cond_branch\n\tlsl\tr1, r0, #0x10\n\tlsr\tr1, r1, #0x10\n\tldr\tr0, .L10+0x4\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tldrb\tr1, [r2, #0x8]\n\tlsl\tr1, r1, #0x10\n\tldr\tr0, .L10+0x8\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tmov\tr0, ip\n\tstr\tr4, [r0]\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03004D80\n\t.word\t-0x10000\n\t.word\t-0xff0001\n.L5:\n\tadd\tr5, r5, #0xc\n\tadd\tr3, r3, #0x1\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tldrh\tr0, [r0]\n\tcmp\tr3, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L12\n\torr\tr4, r4, r0\n\tmov\tr7, ip\n\tstr\tr4, [r7]\n.L8:\n\tmov\tr0, ip\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t CheckTileCollisionVertical,.Lfe1-CheckTileCollisionVertical\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CheckTileCollisionVertical # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:CheckWorldCompletion:agbcc","sym":"CheckWorldCompletion","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","struct","nested-loop","bitwise","branch"],"loc":40,"refSource":"u8 CheckWorldCompletion(u8 arg0) {\n u32 var_r0;\n u32 var_r2;\n u8 var_sl;\n u8 var_ip;\n u8 var_r6;\n u8 var_r8;\n u8 v50;\n if (arg0 < 4) {\n if (((gUnk_03004670->unk8[arg0][7] & 0x80) != 0) && ((gUnk_03004670->unk8[arg0 + 1][0] & 0x7F) != 0x7F))\n return 1;\n } else if ((gUnk_03004670->unk8[5][7] & 0x80) != 0) {\n var_r8 = 0;\n var_ip = 0;\n var_r6 = 0;\n var_sl = 0;\n for (var_r0 = 0; var_r0 < 5; var_r0++) {\n for (var_r2 = 0; var_r2 < 7; var_r2++) {\n if ((var_r2 == 3 || var_r2 == 5) && (gUnk_03004670->unk8[var_r0][var_r2] & 0x7F) == 0x64)\n var_r8 += 1;\n else if ((var_r2 != 7) && ((gUnk_03004670->unk8[var_r0][var_r2] & 0x7F) == 0x1E))\n var_ip += 1;\n if (gUnk_03004670->unk8[var_r0][var_r2] & 0x80)\n var_r6 += 1;\n }\n }\n v50 = gUnk_03004670->unk8[5][0] & 0x7F;\n if (v50 == 0x1E)\n var_sl += 1;\n if ((gUnk_03004670->unk8[5][1] & 0x7F) == 0x1E)\n var_sl += 1;\n if ((arg0 == 4) && (v50 != 0x7F) && (var_r6 == 0x23))\n return 1;\n if ((arg0 == 5) && ((gUnk_03004670->unk8[5][1] & 0x7F) != 0x7F) && ((var_ip + var_r8) > 0x18))\n return 1;\n if ((arg0 == 6) && ((gUnk_03004670->unk8[5][2] & 0x7F) != 0x7F) && ((var_ip + var_r8 + var_sl) == 0x25))\n return 1;\n }\n return 0;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_3.c#L1752-L1791","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckWorldCompletion\n\t.type\t CheckWorldCompletion,function\n\t.thumb_func\nCheckWorldCompletion:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tcmp\tr0, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr0, .L30\n\tldr\tr2, [r0]\n\tmov\tr0, r9\n\tlsl\tr1, r0, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xf\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB26\n\tb\t.L5\t@long jump\n.LCB26:\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.LCB39\n\tb\t.L5\t@long jump\n.LCB39:\n.L29:\n\tmov\tr0, #0x1\n\tb\t.L27\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgUnk_03004670\n.L3:\n\tldr\tr2, .L32\n\tldr\tr0, [r2]\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB61\n\tb\t.L5\t@long jump\n.LCB61:\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tip, r1\n\tmov\tr6, #0x0\n\tmov\tsl, r6\n\tmov\tr0, #0x0\n\tadd\tr4, r2, #0\n\tmov\tr7, #0x7f\n.L10:\n\tmov\tr2, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr3, r0, #0x3\n.L14:\n\tcmp\tr2, #0x3\n\tbeq\t.L16\t@cond_branch\n\tcmp\tr2, #0x5\n\tbne\t.L15\t@cond_branch\n.L16:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L15\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr8, r0\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgUnk_03004670\n.L15:\n\tcmp\tr2, #0x7\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tip, r0\n.L17:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L13:\n\tadd\tr3, r3, #0x1\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, #0x6\n\tbls\t.L14\t@cond_branch\n\tadd\tr0, r5, #0\n\tcmp\tr0, #0x4\n\tbls\t.L10\t@cond_branch\n\tldr\tr0, .L34\n\tldr\tr1, [r0]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x30\n\tldrb\tr0, [r0]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L22\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L22:\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L23\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L23:\n\tmov\tr1, r9\n\tcmp\tr1, #0x4\n\tbne\t.L24\t@cond_branch\n\tcmp\tr3, #0x7f\n\tbeq\t.L24\t@cond_branch\n\tcmp\tr6, #0x23\n\tbeq\t.L29\t@cond_branch\n.L24:\n\tmov\tr0, r9\n\tcmp\tr0, #0x5\n\tbne\t.L25\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x18\n\tble\t.LCB220\n\tb\t.L29\t@long jump\n.LCB220:\n.L25:\n\tmov\tr0, r9\n\tcmp\tr0, #0x6\n\tbne\t.L5\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x32\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tcmp\tr0, #0x25\n\tbne\t.LCB240\n\tb\t.L29\t@long jump\n.LCB240:\n.L5:\n\tmov\tr0, #0x0\n.L27:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgUnk_03004670\n.Lfe1:\n\t.size\t CheckWorldCompletion,.Lfe1-CheckWorldCompletion\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'CheckWorldCompletion' — lift: cannot lift 'CheckWorldCompletion': branch target '.LCB39' is not a code block in this function (a data label, or outside the sliced function) */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tCheckWorldCompletion */\n/* \t.type\t CheckWorldCompletion,function */\n/* \t.thumb_func */\n/* CheckWorldCompletion: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, sl */\n/* \tmov\tr6, r9 */\n/* \tmov\tr5, r8 */\n/* \tpush\t{r5, r6, r7} */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tmov\tr9, r0 */\n/* \tcmp\tr0, #0x3 */\n/* \tbhi\t.L3\t@cond_branch */\n/* \tldr\tr0, .L30 */\n/* \tldr\tr2, [r0] */\n/* \tmov\tr0, r9 */\n/* \tlsl\tr1, r0, #0x3 */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0xf */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, #0x80 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.LCB26 */\n/* \tb\t.L5\t@long jump */\n/* .LCB26: */\n/* \tmov\tr1, r9 */\n/* \tadd\tr1, r1, #0x1 */\n/* \tlsl\tr1, r1, #0x3 */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x8 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbne\t.LCB39 */\n/* \tb\t.L5\t@long jump */\n/* .LCB39: */\n/* .L29: */\n/* \tmov\tr0, #0x1 */\n/* \tb\t.L27 */\n/* .L31: */\n/* \t.align\t2, 0 */\n/* .L30: */\n/* \t.word\tgUnk_03004670 */\n/* .L3: */\n/* \tldr\tr2, .L32 */\n/* \tldr\tr0, [r2] */\n/* \tadd\tr0, r0, #0x37 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, #0x80 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.LCB61 */\n/* \tb\t.L5\t@long jump */\n/* .LCB61: */\n/* \tmov\tr1, #0x0 */\n/* \tmov\tr8, r1 */\n/* \tmov\tip, r1 */\n/* \tmov\tr6, #0x0 */\n/* \tmov\tsl, r6 */\n/* \tmov\tr0, #0x0 */\n/* \tadd\tr4, r2, #0 */\n/* \tmov\tr7, #0x7f */\n/* .L10: */\n/* \tmov\tr2, #0x0 */\n/* \tadd\tr5, r0, #0x1 */\n/* \tlsl\tr3, r0, #0x3 */\n/* .L14: */\n/* \tcmp\tr2, #0x3 */\n/* \tbeq\t.L16\t@cond_branch */\n/* \tcmp\tr2, #0x5 */\n/* \tbne\t.L15\t@cond_branch */\n/* .L16: */\n/* \tldr\tr0, [r4] */\n/* \tadd\tr0, r0, #0x8 */\n/* \tadd\tr0, r0, r3 */\n/* \tldrb\tr1, [r0] */\n/* \tadd\tr0, r7, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x64 */\n/* \tbne\t.L15\t@cond_branch */\n/* \tmov\tr0, r8 */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tmov\tr8, r0 */\n/* \tb\t.L17 */\n/* .L33: */\n/* \t.align\t2, 0 */\n/* .L32: */\n/* \t.word\tgUnk_03004670 */\n/* .L15: */\n/* \tcmp\tr2, #0x7 */\n/* \tbeq\t.L17\t@cond_branch */\n/* \tldr\tr0, [r4] */\n/* \tadd\tr0, r0, #0x8 */\n/* \tadd\tr0, r0, r3 */\n/* \tldrb\tr1, [r0] */\n/* \tadd\tr0, r7, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x1e */\n/* \tbne\t.L17\t@cond_branch */\n/* \tmov\tr0, ip */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tmov\tip, r0 */\n/* .L17: */\n/* \tldr\tr0, [r4] */\n/* \tadd\tr0, r0, #0x8 */\n/* \tadd\tr0, r0, r3 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, #0x80 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L13\t@cond_branch */\n/* \tadd\tr0, r6, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr6, r0, #0x18 */\n/* .L13: */\n/* \tadd\tr3, r3, #0x1 */\n/* \tadd\tr2, r2, #0x1 */\n/* \tcmp\tr2, #0x6 */\n/* \tbls\t.L14\t@cond_branch */\n/* \tadd\tr0, r5, #0 */\n/* \tcmp\tr0, #0x4 */\n/* \tbls\t.L10\t@cond_branch */\n/* \tldr\tr0, .L34 */\n/* \tldr\tr1, [r0] */\n/* \tadd\tr0, r1, #0 */\n/* \tadd\tr0, r0, #0x30 */\n/* \tldrb\tr0, [r0] */\n/* \tmov\tr4, #0x7f */\n/* \tadd\tr3, r4, #0 */\n/* \tand\tr3, r3, r0 */\n/* \tcmp\tr3, #0x1e */\n/* \tbne\t.L22\t@cond_branch */\n/* \tmov\tr0, sl */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tmov\tsl, r0 */\n/* .L22: */\n/* \tadd\tr0, r1, #0 */\n/* \tadd\tr0, r0, #0x31 */\n/* \tldrb\tr1, [r0] */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x1e */\n/* \tbne\t.L23\t@cond_branch */\n/* \tmov\tr0, sl */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tmov\tsl, r0 */\n/* .L23: */\n/* \tmov\tr1, r9 */\n/* \tcmp\tr1, #0x4 */\n/* \tbne\t.L24\t@cond_branch */\n/* \tcmp\tr3, #0x7f */\n/* \tbeq\t.L24\t@cond_branch */\n/* \tcmp\tr6, #0x23 */\n/* \tbeq\t.L29\t@cond_branch */\n/* .L24: */\n/* \tmov\tr0, r9 */\n/* \tcmp\tr0, #0x5 */\n/* \tbne\t.L25\t@cond_branch */\n/* \tldr\tr1, .L34 */\n/* \tldr\tr0, [r1] */\n/* \tadd\tr0, r0, #0x31 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbeq\t.L25\t@cond_branch */\n/* \tmov\tr0, ip */\n/* \tadd\tr0, r0, r8 */\n/* \tcmp\tr0, #0x18 */\n/* \tble\t.LCB220 */\n/* \tb\t.L29\t@long jump */\n/* .LCB220: */\n/* .L25: */\n/* \tmov\tr0, r9 */\n/* \tcmp\tr0, #0x6 */\n/* \tbne\t.L5\t@cond_branch */\n/* \tldr\tr1, .L34 */\n/* \tldr\tr0, [r1] */\n/* \tadd\tr0, r0, #0x32 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbeq\t.L5\t@cond_branch */\n/* \tmov\tr0, ip */\n/* \tadd\tr0, r0, r8 */\n/* \tadd\tr0, r0, sl */\n/* \tcmp\tr0, #0x25 */\n/* \tbne\t.LCB240 */\n/* \tb\t.L29\t@long jump */\n/* .LCB240: */\n/* .L5: */\n/* \tmov\tr0, #0x0 */\n/* .L27: */\n/* \tpop\t{r3, r4, r5} */\n/* \tmov\tr8, r3 */\n/* \tmov\tr9, r4 */\n/* \tmov\tsl, r5 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .L35: */\n/* \t.align\t2, 0 */\n/* .L34: */\n/* \t.word\tgUnk_03004670 */\n/* .Lfe1: */\n/* \t.size\t CheckWorldCompletion,.Lfe1-CheckWorldCompletion */\n/* .text */\n/* \t.align\t2, 0 */\nvoid CheckWorldCompletion(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'CheckWorldCompletion': branch target '.LCB39' is not a code block in this function (a data label, or outside the sliced function)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":232,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'CheckWorldCompletion': branch target '.LCB39' is not a code block in this function (a data label, or outside the sliced function)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern void *gUnk_03004670;\n\ns32 CheckWorldCompletion(u8 arg0) {\n s32 temp_r3;\n s32 var_r3;\n u32 var_r0;\n u32 var_r2;\n u32 var_sl;\n u8 temp_r0;\n u8 var_ip;\n u8 var_r6;\n u8 var_r8;\n\n temp_r0 = arg0;\n if ((u32) temp_r0 <= 3U) {\n if (!(0x80 & *(gUnk_03004670 + 0xF + (temp_r0 * 8)))) {\n goto block_36;\n }\n if ((0x7F & *(gUnk_03004670 + 8 + ((temp_r0 + 1) * 8))) == 0x7F) {\n goto block_36;\n }\n goto block_5;\n }\n if (!(0x80 & gUnk_03004670->unk37)) {\n goto block_36;\n }\n var_r8 = 0;\n var_ip = 0;\n var_r6 = 0;\n var_sl = 0;\n var_r0 = 0;\n do {\n var_r2 = 0;\n var_r3 = var_r0 * 8;\nloop_10:\n switch (var_r2) { /* switch 1; irregular */\n case 7: /* switch 1 */\n break;\n case 3: /* switch 1 */\n case 5: /* switch 1 */\n if ((0x7F & *(gUnk_03004670 + 8 + var_r3)) == 0x64) {\n var_r8 += 1;\n } else if ((var_r2 != 7) && ((0x7F & *(gUnk_03004670 + 8 + var_r3)) == 0x1E)) {\n var_ip += 1;\n }\n break;\n }\n if (0x80 & *(gUnk_03004670 + 8 + var_r3)) {\n var_r6 += 1;\n }\n var_r3 += 1;\n var_r2 += 1;\n if (var_r2 <= 6U) {\n goto loop_10;\n }\n var_r0 += 1;\n } while (var_r0 <= 4U);\n temp_r3 = 0x7F & gUnk_03004670->unk30;\n if (temp_r3 == 0x1E) {\n var_sl = 0x01000000U >> 0x18;\n }\n if ((0x7F & gUnk_03004670->unk31) == 0x1E) {\n var_sl = (u32) (u8) (var_sl + 1);\n }\n switch (temp_r0) { /* switch 2; irregular */\n case 4: /* switch 2 */\n if ((temp_r3 == 0x7F) || (var_r6 != 0x23)) {\n if ((temp_r0 == 5) && ((0x7F & gUnk_03004670->unk31) != 0x7F) && ((s32) (var_ip + var_r8) > 0x18)) {\n goto block_5;\n }\n if ((temp_r0 == 6) && ((0x7F & gUnk_03004670->unk32) != 0x7F) && ((var_ip + var_r8 + var_sl) == 0x25)) {\n goto block_5;\n }\nblock_36:\n return 0;\n }\nblock_5:\n return 1;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":60,"lines":78,"gotos":7,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1072: conflicting types for `gUnk_03004670'","/c.c:312: previous declaration of `gUnk_03004670'","/c.c:1087: warning: dereferencing `void *' pointer","/c.c:1087: void value not ignored as it ought to be","/c.c:1090: warning: dereferencing `void *' pointer"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CheckWorldCompletion` — benchmark function kleod:CheckWorldCompletion:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckWorldCompletion\n\t.type\t CheckWorldCompletion,function\n\t.thumb_func\nCheckWorldCompletion:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tcmp\tr0, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr0, .L30\n\tldr\tr2, [r0]\n\tmov\tr0, r9\n\tlsl\tr1, r0, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xf\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB26\n\tb\t.L5\t@long jump\n.LCB26:\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.LCB39\n\tb\t.L5\t@long jump\n.LCB39:\n.L29:\n\tmov\tr0, #0x1\n\tb\t.L27\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgUnk_03004670\n.L3:\n\tldr\tr2, .L32\n\tldr\tr0, [r2]\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB61\n\tb\t.L5\t@long jump\n.LCB61:\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tip, r1\n\tmov\tr6, #0x0\n\tmov\tsl, r6\n\tmov\tr0, #0x0\n\tadd\tr4, r2, #0\n\tmov\tr7, #0x7f\n.L10:\n\tmov\tr2, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr3, r0, #0x3\n.L14:\n\tcmp\tr2, #0x3\n\tbeq\t.L16\t@cond_branch\n\tcmp\tr2, #0x5\n\tbne\t.L15\t@cond_branch\n.L16:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L15\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr8, r0\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgUnk_03004670\n.L15:\n\tcmp\tr2, #0x7\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tip, r0\n.L17:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L13:\n\tadd\tr3, r3, #0x1\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, #0x6\n\tbls\t.L14\t@cond_branch\n\tadd\tr0, r5, #0\n\tcmp\tr0, #0x4\n\tbls\t.L10\t@cond_branch\n\tldr\tr0, .L34\n\tldr\tr1, [r0]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x30\n\tldrb\tr0, [r0]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L22\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L22:\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L23\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L23:\n\tmov\tr1, r9\n\tcmp\tr1, #0x4\n\tbne\t.L24\t@cond_branch\n\tcmp\tr3, #0x7f\n\tbeq\t.L24\t@cond_branch\n\tcmp\tr6, #0x23\n\tbeq\t.L29\t@cond_branch\n.L24:\n\tmov\tr0, r9\n\tcmp\tr0, #0x5\n\tbne\t.L25\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x18\n\tble\t.LCB220\n\tb\t.L29\t@long jump\n.LCB220:\n.L25:\n\tmov\tr0, r9\n\tcmp\tr0, #0x6\n\tbne\t.L5\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x32\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tcmp\tr0, #0x25\n\tbne\t.LCB240\n\tb\t.L29\t@long jump\n.LCB240:\n.L5:\n\tmov\tr0, #0x0\n.L27:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgUnk_03004670\n.Lfe1:\n\t.size\t CheckWorldCompletion,.Lfe1-CheckWorldCompletion\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CheckWorldCompletion # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CheckWorldCompletion` — benchmark function kleod:CheckWorldCompletion:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:CheckWorldCompletion:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckWorldCompletion\n\t.type\t CheckWorldCompletion,function\n\t.thumb_func\nCheckWorldCompletion:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tcmp\tr0, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr0, .L30\n\tldr\tr2, [r0]\n\tmov\tr0, r9\n\tlsl\tr1, r0, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xf\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB26\n\tb\t.L5\t@long jump\n.LCB26:\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.LCB39\n\tb\t.L5\t@long jump\n.LCB39:\n.L29:\n\tmov\tr0, #0x1\n\tb\t.L27\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgUnk_03004670\n.L3:\n\tldr\tr2, .L32\n\tldr\tr0, [r2]\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB61\n\tb\t.L5\t@long jump\n.LCB61:\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tip, r1\n\tmov\tr6, #0x0\n\tmov\tsl, r6\n\tmov\tr0, #0x0\n\tadd\tr4, r2, #0\n\tmov\tr7, #0x7f\n.L10:\n\tmov\tr2, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr3, r0, #0x3\n.L14:\n\tcmp\tr2, #0x3\n\tbeq\t.L16\t@cond_branch\n\tcmp\tr2, #0x5\n\tbne\t.L15\t@cond_branch\n.L16:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L15\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr8, r0\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgUnk_03004670\n.L15:\n\tcmp\tr2, #0x7\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tip, r0\n.L17:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L13:\n\tadd\tr3, r3, #0x1\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, #0x6\n\tbls\t.L14\t@cond_branch\n\tadd\tr0, r5, #0\n\tcmp\tr0, #0x4\n\tbls\t.L10\t@cond_branch\n\tldr\tr0, .L34\n\tldr\tr1, [r0]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x30\n\tldrb\tr0, [r0]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L22\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L22:\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L23\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L23:\n\tmov\tr1, r9\n\tcmp\tr1, #0x4\n\tbne\t.L24\t@cond_branch\n\tcmp\tr3, #0x7f\n\tbeq\t.L24\t@cond_branch\n\tcmp\tr6, #0x23\n\tbeq\t.L29\t@cond_branch\n.L24:\n\tmov\tr0, r9\n\tcmp\tr0, #0x5\n\tbne\t.L25\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x18\n\tble\t.LCB220\n\tb\t.L29\t@long jump\n.LCB220:\n.L25:\n\tmov\tr0, r9\n\tcmp\tr0, #0x6\n\tbne\t.L5\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x32\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tcmp\tr0, #0x25\n\tbne\t.LCB240\n\tb\t.L29\t@long jump\n.LCB240:\n.L5:\n\tmov\tr0, #0x0\n.L27:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgUnk_03004670\n.Lfe1:\n\t.size\t CheckWorldCompletion,.Lfe1-CheckWorldCompletion\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CheckWorldCompletion # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:CopyBGScrollTiles:agbcc","sym":"CopyBGScrollTiles","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","array","loop","branch"],"loc":16,"refSource":"void CopyBGScrollTiles(void) {\n u32 var_r5;\n u32 var_r6;\n\n for (var_r6 = 0; var_r6 < 3; var_r6++) {\n if (var_r6 < gUnk_03005220.hearts) {\n var_r5 = 0;\n } else {\n var_r5 = 2;\n }\n gBgTilemapBufs[0][(var_r6 * 2) + 0x241] = gBgTilemapBufs[0][(var_r6 * 2) + ((var_r5 + 0x14) << 5)];\n gBgTilemapBufs[0][(var_r6 * 2) + 0x242] = gBgTilemapBufs[0][(var_r6 * 2 + 1) + ((var_r5 + 0x14) << 5)];\n gBgTilemapBufs[0][(var_r6 * 2) + 0x261] = gBgTilemapBufs[0][(var_r6 * 2) + ((var_r5 + 0x15) << 5)];\n gBgTilemapBufs[0][(var_r6 * 2) + 0x262] = gBgTilemapBufs[0][(var_r6 * 2 + 1) + ((var_r5 + 0x15) << 5)];\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_1.c#L1165-L1180","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCopyBGScrollTiles\n\t.type\t CopyBGScrollTiles,function\n\t.thumb_func\nCopyBGScrollTiles:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr6, #0x0\n\tldr\tr7, .L10\n\tldr\tr4, .L10+0x4\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x1e\n\tlsr\tr0, r0, #0x1e\n\tmov\tr5, #0x2\n\tcmp\tr6, r0\n\tbcs\t.L7\t@cond_branch\n\tmov\tr5, #0x0\n.L7:\n\tlsl\tr3, r6, #0x1\n\tldr\tr0, .L10+0x8\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r5, #0\n\tadd\tr1, r1, #0x14\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0xc\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r1, #0x1\n\tadd\tr1, r3, r1\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tldrh\tr0, [r1]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0x10\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r5, #0\n\tadd\tr2, r2, #0x15\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r3, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L10+0x14\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r4\n\tldrh\tr0, [r3]\n\tstrh\tr0, [r1]\n\tadd\tr6, r6, #0x1\n\tcmp\tr6, #0x2\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x241\n\t.word\t0x242\n\t.word\t0x261\n\t.word\t0x262\n.Lfe1:\n\t.size\t CopyBGScrollTiles,.Lfe1-CopyBGScrollTiles\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"noncompile","source":"s32 CopyBGScrollTiles(void) {\n s32 v0;\n u32 v1;\n s32 v2;\n v1 = 0;\n do {\n if (v1 >= *(u8 *)&gUnk_03005220 << 30 >> 30) {\n v2 = 2;\n } else {\n v2 = 0;\n }\n gBgTilemapBufs[(v1 << 1) + 577] = gBgTilemapBufs[(v1 << 1) + (v2 + 20 << 5)];\n gBgTilemapBufs[(v1 << 1) + 578] = gBgTilemapBufs[(v1 << 1) + ((v2 + 20 << 5) + 1)];\n gBgTilemapBufs[(v1 << 1) + 609] = gBgTilemapBufs[(v1 << 1) + (v2 + 21 << 5)];\n v0 = gBgTilemapBufs[(v1 << 1) + ((v2 + 21 << 5) + 1)];\n gBgTilemapBufs[(v1 << 1) + 610] = v0;\n v1 = v1 + 1;\n } while (v1 <= 2);\n return v0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":20,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["no scorable candidate for 'CopyBGScrollTiles': agbcc failed: /c.c:1078: invalid operands to binary <<"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void CopyBGScrollTiles(void) {\n s32 temp_r1;\n s32 temp_r2;\n s32 temp_r3;\n s32 var_r5;\n u32 var_r6;\n\n var_r6 = 0;\n do {\n var_r5 = 2;\n if (var_r6 < (u32) ((u32) (gUnk_03005220 << 0x1E) >> 0x1E)) {\n var_r5 = 0;\n }\n temp_r3 = var_r6 * 2;\n temp_r1 = (var_r5 + 0x14) << 5;\n (*gBgTilemapBufs)[temp_r3 + 0x241] = (*gBgTilemapBufs)[temp_r3 + temp_r1];\n (*gBgTilemapBufs)[temp_r3 + 0x242] = (*gBgTilemapBufs)[temp_r3 + (temp_r1 + 1)];\n temp_r2 = (var_r5 + 0x15) << 5;\n (*gBgTilemapBufs)[temp_r3 + 0x261] = (*gBgTilemapBufs)[temp_r3 + temp_r2];\n (*gBgTilemapBufs)[temp_r3 + 0x262] = (*gBgTilemapBufs)[temp_r3 + (temp_r2 + 1)];\n var_r6 += 1;\n } while (var_r6 <= 2U);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":98,"lines":22,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1082: invalid operands to binary <<"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CopyBGScrollTiles` — benchmark function kleod:CopyBGScrollTiles:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCopyBGScrollTiles\n\t.type\t CopyBGScrollTiles,function\n\t.thumb_func\nCopyBGScrollTiles:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr6, #0x0\n\tldr\tr7, .L10\n\tldr\tr4, .L10+0x4\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x1e\n\tlsr\tr0, r0, #0x1e\n\tmov\tr5, #0x2\n\tcmp\tr6, r0\n\tbcs\t.L7\t@cond_branch\n\tmov\tr5, #0x0\n.L7:\n\tlsl\tr3, r6, #0x1\n\tldr\tr0, .L10+0x8\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r5, #0\n\tadd\tr1, r1, #0x14\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0xc\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r1, #0x1\n\tadd\tr1, r3, r1\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tldrh\tr0, [r1]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0x10\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r5, #0\n\tadd\tr2, r2, #0x15\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r3, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L10+0x14\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r4\n\tldrh\tr0, [r3]\n\tstrh\tr0, [r1]\n\tadd\tr6, r6, #0x1\n\tcmp\tr6, #0x2\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x241\n\t.word\t0x242\n\t.word\t0x261\n\t.word\t0x262\n.Lfe1:\n\t.size\t CopyBGScrollTiles,.Lfe1-CopyBGScrollTiles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid CopyBGScrollTiles(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CopyBGScrollTiles # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CopyBGScrollTiles` — benchmark function kleod:CopyBGScrollTiles:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:CopyBGScrollTiles:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCopyBGScrollTiles\n\t.type\t CopyBGScrollTiles,function\n\t.thumb_func\nCopyBGScrollTiles:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr6, #0x0\n\tldr\tr7, .L10\n\tldr\tr4, .L10+0x4\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x1e\n\tlsr\tr0, r0, #0x1e\n\tmov\tr5, #0x2\n\tcmp\tr6, r0\n\tbcs\t.L7\t@cond_branch\n\tmov\tr5, #0x0\n.L7:\n\tlsl\tr3, r6, #0x1\n\tldr\tr0, .L10+0x8\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r5, #0\n\tadd\tr1, r1, #0x14\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0xc\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r1, #0x1\n\tadd\tr1, r3, r1\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tldrh\tr0, [r1]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0x10\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r5, #0\n\tadd\tr2, r2, #0x15\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r3, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L10+0x14\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r4\n\tldrh\tr0, [r3]\n\tstrh\tr0, [r1]\n\tadd\tr6, r6, #0x1\n\tcmp\tr6, #0x2\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x241\n\t.word\t0x242\n\t.word\t0x261\n\t.word\t0x262\n.Lfe1:\n\t.size\t CopyBGScrollTiles,.Lfe1-CopyBGScrollTiles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CopyBGScrollTiles # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:Decompress:agbcc","sym":"Decompress","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["branch","bitwise","cast","call","memory"],"loc":12,"refSource":"void Decompress(void *dest, void *src) {\n void *heapPtr;\n\n if (((u32 *)src)[0] & 0x80000000) {\n heapPtr = thunk_HeapAlloc(((u32 *)src)[1] >> 8, 0);\n HuffUnComp((u8 *)src + 4, heapPtr);\n LZ77UnCompWram(heapPtr, dest);\n thunk_HeapFree(heapPtr);\n } else {\n LZ77UnCompWram((u8 *)src + 4, dest);\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L110-L121","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompress\n\t.type\t Decompress,function\n\t.thumb_func\nDecompress:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tldr\tr0, [r5]\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tldr\tr0, [r5, #0x4]\n\tlsr\tr0, r0, #0x8\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r4, #0\n\tbl\tHuffUnComp\n\tadd\tr0, r4, #0\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n\tadd\tr0, r4, #0\n\tbl\tthunk_HeapFree\n\tb\t.L4\n.L3:\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n.L4:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t Decompress,.Lfe1-Decompress\n\n.text\n\t.align\t2, 0\n","ctx":"void *thunk_HeapAlloc(u32, u32);\nvoid thunk_HeapFree(void *);\nvoid HuffUnComp(void *, void *);\nvoid LZ77UnCompWram(void *, void *);","proto":{"Decompress":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void Decompress(u32 a0, s32 * a1) {\n s32 v0;\n s32 v1;\n if (*a1 >= 0) {\n v1 = LZ77UnCompWram(a1 + 1, a0);\n } else {\n v0 = thunk_HeapAlloc(a1[1] >> 8, 0);\n HuffUnComp(a1 + 1, v0);\n LZ77UnCompWram(v0, a0);\n v1 = thunk_HeapFree(v0, a0);\n }\n return;\n}\n","score":10,"maxScore":30,"compileErrors":null,"breakdown":{"insert":4,"delete":3,"replace":1,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Decompress(void *arg0, void *arg1) {\n void *temp_r0;\n\n if ((s32) arg1->unk0 < 0) {\n temp_r0 = thunk_HeapAlloc((u32) arg1->unk4 >> 8, 0U);\n HuffUnComp(arg1 + 4, temp_r0);\n LZ77UnCompWram(temp_r0, arg0);\n thunk_HeapFree(temp_r0);\n return;\n }\n LZ77UnCompWram(arg1 + 4, arg0);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":11,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1075: warning: dereferencing `void *' pointer","/c.c:1075: request for member `unk0' in something not a structure or union","/c.c:1076: warning: implicit declaration of function `thunk_HeapAlloc'","/c.c:1076: warning: dereferencing `void *' pointer","/c.c:1076: request for member `unk4' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":10,"maxScore":30,"ratio":0.3333333333333333,"kinds":{"insert":4,"delete":3,"replace":1,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Decompress` — benchmark function kleod:Decompress:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompress\n\t.type\t Decompress,function\n\t.thumb_func\nDecompress:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tldr\tr0, [r5]\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tldr\tr0, [r5, #0x4]\n\tlsr\tr0, r0, #0x8\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r4, #0\n\tbl\tHuffUnComp\n\tadd\tr0, r4, #0\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n\tadd\tr0, r4, #0\n\tbl\tthunk_HeapFree\n\tb\t.L4\n.L3:\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n.L4:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t Decompress,.Lfe1-Decompress\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid *thunk_HeapAlloc(u32, u32);\nvoid thunk_HeapFree(void *);\nvoid HuffUnComp(void *, void *);\nvoid LZ77UnCompWram(void *, void *);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Decompress # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Decompress` — benchmark function kleod:Decompress:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:Decompress:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompress\n\t.type\t Decompress,function\n\t.thumb_func\nDecompress:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tldr\tr0, [r5]\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tldr\tr0, [r5, #0x4]\n\tlsr\tr0, r0, #0x8\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r4, #0\n\tbl\tHuffUnComp\n\tadd\tr0, r4, #0\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n\tadd\tr0, r4, #0\n\tbl\tthunk_HeapFree\n\tb\t.L4\n.L3:\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n.L4:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t Decompress,.Lfe1-Decompress\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"Decompress\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Decompress # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:DecompressAlloc:agbcc","sym":"DecompressAlloc","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["call","cast","bitwise","memory","pointer"],"loc":7,"refSource":"void *DecompressAlloc(void *src) {\n void *heapPtr;\n\n heapPtr = thunk_HeapAlloc(((u32 *)src)[0] & 0x7FFFFFFF, 0);\n Decompress(heapPtr, src);\n return heapPtr;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L142-L148","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressAlloc\n\t.type\t DecompressAlloc,function\n\t.thumb_func\nDecompressAlloc:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tldr\tr0, [r5]\n\tldr\tr1, .L3\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x7fffffff\n.Lfe1:\n\t.size\t DecompressAlloc,.Lfe1-DecompressAlloc\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-bbb0f9d88b2b.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 DecompressAlloc(s32 * a0) {\n s32 v0;\n v0 = thunk_HeapAlloc(*a0 & 2147483647, 0);\n Decompress(v0, a0);\n return v0;\n}\n","score":0,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *DecompressAlloc(void *src) {\n void *temp_r0;\n\n temp_r0 = thunk_HeapAlloc(*src & 0x7FFFFFFF, 0U);\n Decompress(temp_r0, src);\n return temp_r0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1077: warning: dereferencing `void *' pointer","/c.c:1077: void value not ignored as it ought to be"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `DecompressAlloc` — benchmark function kleod:DecompressAlloc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressAlloc\n\t.type\t DecompressAlloc,function\n\t.thumb_func\nDecompressAlloc:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tldr\tr0, [r5]\n\tldr\tr1, .L3\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x7fffffff\n.Lfe1:\n\t.size\t DecompressAlloc,.Lfe1-DecompressAlloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-bbb0f9d88b2b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *DecompressAlloc(void *src);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DecompressAlloc # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `DecompressAlloc` — benchmark function kleod:DecompressAlloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DecompressAlloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressAlloc\n\t.type\t DecompressAlloc,function\n\t.thumb_func\nDecompressAlloc:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tldr\tr0, [r5]\n\tldr\tr1, .L3\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x7fffffff\n.Lfe1:\n\t.size\t DecompressAlloc,.Lfe1-DecompressAlloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DecompressAlloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:DecompressDma:agbcc","sym":"DecompressDma","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["call","bitwise","cast","memory","dma"],"loc":8,"refSource":"void DecompressDma(void *src, void *dest, u16 size) {\n void *heapPtr;\n\n heapPtr = thunk_HeapAlloc(((u32 *)src)[0] & 0x7FFFFFFF, 0);\n Decompress(heapPtr, src);\n DmaCopy16Wait(3, (u8 *)heapPtr + 4, dest, size);\n thunk_HeapFree(heapPtr);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L129-L136","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressDma\n\t.type\t DecompressDma,function\n\t.thumb_func\nDecompressDma:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr5, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr4, r2, #0x10\n\tldr\tr0, [r5]\n\tldr\tr1, .L7\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr7, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tldr\tr1, .L7+0x4\n\tadd\tr0, r7, #0x4\n\tstr\tr0, [r1]\n\tstr\tr6, [r1, #0x4]\n\tlsr\tr4, r4, #0x11\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\torr\tr4, r4, r2\n\tstr\tr4, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n.L3:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r7, #0\n\tbl\tthunk_HeapFree\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x7fffffff\n\t.word\t0x40000d4\n.Lfe1:\n\t.size\t DecompressDma,.Lfe1-DecompressDma\n\n.text\n\t.align\t2, 0\n","ctx":"void *thunk_HeapAlloc(u32, u32);\nvoid thunk_HeapFree(void *);\nvoid Decompress(void *, void *);","proto":{"DecompressDma":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void DecompressDma(s32 * a0, u32 a1, u32 a2) {\n s32 v0;\n v0 = thunk_HeapAlloc(*a0 & 2147483647, 0, a2);\n Decompress(v0, a0);\n *(s32 *)67109076 = v0 + 4;\n ((s32 *)67109076)[1] = a1;\n ((s32 *)67109076)[2] = a2 << 16 >> 17 | 128 << 24;\n do {\n } while ((((s32 *)67109076)[2] & 128 << 24) != 0);\n thunk_HeapFree(v0, 67109076, 128 << 24);\n return;\n}\n","score":19,"maxScore":40,"compileErrors":null,"breakdown":{"insert":7,"delete":2,"replace":1,"opMismatch":0,"argMismatch":9},"quality":{"score":96,"lines":12,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void DecompressDma(s32 *arg0, s32 arg1, s32 arg2) {\n void *temp_r0;\n\n temp_r0 = thunk_HeapAlloc(*arg0 & 0x7FFFFFFF, 0U);\n Decompress(temp_r0, arg0);\n (void *)0x040000D4->unk0 = (void *) (temp_r0 + 4);\n (void *)0x040000D4->unk4 = arg1;\n (void *)0x040000D4->unk8 = (s32) (((u32) (arg2 << 0x10) >> 0x11) | 0x80000000);\n do {\n\n } while ((void *)0x040000D4->unk8 & 0x80000000);\n thunk_HeapFree(temp_r0);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":90,"lines":11,"gotos":0,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1075: warning: implicit declaration of function `thunk_HeapAlloc'","/c.c:1075: warning: assignment makes pointer from integer without a cast","/c.c:1076: warning: implicit declaration of function `Decompress'","/c.c:1077: invalid type argument of `->'","/c.c:1078: invalid type argument of `->'"]},"gapSize":{"decompiler":"asmlift","score":19,"maxScore":40,"ratio":0.475,"kinds":{"insert":7,"delete":2,"replace":1,"opMismatch":0,"argMismatch":9}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `DecompressDma` — benchmark function kleod:DecompressDma:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressDma\n\t.type\t DecompressDma,function\n\t.thumb_func\nDecompressDma:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr5, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr4, r2, #0x10\n\tldr\tr0, [r5]\n\tldr\tr1, .L7\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr7, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tldr\tr1, .L7+0x4\n\tadd\tr0, r7, #0x4\n\tstr\tr0, [r1]\n\tstr\tr6, [r1, #0x4]\n\tlsr\tr4, r4, #0x11\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\torr\tr4, r4, r2\n\tstr\tr4, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n.L3:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r7, #0\n\tbl\tthunk_HeapFree\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x7fffffff\n\t.word\t0x40000d4\n.Lfe1:\n\t.size\t DecompressDma,.Lfe1-DecompressDma\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid *thunk_HeapAlloc(u32, u32);\nvoid thunk_HeapFree(void *);\nvoid Decompress(void *, void *);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DecompressDma # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `DecompressDma` — benchmark function kleod:DecompressDma:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DecompressDma:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressDma\n\t.type\t DecompressDma,function\n\t.thumb_func\nDecompressDma:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr5, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr4, r2, #0x10\n\tldr\tr0, [r5]\n\tldr\tr1, .L7\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr7, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tldr\tr1, .L7+0x4\n\tadd\tr0, r7, #0x4\n\tstr\tr0, [r1]\n\tstr\tr6, [r1, #0x4]\n\tlsr\tr4, r4, #0x11\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\torr\tr4, r4, r2\n\tstr\tr4, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n.L3:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r7, #0\n\tbl\tthunk_HeapFree\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x7fffffff\n\t.word\t0x40000d4\n.Lfe1:\n\t.size\t DecompressDma,.Lfe1-DecompressDma\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"DecompressDma\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DecompressDma # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:DivideQ4:agbcc","sym":"DivideQ4","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div","shift"],"loc":3,"refSource":"s16 DivideQ4(s16 num1, s16 num2) {\n return ((num1 << 4) / num2);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L42-L44","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ4\n\t.type\t DivideQ4,function\n\t.thumb_func\nDivideQ4:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0xc\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ4,.Lfe1-DivideQ4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 DivideQ4(s32 a0, s32 a1) {\n return (s16)((a0 << 16 >> 12) / (s16)a1);\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s16 DivideQ4(s32 arg0, s16 arg1) {\n return (s16) ((s32) ((s32) (arg0 << 0x10) >> 0xC) / arg1);\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":98,"lines":3,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `DivideQ4` — benchmark function kleod:DivideQ4:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ4\n\t.type\t DivideQ4,function\n\t.thumb_func\nDivideQ4:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0xc\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ4,.Lfe1-DivideQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DivideQ4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `DivideQ4` — benchmark function kleod:DivideQ4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DivideQ4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ4\n\t.type\t DivideQ4,function\n\t.thumb_func\nDivideQ4:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0xc\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ4,.Lfe1-DivideQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DivideQ4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:DivideQ8:agbcc","sym":"DivideQ8","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div","shift"],"loc":3,"refSource":"s16 DivideQ8(s16 num1, s16 num2) {\n return (num1 << 8) / num2;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L11-L13","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ8\n\t.type\t DivideQ8,function\n\t.thumb_func\nDivideQ8:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ8,.Lfe1-DivideQ8\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 DivideQ8(s32 a0, s32 a1) {\n return (s16)((a0 << 16 >> 8) / (s16)a1);\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s16 DivideQ8(s32 arg0, s16 arg1) {\n return (s16) ((s32) ((s32) (arg0 << 0x10) >> 8) / arg1);\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":98,"lines":3,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `DivideQ8` — benchmark function kleod:DivideQ8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ8\n\t.type\t DivideQ8,function\n\t.thumb_func\nDivideQ8:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ8,.Lfe1-DivideQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DivideQ8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `DivideQ8` — benchmark function kleod:DivideQ8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DivideQ8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ8\n\t.type\t DivideQ8,function\n\t.thumb_func\nDivideQ8:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ8,.Lfe1-DivideQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DivideQ8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:DmaSpriteToObjVram:agbcc","sym":"DmaSpriteToObjVram","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["pointer","mmio","dma","cast","memory"],"loc":12,"refSource":"void DmaSpriteToObjVram(u32 entryIdx, u32 frameIdx) {\n vu32 *dma3 = ®_DMA3SAD;\n u32 base = *(vu32 *)&gGfxStreamBuffer;\n u8 *entry = (u8 *)(entryIdx * 8 + base);\n u16 tileCount = *(u16 *)(entry + 6);\n dma3[0] = *(u32 *)entry + tileCount * (frameIdx << 5);\n\n dma3[1] = (u32) * (u16 *)(entry + 4) * 32 + OBJ_VRAM;\n\n dma3[2] = (*(u16 *)(entry + 6) << 4) | (0x80 << 24);\n dma3[2];\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L349-L360","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDmaSpriteToObjVram\n\t.type\t DmaSpriteToObjVram,function\n\t.thumb_func\nDmaSpriteToObjVram:\n\tldr\tr3, .L3\n\tldr\tr2, .L3+0x4\n\tldr\tr2, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r2\n\tldrh\tr2, [r0, #0x6]\n\tlsl\tr1, r1, #0x5\n\tmul\tr2, r2, r1\n\tldr\tr1, [r0]\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3]\n\tldrh\tr1, [r0, #0x4]\n\tlsl\tr1, r1, #0x5\n\tldr\tr2, .L3+0x8\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3, #0x4]\n\tldrh\tr0, [r0, #0x6]\n\tlsl\tr0, r0, #0x4\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r3, #0x8]\n\tldr\tr0, [r3, #0x8]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x40000d4\n\t.word\t0x30007c8\n\t.word\t0x6010000\n.Lfe1:\n\t.size\t DmaSpriteToObjVram,.Lfe1-DmaSpriteToObjVram\n\n.text\n\t.align\t2, 0\n","proto":{"DmaSpriteToObjVram":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gGfxStreamBuffer","shape":"scalar u32"}],"outcome":"nonmatch","source":"struct Elem0 { s32 field_0; u16 field_4; u16 field_6; };\nvoid DmaSpriteToObjVram(u32 a0, u32 a1) {\n struct Elem0 * v0;\n s32 * p0;\n p0 = (s32 *)67109076;\n v0 = gGfxStreamBuffer;\n *p0 = v0[a0].field_0 + v0[a0].field_6 * (a1 << 5);\n p0[1] = (v0[a0].field_4 << 5) + 100728832;\n p0[2] = v0[a0].field_6 << 4 | 128 << 24;\n return;\n}\n","score":5,"maxScore":28,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":11,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 DmaSpriteToObjVram(s32 arg0, s32 arg1) {\n void *temp_r0;\n\n temp_r0 = (arg0 * 8) + *(s32 *)0x030007C8;\n (void *)0x040000D4->unk0 = (s32) (temp_r0->unk0 + (temp_r0->unk6 * (arg1 << 5)));\n (void *)0x040000D4->unk4 = (s32) ((temp_r0->unk4 << 5) + 0x06010000);\n (void *)0x040000D4->unk8 = (s32) ((temp_r0->unk6 * 0x10) | 0x80000000);\n return (void *)0x040000D4->unk8;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":8,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":1},"errorMarkers":["agbcc failed: /c.c:1075: warning: assignment makes pointer from integer without a cast","/c.c:1076: invalid type argument of `->'","/c.c:1076: warning: dereferencing `void *' pointer","/c.c:1076: request for member `unk0' in something not a structure or union","/c.c:1076: request for member `unk6' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":28,"ratio":0.17857142857142858,"kinds":{"insert":1,"delete":1,"replace":0,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `DmaSpriteToObjVram` — benchmark function kleod:DmaSpriteToObjVram:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDmaSpriteToObjVram\n\t.type\t DmaSpriteToObjVram,function\n\t.thumb_func\nDmaSpriteToObjVram:\n\tldr\tr3, .L3\n\tldr\tr2, .L3+0x4\n\tldr\tr2, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r2\n\tldrh\tr2, [r0, #0x6]\n\tlsl\tr1, r1, #0x5\n\tmul\tr2, r2, r1\n\tldr\tr1, [r0]\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3]\n\tldrh\tr1, [r0, #0x4]\n\tlsl\tr1, r1, #0x5\n\tldr\tr2, .L3+0x8\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3, #0x4]\n\tldrh\tr0, [r0, #0x6]\n\tlsl\tr0, r0, #0x4\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r3, #0x8]\n\tldr\tr0, [r3, #0x8]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x40000d4\n\t.word\t0x30007c8\n\t.word\t0x6010000\n.Lfe1:\n\t.size\t DmaSpriteToObjVram,.Lfe1-DmaSpriteToObjVram\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DmaSpriteToObjVram # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `DmaSpriteToObjVram` — benchmark function kleod:DmaSpriteToObjVram:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DmaSpriteToObjVram:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDmaSpriteToObjVram\n\t.type\t DmaSpriteToObjVram,function\n\t.thumb_func\nDmaSpriteToObjVram:\n\tldr\tr3, .L3\n\tldr\tr2, .L3+0x4\n\tldr\tr2, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r2\n\tldrh\tr2, [r0, #0x6]\n\tlsl\tr1, r1, #0x5\n\tmul\tr2, r2, r1\n\tldr\tr1, [r0]\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3]\n\tldrh\tr1, [r0, #0x4]\n\tlsl\tr1, r1, #0x5\n\tldr\tr2, .L3+0x8\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3, #0x4]\n\tldrh\tr0, [r0, #0x6]\n\tlsl\tr0, r0, #0x4\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r3, #0x8]\n\tldr\tr0, [r3, #0x8]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x40000d4\n\t.word\t0x30007c8\n\t.word\t0x6010000\n.Lfe1:\n\t.size\t DmaSpriteToObjVram,.Lfe1-DmaSpriteToObjVram\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"DmaSpriteToObjVram\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DmaSpriteToObjVram # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:FreeAllDecompBuffers:agbcc","sym":"FreeAllDecompBuffers","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","call","pointer","branch"],"loc":20,"refSource":"void FreeAllDecompBuffers(void) {\n u32 *decompBuffers = (u32 *)gDecompBufferCtrl;\n\n thunk_HeapFree(decompBuffers[1] - 4);\n thunk_HeapFree(decompBuffers[0] - 4);\n thunk_HeapFree(decompBuffers[3] - 4);\n thunk_HeapFree(decompBuffers[2] - 4);\n thunk_HeapFree(decompBuffers[5] - 4);\n thunk_HeapFree(decompBuffers[4] - 4);\n\n if (gCollisionMapPtr != 0) {\n thunk_HeapFree(gCollisionMapPtr - 4);\n gCollisionMapPtr = 0;\n }\n\n m4aSongNumStart(0x8D);\n m4aSongNumStart(0x8E);\n m4aSongNumStart(0x8F);\n m4aSongNumStart(0x90);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L91-L110","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tFreeAllDecompBuffers\n\t.type\t FreeAllDecompBuffers,function\n\t.thumb_func\nFreeAllDecompBuffers:\n\tpush\t{r4, lr}\n\tldr\tr4, .L4\n\tldr\tr0, [r4, #0x4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x8]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x14]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x10]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr4, .L4+0x4\n\tldr\tr0, [r4]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tmov\tr0, #0x0\n\tstr\tr0, [r4]\n.L3:\n\tmov\tr0, #0x8d\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8e\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8f\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x90\n\tbl\tm4aSongNumStart\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x3004790\n\t.word\t0x3005290\n.Lfe1:\n\t.size\t FreeAllDecompBuffers,.Lfe1-FreeAllDecompBuffers\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-f808d4b2fde6.i.gz","proto":{"FreeAllDecompBuffers":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","droppedCandidates":[{"label":"unsigned","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-qbbic1/c.c:1076: `gBgDataPtrs' undeclared (first use in this function)"}],"symbolsUsed":[],"outcome":"match","source":"void FreeAllDecompBuffers(void) {\n s32 * v0;\n s32 * v1;\n v0 = (s32 *)50349968;\n thunk_HeapFree(v0[1] - 4);\n thunk_HeapFree(*v0 - 4);\n thunk_HeapFree(v0[3] - 4);\n thunk_HeapFree(v0[2] - 4);\n thunk_HeapFree(v0[5] - 4);\n thunk_HeapFree(v0[4] - 4);\n v1 = (s32 *)50352784;\n if (*v1 != 0) {\n thunk_HeapFree(*v1 - 4);\n *v1 = 0;\n }\n m4aSongNumStart(141);\n m4aSongNumStart(142);\n m4aSongNumStart(143);\n m4aSongNumStart(144);\n return;\n}\n","score":0,"maxScore":41,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":98,"lines":21,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void FreeAllDecompBuffers(void) {\n s32 temp_r0;\n\n thunk_HeapFree((void *)0x03004790->unk4 - 4);\n thunk_HeapFree((void *)0x03004790->unk0 - 4);\n thunk_HeapFree((void *)0x03004790->unkC - 4);\n thunk_HeapFree((void *)0x03004790->unk8 - 4);\n thunk_HeapFree((void *)0x03004790->unk14 - 4);\n thunk_HeapFree((void *)0x03004790->unk10 - 4);\n temp_r0 = *(s32 *)0x03005290;\n if (temp_r0 != 0) {\n thunk_HeapFree(temp_r0 - 4);\n *(s32 *)0x03005290 = 0;\n }\n m4aSongNumStart(0x8DU);\n m4aSongNumStart(0x8EU);\n m4aSongNumStart(0x8FU);\n m4aSongNumStart(0x90U);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":18,"gotos":0,"casts":9,"unkGlue":0,"rawMem":0,"addrDeref":2},"errorMarkers":["agbcc failed: /c.c:1077: invalid type argument of `->'","/c.c:1078: invalid type argument of `->'","/c.c:1079: invalid type argument of `->'","/c.c:1080: invalid type argument of `->'","/c.c:1081: invalid type argument of `->'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `FreeAllDecompBuffers` — benchmark function kleod:FreeAllDecompBuffers:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tFreeAllDecompBuffers\n\t.type\t FreeAllDecompBuffers,function\n\t.thumb_func\nFreeAllDecompBuffers:\n\tpush\t{r4, lr}\n\tldr\tr4, .L4\n\tldr\tr0, [r4, #0x4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x8]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x14]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x10]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr4, .L4+0x4\n\tldr\tr0, [r4]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tmov\tr0, #0x0\n\tstr\tr0, [r4]\n.L3:\n\tmov\tr0, #0x8d\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8e\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8f\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x90\n\tbl\tm4aSongNumStart\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x3004790\n\t.word\t0x3005290\n.Lfe1:\n\t.size\t FreeAllDecompBuffers,.Lfe1-FreeAllDecompBuffers\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-f808d4b2fde6.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid FreeAllDecompBuffers(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function FreeAllDecompBuffers # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `FreeAllDecompBuffers` — benchmark function kleod:FreeAllDecompBuffers:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:FreeAllDecompBuffers:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tFreeAllDecompBuffers\n\t.type\t FreeAllDecompBuffers,function\n\t.thumb_func\nFreeAllDecompBuffers:\n\tpush\t{r4, lr}\n\tldr\tr4, .L4\n\tldr\tr0, [r4, #0x4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x8]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x14]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x10]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr4, .L4+0x4\n\tldr\tr0, [r4]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tmov\tr0, #0x0\n\tstr\tr0, [r4]\n.L3:\n\tmov\tr0, #0x8d\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8e\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8f\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x90\n\tbl\tm4aSongNumStart\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x3004790\n\t.word\t0x3005290\n.Lfe1:\n\t.size\t FreeAllDecompBuffers,.Lfe1-FreeAllDecompBuffers\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"FreeAllDecompBuffers\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name FreeAllDecompBuffers # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:GameUpdate:agbcc","sym":"GameUpdate","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["branch","global","call"],"loc":9,"refSource":"void GameUpdate(void) {\n if (gPauseFlag == 0) {\n UpdateWorldMapNodeState();\n UpdatePlayerInput();\n InitPlayerCollision();\n UpdateWorldMapCursor();\n }\n UpdatePaletteAnimations();\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L165-L173","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGameUpdate\n\t.type\t GameUpdate,function\n\t.thumb_func\nGameUpdate:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tbl\tUpdateWorldMapNodeState\n\tbl\tUpdatePlayerInput\n\tbl\tInitPlayerCollision\n\tbl\tUpdateWorldMapCursor\n.L3:\n\tbl\tUpdatePaletteAnimations\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x30034e4\n.Lfe1:\n\t.size\t GameUpdate,.Lfe1-GameUpdate\n\n.text\n\t.align\t2, 0\n","ctx":"void UpdateWorldMapNodeState(void);\nvoid UpdatePlayerInput(void);\nvoid InitPlayerCollision(void);\nvoid UpdateWorldMapCursor(void);\nvoid UpdatePaletteAnimations(void);","proto":{"GameUpdate":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gUnk_030034E4","shape":"scalar u8"}],"outcome":"nonmatch","source":"void GameUpdate(void) {\n s32 v0;\n v0 = gUnk_030034E4;\n if (v0 == 0) UpdateWorldMapCursor(InitPlayerCollision(UpdatePlayerInput(UpdateWorldMapNodeState(v0))));\n UpdatePaletteAnimations();\n return;\n}\n","score":3,"maxScore":15,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void GameUpdate(void) {\n if (*(u8 *)0x030034E4 == 0) {\n UpdateWorldMapNodeState();\n UpdatePlayerInput();\n InitPlayerCollision();\n UpdateWorldMapCursor();\n }\n UpdatePaletteAnimations();\n}\n","score":0,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":1}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GameUpdate` — benchmark function kleod:GameUpdate:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGameUpdate\n\t.type\t GameUpdate,function\n\t.thumb_func\nGameUpdate:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tbl\tUpdateWorldMapNodeState\n\tbl\tUpdatePlayerInput\n\tbl\tInitPlayerCollision\n\tbl\tUpdateWorldMapCursor\n.L3:\n\tbl\tUpdatePaletteAnimations\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x30034e4\n.Lfe1:\n\t.size\t GameUpdate,.Lfe1-GameUpdate\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid UpdateWorldMapNodeState(void);\nvoid UpdatePlayerInput(void);\nvoid InitPlayerCollision(void);\nvoid UpdateWorldMapCursor(void);\nvoid UpdatePaletteAnimations(void);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GameUpdate # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GameUpdate` — benchmark function kleod:GameUpdate:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:GameUpdate:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGameUpdate\n\t.type\t GameUpdate,function\n\t.thumb_func\nGameUpdate:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tbl\tUpdateWorldMapNodeState\n\tbl\tUpdatePlayerInput\n\tbl\tInitPlayerCollision\n\tbl\tUpdateWorldMapCursor\n.L3:\n\tbl\tUpdatePaletteAnimations\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x30034e4\n.Lfe1:\n\t.size\t GameUpdate,.Lfe1-GameUpdate\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GameUpdate\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GameUpdate # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:GetEntityLookupData:agbcc","sym":"GetEntityLookupData","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","pointer","cast","global","memory"],"loc":7,"refSource":"void GetEntityLookupData(u8 idx) {\n u8 *flags = gGameFlagsPtr;\n const u8 *table = gEntityDataTable;\n const u8 *entry = &table[(u32)idx * 8];\n flags[0x11] = entry[5];\n flags[0x12] = entry[6];\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L63-L69","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetEntityLookupData\n\t.type\t GetEntityLookupData,function\n\t.thumb_func\nGetEntityLookupData:\n\tlsl\tr0, r0, #0x18\n\tldr\tr2, .L3\n\tldr\tr1, .L3+0x4\n\tlsr\tr0, r0, #0x15\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x5]\n\tstrb\tr1, [r2, #0x11]\n\tldrb\tr0, [r0, #0x6]\n\tstrb\tr0, [r2, #0x12]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntityDataTable\n.Lfe1:\n\t.size\t GetEntityLookupData,.Lfe1-GetEntityLookupData\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz","proto":{"GetEntityLookupData":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","symbolsUsed":[{"name":"gEntityDataTable","shape":"u8[]"},{"name":"gGameFlagsPtr","shape":"u8[]"}],"outcome":"nonmatch","source":"void GetEntityLookupData(u32 a0) {\n u8 * p0;\n u8 * p1;\n p0 = (u8 *)&gGameFlagsPtr;\n p1 = (u8 *)&gEntityDataTable;\n p0[17] = p1[(a0 << 24 >> 21) + 5];\n p0[18] = p1[(a0 << 24 >> 21) + 6];\n return;\n}\n","score":4,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void GetEntityLookupData(u8 idx) {\n u8 *temp_r0;\n\n temp_r0 = &gEntityDataTable[(u32) (idx << 0x18) >> 0x15];\n gGameFlagsPtr->unk11 = (u8) temp_r0->unk5;\n gGameFlagsPtr->unk12 = (u8) temp_r0->unk6;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":98,"lines":6,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1075: warning: assignment discards qualifiers from pointer target type","/c.c:1076: request for member `unk11' in something not a structure or union","/c.c:1076: request for member `unk5' in something not a structure or union","/c.c:1077: request for member `unk12' in something not a structure or union","/c.c:1077: request for member `unk6' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":4,"maxScore":14,"ratio":0.2857142857142857,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GetEntityLookupData` — benchmark function kleod:GetEntityLookupData:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetEntityLookupData\n\t.type\t GetEntityLookupData,function\n\t.thumb_func\nGetEntityLookupData:\n\tlsl\tr0, r0, #0x18\n\tldr\tr2, .L3\n\tldr\tr1, .L3+0x4\n\tlsr\tr0, r0, #0x15\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x5]\n\tstrb\tr1, [r2, #0x11]\n\tldrb\tr0, [r0, #0x6]\n\tstrb\tr0, [r2, #0x12]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntityDataTable\n.Lfe1:\n\t.size\t GetEntityLookupData,.Lfe1-GetEntityLookupData\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid GetEntityLookupData(u8 idx);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GetEntityLookupData # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GetEntityLookupData` — benchmark function kleod:GetEntityLookupData:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:GetEntityLookupData:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetEntityLookupData\n\t.type\t GetEntityLookupData,function\n\t.thumb_func\nGetEntityLookupData:\n\tlsl\tr0, r0, #0x18\n\tldr\tr2, .L3\n\tldr\tr1, .L3+0x4\n\tlsr\tr0, r0, #0x15\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x5]\n\tstrb\tr1, [r2, #0x11]\n\tldrb\tr0, [r0, #0x6]\n\tstrb\tr0, [r2, #0x12]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntityDataTable\n.Lfe1:\n\t.size\t GetEntityLookupData,.Lfe1-GetEntityLookupData\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GetEntityLookupData\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetEntityLookupData # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:MultiplyQ4:agbcc","sym":"MultiplyQ4","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","fixed-point","branch"],"loc":12,"refSource":"s16 MultiplyQ4(s16 num1, s16 num2) {\n s32 product;\n s32 rounded;\n\n product = num1 * num2;\n rounded = product;\n if (rounded < 0) {\n rounded += 0xF;\n }\n product = rounded >> 4;\n return product;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L25-L36","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ4\n\t.type\t MultiplyQ4,function\n\t.thumb_func\nMultiplyQ4:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xf\n.L3:\n\tlsl\tr0, r1, #0xc\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ4,.Lfe1-MultiplyQ4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/regcopy-ret","symbolsUsed":[],"outcome":"match","source":"s32 MultiplyQ4(u32 a0, u32 a1) {\n s32 v0;\n s32 w0;\n v0 = (s16)a0 * (s16)a1;\n w0 = v0;\n if (w0 < 0) w0 = w0 + 15;\n v0 = w0 << 12 >> 16;\n return v0;\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 MultiplyQ4(s16 arg0, s16 arg1) {\n s32 temp_r0;\n s32 var_r1;\n\n temp_r0 = arg0 * arg1;\n var_r1 = temp_r0;\n if (temp_r0 < 0) {\n var_r1 += 0xF;\n }\n return (s32) (var_r1 << 0xC) >> 0x10;\n}\n","score":3,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":10,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MultiplyQ4` — benchmark function kleod:MultiplyQ4:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ4\n\t.type\t MultiplyQ4,function\n\t.thumb_func\nMultiplyQ4:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xf\n.L3:\n\tlsl\tr0, r1, #0xc\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ4,.Lfe1-MultiplyQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MultiplyQ4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MultiplyQ4` — benchmark function kleod:MultiplyQ4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:MultiplyQ4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ4\n\t.type\t MultiplyQ4,function\n\t.thumb_func\nMultiplyQ4:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xf\n.L3:\n\tlsl\tr0, r1, #0xc\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ4,.Lfe1-MultiplyQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MultiplyQ4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:MultiplyQ8:agbcc","sym":"MultiplyQ8","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","fixed-point","branch"],"loc":12,"refSource":"s16 MultiplyQ8(s16 num1, s16 num2) {\n s32 product;\n s32 rounded;\n\n product = num1 * num2;\n rounded = product;\n if (rounded < 0) {\n rounded += 0xFF;\n }\n product = rounded >> 8;\n return product;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L116-L127","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ8\n\t.type\t MultiplyQ8,function\n\t.thumb_func\nMultiplyQ8:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ8,.Lfe1-MultiplyQ8\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/regcopy-ret","symbolsUsed":[],"outcome":"match","source":"s32 MultiplyQ8(u32 a0, u32 a1) {\n s32 v0;\n s32 w0;\n v0 = (s16)a0 * (s16)a1;\n w0 = v0;\n if (w0 < 0) w0 = w0 + 255;\n v0 = w0 << 8 >> 16;\n return v0;\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 MultiplyQ8(s16 arg0, s16 arg1) {\n s32 temp_r0;\n s32 var_r1;\n\n temp_r0 = arg0 * arg1;\n var_r1 = temp_r0;\n if (temp_r0 < 0) {\n var_r1 += 0xFF;\n }\n return (s32) (var_r1 << 8) >> 0x10;\n}\n","score":3,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":10,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MultiplyQ8` — benchmark function kleod:MultiplyQ8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ8\n\t.type\t MultiplyQ8,function\n\t.thumb_func\nMultiplyQ8:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ8,.Lfe1-MultiplyQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MultiplyQ8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MultiplyQ8` — benchmark function kleod:MultiplyQ8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:MultiplyQ8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ8\n\t.type\t MultiplyQ8,function\n\t.thumb_func\nMultiplyQ8:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ8,.Lfe1-MultiplyQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MultiplyQ8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:ProcessHBlankWait:agbcc","sym":"ProcessHBlankWait","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["mmio","branch","memory","pointer","shift"],"loc":31,"refSource":"u32 ProcessHBlankWait(u32 idx) {\n volatile u16 *ie;\n volatile u16 *dispstat;\n u8 *buf;\n u32 off;\n u8 *entry;\n u32 timer;\n\n ie = ®_IE;\n *ie |= 2;\n dispstat = ®_DISPSTAT;\n *dispstat |= 0x10;\n\n buf = gBuffer_52A4;\n off = idx * 9;\n off <<= 2;\n off += (u32)buf;\n entry = (u8 *)off;\n\n if (entry[3] >> 7) {\n return 1;\n }\n timer = *(u16 *)(entry + 0x14) - 1;\n *(u16 *)(entry + 0x14) = timer;\n if ((s32)(timer << 16) < 0) {\n *ie &= 0xFFFD;\n *dispstat &= 0xFFEF;\n return 0;\n }\n return 1;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L536-L566","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessHBlankWait\n\t.type\t ProcessHBlankWait,function\n\t.thumb_func\nProcessHBlankWait:\n\tpush\t{r4, lr}\n\tldr\tr3, .L7\n\tldrh\tr1, [r3]\n\tmov\tr2, #0x2\n\torr\tr1, r1, r2\n\tstrh\tr1, [r3]\n\tldr\tr4, .L7+0x4\n\tldrh\tr1, [r4]\n\tmov\tr2, #0x10\n\torr\tr1, r1, r2\n\tstrh\tr1, [r4]\n\tldr\tr1, .L7+0x8\n\tldr\tr2, [r1]\n\tlsl\tr1, r0, #0x3\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r2\n\tldrb\tr0, [r1, #0x3]\n\tlsr\tr0, r0, #0x7\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldrh\tr0, [r1, #0x14]\n\tsub\tr0, r0, #0x1\n\tstrh\tr0, [r1, #0x14]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n.L6:\n\tmov\tr0, #0x1\n\tb\t.L5\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\t0x30052a4\n.L4:\n\tldrh\tr1, [r3]\n\tldr\tr0, .L9\n\tand\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrh\tr1, [r4]\n\tldr\tr0, .L9+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\t0xfffd\n\t.word\t0xffef\n.Lfe1:\n\t.size\t ProcessHBlankWait,.Lfe1-ProcessHBlankWait\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/flip-branch","symbolsUsed":[{"name":"gBuffer_52A4","shape":"scalar u32"}],"outcome":"match","source":"struct Elem0 { u8 _pad0[3]; u8 field_3; u8 _pad1[16]; u16 field_20; u8 _pad2[14]; };\ns32 ProcessHBlankWait(u32 a0) {\n s32 v0;\n *(u16 *)67109376 = *(u16 *)67109376 | 2;\n *(u16 *)67108868 = *(u16 *)67108868 | 16;\n if (((struct Elem0 *)gBuffer_52A4)[a0].field_3 >> 7 != 0) {\n return 1;\n } else {\n v0 = ((struct Elem0 *)gBuffer_52A4)[a0].field_20;\n ((struct Elem0 *)gBuffer_52A4)[a0].field_20 = v0 - 1;\n if (v0 - 1 << 16 < 0) {\n *(u16 *)67109376 = 65533 & *(u16 *)67109376;\n *(u16 *)67108868 = 65519 & *(u16 *)67108868;\n return 0;\n } else {\n return 1;\n }\n }\n}\n","score":0,"maxScore":47,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":88,"lines":19,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 ProcessHBlankWait(s32 arg0) {\n u16 temp_r0;\n void *temp_r1;\n\n *(u16 *)0x04000200 |= 2;\n *(u16 *)0x04000004 |= 0x10;\n temp_r1 = (arg0 * 0x24) + *(s32 *)0x030052A4;\n if ((((u8) temp_r1->unk3 >> 7) != 0) || (temp_r0 = temp_r1->unk14 - 1, temp_r1->unk14 = temp_r0, ((s32) (temp_r0 << 0x10) >= 0))) {\n return 1;\n }\n *(u16 *)0x04000200 &= 0xFFFD;\n *(u16 *)0x04000004 &= 0xFFEF;\n return 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":90,"lines":13,"gotos":0,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":5},"errorMarkers":["agbcc failed: /c.c:1078: warning: assignment makes pointer from integer without a cast","/c.c:1079: warning: dereferencing `void *' pointer","/c.c:1079: request for member `unk3' in something not a structure or union","/c.c:1079: request for member `unk14' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ProcessHBlankWait` — benchmark function kleod:ProcessHBlankWait:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessHBlankWait\n\t.type\t ProcessHBlankWait,function\n\t.thumb_func\nProcessHBlankWait:\n\tpush\t{r4, lr}\n\tldr\tr3, .L7\n\tldrh\tr1, [r3]\n\tmov\tr2, #0x2\n\torr\tr1, r1, r2\n\tstrh\tr1, [r3]\n\tldr\tr4, .L7+0x4\n\tldrh\tr1, [r4]\n\tmov\tr2, #0x10\n\torr\tr1, r1, r2\n\tstrh\tr1, [r4]\n\tldr\tr1, .L7+0x8\n\tldr\tr2, [r1]\n\tlsl\tr1, r0, #0x3\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r2\n\tldrb\tr0, [r1, #0x3]\n\tlsr\tr0, r0, #0x7\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldrh\tr0, [r1, #0x14]\n\tsub\tr0, r0, #0x1\n\tstrh\tr0, [r1, #0x14]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n.L6:\n\tmov\tr0, #0x1\n\tb\t.L5\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\t0x30052a4\n.L4:\n\tldrh\tr1, [r3]\n\tldr\tr0, .L9\n\tand\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrh\tr1, [r4]\n\tldr\tr0, .L9+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\t0xfffd\n\t.word\t0xffef\n.Lfe1:\n\t.size\t ProcessHBlankWait,.Lfe1-ProcessHBlankWait\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ProcessHBlankWait # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ProcessHBlankWait` — benchmark function kleod:ProcessHBlankWait:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ProcessHBlankWait:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessHBlankWait\n\t.type\t ProcessHBlankWait,function\n\t.thumb_func\nProcessHBlankWait:\n\tpush\t{r4, lr}\n\tldr\tr3, .L7\n\tldrh\tr1, [r3]\n\tmov\tr2, #0x2\n\torr\tr1, r1, r2\n\tstrh\tr1, [r3]\n\tldr\tr4, .L7+0x4\n\tldrh\tr1, [r4]\n\tmov\tr2, #0x10\n\torr\tr1, r1, r2\n\tstrh\tr1, [r4]\n\tldr\tr1, .L7+0x8\n\tldr\tr2, [r1]\n\tlsl\tr1, r0, #0x3\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r2\n\tldrb\tr0, [r1, #0x3]\n\tlsr\tr0, r0, #0x7\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldrh\tr0, [r1, #0x14]\n\tsub\tr0, r0, #0x1\n\tstrh\tr0, [r1, #0x14]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n.L6:\n\tmov\tr0, #0x1\n\tb\t.L5\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\t0x30052a4\n.L4:\n\tldrh\tr1, [r3]\n\tldr\tr0, .L9\n\tand\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrh\tr1, [r4]\n\tldr\tr0, .L9+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\t0xfffd\n\t.word\t0xffef\n.Lfe1:\n\t.size\t ProcessHBlankWait,.Lfe1-ProcessHBlankWait\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ProcessHBlankWait # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:ReadKeyInput:agbcc","sym":"ReadKeyInput","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["mmio","global","bitwise","branch","call"],"loc":14,"refSource":"void ReadKeyInput(void) {\n u16 pressed = REG_KEYINPUT ^ 0x3FF;\n\n gKeysPressed = pressed & ~gKeysPrevious;\n gKeysPrevious = pressed;\n if ((pressed & 0x0F) == 0x0F) {\n SoftResetRom(0xFF);\n }\n if (gKeysPrevious & 1) {\n gAButtonHold++;\n } else {\n gAButtonHold = 0;\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L44-L57","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadKeyInput\n\t.type\t ReadKeyInput,function\n\t.thumb_func\nReadKeyInput:\n\tpush\t{r4, lr}\n\tldr\tr0, .L6\n\tldrh\tr0, [r0]\n\tldr\tr2, .L6+0x4\n\tadd\tr1, r2, #0\n\teor\tr1, r1, r0\n\tldr\tr3, .L6+0x8\n\tldr\tr4, .L6+0xc\n\tldrh\tr2, [r4]\n\tadd\tr0, r1, #0\n\tbic\tr0, r0, r2\n\tstrh\tr0, [r3]\n\tstrh\tr1, [r4]\n\tmov\tr0, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xf\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0xff\n\tbl\tSoftResetRom\n.L3:\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x1\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L6+0x10\n\tldrh\tr0, [r1]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r1]\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgKeysPressed\n\t.word\tgKeysPrevious\n\t.word\tgAButtonHold\n.L4:\n\tldr\tr0, .L8\n\tstrh\tr1, [r0]\n.L5:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgAButtonHold\n.Lfe1:\n\t.size\t ReadKeyInput,.Lfe1-ReadKeyInput\n\n.text\n\t.align\t2, 0\n","ctx":"void SoftResetRom(u8);","proto":{"ReadKeyInput":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gAButtonHold","shape":"scalar u16"},{"name":"gKeysPressed","shape":"scalar u16"},{"name":"gKeysPrevious","shape":"scalar u16"}],"outcome":"nonmatch","source":"void ReadKeyInput(void) {\n s32 v0;\n s32 v1;\n s32 v2;\n u16 * v3;\n v0 = *(u16 *)67109168;\n v1 = gKeysPrevious;\n gKeysPressed = (1023 ^ v0) & ~v1;\n gKeysPrevious = 1023 ^ v0;\n if (((1023 ^ v0) & 15) == 15) SoftResetRom(255, (1023 ^ v0) & 15, v1, &gKeysPressed);\n v2 = gKeysPrevious;\n if ((1 & v2) == 0) {\n gAButtonHold = 1 & v2;\n } else {\n v3 = gAButtonHold;\n gAButtonHold = v3 + 1;\n }\n return;\n}\n","score":43,"maxScore":58,"compileErrors":null,"breakdown":{"insert":17,"delete":11,"replace":3,"opMismatch":1,"argMismatch":11},"quality":{"score":100,"lines":19,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"extern u16 gAButtonHold;\nextern s16 gKeysPressed;\nextern u16 gKeysPrevious;\n\nvoid ReadKeyInput(void) {\n u16 temp_r1;\n u16 temp_r1_2;\n\n temp_r1 = 0x3FF ^ *(u16 *)0x04000130;\n gKeysPressed = temp_r1 & ~gKeysPrevious;\n gKeysPrevious = temp_r1;\n if ((temp_r1 & 0xF) == 0xF) {\n SoftResetRom(0xFFU);\n }\n temp_r1_2 = 1 & gKeysPrevious;\n if (temp_r1_2 != 0) {\n gAButtonHold += 1;\n return;\n }\n gAButtonHold = temp_r1_2;\n}\n","score":0,"maxScore":41,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":19,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":1}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ReadKeyInput` — benchmark function kleod:ReadKeyInput:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadKeyInput\n\t.type\t ReadKeyInput,function\n\t.thumb_func\nReadKeyInput:\n\tpush\t{r4, lr}\n\tldr\tr0, .L6\n\tldrh\tr0, [r0]\n\tldr\tr2, .L6+0x4\n\tadd\tr1, r2, #0\n\teor\tr1, r1, r0\n\tldr\tr3, .L6+0x8\n\tldr\tr4, .L6+0xc\n\tldrh\tr2, [r4]\n\tadd\tr0, r1, #0\n\tbic\tr0, r0, r2\n\tstrh\tr0, [r3]\n\tstrh\tr1, [r4]\n\tmov\tr0, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xf\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0xff\n\tbl\tSoftResetRom\n.L3:\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x1\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L6+0x10\n\tldrh\tr0, [r1]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r1]\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgKeysPressed\n\t.word\tgKeysPrevious\n\t.word\tgAButtonHold\n.L4:\n\tldr\tr0, .L8\n\tstrh\tr1, [r0]\n.L5:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgAButtonHold\n.Lfe1:\n\t.size\t ReadKeyInput,.Lfe1-ReadKeyInput\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid SoftResetRom(u8);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReadKeyInput # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ReadKeyInput` — benchmark function kleod:ReadKeyInput:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReadKeyInput:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadKeyInput\n\t.type\t ReadKeyInput,function\n\t.thumb_func\nReadKeyInput:\n\tpush\t{r4, lr}\n\tldr\tr0, .L6\n\tldrh\tr0, [r0]\n\tldr\tr2, .L6+0x4\n\tadd\tr1, r2, #0\n\teor\tr1, r1, r0\n\tldr\tr3, .L6+0x8\n\tldr\tr4, .L6+0xc\n\tldrh\tr2, [r4]\n\tadd\tr0, r1, #0\n\tbic\tr0, r0, r2\n\tstrh\tr0, [r3]\n\tstrh\tr1, [r4]\n\tmov\tr0, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xf\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0xff\n\tbl\tSoftResetRom\n.L3:\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x1\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L6+0x10\n\tldrh\tr0, [r1]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r1]\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgKeysPressed\n\t.word\tgKeysPrevious\n\t.word\tgAButtonHold\n.L4:\n\tldr\tr0, .L8\n\tstrh\tr1, [r0]\n.L5:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgAButtonHold\n.Lfe1:\n\t.size\t ReadKeyInput,.Lfe1-ReadKeyInput\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ReadKeyInput\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReadKeyInput # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:ReadUnalignedU16:agbcc","sym":"ReadUnalignedU16","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","pointer","memory"],"loc":3,"refSource":"u32 ReadUnalignedU16(u8 *ptr) {\n return ptr[0] | (ptr[1] << 8);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L54-L56","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU16\n\t.type\t ReadUnalignedU16,function\n\t.thumb_func\nReadUnalignedU16:\n\tadd\tr1, r0, #0\n\tldrb\tr0, [r1]\n\tldrb\tr1, [r1, #0x1]\n\tlsl\tr1, r1, #0x8\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU16,.Lfe1-ReadUnalignedU16\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 ReadUnalignedU16(u8 * a0) {\n return *a0 | a0[1] << 8;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 ReadUnalignedU16(void *arg0) {\n return arg0->unk0 | (arg0->unk1 << 8);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1073: warning: dereferencing `void *' pointer","/c.c:1073: request for member `unk0' in something not a structure or union","/c.c:1073: request for member `unk1' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ReadUnalignedU16` — benchmark function kleod:ReadUnalignedU16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU16\n\t.type\t ReadUnalignedU16,function\n\t.thumb_func\nReadUnalignedU16:\n\tadd\tr1, r0, #0\n\tldrb\tr0, [r1]\n\tldrb\tr1, [r1, #0x1]\n\tlsl\tr1, r1, #0x8\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU16,.Lfe1-ReadUnalignedU16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReadUnalignedU16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ReadUnalignedU16` — benchmark function kleod:ReadUnalignedU16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReadUnalignedU16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU16\n\t.type\t ReadUnalignedU16,function\n\t.thumb_func\nReadUnalignedU16:\n\tadd\tr1, r0, #0\n\tldrb\tr0, [r1]\n\tldrb\tr1, [r1, #0x1]\n\tlsl\tr1, r1, #0x8\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU16,.Lfe1-ReadUnalignedU16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReadUnalignedU16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:ReadUnalignedU32:agbcc","sym":"ReadUnalignedU32","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","pointer","cast","memory"],"loc":3,"refSource":"u32 ReadUnalignedU32(u8 *ptr) {\n return ptr[0] + (ptr[1] << 8) + (ptr[2] << 16) + (ptr[3] << 24);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L70-L72","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU32\n\t.type\t ReadUnalignedU32,function\n\t.thumb_func\nReadUnalignedU32:\n\tadd\tr2, r0, #0\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r2, #0x1]\n\tlsl\tr1, r1, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x2]\n\tlsl\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x3]\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU32,.Lfe1-ReadUnalignedU32\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 ReadUnalignedU32(u8 * a0) {\n return *a0 + (a0[1] << 8) + (a0[2] << 16) + (a0[3] << 24);\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 ReadUnalignedU32(void *arg0) {\n return arg0->unk0 + (arg0->unk1 << 8) + (arg0->unk2 << 0x10) + (arg0->unk3 << 0x18);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1073: warning: dereferencing `void *' pointer","/c.c:1073: request for member `unk0' in something not a structure or union","/c.c:1073: request for member `unk1' in something not a structure or union","/c.c:1073: request for member `unk2' in something not a structure or union","/c.c:1073: request for member `unk3' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ReadUnalignedU32` — benchmark function kleod:ReadUnalignedU32:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU32\n\t.type\t ReadUnalignedU32,function\n\t.thumb_func\nReadUnalignedU32:\n\tadd\tr2, r0, #0\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r2, #0x1]\n\tlsl\tr1, r1, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x2]\n\tlsl\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x3]\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU32,.Lfe1-ReadUnalignedU32\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReadUnalignedU32 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ReadUnalignedU32` — benchmark function kleod:ReadUnalignedU32:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReadUnalignedU32:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU32\n\t.type\t ReadUnalignedU32,function\n\t.thumb_func\nReadUnalignedU32:\n\tadd\tr2, r0, #0\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r2, #0x1]\n\tlsl\tr1, r1, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x2]\n\tlsl\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x3]\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU32,.Lfe1-ReadUnalignedU32\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReadUnalignedU32 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:ReciprocalQ4:agbcc","sym":"ReciprocalQ4","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div"],"loc":4,"refSource":"s16 ReciprocalQ4(s16 num1) {\n s32 numerator = 0x100;\n return (numerator / num1);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L50-L53","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ4\n\t.type\t ReciprocalQ4,function\n\t.thumb_func\nReciprocalQ4:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ4,.Lfe1-ReciprocalQ4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/regcopy","symbolsUsed":[],"outcome":"match","source":"s32 ReciprocalQ4(u32 a0) {\n s32 w0;\n w0 = 128 << 1;\n return (s16)(w0 / (s16)a0);\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 ReciprocalQ4(s16 arg0) {\n return (s16) (0x100 / arg0);\n}\n","score":4,"maxScore":13,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ReciprocalQ4` — benchmark function kleod:ReciprocalQ4:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ4\n\t.type\t ReciprocalQ4,function\n\t.thumb_func\nReciprocalQ4:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ4,.Lfe1-ReciprocalQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReciprocalQ4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ReciprocalQ4` — benchmark function kleod:ReciprocalQ4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReciprocalQ4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ4\n\t.type\t ReciprocalQ4,function\n\t.thumb_func\nReciprocalQ4:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ4,.Lfe1-ReciprocalQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReciprocalQ4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:ReciprocalQ8:agbcc","sym":"ReciprocalQ8","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div"],"loc":4,"refSource":"s16 ReciprocalQ8(s16 num1) {\n s32 numerator = 0x10000;\n return (numerator / num1);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L19-L22","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ8\n\t.type\t ReciprocalQ8,function\n\t.thumb_func\nReciprocalQ8:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ8,.Lfe1-ReciprocalQ8\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/regcopy","symbolsUsed":[],"outcome":"match","source":"s32 ReciprocalQ8(u32 a0) {\n s32 w0;\n w0 = 128 << 9;\n return (s16)(w0 / (s16)a0);\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 ReciprocalQ8(s16 arg0) {\n return (s16) (0x10000 / arg0);\n}\n","score":4,"maxScore":13,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ReciprocalQ8` — benchmark function kleod:ReciprocalQ8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ8\n\t.type\t ReciprocalQ8,function\n\t.thumb_func\nReciprocalQ8:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ8,.Lfe1-ReciprocalQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReciprocalQ8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ReciprocalQ8` — benchmark function kleod:ReciprocalQ8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReciprocalQ8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ8\n\t.type\t ReciprocalQ8,function\n\t.thumb_func\nReciprocalQ8:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ8,.Lfe1-ReciprocalQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReciprocalQ8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:ReturnOne:agbcc","sym":"ReturnOne","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["baseline"],"loc":3,"refSource":"s32 ReturnOne(void) {\n return 1;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L12-L14","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReturnOne\n\t.type\t ReturnOne,function\n\t.thumb_func\nReturnOne:\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReturnOne,.Lfe1-ReturnOne\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 ReturnOne(void) {\n return 1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 ReturnOne(void) {\n return 1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ReturnOne` — benchmark function kleod:ReturnOne:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReturnOne\n\t.type\t ReturnOne,function\n\t.thumb_func\nReturnOne:\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReturnOne,.Lfe1-ReturnOne\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReturnOne # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ReturnOne` — benchmark function kleod:ReturnOne:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReturnOne:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReturnOne\n\t.type\t ReturnOne,function\n\t.thumb_func\nReturnOne:\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReturnOne,.Lfe1-ReturnOne\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReturnOne # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:RollRandomLevelVariant:agbcc","sym":"RollRandomLevelVariant","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","call","global","bitwise"],"loc":10,"refSource":"void RollRandomLevelVariant(void) {\n u8 *state = gGameFlags;\n u8 difficulty = state[0x0C];\n u32 difficultyIndex = (u8)(difficulty - 1);\n u32 rng = thunk_sub_080002A0();\n u8 *levelState = gControlBlock;\n u32 parity = difficultyIndex & 1;\n u32 variant = sub_0805193C((u8)rng, 5 - difficultyIndex);\n levelState[0x0E] = parity + variant + 1;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L80-L89","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRollRandomLevelVariant\n\t.type\t RollRandomLevelVariant,function\n\t.thumb_func\nRollRandomLevelVariant:\n\tpush\t{r4, r5, r6, lr}\n\tldr\tr0, .L3\n\tldrb\tr4, [r0, #0xc]\n\tsub\tr4, r4, #0x1\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tbl\tthunk_sub_080002A0\n\tldr\tr6, .L3+0x4\n\tmov\tr5, #0x1\n\tand\tr5, r5, r4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr1, #0x5\n\tsub\tr1, r1, r4\n\tbl\tsub_0805193C\n\tadd\tr5, r5, r0\n\tadd\tr5, r5, #0x1\n\tstrb\tr5, [r6, #0xe]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3005400\n\t.word\t0x3004c20\n.Lfe1:\n\t.size\t RollRandomLevelVariant,.Lfe1-RollRandomLevelVariant\n\n.text\n\t.align\t2, 0\n","proto":{"RollRandomLevelVariant":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","droppedCandidates":[{"label":"unsigned","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-NJ4syx/c.c:1077: too many arguments to function `thunk_sub_080002A0'"}],"symbolsUsed":[],"outcome":"nonmatch","source":"void RollRandomLevelVariant(void) {\n s32 v0;\n v0 = ((u8 *)50353152)[12];\n ((u8 *)50351136)[14] = (1 & (u8)(v0 - 1)) + sub_0805193C((u8)thunk_sub_080002A0(50353152), 5 - (u8)(v0 - 1)) + 1;\n return;\n}\n","score":27,"maxScore":30,"compileErrors":null,"breakdown":{"insert":6,"delete":6,"replace":3,"opMismatch":1,"argMismatch":11},"quality":{"score":92,"lines":6,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 sub_0805193C(u8, s32); /* extern */\nu8 thunk_sub_080002A0(); /* extern */\n\nvoid RollRandomLevelVariant(void) {\n u8 temp_r4;\n\n temp_r4 = (void *)0x03005400->unkC - 1;\n (void *)0x03004C20->unkE = (s8) ((1 & temp_r4) + sub_0805193C(thunk_sub_080002A0(), 5 - temp_r4) + 1);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":96,"lines":7,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1074: conflicting types for `sub_0805193C'","/c.c:1072: previous declaration of `sub_0805193C'","/c.c:1075: conflicting types for `thunk_sub_080002A0'","/c.c:1071: previous declaration of `thunk_sub_080002A0'","/c.c:1080: invalid type argument of `->'"]},"gapSize":{"decompiler":"asmlift","score":27,"maxScore":30,"ratio":0.9,"kinds":{"insert":6,"delete":6,"replace":3,"opMismatch":1,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `RollRandomLevelVariant` — benchmark function kleod:RollRandomLevelVariant:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRollRandomLevelVariant\n\t.type\t RollRandomLevelVariant,function\n\t.thumb_func\nRollRandomLevelVariant:\n\tpush\t{r4, r5, r6, lr}\n\tldr\tr0, .L3\n\tldrb\tr4, [r0, #0xc]\n\tsub\tr4, r4, #0x1\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tbl\tthunk_sub_080002A0\n\tldr\tr6, .L3+0x4\n\tmov\tr5, #0x1\n\tand\tr5, r5, r4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr1, #0x5\n\tsub\tr1, r1, r4\n\tbl\tsub_0805193C\n\tadd\tr5, r5, r0\n\tadd\tr5, r5, #0x1\n\tstrb\tr5, [r6, #0xe]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3005400\n\t.word\t0x3004c20\n.Lfe1:\n\t.size\t RollRandomLevelVariant,.Lfe1-RollRandomLevelVariant\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function RollRandomLevelVariant # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `RollRandomLevelVariant` — benchmark function kleod:RollRandomLevelVariant:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:RollRandomLevelVariant:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRollRandomLevelVariant\n\t.type\t RollRandomLevelVariant,function\n\t.thumb_func\nRollRandomLevelVariant:\n\tpush\t{r4, r5, r6, lr}\n\tldr\tr0, .L3\n\tldrb\tr4, [r0, #0xc]\n\tsub\tr4, r4, #0x1\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tbl\tthunk_sub_080002A0\n\tldr\tr6, .L3+0x4\n\tmov\tr5, #0x1\n\tand\tr5, r5, r4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr1, #0x5\n\tsub\tr1, r1, r4\n\tbl\tsub_0805193C\n\tadd\tr5, r5, r0\n\tadd\tr5, r5, #0x1\n\tstrb\tr5, [r6, #0xe]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3005400\n\t.word\t0x3004c20\n.Lfe1:\n\t.size\t RollRandomLevelVariant,.Lfe1-RollRandomLevelVariant\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"RollRandomLevelVariant\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name RollRandomLevelVariant # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:StrCpy:agbcc","sym":"StrCpy","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","loop","pointer"],"loc":10,"refSource":"void StrCpy(u8 *dst, u8 *src) {\n u32 c;\n do {\n c = *src;\n *dst = c;\n c = *src;\n dst++;\n src++;\n } while (c != 0);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L16-L25","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStrCpy\n\t.type\t StrCpy,function\n\t.thumb_func\nStrCpy:\n.L3:\n\tldrb\tr2, [r1]\n\tstrb\tr2, [r0]\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tbx\tlr\n.Lfe1:\n\t.size\t StrCpy,.Lfe1-StrCpy\n\n.text\n\t.align\t2, 0\n","proto":{"StrCpy":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void StrCpy(u8 * a0, u8 * a1) {\n s32 v0;\n u8 * v1;\n u8 * v2;\n v1 = a1;\n v2 = a0;\n do {\n v0 = *v1;\n *v2 = v0;\n v2 = v2 + 1;\n v1 = v1 + 1;\n } while (v0 != 0);\n return;\n}\n","score":5,"maxScore":8,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void *StrCpy(u8 *arg0, u8 *arg1) {\n u8 temp_r2;\n\n do {\n temp_r2 = *arg1;\n *arg0 = temp_r2;\n } while (temp_r2 != 0);\n return arg0 + 1;\n}\n","score":7,"maxScore":8,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":8,"ratio":0.625,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StrCpy` — benchmark function kleod:StrCpy:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStrCpy\n\t.type\t StrCpy,function\n\t.thumb_func\nStrCpy:\n.L3:\n\tldrb\tr2, [r1]\n\tstrb\tr2, [r0]\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tbx\tlr\n.Lfe1:\n\t.size\t StrCpy,.Lfe1-StrCpy\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StrCpy # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StrCpy` — benchmark function kleod:StrCpy:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:StrCpy:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStrCpy\n\t.type\t StrCpy,function\n\t.thumb_func\nStrCpy:\n.L3:\n\tldrb\tr2, [r1]\n\tstrb\tr2, [r0]\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tbx\tlr\n.Lfe1:\n\t.size\t StrCpy,.Lfe1-StrCpy\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StrCpy\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StrCpy # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:StreamCmd_SetBGScroll:agbcc","sym":"StreamCmd_SetBGScroll","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","struct","pointer","call"],"loc":12,"refSource":"void StreamCmd_SetBGScroll(void) {\n u16 scrollX = ReadUnalignedU16(gStreamPtr + 3);\n struct BGLayerState *tbl = gBGLayerState;\n u8 *p = gStreamPtr;\n u16 scrollY;\n u8 *p2;\n tbl[p[2]].scrollX = scrollX << 4;\n scrollY = ReadUnalignedU16(p + 5);\n p2 = gStreamPtr;\n tbl[p2[2]].scrollY = scrollY << 4;\n gStreamPtr = p2 + 7;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L429-L440","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetBGScroll\n\t.type\t StreamCmd_SetBGScroll,function\n\t.thumb_func\nStreamCmd_SetBGScroll:\n\tpush\t{r4, r5, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tadd\tr3, r0, #0\n\tldr\tr5, .L3+0x4\n\tldr\tr0, [r4]\n\tldrb\tr2, [r0, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr3, r3, #0x4\n\tstrh\tr3, [r1, #0x8]\n\tadd\tr0, r0, #0x5\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr2, [r3, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr0, r0, #0x4\n\tstrh\tr0, [r1, #0xa]\n\tadd\tr3, r3, #0x7\n\tstr\tr3, [r4]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n\t.word\t0x3003430\n.Lfe1:\n\t.size\t StreamCmd_SetBGScroll,.Lfe1-StreamCmd_SetBGScroll\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","symbolsUsed":[],"outcome":"nonmatch","source":"struct Elem0 { u8 _pad0[8]; u16 field_8; u16 field_10; u8 _pad1[16]; };\ns32 StreamCmd_SetBGScroll(void) {\n s32 * v0;\n s32 v1;\n struct Elem0 * v2;\n u8 * v3;\n s32 v4;\n u8 * v5;\n v0 = (s32 *)50351492;\n v1 = ReadUnalignedU16(*v0 + 3);\n v2 = (struct Elem0 *)50345008;\n v3 = (u8 *)*v0;\n v2[v3[2]].field_8 = v1 << 4;\n v4 = ReadUnalignedU16(v3 + 5);\n v5 = (u8 *)*v0;\n v2[v5[2]].field_10 = v4 << 4;\n *v0 = v5 + 7;\n return v4 << 4;\n}\n","score":2,"maxScore":32,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":96,"lines":19,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 ReadUnalignedU16(void *); /* extern */\n\nvoid StreamCmd_SetBGScroll(void) {\n void *temp_r0;\n void *temp_r3;\n\n temp_r0 = *(void **)0x03004D84;\n ((temp_r0->unk2 * 0x1C) + 0x03003430)->unk8 = (s16) (ReadUnalignedU16(*(void **)0x03004D84 + 3) * 0x10);\n temp_r3 = *(void **)0x03004D84;\n ((temp_r3->unk2 * 0x1C) + 0x03003430)->unkA = (s16) (ReadUnalignedU16(temp_r0 + 5) * 0x10);\n *(void **)0x03004D84 = temp_r3 + 7;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":10,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":4},"errorMarkers":["agbcc failed: /c.c:1079: warning: dereferencing `void *' pointer","/c.c:1079: request for member `unk2' in something not a structure or union","/c.c:1081: warning: dereferencing `void *' pointer","/c.c:1081: request for member `unk2' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":32,"ratio":0.0625,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StreamCmd_SetBGScroll` — benchmark function kleod:StreamCmd_SetBGScroll:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetBGScroll\n\t.type\t StreamCmd_SetBGScroll,function\n\t.thumb_func\nStreamCmd_SetBGScroll:\n\tpush\t{r4, r5, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tadd\tr3, r0, #0\n\tldr\tr5, .L3+0x4\n\tldr\tr0, [r4]\n\tldrb\tr2, [r0, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr3, r3, #0x4\n\tstrh\tr3, [r1, #0x8]\n\tadd\tr0, r0, #0x5\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr2, [r3, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr0, r0, #0x4\n\tstrh\tr0, [r1, #0xa]\n\tadd\tr3, r3, #0x7\n\tstr\tr3, [r4]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n\t.word\t0x3003430\n.Lfe1:\n\t.size\t StreamCmd_SetBGScroll,.Lfe1-StreamCmd_SetBGScroll\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StreamCmd_SetBGScroll # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StreamCmd_SetBGScroll` — benchmark function kleod:StreamCmd_SetBGScroll:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:StreamCmd_SetBGScroll:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetBGScroll\n\t.type\t StreamCmd_SetBGScroll,function\n\t.thumb_func\nStreamCmd_SetBGScroll:\n\tpush\t{r4, r5, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tadd\tr3, r0, #0\n\tldr\tr5, .L3+0x4\n\tldr\tr0, [r4]\n\tldrb\tr2, [r0, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr3, r3, #0x4\n\tstrh\tr3, [r1, #0x8]\n\tadd\tr0, r0, #0x5\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr2, [r3, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr0, r0, #0x4\n\tstrh\tr0, [r1, #0xa]\n\tadd\tr3, r3, #0x7\n\tstr\tr3, [r4]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n\t.word\t0x3003430\n.Lfe1:\n\t.size\t StreamCmd_SetBGScroll,.Lfe1-StreamCmd_SetBGScroll\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StreamCmd_SetBGScroll # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:StreamCmd_SetWindowRegs:agbcc","sym":"StreamCmd_SetWindowRegs","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["mmio","pointer","bitwise","global"],"loc":10,"refSource":"void StreamCmd_SetWindowRegs(void) {\n vu16 *reg = ®_WININ;\n u8 **streamPtrAddr = &gStreamPtr;\n u8 *stream = *streamPtrAddr;\n\n *reg = stream[2] | (stream[3] << 8);\n reg++;\n *reg = stream[4] | (stream[5] << 8);\n *streamPtrAddr = stream + 6;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L667-L676","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetWindowRegs\n\t.type\t StreamCmd_SetWindowRegs,function\n\t.thumb_func\nStreamCmd_SetWindowRegs:\n\tpush\t{r4, lr}\n\tldr\tr3, .L3\n\tldr\tr4, .L3+0x4\n\tldr\tr2, [r4]\n\tldrb\tr1, [r2, #0x2]\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr3, r3, #0x2\n\tldrb\tr1, [r2, #0x4]\n\tldrb\tr0, [r2, #0x5]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr2, r2, #0x6\n\tstr\tr2, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x4000048\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t StreamCmd_SetWindowRegs,.Lfe1-StreamCmd_SetWindowRegs\n\n.text\n\t.align\t2, 0\n","proto":{"StreamCmd_SetWindowRegs":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void StreamCmd_SetWindowRegs(void) {\n u8 * v0;\n v0 = (u8 *)*(s32 *)50351492;\n *(u16 *)67108936 = v0[2] | v0[3] << 8;\n *(u16 *)67108938 = v0[4] | v0[5] << 8;\n *(s32 *)50351492 = v0 + 6;\n return;\n}\n","score":5,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":2,"opMismatch":0,"argMismatch":3},"quality":{"score":92,"lines":8,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void StreamCmd_SetWindowRegs(void) {\n void *temp_r2;\n\n temp_r2 = *(void **)0x03004D84;\n (void *)0x04000048->unk0 = (s16) (temp_r2->unk2 | (temp_r2->unk3 << 8));\n (void *)0x04000048->unk2 = (s16) (temp_r2->unk4 | (temp_r2->unk5 << 8));\n *(void **)0x03004D84 = temp_r2 + 6;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":90,"lines":7,"gotos":0,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":2},"errorMarkers":["agbcc failed: /c.c:1076: invalid type argument of `->'","/c.c:1076: warning: dereferencing `void *' pointer","/c.c:1076: request for member `unk2' in something not a structure or union","/c.c:1076: request for member `unk3' in something not a structure or union","/c.c:1077: invalid type argument of `->'"]},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":22,"ratio":0.22727272727272727,"kinds":{"insert":0,"delete":0,"replace":2,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StreamCmd_SetWindowRegs` — benchmark function kleod:StreamCmd_SetWindowRegs:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetWindowRegs\n\t.type\t StreamCmd_SetWindowRegs,function\n\t.thumb_func\nStreamCmd_SetWindowRegs:\n\tpush\t{r4, lr}\n\tldr\tr3, .L3\n\tldr\tr4, .L3+0x4\n\tldr\tr2, [r4]\n\tldrb\tr1, [r2, #0x2]\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr3, r3, #0x2\n\tldrb\tr1, [r2, #0x4]\n\tldrb\tr0, [r2, #0x5]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr2, r2, #0x6\n\tstr\tr2, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x4000048\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t StreamCmd_SetWindowRegs,.Lfe1-StreamCmd_SetWindowRegs\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StreamCmd_SetWindowRegs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StreamCmd_SetWindowRegs` — benchmark function kleod:StreamCmd_SetWindowRegs:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:StreamCmd_SetWindowRegs:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetWindowRegs\n\t.type\t StreamCmd_SetWindowRegs,function\n\t.thumb_func\nStreamCmd_SetWindowRegs:\n\tpush\t{r4, lr}\n\tldr\tr3, .L3\n\tldr\tr4, .L3+0x4\n\tldr\tr2, [r4]\n\tldrb\tr1, [r2, #0x2]\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr3, r3, #0x2\n\tldrb\tr1, [r2, #0x4]\n\tldrb\tr0, [r2, #0x5]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr2, r2, #0x6\n\tstr\tr2, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x4000048\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t StreamCmd_SetWindowRegs,.Lfe1-StreamCmd_SetWindowRegs\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StreamCmd_SetWindowRegs\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StreamCmd_SetWindowRegs # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:TransformSingleEntityToScreen:agbcc","sym":"TransformSingleEntityToScreen","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","struct","array","switch","arithmetic"],"loc":58,"refSource":"void TransformSingleEntityToScreen(u8 arg0, s8 arg1, s8 arg2) {\n s32 temp_r0;\n s32 temp_r0_2;\n s16 temp_r1;\n s16 temp_r2;\n s32 var_r2;\n s32 var_r4;\n struct Unk_0300466C_4 *var_r0;\n\n arg1++, arg1--; /* fake */\n gUnk_03002920[arg0].xPosScreen = gUnk_03002920[arg0].xPosBg2 - arg1 - gUnk_03003430.bg2HOfs;\n gUnk_03002920[arg0].yPosScreen = gUnk_03002920[arg0].yPosBg2 - arg2 - gUnk_03003430.bg2VOfs;\n\n temp_r1 = gUnk_03003430.bg2HOfs - gUnk_03002920[arg0].xPosScreen;\n temp_r2 = gUnk_03003430.bg2VOfs - gUnk_03002920[arg0].yPosScreen;\n\n temp_r0 = temp_r1 * gBg2XMag;\n if (temp_r0 < 0) {\n temp_r0 += 0xFF;\n }\n var_r4 = temp_r0 >> 8;\n\n temp_r0_2 = temp_r2 * gBg2YMag;\n if (temp_r0_2 < 0) {\n temp_r0_2 += 0xFF;\n }\n var_r2 = temp_r0_2 >> 8;\n\n var_r4 = gUnk_03003430.bg2HOfs - var_r4;\n if (arg0 > 0xC) {\n var_r0 = (void *)gUnk_030051DC[arg0 - 0xD].unk4;\n } else {\n var_r0 = gUnk_08078FC8[arg0].unk4;\n }\n\n switch (var_r0->shape_size & 0xF) {\n case 3:\n case 11:\n var_r2 = gUnk_03003430.bg2VOfs - var_r2 + ((0x100 - gBg2YMag) >> 3);\n break;\n case 1:\n case 6:\n case 8:\n var_r2 = gUnk_03003430.bg2VOfs - var_r2 + ((0x100 - gBg2YMag) >> 5);\n break;\n case 0:\n case 4:\n case 5:\n var_r2 = gUnk_03003430.bg2VOfs - var_r2 + ((0x100 - gBg2YMag) >> 6);\n break;\n default:\n var_r2 = gUnk_03003430.bg2VOfs - var_r2 + ((0x100 - gBg2YMag) >> 4);\n break;\n }\n\n gUnk_03002920[arg0].xPosScreen = var_r4;\n gUnk_03002920[arg0].yPosScreen = var_r2;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/9400132178f58db2d8b2638349ffa86155ed2e53/src/code_0.c#L1407-L1464","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tTransformSingleEntityToScreen\n\t.type\t TransformSingleEntityToScreen,function\n\t.thumb_func\nTransformSingleEntityToScreen:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tldr\tr0, .L19\n\tmov\tr8, r0\n\tmov\tr0, r9\n\tlsl\tr7, r0, #0x3\n\tsub\tr4, r7, r0\n\tlsl\tr4, r4, #0x2\n\tadd\tr4, r4, r8\n\tlsl\tr1, r1, #0x18\n\tasr\tr1, r1, #0x18\n\tldrh\tr5, [r4]\n\tsub\tr5, r5, r1\n\tldr\tr6, .L19+0x4\n\tmov\tr1, #0x40\n\tadd\tr1, r1, r6\n\tmov\tip, r1\n\tldrh\tr0, [r1]\n\tsub\tr5, r5, r0\n\tstrh\tr5, [r4, #0x4]\n\tlsl\tr2, r2, #0x18\n\tasr\tr2, r2, #0x18\n\tldrh\tr3, [r4, #0x2]\n\tsub\tr3, r3, r2\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x42\n\tldrh\tr0, [r2]\n\tsub\tr3, r3, r0\n\tstrh\tr3, [r4, #0x6]\n\tldrh\tr1, [r1]\n\tsub\tr1, r1, r5\n\tldrh\tr0, [r2]\n\tsub\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tldr\tr0, .L19+0x8\n\tldrh\tr0, [r0]\n\tmul\tr0, r0, r1\n\tmov\tr5, r8\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L3:\n\tasr\tr4, r0, #0x8\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tldr\tr2, .L19+0xc\n\tldrh\tr1, [r2]\n\tmul\tr0, r0, r1\n\tadd\tr3, r2, #0\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L4:\n\tasr\tr2, r0, #0x8\n\tmov\tr1, ip\n\tldrh\tr0, [r1]\n\tsub\tr4, r0, r4\n\tmov\tr0, r9\n\tcmp\tr0, #0xc\n\tbls\t.L5\t@cond_branch\n\tldr\tr0, .L19+0x10\n\tldr\tr0, [r0]\n\tadd\tr0, r7, r0\n\tsub\tr0, r0, #0x68\n\tldr\tr0, [r0, #0x4]\n\tb\t.L6\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n\t.word\tgBg2XMag\n\t.word\tgBg2YMag\n\t.word\tgUnk_030051DC\n.L5:\n\tldr\tr0, .L21\n\tadd\tr0, r0, #0x4\n\tadd\tr0, r7, r0\n\tldr\tr0, [r0]\n.L6:\n\tldrb\tr0, [r0, #0x5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xb\n\tbhi\t.L16\t@cond_branch\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L21+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\tgUnk_08078FC8\n\t.word\t.L17\n\t.align\t2, 0\n\t.align\t2, 0\n.L17:\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L9\n\t.word\t.L15\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L16\n\t.word\t.L9\n.L9:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tb\t.L18\n.L12:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x5\n\tb\t.L18\n.L15:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x6\n\tb\t.L18\n.L16:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x4\n.L18:\n\tadd\tr2, r1, r0\n\tmov\tr1, r9\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r5\n\tstrh\tr4, [r0, #0x4]\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t TransformSingleEntityToScreen,.Lfe1-TransformSingleEntityToScreen\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'TransformSingleEntityToScreen' — lift: cannot lift 'TransformSingleEntityToScreen': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tTransformSingleEntityToScreen */\n/* \t.type\t TransformSingleEntityToScreen,function */\n/* \t.thumb_func */\n/* TransformSingleEntityToScreen: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, r9 */\n/* \tmov\tr6, r8 */\n/* \tpush\t{r6, r7} */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tmov\tr9, r0 */\n/* \tldr\tr0, .L19 */\n/* \tmov\tr8, r0 */\n/* \tmov\tr0, r9 */\n/* \tlsl\tr7, r0, #0x3 */\n/* \tsub\tr4, r7, r0 */\n/* \tlsl\tr4, r4, #0x2 */\n/* \tadd\tr4, r4, r8 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tasr\tr1, r1, #0x18 */\n/* \tldrh\tr5, [r4] */\n/* \tsub\tr5, r5, r1 */\n/* \tldr\tr6, .L19+0x4 */\n/* \tmov\tr1, #0x40 */\n/* \tadd\tr1, r1, r6 */\n/* \tmov\tip, r1 */\n/* \tldrh\tr0, [r1] */\n/* \tsub\tr5, r5, r0 */\n/* \tstrh\tr5, [r4, #0x4] */\n/* \tlsl\tr2, r2, #0x18 */\n/* \tasr\tr2, r2, #0x18 */\n/* \tldrh\tr3, [r4, #0x2] */\n/* \tsub\tr3, r3, r2 */\n/* \tadd\tr2, r6, #0 */\n/* \tadd\tr2, r2, #0x42 */\n/* \tldrh\tr0, [r2] */\n/* \tsub\tr3, r3, r0 */\n/* \tstrh\tr3, [r4, #0x6] */\n/* \tldrh\tr1, [r1] */\n/* \tsub\tr1, r1, r5 */\n/* \tldrh\tr0, [r2] */\n/* \tsub\tr0, r0, r3 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr2, r0, #0x10 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tldr\tr0, .L19+0x8 */\n/* \tldrh\tr0, [r0] */\n/* \tmul\tr0, r0, r1 */\n/* \tmov\tr5, r8 */\n/* \tcmp\tr0, #0 */\n/* \tbge\t.L3\t@cond_branch */\n/* \tadd\tr0, r0, #0xff */\n/* .L3: */\n/* \tasr\tr4, r0, #0x8 */\n/* \tlsl\tr0, r2, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tldr\tr2, .L19+0xc */\n/* \tldrh\tr1, [r2] */\n/* \tmul\tr0, r0, r1 */\n/* \tadd\tr3, r2, #0 */\n/* \tcmp\tr0, #0 */\n/* \tbge\t.L4\t@cond_branch */\n/* \tadd\tr0, r0, #0xff */\n/* .L4: */\n/* \tasr\tr2, r0, #0x8 */\n/* \tmov\tr1, ip */\n/* \tldrh\tr0, [r1] */\n/* \tsub\tr4, r0, r4 */\n/* \tmov\tr0, r9 */\n/* \tcmp\tr0, #0xc */\n/* \tbls\t.L5\t@cond_branch */\n/* \tldr\tr0, .L19+0x10 */\n/* \tldr\tr0, [r0] */\n/* \tadd\tr0, r7, r0 */\n/* \tsub\tr0, r0, #0x68 */\n/* \tldr\tr0, [r0, #0x4] */\n/* \tb\t.L6 */\n/* .L20: */\n/* \t.align\t2, 0 */\n/* .L19: */\n/* \t.word\tgUnk_03002920 */\n/* \t.word\tgUnk_03003430 */\n/* \t.word\tgBg2XMag */\n/* \t.word\tgBg2YMag */\n/* \t.word\tgUnk_030051DC */\n/* .L5: */\n/* \tldr\tr0, .L21 */\n/* \tadd\tr0, r0, #0x4 */\n/* \tadd\tr0, r7, r0 */\n/* \tldr\tr0, [r0] */\n/* .L6: */\n/* \tldrb\tr0, [r0, #0x5] */\n/* \tmov\tr1, #0xf */\n/* \tand\tr1, r1, r0 */\n/* \tcmp\tr1, #0xb */\n/* \tbhi\t.L16\t@cond_branch */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tldr\tr1, .L21+0x4 */\n/* \tadd\tr0, r0, r1 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tpc, r0 */\n/* .L22: */\n/* \t.align\t2, 0 */\n/* .L21: */\n/* \t.word\tgUnk_08078FC8 */\n/* \t.word\t.L17 */\n/* \t.align\t2, 0 */\n/* \t.align\t2, 0 */\n/* .L17: */\n/* \t.word\t.L15 */\n/* \t.word\t.L12 */\n/* \t.word\t.L16 */\n/* \t.word\t.L9 */\n/* \t.word\t.L15 */\n/* \t.word\t.L15 */\n/* \t.word\t.L12 */\n/* \t.word\t.L16 */\n/* \t.word\t.L12 */\n/* \t.word\t.L16 */\n/* \t.word\t.L16 */\n/* \t.word\t.L9 */\n/* .L9: */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x42 */\n/* \tldrh\tr1, [r0] */\n/* \tsub\tr1, r1, r2 */\n/* \tldrh\tr2, [r3] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tsub\tr0, r0, r2 */\n/* \tasr\tr0, r0, #0x3 */\n/* \tb\t.L18 */\n/* .L12: */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x42 */\n/* \tldrh\tr1, [r0] */\n/* \tsub\tr1, r1, r2 */\n/* \tldrh\tr2, [r3] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tsub\tr0, r0, r2 */\n/* \tasr\tr0, r0, #0x5 */\n/* \tb\t.L18 */\n/* .L15: */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x42 */\n/* \tldrh\tr1, [r0] */\n/* \tsub\tr1, r1, r2 */\n/* \tldrh\tr2, [r3] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tsub\tr0, r0, r2 */\n/* \tasr\tr0, r0, #0x6 */\n/* \tb\t.L18 */\n/* .L16: */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x42 */\n/* \tldrh\tr1, [r0] */\n/* \tsub\tr1, r1, r2 */\n/* \tldrh\tr2, [r3] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tsub\tr0, r0, r2 */\n/* \tasr\tr0, r0, #0x4 */\n/* .L18: */\n/* \tadd\tr2, r1, r0 */\n/* \tmov\tr1, r9 */\n/* \tlsl\tr0, r1, #0x3 */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, r5 */\n/* \tstrh\tr4, [r0, #0x4] */\n/* \tstrh\tr2, [r0, #0x6] */\n/* \tpop\t{r3, r4} */\n/* \tmov\tr8, r3 */\n/* \tmov\tr9, r4 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .Lfe1: */\n/* \t.size\t TransformSingleEntityToScreen,.Lfe1-TransformSingleEntityToScreen */\n/* .text */\n/* \t.align\t2, 0 */\nvoid TransformSingleEntityToScreen(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'TransformSingleEntityToScreen': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":194,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'TransformSingleEntityToScreen': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported"]},"m2c":{"decompiler":"m2c","outcome":"failed","source":"/*\nDecompilation failure in function TransformSingleEntityToScreen:\n\nUnable to determine jump table for mov instruction at in.s line 107.\n*/\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/*"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `TransformSingleEntityToScreen` — benchmark function kleod:TransformSingleEntityToScreen:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tTransformSingleEntityToScreen\n\t.type\t TransformSingleEntityToScreen,function\n\t.thumb_func\nTransformSingleEntityToScreen:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tldr\tr0, .L19\n\tmov\tr8, r0\n\tmov\tr0, r9\n\tlsl\tr7, r0, #0x3\n\tsub\tr4, r7, r0\n\tlsl\tr4, r4, #0x2\n\tadd\tr4, r4, r8\n\tlsl\tr1, r1, #0x18\n\tasr\tr1, r1, #0x18\n\tldrh\tr5, [r4]\n\tsub\tr5, r5, r1\n\tldr\tr6, .L19+0x4\n\tmov\tr1, #0x40\n\tadd\tr1, r1, r6\n\tmov\tip, r1\n\tldrh\tr0, [r1]\n\tsub\tr5, r5, r0\n\tstrh\tr5, [r4, #0x4]\n\tlsl\tr2, r2, #0x18\n\tasr\tr2, r2, #0x18\n\tldrh\tr3, [r4, #0x2]\n\tsub\tr3, r3, r2\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x42\n\tldrh\tr0, [r2]\n\tsub\tr3, r3, r0\n\tstrh\tr3, [r4, #0x6]\n\tldrh\tr1, [r1]\n\tsub\tr1, r1, r5\n\tldrh\tr0, [r2]\n\tsub\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tldr\tr0, .L19+0x8\n\tldrh\tr0, [r0]\n\tmul\tr0, r0, r1\n\tmov\tr5, r8\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L3:\n\tasr\tr4, r0, #0x8\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tldr\tr2, .L19+0xc\n\tldrh\tr1, [r2]\n\tmul\tr0, r0, r1\n\tadd\tr3, r2, #0\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L4:\n\tasr\tr2, r0, #0x8\n\tmov\tr1, ip\n\tldrh\tr0, [r1]\n\tsub\tr4, r0, r4\n\tmov\tr0, r9\n\tcmp\tr0, #0xc\n\tbls\t.L5\t@cond_branch\n\tldr\tr0, .L19+0x10\n\tldr\tr0, [r0]\n\tadd\tr0, r7, r0\n\tsub\tr0, r0, #0x68\n\tldr\tr0, [r0, #0x4]\n\tb\t.L6\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n\t.word\tgBg2XMag\n\t.word\tgBg2YMag\n\t.word\tgUnk_030051DC\n.L5:\n\tldr\tr0, .L21\n\tadd\tr0, r0, #0x4\n\tadd\tr0, r7, r0\n\tldr\tr0, [r0]\n.L6:\n\tldrb\tr0, [r0, #0x5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xb\n\tbhi\t.L16\t@cond_branch\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L21+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\tgUnk_08078FC8\n\t.word\t.L17\n\t.align\t2, 0\n\t.align\t2, 0\n.L17:\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L9\n\t.word\t.L15\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L16\n\t.word\t.L9\n.L9:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tb\t.L18\n.L12:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x5\n\tb\t.L18\n.L15:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x6\n\tb\t.L18\n.L16:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x4\n.L18:\n\tadd\tr2, r1, r0\n\tmov\tr1, r9\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r5\n\tstrh\tr4, [r0, #0x4]\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t TransformSingleEntityToScreen,.Lfe1-TransformSingleEntityToScreen\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function TransformSingleEntityToScreen # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `TransformSingleEntityToScreen` — benchmark function kleod:TransformSingleEntityToScreen:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:TransformSingleEntityToScreen:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tTransformSingleEntityToScreen\n\t.type\t TransformSingleEntityToScreen,function\n\t.thumb_func\nTransformSingleEntityToScreen:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tldr\tr0, .L19\n\tmov\tr8, r0\n\tmov\tr0, r9\n\tlsl\tr7, r0, #0x3\n\tsub\tr4, r7, r0\n\tlsl\tr4, r4, #0x2\n\tadd\tr4, r4, r8\n\tlsl\tr1, r1, #0x18\n\tasr\tr1, r1, #0x18\n\tldrh\tr5, [r4]\n\tsub\tr5, r5, r1\n\tldr\tr6, .L19+0x4\n\tmov\tr1, #0x40\n\tadd\tr1, r1, r6\n\tmov\tip, r1\n\tldrh\tr0, [r1]\n\tsub\tr5, r5, r0\n\tstrh\tr5, [r4, #0x4]\n\tlsl\tr2, r2, #0x18\n\tasr\tr2, r2, #0x18\n\tldrh\tr3, [r4, #0x2]\n\tsub\tr3, r3, r2\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x42\n\tldrh\tr0, [r2]\n\tsub\tr3, r3, r0\n\tstrh\tr3, [r4, #0x6]\n\tldrh\tr1, [r1]\n\tsub\tr1, r1, r5\n\tldrh\tr0, [r2]\n\tsub\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tldr\tr0, .L19+0x8\n\tldrh\tr0, [r0]\n\tmul\tr0, r0, r1\n\tmov\tr5, r8\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L3:\n\tasr\tr4, r0, #0x8\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tldr\tr2, .L19+0xc\n\tldrh\tr1, [r2]\n\tmul\tr0, r0, r1\n\tadd\tr3, r2, #0\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L4:\n\tasr\tr2, r0, #0x8\n\tmov\tr1, ip\n\tldrh\tr0, [r1]\n\tsub\tr4, r0, r4\n\tmov\tr0, r9\n\tcmp\tr0, #0xc\n\tbls\t.L5\t@cond_branch\n\tldr\tr0, .L19+0x10\n\tldr\tr0, [r0]\n\tadd\tr0, r7, r0\n\tsub\tr0, r0, #0x68\n\tldr\tr0, [r0, #0x4]\n\tb\t.L6\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n\t.word\tgBg2XMag\n\t.word\tgBg2YMag\n\t.word\tgUnk_030051DC\n.L5:\n\tldr\tr0, .L21\n\tadd\tr0, r0, #0x4\n\tadd\tr0, r7, r0\n\tldr\tr0, [r0]\n.L6:\n\tldrb\tr0, [r0, #0x5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xb\n\tbhi\t.L16\t@cond_branch\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L21+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\tgUnk_08078FC8\n\t.word\t.L17\n\t.align\t2, 0\n\t.align\t2, 0\n.L17:\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L9\n\t.word\t.L15\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L16\n\t.word\t.L9\n.L9:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tb\t.L18\n.L12:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x5\n\tb\t.L18\n.L15:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x6\n\tb\t.L18\n.L16:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x4\n.L18:\n\tadd\tr2, r1, r0\n\tmov\tr1, r9\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r5\n\tstrh\tr4, [r0, #0x4]\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t TransformSingleEntityToScreen,.Lfe1-TransformSingleEntityToScreen\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name TransformSingleEntityToScreen # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:UpdateEntities:agbcc","sym":"UpdateEntities","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","branch","call","cast"],"loc":9,"refSource":"void UpdateEntities(void) {\n u8 i;\n for (i = 0; i <= 6; i++) {\n if ((u8)CheckWorldCompletion(i)) {\n CopyWorldMapTiles(i);\n UpdateWorldMapNodeTile(i);\n }\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L40-L48","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateEntities\n\t.type\t UpdateEntities,function\n\t.thumb_func\nUpdateEntities:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tbl\tCheckWorldCompletion\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r4, #0\n\tbl\tCopyWorldMapTiles\n\tadd\tr0, r4, #0\n\tbl\tUpdateWorldMapNodeTile\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x6\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t UpdateEntities,.Lfe1-UpdateEntities\n\n.text\n\t.align\t2, 0\n","ctx":"u32 CheckWorldCompletion(u8);\nvoid CopyWorldMapTiles(u8);\nvoid UpdateWorldMapNodeTile(u8);","proto":{"UpdateEntities":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void UpdateEntities(void) {\n s32 v0;\n v0 = 0;\n do {\n if (CheckWorldCompletion(v0) << 24 != 0) {\n CopyWorldMapTiles(v0);\n UpdateWorldMapNodeTile(v0);\n }\n v0 = (u8)(v0 + 1);\n } while (v0 <= 6);\n return;\n}\n","score":1,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":12,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void UpdateEntities(void) {\n u8 var_r4;\n\n var_r4 = 0;\n do {\n if ((CheckWorldCompletion(var_r4) << 0x18) != 0) {\n CopyWorldMapTiles(var_r4);\n UpdateWorldMapNodeTile(var_r4);\n }\n var_r4 += 1;\n } while ((u32) var_r4 <= 6U);\n}\n","score":0,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UpdateEntities` — benchmark function kleod:UpdateEntities:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateEntities\n\t.type\t UpdateEntities,function\n\t.thumb_func\nUpdateEntities:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tbl\tCheckWorldCompletion\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r4, #0\n\tbl\tCopyWorldMapTiles\n\tadd\tr0, r4, #0\n\tbl\tUpdateWorldMapNodeTile\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x6\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t UpdateEntities,.Lfe1-UpdateEntities\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nu32 CheckWorldCompletion(u8);\nvoid CopyWorldMapTiles(u8);\nvoid UpdateWorldMapNodeTile(u8);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateEntities # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateEntities` — benchmark function kleod:UpdateEntities:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateEntities:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateEntities\n\t.type\t UpdateEntities,function\n\t.thumb_func\nUpdateEntities:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tbl\tCheckWorldCompletion\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r4, #0\n\tbl\tCopyWorldMapTiles\n\tadd\tr0, r4, #0\n\tbl\tUpdateWorldMapNodeTile\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x6\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t UpdateEntities,.Lfe1-UpdateEntities\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"UpdateEntities\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateEntities # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:UpdateFadeEffect:agbcc","sym":"UpdateFadeEffect","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["mmio","global","call"],"loc":9,"refSource":"void UpdateFadeEffect(void) {\n vu8 *vcount_reg = ®_VCOUNT_L;\n u8 *entity = gEntityArray;\n u8 fade = sub_08051A0C(*vcount_reg, entity[0x08]);\n\n if (fade <= 16) {\n REG_BLDALPHA = ((u32)fade << 8) | fade;\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/engine.c#L48-L56","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateFadeEffect\n\t.type\t UpdateFadeEffect,function\n\t.thumb_func\nUpdateFadeEffect:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldr\tr1, .L4+0x4\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tbl\tsub_08051A0C\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x10\n\tbhi\t.L3\t@cond_branch\n\tldr\tr1, .L4+0x8\n\tlsl\tr0, r2, #0x8\n\torr\tr0, r0, r2\n\tstrh\tr0, [r1]\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x4000006\n\t.word\tgEntityArray\n\t.word\t0x4000052\n.Lfe1:\n\t.size\t UpdateFadeEffect,.Lfe1-UpdateFadeEffect\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gEntityArray","shape":"u8[]"}],"outcome":"nonmatch","source":"s32 UpdateFadeEffect(void) {\n s32 v0;\n s32 v1;\n v0 = sub_08051A0C(*(u8 *)67108870, gEntityArray[8]);\n if ((u8)v0 > 16) {\n v1 = v0 << 24;\n } else {\n *(u16 *)67108946 = (u8)v0 << 8 | (u8)v0;\n v1 = (u8)v0 << 8 | (u8)v0;\n }\n return v1;\n}\n","score":4,"maxScore":21,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":88,"lines":12,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 sub_08051A0C(u8, u8); /* extern */\n\nvoid UpdateFadeEffect(void) {\n u8 temp_r2;\n\n temp_r2 = sub_08051A0C(*(u8 *)0x04000006, gEntityArray->unk8);\n if ((u32) temp_r2 <= 0x10U) {\n *(s16 *)0x04000052 = (temp_r2 << 8) | temp_r2;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":96,"lines":8,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":2},"errorMarkers":["agbcc failed: /c.c:1077: request for member `unk8' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":4,"maxScore":21,"ratio":0.19047619047619047,"kinds":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UpdateFadeEffect` — benchmark function kleod:UpdateFadeEffect:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateFadeEffect\n\t.type\t UpdateFadeEffect,function\n\t.thumb_func\nUpdateFadeEffect:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldr\tr1, .L4+0x4\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tbl\tsub_08051A0C\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x10\n\tbhi\t.L3\t@cond_branch\n\tldr\tr1, .L4+0x8\n\tlsl\tr0, r2, #0x8\n\torr\tr0, r0, r2\n\tstrh\tr0, [r1]\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x4000006\n\t.word\tgEntityArray\n\t.word\t0x4000052\n.Lfe1:\n\t.size\t UpdateFadeEffect,.Lfe1-UpdateFadeEffect\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid UpdateFadeEffect(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateFadeEffect # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateFadeEffect` — benchmark function kleod:UpdateFadeEffect:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateFadeEffect:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateFadeEffect\n\t.type\t UpdateFadeEffect,function\n\t.thumb_func\nUpdateFadeEffect:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldr\tr1, .L4+0x4\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tbl\tsub_08051A0C\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x10\n\tbhi\t.L3\t@cond_branch\n\tldr\tr1, .L4+0x8\n\tlsl\tr0, r2, #0x8\n\torr\tr0, r0, r2\n\tstrh\tr0, [r1]\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x4000006\n\t.word\tgEntityArray\n\t.word\t0x4000052\n.Lfe1:\n\t.size\t UpdateFadeEffect,.Lfe1-UpdateFadeEffect\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateFadeEffect # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:UpdateHUDCounterDisplay:agbcc","sym":"UpdateHUDCounterDisplay","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","array","branch","soft-div"],"loc":35,"refSource":"s32 UpdateHUDCounterDisplay(void) {\n s32 var_r5;\n s32 var_sb;\n\n var_sb = 0;\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5 = 0x64;\n } else {\n var_r5 = 0x1E;\n }\n if (var_r5 == gUnk_03005220.dreamStones) {\n var_sb = 1;\n }\n\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5 = 1;\n if (gUnk_03005220.dreamStones > 0x63) {\n gBgTilemapBufs[0][0x252] += 0;\n gBgTilemapBufs[0][0x252] = gBgTilemapBufs[0][0x293];\n gBgTilemapBufs[0][0x272] += 0;\n gBgTilemapBufs[0][0x272] = gBgTilemapBufs[0][0x2B3];\n }\n } else {\n var_r5 = 0;\n }\n\n if (gUnk_03005220.dreamStones > 9) {\n gBgTilemapBufs[0][0x254 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones / 10) + 0x292];\n gBgTilemapBufs[0][0x274 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones / 10) + 0x2B2];\n }\n\n gBgTilemapBufs[0][0x255 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones % 10) + 0x292];\n gBgTilemapBufs[0][0x275 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones % 10) + 0x2B2];\n return var_sb;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_1.c#L1184-L1218","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateHUDCounterDisplay\n\t.type\t UpdateHUDCounterDisplay,function\n\t.thumb_func\nUpdateHUDCounterDisplay:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tldr\tr0, .L12\n\tldrb\tr1, [r0, #0xa]\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L3\t@cond_branch\n.L4:\n\tmov\tr5, #0x64\n\tb\t.L5\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgUnk_03004C20\n.L3:\n\tmov\tr5, #0x1e\n.L5:\n\tldr\tr1, .L14\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr2, r0, #0x19\n\tmov\tr8, r1\n\tcmp\tr5, r2\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x1\n\tmov\tr9, r1\n.L6:\n\tldrb\tr0, [r3, #0xa]\n\tcmp\tr0, #0x1\n\tbeq\t.L8\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L7\t@cond_branch\n.L8:\n\tmov\tr5, #0x1\n\tldr\tr6, .L14+0x4\n\tcmp\tr2, #0x63\n\tble\t.L10\t@cond_branch\n\tldr\tr2, .L14+0x8\n\tadd\tr1, r6, r2\n\tadd\tr2, r2, #0x82\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L14+0xc\n\tadd\tr1, r6, r0\n\tadd\tr2, r2, #0x40\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L10\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x4a4\n\t.word\t0x4e4\n.L7:\n\tmov\tr5, #0x0\n\tldr\tr6, .L16\n.L10:\n\tmov\tr7, r8\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tcmp\tr0, #0x9\n\tble\t.L11\t@cond_branch\n\tmov\tr4, #0x95\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr1, .L16+0x4\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr4, #0x9d\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n.L11:\n\tldr\tr4, .L16+0xc\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x4\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldr\tr4, .L16+0x10\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr0, r9\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgBgTilemapBufs\n\t.word\t0x292\n\t.word\t0x2b2\n\t.word\t0x255\n\t.word\t0x275\n.Lfe1:\n\t.size\t UpdateHUDCounterDisplay,.Lfe1-UpdateHUDCounterDisplay\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"noncompile","source":"s32 UpdateHUDCounterDisplay(s32 a0, s32 a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n u16 * v5;\n if (gUnk_03004C20.unkA == 1) {\n v2 = 100;\n } else {\n if (gUnk_03004C20.level != 6) {\n v2 = 30;\n } else {\n v2 = 100;\n }\n }\n v0 = *(u16 *)&gUnk_03005220;\n if (v2 != v0 << 20 >> 25) {\n v3 = 0;\n } else {\n v3 = 1;\n }\n if (gUnk_03004C20.unkA == 1) {\n if (v0 << 20 >> 25 <= 99) {\n v4 = 1;\n v5 = &gBgTilemapBufs;\n } else {\n gBgTilemapBufs[594] = gBgTilemapBufs[659];\n gBgTilemapBufs[626] = gBgTilemapBufs[691];\n v4 = 1;\n v5 = &gBgTilemapBufs;\n }\n } else {\n if (gUnk_03004C20.level != 6) {\n v4 = 0;\n v5 = &gBgTilemapBufs;\n } else {\n if (v0 << 20 >> 25 <= 99) {\n v4 = 1;\n v5 = &gBgTilemapBufs;\n } else {\n gBgTilemapBufs[594] = gBgTilemapBufs[659];\n gBgTilemapBufs[626] = gBgTilemapBufs[691];\n v4 = 1;\n v5 = &gBgTilemapBufs;\n }\n }\n }\n v1 = *(u16 *)&gUnk_03005220;\n if (v1 << 20 >> 25 > 9) {\n v5[(149 << 2) - v4] = v5[(v1 << 20 >> 25) / 10 + 658];\n v5[(157 << 2) - v4] = v5[(*(u16 *)&gUnk_03005220 << 20 >> 25) / 10 + 690];\n }\n v5[597 - v4] = v5[(*(u16 *)&gUnk_03005220 << 20 >> 25) % 10 + 658];\n v5[629 - v4] = v5[(*(u16 *)&gUnk_03005220 << 20 >> 25) % 10 + 690];\n return v3;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":94,"lines":57,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["no scorable candidate for 'UpdateHUDCounterDisplay': agbcc failed: /c.c:1088: incompatible types in assignment"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 UpdateHUDCounterDisplay(void) {\n s32 var_r5;\n s32 var_r5_2;\n s32 var_r9;\n u32 temp_r0;\n u32 temp_r2;\n\n var_r9 = 0;\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5 = 0x64;\n } else {\n var_r5 = 0x1E;\n }\n temp_r2 = (u32) (gUnk_03005220 << 0x14) >> 0x19;\n if (var_r5 == temp_r2) {\n var_r9 = 1;\n }\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5_2 = 1;\n if ((s32) temp_r2 > 0x63) {\n gBgTilemapBufs[0][0x252] = gBgTilemapBufs[0][0x293];\n gBgTilemapBufs[0][0x272] = gBgTilemapBufs[0][0x2B3];\n }\n } else {\n var_r5_2 = 0;\n }\n temp_r0 = (u32) (gUnk_03005220 << 0x14) >> 0x19;\n if ((s32) temp_r0 > 9) {\n gBgTilemapBufs->unk0[0x254 - var_r5_2] = gBgTilemapBufs->unk0[((s32) temp_r0 / 10) + 0x292];\n gBgTilemapBufs->unk0[0x274 - var_r5_2] = gBgTilemapBufs->unk0[((s32) ((u32) (gUnk_03005220 << 0x14) >> 0x19) / 10) + 0x2B2];\n }\n gBgTilemapBufs->unk0[0x255 - var_r5_2] = gBgTilemapBufs->unk0[((s32) ((u32) (gUnk_03005220 << 0x14) >> 0x19) % 10) + 0x292];\n gBgTilemapBufs->unk0[0x275 - var_r5_2] = gBgTilemapBufs->unk0[((s32) ((u32) (gUnk_03005220 << 0x14) >> 0x19) % 10) + 0x2B2];\n return var_r9;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":34,"gotos":0,"casts":12,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1085: invalid operands to binary <<","/c.c:1098: invalid operands to binary <<","/c.c:1100: request for member `unk0' in something not a structure or union","/c.c:1101: request for member `unk0' in something not a structure or union","/c.c:1101: invalid operands to binary <<"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UpdateHUDCounterDisplay` — benchmark function kleod:UpdateHUDCounterDisplay:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateHUDCounterDisplay\n\t.type\t UpdateHUDCounterDisplay,function\n\t.thumb_func\nUpdateHUDCounterDisplay:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tldr\tr0, .L12\n\tldrb\tr1, [r0, #0xa]\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L3\t@cond_branch\n.L4:\n\tmov\tr5, #0x64\n\tb\t.L5\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgUnk_03004C20\n.L3:\n\tmov\tr5, #0x1e\n.L5:\n\tldr\tr1, .L14\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr2, r0, #0x19\n\tmov\tr8, r1\n\tcmp\tr5, r2\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x1\n\tmov\tr9, r1\n.L6:\n\tldrb\tr0, [r3, #0xa]\n\tcmp\tr0, #0x1\n\tbeq\t.L8\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L7\t@cond_branch\n.L8:\n\tmov\tr5, #0x1\n\tldr\tr6, .L14+0x4\n\tcmp\tr2, #0x63\n\tble\t.L10\t@cond_branch\n\tldr\tr2, .L14+0x8\n\tadd\tr1, r6, r2\n\tadd\tr2, r2, #0x82\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L14+0xc\n\tadd\tr1, r6, r0\n\tadd\tr2, r2, #0x40\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L10\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x4a4\n\t.word\t0x4e4\n.L7:\n\tmov\tr5, #0x0\n\tldr\tr6, .L16\n.L10:\n\tmov\tr7, r8\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tcmp\tr0, #0x9\n\tble\t.L11\t@cond_branch\n\tmov\tr4, #0x95\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr1, .L16+0x4\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr4, #0x9d\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n.L11:\n\tldr\tr4, .L16+0xc\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x4\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldr\tr4, .L16+0x10\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr0, r9\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgBgTilemapBufs\n\t.word\t0x292\n\t.word\t0x2b2\n\t.word\t0x255\n\t.word\t0x275\n.Lfe1:\n\t.size\t UpdateHUDCounterDisplay,.Lfe1-UpdateHUDCounterDisplay\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 UpdateHUDCounterDisplay(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateHUDCounterDisplay # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateHUDCounterDisplay` — benchmark function kleod:UpdateHUDCounterDisplay:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateHUDCounterDisplay:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateHUDCounterDisplay\n\t.type\t UpdateHUDCounterDisplay,function\n\t.thumb_func\nUpdateHUDCounterDisplay:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tldr\tr0, .L12\n\tldrb\tr1, [r0, #0xa]\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L3\t@cond_branch\n.L4:\n\tmov\tr5, #0x64\n\tb\t.L5\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgUnk_03004C20\n.L3:\n\tmov\tr5, #0x1e\n.L5:\n\tldr\tr1, .L14\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr2, r0, #0x19\n\tmov\tr8, r1\n\tcmp\tr5, r2\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x1\n\tmov\tr9, r1\n.L6:\n\tldrb\tr0, [r3, #0xa]\n\tcmp\tr0, #0x1\n\tbeq\t.L8\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L7\t@cond_branch\n.L8:\n\tmov\tr5, #0x1\n\tldr\tr6, .L14+0x4\n\tcmp\tr2, #0x63\n\tble\t.L10\t@cond_branch\n\tldr\tr2, .L14+0x8\n\tadd\tr1, r6, r2\n\tadd\tr2, r2, #0x82\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L14+0xc\n\tadd\tr1, r6, r0\n\tadd\tr2, r2, #0x40\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L10\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x4a4\n\t.word\t0x4e4\n.L7:\n\tmov\tr5, #0x0\n\tldr\tr6, .L16\n.L10:\n\tmov\tr7, r8\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tcmp\tr0, #0x9\n\tble\t.L11\t@cond_branch\n\tmov\tr4, #0x95\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr1, .L16+0x4\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr4, #0x9d\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n.L11:\n\tldr\tr4, .L16+0xc\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x4\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldr\tr4, .L16+0x10\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr0, r9\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgBgTilemapBufs\n\t.word\t0x292\n\t.word\t0x2b2\n\t.word\t0x255\n\t.word\t0x275\n.Lfe1:\n\t.size\t UpdateHUDCounterDisplay,.Lfe1-UpdateHUDCounterDisplay\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateHUDCounterDisplay # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:UpdateWorldMapNodeTile:agbcc","sym":"UpdateWorldMapNodeTile","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","array","branch","table"],"loc":22,"refSource":"void UpdateWorldMapNodeTile(u8 arg0) {\n vu32 a; // Required to match\n if (arg0 < 4) {\n gBgTilemapBufs[1][gUnk_08116748[arg0][0] + (gUnk_08116748[arg0][1] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 0];\n gBgTilemapBufs[1][gUnk_08116748[arg0][2] + (gUnk_08116748[arg0][3] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 1];\n gBgTilemapBufs[1][gUnk_08116748[arg0][4] + (gUnk_08116748[arg0][5] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 2];\n gBgTilemapBufs[1][gUnk_08116748[arg0][6] + (gUnk_08116748[arg0][7] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 3];\n } else {\n gBgTilemapBufs[1][gUnk_08116748[arg0][0] + (gUnk_08116748[arg0][1] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 4];\n gBgTilemapBufs[1][gUnk_08116748[arg0][2] + (gUnk_08116748[arg0][3] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 5];\n gBgTilemapBufs[1][gUnk_08116748[arg0][4] + (gUnk_08116748[arg0][5] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 6];\n gBgTilemapBufs[1][gUnk_08116748[arg0][6] + (gUnk_08116748[arg0][7] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 7];\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_3.c#L1849-L1870","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeTile\n\t.type\t UpdateWorldMapNodeTile,function\n\t.thumb_func\nUpdateWorldMapNodeTile:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr6, .L6\n\tldr\tr4, .L6+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L6+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr0, r3, #0x6\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x3\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.L3:\n\tldr\tr6, .L8\n\tldr\tr4, .L8+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L8+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x4\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x5\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x6\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x7\n.L5:\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r6\n\tldrh\tr1, [r3]\n\tstrh\tr1, [r0]\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.Lfe1:\n\t.size\t UpdateWorldMapNodeTile,.Lfe1-UpdateWorldMapNodeTile\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'UpdateWorldMapNodeTile' — lift: cannot lift 'UpdateWorldMapNodeTile': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tUpdateWorldMapNodeTile */\n/* \t.type\t UpdateWorldMapNodeTile,function */\n/* \t.thumb_func */\n/* UpdateWorldMapNodeTile: */\n/* \tpush\t{r4, r5, r6, lr} */\n/* \tadd\tsp, sp, #-0x4 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr3, r0, #0x18 */\n/* \tcmp\tr3, #0x3 */\n/* \tbhi\t.L3\t@cond_branch */\n/* \tldr\tr6, .L6 */\n/* \tldr\tr4, .L6+0x4 */\n/* \tlsl\tr5, r3, #0x3 */\n/* \tadd\tr2, r5, r4 */\n/* \tadd\tr0, r4, #0x1 */\n/* \tadd\tr0, r5, r0 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr2, [r2] */\n/* \tadd\tr1, r1, r2 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tadd\tr6, r6, r0 */\n/* \tadd\tr1, r1, r6 */\n/* \tldr\tr0, .L6+0x8 */\n/* \tadd\tr0, r3, r0 */\n/* \tldrb\tr3, [r0] */\n/* \tadd\tr3, r3, #0x1c */\n/* \tlsl\tr0, r3, #0x6 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr2, r4, #0x2 */\n/* \tadd\tr2, r5, r2 */\n/* \tadd\tr0, r4, #0x3 */\n/* \tadd\tr0, r5, r0 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr2, [r2] */\n/* \tadd\tr1, r1, r2 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tadd\tr1, r1, r6 */\n/* \tlsl\tr3, r3, #0x5 */\n/* \tadd\tr0, r3, #0x1 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr2, r4, #0x4 */\n/* \tadd\tr2, r5, r2 */\n/* \tadd\tr0, r4, #0x5 */\n/* \tadd\tr0, r5, r0 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr2, [r2] */\n/* \tadd\tr1, r1, r2 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tadd\tr1, r1, r6 */\n/* \tadd\tr0, r3, #0x2 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr1, r4, #0x6 */\n/* \tadd\tr1, r5, r1 */\n/* \tadd\tr4, r4, #0x7 */\n/* \tadd\tr5, r5, r4 */\n/* \tldrb\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x5 */\n/* \tldrb\tr1, [r1] */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tadd\tr3, r3, #0x3 */\n/* \tb\t.L5 */\n/* .L7: */\n/* \t.align\t2, 0 */\n/* .L6: */\n/* \t.word\tgBgTilemapBufs */\n/* \t.word\tgUnk_08116748 */\n/* \t.word\tgUnk_08116880 */\n/* .L3: */\n/* \tldr\tr6, .L8 */\n/* \tldr\tr4, .L8+0x4 */\n/* \tlsl\tr5, r3, #0x3 */\n/* \tadd\tr2, r5, r4 */\n/* \tadd\tr0, r4, #0x1 */\n/* \tadd\tr0, r5, r0 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr2, [r2] */\n/* \tadd\tr1, r1, r2 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tadd\tr6, r6, r0 */\n/* \tadd\tr1, r1, r6 */\n/* \tldr\tr0, .L8+0x8 */\n/* \tadd\tr0, r3, r0 */\n/* \tldrb\tr3, [r0] */\n/* \tadd\tr3, r3, #0x1c */\n/* \tlsl\tr3, r3, #0x5 */\n/* \tadd\tr0, r3, #0x4 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr2, r4, #0x2 */\n/* \tadd\tr2, r5, r2 */\n/* \tadd\tr0, r4, #0x3 */\n/* \tadd\tr0, r5, r0 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr2, [r2] */\n/* \tadd\tr1, r1, r2 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tadd\tr1, r1, r6 */\n/* \tadd\tr0, r3, #0x5 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr2, r4, #0x4 */\n/* \tadd\tr2, r5, r2 */\n/* \tadd\tr0, r4, #0x5 */\n/* \tadd\tr0, r5, r0 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr2, [r2] */\n/* \tadd\tr1, r1, r2 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tadd\tr1, r1, r6 */\n/* \tadd\tr0, r3, #0x6 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr1, r4, #0x6 */\n/* \tadd\tr1, r5, r1 */\n/* \tadd\tr4, r4, #0x7 */\n/* \tadd\tr5, r5, r4 */\n/* \tldrb\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x5 */\n/* \tldrb\tr1, [r1] */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tadd\tr3, r3, #0x7 */\n/* .L5: */\n/* \tlsl\tr3, r3, #0x1 */\n/* \tadd\tr3, r3, r6 */\n/* \tldrh\tr1, [r3] */\n/* \tstrh\tr1, [r0] */\n/* \tadd\tsp, sp, #0x4 */\n/* \tpop\t{r4, r5, r6} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L9: */\n/* \t.align\t2, 0 */\n/* .L8: */\n/* \t.word\tgBgTilemapBufs */\n/* \t.word\tgUnk_08116748 */\n/* \t.word\tgUnk_08116880 */\n/* .Lfe1: */\n/* \t.size\t UpdateWorldMapNodeTile,.Lfe1-UpdateWorldMapNodeTile */\n/* .text */\n/* \t.align\t2, 0 */\nvoid UpdateWorldMapNodeTile(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'UpdateWorldMapNodeTile': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":178,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'UpdateWorldMapNodeTile': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void UpdateWorldMapNodeTile(u8 arg0) {\n s32 temp_r3_2;\n s32 temp_r3_3;\n s32 temp_r3_4;\n s32 temp_r5;\n s32 temp_r5_2;\n s32 var_r3;\n u16 (*var_r6)[0x400];\n u16 *var_r0;\n u8 temp_r3;\n\n temp_r3 = arg0;\n if ((u32) temp_r3 <= 3U) {\n temp_r5 = temp_r3 * 8;\n var_r6 = gBgTilemapBufs + 0x800;\n temp_r3_2 = gUnk_08116880[temp_r3] + 0x1C;\n (*var_r6)[(*(temp_r5 + &gUnk_08116748[0][1]) << 5) + *gUnk_08116748[temp_r3]] = *((temp_r3_2 << 6) + var_r6);\n temp_r3_3 = temp_r3_2 << 5;\n (*var_r6)[(*(temp_r5 + &gUnk_08116748[0][3]) << 5) + *(temp_r5 + &gUnk_08116748[0][2])] = (*var_r6)[temp_r3_3 + 1];\n (*var_r6)[(*(temp_r5 + &gUnk_08116748[0][5]) << 5) + *(temp_r5 + &gUnk_08116748[0][4])] = (*var_r6)[temp_r3_3 + 2];\n var_r0 = &(*var_r6)[(*(temp_r5 + &gUnk_08116748[0][7]) << 5) + *(temp_r5 + &gUnk_08116748[0][6])];\n var_r3 = temp_r3_3 + 3;\n } else {\n temp_r5_2 = temp_r3 * 8;\n var_r6 = gBgTilemapBufs + 0x800;\n temp_r3_4 = (gUnk_08116880[temp_r3] + 0x1C) << 5;\n (*var_r6)[(*(temp_r5_2 + &gUnk_08116748[0][1]) << 5) + *gUnk_08116748[temp_r3]] = (*var_r6)[temp_r3_4 + 4];\n (*var_r6)[(*(temp_r5_2 + &gUnk_08116748[0][3]) << 5) + *(temp_r5_2 + &gUnk_08116748[0][2])] = (*var_r6)[temp_r3_4 + 5];\n (*var_r6)[(*(temp_r5_2 + &gUnk_08116748[0][5]) << 5) + *(temp_r5_2 + &gUnk_08116748[0][4])] = (*var_r6)[temp_r3_4 + 6];\n var_r0 = &(*var_r6)[(*(temp_r5_2 + &gUnk_08116748[0][7]) << 5) + *(temp_r5_2 + &gUnk_08116748[0][6])];\n var_r3 = temp_r3_4 + 7;\n }\n *var_r0 = (*var_r6)[var_r3];\n}\n","score":151,"maxScore":170,"compileErrors":null,"breakdown":{"insert":18,"delete":36,"replace":12,"opMismatch":2,"argMismatch":83},"quality":{"score":100,"lines":33,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":151,"maxScore":170,"ratio":0.888235294117647,"kinds":{"insert":18,"delete":36,"replace":12,"opMismatch":2,"argMismatch":83}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UpdateWorldMapNodeTile` — benchmark function kleod:UpdateWorldMapNodeTile:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeTile\n\t.type\t UpdateWorldMapNodeTile,function\n\t.thumb_func\nUpdateWorldMapNodeTile:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr6, .L6\n\tldr\tr4, .L6+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L6+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr0, r3, #0x6\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x3\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.L3:\n\tldr\tr6, .L8\n\tldr\tr4, .L8+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L8+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x4\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x5\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x6\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x7\n.L5:\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r6\n\tldrh\tr1, [r3]\n\tstrh\tr1, [r0]\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.Lfe1:\n\t.size\t UpdateWorldMapNodeTile,.Lfe1-UpdateWorldMapNodeTile\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid UpdateWorldMapNodeTile(u8 arg0);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateWorldMapNodeTile # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateWorldMapNodeTile` — benchmark function kleod:UpdateWorldMapNodeTile:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateWorldMapNodeTile:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeTile\n\t.type\t UpdateWorldMapNodeTile,function\n\t.thumb_func\nUpdateWorldMapNodeTile:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr6, .L6\n\tldr\tr4, .L6+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L6+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr0, r3, #0x6\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x3\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.L3:\n\tldr\tr6, .L8\n\tldr\tr4, .L8+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L8+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x4\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x5\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x6\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x7\n.L5:\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r6\n\tldrh\tr1, [r3]\n\tstrh\tr1, [r0]\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.Lfe1:\n\t.size\t UpdateWorldMapNodeTile,.Lfe1-UpdateWorldMapNodeTile\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateWorldMapNodeTile # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:VBlankHandlerMinimal:agbcc","sym":"VBlankHandlerMinimal","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["mmio","global","call"],"loc":5,"refSource":"void VBlankHandlerMinimal(void) {\n m4aSoundVSync();\n m4aSoundMain();\n gIMEAcknowledge = 1;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L71-L75","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVBlankHandlerMinimal\n\t.type\t VBlankHandlerMinimal,function\n\t.thumb_func\nVBlankHandlerMinimal:\n\tpush\t{lr}\n\tbl\tm4aSoundVSync\n\tbl\tm4aSoundMain\n\tldr\tr1, .L3\n\tmov\tr0, #0x1\n\tstrh\tr0, [r1]\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3007ff8\n.Lfe1:\n\t.size\t VBlankHandlerMinimal,.Lfe1-VBlankHandlerMinimal\n\n.text\n\t.align\t2, 0\n","ctx":"void m4aSoundVSync(void);\nvoid m4aSoundMain(void);","proto":{"VBlankHandlerMinimal":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gIMEAcknowledge","shape":"scalar u16"}],"outcome":"match","source":"void VBlankHandlerMinimal(void) {\n m4aSoundMain(m4aSoundVSync());\n gIMEAcknowledge = 1;\n return;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void VBlankHandlerMinimal(void) {\n m4aSoundVSync();\n m4aSoundMain();\n *(s16 *)0x03007FF8 = 1;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":1}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `VBlankHandlerMinimal` — benchmark function kleod:VBlankHandlerMinimal:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVBlankHandlerMinimal\n\t.type\t VBlankHandlerMinimal,function\n\t.thumb_func\nVBlankHandlerMinimal:\n\tpush\t{lr}\n\tbl\tm4aSoundVSync\n\tbl\tm4aSoundMain\n\tldr\tr1, .L3\n\tmov\tr0, #0x1\n\tstrh\tr0, [r1]\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3007ff8\n.Lfe1:\n\t.size\t VBlankHandlerMinimal,.Lfe1-VBlankHandlerMinimal\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid m4aSoundVSync(void);\nvoid m4aSoundMain(void);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function VBlankHandlerMinimal # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `VBlankHandlerMinimal` — benchmark function kleod:VBlankHandlerMinimal:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:VBlankHandlerMinimal:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVBlankHandlerMinimal\n\t.type\t VBlankHandlerMinimal,function\n\t.thumb_func\nVBlankHandlerMinimal:\n\tpush\t{lr}\n\tbl\tm4aSoundVSync\n\tbl\tm4aSoundMain\n\tldr\tr1, .L3\n\tmov\tr0, #0x1\n\tstrh\tr0, [r1]\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3007ff8\n.Lfe1:\n\t.size\t VBlankHandlerMinimal,.Lfe1-VBlankHandlerMinimal\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"VBlankHandlerMinimal\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VBlankHandlerMinimal # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:WritePaletteColor:agbcc","sym":"WritePaletteColor","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["call","global","pointer","memory","mmio"],"loc":7,"refSource":"void WritePaletteColor(void) {\n u8 **gp = &gStreamPtr;\n u16 color = ReadUnalignedU16(*gp + 3);\n u8 *ptr = *gp;\n *(u16 *)(BG_PAL_RAM + ptr[2] * 2) = color;\n *gp = ptr + 5;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L448-L454","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tWritePaletteColor\n\t.type\t WritePaletteColor,function\n\t.thumb_func\nWritePaletteColor:\n\tpush\t{r4, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr1, [r3, #0x2]\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, #0xa0\n\tlsl\tr2, r2, #0x13\n\tadd\tr1, r1, r2\n\tstrh\tr0, [r1]\n\tadd\tr3, r3, #0x5\n\tstr\tr3, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t WritePaletteColor,.Lfe1-WritePaletteColor\n\n.text\n\t.align\t2, 0\n","proto":{"WritePaletteColor":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void WritePaletteColor(void) {\n s32 * v0;\n s32 v1;\n u8 * v2;\n v0 = (s32 *)50351492;\n v1 = ReadUnalignedU16(*v0 + 3);\n v2 = (u8 *)*v0;\n ((u16 *)(160 << 19))[v2[2]] = v1;\n *v0 = v2 + 5;\n return;\n}\n","score":0,"maxScore":18,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":11,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s16 ReadUnalignedU16(s32); /* extern */\n\nvoid WritePaletteColor(void) {\n void *temp_r3;\n\n temp_r3 = *(void **)0x03004D84;\n (temp_r3->unk2 * 2)->unk5000000 = ReadUnalignedU16(*(void **)0x03004D84 + 3);\n *(void **)0x03004D84 = temp_r3 + 5;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":94,"lines":7,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":3},"errorMarkers":["agbcc failed: /c.c:1073: conflicting types for `ReadUnalignedU16'","/c.c:1071: previous declaration of `ReadUnalignedU16'","/c.c:1079: warning: dereferencing `void *' pointer","/c.c:1079: request for member `unk2' in something not a structure or union","/c.c:1079: warning: passing arg 1 of `ReadUnalignedU16' makes integer from pointer without a cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `WritePaletteColor` — benchmark function kleod:WritePaletteColor:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tWritePaletteColor\n\t.type\t WritePaletteColor,function\n\t.thumb_func\nWritePaletteColor:\n\tpush\t{r4, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr1, [r3, #0x2]\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, #0xa0\n\tlsl\tr2, r2, #0x13\n\tadd\tr1, r1, r2\n\tstrh\tr0, [r1]\n\tadd\tr3, r3, #0x5\n\tstr\tr3, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t WritePaletteColor,.Lfe1-WritePaletteColor\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function WritePaletteColor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `WritePaletteColor` — benchmark function kleod:WritePaletteColor:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: a3a9d7176a881b7bc44675724283c90c19002dfdf134ae7c9b53af88414c658f\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:WritePaletteColor:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tWritePaletteColor\n\t.type\t WritePaletteColor,function\n\t.thumb_func\nWritePaletteColor:\n\tpush\t{r4, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr1, [r3, #0x2]\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, #0xa0\n\tlsl\tr2, r2, #0x13\n\tadd\tr1, r1, r2\n\tstrh\tr0, [r1]\n\tadd\tr3, r3, #0x5\n\tstr\tr3, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t WritePaletteColor,.Lfe1-WritePaletteColor\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"WritePaletteColor\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name WritePaletteColor # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:CameraScissorSet:gcc2.7.2","sym":"CameraScissorSet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","arithmetic"],"loc":7,"refSource":"void CameraScissorSet(s16 camIndex, RectF *arg1) {\n HuCamera *camera = &gCameraList[camIndex];\n camera->screenLeft = arg1->x1;\n camera->screenTop = arg1->y1;\n camera->screenRight = arg1->x2;\n camera->screenBottom = arg1->y2;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L72-L78","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x3\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x2\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x4\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\taddu\tv0,v0,v1\n 28:\tlwc1\t$f0,0(a1)\n 2c:\tswc1\t$f0,144(v0)\n 30:\tlwc1\t$f0,4(a1)\n 34:\tswc1\t$f0,148(v0)\n 38:\tlwc1\t$f0,8(a1)\n 3c:\tswc1\t$f0,152(v0)\n 40:\tlwc1\t$f0,12(a1)\n 44:\tjr\tra\n 48:\tswc1\t$f0,156(v0)\n 4c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-3f9d594d88fa.i.gz","proto":{"CameraScissorSet":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-333d6c1dd230dd41/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c CameraScissorSet\n00000000 *UND*\t00000000 gCameraList\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 gCameraList\n00000020 R_MIPS_LO16 gCameraList\n\n\nContents of section .text:\n 0000 00042400 00042403 000410c0 00441021 ..$...$......D.!\n 0010 00021080 00441023 00021100 3c030000 .....D.#....<...\n 0020 8c630000 00431021 c4a00000 e4400090 .c...C.!.....@..\n 0030 c4a00004 e4400094 c4a00008 e4400098 .....@.......@..\n 0040 c4a0000c 03e00008 e440009c 00000000 .........@......\nContents of section .reginfo:\n 0000 8000003c 00000000 00000001 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'CameraScissorSet' — lift: cannot lift 'CameraScissorSet @0x28': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsll\ta0,a0,0x10 */\n/* 4:\tsra\ta0,a0,0x10 */\n/* 8:\tsll\tv0,a0,0x3 */\n/* c:\taddu\tv0,v0,a0 */\n/* 10:\tsll\tv0,v0,0x2 */\n/* 14:\tsubu\tv0,v0,a0 */\n/* 18:\tsll\tv0,v0,0x4 */\n/* 1c:\tlui\tv1,0x0 */\n/* 20:\tlw\tv1,0(v1) */\n/* 24:\taddu\tv0,v0,v1 */\n/* 28:\tlwc1\t$f0,0(a1) */\n/* 2c:\tswc1\t$f0,144(v0) */\n/* 30:\tlwc1\t$f0,4(a1) */\n/* 34:\tswc1\t$f0,148(v0) */\n/* 38:\tlwc1\t$f0,8(a1) */\n/* 3c:\tswc1\t$f0,152(v0) */\n/* 40:\tlwc1\t$f0,12(a1) */\n/* 44:\tjr\tra */\n/* 48:\tswc1\t$f0,156(v0) */\n/* 4c:\tnop */\nvoid CameraScissorSet(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'CameraScissorSet @0x28': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":28,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'CameraScissorSet @0x28': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void CameraScissorSet(s16 camIndex, RectF *arg1) {\n HuCamera *temp_v0;\n\n temp_v0 = &gCameraList[camIndex];\n temp_v0->screenLeft = arg1->x1;\n temp_v0->screenTop = arg1->y1;\n temp_v0->screenRight = arg1->x2;\n temp_v0->screenBottom = arg1->y2;\n}\n","score":0,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CameraScissorSet` — benchmark function marioparty3:CameraScissorSet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel CameraScissorSet\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$v0, $a0, 0x3\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x4\n lui\t$v1, %hi(gCameraList)\n lw\t$v1, %lo(gCameraList)($v1)\n addu\t$v0, $v0, $v1\n lwc1\t$f0, 0($a1)\n swc1\t$f0, 144($v0)\n lwc1\t$f0, 4($a1)\n swc1\t$f0, 148($v0)\n lwc1\t$f0, 8($a1)\n swc1\t$f0, 152($v0)\n lwc1\t$f0, 12($a1)\n jr\t$ra\n swc1\t$f0, 156($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-3f9d594d88fa.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid CameraScissorSet(s16 camIndex, RectF *arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CameraScissorSet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CameraScissorSet` — benchmark function marioparty3:CameraScissorSet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:CameraScissorSet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x3\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x2\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x4\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\taddu\tv0,v0,v1\n 28:\tlwc1\t$f0,0(a1)\n 2c:\tswc1\t$f0,144(v0)\n 30:\tlwc1\t$f0,4(a1)\n 34:\tswc1\t$f0,148(v0)\n 38:\tlwc1\t$f0,8(a1)\n 3c:\tswc1\t$f0,152(v0)\n 40:\tlwc1\t$f0,12(a1)\n 44:\tjr\tra\n 48:\tswc1\t$f0,156(v0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-333d6c1dd230dd41/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c CameraScissorSet\n00000000 *UND*\t00000000 gCameraList\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 gCameraList\n00000020 R_MIPS_LO16 gCameraList\n\n\nContents of section .text:\n 0000 00042400 00042403 000410c0 00441021 ..$...$......D.!\n 0010 00021080 00441023 00021100 3c030000 .....D.#....<...\n 0020 8c630000 00431021 c4a00000 e4400090 .c...C.!.....@..\n 0030 c4a00004 e4400094 c4a00008 e4400098 .....@.......@..\n 0040 c4a0000c 03e00008 e440009c 00000000 .........@......\nContents of section .reginfo:\n 0000 8000003c 00000000 00000001 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"CameraScissorSet\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name CameraScissorSet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8000F024_FC24:gcc2.7.2","sym":"func_8000F024_FC24","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","arithmetic"],"loc":5,"refSource":"void func_8000F024_FC24(void **pool, u16 size, u16 segment) {\n frameBufferPool = pool;\n frameBufferCount = size;\n frameBufferSegmentID = segment;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L225-L229","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsw\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tjr\tra\n 18:\tsh\ta2,0(at)\n 1c:\tnop\n","proto":{"func_8000F024_FC24":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f9d164df3a2c16f4/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_8000F024_FC24\n00000000 *UND*\t00000000 frameBufferPool\n00000000 *UND*\t00000000 frameBufferCount\n00000000 *UND*\t00000000 frameBufferSegmentID\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 frameBufferPool\n00000004 R_MIPS_LO16 frameBufferPool\n00000008 R_MIPS_HI16 frameBufferCount\n0000000c R_MIPS_LO16 frameBufferCount\n00000010 R_MIPS_HI16 frameBufferSegmentID\n00000018 R_MIPS_LO16 frameBufferSegmentID\n\n\nContents of section .text:\n 0000 3c010000 ac240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 03e00008 a4260000 00000000 <........&......\nContents of section .reginfo:\n 0000 80000072 00000000 00000000 00000000 ...r............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"frameBufferCount"},{"name":"frameBufferPool"},{"name":"frameBufferSegmentID"}],"outcome":"match","source":"void func_8000F024_FC24(u32 a0, u32 a1, u32 a2) {\n frameBufferPool = a0;\n frameBufferCount = a1;\n frameBufferSegmentID = a2;\n return;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"extern s16 frameBufferCount;\nextern s32 frameBufferPool;\nextern s16 frameBufferSegmentID;\n\nvoid func_8000F024_FC24(s32 arg0, s16 arg1, s16 arg2) {\n frameBufferPool = arg0;\n frameBufferCount = arg1;\n frameBufferSegmentID = arg2;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8000F024_FC24` — benchmark function marioparty3:func_8000F024_FC24:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F024_FC24\n lui\t$at, %hi(frameBufferPool)\n sw\t$a0, %lo(frameBufferPool)($at)\n lui\t$at, %hi(frameBufferCount)\n sh\t$a1, %lo(frameBufferCount)($at)\n lui\t$at, %hi(frameBufferSegmentID)\n jr\t$ra\n sh\t$a2, %lo(frameBufferSegmentID)($at)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F024_FC24 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F024_FC24` — benchmark function marioparty3:func_8000F024_FC24:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F024_FC24:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsw\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tjr\tra\n 18:\tsh\ta2,0(at)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f9d164df3a2c16f4/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_8000F024_FC24\n00000000 *UND*\t00000000 frameBufferPool\n00000000 *UND*\t00000000 frameBufferCount\n00000000 *UND*\t00000000 frameBufferSegmentID\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 frameBufferPool\n00000004 R_MIPS_LO16 frameBufferPool\n00000008 R_MIPS_HI16 frameBufferCount\n0000000c R_MIPS_LO16 frameBufferCount\n00000010 R_MIPS_HI16 frameBufferSegmentID\n00000018 R_MIPS_LO16 frameBufferSegmentID\n\n\nContents of section .text:\n 0000 3c010000 ac240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 03e00008 a4260000 00000000 <........&......\nContents of section .reginfo:\n 0000 80000072 00000000 00000000 00000000 ...r............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F024_FC24\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F024_FC24 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8000F04C_FC4C:gcc2.7.2","sym":"func_8000F04C_FC4C","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","global","arithmetic"],"loc":6,"refSource":"void func_8000F04C_FC4C(u64 **threadStacks) {\n gThread3Stack = *threadStacks++;\n gThreadOutStack = *threadStacks++;\n gThreadOutStackSize = *threadStacks++;\n gThreadYieldStack = *threadStacks;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L237-L242","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tlui\tat,0x0\n 8:\tsw\tv0,0(at)\n c:\taddiu\ta0,a0,4\n 10:\tlw\tv0,0(a0)\n 14:\tlui\tat,0x0\n 18:\tsw\tv0,0(at)\n 1c:\taddiu\ta0,a0,4\n 20:\tlw\tv0,0(a0)\n 24:\tlui\tat,0x0\n 28:\tsw\tv0,0(at)\n 2c:\tlw\tv0,4(a0)\n 30:\tlui\tat,0x0\n 34:\tjr\tra\n 38:\tsw\tv0,0(at)\n 3c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-5423b0a9a65c.i.gz","proto":{"func_8000F04C_FC4C":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-7e5035f793b0f45c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_8000F04C_FC4C\n00000000 *UND*\t00000000 gThread3Stack\n00000000 *UND*\t00000000 gThreadOutStack\n00000000 *UND*\t00000000 gThreadOutStackSize\n00000000 *UND*\t00000000 gThreadYieldStack\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 gThread3Stack\n00000008 R_MIPS_LO16 gThread3Stack\n00000014 R_MIPS_HI16 gThreadOutStack\n00000018 R_MIPS_LO16 gThreadOutStack\n00000024 R_MIPS_HI16 gThreadOutStackSize\n00000028 R_MIPS_LO16 gThreadOutStackSize\n00000030 R_MIPS_HI16 gThreadYieldStack\n00000038 R_MIPS_LO16 gThreadYieldStack\n\n\nContents of section .text:\n 0000 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0010 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0020 8c820000 3c010000 ac220000 8c820004 ....<....\"......\n 0030 3c010000 03e00008 ac220000 00000000 <........\"......\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gThread3Stack"},{"name":"gThreadOutStack"},{"name":"gThreadOutStackSize"},{"name":"gThreadYieldStack"}],"outcome":"nonmatch","source":"void func_8000F04C_FC4C(s32 * a0) {\n gThread3Stack = *a0;\n gThreadOutStack = *(a0 + 1);\n gThreadOutStackSize = *(a0 + 1 + 1);\n gThreadYieldStack = (a0 + 1 + 1)[1];\n return;\n}\n","score":5,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_8000F04C_FC4C(u64 **threadStacks) {\n u64 **temp_a0;\n\n gThread3Stack = threadStacks->unk0;\n temp_a0 = threadStacks + 4;\n gThreadOutStack = threadStacks->unk4;\n gThreadOutStackSize = temp_a0->unk4;\n gThreadYieldStack = (temp_a0 + 4)->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5517: request for member `unk0' in something not a structure or union","/c.i:5519: request for member `unk4' in something not a structure or union","/c.i:5520: request for member `unk4' in something not a structure or union","/c.i:5521: request for member `unk4' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":15,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8000F04C_FC4C` — benchmark function marioparty3:func_8000F04C_FC4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F04C_FC4C\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThread3Stack)\n sw\t$v0, %lo(gThread3Stack)($at)\n addiu\t$a0, $a0, 4\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThreadOutStack)\n sw\t$v0, %lo(gThreadOutStack)($at)\n addiu\t$a0, $a0, 4\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThreadOutStackSize)\n sw\t$v0, %lo(gThreadOutStackSize)($at)\n lw\t$v0, 4($a0)\n lui\t$at, %hi(gThreadYieldStack)\n jr\t$ra\n sw\t$v0, %lo(gThreadYieldStack)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-5423b0a9a65c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8000F04C_FC4C(u64 **threadStacks);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F04C_FC4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F04C_FC4C` — benchmark function marioparty3:func_8000F04C_FC4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F04C_FC4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tlui\tat,0x0\n 8:\tsw\tv0,0(at)\n c:\taddiu\ta0,a0,4\n 10:\tlw\tv0,0(a0)\n 14:\tlui\tat,0x0\n 18:\tsw\tv0,0(at)\n 1c:\taddiu\ta0,a0,4\n 20:\tlw\tv0,0(a0)\n 24:\tlui\tat,0x0\n 28:\tsw\tv0,0(at)\n 2c:\tlw\tv0,4(a0)\n 30:\tlui\tat,0x0\n 34:\tjr\tra\n 38:\tsw\tv0,0(at)\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-7e5035f793b0f45c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_8000F04C_FC4C\n00000000 *UND*\t00000000 gThread3Stack\n00000000 *UND*\t00000000 gThreadOutStack\n00000000 *UND*\t00000000 gThreadOutStackSize\n00000000 *UND*\t00000000 gThreadYieldStack\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 gThread3Stack\n00000008 R_MIPS_LO16 gThread3Stack\n00000014 R_MIPS_HI16 gThreadOutStack\n00000018 R_MIPS_LO16 gThreadOutStack\n00000024 R_MIPS_HI16 gThreadOutStackSize\n00000028 R_MIPS_LO16 gThreadOutStackSize\n00000030 R_MIPS_HI16 gThreadYieldStack\n00000038 R_MIPS_LO16 gThreadYieldStack\n\n\nContents of section .text:\n 0000 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0010 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0020 8c820000 3c010000 ac220000 8c820004 ....<....\"......\n 0030 3c010000 03e00008 ac220000 00000000 <........\"......\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F04C_FC4C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F04C_FC4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8000F088_FC88:gcc2.7.2","sym":"func_8000F088_FC88","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","global","arithmetic"],"loc":3,"refSource":"void func_8000F088_FC88(s32 *uCodeAdresses) {\n gUCodeAddresses = uCodeAdresses;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L245-L247","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsw\ta0,0(at)\n c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-c25019c2fe69.i.gz","proto":{"func_8000F088_FC88":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6e75782630e57f66/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8000F088_FC88\n00000000 *UND*\t00000000 gUCodeAddresses\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gUCodeAddresses\n00000008 R_MIPS_LO16 gUCodeAddresses\n\n\nContents of section .text:\n 0000 3c010000 03e00008 ac240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gUCodeAddresses"}],"outcome":"match","source":"void func_8000F088_FC88(u32 a0) {\n gUCodeAddresses = a0;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8000F088_FC88(s32 *uCodeAdresses) {\n gUCodeAddresses = uCodeAdresses;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8000F088_FC88` — benchmark function marioparty3:func_8000F088_FC88:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F088_FC88\n lui\t$at, %hi(gUCodeAddresses)\n jr\t$ra\n sw\t$a0, %lo(gUCodeAddresses)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-c25019c2fe69.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8000F088_FC88(s32 *uCodeAdresses);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F088_FC88 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F088_FC88` — benchmark function marioparty3:func_8000F088_FC88:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F088_FC88:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsw\ta0,0(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6e75782630e57f66/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8000F088_FC88\n00000000 *UND*\t00000000 gUCodeAddresses\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gUCodeAddresses\n00000008 R_MIPS_LO16 gUCodeAddresses\n\n\nContents of section .text:\n 0000 3c010000 03e00008 ac240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F088_FC88\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F088_FC88 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80011460_12060:gcc2.7.2","sym":"func_80011460_12060","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","loop","arithmetic"],"loc":13,"refSource":"s16 func_80011460_12060(u8 *arg0) {\n s32 sum = 0;\n s16 i = 1;\n u8 c = arg0[0];\n\n while (c != 0 && i < 28) {\n sum += i * c;\n arg0++;\n i++;\n c = arg0[0];\n }\n return sum;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfload.c#L31-L43","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\ta3,zero\n 4:\tli\ta2,1\n 8:\tlbu\tv0,0(a0)\n c:\tbeqz\tv0,54 \n 10:\tmove\ta1,v0\n 14:\tsll\tv0,a2,0x10\n 18:\tsra\tv0,v0,0x10\n 1c:\tmult\tv0,a1\n 20:\tmflo\tv0\n 24:\taddu\ta3,a3,v0\n 28:\taddiu\ta0,a0,1\n 2c:\taddiu\tv0,a2,1\n 30:\tmove\ta2,v0\n 34:\tlbu\ta1,0(a0)\n 38:\tsltu\tv1,zero,a1\n 3c:\tsll\tv0,v0,0x10\n 40:\tsra\tv0,v0,0x10\n 44:\tslti\tv0,v0,28\n 48:\tand\tv1,v1,v0\n 4c:\tbnezl\tv1,18 \n 50:\tsll\tv0,a2,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tjr\tra\n 5c:\tsra\tv0,v0,0x10\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-be8a3ce746675614/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80011460_12060\n\n\nContents of section .text:\n 0000 00003821 24060001 90820000 10400011 ..8!$........@..\n 0010 00402821 00061400 00021403 00450018 .@(!.........E..\n 0020 00001012 00e23821 24840001 24c20001 ......8!$...$...\n 0030 00403021 90850000 0005182b 00021400 .@0!.......+....\n 0040 00021403 2842001c 00621824 5460fff2 ....(B...b.$T`..\n 0050 00061400 00071400 03e00008 00021403 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80011460_12060' — lift: cannot lift 'func_80011460_12060': unmodelled control transfer 'bnezl' at 0x4c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\ta3,zero */\n/* 4:\tli\ta2,1 */\n/* 8:\tlbu\tv0,0(a0) */\n/* c:\tbeqz\tv0,54 */\n/* 10:\tmove\ta1,v0 */\n/* 14:\tsll\tv0,a2,0x10 */\n/* 18:\tsra\tv0,v0,0x10 */\n/* 1c:\tmult\tv0,a1 */\n/* 20:\tmflo\tv0 */\n/* 24:\taddu\ta3,a3,v0 */\n/* 28:\taddiu\ta0,a0,1 */\n/* 2c:\taddiu\tv0,a2,1 */\n/* 30:\tmove\ta2,v0 */\n/* 34:\tlbu\ta1,0(a0) */\n/* 38:\tsltu\tv1,zero,a1 */\n/* 3c:\tsll\tv0,v0,0x10 */\n/* 40:\tsra\tv0,v0,0x10 */\n/* 44:\tslti\tv0,v0,28 */\n/* 48:\tand\tv1,v1,v0 */\n/* 4c:\tbnezl\tv1,18 */\n/* 50:\tsll\tv0,a2,0x10 */\n/* 54:\tsll\tv0,a3,0x10 */\n/* 58:\tjr\tra */\n/* 5c:\tsra\tv0,v0,0x10 */\nvoid func_80011460_12060(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80011460_12060': unmodelled control transfer 'bnezl' at 0x4c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80011460_12060': unmodelled control transfer 'bnezl' at 0x4c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 func_80011460_12060(u8 *arg0) {\n s16 temp_v0_2;\n s16 var_a2;\n s16 var_a3;\n u8 *var_a0;\n u8 temp_v0;\n u8 var_a1;\n\n var_a0 = arg0;\n var_a3 = 0;\n var_a2 = 1;\n temp_v0 = *var_a0;\n var_a1 = temp_v0;\n if (temp_v0 != 0) {\n do {\n var_a3 += var_a2 * var_a1;\n var_a0 += 1;\n temp_v0_2 = var_a2 + 1;\n var_a2 = temp_v0_2;\n var_a1 = *var_a0;\n } while ((var_a1 != 0) & (temp_v0_2 < 0x1C));\n }\n return var_a3;\n}\n","score":4,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":23,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":24,"ratio":0.16666666666666666,"kinds":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80011460_12060` — benchmark function marioparty3:func_80011460_12060:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80011460_12060\n move\t$a3, $zero\n li\t$a2, 1\n lbu\t$v0, 0($a0)\n beqz\t$v0, .L54\n move\t$a1, $v0\n sll\t$v0, $a2, 0x10\n.L18:\n sra\t$v0, $v0, 0x10\n mult\t$v0, $a1\n mflo\t$v0\n addu\t$a3, $a3, $v0\n addiu\t$a0, $a0, 1\n addiu\t$v0, $a2, 1\n move\t$a2, $v0\n lbu\t$a1, 0($a0)\n sltu\t$v1, $zero, $a1\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 28\n and\t$v1, $v1, $v0\n bnezl\t$v1, .L18\n sll\t$v0, $a2, 0x10\n.L54:\n sll\t$v0, $a3, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80011460_12060 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80011460_12060` — benchmark function marioparty3:func_80011460_12060:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80011460_12060:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\ta3,zero\n 4:\tli\ta2,1\n 8:\tlbu\tv0,0(a0)\n c:\tbeqz\tv0,54 \n 10:\tmove\ta1,v0\n 14:\tsll\tv0,a2,0x10\n 18:\tsra\tv0,v0,0x10\n 1c:\tmult\tv0,a1\n 20:\tmflo\tv0\n 24:\taddu\ta3,a3,v0\n 28:\taddiu\ta0,a0,1\n 2c:\taddiu\tv0,a2,1\n 30:\tmove\ta2,v0\n 34:\tlbu\ta1,0(a0)\n 38:\tsltu\tv1,zero,a1\n 3c:\tsll\tv0,v0,0x10\n 40:\tsra\tv0,v0,0x10\n 44:\tslti\tv0,v0,28\n 48:\tand\tv1,v1,v0\n 4c:\tbnezl\tv1,18 \n 50:\tsll\tv0,a2,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tjr\tra\n 5c:\tsra\tv0,v0,0x10\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-be8a3ce746675614/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80011460_12060\n\n\nContents of section .text:\n 0000 00003821 24060001 90820000 10400011 ..8!$........@..\n 0010 00402821 00061400 00021403 00450018 .@(!.........E..\n 0020 00001012 00e23821 24840001 24c20001 ......8!$...$...\n 0030 00403021 90850000 0005182b 00021400 .@0!.......+....\n 0040 00021403 2842001c 00621824 5460fff2 ....(B...b.$T`..\n 0050 00061400 00071400 03e00008 00021403 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80011460_12060 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800123F4_12FF4:gcc2.7.2","sym":"func_800123F4_12FF4","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":3,"refSource":"void func_800123F4_12FF4(void) {\n D_800D418E_D4D8E = D_800D2008_D2C08;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L53-L55","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlbu\tv0,0(v0)\n 8:\tlui\tat,0x0\n c:\tjr\tra\n 10:\tsh\tv0,0(at)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-888e856682f4.i.gz","proto":{"func_800123F4_12FF4":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-05c12408f5e201a5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 func_800123F4_12FF4\n00000000 *UND*\t00000000 D_800D2008_D2C08\n00000000 *UND*\t00000000 D_800D418E_D4D8E\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D2008_D2C08\n00000004 R_MIPS_LO16 D_800D2008_D2C08\n00000008 R_MIPS_HI16 D_800D418E_D4D8E\n00000010 R_MIPS_LO16 D_800D418E_D4D8E\n\n\nContents of section .text:\n 0000 3c020000 90420000 3c010000 03e00008 <....B..<.......\n 0010 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000006 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800D2008_D2C08"},{"name":"D_800D418E_D4D8E"}],"outcome":"match","source":"void func_800123F4_12FF4(void) {\n D_800D418E_D4D8E = D_800D2008_D2C08;\n return;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_800123F4_12FF4(void) {\n D_800D418E_D4D8E = (s16) D_800D2008_D2C08;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800123F4_12FF4` — benchmark function marioparty3:func_800123F4_12FF4:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800123F4_12FF4\n lui\t$v0, %hi(D_800D2008_D2C08)\n lbu\t$v0, %lo(D_800D2008_D2C08)($v0)\n lui\t$at, %hi(D_800D418E_D4D8E)\n jr\t$ra\n sh\t$v0, %lo(D_800D418E_D4D8E)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-888e856682f4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800123F4_12FF4(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800123F4_12FF4 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800123F4_12FF4` — benchmark function marioparty3:func_800123F4_12FF4:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800123F4_12FF4:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlbu\tv0,0(v0)\n 8:\tlui\tat,0x0\n c:\tjr\tra\n 10:\tsh\tv0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-05c12408f5e201a5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 func_800123F4_12FF4\n00000000 *UND*\t00000000 D_800D2008_D2C08\n00000000 *UND*\t00000000 D_800D418E_D4D8E\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D2008_D2C08\n00000004 R_MIPS_LO16 D_800D2008_D2C08\n00000008 R_MIPS_HI16 D_800D418E_D4D8E\n00000010 R_MIPS_LO16 D_800D418E_D4D8E\n\n\nContents of section .text:\n 0000 3c020000 90420000 3c010000 03e00008 <....B..<.......\n 0010 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000006 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800123F4_12FF4\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800123F4_12FF4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8001D330_1DF30:gcc2.7.2","sym":"func_8001D330_1DF30","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":3,"refSource":"void func_8001D330_1DF30(s16 arg0) {\n D_800A0A78_A1678 = arg0;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfman.c#L525-L527","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsh\ta0,0(at)\n c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-f8dec0704e6a.i.gz","proto":{"func_8001D330_1DF30":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fda35e2082dacdbe/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8001D330_1DF30\n00000000 *UND*\t00000000 D_800A0A78_A1678\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800A0A78_A1678\n00000008 R_MIPS_LO16 D_800A0A78_A1678\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a4240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800A0A78_A1678"}],"outcome":"match","source":"void func_8001D330_1DF30(u32 a0) {\n D_800A0A78_A1678 = a0;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8001D330_1DF30(s16 arg0) {\n D_800A0A78_A1678 = arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8001D330_1DF30` — benchmark function marioparty3:func_8001D330_1DF30:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001D330_1DF30\n lui\t$at, %hi(D_800A0A78_A1678)\n jr\t$ra\n sh\t$a0, %lo(D_800A0A78_A1678)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-f8dec0704e6a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8001D330_1DF30(s16 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001D330_1DF30 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001D330_1DF30` — benchmark function marioparty3:func_8001D330_1DF30:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8001D330_1DF30:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsh\ta0,0(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fda35e2082dacdbe/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8001D330_1DF30\n00000000 *UND*\t00000000 D_800A0A78_A1678\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800A0A78_A1678\n00000008 R_MIPS_LO16 D_800A0A78_A1678\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a4240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001D330_1DF30\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001D330_1DF30 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8001FBBC_207BC:gcc2.7.2","sym":"func_8001FBBC_207BC","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","arithmetic"],"loc":10,"refSource":"void func_8001FBBC_207BC(s16 arg0, s8 arg1, s8 arg2, s8 arg3) {\n HmfModel *other;\n\n other = HmfModelData[arg0].unkB4;\n if (other != NULL) {\n other->unk00 = arg1;\n other->unk01 = arg2;\n other->unk02 = arg3;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfman.c#L615-L624","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tlui\tv1,0x0\n c:\tlw\tv1,0(v1)\n 10:\tsll\tv0,a0,0x1\n 14:\taddu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x6\n 1c:\taddu\tv0,v0,v1\n 20:\tlw\tv0,180(v0)\n 24:\tbeqz\tv0,38 \n 28:\tnop\n 2c:\tsb\ta1,0(v0)\n 30:\tsb\ta2,1(v0)\n 34:\tsb\ta3,2(v0)\n 38:\tjr\tra\n 3c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_8001FBBC_207BC":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ecb67d8ea63f745/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001FBBC_207BC\n00000000 *UND*\t00000000 HmfModelData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HmfModelData\n0000000c R_MIPS_LO16 HmfModelData\n\n\nContents of section .text:\n 0000 00042400 00042403 3c030000 8c630000 ..$...$.<....c..\n 0010 00041040 00441021 00021180 00431021 ...@.D.!.....C.!\n 0020 8c4200b4 10400004 00000000 a0450000 .B...@.......E..\n 0030 a0460001 a0470002 03e00008 00000000 .F...G..........\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[{"name":"HmfModelData","shape":"pointer"}],"outcome":"match","source":"struct Elem0 { u8 _pad0[180]; s32 field_180; u8 _pad1[8]; };\nvoid func_8001FBBC_207BC(s32 a0, s32 a1, s32 a2, s32 a3) {\n u8 * v0;\n v0 = (u8 *)((struct Elem0 *)HmfModelData)[a0 << 16 >> 16].field_180;\n if (v0 != 0) {\n *v0 = a1;\n v0[1] = a2;\n v0[2] = a3;\n }\n return;\n}\n","score":0,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8001FBBC_207BC(s16 arg0, s8 arg1, s8 arg2, s8 arg3) {\n HmfModel *temp_v0;\n\n temp_v0 = HmfModelData[arg0].unkB4;\n if (temp_v0 != NULL) {\n temp_v0->unk00 = arg1;\n temp_v0->unk01 = (u8) arg2;\n temp_v0->unk02 = (u8) arg3;\n }\n}\n","score":0,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8001FBBC_207BC` — benchmark function marioparty3:func_8001FBBC_207BC:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001FBBC_207BC\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n lui\t$v1, %hi(HmfModelData)\n lw\t$v1, %lo(HmfModelData)($v1)\n sll\t$v0, $a0, 0x1\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x6\n addu\t$v0, $v0, $v1\n lw\t$v0, 180($v0)\n beqz\t$v0, .L38\n nop\n sb\t$a1, 0($v0)\n sb\t$a2, 1($v0)\n sb\t$a3, 2($v0)\n.L38:\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8001FBBC_207BC(s16 arg0, s8 arg1, s8 arg2, s8 arg3);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001FBBC_207BC # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001FBBC_207BC` — benchmark function marioparty3:func_8001FBBC_207BC:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8001FBBC_207BC:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tlui\tv1,0x0\n c:\tlw\tv1,0(v1)\n 10:\tsll\tv0,a0,0x1\n 14:\taddu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x6\n 1c:\taddu\tv0,v0,v1\n 20:\tlw\tv0,180(v0)\n 24:\tbeqz\tv0,38 \n 28:\tnop\n 2c:\tsb\ta1,0(v0)\n 30:\tsb\ta2,1(v0)\n 34:\tsb\ta3,2(v0)\n 38:\tjr\tra\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ecb67d8ea63f745/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001FBBC_207BC\n00000000 *UND*\t00000000 HmfModelData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HmfModelData\n0000000c R_MIPS_LO16 HmfModelData\n\n\nContents of section .text:\n 0000 00042400 00042403 3c030000 8c630000 ..$...$.<....c..\n 0010 00041040 00441021 00021180 00431021 ...@.D.!.....C.!\n 0020 8c4200b4 10400004 00000000 a0450000 .B...@.......E..\n 0030 a0460001 a0470002 03e00008 00000000 .F...G..........\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001FBBC_207BC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001FBBC_207BC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8002FD48_30948:gcc2.7.2","sym":"func_8002FD48_30948","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","arithmetic"],"loc":3,"refSource":"void func_8002FD48_30948(HmfData *arg0) {\n arg0->unkA0 = 0;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/22EB0.c#L208-L210","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\tzero,160(a0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_8002FD48_30948":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ae562d6511b20a82/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_8002FD48_30948\n\n\nContents of section .text:\n 0000 03e00008 ac8000a0 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000010 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void func_8002FD48_30948(s32 * a0) {\n a0[40] = 0;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8002FD48_30948(HmfData *arg0) {\n arg0->unkA0 = 0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8002FD48_30948` — benchmark function marioparty3:func_8002FD48_30948:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002FD48_30948\n jr\t$ra\n sw\t$zero, 160($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8002FD48_30948(HmfData *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002FD48_30948 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002FD48_30948` — benchmark function marioparty3:func_8002FD48_30948:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8002FD48_30948:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\tzero,160(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ae562d6511b20a82/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_8002FD48_30948\n\n\nContents of section .text:\n 0000 03e00008 ac8000a0 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000010 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8002FD48_30948\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002FD48_30948 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80045314_45F14:gcc2.7.2","sym":"func_80045314_45F14","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["branch","arithmetic"],"loc":10,"refSource":"s32 func_80045314_45F14(void) {\n switch (omovl) {\n case 2:\n return 20;\n case 3:\n return -20;\n default:\n return 0;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/gamemes.c#L743-L752","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tli\tv0,2\n c:\tbeq\tv1,v0,24 \n 10:\tli\tv0,3\n 14:\tbeq\tv1,v0,28 \n 18:\tli\tv0,-20\n 1c:\tj\t28 \n 20:\tmove\tv0,zero\n 24:\tli\tv0,20\n 28:\tjr\tra\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fe5bd170329e178e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_80045314_45F14\n00000000 *UND*\t00000000 omovl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 omovl\n00000004 R_MIPS_LO16 omovl\n0000001c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 3c030000 8c630000 24020002 10620005 <....c..$....b..\n 0010 24020003 10620004 2402ffec 0800000a $....b..$.......\n 0020 00001021 24020014 03e00008 00000000 ...!$...........\nContents of section .reginfo:\n 0000 8000000c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"omovl"}],"outcome":"nonmatch","source":"s32 func_80045314_45F14(void) {\n s32 v0;\n if (omovl == 2) {\n v0 = 20;\n } else {\n if (omovl == 3) {\n v0 = -20;\n } else {\n v0 = 0;\n }\n }\n return v0;\n}\n","score":11,"maxScore":18,"compileErrors":null,"breakdown":{"insert":6,"delete":3,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":13,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern s32 omovl;\n\ns32 func_80045314_45F14(void) {\n s32 var_v0;\n\n if (omovl != 2) {\n var_v0 = -0x14;\n if (omovl != 3) {\n return 0;\n }\n /* Duplicate return node #4. Try simplifying control flow for better match */\n return var_v0;\n }\n var_v0 = 0x14;\n return var_v0;\n}\n","score":5,"maxScore":13,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":3,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":14,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":5,"maxScore":13,"ratio":0.38461538461538464,"kinds":{"insert":1,"delete":0,"replace":3,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80045314_45F14` — benchmark function marioparty3:func_80045314_45F14:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045314_45F14\n lui\t$v1, %hi(omovl)\n lw\t$v1, %lo(omovl)($v1)\n li\t$v0, 2\n beq\t$v1, $v0, .L24\n li\t$v0, 3\n beq\t$v1, $v0, .L28\n li\t$v0, -20\n j\t.L28\n move\t$v0, $zero\n.L24:\n li\t$v0, 20\n.L28:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045314_45F14 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045314_45F14` — benchmark function marioparty3:func_80045314_45F14:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045314_45F14:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tli\tv0,2\n c:\tbeq\tv1,v0,24 \n 10:\tli\tv0,3\n 14:\tbeq\tv1,v0,28 \n 18:\tli\tv0,-20\n 1c:\tj\t28 \n 20:\tmove\tv0,zero\n 24:\tli\tv0,20\n 28:\tjr\tra\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fe5bd170329e178e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_80045314_45F14\n00000000 *UND*\t00000000 omovl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 omovl\n00000004 R_MIPS_LO16 omovl\n0000001c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 3c030000 8c630000 24020002 10620005 <....c..$....b..\n 0010 24020003 10620004 2402ffec 0800000a $....b..$.......\n 0020 00001021 24020014 03e00008 00000000 ...!$...........\nContents of section .reginfo:\n 0000 8000000c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045314_45F14 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80045350_45F50:gcc2.7.2","sym":"func_80045350_45F50","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","loop","branch","global","arithmetic"],"loc":13,"refSource":"void func_80045350_45F50(void) {\n s32 var_v1;\n\n if (D_800A6D44_A7944[GwSystem.minigame_index - 1].minigameType == 6) {\n return;\n }\n for (var_v1 = 0; var_v1 < 4; var_v1++) {\n GW_PLAYER *temp_v0 = &GwPlayer[var_v1];\n\n temp_v0->gameCoin = 0;\n temp_v0->bonusCoin = 0;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/pause.c#L61-L73","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlb\tv1,16(v1)\n 8:\taddiu\tv1,v1,-1\n c:\tsll\tv0,v1,0x2\n 10:\taddu\tv0,v0,v1\n 14:\tsll\tv0,v0,0x2\n 18:\tlui\tv1,0x0\n 1c:\taddu\tv1,v1,v0\n 20:\tlbu\tv1,0(v1)\n 24:\tli\tv0,6\n 28:\tbeq\tv1,v0,64 \n 2c:\tnop\n 30:\tmove\tv1,zero\n 34:\tlui\ta0,0x0\n 38:\taddiu\ta0,a0,0\n 3c:\tsll\tv0,v1,0x3\n 40:\tsubu\tv0,v0,v1\n 44:\tsll\tv0,v0,0x3\n 48:\taddu\tv0,v0,a0\n 4c:\tsh\tzero,6(v0)\n 50:\tsh\tzero,8(v0)\n 54:\taddiu\tv1,v1,1\n 58:\tslti\tv0,v1,4\n 5c:\tbnez\tv0,40 \n 60:\tsll\tv0,v1,0x3\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-a3d2d0baeda1.i.gz","proto":{"func_80045350_45F50":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-42758b8683c841eb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80045350_45F50\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 D_800A6D44_A7944\n00000000 *UND*\t00000000 GwPlayer\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000004 R_MIPS_LO16 GwSystem\n00000018 R_MIPS_HI16 D_800A6D44_A7944\n00000020 R_MIPS_LO16 D_800A6D44_A7944\n00000034 R_MIPS_HI16 GwPlayer\n00000038 R_MIPS_LO16 GwPlayer\n\n\nContents of section .text:\n 0000 3c030000 80630010 2463ffff 00031080 <....c..$c......\n 0010 00431021 00021080 3c030000 00621821 .C.!....<....b.!\n 0020 90630000 24020006 1062000e 00000000 .c..$....b......\n 0030 00001821 3c040000 24840000 000310c0 ...!<...$.......\n 0040 00431023 000210c0 00441021 a4400006 .C.#.....D.!.@..\n 0050 a4400008 24630001 28620004 1440fff8 .@..$c..(b...@..\n 0060 000310c0 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80045350_45F50' — lift: cannot lift 'func_80045350_45F50': %hi(D_800A6D44_A7944) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlui\tv1,0x0 */\n/* 4:\tlb\tv1,16(v1) */\n/* 8:\taddiu\tv1,v1,-1 */\n/* c:\tsll\tv0,v1,0x2 */\n/* 10:\taddu\tv0,v0,v1 */\n/* 14:\tsll\tv0,v0,0x2 */\n/* 18:\tlui\tv1,0x0 */\n/* 1c:\taddu\tv1,v1,v0 */\n/* 20:\tlbu\tv1,0(v1) */\n/* 24:\tli\tv0,6 */\n/* 28:\tbeq\tv1,v0,64 */\n/* 2c:\tnop */\n/* 30:\tmove\tv1,zero */\n/* 34:\tlui\ta0,0x0 */\n/* 38:\taddiu\ta0,a0,0 */\n/* 3c:\tsll\tv0,v1,0x3 */\n/* 40:\tsubu\tv0,v0,v1 */\n/* 44:\tsll\tv0,v0,0x3 */\n/* 48:\taddu\tv0,v0,a0 */\n/* 4c:\tsh\tzero,6(v0) */\n/* 50:\tsh\tzero,8(v0) */\n/* 54:\taddiu\tv1,v1,1 */\n/* 58:\tslti\tv0,v1,4 */\n/* 5c:\tbnez\tv0,40 */\n/* 60:\tsll\tv0,v1,0x3 */\n/* 64:\tjr\tra */\n/* 68:\tnop */\n/* 6c:\tnop */\nvoid func_80045350_45F50(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80045350_45F50': %hi(D_800A6D44_A7944) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":36,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80045350_45F50': %hi(D_800A6D44_A7944) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_80045350_45F50(void) {\n s32 var_v0;\n s32 var_v1;\n void *temp_v0;\n\n if (D_800A6D44_A7944[GwSystem.playMode - 1].minigameType != 6) {\n var_v1 = 0;\n var_v0 = 0 * 8;\n do {\n temp_v0 = ((var_v0 - var_v1) * 8) + GwPlayer;\n temp_v0->unk6 = 0;\n temp_v0->unk8 = 0;\n var_v1 += 1;\n var_v0 = var_v1 * 8;\n } while (var_v1 < 4);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":16,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5521: warning: dereferencing `void *' pointer","/c.i:5521: request for member `unk6' in something not a structure or union","/c.i:5522: warning: dereferencing `void *' pointer","/c.i:5522: request for member `unk8' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80045350_45F50` — benchmark function marioparty3:func_80045350_45F50:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045350_45F50\n lui\t$v1, %hi(GwSystem)\n lb\t$v1, %lo(GwSystem)($v1)\n addiu\t$v1, $v1, -1\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_800A6D44_A7944)\n addu\t$v1, $v1, $v0\n lbu\t$v1, %lo(D_800A6D44_A7944)($v1)\n li\t$v0, 6\n beq\t$v1, $v0, .L64\n nop\n move\t$v1, $zero\n lui\t$a0, %hi(GwPlayer)\n addiu\t$a0, $a0, %lo(GwPlayer)\n sll\t$v0, $v1, 0x3\n.L40:\n subu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x3\n addu\t$v0, $v0, $a0\n sh\t$zero, 6($v0)\n sh\t$zero, 8($v0)\n addiu\t$v1, $v1, 1\n slti\t$v0, $v1, 4\n bnez\t$v0, .L40\n sll\t$v0, $v1, 0x3\n.L64:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-a3d2d0baeda1.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80045350_45F50(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045350_45F50 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045350_45F50` — benchmark function marioparty3:func_80045350_45F50:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045350_45F50:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlb\tv1,16(v1)\n 8:\taddiu\tv1,v1,-1\n c:\tsll\tv0,v1,0x2\n 10:\taddu\tv0,v0,v1\n 14:\tsll\tv0,v0,0x2\n 18:\tlui\tv1,0x0\n 1c:\taddu\tv1,v1,v0\n 20:\tlbu\tv1,0(v1)\n 24:\tli\tv0,6\n 28:\tbeq\tv1,v0,64 \n 2c:\tnop\n 30:\tmove\tv1,zero\n 34:\tlui\ta0,0x0\n 38:\taddiu\ta0,a0,0\n 3c:\tsll\tv0,v1,0x3\n 40:\tsubu\tv0,v0,v1\n 44:\tsll\tv0,v0,0x3\n 48:\taddu\tv0,v0,a0\n 4c:\tsh\tzero,6(v0)\n 50:\tsh\tzero,8(v0)\n 54:\taddiu\tv1,v1,1\n 58:\tslti\tv0,v1,4\n 5c:\tbnez\tv0,40 \n 60:\tsll\tv0,v1,0x3\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-42758b8683c841eb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80045350_45F50\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 D_800A6D44_A7944\n00000000 *UND*\t00000000 GwPlayer\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000004 R_MIPS_LO16 GwSystem\n00000018 R_MIPS_HI16 D_800A6D44_A7944\n00000020 R_MIPS_LO16 D_800A6D44_A7944\n00000034 R_MIPS_HI16 GwPlayer\n00000038 R_MIPS_LO16 GwPlayer\n\n\nContents of section .text:\n 0000 3c030000 80630010 2463ffff 00031080 <....c..$c......\n 0010 00431021 00021080 3c030000 00621821 .C.!....<....b.!\n 0020 90630000 24020006 1062000e 00000000 .c..$....b......\n 0030 00001821 3c040000 24840000 000310c0 ...!<...$.......\n 0040 00431023 000210c0 00441021 a4400006 .C.#.....D.!.@..\n 0050 a4400008 24630001 28620004 1440fff8 .@..$c..(b...@..\n 0060 000310c0 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80045350_45F50\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045350_45F50 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80045BF0_467F0:gcc2.7.2","sym":"func_80045BF0_467F0","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["loop","branch","global","arithmetic"],"loc":14,"refSource":"s32 func_80045BF0_467F0(s32 arg0) {\n u32 var_v0;\n u32 var_v1;\n\n for (var_v1 = 0; var_v1 < 9; var_v1++) {\n if ((arg0 & 0xFF) == D_800A1590_A2190[var_v1]) {\n break;\n }\n }\n if (var_v1 >= 9) {\n var_v1 = -1;\n }\n return var_v1;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/pause.c#L217-L230","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tandi\ta0,a0,0xff\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,v1\n 10:\tlbu\tv0,0(v0)\n 14:\tbeq\ta0,v0,2c \n 18:\tsltiu\tv0,v1,9\n 1c:\taddiu\tv1,v1,1\n 20:\tsltiu\tv0,v1,9\n 24:\tbnez\tv0,8 \n 28:\tnop\n 2c:\tbeqzl\tv0,34 \n 30:\tli\tv1,-1\n 34:\tjr\tra\n 38:\tmove\tv0,v1\n 3c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-60e502c4aebd.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a29f6a37f2d335f7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_80045BF0_467F0\n00000000 *UND*\t00000000 D_800A1590_A2190\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800A1590_A2190\n00000010 R_MIPS_LO16 D_800A1590_A2190\n\n\nContents of section .text:\n 0000 00001821 308400ff 3c020000 00431021 ...!0...<....C.!\n 0010 90420000 10820005 2c620009 24630001 .B......,b..$c..\n 0020 2c620009 1440fff8 00000000 50400001 ,b...@......P@..\n 0030 2403ffff 03e00008 00601021 00000000 $........`.!....\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80045BF0_467F0' — lift: cannot lift 'func_80045BF0_467F0': unmodelled control transfer 'beqzl' at 0x2c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tandi\ta0,a0,0xff */\n/* 8:\tlui\tv0,0x0 */\n/* c:\taddu\tv0,v0,v1 */\n/* 10:\tlbu\tv0,0(v0) */\n/* 14:\tbeq\ta0,v0,2c */\n/* 18:\tsltiu\tv0,v1,9 */\n/* 1c:\taddiu\tv1,v1,1 */\n/* 20:\tsltiu\tv0,v1,9 */\n/* 24:\tbnez\tv0,8 */\n/* 28:\tnop */\n/* 2c:\tbeqzl\tv0,34 */\n/* 30:\tli\tv1,-1 */\n/* 34:\tjr\tra */\n/* 38:\tmove\tv0,v1 */\n/* 3c:\tnop */\nvoid func_80045BF0_467F0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80045BF0_467F0': unmodelled control transfer 'beqzl' at 0x2c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":24,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80045BF0_467F0': unmodelled control transfer 'beqzl' at 0x2c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 func_80045BF0_467F0(s32 arg0) {\n s32 var_v0;\n u32 var_v1;\n\n var_v1 = 0;\nloop_1:\n var_v0 = var_v1 < 9U;\n if ((arg0 & 0xFF) != D_800A1590_A2190[var_v1]) {\n var_v1 += 1;\n var_v0 = var_v1 < 9U;\n if (var_v0 != 0) {\n goto loop_1;\n }\n }\n if (var_v0 == 0) {\n var_v1 = -1U;\n }\n return (s32) var_v1;\n}\n","score":11,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":11},"quality":{"score":88,"lines":18,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":11,"maxScore":15,"ratio":0.7333333333333333,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80045BF0_467F0` — benchmark function marioparty3:func_80045BF0_467F0:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045BF0_467F0\n move\t$v1, $zero\n andi\t$a0, $a0, 0xff\n.L8:\n lui\t$v0, %hi(D_800A1590_A2190)\n addu\t$v0, $v0, $v1\n lbu\t$v0, %lo(D_800A1590_A2190)($v0)\n beq\t$a0, $v0, .L2c\n sltiu\t$v0, $v1, 9\n addiu\t$v1, $v1, 1\n sltiu\t$v0, $v1, 9\n bnez\t$v0, .L8\n nop\n.L2c:\n beqzl\t$v0, .L34\n li\t$v1, -1\n.L34:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-60e502c4aebd.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 func_80045BF0_467F0(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045BF0_467F0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045BF0_467F0` — benchmark function marioparty3:func_80045BF0_467F0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045BF0_467F0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tandi\ta0,a0,0xff\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,v1\n 10:\tlbu\tv0,0(v0)\n 14:\tbeq\ta0,v0,2c \n 18:\tsltiu\tv0,v1,9\n 1c:\taddiu\tv1,v1,1\n 20:\tsltiu\tv0,v1,9\n 24:\tbnez\tv0,8 \n 28:\tnop\n 2c:\tbeqzl\tv0,34 \n 30:\tli\tv1,-1\n 34:\tjr\tra\n 38:\tmove\tv0,v1\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a29f6a37f2d335f7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_80045BF0_467F0\n00000000 *UND*\t00000000 D_800A1590_A2190\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800A1590_A2190\n00000010 R_MIPS_LO16 D_800A1590_A2190\n\n\nContents of section .text:\n 0000 00001821 308400ff 3c020000 00431021 ...!0...<....C.!\n 0010 90420000 10820005 2c620009 24630001 .B......,b..$c..\n 0020 2c620009 1440fff8 00000000 50400001 ,b...@......P@..\n 0030 2403ffff 03e00008 00601021 00000000 $........`.!....\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045BF0_467F0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80047E90_48A90:gcc2.7.2","sym":"func_80047E90_48A90","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","arithmetic"],"loc":3,"refSource":"void func_80047E90_48A90(omObjData *obj, s32 arg1) {\n obj->unk10 |= arg1;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L516-L518","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,16(a0)\n 4:\tor\ta1,a1,v0\n 8:\tjr\tra\n c:\tsw\ta1,16(a0)\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_80047E90_48A90":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-18006fbfe679d559/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_80047E90_48A90\n\n\nContents of section .text:\n 0000 8c820010 00a22825 03e00008 ac850010 ......(%........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void func_80047E90_48A90(s32 * a0, u32 a1) {\n a0[4] = a1 | a0[4];\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_80047E90_48A90(omObjData *obj, s32 arg1) {\n obj->unk10 |= arg1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80047E90_48A90` — benchmark function marioparty3:func_80047E90_48A90:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80047E90_48A90\n lw\t$v0, 16($a0)\n or\t$a1, $a1, $v0\n jr\t$ra\n sw\t$a1, 16($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80047E90_48A90(omObjData *obj, s32 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80047E90_48A90 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80047E90_48A90` — benchmark function marioparty3:func_80047E90_48A90:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80047E90_48A90:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,16(a0)\n 4:\tor\ta1,a1,v0\n 8:\tjr\tra\n c:\tsw\ta1,16(a0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-18006fbfe679d559/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_80047E90_48A90\n\n\nContents of section .text:\n 0000 8c820010 00a22825 03e00008 ac850010 ......(%........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80047E90_48A90\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80047E90_48A90 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8004A444_4B044:gcc2.7.2","sym":"func_8004A444_4B044","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":5,"refSource":"void func_8004A444_4B044(s32 arg0) {\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n D_800D1710_D2310 = arg0;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L1053-L1057","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tlui\tat,0x0\n 8:\tsh\tv0,0(at)\n c:\tli\tv0,4\n 10:\tlui\tat,0x0\n 14:\tsh\tv0,0(at)\n 18:\tlui\tat,0x0\n 1c:\tjr\tra\n 20:\tsb\ta0,0(at)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-36a64acb471a.i.gz","proto":{"func_8004A444_4B044":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-74d5e58386117089/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 func_8004A444_4B044\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n00000000 *UND*\t00000000 D_800D1710_D2310\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 D_800A1780_A2380\n00000008 R_MIPS_LO16 D_800A1780_A2380\n00000010 R_MIPS_HI16 D_800D0A3A_D163A\n00000014 R_MIPS_LO16 D_800D0A3A_D163A\n00000018 R_MIPS_HI16 D_800D1710_D2310\n00000020 R_MIPS_LO16 D_800D1710_D2310\n\n\nContents of section .text:\n 0000 24020001 3c010000 a4220000 24020004 $...<....\"..$...\n 0010 3c010000 a4220000 3c010000 03e00008 <....\"..<.......\n 0020 a0240000 00000000 00000000 00000000 .$..............\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800A1780_A2380"},{"name":"D_800D0A3A_D163A"},{"name":"D_800D1710_D2310"}],"outcome":"match","source":"void func_8004A444_4B044(u32 a0) {\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n D_800D1710_D2310 = a0;\n return;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8004A444_4B044(s32 arg0) {\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n D_800D1710_D2310 = (s8) arg0;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8004A444_4B044` — benchmark function marioparty3:func_8004A444_4B044:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8004A444_4B044\n li\t$v0, 1\n lui\t$at, %hi(D_800A1780_A2380)\n sh\t$v0, %lo(D_800A1780_A2380)($at)\n li\t$v0, 4\n lui\t$at, %hi(D_800D0A3A_D163A)\n sh\t$v0, %lo(D_800D0A3A_D163A)($at)\n lui\t$at, %hi(D_800D1710_D2310)\n jr\t$ra\n sb\t$a0, %lo(D_800D1710_D2310)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-36a64acb471a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8004A444_4B044(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8004A444_4B044 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8004A444_4B044` — benchmark function marioparty3:func_8004A444_4B044:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8004A444_4B044:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tlui\tat,0x0\n 8:\tsh\tv0,0(at)\n c:\tli\tv0,4\n 10:\tlui\tat,0x0\n 14:\tsh\tv0,0(at)\n 18:\tlui\tat,0x0\n 1c:\tjr\tra\n 20:\tsb\ta0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-74d5e58386117089/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 func_8004A444_4B044\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n00000000 *UND*\t00000000 D_800D1710_D2310\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 D_800A1780_A2380\n00000008 R_MIPS_LO16 D_800A1780_A2380\n00000010 R_MIPS_HI16 D_800D0A3A_D163A\n00000014 R_MIPS_LO16 D_800D0A3A_D163A\n00000018 R_MIPS_HI16 D_800D1710_D2310\n00000020 R_MIPS_LO16 D_800D1710_D2310\n\n\nContents of section .text:\n 0000 24020001 3c010000 a4220000 24020004 $...<....\"..$...\n 0010 3c010000 a4220000 3c010000 03e00008 <....\"..<.......\n 0020 a0240000 00000000 00000000 00000000 .$..............\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8004A444_4B044\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8004A444_4B044 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8004A468_4B068:gcc2.7.2","sym":"func_8004A468_4B068","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":7,"refSource":"void func_8004A468_4B068(u16 arg0, u16 arg1, u16 arg2) {\n D_800D4082_D4C82 = arg0;\n D_800CD2F4_CDEF4 = arg1;\n D_800D6A56_D7656 = arg2;\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L1059-L1065","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsh\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tsh\ta2,0(at)\n 18:\tli\tv0,1\n 1c:\tlui\tat,0x0\n 20:\tsh\tv0,0(at)\n 24:\tli\tv0,4\n 28:\tlui\tat,0x0\n 2c:\tjr\tra\n 30:\tsh\tv0,0(at)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-568fac34e668.i.gz","proto":{"func_8004A468_4B068":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-de11bb2b49be74db/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8004A468_4B068\n00000000 *UND*\t00000000 D_800D4082_D4C82\n00000000 *UND*\t00000000 D_800CD2F4_CDEF4\n00000000 *UND*\t00000000 D_800D6A56_D7656\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D4082_D4C82\n00000004 R_MIPS_LO16 D_800D4082_D4C82\n00000008 R_MIPS_HI16 D_800CD2F4_CDEF4\n0000000c R_MIPS_LO16 D_800CD2F4_CDEF4\n00000010 R_MIPS_HI16 D_800D6A56_D7656\n00000014 R_MIPS_LO16 D_800D6A56_D7656\n0000001c R_MIPS_HI16 D_800A1780_A2380\n00000020 R_MIPS_LO16 D_800A1780_A2380\n00000028 R_MIPS_HI16 D_800D0A3A_D163A\n00000030 R_MIPS_LO16 D_800D0A3A_D163A\n\n\nContents of section .text:\n 0000 3c010000 a4240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 a4260000 24020001 3c010000 <....&..$...<...\n 0020 a4220000 24020004 3c010000 03e00008 .\"..$...<.......\n 0030 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800A1780_A2380"},{"name":"D_800CD2F4_CDEF4"},{"name":"D_800D0A3A_D163A"},{"name":"D_800D4082_D4C82"},{"name":"D_800D6A56_D7656"}],"outcome":"match","source":"void func_8004A468_4B068(u32 a0, u32 a1, u32 a2) {\n D_800D4082_D4C82 = a0;\n D_800CD2F4_CDEF4 = a1;\n D_800D6A56_D7656 = a2;\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n return;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8004A468_4B068(u16 arg0, u16 arg1, u16 arg2) {\n D_800D4082_D4C82 = arg0;\n D_800CD2F4_CDEF4 = arg1;\n D_800D6A56_D7656 = arg2;\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8004A468_4B068` — benchmark function marioparty3:func_8004A468_4B068:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8004A468_4B068\n lui\t$at, %hi(D_800D4082_D4C82)\n sh\t$a0, %lo(D_800D4082_D4C82)($at)\n lui\t$at, %hi(D_800CD2F4_CDEF4)\n sh\t$a1, %lo(D_800CD2F4_CDEF4)($at)\n lui\t$at, %hi(D_800D6A56_D7656)\n sh\t$a2, %lo(D_800D6A56_D7656)($at)\n li\t$v0, 1\n lui\t$at, %hi(D_800A1780_A2380)\n sh\t$v0, %lo(D_800A1780_A2380)($at)\n li\t$v0, 4\n lui\t$at, %hi(D_800D0A3A_D163A)\n jr\t$ra\n sh\t$v0, %lo(D_800D0A3A_D163A)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-568fac34e668.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8004A468_4B068(u16 arg0, u16 arg1, u16 arg2);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8004A468_4B068 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8004A468_4B068` — benchmark function marioparty3:func_8004A468_4B068:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8004A468_4B068:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsh\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tsh\ta2,0(at)\n 18:\tli\tv0,1\n 1c:\tlui\tat,0x0\n 20:\tsh\tv0,0(at)\n 24:\tli\tv0,4\n 28:\tlui\tat,0x0\n 2c:\tjr\tra\n 30:\tsh\tv0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-de11bb2b49be74db/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8004A468_4B068\n00000000 *UND*\t00000000 D_800D4082_D4C82\n00000000 *UND*\t00000000 D_800CD2F4_CDEF4\n00000000 *UND*\t00000000 D_800D6A56_D7656\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D4082_D4C82\n00000004 R_MIPS_LO16 D_800D4082_D4C82\n00000008 R_MIPS_HI16 D_800CD2F4_CDEF4\n0000000c R_MIPS_LO16 D_800CD2F4_CDEF4\n00000010 R_MIPS_HI16 D_800D6A56_D7656\n00000014 R_MIPS_LO16 D_800D6A56_D7656\n0000001c R_MIPS_HI16 D_800A1780_A2380\n00000020 R_MIPS_LO16 D_800A1780_A2380\n00000028 R_MIPS_HI16 D_800D0A3A_D163A\n00000030 R_MIPS_LO16 D_800D0A3A_D163A\n\n\nContents of section .text:\n 0000 3c010000 a4240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 a4260000 24020001 3c010000 <....&..$...<...\n 0020 a4220000 24020004 3c010000 03e00008 .\"..$...<.......\n 0030 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8004A468_4B068\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8004A468_4B068 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80052E14_53A14:gcc2.7.2","sym":"func_80052E14_53A14","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","arithmetic"],"loc":13,"refSource":"void func_80052E14_53A14(HuSprite *arg0) {\n arg0->unk_68.unk00 = arg0->unk_84;\n arg0->unk_68.unk04 = arg0->unk_88;\n arg0->unk_68.unk06 = arg0->unk_0E;\n arg0->unk_68.unk0A = arg0->unk_8A;\n arg0->unk_68.unk08 = arg0->unk_0C;\n arg0->unk_68.unk0C = arg0->unk_8C;\n arg0->unk_68.unk10 = arg0->unk_10;\n arg0->unk_68.unk16 = arg0->unk_92;\n arg0->unk_68.unk14 = arg0->unk_90;\n arg0->unk_68.unk18 = 0;\n arg0->unk_68.unk17 = 0;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L213-L225","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,132(a0)\n 4:\tsw\tv0,104(a0)\n 8:\tlbu\tv0,136(a0)\n c:\tsb\tv0,108(a0)\n 10:\tlhu\tv0,14(a0)\n 14:\tsh\tv0,110(a0)\n 18:\tlhu\tv0,138(a0)\n 1c:\tsh\tv0,114(a0)\n 20:\tlhu\tv0,12(a0)\n 24:\tsh\tv0,112(a0)\n 28:\tlwc1\t$f0,140(a0)\n 2c:\tswc1\t$f0,116(a0)\n 30:\tlwc1\t$f0,16(a0)\n 34:\tswc1\t$f0,120(a0)\n 38:\tlbu\tv0,146(a0)\n 3c:\tsb\tv0,126(a0)\n 40:\tlhu\tv0,144(a0)\n 44:\tsh\tv0,124(a0)\n 48:\tsb\tzero,128(a0)\n 4c:\tjr\tra\n 50:\tsb\tzero,127(a0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_80052E14_53A14":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-175e7c1a4c54ca05/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80052E14_53A14\n\n\nContents of section .text:\n 0000 8c820084 ac820068 90820088 a082006c .......h.......l\n 0010 9482000e a482006e 9482008a a4820072 .......n.......r\n 0020 9482000c a4820070 c480008c e4800074 .......p.......t\n 0030 c4800010 e4800078 90820092 a082007e .......x.......~\n 0040 94820090 a482007c a0800080 03e00008 .......|........\n 0050 a080007f 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80052E14_53A14' — lift: cannot lift 'func_80052E14_53A14 @0x28': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlw\tv0,132(a0) */\n/* 4:\tsw\tv0,104(a0) */\n/* 8:\tlbu\tv0,136(a0) */\n/* c:\tsb\tv0,108(a0) */\n/* 10:\tlhu\tv0,14(a0) */\n/* 14:\tsh\tv0,110(a0) */\n/* 18:\tlhu\tv0,138(a0) */\n/* 1c:\tsh\tv0,114(a0) */\n/* 20:\tlhu\tv0,12(a0) */\n/* 24:\tsh\tv0,112(a0) */\n/* 28:\tlwc1\t$f0,140(a0) */\n/* 2c:\tswc1\t$f0,116(a0) */\n/* 30:\tlwc1\t$f0,16(a0) */\n/* 34:\tswc1\t$f0,120(a0) */\n/* 38:\tlbu\tv0,146(a0) */\n/* 3c:\tsb\tv0,126(a0) */\n/* 40:\tlhu\tv0,144(a0) */\n/* 44:\tsh\tv0,124(a0) */\n/* 48:\tsb\tzero,128(a0) */\n/* 4c:\tjr\tra */\n/* 50:\tsb\tzero,127(a0) */\n/* \t... */\nvoid func_80052E14_53A14(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80052E14_53A14 @0x28': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":30,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80052E14_53A14 @0x28': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_80052E14_53A14(HuSprite *arg0) {\n arg0->unk_68.unk00 = arg0->unk_84;\n arg0->unk_68.unk04 = (u8) arg0->unk_88;\n arg0->unk_68.unk06 = (s16) (u16) arg0->unk_0E;\n arg0->unk_68.unk0A = (s16) (u16) arg0->unk_8A;\n arg0->unk_68.unk08 = (s16) (u16) arg0->unk_0C;\n arg0->unk_68.unk0C = arg0->unk_8C;\n arg0->unk_68.unk10 = arg0->unk_10;\n arg0->unk_68.unk16 = (u8) arg0->unk_92;\n arg0->unk_68.unk14 = (s16) (u16) arg0->unk_90;\n arg0->unk_68.unk18 = 0;\n arg0->unk_68.unk17 = 0;\n}\n","score":0,"maxScore":21,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":88,"lines":13,"gotos":0,"casts":10,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80052E14_53A14` — benchmark function marioparty3:func_80052E14_53A14:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80052E14_53A14\n lw\t$v0, 132($a0)\n sw\t$v0, 104($a0)\n lbu\t$v0, 136($a0)\n sb\t$v0, 108($a0)\n lhu\t$v0, 14($a0)\n sh\t$v0, 110($a0)\n lhu\t$v0, 138($a0)\n sh\t$v0, 114($a0)\n lhu\t$v0, 12($a0)\n sh\t$v0, 112($a0)\n lwc1\t$f0, 140($a0)\n swc1\t$f0, 116($a0)\n lwc1\t$f0, 16($a0)\n swc1\t$f0, 120($a0)\n lbu\t$v0, 146($a0)\n sb\t$v0, 126($a0)\n lhu\t$v0, 144($a0)\n sh\t$v0, 124($a0)\n sb\t$zero, 128($a0)\n jr\t$ra\n sb\t$zero, 127($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80052E14_53A14(HuSprite *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80052E14_53A14 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80052E14_53A14` — benchmark function marioparty3:func_80052E14_53A14:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80052E14_53A14:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,132(a0)\n 4:\tsw\tv0,104(a0)\n 8:\tlbu\tv0,136(a0)\n c:\tsb\tv0,108(a0)\n 10:\tlhu\tv0,14(a0)\n 14:\tsh\tv0,110(a0)\n 18:\tlhu\tv0,138(a0)\n 1c:\tsh\tv0,114(a0)\n 20:\tlhu\tv0,12(a0)\n 24:\tsh\tv0,112(a0)\n 28:\tlwc1\t$f0,140(a0)\n 2c:\tswc1\t$f0,116(a0)\n 30:\tlwc1\t$f0,16(a0)\n 34:\tswc1\t$f0,120(a0)\n 38:\tlbu\tv0,146(a0)\n 3c:\tsb\tv0,126(a0)\n 40:\tlhu\tv0,144(a0)\n 44:\tsh\tv0,124(a0)\n 48:\tsb\tzero,128(a0)\n 4c:\tjr\tra\n 50:\tsb\tzero,127(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-175e7c1a4c54ca05/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80052E14_53A14\n\n\nContents of section .text:\n 0000 8c820084 ac820068 90820088 a082006c .......h.......l\n 0010 9482000e a482006e 9482008a a4820072 .......n.......r\n 0020 9482000c a4820070 c480008c e4800074 .......p.......t\n 0030 c4800010 e4800078 90820092 a082007e .......x.......~\n 0040 94820090 a482007c a0800080 03e00008 .......|........\n 0050 a080007f 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80052E14_53A14\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80052E14_53A14 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800560D8_56CD8:gcc2.7.2","sym":"func_800560D8_56CD8","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","arithmetic"],"loc":3,"refSource":"HuSprite_Unk84_Unk00_Struct *func_800560D8_56CD8(s16 arg0, u16 arg1) {\n return &D_800C9530_CA130[arg0]->unk00[arg1];\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L636-L638","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\tjr\tra\n 2c:\taddu\tv0,v0,v1\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ccfed22fe178e2d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_800560D8_56CD8\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 03e00008 00431021 .....c.......C.!\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800560D8_56CD8' — lift: cannot lift 'func_800560D8_56CD8': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsll\ta0,a0,0x10 */\n/* 4:\tsra\ta0,a0,0xe */\n/* 8:\tlui\tv1,0x0 */\n/* c:\taddu\tv1,v1,a0 */\n/* 10:\tlw\tv1,0(v1) */\n/* 14:\tandi\ta1,a1,0xffff */\n/* 18:\tsll\tv0,a1,0x1 */\n/* 1c:\taddu\tv0,v0,a1 */\n/* 20:\tsll\tv0,v0,0x2 */\n/* 24:\tlw\tv1,0(v1) */\n/* 28:\tjr\tra */\n/* 2c:\taddu\tv0,v0,v1 */\nvoid func_800560D8_56CD8(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800560D8_56CD8': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800560D8_56CD8': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"HuSprite_Unk84_Unk00_Struct *func_800560D8_56CD8(s16 arg0, u16 arg1) {\n return ((arg1 & 0xFFFF) * 0xC) + **(D_800C9530_CA130 + ((s32) (arg0 << 0x10) >> 0xE));\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5513: invalid operands to binary +"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800560D8_56CD8` — benchmark function marioparty3:func_800560D8_56CD8:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800560D8_56CD8\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v1, %hi(D_800C9530_CA130)\n addu\t$v1, $v1, $a0\n lw\t$v1, %lo(D_800C9530_CA130)($v1)\n andi\t$a1, $a1, 0xffff\n sll\t$v0, $a1, 0x1\n addu\t$v0, $v0, $a1\n sll\t$v0, $v0, 0x2\n lw\t$v1, 0($v1)\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nHuSprite_Unk84_Unk00_Struct *func_800560D8_56CD8(s16 arg0, u16 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800560D8_56CD8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800560D8_56CD8` — benchmark function marioparty3:func_800560D8_56CD8:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800560D8_56CD8:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\tjr\tra\n 2c:\taddu\tv0,v0,v1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ccfed22fe178e2d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_800560D8_56CD8\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 03e00008 00431021 .....c.......C.!\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800560D8_56CD8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8005614C_56D4C:gcc2.7.2","sym":"func_8005614C_56D4C","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","arithmetic"],"loc":5,"refSource":"void *func_8005614C_56D4C(s16 arg0, u16 arg1) {\n HuSprite_Unk84_Unk00_Struct *entry = &D_800C9530_CA130[arg0]->unk00[arg1];\n\n return entry->unk00;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L650-L654","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\taddu\tv0,v0,v1\n 2c:\tjr\tra\n 30:\tlw\tv0,0(v0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz","proto":{"func_8005614C_56D4C":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ce007631d46caae3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8005614C_56D4C\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 00431021 03e00008 .....c...C.!....\n 0030 8c420000 00000000 00000000 00000000 .B..............\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8005614C_56D4C' — lift: cannot lift 'func_8005614C_56D4C': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsll\ta0,a0,0x10 */\n/* 4:\tsra\ta0,a0,0xe */\n/* 8:\tlui\tv1,0x0 */\n/* c:\taddu\tv1,v1,a0 */\n/* 10:\tlw\tv1,0(v1) */\n/* 14:\tandi\ta1,a1,0xffff */\n/* 18:\tsll\tv0,a1,0x1 */\n/* 1c:\taddu\tv0,v0,a1 */\n/* 20:\tsll\tv0,v0,0x2 */\n/* 24:\tlw\tv1,0(v1) */\n/* 28:\taddu\tv0,v0,v1 */\n/* 2c:\tjr\tra */\n/* 30:\tlw\tv0,0(v0) */\n/* \t... */\nvoid func_8005614C_56D4C(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8005614C_56D4C': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8005614C_56D4C': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *func_8005614C_56D4C(s16 arg0, u16 arg1) {\n return *(((arg1 & 0xFFFF) * 0xC) + **(D_800C9530_CA130 + ((s32) (arg0 << 0x10) >> 0xE)));\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5513: invalid operands to binary +"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8005614C_56D4C` — benchmark function marioparty3:func_8005614C_56D4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8005614C_56D4C\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v1, %hi(D_800C9530_CA130)\n addu\t$v1, $v1, $a0\n lw\t$v1, %lo(D_800C9530_CA130)($v1)\n andi\t$a1, $a1, 0xffff\n sll\t$v0, $a1, 0x1\n addu\t$v0, $v0, $a1\n sll\t$v0, $v0, 0x2\n lw\t$v1, 0($v1)\n addu\t$v0, $v0, $v1\n jr\t$ra\n lw\t$v0, 0($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_8005614C_56D4C(s16 arg0, u16 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8005614C_56D4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005614C_56D4C` — benchmark function marioparty3:func_8005614C_56D4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8005614C_56D4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\taddu\tv0,v0,v1\n 2c:\tjr\tra\n 30:\tlw\tv0,0(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ce007631d46caae3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8005614C_56D4C\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 00431021 03e00008 .....c...C.!....\n 0030 8c420000 00000000 00000000 00000000 .B..............\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8005614C_56D4C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8005614C_56D4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80056254_56E54:gcc2.7.2","sym":"func_80056254_56E54","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","arithmetic"],"loc":3,"refSource":"void *func_80056254_56E54(HuSprite_Unk84_Struct **arg0) {\n return (*arg0)->unk0C;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L676-L678","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tjr\tra\n 8:\tlw\tv0,12(v0)\n c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_80056254_56E54":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f915d8b63c68575e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_80056254_56E54\n\n\nContents of section .text:\n 0000 8c820000 03e00008 8c42000c 00000000 .........B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void func_80056254_56E54(s32 * a0) {\n return;\n}\n","score":2,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void *func_80056254_56E54(HuSprite_Unk84_Struct **arg0) {\n return (*arg0)->unk0C;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80056254_56E54` — benchmark function marioparty3:func_80056254_56E54:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056254_56E54\n lw\t$v0, 0($a0)\n jr\t$ra\n lw\t$v0, 12($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80056254_56E54(HuSprite_Unk84_Struct **arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056254_56E54 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056254_56E54` — benchmark function marioparty3:func_80056254_56E54:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056254_56E54:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tjr\tra\n 8:\tlw\tv0,12(v0)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f915d8b63c68575e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_80056254_56E54\n\n\nContents of section .text:\n 0000 8c820000 03e00008 8c42000c 00000000 .........B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80056254_56E54\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056254_56E54 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80056260_56E60:gcc2.7.2","sym":"func_80056260_56E60","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","arithmetic"],"loc":3,"refSource":"void *func_80056260_56E60(s16 arg0) {\n return D_800C9530_CA130[arg0]->unk0C;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L680-L682","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tjr\tra\n 18:\tlw\tv0,12(v0)\n 1c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz","proto":{"func_80056260_56E60":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c88c2e4abac83811/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_80056260_56E60\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 03e00008 8c42000c 00000000 .B.......B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80056260_56E60' — lift: cannot lift 'func_80056260_56E60': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsll\ta0,a0,0x10 */\n/* 4:\tsra\ta0,a0,0xe */\n/* 8:\tlui\tv0,0x0 */\n/* c:\taddu\tv0,v0,a0 */\n/* 10:\tlw\tv0,0(v0) */\n/* 14:\tjr\tra */\n/* 18:\tlw\tv0,12(v0) */\n/* 1c:\tnop */\nvoid func_80056260_56E60(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80056260_56E60': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80056260_56E60': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *func_80056260_56E60(s16 arg0) {\n return (*(D_800C9530_CA130 + ((s32) (arg0 << 0x10) >> 0xE)))->unkC;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5513: structure has no member named `unkC'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80056260_56E60` — benchmark function marioparty3:func_80056260_56E60:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056260_56E60\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v0, %hi(D_800C9530_CA130)\n addu\t$v0, $v0, $a0\n lw\t$v0, %lo(D_800C9530_CA130)($v0)\n jr\t$ra\n lw\t$v0, 12($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80056260_56E60(s16 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056260_56E60 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056260_56E60` — benchmark function marioparty3:func_80056260_56E60:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056260_56E60:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tjr\tra\n 18:\tlw\tv0,12(v0)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c88c2e4abac83811/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_80056260_56E60\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 03e00008 8c42000c 00000000 .B.......B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80056260_56E60\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056260_56E60 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80056C98_57898:gcc2.7.2","sym":"func_80056C98_57898","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","arithmetic"],"loc":7,"refSource":"u32 func_80056C98_57898(u8 **arg0) {\n u8 *p = *arg0;\n u32 val = (p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3];\n\n *arg0 = p + 4;\n return val;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L777-L783","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\ta1,0(a0)\n 4:\tlbu\tv0,0(a1)\n 8:\tsll\tv0,v0,0x18\n c:\tlbu\tv1,1(a1)\n 10:\tsll\tv1,v1,0x10\n 14:\taddu\tv0,v0,v1\n 18:\tlbu\tv1,2(a1)\n 1c:\tsll\tv1,v1,0x8\n 20:\taddu\tv0,v0,v1\n 24:\tlbu\tv1,3(a1)\n 28:\taddiu\ta1,a1,4\n 2c:\tsw\ta1,0(a0)\n 30:\tjr\tra\n 34:\taddu\tv0,v0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-0bc2346d0a617052/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 func_80056C98_57898\n\n\nContents of section .text:\n 0000 8c850000 90a20000 00021600 90a30001 ................\n 0010 00031c00 00431021 90a30002 00031a00 .....C.!........\n 0020 00431021 90a30003 24a50004 ac850000 .C.!....$.......\n 0030 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 func_80056C98_57898(s32 * a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n v0 = *(u8 *)*a0;\n v1 = ((u8 *)*a0)[1];\n v2 = ((u8 *)*a0)[2];\n v3 = ((u8 *)*a0)[3];\n *a0 = *a0 + 4;\n return (v0 << 24) + (v1 << 16) + (v2 << 8) + v3;\n}\n","score":18,"maxScore":19,"compileErrors":null,"breakdown":{"insert":5,"delete":5,"replace":0,"opMismatch":0,"argMismatch":8},"quality":{"score":96,"lines":12,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 func_80056C98_57898(void **arg0) {\n void *temp_a1;\n\n temp_a1 = *arg0;\n *arg0 = temp_a1 + 4;\n return (temp_a1->unk0 << 0x18) + (temp_a1->unk1 << 0x10) + (temp_a1->unk2 << 8) + temp_a1->unk3;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5515: warning: dereferencing `void *' pointer","/c.i:5515: request for member `unk0' in something not a structure or union","/c.i:5515: request for member `unk1' in something not a structure or union","/c.i:5515: request for member `unk2' in something not a structure or union","/c.i:5515: request for member `unk3' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":18,"maxScore":19,"ratio":0.9473684210526315,"kinds":{"insert":5,"delete":5,"replace":0,"opMismatch":0,"argMismatch":8}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80056C98_57898` — benchmark function marioparty3:func_80056C98_57898:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056C98_57898\n lw\t$a1, 0($a0)\n lbu\t$v0, 0($a1)\n sll\t$v0, $v0, 0x18\n lbu\t$v1, 1($a1)\n sll\t$v1, $v1, 0x10\n addu\t$v0, $v0, $v1\n lbu\t$v1, 2($a1)\n sll\t$v1, $v1, 0x8\n addu\t$v0, $v0, $v1\n lbu\t$v1, 3($a1)\n addiu\t$a1, $a1, 4\n sw\t$a1, 0($a0)\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056C98_57898 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056C98_57898` — benchmark function marioparty3:func_80056C98_57898:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056C98_57898:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\ta1,0(a0)\n 4:\tlbu\tv0,0(a1)\n 8:\tsll\tv0,v0,0x18\n c:\tlbu\tv1,1(a1)\n 10:\tsll\tv1,v1,0x10\n 14:\taddu\tv0,v0,v1\n 18:\tlbu\tv1,2(a1)\n 1c:\tsll\tv1,v1,0x8\n 20:\taddu\tv0,v0,v1\n 24:\tlbu\tv1,3(a1)\n 28:\taddiu\ta1,a1,4\n 2c:\tsw\ta1,0(a0)\n 30:\tjr\tra\n 34:\taddu\tv0,v0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-0bc2346d0a617052/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 func_80056C98_57898\n\n\nContents of section .text:\n 0000 8c850000 90a20000 00021600 90a30001 ................\n 0010 00031c00 00431021 90a30002 00031a00 .....C.!........\n 0020 00431021 90a30003 24a50004 ac850000 .C.!....$.......\n 0030 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056C98_57898 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800570A8_57CA8:gcc2.7.2","sym":"func_800570A8_57CA8","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","loop","global","arithmetic"],"loc":12,"refSource":"void func_800570A8_57CA8(s16 group, s16 member, s16 arg2) {\n HuSprite *sprite = HuSprGrpData[group]->members[member];\n s32 i;\n\n sprite->unk_98 = D_800D0A50_D1650[arg2];\n sprite->unk_FC.f = 1.0f;\n for (i = 0; i < 0x10; i++) {\n sprite->unk_9C[i] = 0xFFFF;\n sprite->unk_BC[i] = 0;\n }\n sprite->unk_104 = 0;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L823-L834","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tsll\ta1,a1,0x10\n 18:\tsra\ta1,a1,0xe\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\ta0,16(a1)\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0xe\n 2c:\tlui\tv0,0x0\n 30:\taddu\tv0,v0,a2\n 34:\tlw\tv0,0(v0)\n 38:\tsw\tv0,152(a0)\n 3c:\tlui\tat,0x3f80\n 40:\tmtc1\tat,$f0\n 44:\tnop\n 48:\tswc1\t$f0,252(a0)\n 4c:\tmove\tv1,zero\n 50:\tli\ta1,0xffff\n 54:\tsll\tv0,v1,0x1\n 58:\taddu\tv0,v0,a0\n 5c:\tsh\ta1,156(v0)\n 60:\tsll\tv0,v1,0x2\n 64:\taddu\tv0,v0,a0\n 68:\tsw\tzero,188(v0)\n 6c:\taddiu\tv1,v1,1\n 70:\tslti\tv0,v1,16\n 74:\tbnezl\tv0,58 \n 78:\tsll\tv0,v1,0x1\n 7c:\tjr\tra\n 80:\tsw\tzero,260(a0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-b2e749e20c8f.i.gz","proto":{"func_800570A8_57CA8":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c7814ced67c9c843/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800570A8_57CA8\n00000000 *UND*\t00000000 HuSprGrpData\n00000000 *UND*\t00000000 D_800D0A50_D1650\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HuSprGrpData\n00000010 R_MIPS_LO16 HuSprGrpData\n0000002c R_MIPS_HI16 D_800D0A50_D1650\n00000034 R_MIPS_LO16 D_800D0A50_D1650\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 00052c00 00052b83 00a22821 .B....,...+...(!\n 0020 8ca40010 00063400 00063383 3c020000 ......4...3.<...\n 0030 00461021 8c420000 ac820098 3c013f80 .F.!.B......<.?.\n 0040 44810000 00000000 e48000fc 00001821 D..............!\n 0050 3405ffff 00031040 00441021 a445009c 4......@.D.!.E..\n 0060 00031080 00441021 ac4000bc 24630001 .....D.!.@..$c..\n 0070 28620010 5440fff8 00031040 03e00008 (b..T@.....@....\n 0080 ac800104 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007e 00000000 00000001 00000000 ...~............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800570A8_57CA8' — lift: cannot lift 'func_800570A8_57CA8': unmodelled control transfer 'bnezl' at 0x74 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsll\ta0,a0,0x10 */\n/* 4:\tsra\ta0,a0,0xe */\n/* 8:\tlui\tv0,0x0 */\n/* c:\taddu\tv0,v0,a0 */\n/* 10:\tlw\tv0,0(v0) */\n/* 14:\tsll\ta1,a1,0x10 */\n/* 18:\tsra\ta1,a1,0xe */\n/* 1c:\taddu\ta1,a1,v0 */\n/* 20:\tlw\ta0,16(a1) */\n/* 24:\tsll\ta2,a2,0x10 */\n/* 28:\tsra\ta2,a2,0xe */\n/* 2c:\tlui\tv0,0x0 */\n/* 30:\taddu\tv0,v0,a2 */\n/* 34:\tlw\tv0,0(v0) */\n/* 38:\tsw\tv0,152(a0) */\n/* 3c:\tlui\tat,0x3f80 */\n/* 40:\tmtc1\tat,$f0 */\n/* 44:\tnop */\n/* 48:\tswc1\t$f0,252(a0) */\n/* 4c:\tmove\tv1,zero */\n/* 50:\tli\ta1,0xffff */\n/* 54:\tsll\tv0,v1,0x1 */\n/* 58:\taddu\tv0,v0,a0 */\n/* 5c:\tsh\ta1,156(v0) */\n/* 60:\tsll\tv0,v1,0x2 */\n/* 64:\taddu\tv0,v0,a0 */\n/* 68:\tsw\tzero,188(v0) */\n/* 6c:\taddiu\tv1,v1,1 */\n/* 70:\tslti\tv0,v1,16 */\n/* 74:\tbnezl\tv0,58 */\n/* 78:\tsll\tv0,v1,0x1 */\n/* 7c:\tjr\tra */\n/* 80:\tsw\tzero,260(a0) */\n/* \t... */\nvoid func_800570A8_57CA8(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800570A8_57CA8': unmodelled control transfer 'bnezl' at 0x74 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":42,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800570A8_57CA8': unmodelled control transfer 'bnezl' at 0x74 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_800570A8_57CA8(s16 group, s16 member, s16 arg2) {\n s32 var_v1;\n void *temp_a0;\n\n temp_a0 = (((s32) (member << 0x10) >> 0xE) + *(HuSprGrpData + ((s32) (group << 0x10) >> 0xE)))->unk10;\n temp_a0->unk98 = (s32) *(D_800D0A50_D1650 + ((s32) (arg2 << 0x10) >> 0xE));\n temp_a0->unkFC = 1.0f;\n var_v1 = 0;\n do {\n ((var_v1 * 2) + temp_a0)->unk9C = 0xFFFF;\n ((var_v1 * 4) + temp_a0)->unkBC = 0;\n var_v1 += 1;\n } while (var_v1 < 0x10);\n temp_a0->unk104 = 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":96,"lines":14,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5515: structure has no member named `unk10'","/c.i:5516: warning: dereferencing `void *' pointer","/c.i:5516: request for member `unk98' in something not a structure or union","/c.i:5517: warning: dereferencing `void *' pointer","/c.i:5517: request for member `unkFC' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800570A8_57CA8` — benchmark function marioparty3:func_800570A8_57CA8:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800570A8_57CA8\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v0, %hi(HuSprGrpData)\n addu\t$v0, $v0, $a0\n lw\t$v0, %lo(HuSprGrpData)($v0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0xe\n addu\t$a1, $a1, $v0\n lw\t$a0, 16($a1)\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0xe\n lui\t$v0, %hi(D_800D0A50_D1650)\n addu\t$v0, $v0, $a2\n lw\t$v0, %lo(D_800D0A50_D1650)($v0)\n sw\t$v0, 152($a0)\n lui\t$at, 0x3f80\n mtc1\t$at, $f0\n nop\n swc1\t$f0, 252($a0)\n move\t$v1, $zero\n li\t$a1, 0xffff\n sll\t$v0, $v1, 0x1\n.L58:\n addu\t$v0, $v0, $a0\n sh\t$a1, 156($v0)\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $a0\n sw\t$zero, 188($v0)\n addiu\t$v1, $v1, 1\n slti\t$v0, $v1, 16\n bnezl\t$v0, .L58\n sll\t$v0, $v1, 0x1\n jr\t$ra\n sw\t$zero, 260($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-b2e749e20c8f.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800570A8_57CA8(s16 group, s16 member, s16 arg2);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800570A8_57CA8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800570A8_57CA8` — benchmark function marioparty3:func_800570A8_57CA8:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800570A8_57CA8:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tsll\ta1,a1,0x10\n 18:\tsra\ta1,a1,0xe\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\ta0,16(a1)\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0xe\n 2c:\tlui\tv0,0x0\n 30:\taddu\tv0,v0,a2\n 34:\tlw\tv0,0(v0)\n 38:\tsw\tv0,152(a0)\n 3c:\tlui\tat,0x3f80\n 40:\tmtc1\tat,$f0\n 44:\tnop\n 48:\tswc1\t$f0,252(a0)\n 4c:\tmove\tv1,zero\n 50:\tli\ta1,0xffff\n 54:\tsll\tv0,v1,0x1\n 58:\taddu\tv0,v0,a0\n 5c:\tsh\ta1,156(v0)\n 60:\tsll\tv0,v1,0x2\n 64:\taddu\tv0,v0,a0\n 68:\tsw\tzero,188(v0)\n 6c:\taddiu\tv1,v1,1\n 70:\tslti\tv0,v1,16\n 74:\tbnezl\tv0,58 \n 78:\tsll\tv0,v1,0x1\n 7c:\tjr\tra\n 80:\tsw\tzero,260(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c7814ced67c9c843/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800570A8_57CA8\n00000000 *UND*\t00000000 HuSprGrpData\n00000000 *UND*\t00000000 D_800D0A50_D1650\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HuSprGrpData\n00000010 R_MIPS_LO16 HuSprGrpData\n0000002c R_MIPS_HI16 D_800D0A50_D1650\n00000034 R_MIPS_LO16 D_800D0A50_D1650\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 00052c00 00052b83 00a22821 .B....,...+...(!\n 0020 8ca40010 00063400 00063383 3c020000 ......4...3.<...\n 0030 00461021 8c420000 ac820098 3c013f80 .F.!.B......<.?.\n 0040 44810000 00000000 e48000fc 00001821 D..............!\n 0050 3405ffff 00031040 00441021 a445009c 4......@.D.!.E..\n 0060 00031080 00441021 ac4000bc 24630001 .....D.!.@..$c..\n 0070 28620010 5440fff8 00031040 03e00008 (b..T@.....@....\n 0080 ac800104 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007e 00000000 00000001 00000000 ...~............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800570A8_57CA8\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800570A8_57CA8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8005FA90_60690:gcc2.7.2","sym":"func_8005FA90_60690","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","loop","branch","global","arithmetic"],"loc":17,"refSource":"u8 func_8005FA90_60690(u8 *arg0) {\n s16 i, j;\n\n for (i = 0; i < 10; i += 2) {\n if (D_800A232C_A2F2C[i] == arg0[0] && D_800A232C_A2F2C[i + 1] == arg0[1]) {\n return i / 2;\n }\n }\n for (i = 0; i < 16; i++) {\n for (j = 0; j < 32; j += 2) {\n if (D_800A2344_A2F44[i][j] == arg0[0] && D_800A2344_A2F44[i][j + 1] == arg0[1]) {\n return i * 16 + j / 2;\n }\n }\n }\n return 16;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L297-L313","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,zero\n 4:\tlbu\ta3,0(a0)\n 8:\tsll\ta2,t0,0x10\n c:\tsra\ta1,a2,0x10\n 10:\tlui\tv0,0x0\n 14:\taddu\tv0,v0,a1\n 18:\tlbu\tv0,0(v0)\n 1c:\tbne\tv0,a3,50 \n 20:\taddiu\tv0,t0,2\n 24:\tlui\tv1,0x0\n 28:\taddu\tv1,v1,a1\n 2c:\tlbu\tv1,1(v1)\n 30:\tlbu\tv0,1(a0)\n 34:\tbnel\tv1,v0,50 \n 38:\taddiu\tv0,t0,2\n 3c:\tsrl\tv0,a2,0x1f\n 40:\taddu\tv0,a1,v0\n 44:\tsrl\tv0,v0,0x1\n 48:\tj\t10c \n 4c:\tandi\tv0,v0,0xff\n 50:\tmove\tt0,v0\n 54:\tsll\tv0,v0,0x10\n 58:\tsra\tv0,v0,0x10\n 5c:\tslti\tv0,v0,10\n 60:\tbnez\tv0,c \n 64:\tsll\ta2,t0,0x10\n 68:\tmove\tt0,zero\n 6c:\tlui\tt4,0x0\n 70:\taddiu\tt4,t4,0\n 74:\tlbu\tt3,0(a0)\n 78:\tmove\ta3,zero\n 7c:\tsll\tv1,t0,0x10\n 80:\tsra\tv1,v1,0x10\n 84:\tsll\tv0,v1,0x2\n 88:\taddu\tv0,v0,t4\n 8c:\tlw\tt1,0(v0)\n 90:\tsll\tt2,v1,0x4\n 94:\tsll\ta1,a3,0x10\n 98:\tsra\ta2,a1,0x10\n 9c:\taddu\tv1,t1,a2\n a0:\tlbu\tv0,0(v1)\n a4:\tbne\tv0,t3,d4 \n a8:\taddiu\tv0,a3,2\n ac:\tlbu\tv1,1(v1)\n b0:\tlbu\tv0,1(a0)\n b4:\tbnel\tv1,v0,d4 \n b8:\taddiu\tv0,a3,2\n bc:\tsrl\tv0,a1,0x1f\n c0:\taddu\tv0,a2,v0\n c4:\tsra\tv0,v0,0x1\n c8:\taddu\tv0,v0,t2\n cc:\tj\t10c \n d0:\tandi\tv0,v0,0xff\n d4:\tmove\ta3,v0\n d8:\tsll\tv0,v0,0x10\n dc:\tsra\tv0,v0,0x10\n e0:\tslti\tv0,v0,32\n e4:\tbnez\tv0,98 \n e8:\tsll\ta1,a3,0x10\n ec:\taddiu\tv0,t0,1\n f0:\tmove\tt0,v0\n f4:\tsll\tv0,v0,0x10\n f8:\tsra\tv0,v0,0x10\n fc:\tslti\tv0,v0,16\n 100:\tbnezl\tv0,7c \n 104:\tmove\ta3,zero\n 108:\tli\tv0,16\n 10c:\tjr\tra\n 110:\tnop\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-08282be5c7c2.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-9446791f5273df55/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000114 func_8005FA90_60690\n00000000 *UND*\t00000000 D_800A232C_A2F2C\n00000000 *UND*\t00000000 D_800A2344_A2F44\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 D_800A232C_A2F2C\n00000018 R_MIPS_LO16 D_800A232C_A2F2C\n00000024 R_MIPS_HI16 D_800A232C_A2F2C\n0000002c R_MIPS_LO16 D_800A232C_A2F2C\n00000048 R_MIPS_26 .text\n0000006c R_MIPS_HI16 D_800A2344_A2F44\n00000070 R_MIPS_LO16 D_800A2344_A2F44\n000000cc R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00004021 90870000 00083400 00062c03 ..@!......4...,.\n 0010 3c020000 00451021 90420000 1447000c <....E.!.B...G..\n 0020 25020002 3c030000 00651821 90630001 %...<....e.!.c..\n 0030 90820001 54620006 25020002 000617c2 ....Tb..%.......\n 0040 00a21021 00021042 08000043 304200ff ...!...B...C0B..\n 0050 00404021 00021400 00021403 2842000a .@@!........(B..\n 0060 1440ffea 00083400 00004021 3c0c0000 .@....4...@!<...\n 0070 258c0000 908b0000 00003821 00081c00 %.........8!....\n 0080 00031c03 00031080 004c1021 8c490000 .........L.!.I..\n 0090 00035100 00072c00 00053403 01261821 ..Q...,...4..&.!\n 00a0 90620000 144b000b 24e20002 90630001 .b...K..$....c..\n 00b0 90820001 54620007 24e20002 000517c2 ....Tb..$.......\n 00c0 00c21021 00021043 004a1021 08000043 ...!...C.J.!...C\n 00d0 304200ff 00403821 00021400 00021403 0B...@8!........\n 00e0 28420020 1440ffec 00072c00 25020001 (B. .@....,.%...\n 00f0 00404021 00021400 00021403 28420010 .@@!........(B..\n 0100 5440ffde 00003821 24020010 03e00008 T@....8!$.......\n 0110 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80001ffc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8005FA90_60690' — lift: cannot lift 'func_8005FA90_60690': unmodelled control transfer 'bnel' at 0x34 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tt0,zero */\n/* 4:\tlbu\ta3,0(a0) */\n/* 8:\tsll\ta2,t0,0x10 */\n/* c:\tsra\ta1,a2,0x10 */\n/* 10:\tlui\tv0,0x0 */\n/* 14:\taddu\tv0,v0,a1 */\n/* 18:\tlbu\tv0,0(v0) */\n/* 1c:\tbne\tv0,a3,50 */\n/* 20:\taddiu\tv0,t0,2 */\n/* 24:\tlui\tv1,0x0 */\n/* 28:\taddu\tv1,v1,a1 */\n/* 2c:\tlbu\tv1,1(v1) */\n/* 30:\tlbu\tv0,1(a0) */\n/* 34:\tbnel\tv1,v0,50 */\n/* 38:\taddiu\tv0,t0,2 */\n/* 3c:\tsrl\tv0,a2,0x1f */\n/* 40:\taddu\tv0,a1,v0 */\n/* 44:\tsrl\tv0,v0,0x1 */\n/* 48:\tj\t10c */\n/* 4c:\tandi\tv0,v0,0xff */\n/* 50:\tmove\tt0,v0 */\n/* 54:\tsll\tv0,v0,0x10 */\n/* 58:\tsra\tv0,v0,0x10 */\n/* 5c:\tslti\tv0,v0,10 */\n/* 60:\tbnez\tv0,c */\n/* 64:\tsll\ta2,t0,0x10 */\n/* 68:\tmove\tt0,zero */\n/* 6c:\tlui\tt4,0x0 */\n/* 70:\taddiu\tt4,t4,0 */\n/* 74:\tlbu\tt3,0(a0) */\n/* 78:\tmove\ta3,zero */\n/* 7c:\tsll\tv1,t0,0x10 */\n/* 80:\tsra\tv1,v1,0x10 */\n/* 84:\tsll\tv0,v1,0x2 */\n/* 88:\taddu\tv0,v0,t4 */\n/* 8c:\tlw\tt1,0(v0) */\n/* 90:\tsll\tt2,v1,0x4 */\n/* 94:\tsll\ta1,a3,0x10 */\n/* 98:\tsra\ta2,a1,0x10 */\n/* 9c:\taddu\tv1,t1,a2 */\n/* a0:\tlbu\tv0,0(v1) */\n/* a4:\tbne\tv0,t3,d4 */\n/* a8:\taddiu\tv0,a3,2 */\n/* ac:\tlbu\tv1,1(v1) */\n/* b0:\tlbu\tv0,1(a0) */\n/* b4:\tbnel\tv1,v0,d4 */\n/* b8:\taddiu\tv0,a3,2 */\n/* bc:\tsrl\tv0,a1,0x1f */\n/* c0:\taddu\tv0,a2,v0 */\n/* c4:\tsra\tv0,v0,0x1 */\n/* c8:\taddu\tv0,v0,t2 */\n/* cc:\tj\t10c */\n/* d0:\tandi\tv0,v0,0xff */\n/* d4:\tmove\ta3,v0 */\n/* d8:\tsll\tv0,v0,0x10 */\n/* dc:\tsra\tv0,v0,0x10 */\n/* e0:\tslti\tv0,v0,32 */\n/* e4:\tbnez\tv0,98 */\n/* e8:\tsll\ta1,a3,0x10 */\n/* ec:\taddiu\tv0,t0,1 */\n/* f0:\tmove\tt0,v0 */\n/* f4:\tsll\tv0,v0,0x10 */\n/* f8:\tsra\tv0,v0,0x10 */\n/* fc:\tslti\tv0,v0,16 */\n/* 100:\tbnezl\tv0,7c */\n/* 104:\tmove\ta3,zero */\n/* 108:\tli\tv0,16 */\n/* 10c:\tjr\tra */\n/* 110:\tnop */\n/* \t... */\nvoid func_8005FA90_60690(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8005FA90_60690': unmodelled control transfer 'bnel' at 0x34 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":78,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8005FA90_60690': unmodelled control transfer 'bnel' at 0x34 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 func_8005FA90_60690(u8 *arg0) {\n s16 temp_v0;\n s16 var_a3;\n s16 var_t0;\n s16 var_t0_2;\n s16 var_v0;\n s16 var_v0_2;\n s32 temp_a1;\n s32 temp_a2;\n s32 var_a1;\n s32 var_a2;\n u8 *temp_v1;\n\n var_t0_2 = 0;\n var_a2 = 0 << 0x10;\nloop_1:\n temp_a1 = var_a2 >> 0x10;\n var_v0 = var_t0_2 + 2;\n if (D_800A232C_A2F2C[temp_a1] == arg0->unk0) {\n if (D_800A232C_A2F2C[temp_a1] != arg0->unk1) {\n var_v0 = var_t0_2 + 2;\n goto block_6;\n }\n return ((u32) (temp_a1 + ((u32) var_a2 >> 0x1F)) >> 1) & 0xFF;\n }\nblock_6:\n var_t0_2 = var_v0;\n var_a2 = var_t0_2 << 0x10;\n if (var_v0 >= 0xA) {\n var_t0 = 0;\nloop_8:\n var_a3 = 0;\n var_a1 = 0 << 0x10;\nloop_9:\n temp_a2 = var_a1 >> 0x10;\n temp_v1 = &D_800A2344_A2F44[var_t0][temp_a2];\n var_v0_2 = var_a3 + 2;\n if (temp_v1->unk0 == arg0->unk0) {\n if (temp_v1->unk1 != arg0->unk1) {\n var_v0_2 = var_a3 + 2;\n goto block_14;\n }\n return (((s32) (temp_a2 + ((u32) var_a1 >> 0x1F)) >> 1) + (var_t0 * 0x10)) & 0xFF;\n }\nblock_14:\n var_a3 = var_v0_2;\n var_a1 = var_a3 << 0x10;\n if (var_v0_2 >= 0x20) {\n temp_v0 = var_t0 + 1;\n var_t0 = temp_v0;\n if (temp_v0 >= 0x10) {\n return 0x10U;\n }\n goto loop_8;\n }\n goto loop_9;\n }\n goto loop_1;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":60,"lines":58,"gotos":5,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5530: request for member `unk0' in something not a structure or union","/c.i:5531: request for member `unk1' in something not a structure or union","/c.i:5549: request for member `unk0' in something not a structure or union","/c.i:5550: request for member `unk1' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8005FA90_60690` — benchmark function marioparty3:func_8005FA90_60690:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8005FA90_60690\n move\t$t0, $zero\n lbu\t$a3, 0($a0)\n sll\t$a2, $t0, 0x10\n.Lc:\n sra\t$a1, $a2, 0x10\n lui\t$v0, %hi(D_800A232C_A2F2C)\n addu\t$v0, $v0, $a1\n lbu\t$v0, %lo(D_800A232C_A2F2C)($v0)\n bne\t$v0, $a3, .L50\n addiu\t$v0, $t0, 2\n lui\t$v1, %hi(D_800A232C_A2F2C)\n addu\t$v1, $v1, $a1\n lbu\t$v1, %lo(D_800A232C_A2F2C)($v1)\n lbu\t$v0, 1($a0)\n bnel\t$v1, $v0, .L50\n addiu\t$v0, $t0, 2\n srl\t$v0, $a2, 0x1f\n addu\t$v0, $a1, $v0\n srl\t$v0, $v0, 0x1\n j\t.L10c\n andi\t$v0, $v0, 0xff\n.L50:\n move\t$t0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 10\n bnez\t$v0, .Lc\n sll\t$a2, $t0, 0x10\n move\t$t0, $zero\n lui\t$t4, %hi(D_800A2344_A2F44)\n addiu\t$t4, $t4, %lo(D_800A2344_A2F44)\n lbu\t$t3, 0($a0)\n move\t$a3, $zero\n.L7c:\n sll\t$v1, $t0, 0x10\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $t4\n lw\t$t1, 0($v0)\n sll\t$t2, $v1, 0x4\n sll\t$a1, $a3, 0x10\n.L98:\n sra\t$a2, $a1, 0x10\n addu\t$v1, $t1, $a2\n lbu\t$v0, 0($v1)\n bne\t$v0, $t3, .Ld4\n addiu\t$v0, $a3, 2\n lbu\t$v1, 1($v1)\n lbu\t$v0, 1($a0)\n bnel\t$v1, $v0, .Ld4\n addiu\t$v0, $a3, 2\n srl\t$v0, $a1, 0x1f\n addu\t$v0, $a2, $v0\n sra\t$v0, $v0, 0x1\n addu\t$v0, $v0, $t2\n j\t.L10c\n andi\t$v0, $v0, 0xff\n.Ld4:\n move\t$a3, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 32\n bnez\t$v0, .L98\n sll\t$a1, $a3, 0x10\n addiu\t$v0, $t0, 1\n move\t$t0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 16\n bnezl\t$v0, .L7c\n move\t$a3, $zero\n li\t$v0, 16\n.L10c:\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-08282be5c7c2.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 func_8005FA90_60690(u8 *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8005FA90_60690 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005FA90_60690` — benchmark function marioparty3:func_8005FA90_60690:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8005FA90_60690:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,zero\n 4:\tlbu\ta3,0(a0)\n 8:\tsll\ta2,t0,0x10\n c:\tsra\ta1,a2,0x10\n 10:\tlui\tv0,0x0\n 14:\taddu\tv0,v0,a1\n 18:\tlbu\tv0,0(v0)\n 1c:\tbne\tv0,a3,50 \n 20:\taddiu\tv0,t0,2\n 24:\tlui\tv1,0x0\n 28:\taddu\tv1,v1,a1\n 2c:\tlbu\tv1,1(v1)\n 30:\tlbu\tv0,1(a0)\n 34:\tbnel\tv1,v0,50 \n 38:\taddiu\tv0,t0,2\n 3c:\tsrl\tv0,a2,0x1f\n 40:\taddu\tv0,a1,v0\n 44:\tsrl\tv0,v0,0x1\n 48:\tj\t10c \n 4c:\tandi\tv0,v0,0xff\n 50:\tmove\tt0,v0\n 54:\tsll\tv0,v0,0x10\n 58:\tsra\tv0,v0,0x10\n 5c:\tslti\tv0,v0,10\n 60:\tbnez\tv0,c \n 64:\tsll\ta2,t0,0x10\n 68:\tmove\tt0,zero\n 6c:\tlui\tt4,0x0\n 70:\taddiu\tt4,t4,0\n 74:\tlbu\tt3,0(a0)\n 78:\tmove\ta3,zero\n 7c:\tsll\tv1,t0,0x10\n 80:\tsra\tv1,v1,0x10\n 84:\tsll\tv0,v1,0x2\n 88:\taddu\tv0,v0,t4\n 8c:\tlw\tt1,0(v0)\n 90:\tsll\tt2,v1,0x4\n 94:\tsll\ta1,a3,0x10\n 98:\tsra\ta2,a1,0x10\n 9c:\taddu\tv1,t1,a2\n a0:\tlbu\tv0,0(v1)\n a4:\tbne\tv0,t3,d4 \n a8:\taddiu\tv0,a3,2\n ac:\tlbu\tv1,1(v1)\n b0:\tlbu\tv0,1(a0)\n b4:\tbnel\tv1,v0,d4 \n b8:\taddiu\tv0,a3,2\n bc:\tsrl\tv0,a1,0x1f\n c0:\taddu\tv0,a2,v0\n c4:\tsra\tv0,v0,0x1\n c8:\taddu\tv0,v0,t2\n cc:\tj\t10c \n d0:\tandi\tv0,v0,0xff\n d4:\tmove\ta3,v0\n d8:\tsll\tv0,v0,0x10\n dc:\tsra\tv0,v0,0x10\n e0:\tslti\tv0,v0,32\n e4:\tbnez\tv0,98 \n e8:\tsll\ta1,a3,0x10\n ec:\taddiu\tv0,t0,1\n f0:\tmove\tt0,v0\n f4:\tsll\tv0,v0,0x10\n f8:\tsra\tv0,v0,0x10\n fc:\tslti\tv0,v0,16\n 100:\tbnezl\tv0,7c \n 104:\tmove\ta3,zero\n 108:\tli\tv0,16\n 10c:\tjr\tra\n 110:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-9446791f5273df55/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000114 func_8005FA90_60690\n00000000 *UND*\t00000000 D_800A232C_A2F2C\n00000000 *UND*\t00000000 D_800A2344_A2F44\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 D_800A232C_A2F2C\n00000018 R_MIPS_LO16 D_800A232C_A2F2C\n00000024 R_MIPS_HI16 D_800A232C_A2F2C\n0000002c R_MIPS_LO16 D_800A232C_A2F2C\n00000048 R_MIPS_26 .text\n0000006c R_MIPS_HI16 D_800A2344_A2F44\n00000070 R_MIPS_LO16 D_800A2344_A2F44\n000000cc R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00004021 90870000 00083400 00062c03 ..@!......4...,.\n 0010 3c020000 00451021 90420000 1447000c <....E.!.B...G..\n 0020 25020002 3c030000 00651821 90630001 %...<....e.!.c..\n 0030 90820001 54620006 25020002 000617c2 ....Tb..%.......\n 0040 00a21021 00021042 08000043 304200ff ...!...B...C0B..\n 0050 00404021 00021400 00021403 2842000a .@@!........(B..\n 0060 1440ffea 00083400 00004021 3c0c0000 .@....4...@!<...\n 0070 258c0000 908b0000 00003821 00081c00 %.........8!....\n 0080 00031c03 00031080 004c1021 8c490000 .........L.!.I..\n 0090 00035100 00072c00 00053403 01261821 ..Q...,...4..&.!\n 00a0 90620000 144b000b 24e20002 90630001 .b...K..$....c..\n 00b0 90820001 54620007 24e20002 000517c2 ....Tb..$.......\n 00c0 00c21021 00021043 004a1021 08000043 ...!...C.J.!...C\n 00d0 304200ff 00403821 00021400 00021403 0B...@8!........\n 00e0 28420020 1440ffec 00072c00 25020001 (B. .@....,.%...\n 00f0 00404021 00021400 00021403 28420010 .@@!........(B..\n 0100 5440ffde 00003821 24020010 03e00008 T@....8!$.......\n 0110 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80001ffc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8005FA90_60690 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800600C0_60CC0:gcc2.7.2","sym":"func_800600C0_60CC0","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","global","arithmetic"],"loc":10,"refSource":"void func_800600C0_60CC0(s16 winId, s32 arg1) {\n TextWindow *window;\n\n window = &D_800CC69C_CD29C[winId];\n if (arg1 != 0) {\n window->unk_38 |= 0x10;\n } else {\n window->unk_38 &= ~0x10;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L325-L334","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\tbeqz\ta1,38 \n 28:\taddu\ta0,v0,v1\n 2c:\tlw\tv0,56(a0)\n 30:\tj\t44 \n 34:\tori\tv0,v0,0x10\n 38:\tlw\tv0,56(a0)\n 3c:\tli\tv1,-17\n 40:\tand\tv0,v0,v1\n 44:\tjr\tra\n 48:\tsw\tv0,56(a0)\n 4c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz","proto":{"func_800600C0_60CC0":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ebcbb216a187e6c6/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_800600C0_60CC0\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 D_800CC69C_CD29C\n00000020 R_MIPS_LO16 D_800CC69C_CD29C\n00000030 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00042400 00042403 00041080 00441021 ..$...$......D.!\n 0010 00021140 00441023 00021080 3c030000 ...@.D.#....<...\n 0020 8c630000 10a00004 00432021 8c820038 .c.......C !...8\n 0030 08000011 34420010 8c820038 2403ffef ....4B.....8$...\n 0040 00431024 03e00008 ac820038 00000000 .C.$.......8....\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800CC69C_CD29C","shape":"pointer"}],"outcome":"nonmatch","source":"void func_800600C0_60CC0(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n v0 = D_800CC69C_CD29C;\n if (a1 == 0) {\n v1 = ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] & -17;\n } else {\n v1 = ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] | 16;\n }\n ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] = v1;\n return;\n}\n","score":38,"maxScore":39,"compileErrors":null,"breakdown":{"insert":20,"delete":7,"replace":4,"opMismatch":0,"argMismatch":7},"quality":{"score":98,"lines":12,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_800600C0_60CC0(s16 winId, s32 arg1) {\n TextWindow *temp_a0;\n u32 var_v0;\n\n temp_a0 = &D_800CC69C_CD29C[winId];\n if (arg1 != 0) {\n var_v0 = temp_a0->unk_38 | 0x10;\n } else {\n var_v0 = temp_a0->unk_38 & ~0x10;\n }\n temp_a0->unk_38 = var_v0;\n}\n","score":3,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":19,"ratio":0.15789473684210525,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800600C0_60CC0` — benchmark function marioparty3:func_800600C0_60CC0:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800600C0_60CC0\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$v0, $a0, 0x2\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x5\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_800CC69C_CD29C)\n lw\t$v1, %lo(D_800CC69C_CD29C)($v1)\n beqz\t$a1, .L38\n addu\t$a0, $v0, $v1\n lw\t$v0, 56($a0)\n j\t.L44\n ori\t$v0, $v0, 0x10\n.L38:\n lw\t$v0, 56($a0)\n li\t$v1, -17\n and\t$v0, $v0, $v1\n.L44:\n jr\t$ra\n sw\t$v0, 56($a0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800600C0_60CC0(s16 winId, s32 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800600C0_60CC0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800600C0_60CC0` — benchmark function marioparty3:func_800600C0_60CC0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800600C0_60CC0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\tbeqz\ta1,38 \n 28:\taddu\ta0,v0,v1\n 2c:\tlw\tv0,56(a0)\n 30:\tj\t44 \n 34:\tori\tv0,v0,0x10\n 38:\tlw\tv0,56(a0)\n 3c:\tli\tv1,-17\n 40:\tand\tv0,v0,v1\n 44:\tjr\tra\n 48:\tsw\tv0,56(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ebcbb216a187e6c6/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_800600C0_60CC0\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 D_800CC69C_CD29C\n00000020 R_MIPS_LO16 D_800CC69C_CD29C\n00000030 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00042400 00042403 00041080 00441021 ..$...$......D.!\n 0010 00021140 00441023 00021080 3c030000 ...@.D.#....<...\n 0020 8c630000 10a00004 00432021 8c820038 .c.......C !...8\n 0030 08000011 34420010 8c820038 2403ffef ....4B.....8$...\n 0040 00431024 03e00008 ac820038 00000000 .C.$.......8....\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800600C0_60CC0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800600C0_60CC0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8006014C_60D4C:gcc2.7.2","sym":"func_8006014C_60D4C","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":3,"refSource":"s8 func_8006014C_60D4C(s32 winId) {\n return D_800CC69C_CD29C[winId].unk_31;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L345-L347","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\taddu\tv0,v0,v1\n 20:\tjr\tra\n 24:\tlb\tv0,49(v0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f52bf81a0ee885b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 func_8006014C_60D4C\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800CC69C_CD29C\n00000004 R_MIPS_LO16 D_800CC69C_CD29C\n\n\nContents of section .text:\n 0000 3c030000 8c630000 00041080 00441021 <....c.......D.!\n 0010 00021140 00441023 00021080 00431021 ...@.D.#.....C.!\n 0020 03e00008 80420031 00000000 00000000 .....B.1........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","symbolsUsed":[{"name":"D_800CC69C_CD29C","shape":"pointer"}],"outcome":"nonmatch","source":"s32 func_8006014C_60D4C(u32 a0) {\n return ((s8 *)((a0 * 160 - a0 << 2) + D_800CC69C_CD29C))[49];\n}\n","score":11,"maxScore":15,"compileErrors":null,"breakdown":{"insert":5,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 func_8006014C_60D4C(s32 winId) {\n return D_800CC69C_CD29C[winId].unk_31;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8006014C_60D4C` — benchmark function marioparty3:func_8006014C_60D4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8006014C_60D4C\n lui\t$v1, %hi(D_800CC69C_CD29C)\n lw\t$v1, %lo(D_800CC69C_CD29C)($v1)\n sll\t$v0, $a0, 0x2\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x5\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n addu\t$v0, $v0, $v1\n jr\t$ra\n lb\t$v0, 49($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns8 func_8006014C_60D4C(s32 winId);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8006014C_60D4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8006014C_60D4C` — benchmark function marioparty3:func_8006014C_60D4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8006014C_60D4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\taddu\tv0,v0,v1\n 20:\tjr\tra\n 24:\tlb\tv0,49(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f52bf81a0ee885b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 func_8006014C_60D4C\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800CC69C_CD29C\n00000004 R_MIPS_LO16 D_800CC69C_CD29C\n\n\nContents of section .text:\n 0000 3c030000 8c630000 00041080 00441021 <....c.......D.!\n 0010 00021140 00441023 00021080 00431021 ...@.D.#.....C.!\n 0020 03e00008 80420031 00000000 00000000 .....B.1........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8006014C_60D4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80071B40_72740:gcc2.7.2","sym":"func_80071B40_72740","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","arithmetic"],"loc":3,"refSource":"void func_80071B40_72740(ALVoice *voice, s16 priority) {\n voice->priority = priority;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/72740.c#L3-L5","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsh\ta1,22(a0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_80071B40_72740":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6172ae035c3f8dd3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_80071B40_72740\n\n\nContents of section .text:\n 0000 03e00008 a4850016 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void func_80071B40_72740(u16 * a0, u32 a1) {\n a0[11] = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_80071B40_72740(ALVoice *voice, s16 priority) {\n voice->priority = priority;\n}\n/* Warning: struct PVoice_s is not defined (only forward-declared) */\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80071B40_72740` — benchmark function marioparty3:func_80071B40_72740:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80071B40_72740\n jr\t$ra\n sh\t$a1, 22($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80071B40_72740(ALVoice *voice, s16 priority);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80071B40_72740 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80071B40_72740` — benchmark function marioparty3:func_80071B40_72740:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80071B40_72740:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsh\ta1,22(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6172ae035c3f8dd3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_80071B40_72740\n\n\nContents of section .text:\n 0000 03e00008 a4850016 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80071B40_72740\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80071B40_72740 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8008A0D0_8ACD0:gcc2.7.2","sym":"func_8008A0D0_8ACD0","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","arithmetic"],"loc":16,"refSource":"void func_8008A0D0_8ACD0(Mtx *arg0) {\n arg0->m[0][1] =\n arg0->m[0][3] =\n arg0->m[1][0] =\n arg0->m[1][2] =\n arg0->m[2][0] =\n arg0->m[2][1] =\n arg0->m[2][2] =\n arg0->m[2][3] =\n arg0->m[3][0] =\n arg0->m[3][1] =\n arg0->m[3][2] =\n arg0->m[3][3] = 0;\n arg0->m[0][0] = arg0->m[1][1] = 0x10000;\n arg0->m[0][2] = arg0->m[1][3] = 1;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/8ACD0.c#L3-L18","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,60(a0)\n 4:\tsw\tzero,56(a0)\n 8:\tsw\tzero,52(a0)\n c:\tsw\tzero,48(a0)\n 10:\tsw\tzero,44(a0)\n 14:\tsw\tzero,40(a0)\n 18:\tsw\tzero,36(a0)\n 1c:\tsw\tzero,32(a0)\n 20:\tsw\tzero,24(a0)\n 24:\tsw\tzero,16(a0)\n 28:\tsw\tzero,12(a0)\n 2c:\tsw\tzero,4(a0)\n 30:\tlui\tv0,0x1\n 34:\tsw\tv0,20(a0)\n 38:\tsw\tv0,0(a0)\n 3c:\tli\tv0,1\n 40:\tsw\tv0,28(a0)\n 44:\tjr\tra\n 48:\tsw\tv0,8(a0)\n 4c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_8008A0D0_8ACD0":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cfcfe2081306cc0e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_8008A0D0_8ACD0\n\n\nContents of section .text:\n 0000 ac80003c ac800038 ac800034 ac800030 ...<...8...4...0\n 0010 ac80002c ac800028 ac800024 ac800020 ...,...(...$... \n 0020 ac800018 ac800010 ac80000c ac800004 ................\n 0030 3c020001 ac820014 ac820000 24020001 <...........$...\n 0040 ac82001c 03e00008 ac820008 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void func_8008A0D0_8ACD0(s32 * a0) {\n a0[15] = 0;\n a0[14] = 0;\n a0[13] = 0;\n a0[12] = 0;\n a0[11] = 0;\n a0[10] = 0;\n a0[9] = 0;\n a0[8] = 0;\n a0[6] = 0;\n a0[4] = 0;\n a0[3] = 0;\n a0[1] = 0;\n a0[5] = 65536;\n *a0 = 65536;\n a0[7] = 1;\n a0[2] = 1;\n return;\n}\n","score":0,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":19,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8008A0D0_8ACD0(Mtx *arg0) {\n arg0->m[3][3] = 0;\n arg0->m[3][2] = 0;\n arg0->m[3][1] = 0;\n arg0->m[3][0] = 0;\n arg0->m[2][3] = 0;\n arg0->m[2][2] = 0;\n arg0->m[2][1] = 0;\n arg0->m[2][0] = 0;\n arg0->m[1][2] = 0;\n arg0->m[1][0] = 0;\n arg0->m[0][3] = 0;\n arg0->m[0][1] = 0;\n arg0->m[1][1] = 0x10000;\n arg0->m[0][0] = 0x10000;\n arg0->m[1][3] = 1;\n arg0->m[0][2] = 1;\n}\n","score":0,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8008A0D0_8ACD0` — benchmark function marioparty3:func_8008A0D0_8ACD0:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8008A0D0_8ACD0\n sw\t$zero, 60($a0)\n sw\t$zero, 56($a0)\n sw\t$zero, 52($a0)\n sw\t$zero, 48($a0)\n sw\t$zero, 44($a0)\n sw\t$zero, 40($a0)\n sw\t$zero, 36($a0)\n sw\t$zero, 32($a0)\n sw\t$zero, 24($a0)\n sw\t$zero, 16($a0)\n sw\t$zero, 12($a0)\n sw\t$zero, 4($a0)\n lui\t$v0, 0x1\n sw\t$v0, 20($a0)\n sw\t$v0, 0($a0)\n li\t$v0, 1\n sw\t$v0, 28($a0)\n jr\t$ra\n sw\t$v0, 8($a0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8008A0D0_8ACD0(Mtx *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8008A0D0_8ACD0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8008A0D0_8ACD0` — benchmark function marioparty3:func_8008A0D0_8ACD0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8008A0D0_8ACD0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,60(a0)\n 4:\tsw\tzero,56(a0)\n 8:\tsw\tzero,52(a0)\n c:\tsw\tzero,48(a0)\n 10:\tsw\tzero,44(a0)\n 14:\tsw\tzero,40(a0)\n 18:\tsw\tzero,36(a0)\n 1c:\tsw\tzero,32(a0)\n 20:\tsw\tzero,24(a0)\n 24:\tsw\tzero,16(a0)\n 28:\tsw\tzero,12(a0)\n 2c:\tsw\tzero,4(a0)\n 30:\tlui\tv0,0x1\n 34:\tsw\tv0,20(a0)\n 38:\tsw\tv0,0(a0)\n 3c:\tli\tv0,1\n 40:\tsw\tv0,28(a0)\n 44:\tjr\tra\n 48:\tsw\tv0,8(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cfcfe2081306cc0e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_8008A0D0_8ACD0\n\n\nContents of section .text:\n 0000 ac80003c ac800038 ac800034 ac800030 ...<...8...4...0\n 0010 ac80002c ac800028 ac800024 ac800020 ...,...(...$... \n 0020 ac800018 ac800010 ac80000c ac800004 ................\n 0030 3c020001 ac820014 ac820000 24020001 <...........$...\n 0040 ac82001c 03e00008 ac820008 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8008A0D0_8ACD0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8008A0D0_8ACD0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:GWBoardRecordGet:gcc2.7.2","sym":"GWBoardRecordGet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","branch","arithmetic"],"loc":12,"refSource":"u8 *GWBoardRecordGet(s16 arg0) {\n s16 idx = arg0;\n\n if (arg0 < 0) {\n idx = GwSystem.current_board_index;\n }\n\n if (GwSystem.playMode & 1) {\n return (u8 *)&GwCommon.unk_1D[2] + idx * 9;\n }\n return (u8 *)&GwCommon.unk_1D[0x38] + idx * 9;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/save.c#L80-L91","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tsll\ta0,a0,0x10\n 8:\tbgez\ta0,20 \n c:\tnop\n 10:\tlui\tv0,0x0\n 14:\tlbu\tv0,1(v0)\n 18:\tsll\tv0,v0,0x18\n 1c:\tsra\tv1,v0,0x18\n 20:\tlui\tv0,0x0\n 24:\tlbu\tv0,0(v0)\n 28:\tandi\tv0,v0,0x1\n 2c:\tbnez\tv0,4c \n 30:\tsll\tv1,v1,0x10\n 34:\tsra\tv1,v1,0x10\n 38:\tsll\tv0,v1,0x3\n 3c:\taddu\tv0,v0,v1\n 40:\tlui\tv1,0x0\n 44:\tj\t60 \n 48:\taddiu\tv1,v1,85\n 4c:\tsra\tv1,v1,0x10\n 50:\tsll\tv0,v1,0x3\n 54:\taddu\tv0,v0,v1\n 58:\tlui\tv1,0x0\n 5c:\taddiu\tv1,v1,31\n 60:\tjr\tra\n 64:\taddu\tv0,v0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-8ff646f69be78698/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000068 GWBoardRecordGet\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 GwCommon\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 GwSystem\n00000014 R_MIPS_LO16 GwSystem\n00000020 R_MIPS_HI16 GwSystem\n00000024 R_MIPS_LO16 GwSystem\n00000040 R_MIPS_HI16 GwCommon\n00000048 R_MIPS_LO16 GwCommon\n00000044 R_MIPS_26 .text\n00000058 R_MIPS_HI16 GwCommon\n0000005c R_MIPS_LO16 GwCommon\n\n\nContents of section .text:\n 0000 00801821 00042400 04810005 00000000 ...!..$.........\n 0010 3c020000 90420001 00021600 00021e03 <....B..........\n 0020 3c020000 90420000 30420001 14400007 <....B..0B...@..\n 0030 00031c00 00031c03 000310c0 00431021 .............C.!\n 0040 3c030000 08000018 24630055 00031c03 <.......$c.U....\n 0050 000310c0 00431021 3c030000 2463001f .....C.!<...$c..\n 0060 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[{"name":"GwCommon","shape":"struct GwCommon_s (164 B)"},{"name":"GwSystem","shape":"struct GW_SYSTEM (164 B)"}],"outcome":"nonmatch","source":"s32 GWBoardRecordGet(s32 a0) {\n s32 v0;\n s32 v1;\n if (a0 << 16 < 0) a0 = GwSystem.current_board_index << 24 >> 24;\n if ((GwSystem.playMode & 1) != 0) {\n v0 = (a0 << 16 >> 16) * 9;\n v1 = (u32)&GwCommon + 31;\n } else {\n v0 = (a0 << 16 >> 16) * 9;\n v1 = (u32)&GwCommon + 85;\n }\n return v0 + v1;\n}\n","score":20,"maxScore":26,"compileErrors":null,"breakdown":{"insert":0,"delete":3,"replace":2,"opMismatch":0,"argMismatch":15},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"extern ? GwCommon;\nextern u8 GwSystem;\n\nvoid *GWBoardRecordGet(s8 arg0) {\n s32 var_v0;\n s8 var_v1;\n\n var_v1 = arg0;\n if (arg0 & 0x8000) {\n var_v1 = (s8) GwSystem;\n }\n if (!(GwSystem & 1)) {\n var_v0 = (s16) var_v1 * 9;\n } else {\n var_v0 = (s16) var_v1 * 9;\n }\n return var_v0 + &GwCommon;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":98,"lines":16,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":{"decompiler":"asmlift","score":20,"maxScore":26,"ratio":0.7692307692307693,"kinds":{"insert":0,"delete":3,"replace":2,"opMismatch":0,"argMismatch":15}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GWBoardRecordGet` — benchmark function marioparty3:GWBoardRecordGet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GWBoardRecordGet\n move\t$v1, $a0\n sll\t$a0, $a0, 0x10\n bgez\t$a0, .L20\n nop\n lui\t$v0, %hi(GwSystem)\n lbu\t$v0, %lo(GwSystem)($v0)\n sll\t$v0, $v0, 0x18\n sra\t$v1, $v0, 0x18\n.L20:\n lui\t$v0, %hi(GwSystem)\n lbu\t$v0, %lo(GwSystem)($v0)\n andi\t$v0, $v0, 0x1\n bnez\t$v0, .L4c\n sll\t$v1, $v1, 0x10\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x3\n addu\t$v0, $v0, $v1\n lui\t$v1, %hi(GwCommon)\n j\t.L60\n addiu\t$v1, $v1, %lo(GwCommon)\n.L4c:\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x3\n addu\t$v0, $v0, $v1\n lui\t$v1, %hi(GwCommon)\n addiu\t$v1, $v1, %lo(GwCommon)\n.L60:\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GWBoardRecordGet # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GWBoardRecordGet` — benchmark function marioparty3:GWBoardRecordGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:GWBoardRecordGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tsll\ta0,a0,0x10\n 8:\tbgez\ta0,20 \n c:\tnop\n 10:\tlui\tv0,0x0\n 14:\tlbu\tv0,1(v0)\n 18:\tsll\tv0,v0,0x18\n 1c:\tsra\tv1,v0,0x18\n 20:\tlui\tv0,0x0\n 24:\tlbu\tv0,0(v0)\n 28:\tandi\tv0,v0,0x1\n 2c:\tbnez\tv0,4c \n 30:\tsll\tv1,v1,0x10\n 34:\tsra\tv1,v1,0x10\n 38:\tsll\tv0,v1,0x3\n 3c:\taddu\tv0,v0,v1\n 40:\tlui\tv1,0x0\n 44:\tj\t60 \n 48:\taddiu\tv1,v1,85\n 4c:\tsra\tv1,v1,0x10\n 50:\tsll\tv0,v1,0x3\n 54:\taddu\tv0,v0,v1\n 58:\tlui\tv1,0x0\n 5c:\taddiu\tv1,v1,31\n 60:\tjr\tra\n 64:\taddu\tv0,v0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-8ff646f69be78698/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000068 GWBoardRecordGet\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 GwCommon\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 GwSystem\n00000014 R_MIPS_LO16 GwSystem\n00000020 R_MIPS_HI16 GwSystem\n00000024 R_MIPS_LO16 GwSystem\n00000040 R_MIPS_HI16 GwCommon\n00000048 R_MIPS_LO16 GwCommon\n00000044 R_MIPS_26 .text\n00000058 R_MIPS_HI16 GwCommon\n0000005c R_MIPS_LO16 GwCommon\n\n\nContents of section .text:\n 0000 00801821 00042400 04810005 00000000 ...!..$.........\n 0010 3c020000 90420001 00021600 00021e03 <....B..........\n 0020 3c020000 90420000 30420001 14400007 <....B..0B...@..\n 0030 00031c00 00031c03 000310c0 00431021 .............C.!\n 0040 3c030000 08000018 24630055 00031c03 <.......$c.U....\n 0050 000310c0 00431021 3c030000 2463001f .....C.!<...$c..\n 0060 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name GWBoardRecordGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:GWMgNoSet:gcc2.7.2","sym":"GWMgNoSet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic"],"loc":3,"refSource":"void GWMgNoSet(s8 arg0) {\n GwSystem.minigame_index = arg0;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/save.c#L17-L19","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsb\ta0,16(at)\n c:\tnop\n","proto":{"GWMgNoSet":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a0e672d23a10fb4c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c GWMgNoSet\n00000000 *UND*\t00000000 GwSystem\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000008 R_MIPS_LO16 GwSystem\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a0240010 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"GwSystem","shape":"struct GW_SYSTEM (164 B)"}],"outcome":"match","source":"void GWMgNoSet(u32 a0) {\n GwSystem.minigame_index = a0;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern s8 GwSystem;\n\nvoid GWMgNoSet(s8 arg0) {\n GwSystem = arg0;\n}\n","score":2,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GWMgNoSet` — benchmark function marioparty3:GWMgNoSet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GWMgNoSet\n lui\t$at, %hi(GwSystem)\n jr\t$ra\n sb\t$a0, %lo(GwSystem)($at)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GWMgNoSet # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GWMgNoSet` — benchmark function marioparty3:GWMgNoSet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:GWMgNoSet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsb\ta0,16(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a0e672d23a10fb4c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c GWMgNoSet\n00000000 *UND*\t00000000 GwSystem\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000008 R_MIPS_LO16 GwSystem\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a0240010 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GWMgNoSet\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name GWMgNoSet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2","sym":"HuMemUsedMemoryBlockGet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","loop","arithmetic"],"loc":13,"refSource":"u32 HuMemUsedMemoryBlockGet(HeapNode *heap) {\n HeapNode *cur_heap;\n u32 count_free;\n\n cur_heap = heap;\n count_free = 0;\n do {\n count_free += (cur_heap->active ^ TRUE) == FALSE ? 1 : 0;\n cur_heap = cur_heap->next;\n } while (cur_heap != heap);\n\n return count_free;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/malloc.c#L158-L170","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tlbu\tv0,5(v1)\n c:\txori\tv0,v0,0x1\n 10:\tsltiu\tv0,v0,1\n 14:\tlw\tv1,12(v1)\n 18:\tbne\tv1,a0,8 \n 1c:\taddu\ta1,a1,v0\n 20:\tjr\tra\n 24:\tmove\tv0,a1\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c8d399600d2a1b5d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 HuMemUsedMemoryBlockGet\n\n\nContents of section .text:\n 0000 00801821 00002821 90620005 38420001 ...!..(!.b..8B..\n 0010 2c420001 8c63000c 1464fffb 00a22821 ,B...c...d....(!\n 0020 03e00008 00a01021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"struct Struct0 { u8 _pad0[5]; u8 field_5; u8 _pad1[6]; s32 field_12; };\ns32 HuMemUsedMemoryBlockGet(struct Struct0 * a0) {\n s32 v0;\n struct Struct0 * v1;\n s32 v2;\n v1 = a0;\n v2 = 0;\n do {\n v0 = v1->field_5;\n v1 = (struct Struct0 *)v1->field_12;\n v2 = v2 + ((v0 ^ 1) < 1);\n } while (v1 != a0);\n return v2;\n}\n","score":3,"maxScore":11,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 HuMemUsedMemoryBlockGet(HeapNode *heap) {\n HeapNode *var_v1;\n s32 temp_v0;\n u32 var_a1;\n\n var_v1 = heap;\n var_a1 = 0;\n do {\n temp_v0 = var_v1->active == 1;\n var_v1 = var_v1->next;\n var_a1 += temp_v0;\n } while (var_v1 != heap);\n return var_a1;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `HuMemUsedMemoryBlockGet` — benchmark function marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel HuMemUsedMemoryBlockGet\n move\t$v1, $a0\n move\t$a1, $zero\n.L8:\n lbu\t$v0, 5($v1)\n xori\t$v0, $v0, 0x1\n sltiu\t$v0, $v0, 1\n lw\t$v1, 12($v1)\n bne\t$v1, $a0, .L8\n addu\t$a1, $a1, $v0\n jr\t$ra\n move\t$v0, $a1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu32 HuMemUsedMemoryBlockGet(HeapNode *heap);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function HuMemUsedMemoryBlockGet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `HuMemUsedMemoryBlockGet` — benchmark function marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tlbu\tv0,5(v1)\n c:\txori\tv0,v0,0x1\n 10:\tsltiu\tv0,v0,1\n 14:\tlw\tv1,12(v1)\n 18:\tbne\tv1,a0,8 \n 1c:\taddu\ta1,a1,v0\n 20:\tjr\tra\n 24:\tmove\tv0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c8d399600d2a1b5d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 HuMemUsedMemoryBlockGet\n\n\nContents of section .text:\n 0000 00801821 00002821 90620005 38420001 ...!..(!.b..8B..\n 0010 2c420001 8c63000c 1464fffb 00a22821 ,B...c...d....(!\n 0020 03e00008 00a01021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name HuMemUsedMemoryBlockGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2","sym":"HuMemUsedMemorySizeGet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","loop","branch","arithmetic"],"loc":15,"refSource":"u32 HuMemUsedMemorySizeGet(HeapNode *heap) {\n HeapNode *cur_heap;\n u32 total_size;\n\n cur_heap = heap;\n total_size = 0;\n do {\n if (cur_heap->active == TRUE) {\n total_size += cur_heap->size;\n }\n cur_heap = cur_heap->next;\n } while (cur_heap != heap);\n\n return total_size;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/malloc.c#L139-L153","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tli\ta2,1\n c:\tlbu\tv0,5(v1)\n 10:\tbne\tv0,a2,20 \n 14:\tnop\n 18:\tlw\tv0,0(v1)\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\tv1,12(v1)\n 24:\tbne\tv1,a0,c \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,a1\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-73de7a10111e47ad/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 HuMemUsedMemorySizeGet\n\n\nContents of section .text:\n 0000 00801821 00002821 24060001 90620005 ...!..(!$....b..\n 0010 14460003 00000000 8c620000 00a22821 .F.......b....(!\n 0020 8c63000c 1464fff9 00000000 03e00008 .c...d..........\n 0030 00a01021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"struct Struct0 { s32 field_0; u8 _pad0[1]; u8 field_5; u8 _pad1[6]; s32 field_12; };\ns32 HuMemUsedMemorySizeGet(struct Struct0 * a0) {\n struct Struct0 * v0;\n s32 v1;\n s32 v2;\n v0 = a0;\n v1 = 0;\n do {\n if (v0->field_5 != 1) {\n v2 = v1;\n } else {\n v2 = v1 + v0->field_0;\n }\n v1 = v2;\n v0 = (struct Struct0 *)v0->field_12;\n } while (v0 != a0);\n return v1;\n}\n","score":4,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":3,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 HuMemUsedMemorySizeGet(HeapNode *heap) {\n HeapNode *var_v1;\n u32 var_a1;\n\n var_v1 = heap;\n var_a1 = 0;\n do {\n if (var_v1->active == 1) {\n var_a1 += var_v1->size;\n }\n var_v1 = var_v1->next;\n } while (var_v1 != heap);\n return var_a1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `HuMemUsedMemorySizeGet` — benchmark function marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel HuMemUsedMemorySizeGet\n move\t$v1, $a0\n move\t$a1, $zero\n li\t$a2, 1\n.Lc:\n lbu\t$v0, 5($v1)\n bne\t$v0, $a2, .L20\n nop\n lw\t$v0, 0($v1)\n addu\t$a1, $a1, $v0\n.L20:\n lw\t$v1, 12($v1)\n bne\t$v1, $a0, .Lc\n nop\n jr\t$ra\n move\t$v0, $a1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu32 HuMemUsedMemorySizeGet(HeapNode *heap);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function HuMemUsedMemorySizeGet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `HuMemUsedMemorySizeGet` — benchmark function marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tli\ta2,1\n c:\tlbu\tv0,5(v1)\n 10:\tbne\tv0,a2,20 \n 14:\tnop\n 18:\tlw\tv0,0(v1)\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\tv1,12(v1)\n 24:\tbne\tv1,a0,c \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-73de7a10111e47ad/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 HuMemUsedMemorySizeGet\n\n\nContents of section .text:\n 0000 00801821 00002821 24060001 90620005 ...!..(!$....b..\n 0010 14460003 00000000 8c620000 00a22821 .F.......b....(!\n 0020 8c63000c 1464fff9 00000000 03e00008 .c...d..........\n 0030 00a01021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name HuMemUsedMemorySizeGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:UnlinkProcess:gcc2.7.2","sym":"UnlinkProcess","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","arithmetic"],"loc":10,"refSource":"static void UnlinkProcess(Process **root, Process *process) {\n if (process->next) {\n process->next->youngest_child = process->youngest_child;\n }\n if (process->youngest_child) {\n process->youngest_child->next = process->next;\n } else {\n *root = process->next;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/process.c#L45-L54","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,0(a1)\n 4:\tbeqz\tv1,14 \n 8:\tnop\n c:\tlw\tv0,4(a1)\n 10:\tsw\tv0,4(v1)\n 14:\tlw\tv1,4(a1)\n 18:\tbeqz\tv1,2c \n 1c:\tnop\n 20:\tlw\tv0,0(a1)\n 24:\tj\t34 \n 28:\tsw\tv0,0(v1)\n 2c:\tlw\tv0,0(a1)\n 30:\tsw\tv0,0(a0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"UnlinkProcess":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cc80fd6fc668362f/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l F .text\t0000003c UnlinkProcess\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8ca30000 10600003 00000000 8ca20004 .....`..........\n 0010 ac620004 8ca30004 10600004 00000000 .b.......`......\n 0020 8ca20000 0800000d ac620000 8ca20000 .........b......\n 0030 ac820000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void UnlinkProcess(s32 * a0, s32 * a1) {\n s32 v0;\n s32 v1;\n if (*a1 != 0) ((s32 *)*a1)[1] = a1[1];\n if (a1[1] == 0) {\n v1 = *a1;\n *a0 = v1;\n } else {\n v0 = *a1;\n *(s32 *)a1[1] = v0;\n }\n return;\n}\n","score":5,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":13,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void UnlinkProcess(Process **root, Process *process) {\n Process *temp_v1;\n Process *temp_v1_2;\n\n temp_v1 = process->next;\n if (temp_v1 != NULL) {\n temp_v1->youngest_child = process->youngest_child;\n }\n temp_v1_2 = process->youngest_child;\n if (temp_v1_2 != NULL) {\n temp_v1_2->next = process->next;\n return;\n }\n *root = process->next;\n}\n","score":0,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UnlinkProcess` — benchmark function marioparty3:UnlinkProcess:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel UnlinkProcess\n lw\t$v1, 0($a1)\n beqz\t$v1, .L14\n nop\n lw\t$v0, 4($a1)\n sw\t$v0, 4($v1)\n.L14:\n lw\t$v1, 4($a1)\n beqz\t$v1, .L2c\n nop\n lw\t$v0, 0($a1)\n j\t.L34\n sw\t$v0, 0($v1)\n.L2c:\n lw\t$v0, 0($a1)\n sw\t$v0, 0($a0)\n.L34:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nstatic void UnlinkProcess(Process **root, Process *process);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UnlinkProcess # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UnlinkProcess` — benchmark function marioparty3:UnlinkProcess:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: da9e6e7e6565a2e84cf1740117b92e09100c75964be267d024217d802e16a1ca\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:UnlinkProcess:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,0(a1)\n 4:\tbeqz\tv1,14 \n 8:\tnop\n c:\tlw\tv0,4(a1)\n 10:\tsw\tv0,4(v1)\n 14:\tlw\tv1,4(a1)\n 18:\tbeqz\tv1,2c \n 1c:\tnop\n 20:\tlw\tv0,0(a1)\n 24:\tj\t34 \n 28:\tsw\tv0,0(v1)\n 2c:\tlw\tv0,0(a1)\n 30:\tsw\tv0,0(a0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cc80fd6fc668362f/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l F .text\t0000003c UnlinkProcess\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8ca30000 10600003 00000000 8ca20004 .....`..........\n 0010 ac620004 8ca30004 10600004 00000000 .b.......`......\n 0020 8ca20000 0800000d ac620000 8ca20000 .........b......\n 0030 ac820000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"UnlinkProcess\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name UnlinkProcess # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:CalcByteArraySum:agbcc","sym":"CalcByteArraySum","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","loop","pointer","array"],"loc":7,"refSource":"u32 CalcByteArraySum(const u8 *data, u32 length)\n{\n u32 sum, i;\n for (sum = 0, i = 0; i < length; i++)\n sum += data[i];\n return sum;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L256-L262","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcByteArraySum\n\t.type\t CalcByteArraySum,function\n\t.thumb_func\nCalcByteArraySum:\n\tpush\t{r4, lr}\n\tadd\tr4, r0, #0\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r4, r2\n\tldrb\tr0, [r0]\n\tadd\tr3, r3, r0\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, r1\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcByteArraySum,.Lfe1-CalcByteArraySum\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 CalcByteArraySum(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n v1 = 0;\n for (v0 = 0; v0 < a1; v0 = v0 + 1) {\n v1 = v1 + *(u8 *)(a0 + v0);\n }\n return v1;\n}\n","score":0,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 CalcByteArraySum(s32 arg0, u32 arg1) {\n s32 var_r3;\n u32 var_r2;\n\n var_r3 = 0;\n var_r2 = 0;\n if (arg1 > 0U) {\n do {\n var_r3 += *(arg0 + var_r2);\n var_r2 += 1;\n } while (var_r2 < arg1);\n }\n return var_r3;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3929: invalid type argument of `unary *'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CalcByteArraySum` — benchmark function pokeemerald:CalcByteArraySum:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcByteArraySum\n\t.type\t CalcByteArraySum,function\n\t.thumb_func\nCalcByteArraySum:\n\tpush\t{r4, lr}\n\tadd\tr4, r0, #0\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r4, r2\n\tldrb\tr0, [r0]\n\tadd\tr3, r3, r0\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, r1\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcByteArraySum,.Lfe1-CalcByteArraySum\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CalcByteArraySum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CalcByteArraySum` — benchmark function pokeemerald:CalcByteArraySum:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalcByteArraySum:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcByteArraySum\n\t.type\t CalcByteArraySum,function\n\t.thumb_func\nCalcByteArraySum:\n\tpush\t{r4, lr}\n\tadd\tr4, r0, #0\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r4, r2\n\tldrb\tr0, [r0]\n\tadd\tr3, r3, r0\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, r1\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcByteArraySum,.Lfe1-CalcByteArraySum\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalcByteArraySum # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:CalcCRC16:agbcc","sym":"CalcCRC16","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","loop","branch","nested-loop"],"loc":18,"refSource":"u16 CalcCRC16(const u8 *data, s32 length)\n{\n u16 i, j;\n u16 crc = 0x1121;\n\n for (i = 0; i < length; i++)\n {\n crc ^= data[i];\n for (j = 0; j < 8; j++)\n {\n if (crc & 1)\n crc = (crc >> 1) ^ 0x8408;\n else\n crc >>= 1;\n }\n }\n return ~crc;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L222-L239","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16\n\t.type\t CalcCRC16,function\n\t.thumb_func\nCalcCRC16:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L15\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbge\t.L4\t@cond_branch\n\tmov\tr6, #0x1\n\tldr\tr0, .L15+0x4\n\tadd\tr5, r0, #0\n.L6:\n\tadd\tr0, r7, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tmov\tr1, #0x0\n\tadd\tr3, r3, #0x1\n.L10:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r6\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tlsr\tr0, r2, #0x1\n\teor\tr0, r0, r5\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tb\t.L9\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t0x1121\n\t.word\t0x8408\n.L11:\n\tlsr\tr2, r2, #0x1\n.L9:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0x7\n\tbls\t.L10\t@cond_branch\n\tlsl\tr0, r3, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcCRC16,.Lfe1-CalcCRC16\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 CalcCRC16(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n if (0 >= a1) {\n v4 = 4385;\n } else {\n v0 = 0;\n v1 = 4385;\n do {\n v2 = v1 ^ *(u8 *)(a0 + v0);\n v3 = 0;\n do {\n if ((v2 & 1) == 0) {\n v4 = v2 >> 1;\n } else {\n v4 = (u16)(v2 >> 1 ^ 33800);\n }\n v2 = v4;\n v3 = (u16)(v3 + 1);\n } while (v3 <= 7);\n v1 = v4;\n v0 = (u16)(v0 + 1);\n } while (v0 < a1);\n v4 = v1;\n }\n return (u16)~v4;\n}\n","score":45,"maxScore":55,"compileErrors":null,"breakdown":{"insert":13,"delete":5,"replace":2,"opMismatch":5,"argMismatch":20},"quality":{"score":90,"lines":30,"gotos":0,"casts":5,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u16 CalcCRC16(s32 arg0, s32 arg1) {\n u16 var_r1;\n u16 var_r2;\n u16 var_r3;\n\n var_r2 = 0x1121;\n var_r3 = 0;\n if (arg1 > 0) {\n do {\n var_r2 ^= *(arg0 + var_r3);\n var_r1 = 0;\nloop_3:\n if (var_r2 & 1) {\n var_r2 = (var_r2 >> 1) ^ 0x8408;\n } else {\n var_r2 = (u16) (var_r2 >> 1);\n }\n var_r1 += 1;\n if ((u32) var_r1 <= 7U) {\n goto loop_3;\n }\n var_r3 += 1;\n } while ((s32) var_r3 < arg1);\n }\n return (u16) ~var_r2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":84,"lines":25,"gotos":1,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3930: invalid type argument of `unary *'"]},"gapSize":{"decompiler":"asmlift","score":45,"maxScore":55,"ratio":0.8181818181818182,"kinds":{"insert":13,"delete":5,"replace":2,"opMismatch":5,"argMismatch":20}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CalcCRC16` — benchmark function pokeemerald:CalcCRC16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16\n\t.type\t CalcCRC16,function\n\t.thumb_func\nCalcCRC16:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L15\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbge\t.L4\t@cond_branch\n\tmov\tr6, #0x1\n\tldr\tr0, .L15+0x4\n\tadd\tr5, r0, #0\n.L6:\n\tadd\tr0, r7, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tmov\tr1, #0x0\n\tadd\tr3, r3, #0x1\n.L10:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r6\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tlsr\tr0, r2, #0x1\n\teor\tr0, r0, r5\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tb\t.L9\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t0x1121\n\t.word\t0x8408\n.L11:\n\tlsr\tr2, r2, #0x1\n.L9:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0x7\n\tbls\t.L10\t@cond_branch\n\tlsl\tr0, r3, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcCRC16,.Lfe1-CalcCRC16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CalcCRC16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CalcCRC16` — benchmark function pokeemerald:CalcCRC16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalcCRC16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16\n\t.type\t CalcCRC16,function\n\t.thumb_func\nCalcCRC16:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L15\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbge\t.L4\t@cond_branch\n\tmov\tr6, #0x1\n\tldr\tr0, .L15+0x4\n\tadd\tr5, r0, #0\n.L6:\n\tadd\tr0, r7, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tmov\tr1, #0x0\n\tadd\tr3, r3, #0x1\n.L10:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r6\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tlsr\tr0, r2, #0x1\n\teor\tr0, r0, r5\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tb\t.L9\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t0x1121\n\t.word\t0x8408\n.L11:\n\tlsr\tr2, r2, #0x1\n.L9:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0x7\n\tbls\t.L10\t@cond_branch\n\tlsl\tr0, r3, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcCRC16,.Lfe1-CalcCRC16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalcCRC16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:CalcCRC16WithTable:agbcc","sym":"CalcCRC16WithTable","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","array","bitwise","cast","table"],"loc":14,"refSource":"u16 CalcCRC16WithTable(const u8 *data, u32 length)\n{\n u16 i;\n u16 crc = 0x1121;\n u8 byte;\n\n for (i = 0; i < length; i++)\n {\n byte = crc >> 8;\n crc ^= data[i];\n crc = byte ^ sCrc16Table[(u8)crc];\n }\n return ~crc;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L241-L254","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t1, 0\n\t.type\t sCrc16Table,object\nsCrc16Table:\n\t.short\t0x0\n\t.short\t0x1189\n\t.short\t0x2312\n\t.short\t0x329b\n\t.short\t0x4624\n\t.short\t0x57ad\n\t.short\t0x6536\n\t.short\t0x74bf\n\t.short\t0x8c48\n\t.short\t0x9dc1\n\t.short\t0xaf5a\n\t.short\t0xbed3\n\t.short\t0xca6c\n\t.short\t0xdbe5\n\t.short\t0xe97e\n\t.short\t0xf8f7\n\t.short\t0x1081\n\t.short\t0x108\n\t.short\t0x3393\n\t.short\t0x221a\n\t.short\t0x56a5\n\t.short\t0x472c\n\t.short\t0x75b7\n\t.short\t0x643e\n\t.short\t0x9cc9\n\t.short\t0x8d40\n\t.short\t0xbfdb\n\t.short\t0xae52\n\t.short\t0xdaed\n\t.short\t0xcb64\n\t.short\t0xf9ff\n\t.short\t0xe876\n\t.short\t0x2102\n\t.short\t0x308b\n\t.short\t0x210\n\t.short\t0x1399\n\t.short\t0x6726\n\t.short\t0x76af\n\t.short\t0x4434\n\t.short\t0x55bd\n\t.short\t0xad4a\n\t.short\t0xbcc3\n\t.short\t0x8e58\n\t.short\t0x9fd1\n\t.short\t0xeb6e\n\t.short\t0xfae7\n\t.short\t0xc87c\n\t.short\t0xd9f5\n\t.short\t0x3183\n\t.short\t0x200a\n\t.short\t0x1291\n\t.short\t0x318\n\t.short\t0x77a7\n\t.short\t0x662e\n\t.short\t0x54b5\n\t.short\t0x453c\n\t.short\t0xbdcb\n\t.short\t0xac42\n\t.short\t0x9ed9\n\t.short\t0x8f50\n\t.short\t0xfbef\n\t.short\t0xea66\n\t.short\t0xd8fd\n\t.short\t0xc974\n\t.short\t0x4204\n\t.short\t0x538d\n\t.short\t0x6116\n\t.short\t0x709f\n\t.short\t0x420\n\t.short\t0x15a9\n\t.short\t0x2732\n\t.short\t0x36bb\n\t.short\t0xce4c\n\t.short\t0xdfc5\n\t.short\t0xed5e\n\t.short\t0xfcd7\n\t.short\t0x8868\n\t.short\t0x99e1\n\t.short\t0xab7a\n\t.short\t0xbaf3\n\t.short\t0x5285\n\t.short\t0x430c\n\t.short\t0x7197\n\t.short\t0x601e\n\t.short\t0x14a1\n\t.short\t0x528\n\t.short\t0x37b3\n\t.short\t0x263a\n\t.short\t0xdecd\n\t.short\t0xcf44\n\t.short\t0xfddf\n\t.short\t0xec56\n\t.short\t0x98e9\n\t.short\t0x8960\n\t.short\t0xbbfb\n\t.short\t0xaa72\n\t.short\t0x6306\n\t.short\t0x728f\n\t.short\t0x4014\n\t.short\t0x519d\n\t.short\t0x2522\n\t.short\t0x34ab\n\t.short\t0x630\n\t.short\t0x17b9\n\t.short\t0xef4e\n\t.short\t0xfec7\n\t.short\t0xcc5c\n\t.short\t0xddd5\n\t.short\t0xa96a\n\t.short\t0xb8e3\n\t.short\t0x8a78\n\t.short\t0x9bf1\n\t.short\t0x7387\n\t.short\t0x620e\n\t.short\t0x5095\n\t.short\t0x411c\n\t.short\t0x35a3\n\t.short\t0x242a\n\t.short\t0x16b1\n\t.short\t0x738\n\t.short\t0xffcf\n\t.short\t0xee46\n\t.short\t0xdcdd\n\t.short\t0xcd54\n\t.short\t0xb9eb\n\t.short\t0xa862\n\t.short\t0x9af9\n\t.short\t0x8b70\n\t.short\t0x8408\n\t.short\t0x9581\n\t.short\t0xa71a\n\t.short\t0xb693\n\t.short\t0xc22c\n\t.short\t0xd3a5\n\t.short\t0xe13e\n\t.short\t0xf0b7\n\t.short\t0x840\n\t.short\t0x19c9\n\t.short\t0x2b52\n\t.short\t0x3adb\n\t.short\t0x4e64\n\t.short\t0x5fed\n\t.short\t0x6d76\n\t.short\t0x7cff\n\t.short\t0x9489\n\t.short\t0x8500\n\t.short\t0xb79b\n\t.short\t0xa612\n\t.short\t0xd2ad\n\t.short\t0xc324\n\t.short\t0xf1bf\n\t.short\t0xe036\n\t.short\t0x18c1\n\t.short\t0x948\n\t.short\t0x3bd3\n\t.short\t0x2a5a\n\t.short\t0x5ee5\n\t.short\t0x4f6c\n\t.short\t0x7df7\n\t.short\t0x6c7e\n\t.short\t0xa50a\n\t.short\t0xb483\n\t.short\t0x8618\n\t.short\t0x9791\n\t.short\t0xe32e\n\t.short\t0xf2a7\n\t.short\t0xc03c\n\t.short\t0xd1b5\n\t.short\t0x2942\n\t.short\t0x38cb\n\t.short\t0xa50\n\t.short\t0x1bd9\n\t.short\t0x6f66\n\t.short\t0x7eef\n\t.short\t0x4c74\n\t.short\t0x5dfd\n\t.short\t0xb58b\n\t.short\t0xa402\n\t.short\t0x9699\n\t.short\t0x8710\n\t.short\t0xf3af\n\t.short\t0xe226\n\t.short\t0xd0bd\n\t.short\t0xc134\n\t.short\t0x39c3\n\t.short\t0x284a\n\t.short\t0x1ad1\n\t.short\t0xb58\n\t.short\t0x7fe7\n\t.short\t0x6e6e\n\t.short\t0x5cf5\n\t.short\t0x4d7c\n\t.short\t0xc60c\n\t.short\t0xd785\n\t.short\t0xe51e\n\t.short\t0xf497\n\t.short\t0x8028\n\t.short\t0x91a1\n\t.short\t0xa33a\n\t.short\t0xb2b3\n\t.short\t0x4a44\n\t.short\t0x5bcd\n\t.short\t0x6956\n\t.short\t0x78df\n\t.short\t0xc60\n\t.short\t0x1de9\n\t.short\t0x2f72\n\t.short\t0x3efb\n\t.short\t0xd68d\n\t.short\t0xc704\n\t.short\t0xf59f\n\t.short\t0xe416\n\t.short\t0x90a9\n\t.short\t0x8120\n\t.short\t0xb3bb\n\t.short\t0xa232\n\t.short\t0x5ac5\n\t.short\t0x4b4c\n\t.short\t0x79d7\n\t.short\t0x685e\n\t.short\t0x1ce1\n\t.short\t0xd68\n\t.short\t0x3ff3\n\t.short\t0x2e7a\n\t.short\t0xe70e\n\t.short\t0xf687\n\t.short\t0xc41c\n\t.short\t0xd595\n\t.short\t0xa12a\n\t.short\t0xb0a3\n\t.short\t0x8238\n\t.short\t0x93b1\n\t.short\t0x6b46\n\t.short\t0x7acf\n\t.short\t0x4854\n\t.short\t0x59dd\n\t.short\t0x2d62\n\t.short\t0x3ceb\n\t.short\t0xe70\n\t.short\t0x1ff9\n\t.short\t0xf78f\n\t.short\t0xe606\n\t.short\t0xd49d\n\t.short\t0xc514\n\t.short\t0xb1ab\n\t.short\t0xa022\n\t.short\t0x92b9\n\t.short\t0x8330\n\t.short\t0x7bc7\n\t.short\t0x6a4e\n\t.short\t0x58d5\n\t.short\t0x495c\n\t.short\t0x3de3\n\t.short\t0x2c6a\n\t.short\t0x1ef1\n\t.short\t0xf78\n\t.size\t sCrc16Table,512\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16WithTable\n\t.type\t CalcCRC16WithTable,function\n\t.thumb_func\nCalcCRC16WithTable:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L8\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L8+0x4\n.L6:\n\tlsr\tr1, r2, #0x8\n\tadd\tr0, r5, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tlsl\tr0, r2, #0x18\n\tlsr\tr0, r0, #0x17\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tadd\tr2, r0, #0\n\teor\tr2, r2, r1\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x1121\n\t.word\tsCrc16Table\n.Lfe1:\n\t.size\t CalcCRC16WithTable,.Lfe1-CalcCRC16WithTable\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-dbb6d12e4277.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'CalcCRC16WithTable' — lift: cannot lift 'CalcCRC16WithTable': reads the sub-word data table 'sCrc16Table' (.short) — sub-word table data is not modelled */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* \t.section .rodata */\n/* \t.align\t1, 0 */\n/* \t.type\t sCrc16Table,object */\n/* sCrc16Table: */\n/* \t.short\t0x0 */\n/* \t.short\t0x1189 */\n/* \t.short\t0x2312 */\n/* \t.short\t0x329b */\n/* \t.short\t0x4624 */\n/* \t.short\t0x57ad */\n/* \t.short\t0x6536 */\n/* \t.short\t0x74bf */\n/* \t.short\t0x8c48 */\n/* \t.short\t0x9dc1 */\n/* \t.short\t0xaf5a */\n/* \t.short\t0xbed3 */\n/* \t.short\t0xca6c */\n/* \t.short\t0xdbe5 */\n/* \t.short\t0xe97e */\n/* \t.short\t0xf8f7 */\n/* \t.short\t0x1081 */\n/* \t.short\t0x108 */\n/* \t.short\t0x3393 */\n/* \t.short\t0x221a */\n/* \t.short\t0x56a5 */\n/* \t.short\t0x472c */\n/* \t.short\t0x75b7 */\n/* \t.short\t0x643e */\n/* \t.short\t0x9cc9 */\n/* \t.short\t0x8d40 */\n/* \t.short\t0xbfdb */\n/* \t.short\t0xae52 */\n/* \t.short\t0xdaed */\n/* \t.short\t0xcb64 */\n/* \t.short\t0xf9ff */\n/* \t.short\t0xe876 */\n/* \t.short\t0x2102 */\n/* \t.short\t0x308b */\n/* \t.short\t0x210 */\n/* \t.short\t0x1399 */\n/* \t.short\t0x6726 */\n/* \t.short\t0x76af */\n/* \t.short\t0x4434 */\n/* \t.short\t0x55bd */\n/* \t.short\t0xad4a */\n/* \t.short\t0xbcc3 */\n/* \t.short\t0x8e58 */\n/* \t.short\t0x9fd1 */\n/* \t.short\t0xeb6e */\n/* \t.short\t0xfae7 */\n/* \t.short\t0xc87c */\n/* \t.short\t0xd9f5 */\n/* \t.short\t0x3183 */\n/* \t.short\t0x200a */\n/* \t.short\t0x1291 */\n/* \t.short\t0x318 */\n/* \t.short\t0x77a7 */\n/* \t.short\t0x662e */\n/* \t.short\t0x54b5 */\n/* \t.short\t0x453c */\n/* \t.short\t0xbdcb */\n/* \t.short\t0xac42 */\n/* \t.short\t0x9ed9 */\n/* \t.short\t0x8f50 */\n/* \t.short\t0xfbef */\n/* \t.short\t0xea66 */\n/* \t.short\t0xd8fd */\n/* \t.short\t0xc974 */\n/* \t.short\t0x4204 */\n/* \t.short\t0x538d */\n/* \t.short\t0x6116 */\n/* \t.short\t0x709f */\n/* \t.short\t0x420 */\n/* \t.short\t0x15a9 */\n/* \t.short\t0x2732 */\n/* \t.short\t0x36bb */\n/* \t.short\t0xce4c */\n/* \t.short\t0xdfc5 */\n/* \t.short\t0xed5e */\n/* \t.short\t0xfcd7 */\n/* \t.short\t0x8868 */\n/* \t.short\t0x99e1 */\n/* \t.short\t0xab7a */\n/* \t.short\t0xbaf3 */\n/* \t.short\t0x5285 */\n/* \t.short\t0x430c */\n/* \t.short\t0x7197 */\n/* \t.short\t0x601e */\n/* \t.short\t0x14a1 */\n/* \t.short\t0x528 */\n/* \t.short\t0x37b3 */\n/* \t.short\t0x263a */\n/* \t.short\t0xdecd */\n/* \t.short\t0xcf44 */\n/* \t.short\t0xfddf */\n/* \t.short\t0xec56 */\n/* \t.short\t0x98e9 */\n/* \t.short\t0x8960 */\n/* \t.short\t0xbbfb */\n/* \t.short\t0xaa72 */\n/* \t.short\t0x6306 */\n/* \t.short\t0x728f */\n/* \t.short\t0x4014 */\n/* \t.short\t0x519d */\n/* \t.short\t0x2522 */\n/* \t.short\t0x34ab */\n/* \t.short\t0x630 */\n/* \t.short\t0x17b9 */\n/* \t.short\t0xef4e */\n/* \t.short\t0xfec7 */\n/* \t.short\t0xcc5c */\n/* \t.short\t0xddd5 */\n/* \t.short\t0xa96a */\n/* \t.short\t0xb8e3 */\n/* \t.short\t0x8a78 */\n/* \t.short\t0x9bf1 */\n/* \t.short\t0x7387 */\n/* \t.short\t0x620e */\n/* \t.short\t0x5095 */\n/* \t.short\t0x411c */\n/* \t.short\t0x35a3 */\n/* \t.short\t0x242a */\n/* \t.short\t0x16b1 */\n/* \t.short\t0x738 */\n/* \t.short\t0xffcf */\n/* \t.short\t0xee46 */\n/* \t.short\t0xdcdd */\n/* \t.short\t0xcd54 */\n/* \t.short\t0xb9eb */\n/* \t.short\t0xa862 */\n/* \t.short\t0x9af9 */\n/* \t.short\t0x8b70 */\n/* \t.short\t0x8408 */\n/* \t.short\t0x9581 */\n/* \t.short\t0xa71a */\n/* \t.short\t0xb693 */\n/* \t.short\t0xc22c */\n/* \t.short\t0xd3a5 */\n/* \t.short\t0xe13e */\n/* \t.short\t0xf0b7 */\n/* \t.short\t0x840 */\n/* \t.short\t0x19c9 */\n/* \t.short\t0x2b52 */\n/* \t.short\t0x3adb */\n/* \t.short\t0x4e64 */\n/* \t.short\t0x5fed */\n/* \t.short\t0x6d76 */\n/* \t.short\t0x7cff */\n/* \t.short\t0x9489 */\n/* \t.short\t0x8500 */\n/* \t.short\t0xb79b */\n/* \t.short\t0xa612 */\n/* \t.short\t0xd2ad */\n/* \t.short\t0xc324 */\n/* \t.short\t0xf1bf */\n/* \t.short\t0xe036 */\n/* \t.short\t0x18c1 */\n/* \t.short\t0x948 */\n/* \t.short\t0x3bd3 */\n/* \t.short\t0x2a5a */\n/* \t.short\t0x5ee5 */\n/* \t.short\t0x4f6c */\n/* \t.short\t0x7df7 */\n/* \t.short\t0x6c7e */\n/* \t.short\t0xa50a */\n/* \t.short\t0xb483 */\n/* \t.short\t0x8618 */\n/* \t.short\t0x9791 */\n/* \t.short\t0xe32e */\n/* \t.short\t0xf2a7 */\n/* \t.short\t0xc03c */\n/* \t.short\t0xd1b5 */\n/* \t.short\t0x2942 */\n/* \t.short\t0x38cb */\n/* \t.short\t0xa50 */\n/* \t.short\t0x1bd9 */\n/* \t.short\t0x6f66 */\n/* \t.short\t0x7eef */\n/* \t.short\t0x4c74 */\n/* \t.short\t0x5dfd */\n/* \t.short\t0xb58b */\n/* \t.short\t0xa402 */\n/* \t.short\t0x9699 */\n/* \t.short\t0x8710 */\n/* \t.short\t0xf3af */\n/* \t.short\t0xe226 */\n/* \t.short\t0xd0bd */\n/* \t.short\t0xc134 */\n/* \t.short\t0x39c3 */\n/* \t.short\t0x284a */\n/* \t.short\t0x1ad1 */\n/* \t.short\t0xb58 */\n/* \t.short\t0x7fe7 */\n/* \t.short\t0x6e6e */\n/* \t.short\t0x5cf5 */\n/* \t.short\t0x4d7c */\n/* \t.short\t0xc60c */\n/* \t.short\t0xd785 */\n/* \t.short\t0xe51e */\n/* \t.short\t0xf497 */\n/* \t.short\t0x8028 */\n/* \t.short\t0x91a1 */\n/* \t.short\t0xa33a */\n/* \t.short\t0xb2b3 */\n/* \t.short\t0x4a44 */\n/* \t.short\t0x5bcd */\n/* \t.short\t0x6956 */\n/* \t.short\t0x78df */\n/* \t.short\t0xc60 */\n/* \t.short\t0x1de9 */\n/* \t.short\t0x2f72 */\n/* \t.short\t0x3efb */\n/* \t.short\t0xd68d */\n/* \t.short\t0xc704 */\n/* \t.short\t0xf59f */\n/* \t.short\t0xe416 */\n/* \t.short\t0x90a9 */\n/* \t.short\t0x8120 */\n/* \t.short\t0xb3bb */\n/* \t.short\t0xa232 */\n/* \t.short\t0x5ac5 */\n/* \t.short\t0x4b4c */\n/* \t.short\t0x79d7 */\n/* \t.short\t0x685e */\n/* \t.short\t0x1ce1 */\n/* \t.short\t0xd68 */\n/* \t.short\t0x3ff3 */\n/* \t.short\t0x2e7a */\n/* \t.short\t0xe70e */\n/* \t.short\t0xf687 */\n/* \t.short\t0xc41c */\n/* \t.short\t0xd595 */\n/* \t.short\t0xa12a */\n/* \t.short\t0xb0a3 */\n/* \t.short\t0x8238 */\n/* \t.short\t0x93b1 */\n/* \t.short\t0x6b46 */\n/* \t.short\t0x7acf */\n/* \t.short\t0x4854 */\n/* \t.short\t0x59dd */\n/* \t.short\t0x2d62 */\n/* \t.short\t0x3ceb */\n/* \t.short\t0xe70 */\n/* \t.short\t0x1ff9 */\n/* \t.short\t0xf78f */\n/* \t.short\t0xe606 */\n/* \t.short\t0xd49d */\n/* \t.short\t0xc514 */\n/* \t.short\t0xb1ab */\n/* \t.short\t0xa022 */\n/* \t.short\t0x92b9 */\n/* \t.short\t0x8330 */\n/* \t.short\t0x7bc7 */\n/* \t.short\t0x6a4e */\n/* \t.short\t0x58d5 */\n/* \t.short\t0x495c */\n/* \t.short\t0x3de3 */\n/* \t.short\t0x2c6a */\n/* \t.short\t0x1ef1 */\n/* \t.short\t0xf78 */\n/* \t.size\t sCrc16Table,512 */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tCalcCRC16WithTable */\n/* \t.type\t CalcCRC16WithTable,function */\n/* \t.thumb_func */\n/* CalcCRC16WithTable: */\n/* \tpush\t{r4, r5, r6, lr} */\n/* \tadd\tr5, r0, #0 */\n/* \tadd\tr4, r1, #0 */\n/* \tldr\tr2, .L8 */\n/* \tmov\tr3, #0x0 */\n/* \tcmp\tr3, r4 */\n/* \tbcs\t.L4\t@cond_branch */\n/* \tldr\tr6, .L8+0x4 */\n/* .L6: */\n/* \tlsr\tr1, r2, #0x8 */\n/* \tadd\tr0, r5, r3 */\n/* \tldrb\tr0, [r0] */\n/* \teor\tr2, r2, r0 */\n/* \tlsl\tr0, r2, #0x18 */\n/* \tlsr\tr0, r0, #0x17 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tadd\tr2, r0, #0 */\n/* \teor\tr2, r2, r1 */\n/* \tadd\tr0, r3, #0x1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr3, r0, #0x10 */\n/* \tcmp\tr3, r4 */\n/* \tbcc\t.L6\t@cond_branch */\n/* .L4: */\n/* \tmvn\tr0, r2 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tpop\t{r4, r5, r6} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .L9: */\n/* \t.align\t2, 0 */\n/* .L8: */\n/* \t.word\t0x1121 */\n/* \t.word\tsCrc16Table */\n/* .Lfe1: */\n/* \t.size\t CalcCRC16WithTable,.Lfe1-CalcCRC16WithTable */\n/* .text */\n/* \t.align\t2, 0 */\nvoid CalcCRC16WithTable(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'CalcCRC16WithTable': reads the sub-word data table 'sCrc16Table' (.short) — sub-word table data is not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":315,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'CalcCRC16WithTable': reads the sub-word data table 'sCrc16Table' (.short) — sub-word table data is not modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u16 CalcCRC16WithTable(u8 *data, u32 length) {\n u16 var_r2;\n u16 var_r3;\n\n var_r2 = 0x1121;\n var_r3 = 0;\n if (length > 0U) {\n do {\n var_r2 = *(((u32) ((var_r2 ^ data[var_r3]) << 0x18) >> 0x17) + sCrc16Table) ^ (var_r2 >> 8);\n var_r3 += 1;\n } while ((u32) var_r3 < length);\n }\n return (u16) ~var_r2;\n}\n","score":19,"maxScore":33,"compileErrors":null,"breakdown":{"insert":1,"delete":3,"replace":3,"opMismatch":1,"argMismatch":11},"quality":{"score":98,"lines":13,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":19,"maxScore":33,"ratio":0.5757575757575758,"kinds":{"insert":1,"delete":3,"replace":3,"opMismatch":1,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CalcCRC16WithTable` — benchmark function pokeemerald:CalcCRC16WithTable:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t1, 0\n\t.type\t sCrc16Table,object\nsCrc16Table:\n\t.short\t0x0\n\t.short\t0x1189\n\t.short\t0x2312\n\t.short\t0x329b\n\t.short\t0x4624\n\t.short\t0x57ad\n\t.short\t0x6536\n\t.short\t0x74bf\n\t.short\t0x8c48\n\t.short\t0x9dc1\n\t.short\t0xaf5a\n\t.short\t0xbed3\n\t.short\t0xca6c\n\t.short\t0xdbe5\n\t.short\t0xe97e\n\t.short\t0xf8f7\n\t.short\t0x1081\n\t.short\t0x108\n\t.short\t0x3393\n\t.short\t0x221a\n\t.short\t0x56a5\n\t.short\t0x472c\n\t.short\t0x75b7\n\t.short\t0x643e\n\t.short\t0x9cc9\n\t.short\t0x8d40\n\t.short\t0xbfdb\n\t.short\t0xae52\n\t.short\t0xdaed\n\t.short\t0xcb64\n\t.short\t0xf9ff\n\t.short\t0xe876\n\t.short\t0x2102\n\t.short\t0x308b\n\t.short\t0x210\n\t.short\t0x1399\n\t.short\t0x6726\n\t.short\t0x76af\n\t.short\t0x4434\n\t.short\t0x55bd\n\t.short\t0xad4a\n\t.short\t0xbcc3\n\t.short\t0x8e58\n\t.short\t0x9fd1\n\t.short\t0xeb6e\n\t.short\t0xfae7\n\t.short\t0xc87c\n\t.short\t0xd9f5\n\t.short\t0x3183\n\t.short\t0x200a\n\t.short\t0x1291\n\t.short\t0x318\n\t.short\t0x77a7\n\t.short\t0x662e\n\t.short\t0x54b5\n\t.short\t0x453c\n\t.short\t0xbdcb\n\t.short\t0xac42\n\t.short\t0x9ed9\n\t.short\t0x8f50\n\t.short\t0xfbef\n\t.short\t0xea66\n\t.short\t0xd8fd\n\t.short\t0xc974\n\t.short\t0x4204\n\t.short\t0x538d\n\t.short\t0x6116\n\t.short\t0x709f\n\t.short\t0x420\n\t.short\t0x15a9\n\t.short\t0x2732\n\t.short\t0x36bb\n\t.short\t0xce4c\n\t.short\t0xdfc5\n\t.short\t0xed5e\n\t.short\t0xfcd7\n\t.short\t0x8868\n\t.short\t0x99e1\n\t.short\t0xab7a\n\t.short\t0xbaf3\n\t.short\t0x5285\n\t.short\t0x430c\n\t.short\t0x7197\n\t.short\t0x601e\n\t.short\t0x14a1\n\t.short\t0x528\n\t.short\t0x37b3\n\t.short\t0x263a\n\t.short\t0xdecd\n\t.short\t0xcf44\n\t.short\t0xfddf\n\t.short\t0xec56\n\t.short\t0x98e9\n\t.short\t0x8960\n\t.short\t0xbbfb\n\t.short\t0xaa72\n\t.short\t0x6306\n\t.short\t0x728f\n\t.short\t0x4014\n\t.short\t0x519d\n\t.short\t0x2522\n\t.short\t0x34ab\n\t.short\t0x630\n\t.short\t0x17b9\n\t.short\t0xef4e\n\t.short\t0xfec7\n\t.short\t0xcc5c\n\t.short\t0xddd5\n\t.short\t0xa96a\n\t.short\t0xb8e3\n\t.short\t0x8a78\n\t.short\t0x9bf1\n\t.short\t0x7387\n\t.short\t0x620e\n\t.short\t0x5095\n\t.short\t0x411c\n\t.short\t0x35a3\n\t.short\t0x242a\n\t.short\t0x16b1\n\t.short\t0x738\n\t.short\t0xffcf\n\t.short\t0xee46\n\t.short\t0xdcdd\n\t.short\t0xcd54\n\t.short\t0xb9eb\n\t.short\t0xa862\n\t.short\t0x9af9\n\t.short\t0x8b70\n\t.short\t0x8408\n\t.short\t0x9581\n\t.short\t0xa71a\n\t.short\t0xb693\n\t.short\t0xc22c\n\t.short\t0xd3a5\n\t.short\t0xe13e\n\t.short\t0xf0b7\n\t.short\t0x840\n\t.short\t0x19c9\n\t.short\t0x2b52\n\t.short\t0x3adb\n\t.short\t0x4e64\n\t.short\t0x5fed\n\t.short\t0x6d76\n\t.short\t0x7cff\n\t.short\t0x9489\n\t.short\t0x8500\n\t.short\t0xb79b\n\t.short\t0xa612\n\t.short\t0xd2ad\n\t.short\t0xc324\n\t.short\t0xf1bf\n\t.short\t0xe036\n\t.short\t0x18c1\n\t.short\t0x948\n\t.short\t0x3bd3\n\t.short\t0x2a5a\n\t.short\t0x5ee5\n\t.short\t0x4f6c\n\t.short\t0x7df7\n\t.short\t0x6c7e\n\t.short\t0xa50a\n\t.short\t0xb483\n\t.short\t0x8618\n\t.short\t0x9791\n\t.short\t0xe32e\n\t.short\t0xf2a7\n\t.short\t0xc03c\n\t.short\t0xd1b5\n\t.short\t0x2942\n\t.short\t0x38cb\n\t.short\t0xa50\n\t.short\t0x1bd9\n\t.short\t0x6f66\n\t.short\t0x7eef\n\t.short\t0x4c74\n\t.short\t0x5dfd\n\t.short\t0xb58b\n\t.short\t0xa402\n\t.short\t0x9699\n\t.short\t0x8710\n\t.short\t0xf3af\n\t.short\t0xe226\n\t.short\t0xd0bd\n\t.short\t0xc134\n\t.short\t0x39c3\n\t.short\t0x284a\n\t.short\t0x1ad1\n\t.short\t0xb58\n\t.short\t0x7fe7\n\t.short\t0x6e6e\n\t.short\t0x5cf5\n\t.short\t0x4d7c\n\t.short\t0xc60c\n\t.short\t0xd785\n\t.short\t0xe51e\n\t.short\t0xf497\n\t.short\t0x8028\n\t.short\t0x91a1\n\t.short\t0xa33a\n\t.short\t0xb2b3\n\t.short\t0x4a44\n\t.short\t0x5bcd\n\t.short\t0x6956\n\t.short\t0x78df\n\t.short\t0xc60\n\t.short\t0x1de9\n\t.short\t0x2f72\n\t.short\t0x3efb\n\t.short\t0xd68d\n\t.short\t0xc704\n\t.short\t0xf59f\n\t.short\t0xe416\n\t.short\t0x90a9\n\t.short\t0x8120\n\t.short\t0xb3bb\n\t.short\t0xa232\n\t.short\t0x5ac5\n\t.short\t0x4b4c\n\t.short\t0x79d7\n\t.short\t0x685e\n\t.short\t0x1ce1\n\t.short\t0xd68\n\t.short\t0x3ff3\n\t.short\t0x2e7a\n\t.short\t0xe70e\n\t.short\t0xf687\n\t.short\t0xc41c\n\t.short\t0xd595\n\t.short\t0xa12a\n\t.short\t0xb0a3\n\t.short\t0x8238\n\t.short\t0x93b1\n\t.short\t0x6b46\n\t.short\t0x7acf\n\t.short\t0x4854\n\t.short\t0x59dd\n\t.short\t0x2d62\n\t.short\t0x3ceb\n\t.short\t0xe70\n\t.short\t0x1ff9\n\t.short\t0xf78f\n\t.short\t0xe606\n\t.short\t0xd49d\n\t.short\t0xc514\n\t.short\t0xb1ab\n\t.short\t0xa022\n\t.short\t0x92b9\n\t.short\t0x8330\n\t.short\t0x7bc7\n\t.short\t0x6a4e\n\t.short\t0x58d5\n\t.short\t0x495c\n\t.short\t0x3de3\n\t.short\t0x2c6a\n\t.short\t0x1ef1\n\t.short\t0xf78\n\t.size\t sCrc16Table,512\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16WithTable\n\t.type\t CalcCRC16WithTable,function\n\t.thumb_func\nCalcCRC16WithTable:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L8\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L8+0x4\n.L6:\n\tlsr\tr1, r2, #0x8\n\tadd\tr0, r5, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tlsl\tr0, r2, #0x18\n\tlsr\tr0, r0, #0x17\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tadd\tr2, r0, #0\n\teor\tr2, r2, r1\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x1121\n\t.word\tsCrc16Table\n.Lfe1:\n\t.size\t CalcCRC16WithTable,.Lfe1-CalcCRC16WithTable\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-dbb6d12e4277.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu16 CalcCRC16WithTable(const u8 *data, u32 length);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CalcCRC16WithTable # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CalcCRC16WithTable` — benchmark function pokeemerald:CalcCRC16WithTable:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalcCRC16WithTable:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t1, 0\n\t.type\t sCrc16Table,object\nsCrc16Table:\n\t.short\t0x0\n\t.short\t0x1189\n\t.short\t0x2312\n\t.short\t0x329b\n\t.short\t0x4624\n\t.short\t0x57ad\n\t.short\t0x6536\n\t.short\t0x74bf\n\t.short\t0x8c48\n\t.short\t0x9dc1\n\t.short\t0xaf5a\n\t.short\t0xbed3\n\t.short\t0xca6c\n\t.short\t0xdbe5\n\t.short\t0xe97e\n\t.short\t0xf8f7\n\t.short\t0x1081\n\t.short\t0x108\n\t.short\t0x3393\n\t.short\t0x221a\n\t.short\t0x56a5\n\t.short\t0x472c\n\t.short\t0x75b7\n\t.short\t0x643e\n\t.short\t0x9cc9\n\t.short\t0x8d40\n\t.short\t0xbfdb\n\t.short\t0xae52\n\t.short\t0xdaed\n\t.short\t0xcb64\n\t.short\t0xf9ff\n\t.short\t0xe876\n\t.short\t0x2102\n\t.short\t0x308b\n\t.short\t0x210\n\t.short\t0x1399\n\t.short\t0x6726\n\t.short\t0x76af\n\t.short\t0x4434\n\t.short\t0x55bd\n\t.short\t0xad4a\n\t.short\t0xbcc3\n\t.short\t0x8e58\n\t.short\t0x9fd1\n\t.short\t0xeb6e\n\t.short\t0xfae7\n\t.short\t0xc87c\n\t.short\t0xd9f5\n\t.short\t0x3183\n\t.short\t0x200a\n\t.short\t0x1291\n\t.short\t0x318\n\t.short\t0x77a7\n\t.short\t0x662e\n\t.short\t0x54b5\n\t.short\t0x453c\n\t.short\t0xbdcb\n\t.short\t0xac42\n\t.short\t0x9ed9\n\t.short\t0x8f50\n\t.short\t0xfbef\n\t.short\t0xea66\n\t.short\t0xd8fd\n\t.short\t0xc974\n\t.short\t0x4204\n\t.short\t0x538d\n\t.short\t0x6116\n\t.short\t0x709f\n\t.short\t0x420\n\t.short\t0x15a9\n\t.short\t0x2732\n\t.short\t0x36bb\n\t.short\t0xce4c\n\t.short\t0xdfc5\n\t.short\t0xed5e\n\t.short\t0xfcd7\n\t.short\t0x8868\n\t.short\t0x99e1\n\t.short\t0xab7a\n\t.short\t0xbaf3\n\t.short\t0x5285\n\t.short\t0x430c\n\t.short\t0x7197\n\t.short\t0x601e\n\t.short\t0x14a1\n\t.short\t0x528\n\t.short\t0x37b3\n\t.short\t0x263a\n\t.short\t0xdecd\n\t.short\t0xcf44\n\t.short\t0xfddf\n\t.short\t0xec56\n\t.short\t0x98e9\n\t.short\t0x8960\n\t.short\t0xbbfb\n\t.short\t0xaa72\n\t.short\t0x6306\n\t.short\t0x728f\n\t.short\t0x4014\n\t.short\t0x519d\n\t.short\t0x2522\n\t.short\t0x34ab\n\t.short\t0x630\n\t.short\t0x17b9\n\t.short\t0xef4e\n\t.short\t0xfec7\n\t.short\t0xcc5c\n\t.short\t0xddd5\n\t.short\t0xa96a\n\t.short\t0xb8e3\n\t.short\t0x8a78\n\t.short\t0x9bf1\n\t.short\t0x7387\n\t.short\t0x620e\n\t.short\t0x5095\n\t.short\t0x411c\n\t.short\t0x35a3\n\t.short\t0x242a\n\t.short\t0x16b1\n\t.short\t0x738\n\t.short\t0xffcf\n\t.short\t0xee46\n\t.short\t0xdcdd\n\t.short\t0xcd54\n\t.short\t0xb9eb\n\t.short\t0xa862\n\t.short\t0x9af9\n\t.short\t0x8b70\n\t.short\t0x8408\n\t.short\t0x9581\n\t.short\t0xa71a\n\t.short\t0xb693\n\t.short\t0xc22c\n\t.short\t0xd3a5\n\t.short\t0xe13e\n\t.short\t0xf0b7\n\t.short\t0x840\n\t.short\t0x19c9\n\t.short\t0x2b52\n\t.short\t0x3adb\n\t.short\t0x4e64\n\t.short\t0x5fed\n\t.short\t0x6d76\n\t.short\t0x7cff\n\t.short\t0x9489\n\t.short\t0x8500\n\t.short\t0xb79b\n\t.short\t0xa612\n\t.short\t0xd2ad\n\t.short\t0xc324\n\t.short\t0xf1bf\n\t.short\t0xe036\n\t.short\t0x18c1\n\t.short\t0x948\n\t.short\t0x3bd3\n\t.short\t0x2a5a\n\t.short\t0x5ee5\n\t.short\t0x4f6c\n\t.short\t0x7df7\n\t.short\t0x6c7e\n\t.short\t0xa50a\n\t.short\t0xb483\n\t.short\t0x8618\n\t.short\t0x9791\n\t.short\t0xe32e\n\t.short\t0xf2a7\n\t.short\t0xc03c\n\t.short\t0xd1b5\n\t.short\t0x2942\n\t.short\t0x38cb\n\t.short\t0xa50\n\t.short\t0x1bd9\n\t.short\t0x6f66\n\t.short\t0x7eef\n\t.short\t0x4c74\n\t.short\t0x5dfd\n\t.short\t0xb58b\n\t.short\t0xa402\n\t.short\t0x9699\n\t.short\t0x8710\n\t.short\t0xf3af\n\t.short\t0xe226\n\t.short\t0xd0bd\n\t.short\t0xc134\n\t.short\t0x39c3\n\t.short\t0x284a\n\t.short\t0x1ad1\n\t.short\t0xb58\n\t.short\t0x7fe7\n\t.short\t0x6e6e\n\t.short\t0x5cf5\n\t.short\t0x4d7c\n\t.short\t0xc60c\n\t.short\t0xd785\n\t.short\t0xe51e\n\t.short\t0xf497\n\t.short\t0x8028\n\t.short\t0x91a1\n\t.short\t0xa33a\n\t.short\t0xb2b3\n\t.short\t0x4a44\n\t.short\t0x5bcd\n\t.short\t0x6956\n\t.short\t0x78df\n\t.short\t0xc60\n\t.short\t0x1de9\n\t.short\t0x2f72\n\t.short\t0x3efb\n\t.short\t0xd68d\n\t.short\t0xc704\n\t.short\t0xf59f\n\t.short\t0xe416\n\t.short\t0x90a9\n\t.short\t0x8120\n\t.short\t0xb3bb\n\t.short\t0xa232\n\t.short\t0x5ac5\n\t.short\t0x4b4c\n\t.short\t0x79d7\n\t.short\t0x685e\n\t.short\t0x1ce1\n\t.short\t0xd68\n\t.short\t0x3ff3\n\t.short\t0x2e7a\n\t.short\t0xe70e\n\t.short\t0xf687\n\t.short\t0xc41c\n\t.short\t0xd595\n\t.short\t0xa12a\n\t.short\t0xb0a3\n\t.short\t0x8238\n\t.short\t0x93b1\n\t.short\t0x6b46\n\t.short\t0x7acf\n\t.short\t0x4854\n\t.short\t0x59dd\n\t.short\t0x2d62\n\t.short\t0x3ceb\n\t.short\t0xe70\n\t.short\t0x1ff9\n\t.short\t0xf78f\n\t.short\t0xe606\n\t.short\t0xd49d\n\t.short\t0xc514\n\t.short\t0xb1ab\n\t.short\t0xa022\n\t.short\t0x92b9\n\t.short\t0x8330\n\t.short\t0x7bc7\n\t.short\t0x6a4e\n\t.short\t0x58d5\n\t.short\t0x495c\n\t.short\t0x3de3\n\t.short\t0x2c6a\n\t.short\t0x1ef1\n\t.short\t0xf78\n\t.size\t sCrc16Table,512\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16WithTable\n\t.type\t CalcCRC16WithTable,function\n\t.thumb_func\nCalcCRC16WithTable:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L8\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L8+0x4\n.L6:\n\tlsr\tr1, r2, #0x8\n\tadd\tr0, r5, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tlsl\tr0, r2, #0x18\n\tlsr\tr0, r0, #0x17\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tadd\tr2, r0, #0\n\teor\tr2, r2, r1\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x1121\n\t.word\tsCrc16Table\n.Lfe1:\n\t.size\t CalcCRC16WithTable,.Lfe1-CalcCRC16WithTable\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalcCRC16WithTable # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:CalculatePPWithBonus:agbcc","sym":"CalculatePPWithBonus","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","shift","bitwise","soft-div","global","table"],"loc":5,"refSource":"u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex)\n{\n u8 basePP = gBattleMoves[move].pp;\n return basePP + ((basePP * 20 * ((gPPUpGetMask[moveIndex] & ppBonuses) >> (2 * moveIndex))) / 100);\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L4636-L4640","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalculatePPWithBonus\n\t.type\t CalculatePPWithBonus,function\n\t.thumb_func\nCalculatePPWithBonus:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tldr\tr4, .L3\n\tlsl\tr3, r0, #0x1\n\tadd\tr3, r3, r0\n\tlsl\tr3, r3, #0x2\n\tadd\tr3, r3, r4\n\tldrb\tr4, [r3, #0x4]\n\tldr\tr0, .L3+0x4\n\tadd\tr0, r2, r0\n\tldrb\tr3, [r0]\n\tand\tr3, r3, r1\n\tlsl\tr2, r2, #0x1\n\tasr\tr3, r3, r2\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r3\n\tlsl\tr0, r0, #0x2\n\tmul\tr0, r0, r4\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tadd\tr4, r4, r0\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgBattleMoves\n\t.word\tgPPUpGetMask\n.Lfe1:\n\t.size\t CalculatePPWithBonus,.Lfe1-CalculatePPWithBonus\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed/raw-globals","symbolsUsed":[{"name":"gBattleMoves","shape":"array (12 B/elem)"},{"name":"gPPUpGetMask","shape":"u8[]"}],"outcome":"nonmatch","source":"struct Elem0 { u8 _pad0[4]; u8 field_4; u8 _pad1[7]; };\ns32 CalculatePPWithBonus(s32 a0, s32 a1, s32 a2) {\n return (u8)(((struct Elem0 *)&gBattleMoves)[(u16)a0].field_4 + ((((u8 *)&gPPUpGetMask)[(u8)a2] & a1) >> ((u8)a2 << 1)) * 20 * ((struct Elem0 *)&gBattleMoves)[(u16)a0].field_4 / 100);\n}\n","score":17,"maxScore":36,"compileErrors":null,"breakdown":{"insert":3,"delete":3,"replace":4,"opMismatch":0,"argMismatch":7},"quality":{"score":92,"lines":4,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex) {\n u8 temp_r2;\n u8 temp_r4;\n\n temp_r2 = moveIndex;\n temp_r4 = gBattleMoves[move].pp;\n return (u8) (temp_r4 + ((s32) (((s32) (gPPUpGetMask[temp_r2] & ppBonuses) >> (temp_r2 * 2)) * 0x14 * temp_r4) / 100));\n}\n","score":3,"maxScore":33,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":98,"lines":7,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":33,"ratio":0.09090909090909091,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CalculatePPWithBonus` — benchmark function pokeemerald:CalculatePPWithBonus:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalculatePPWithBonus\n\t.type\t CalculatePPWithBonus,function\n\t.thumb_func\nCalculatePPWithBonus:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tldr\tr4, .L3\n\tlsl\tr3, r0, #0x1\n\tadd\tr3, r3, r0\n\tlsl\tr3, r3, #0x2\n\tadd\tr3, r3, r4\n\tldrb\tr4, [r3, #0x4]\n\tldr\tr0, .L3+0x4\n\tadd\tr0, r2, r0\n\tldrb\tr3, [r0]\n\tand\tr3, r3, r1\n\tlsl\tr2, r2, #0x1\n\tasr\tr3, r3, r2\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r3\n\tlsl\tr0, r0, #0x2\n\tmul\tr0, r0, r4\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tadd\tr4, r4, r0\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgBattleMoves\n\t.word\tgPPUpGetMask\n.Lfe1:\n\t.size\t CalculatePPWithBonus,.Lfe1-CalculatePPWithBonus\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CalculatePPWithBonus # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CalculatePPWithBonus` — benchmark function pokeemerald:CalculatePPWithBonus:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalculatePPWithBonus:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalculatePPWithBonus\n\t.type\t CalculatePPWithBonus,function\n\t.thumb_func\nCalculatePPWithBonus:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tldr\tr4, .L3\n\tlsl\tr3, r0, #0x1\n\tadd\tr3, r3, r0\n\tlsl\tr3, r3, #0x2\n\tadd\tr3, r3, r4\n\tldrb\tr4, [r3, #0x4]\n\tldr\tr0, .L3+0x4\n\tadd\tr0, r2, r0\n\tldrb\tr3, [r0]\n\tand\tr3, r3, r1\n\tlsl\tr2, r2, #0x1\n\tasr\tr3, r3, r2\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r3\n\tlsl\tr0, r0, #0x2\n\tmul\tr0, r0, r4\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tadd\tr4, r4, r0\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgBattleMoves\n\t.word\tgPPUpGetMask\n.Lfe1:\n\t.size\t CalculatePPWithBonus,.Lfe1-CalculatePPWithBonus\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalculatePPWithBonus # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:Cos2:agbcc","sym":"Cos2","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","call"],"loc":4,"refSource":"s16 Cos2(u16 angle)\n{\n return Sin2(angle + 90);\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/trig.c#L540-L543","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCos2\n\t.type\t Cos2,function\n\t.thumb_func\nCos2:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tmov\tr1, #0xb4\n\tlsl\tr1, r1, #0xf\n\tadd\tr0, r0, r1\n\tlsr\tr0, r0, #0x10\n\tbl\tSin2\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Cos2,.Lfe1-Cos2\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 Cos2(u32 a0) {\n return (s16)Sin2((a0 << 16) + (180 << 15) >> 16);\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s16 Sin2(u32); /* extern */\n\ns16 Cos2(s32 arg0) {\n return Sin2((u32) ((arg0 << 0x10) + 0x5A0000) >> 0x10);\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Cos2` — benchmark function pokeemerald:Cos2:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCos2\n\t.type\t Cos2,function\n\t.thumb_func\nCos2:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tmov\tr1, #0xb4\n\tlsl\tr1, r1, #0xf\n\tadd\tr0, r0, r1\n\tlsr\tr0, r0, #0x10\n\tbl\tSin2\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Cos2,.Lfe1-Cos2\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Cos2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Cos2` — benchmark function pokeemerald:Cos2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:Cos2:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCos2\n\t.type\t Cos2,function\n\t.thumb_func\nCos2:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tmov\tr1, #0xb4\n\tlsl\tr1, r1, #0xf\n\tadd\tr0, r0, r1\n\tlsr\tr0, r0, #0x10\n\tbl\tSin2\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Cos2,.Lfe1-Cos2\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Cos2 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:CountTrailingZeroBits:agbcc","sym":"CountTrailingZeroBits","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","loop","branch","shift"],"loc":13,"refSource":"int CountTrailingZeroBits(u32 value)\n{\n u8 i;\n\n for (i = 0; i < 32; i++)\n {\n if ((value & 1) == 0)\n value >>= 1;\n else\n return i;\n }\n return 0;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L208-L220","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountTrailingZeroBits\n\t.type\t CountTrailingZeroBits,function\n\t.thumb_func\nCountTrailingZeroBits:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tmov\tr3, #0x1\n.L6:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r3\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L10\n.L7:\n\tlsr\tr2, r2, #0x1\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0x1f\n\tbls\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n.L10:\n\tbx\tlr\n.Lfe1:\n\t.size\t CountTrailingZeroBits,.Lfe1-CountTrailingZeroBits\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 CountTrailingZeroBits(u32 a0) {\n s32 v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n while ((v0 & 1) == 0) {\n v0 = v0 >> 1;\n v1 = (u8)(v1 + 1);\n if (v1 > 31) {\n v1 = 0;\n return v1;\n }\n }\n return v1;\n}\n","score":19,"maxScore":23,"compileErrors":null,"breakdown":{"insert":6,"delete":2,"replace":1,"opMismatch":2,"argMismatch":8},"quality":{"score":100,"lines":15,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 CountTrailingZeroBits(u32 arg0) {\n u32 var_r2;\n u8 var_r1;\n\n var_r2 = arg0;\n var_r1 = 0;\nloop_1:\n if (var_r2 & 1) {\n return var_r1;\n }\n var_r2 = var_r2 >> 1;\n var_r1 += 1;\n if ((u32) var_r1 > 0x1FU) {\n return 0U;\n }\n goto loop_1;\n}\n","score":15,"maxScore":19,"compileErrors":null,"breakdown":{"insert":2,"delete":3,"replace":0,"opMismatch":1,"argMismatch":9},"quality":{"score":88,"lines":16,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":15,"maxScore":19,"ratio":0.7894736842105263,"kinds":{"insert":2,"delete":3,"replace":0,"opMismatch":1,"argMismatch":9}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CountTrailingZeroBits` — benchmark function pokeemerald:CountTrailingZeroBits:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountTrailingZeroBits\n\t.type\t CountTrailingZeroBits,function\n\t.thumb_func\nCountTrailingZeroBits:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tmov\tr3, #0x1\n.L6:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r3\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L10\n.L7:\n\tlsr\tr2, r2, #0x1\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0x1f\n\tbls\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n.L10:\n\tbx\tlr\n.Lfe1:\n\t.size\t CountTrailingZeroBits,.Lfe1-CountTrailingZeroBits\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CountTrailingZeroBits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CountTrailingZeroBits` — benchmark function pokeemerald:CountTrailingZeroBits:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CountTrailingZeroBits:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountTrailingZeroBits\n\t.type\t CountTrailingZeroBits,function\n\t.thumb_func\nCountTrailingZeroBits:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tmov\tr3, #0x1\n.L6:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r3\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L10\n.L7:\n\tlsr\tr2, r2, #0x1\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0x1f\n\tbls\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n.L10:\n\tbx\tlr\n.Lfe1:\n\t.size\t CountTrailingZeroBits,.Lfe1-CountTrailingZeroBits\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CountTrailingZeroBits # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:FeebasRandom:agbcc","sym":"FeebasRandom","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","shift","global"],"loc":5,"refSource":"static u16 FeebasRandom(void)\n{\n sFeebasRngValue = ISO_RANDOMIZE2(sFeebasRngValue);\n return sFeebasRngValue >> 16;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/wild_encounter.c#L170-L174","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.type\t FeebasRandom,function\n\t.thumb_func\nFeebasRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tsFeebasRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x3039\n.Lfe1:\n\t.size\t FeebasRandom,.Lfe1-FeebasRandom\n\n\t.lcomm\tsFeebasRngValue,4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"sFeebasRngValue","shape":"scalar u32"}],"outcome":"nonmatch","source":"s32 FeebasRandom(void) {\n s32 v0;\n v0 = sFeebasRngValue;\n sFeebasRngValue = 1103515245 * v0 + 12345;\n return 1103515245 * v0 + 12345 >> 16;\n}\n","score":1,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern u32 sFeebasRngValue;\n\nu32 FeebasRandom(void) {\n u32 temp_r0;\n\n temp_r0 = (0x41C64E6D * sFeebasRngValue) + 0x3039;\n sFeebasRngValue = temp_r0;\n return temp_r0 >> 0x10;\n}\n","score":1,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":13,"ratio":0.07692307692307693,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `FeebasRandom` — benchmark function pokeemerald:FeebasRandom:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.type\t FeebasRandom,function\n\t.thumb_func\nFeebasRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tsFeebasRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x3039\n.Lfe1:\n\t.size\t FeebasRandom,.Lfe1-FeebasRandom\n\n\t.lcomm\tsFeebasRngValue,4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function FeebasRandom # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `FeebasRandom` — benchmark function pokeemerald:FeebasRandom:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:FeebasRandom:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.type\t FeebasRandom,function\n\t.thumb_func\nFeebasRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tsFeebasRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x3039\n.Lfe1:\n\t.size\t FeebasRandom,.Lfe1-FeebasRandom\n\n\t.lcomm\tsFeebasRngValue,4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name FeebasRandom # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:GetGenderFromSpeciesAndPersonality:agbcc","sym":"GetGenderFromSpeciesAndPersonality","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","branch","global","struct"],"loc":15,"refSource":"u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality)\n{\n switch (gSpeciesInfo[species].genderRatio)\n {\n case MON_MALE:\n case MON_FEMALE:\n case MON_GENDERLESS:\n return gSpeciesInfo[species].genderRatio;\n }\n\n if (gSpeciesInfo[species].genderRatio > (personality & 0xFF))\n return MON_FEMALE;\n else\n return MON_MALE;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L3471-L3485","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetGenderFromSpeciesAndPersonality\n\t.type\t GetGenderFromSpeciesAndPersonality,function\n\t.thumb_func\nGetGenderFromSpeciesAndPersonality:\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tldr\tr1, .L12\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0, #0x10]\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tcmp\tr0, #0\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, #0xff\n\tbgt\t.L3\t@cond_branch\n\tcmp\tr0, #0xfe\n\tbge\t.L11\t@cond_branch\n.L3:\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x10]\n\tmov\tr0, #0xff\n\tand\tr0, r0, r3\n\tcmp\tr1, r0\n\tbhi\t.L9\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L11\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgSpeciesInfo\n.L9:\n\tmov\tr0, #0xfe\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t GetGenderFromSpeciesAndPersonality,.Lfe1-GetGenderFromSpeciesAndPersonality\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gSpeciesInfo","shape":"array (28 B/elem)"}],"outcome":"nonmatch","source":"struct Elem0 { u8 _pad0[16]; u8 field_16; u8 _pad1[11]; };\ns32 GetGenderFromSpeciesAndPersonality(u32 a0, u32 a1) {\n s32 v0;\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 == 0) {\n v0 = ((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16;\n } else {\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 < 0) {\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 > (255 & a1)) {\n v0 = 254;\n } else {\n v0 = 0;\n }\n } else {\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 > 255) {\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 > (255 & a1)) {\n v0 = 254;\n } else {\n v0 = 0;\n }\n } else {\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 >= 254) {\n v0 = ((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16;\n } else {\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 > (255 & a1)) {\n v0 = 254;\n } else {\n v0 = 0;\n }\n }\n }\n }\n }\n return v0;\n}\n","score":32,"maxScore":37,"compileErrors":null,"breakdown":{"insert":6,"delete":9,"replace":4,"opMismatch":5,"argMismatch":8},"quality":{"score":88,"lines":34,"gotos":0,"casts":9,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality) {\n u16 temp_r2;\n u8 var_r0;\n\n temp_r2 = species;\n var_r0 = gSpeciesInfo[temp_r2].genderRatio;\n if ((var_r0 != 0) && (((s32) var_r0 < 0) || ((s32) var_r0 > 0xFF) || ((s32) var_r0 < 0xFE))) {\n if ((u32) gSpeciesInfo[temp_r2].genderRatio <= (u32) (0xFF & personality)) {\n return 0U;\n }\n var_r0 = 0xFE;\n /* Duplicate return node #7. Try simplifying control flow for better match */\n return var_r0;\n }\n return var_r0;\n}\n","score":25,"maxScore":36,"compileErrors":null,"breakdown":{"insert":5,"delete":11,"replace":1,"opMismatch":1,"argMismatch":7},"quality":{"score":96,"lines":15,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":25,"maxScore":36,"ratio":0.6944444444444444,"kinds":{"insert":5,"delete":11,"replace":1,"opMismatch":1,"argMismatch":7}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GetGenderFromSpeciesAndPersonality` — benchmark function pokeemerald:GetGenderFromSpeciesAndPersonality:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetGenderFromSpeciesAndPersonality\n\t.type\t GetGenderFromSpeciesAndPersonality,function\n\t.thumb_func\nGetGenderFromSpeciesAndPersonality:\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tldr\tr1, .L12\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0, #0x10]\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tcmp\tr0, #0\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, #0xff\n\tbgt\t.L3\t@cond_branch\n\tcmp\tr0, #0xfe\n\tbge\t.L11\t@cond_branch\n.L3:\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x10]\n\tmov\tr0, #0xff\n\tand\tr0, r0, r3\n\tcmp\tr1, r0\n\tbhi\t.L9\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L11\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgSpeciesInfo\n.L9:\n\tmov\tr0, #0xfe\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t GetGenderFromSpeciesAndPersonality,.Lfe1-GetGenderFromSpeciesAndPersonality\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GetGenderFromSpeciesAndPersonality # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GetGenderFromSpeciesAndPersonality` — benchmark function pokeemerald:GetGenderFromSpeciesAndPersonality:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:GetGenderFromSpeciesAndPersonality:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetGenderFromSpeciesAndPersonality\n\t.type\t GetGenderFromSpeciesAndPersonality,function\n\t.thumb_func\nGetGenderFromSpeciesAndPersonality:\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tldr\tr1, .L12\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0, #0x10]\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tcmp\tr0, #0\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, #0xff\n\tbgt\t.L3\t@cond_branch\n\tcmp\tr0, #0xfe\n\tbge\t.L11\t@cond_branch\n.L3:\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x10]\n\tmov\tr0, #0xff\n\tand\tr0, r0, r3\n\tcmp\tr1, r0\n\tbhi\t.L9\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L11\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgSpeciesInfo\n.L9:\n\tmov\tr0, #0xfe\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t GetGenderFromSpeciesAndPersonality,.Lfe1-GetGenderFromSpeciesAndPersonality\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetGenderFromSpeciesAndPersonality # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:GiveBerryPowder:agbcc","sym":"GiveBerryPowder","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["branch","call","memory","global"],"loc":15,"refSource":"bool8 GiveBerryPowder(u32 amountToAdd)\n{\n u32 *powder = &gSaveBlock2Ptr->berryCrush.berryPowderAmount;\n u32 amount = DecryptBerryPowder(powder) + amountToAdd;\n if (amount > MAX_BERRY_POWDER)\n {\n SetBerryPowder(powder, MAX_BERRY_POWDER);\n return FALSE;\n }\n else\n {\n SetBerryPowder(powder, amount);\n return TRUE;\n }\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/berry_powder.c#L162-L176","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGiveBerryPowder\n\t.type\t GiveBerryPowder,function\n\t.thumb_func\nGiveBerryPowder:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tldr\tr0, .L6\n\tldr\tr0, [r0]\n\tmov\tr1, #0xfa\n\tlsl\tr1, r1, #0x1\n\tadd\tr5, r0, r1\n\tadd\tr0, r5, #0\n\tbl\tDecryptBerryPowder\n\tadd\tr1, r0, r4\n\tldr\tr2, .L6+0x4\n\tcmp\tr1, r2\n\tbhi\t.L3\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x1\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgSaveBlock2Ptr\n\t.word\t0x1869f\n.L3:\n\tadd\tr0, r5, #0\n\tadd\tr1, r2, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GiveBerryPowder,.Lfe1-GiveBerryPowder\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-264361caa05e.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gSaveBlock2Ptr","shape":"pointer"}],"outcome":"nonmatch","source":"s32 GiveBerryPowder(u32 a0) {\n s32 v0;\n s32 v1;\n u32 v2;\n s32 v3;\n v0 = gSaveBlock2Ptr;\n v1 = DecryptBerryPowder(v0 + (250 << 1));\n v2 = 99999;\n if (v1 + a0 > v2) {\n SetBerryPowder(v0 + (250 << 1), v2);\n v3 = 0;\n } else {\n SetBerryPowder(v0 + (250 << 1), v1 + a0);\n v3 = 1;\n }\n return v3;\n}\n","score":11,"maxScore":29,"compileErrors":null,"breakdown":{"insert":2,"delete":3,"replace":0,"opMismatch":2,"argMismatch":4},"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 GiveBerryPowder(u32 amountToAdd) {\n u32 *temp_r5;\n u32 temp_r1;\n\n temp_r5 = &gSaveBlock2Ptr->berryCrush.berryPowderAmount;\n temp_r1 = DecryptBerryPowder(temp_r5) + amountToAdd;\n if (temp_r1 <= 0x1869FU) {\n SetBerryPowder(temp_r5, temp_r1);\n return 1U;\n }\n SetBerryPowder(temp_r5, 0x1869FU);\n return 0U;\n}\n","score":9,"maxScore":28,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":0,"opMismatch":2,"argMismatch":4},"quality":{"score":100,"lines":12,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":9,"maxScore":28,"ratio":0.32142857142857145,"kinds":{"insert":1,"delete":2,"replace":0,"opMismatch":2,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GiveBerryPowder` — benchmark function pokeemerald:GiveBerryPowder:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGiveBerryPowder\n\t.type\t GiveBerryPowder,function\n\t.thumb_func\nGiveBerryPowder:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tldr\tr0, .L6\n\tldr\tr0, [r0]\n\tmov\tr1, #0xfa\n\tlsl\tr1, r1, #0x1\n\tadd\tr5, r0, r1\n\tadd\tr0, r5, #0\n\tbl\tDecryptBerryPowder\n\tadd\tr1, r0, r4\n\tldr\tr2, .L6+0x4\n\tcmp\tr1, r2\n\tbhi\t.L3\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x1\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgSaveBlock2Ptr\n\t.word\t0x1869f\n.L3:\n\tadd\tr0, r5, #0\n\tadd\tr1, r2, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GiveBerryPowder,.Lfe1-GiveBerryPowder\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-264361caa05e.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nbool8 GiveBerryPowder(u32 amountToAdd);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GiveBerryPowder # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GiveBerryPowder` — benchmark function pokeemerald:GiveBerryPowder:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:GiveBerryPowder:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGiveBerryPowder\n\t.type\t GiveBerryPowder,function\n\t.thumb_func\nGiveBerryPowder:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tldr\tr0, .L6\n\tldr\tr0, [r0]\n\tmov\tr1, #0xfa\n\tlsl\tr1, r1, #0x1\n\tadd\tr5, r0, r1\n\tadd\tr0, r5, #0\n\tbl\tDecryptBerryPowder\n\tadd\tr1, r0, r4\n\tldr\tr2, .L6+0x4\n\tcmp\tr1, r2\n\tbhi\t.L3\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x1\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgSaveBlock2Ptr\n\t.word\t0x1869f\n.L3:\n\tadd\tr0, r5, #0\n\tadd\tr1, r2, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GiveBerryPowder,.Lfe1-GiveBerryPowder\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GiveBerryPowder # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:IsStringLengthAtLeast:agbcc","sym":"IsStringLengthAtLeast","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","branch","pointer","array"],"loc":10,"refSource":"bool8 IsStringLengthAtLeast(const u8 *str, s32 n)\n{\n u8 i;\n\n for (i = 0; i < n; i++)\n if (str[i] && str[i] != EOS)\n return TRUE;\n\n return FALSE;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L152-L161","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tIsStringLengthAtLeast\n\t.type\t IsStringLengthAtLeast,function\n\t.thumb_func\nIsStringLengthAtLeast:\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tcmp\tr2, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0xff\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L9\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, r1\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t IsStringLengthAtLeast,.Lfe1-IsStringLengthAtLeast\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"nonmatch","source":"s32 IsStringLengthAtLeast(s32 a0, s32 a1) {\n s32 v0;\n if (0 < a1) {\n v0 = 0;\n do {\n if (*(u8 *)(a0 + v0) != 0) {\n if (*(u8 *)(a0 + v0) != 255) return 1;\n }\n v0 = (u8)(v0 + 1);\n } while (v0 < a1);\n return 0;\n } else {\n return 0;\n }\n}\n","score":10,"maxScore":23,"compileErrors":null,"breakdown":{"insert":4,"delete":3,"replace":0,"opMismatch":2,"argMismatch":1},"quality":{"score":90,"lines":15,"gotos":0,"casts":3,"unkGlue":0,"rawMem":2,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 IsStringLengthAtLeast(s32 arg0, s32 arg1) {\n u8 temp_r0;\n u8 var_r2;\n\n var_r2 = 0;\n if (arg1 > 0) {\nloop_1:\n temp_r0 = *(arg0 + var_r2);\n if ((temp_r0 != 0) && (temp_r0 != 0xFF)) {\n return 1;\n }\n var_r2 += 1;\n if ((s32) var_r2 >= arg1) {\n goto block_5;\n }\n goto loop_1;\n }\nblock_5:\n return 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":76,"lines":19,"gotos":2,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3928: invalid type argument of `unary *'"]},"gapSize":{"decompiler":"asmlift","score":10,"maxScore":23,"ratio":0.43478260869565216,"kinds":{"insert":4,"delete":3,"replace":0,"opMismatch":2,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `IsStringLengthAtLeast` — benchmark function pokeemerald:IsStringLengthAtLeast:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tIsStringLengthAtLeast\n\t.type\t IsStringLengthAtLeast,function\n\t.thumb_func\nIsStringLengthAtLeast:\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tcmp\tr2, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0xff\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L9\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, r1\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t IsStringLengthAtLeast,.Lfe1-IsStringLengthAtLeast\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function IsStringLengthAtLeast # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `IsStringLengthAtLeast` — benchmark function pokeemerald:IsStringLengthAtLeast:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:IsStringLengthAtLeast:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tIsStringLengthAtLeast\n\t.type\t IsStringLengthAtLeast,function\n\t.thumb_func\nIsStringLengthAtLeast:\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tcmp\tr2, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0xff\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L9\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, r1\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t IsStringLengthAtLeast,.Lfe1-IsStringLengthAtLeast\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name IsStringLengthAtLeast # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:LoadWordFromTwoHalfwords:agbcc","sym":"LoadWordFromTwoHalfwords","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","pointer","array","bitwise","shift"],"loc":4,"refSource":"void LoadWordFromTwoHalfwords(u16 *h, u32 *w)\n{\n *w = h[0] | (s16)h[1] << 16;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L133-L136","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tLoadWordFromTwoHalfwords\n\t.type\t LoadWordFromTwoHalfwords,function\n\t.thumb_func\nLoadWordFromTwoHalfwords:\n\tldrh\tr2, [r0]\n\tmov\tr3, #0x2\n\tldrsh\tr0, [r0, r3]\n\tlsl\tr0, r0, #0x10\n\torr\tr2, r2, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t LoadWordFromTwoHalfwords,.Lfe1-LoadWordFromTwoHalfwords\n\n.text\n\t.align\t2, 0\n","proto":{"LoadWordFromTwoHalfwords":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void LoadWordFromTwoHalfwords(u16 * a0, s32 * a1) {\n *a1 = *a0 | *(a0 + 1) << 16;\n return;\n}\n","score":2,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void LoadWordFromTwoHalfwords(void *arg0, s32 *arg1) {\n *arg1 = arg0->unk0 | (arg0->unk2 << 0x10);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3922: warning: dereferencing `void *' pointer","/c.c:3922: request for member `unk0' in something not a structure or union","/c.c:3922: request for member `unk2' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":7,"ratio":0.2857142857142857,"kinds":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `LoadWordFromTwoHalfwords` — benchmark function pokeemerald:LoadWordFromTwoHalfwords:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tLoadWordFromTwoHalfwords\n\t.type\t LoadWordFromTwoHalfwords,function\n\t.thumb_func\nLoadWordFromTwoHalfwords:\n\tldrh\tr2, [r0]\n\tmov\tr3, #0x2\n\tldrsh\tr0, [r0, r3]\n\tlsl\tr0, r0, #0x10\n\torr\tr2, r2, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t LoadWordFromTwoHalfwords,.Lfe1-LoadWordFromTwoHalfwords\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function LoadWordFromTwoHalfwords # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `LoadWordFromTwoHalfwords` — benchmark function pokeemerald:LoadWordFromTwoHalfwords:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:LoadWordFromTwoHalfwords:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tLoadWordFromTwoHalfwords\n\t.type\t LoadWordFromTwoHalfwords,function\n\t.thumb_func\nLoadWordFromTwoHalfwords:\n\tldrh\tr2, [r0]\n\tmov\tr3, #0x2\n\tldrsh\tr0, [r0, r3]\n\tlsl\tr0, r0, #0x10\n\torr\tr2, r2, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t LoadWordFromTwoHalfwords,.Lfe1-LoadWordFromTwoHalfwords\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"LoadWordFromTwoHalfwords\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name LoadWordFromTwoHalfwords # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:MathUtil_Div16:agbcc","sym":"MathUtil_Div16","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div","branch","shift"],"loc":8,"refSource":"s16 MathUtil_Div16(s16 x, s16 y)\n{\n if (y == 0)\n {\n return 0;\n }\n return (x << 8) / y;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L33-L40","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16\n\t.type\t MathUtil_Div16,function\n\t.thumb_func\nMathUtil_Div16:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16,.Lfe1-MathUtil_Div16\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 MathUtil_Div16(u32 a0, u32 a1) {\n s32 v0;\n if ((s16)a1 == 0) {\n v0 = 0;\n } else {\n v0 = (s16)(((u16)a0 << 16 >> 8) / (s16)a1);\n }\n return v0;\n}\n","score":16,"maxScore":22,"compileErrors":null,"breakdown":{"insert":6,"delete":8,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":96,"lines":9,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 MathUtil_Div16(u16 arg0, s16 arg1) {\n s16 temp_r1;\n\n temp_r1 = arg1;\n if (temp_r1 != 0) {\n return (s16) ((s32) ((s32) (arg0 << 0x10) >> 8) / temp_r1);\n }\n return 0;\n}\n","score":5,"maxScore":18,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":98,"lines":8,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":5,"maxScore":18,"ratio":0.2777777777777778,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Div16` — benchmark function pokeemerald:MathUtil_Div16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16\n\t.type\t MathUtil_Div16,function\n\t.thumb_func\nMathUtil_Div16:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16,.Lfe1-MathUtil_Div16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Div16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Div16` — benchmark function pokeemerald:MathUtil_Div16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Div16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16\n\t.type\t MathUtil_Div16,function\n\t.thumb_func\nMathUtil_Div16:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16,.Lfe1-MathUtil_Div16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Div16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:MathUtil_Div16Shift:agbcc","sym":"MathUtil_Div16Shift","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div","branch","shift"],"loc":8,"refSource":"s16 MathUtil_Div16Shift(u8 s, s16 x, s16 y)\n{\n if (y == 0)\n {\n return 0;\n }\n return (x << s) / y;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L42-L49","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16Shift\n\t.type\t MathUtil_Div16Shift,function\n\t.thumb_func\nMathUtil_Div16Shift:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr0, r1, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr1, r2, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr0, r0, r3\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16Shift,.Lfe1-MathUtil_Div16Shift\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 MathUtil_Div16Shift(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n if ((s16)a2 == 0) {\n v0 = 0;\n } else {\n v0 = (s16)(((s16)(u16)a1 << (u8)a0) / (s16)a2);\n }\n return v0;\n}\n","score":16,"maxScore":24,"compileErrors":null,"breakdown":{"insert":5,"delete":5,"replace":4,"opMismatch":1,"argMismatch":1},"quality":{"score":92,"lines":9,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 MathUtil_Div16Shift(u8 arg0, u16 arg1, s16 arg2) {\n s16 temp_r1;\n\n temp_r1 = arg2;\n if (temp_r1 != 0) {\n return (s16) ((s32) ((s16) arg1 << arg0) / temp_r1);\n }\n return 0;\n}\n","score":5,"maxScore":21,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":98,"lines":8,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":5,"maxScore":21,"ratio":0.23809523809523808,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Div16Shift` — benchmark function pokeemerald:MathUtil_Div16Shift:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16Shift\n\t.type\t MathUtil_Div16Shift,function\n\t.thumb_func\nMathUtil_Div16Shift:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr0, r1, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr1, r2, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr0, r0, r3\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16Shift,.Lfe1-MathUtil_Div16Shift\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Div16Shift # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Div16Shift` — benchmark function pokeemerald:MathUtil_Div16Shift:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Div16Shift:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16Shift\n\t.type\t MathUtil_Div16Shift,function\n\t.thumb_func\nMathUtil_Div16Shift:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr0, r1, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr1, r2, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr0, r0, r3\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16Shift,.Lfe1-MathUtil_Div16Shift\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Div16Shift # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:MathUtil_Inv16:agbcc","sym":"MathUtil_Inv16","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div"],"loc":7,"refSource":"s16 MathUtil_Inv16(s16 y)\n{\n s32 x;\n\n x = 0x10000;\n return x / y;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L64-L70","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Inv16\n\t.type\t MathUtil_Inv16,function\n\t.thumb_func\nMathUtil_Inv16:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Inv16,.Lfe1-MathUtil_Inv16\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/regcopy","symbolsUsed":[],"outcome":"match","source":"s32 MathUtil_Inv16(u32 a0) {\n s32 w0;\n w0 = 128 << 9;\n return (s16)(w0 / (s16)a0);\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 MathUtil_Inv16(s16 arg0) {\n return (s16) (0x10000 / arg0);\n}\n","score":4,"maxScore":13,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Inv16` — benchmark function pokeemerald:MathUtil_Inv16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Inv16\n\t.type\t MathUtil_Inv16,function\n\t.thumb_func\nMathUtil_Inv16:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Inv16,.Lfe1-MathUtil_Inv16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Inv16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Inv16` — benchmark function pokeemerald:MathUtil_Inv16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Inv16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Inv16\n\t.type\t MathUtil_Inv16,function\n\t.thumb_func\nMathUtil_Inv16:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Inv16,.Lfe1-MathUtil_Inv16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Inv16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:MathUtil_Mul16:agbcc","sym":"MathUtil_Mul16","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","fixed-point","soft-div"],"loc":9,"refSource":"s16 MathUtil_Mul16(s16 x, s16 y)\n{\n s32 result;\n\n result = x;\n result *= y;\n result /= 256;\n return result;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L3-L11","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16\n\t.type\t MathUtil_Mul16,function\n\t.thumb_func\nMathUtil_Mul16:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MathUtil_Mul16,.Lfe1-MathUtil_Mul16\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/regcopy-ret","symbolsUsed":[],"outcome":"match","source":"s32 MathUtil_Mul16(u32 a0, u32 a1) {\n s32 v0;\n s32 w0;\n v0 = (s16)a0 * (s16)a1;\n w0 = v0;\n if (w0 < 0) w0 = w0 + 255;\n v0 = w0 << 8 >> 16;\n return v0;\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 MathUtil_Mul16(s16 arg0, s16 arg1) {\n s32 temp_r0;\n s32 var_r1;\n\n temp_r0 = arg0 * arg1;\n var_r1 = temp_r0;\n if (temp_r0 < 0) {\n var_r1 += 0xFF;\n }\n return (s32) (var_r1 << 8) >> 0x10;\n}\n","score":3,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":10,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Mul16` — benchmark function pokeemerald:MathUtil_Mul16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16\n\t.type\t MathUtil_Mul16,function\n\t.thumb_func\nMathUtil_Mul16:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MathUtil_Mul16,.Lfe1-MathUtil_Mul16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Mul16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Mul16` — benchmark function pokeemerald:MathUtil_Mul16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Mul16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16\n\t.type\t MathUtil_Mul16,function\n\t.thumb_func\nMathUtil_Mul16:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MathUtil_Mul16,.Lfe1-MathUtil_Mul16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Mul16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:MathUtil_Mul16Shift:agbcc","sym":"MathUtil_Mul16Shift","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","fixed-point","soft-div","shift"],"loc":9,"refSource":"s16 MathUtil_Mul16Shift(u8 s, s16 x, s16 y)\n{\n s32 result;\n\n result = x;\n result *= y;\n result /= (1 << s);\n return result;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L13-L21","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16Shift\n\t.type\t MathUtil_Mul16Shift,function\n\t.thumb_func\nMathUtil_Mul16Shift:\n\tpush\t{lr}\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr3, r3, #0x10\n\tasr\tr3, r3, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tmul\tr3, r3, r2\n\tmov\tr1, #0x1\n\tlsl\tr1, r1, r0\n\tadd\tr0, r3, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul16Shift,.Lfe1-MathUtil_Mul16Shift\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 MathUtil_Mul16Shift(u32 a0, u32 a1, u32 a2) {\n return (s16)((s16)a1 * (s16)a2 / (1 << (u8)a0));\n}\n","score":13,"maxScore":22,"compileErrors":null,"breakdown":{"insert":5,"delete":6,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":96,"lines":3,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 MathUtil_Mul16Shift(u8 arg0, s16 arg1, s16 arg2) {\n return (s16) ((s32) (arg1 * arg2) / (s32) (1 << arg0));\n}\n","score":5,"maxScore":17,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":98,"lines":3,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":5,"maxScore":17,"ratio":0.29411764705882354,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Mul16Shift` — benchmark function pokeemerald:MathUtil_Mul16Shift:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16Shift\n\t.type\t MathUtil_Mul16Shift,function\n\t.thumb_func\nMathUtil_Mul16Shift:\n\tpush\t{lr}\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr3, r3, #0x10\n\tasr\tr3, r3, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tmul\tr3, r3, r2\n\tmov\tr1, #0x1\n\tlsl\tr1, r1, r0\n\tadd\tr0, r3, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul16Shift,.Lfe1-MathUtil_Mul16Shift\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Mul16Shift # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Mul16Shift` — benchmark function pokeemerald:MathUtil_Mul16Shift:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Mul16Shift:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16Shift\n\t.type\t MathUtil_Mul16Shift,function\n\t.thumb_func\nMathUtil_Mul16Shift:\n\tpush\t{lr}\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr3, r3, #0x10\n\tasr\tr3, r3, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tmul\tr3, r3, r2\n\tmov\tr1, #0x1\n\tlsl\tr1, r1, r0\n\tadd\tr0, r3, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul16Shift,.Lfe1-MathUtil_Mul16Shift\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Mul16Shift # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:MathUtil_Mul32:agbcc","sym":"MathUtil_Mul32","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","fixed-point","long-long","soft-div"],"loc":9,"refSource":"s32 MathUtil_Mul32(s32 x, s32 y)\n{\n s64 result;\n\n result = x;\n result *= y;\n result /= 256;\n return result;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L23-L31","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul32\n\t.type\t MathUtil_Mul32,function\n\t.thumb_func\nMathUtil_Mul32:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r1, #0\n\tadd\tr4, r0, #0\n\tasr\tr5, r0, #0x1f\n\tasr\tr3, r2, #0x1f\n\tadd\tr1, r5, #0\n\tadd\tr0, r4, #0\n\tbl\t__muldi3\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr7, r5, #0\n\tadd\tr6, r4, #0\n\tcmp\tr5, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr6, #0xff\n\tmov\tr7, #0\n\tadd\tr6, r6, r4\n\tadc\tr7, r7, r5\n.L3:\n\tlsl\tr3, r7, #0x18\n\tlsr\tr2, r6, #0x8\n\tadd\tr0, r3, #0\n\torr\tr0, r0, r2\n\tasr\tr1, r7, #0x8\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul32,.Lfe1-MathUtil_Mul32\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"s32 MathUtil_Mul32(s32 a0, s32 a1) {\n s32 v0;\n s32 v1;\n v0 = __muldi3(a0, a0 >> 31, a1, a1 >> 31);\n if (a0 >> 31 >= 0) {\n v1 = a0 >> 31;\n } else {\n v0 = 255 + v0;\n v1 = ASMLIFT_ERROR(\"unmodelled instruction 'adc'\", 0, a0 >> 31);\n }\n return v1 << 24 | v0 >> 8;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":12,"gotos":0,"casts":0,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: unmodelled instruction 'adc'"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u32 __muldi3(s32, s32, s32, s32); /* extern */\n\ns32 MathUtil_Mul32(s32 arg0, s32 arg1) {\n s32 temp_r1;\n s32 var_r7;\n u32 temp_r0;\n u32 temp_ret;\n u32 var_r6;\n\n temp_ret = __muldi3(arg0, arg0 >> 0x1F, arg1, arg1 >> 0x1F);\n temp_r0 = temp_ret;\n temp_r1 = SECOND_REG(temp_ret);\n var_r7 = temp_r1;\n var_r6 = temp_r0;\n if (temp_r1 < 0) {\n var_r6 = temp_r0 + 0xFF;\n var_r7 = temp_r1 + M2C_CARRY(var_r6);\n }\n return (var_r7 << 0x18) | (var_r6 >> 8);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_CARRY"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Mul32` — benchmark function pokeemerald:MathUtil_Mul32:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul32\n\t.type\t MathUtil_Mul32,function\n\t.thumb_func\nMathUtil_Mul32:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r1, #0\n\tadd\tr4, r0, #0\n\tasr\tr5, r0, #0x1f\n\tasr\tr3, r2, #0x1f\n\tadd\tr1, r5, #0\n\tadd\tr0, r4, #0\n\tbl\t__muldi3\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr7, r5, #0\n\tadd\tr6, r4, #0\n\tcmp\tr5, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr6, #0xff\n\tmov\tr7, #0\n\tadd\tr6, r6, r4\n\tadc\tr7, r7, r5\n.L3:\n\tlsl\tr3, r7, #0x18\n\tlsr\tr2, r6, #0x8\n\tadd\tr0, r3, #0\n\torr\tr0, r0, r2\n\tasr\tr1, r7, #0x8\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul32,.Lfe1-MathUtil_Mul32\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Mul32 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Mul32` — benchmark function pokeemerald:MathUtil_Mul32:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Mul32:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul32\n\t.type\t MathUtil_Mul32,function\n\t.thumb_func\nMathUtil_Mul32:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r1, #0\n\tadd\tr4, r0, #0\n\tasr\tr5, r0, #0x1f\n\tasr\tr3, r2, #0x1f\n\tadd\tr1, r5, #0\n\tadd\tr0, r4, #0\n\tbl\t__muldi3\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr7, r5, #0\n\tadd\tr6, r4, #0\n\tcmp\tr5, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr6, #0xff\n\tmov\tr7, #0\n\tadd\tr6, r6, r4\n\tadc\tr7, r7, r5\n.L3:\n\tlsl\tr3, r7, #0x18\n\tlsr\tr2, r6, #0x8\n\tadd\tr0, r3, #0\n\torr\tr0, r0, r2\n\tasr\tr1, r7, #0x8\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul32,.Lfe1-MathUtil_Mul32\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Mul32 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:ModifyStatByNature:agbcc","sym":"ModifyStatByNature","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","branch","arithmetic","soft-div","global"],"loc":25,"refSource":"u16 ModifyStatByNature(u8 nature, u16 stat, u8 statIndex)\n{\n u16 retVal;\n\n // Don't modify HP, Accuracy, or Evasion by nature\n if (statIndex <= STAT_HP || statIndex > NUM_NATURE_STATS)\n return stat;\n\n switch (gNatureStatTable[nature][statIndex - 1])\n {\n case 1:\n retVal = stat * 110;\n retVal /= 100;\n break;\n case -1:\n retVal = stat * 90;\n retVal /= 100;\n break;\n default:\n retVal = stat;\n break;\n }\n\n return retVal;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L5864-L5898","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tModifyStatByNature\n\t.type\t ModifyStatByNature,function\n\t.thumb_func\nModifyStatByNature:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr0, #0xff\n\tlsl\tr0, r0, #0x18\n\tadd\tr2, r2, r0\n\tlsr\tr2, r2, #0x18\n\tcmp\tr2, #0x4\n\tbls\t.L3\t@cond_branch\n\tadd\tr0, r3, #0\n\tb\t.L9\n.L3:\n\tldr\tr0, .L11\n\tlsl\tr1, r4, #0x2\n\tadd\tr1, r1, r4\n\tsub\tr1, r1, #0x1\n\tadd\tr1, r5, r1\n\tadd\tr1, r1, r0\n\tldrb\tr1, [r1, #0]\n\tlsl\tr1, r1, #24\n\tasr\tr1, r1, #24\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr1, r0\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbne\t.L7\t@cond_branch\n\tmov\tr0, #0x6e\n\tb\t.L10\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\tgNatureStatTable\n.L6:\n\tmov\tr0, #0x5a\n.L10:\n\tmul\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tmov\tr1, #0x64\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L9\n.L7:\n\tadd\tr0, r3, #0\n.L9:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ModifyStatByNature,.Lfe1-ModifyStatByNature\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gNatureStatTable","shape":"s8[]"}],"outcome":"nonmatch","source":"s32 ModifyStatByNature(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n s32 v1;\n if ((a2 << 24) + (255 << 24) >> 24 > 4) {\n return (u16)a1;\n } else {\n v0 = gNatureStatTable[(u8)a2 + ((u8)a0 * 5 - 1)];\n switch ((s8)v0) {\n case -1:\n v1 = 90;\n return (u16)((u16)(v1 * (u16)a1) / 100);\n case 1:\n v1 = 110;\n return (u16)((u16)(v1 * (u16)a1) / 100);\n default:\n return (u16)a1;\n }\n }\n}\n","score":47,"maxScore":60,"compileErrors":null,"breakdown":{"insert":14,"delete":10,"replace":14,"opMismatch":2,"argMismatch":7},"quality":{"score":84,"lines":19,"gotos":0,"casts":11,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u16 ModifyStatByNature(u8 nature, u16 stat, u8 statIndex) {\n s32 var_r0;\n s8 temp_r1;\n u16 temp_r3;\n\n temp_r3 = stat;\n if ((u32) ((u32) ((statIndex << 0x18) + 0xFF000000) >> 0x18) > 4U) {\n return temp_r3;\n }\n temp_r1 = (s8) (u8) (*gNatureStatTable)[statIndex + ((nature * 5) - 1)];\n switch (temp_r1) { /* irregular */\n case 1:\n var_r0 = 0x6E;\nblock_6:\n return (u16) ((u16) (var_r0 * temp_r3) / 100U);\n case -1:\n var_r0 = 0x5A;\n goto block_6;\n default:\n return temp_r3;\n }\n}\n","score":31,"maxScore":55,"compileErrors":null,"breakdown":{"insert":9,"delete":11,"replace":3,"opMismatch":1,"argMismatch":7},"quality":{"score":76,"lines":21,"gotos":1,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":31,"maxScore":55,"ratio":0.5636363636363636,"kinds":{"insert":9,"delete":11,"replace":3,"opMismatch":1,"argMismatch":7}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ModifyStatByNature` — benchmark function pokeemerald:ModifyStatByNature:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tModifyStatByNature\n\t.type\t ModifyStatByNature,function\n\t.thumb_func\nModifyStatByNature:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr0, #0xff\n\tlsl\tr0, r0, #0x18\n\tadd\tr2, r2, r0\n\tlsr\tr2, r2, #0x18\n\tcmp\tr2, #0x4\n\tbls\t.L3\t@cond_branch\n\tadd\tr0, r3, #0\n\tb\t.L9\n.L3:\n\tldr\tr0, .L11\n\tlsl\tr1, r4, #0x2\n\tadd\tr1, r1, r4\n\tsub\tr1, r1, #0x1\n\tadd\tr1, r5, r1\n\tadd\tr1, r1, r0\n\tldrb\tr1, [r1, #0]\n\tlsl\tr1, r1, #24\n\tasr\tr1, r1, #24\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr1, r0\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbne\t.L7\t@cond_branch\n\tmov\tr0, #0x6e\n\tb\t.L10\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\tgNatureStatTable\n.L6:\n\tmov\tr0, #0x5a\n.L10:\n\tmul\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tmov\tr1, #0x64\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L9\n.L7:\n\tadd\tr0, r3, #0\n.L9:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ModifyStatByNature,.Lfe1-ModifyStatByNature\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu16 ModifyStatByNature(u8 nature, u16 stat, u8 statIndex);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ModifyStatByNature # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ModifyStatByNature` — benchmark function pokeemerald:ModifyStatByNature:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:ModifyStatByNature:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tModifyStatByNature\n\t.type\t ModifyStatByNature,function\n\t.thumb_func\nModifyStatByNature:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr0, #0xff\n\tlsl\tr0, r0, #0x18\n\tadd\tr2, r2, r0\n\tlsr\tr2, r2, #0x18\n\tcmp\tr2, #0x4\n\tbls\t.L3\t@cond_branch\n\tadd\tr0, r3, #0\n\tb\t.L9\n.L3:\n\tldr\tr0, .L11\n\tlsl\tr1, r4, #0x2\n\tadd\tr1, r1, r4\n\tsub\tr1, r1, #0x1\n\tadd\tr1, r5, r1\n\tadd\tr1, r1, r0\n\tldrb\tr1, [r1, #0]\n\tlsl\tr1, r1, #24\n\tasr\tr1, r1, #24\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr1, r0\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbne\t.L7\t@cond_branch\n\tmov\tr0, #0x6e\n\tb\t.L10\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\tgNatureStatTable\n.L6:\n\tmov\tr0, #0x5a\n.L10:\n\tmul\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tmov\tr1, #0x64\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L9\n.L7:\n\tadd\tr0, r3, #0\n.L9:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ModifyStatByNature,.Lfe1-ModifyStatByNature\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ModifyStatByNature # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:PutFirstMemBlockHeader:agbcc","sym":"PutFirstMemBlockHeader","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["pointer","struct","call"],"loc":4,"refSource":"void PutFirstMemBlockHeader(void *block, u32 size)\n{\n PutMemBlockHeader(block, (struct MemBlock *)block, (struct MemBlock *)block, size - sizeof(struct MemBlock));\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/malloc.c#L42-L45","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutFirstMemBlockHeader\n\t.type\t PutFirstMemBlockHeader,function\n\t.thumb_func\nPutFirstMemBlockHeader:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr3, r3, #0x10\n\tadd\tr1, r2, #0\n\tbl\tPutMemBlockHeader\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t PutFirstMemBlockHeader,.Lfe1-PutFirstMemBlockHeader\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-92d4b72c07b6.i.gz","proto":{"PutFirstMemBlockHeader":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void PutFirstMemBlockHeader(u32 a0, u32 a1) {\n PutMemBlockHeader(a0, a0, a0, a1 - 16);\n return;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void PutFirstMemBlockHeader(void *block, u32 size) {\n PutMemBlockHeader(block, (struct MemBlock *) block, (struct MemBlock *) block, size - 0x10);\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `PutFirstMemBlockHeader` — benchmark function pokeemerald:PutFirstMemBlockHeader:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutFirstMemBlockHeader\n\t.type\t PutFirstMemBlockHeader,function\n\t.thumb_func\nPutFirstMemBlockHeader:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr3, r3, #0x10\n\tadd\tr1, r2, #0\n\tbl\tPutMemBlockHeader\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t PutFirstMemBlockHeader,.Lfe1-PutFirstMemBlockHeader\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-92d4b72c07b6.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid PutFirstMemBlockHeader(void *block, u32 size);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function PutFirstMemBlockHeader # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `PutFirstMemBlockHeader` — benchmark function pokeemerald:PutFirstMemBlockHeader:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:PutFirstMemBlockHeader:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutFirstMemBlockHeader\n\t.type\t PutFirstMemBlockHeader,function\n\t.thumb_func\nPutFirstMemBlockHeader:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr3, r3, #0x10\n\tadd\tr1, r2, #0\n\tbl\tPutMemBlockHeader\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t PutFirstMemBlockHeader,.Lfe1-PutFirstMemBlockHeader\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"PutFirstMemBlockHeader\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name PutFirstMemBlockHeader # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:PutMemBlockHeader:agbcc","sym":"PutMemBlockHeader","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","pointer","struct"],"loc":10,"refSource":"void PutMemBlockHeader(void *block, struct MemBlock *prev, struct MemBlock *next, u32 size)\n{\n struct MemBlock *header = (struct MemBlock *)block;\n\n header->flag = FALSE;\n header->magic = MALLOC_SYSTEM_ID;\n header->size = size;\n header->prev = prev;\n header->next = next;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/malloc.c#L31-L40","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutMemBlockHeader\n\t.type\t PutMemBlockHeader,function\n\t.thumb_func\nPutMemBlockHeader:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr4, .L3\n\tstrh\tr4, [r0, #0x2]\n\tstr\tr3, [r0, #0x4]\n\tstr\tr1, [r0, #0x8]\n\tstr\tr2, [r0, #0xc]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xa3a3\n.Lfe1:\n\t.size\t PutMemBlockHeader,.Lfe1-PutMemBlockHeader\n\n.text\n\t.align\t2, 0\n","proto":{"PutMemBlockHeader":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"struct Struct0 { u16 field_0; u16 field_2; s32 field_4; s32 field_8; s32 field_12; };\nvoid PutMemBlockHeader(struct Struct0 * a0, u32 a1, u32 a2, u32 a3) {\n a0->field_0 = 0;\n a0->field_2 = 41891;\n a0->field_4 = a3;\n a0->field_8 = a1;\n a0->field_12 = a2;\n return;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void PutMemBlockHeader(void *arg0, s32 arg1, s32 arg2, s32 arg3) {\n arg0->unk0 = 0;\n arg0->unk2 = 0xA3A3;\n arg0->unk4 = arg3;\n arg0->unk8 = arg1;\n arg0->unkC = arg2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3930: warning: dereferencing `void *' pointer","/c.c:3930: request for member `unk0' in something not a structure or union","/c.c:3931: warning: dereferencing `void *' pointer","/c.c:3931: request for member `unk2' in something not a structure or union","/c.c:3932: warning: dereferencing `void *' pointer"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `PutMemBlockHeader` — benchmark function pokeemerald:PutMemBlockHeader:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutMemBlockHeader\n\t.type\t PutMemBlockHeader,function\n\t.thumb_func\nPutMemBlockHeader:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr4, .L3\n\tstrh\tr4, [r0, #0x2]\n\tstr\tr3, [r0, #0x4]\n\tstr\tr1, [r0, #0x8]\n\tstr\tr2, [r0, #0xc]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xa3a3\n.Lfe1:\n\t.size\t PutMemBlockHeader,.Lfe1-PutMemBlockHeader\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function PutMemBlockHeader # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `PutMemBlockHeader` — benchmark function pokeemerald:PutMemBlockHeader:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:PutMemBlockHeader:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutMemBlockHeader\n\t.type\t PutMemBlockHeader,function\n\t.thumb_func\nPutMemBlockHeader:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr4, .L3\n\tstrh\tr4, [r0, #0x2]\n\tstr\tr3, [r0, #0x4]\n\tstr\tr1, [r0, #0x8]\n\tstr\tr2, [r0, #0xc]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xa3a3\n.Lfe1:\n\t.size\t PutMemBlockHeader,.Lfe1-PutMemBlockHeader\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"PutMemBlockHeader\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name PutMemBlockHeader # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:Random:agbcc","sym":"Random","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","arithmetic","shift","call"],"loc":6,"refSource":"u16 Random(void)\n{\n gRngValue = ISO_RANDOMIZE1(gRngValue);\n sRandCount++;\n return gRngValue >> 16;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/random.c#L11-L16","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tldr\tr2, .L3+0xc\n\tldr\tr1, [r2]\n\tadd\tr1, r1, #0x1\n\tstr\tr1, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x6073\n\t.word\tsRandCount\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\n\t.lcomm\tsRandCount,4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gRngValue","shape":"scalar u32"},{"name":"sRandCount","shape":"scalar u32"}],"outcome":"nonmatch","source":"s32 Random(void) {\n s32 v0;\n v0 = gRngValue;\n gRngValue = 1103515245 * v0 + 24691;\n sRandCount = sRandCount + 1;\n return 1103515245 * v0 + 24691 >> 16;\n}\n","score":1,"maxScore":18,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern u32 gRngValue;\nextern s32 sRandCount;\n\nu32 Random(void) {\n u32 temp_r0;\n\n temp_r0 = (0x41C64E6D * gRngValue) + 0x6073;\n gRngValue = temp_r0;\n sRandCount += 1;\n return temp_r0 >> 0x10;\n}\n","score":1,"maxScore":18,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":18,"ratio":0.05555555555555555,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Random` — benchmark function pokeemerald:Random:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tldr\tr2, .L3+0xc\n\tldr\tr1, [r2]\n\tadd\tr1, r1, #0x1\n\tstr\tr1, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x6073\n\t.word\tsRandCount\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\n\t.lcomm\tsRandCount,4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Random # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Random` — benchmark function pokeemerald:Random:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:Random:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tldr\tr2, .L3+0xc\n\tldr\tr1, [r2]\n\tadd\tr1, r1, #0x1\n\tstr\tr1, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x6073\n\t.word\tsRandCount\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\n\t.lcomm\tsRandCount,4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Random # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:SetupBytecodeScript:agbcc","sym":"SetupBytecodeScript","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","pointer","struct"],"loc":6,"refSource":"u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr)\n{\n ctx->scriptPtr = ptr;\n ctx->mode = SCRIPT_MODE_BYTECODE;\n return 1;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/script.c#L52-L57","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSetupBytecodeScript\n\t.type\t SetupBytecodeScript,function\n\t.thumb_func\nSetupBytecodeScript:\n\tstr\tr1, [r0, #0x8]\n\tmov\tr1, #0x1\n\tstrb\tr1, [r0, #0x1]\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t SetupBytecodeScript,.Lfe1-SetupBytecodeScript\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"struct Struct0 { u8 _pad0[1]; u8 field_1; u8 _pad1[6]; s32 field_8; };\ns32 SetupBytecodeScript(struct Struct0 * a0, u32 a1) {\n a0->field_8 = a1;\n a0->field_1 = 1;\n return 1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 SetupBytecodeScript(void *arg0, s32 arg1) {\n arg0->unk8 = arg1;\n arg0->unk1 = 1;\n return 1;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3979: warning: dereferencing `void *' pointer","/c.c:3979: request for member `unk8' in something not a structure or union","/c.c:3980: warning: dereferencing `void *' pointer","/c.c:3980: request for member `unk1' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `SetupBytecodeScript` — benchmark function pokeemerald:SetupBytecodeScript:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSetupBytecodeScript\n\t.type\t SetupBytecodeScript,function\n\t.thumb_func\nSetupBytecodeScript:\n\tstr\tr1, [r0, #0x8]\n\tmov\tr1, #0x1\n\tstrb\tr1, [r0, #0x1]\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t SetupBytecodeScript,.Lfe1-SetupBytecodeScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function SetupBytecodeScript # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `SetupBytecodeScript` — benchmark function pokeemerald:SetupBytecodeScript:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:SetupBytecodeScript:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSetupBytecodeScript\n\t.type\t SetupBytecodeScript,function\n\t.thumb_func\nSetupBytecodeScript:\n\tstr\tr1, [r0, #0x8]\n\tmov\tr1, #0x1\n\tstrb\tr1, [r0, #0x1]\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t SetupBytecodeScript,.Lfe1-SetupBytecodeScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name SetupBytecodeScript # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:Sin2:agbcc","sym":"Sin2","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div","bitwise","branch","table"],"loc":11,"refSource":"s16 Sin2(u16 angle)\n{\n s32 angleMod = angle % 180;\n s32 negate = ((angle / 180) & 1);\n s16 value = gSineDegreeTable[angleMod];\n\n if (negate)\n return -value;\n else\n return value;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/trig.c#L527-L537","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSin2\n\t.type\t Sin2,function\n\t.thumb_func\nSin2:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__umodsi3\n\tadd\tr4, r0, #0\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__udivsi3\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldr\tr1, .L8\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r1\n\tldrh\tr1, [r4]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tlsl\tr0, r1, #0x10\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgSineDegreeTable\n.L3:\n\tlsl\tr0, r1, #0x10\n\tneg\tr0, r0\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sin2,.Lfe1-Sin2\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-3b544fd3decb.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","symbolsUsed":[{"name":"gSineDegreeTable","shape":"s16[]"}],"outcome":"nonmatch","source":"s32 Sin2(u32 a0) {\n s32 v0;\n u16 * p0;\n p0 = (u16 *)&gSineDegreeTable;\n if (((u16)a0 / 180 & 1) != 0) {\n v0 = -(p0[(u16)((u16)a0 % 180)] << 16);\n } else {\n v0 = p0[(u16)((u16)a0 % 180)] << 16;\n }\n return v0 >> 16;\n}\n","score":34,"maxScore":45,"compileErrors":null,"breakdown":{"insert":14,"delete":10,"replace":7,"opMismatch":1,"argMismatch":2},"quality":{"score":92,"lines":11,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 Sin2(u16 angle) {\n s32 var_r0;\n u16 temp_r1;\n u16 temp_r5;\n\n temp_r5 = angle;\n temp_r1 = (u16) gSineDegreeTable[(u16) (temp_r5 % 180U)];\n if (!((temp_r5 / 180U) & 1)) {\n var_r0 = temp_r1 << 0x10;\n } else {\n var_r0 = 0 - (temp_r1 << 0x10);\n }\n return (s16) (var_r0 >> 0x10);\n}\n","score":29,"maxScore":40,"compileErrors":null,"breakdown":{"insert":9,"delete":11,"replace":0,"opMismatch":0,"argMismatch":9},"quality":{"score":98,"lines":13,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":29,"maxScore":40,"ratio":0.725,"kinds":{"insert":9,"delete":11,"replace":0,"opMismatch":0,"argMismatch":9}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Sin2` — benchmark function pokeemerald:Sin2:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSin2\n\t.type\t Sin2,function\n\t.thumb_func\nSin2:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__umodsi3\n\tadd\tr4, r0, #0\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__udivsi3\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldr\tr1, .L8\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r1\n\tldrh\tr1, [r4]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tlsl\tr0, r1, #0x10\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgSineDegreeTable\n.L3:\n\tlsl\tr0, r1, #0x10\n\tneg\tr0, r0\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sin2,.Lfe1-Sin2\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-3b544fd3decb.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns16 Sin2(u16 angle);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Sin2 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Sin2` — benchmark function pokeemerald:Sin2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:Sin2:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSin2\n\t.type\t Sin2,function\n\t.thumb_func\nSin2:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__umodsi3\n\tadd\tr4, r0, #0\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__udivsi3\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldr\tr1, .L8\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r1\n\tldrh\tr1, [r4]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tlsl\tr0, r1, #0x10\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgSineDegreeTable\n.L3:\n\tlsl\tr0, r1, #0x10\n\tneg\tr0, r0\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sin2,.Lfe1-Sin2\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Sin2 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StopScript:agbcc","sym":"StopScript","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","pointer","struct","branch"],"loc":5,"refSource":"void StopScript(struct ScriptContext *ctx)\n{\n ctx->mode = SCRIPT_MODE_STOPPED;\n ctx->scriptPtr = NULL;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/script.c#L65-L69","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStopScript\n\t.type\t StopScript,function\n\t.thumb_func\nStopScript:\n\tmov\tr1, #0x0\n\tstrb\tr1, [r0, #0x1]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t StopScript,.Lfe1-StopScript\n\n.text\n\t.align\t2, 0\n","proto":{"StopScript":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"struct Struct0 { u8 _pad0[1]; u8 field_1; u8 _pad1[6]; s32 field_8; };\nvoid StopScript(struct Struct0 * a0) {\n a0->field_1 = 0;\n a0->field_8 = 0;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void StopScript(void *arg0) {\n arg0->unk1 = 0;\n arg0->unk8 = 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3979: warning: dereferencing `void *' pointer","/c.c:3979: request for member `unk1' in something not a structure or union","/c.c:3980: warning: dereferencing `void *' pointer","/c.c:3980: request for member `unk8' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StopScript` — benchmark function pokeemerald:StopScript:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStopScript\n\t.type\t StopScript,function\n\t.thumb_func\nStopScript:\n\tmov\tr1, #0x0\n\tstrb\tr1, [r0, #0x1]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t StopScript,.Lfe1-StopScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StopScript # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StopScript` — benchmark function pokeemerald:StopScript:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StopScript:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStopScript\n\t.type\t StopScript,function\n\t.thumb_func\nStopScript:\n\tmov\tr1, #0x0\n\tstrb\tr1, [r0, #0x1]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t StopScript,.Lfe1-StopScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StopScript\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StopScript # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StoreWordInTwoHalfwords:agbcc","sym":"StoreWordInTwoHalfwords","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","pointer","array","shift"],"loc":5,"refSource":"void StoreWordInTwoHalfwords(u16 *h, u32 w)\n{\n h[0] = (u16)(w);\n h[1] = (u16)(w >> 16);\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L127-L131","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStoreWordInTwoHalfwords\n\t.type\t StoreWordInTwoHalfwords,function\n\t.thumb_func\nStoreWordInTwoHalfwords:\n\tstrh\tr1, [r0]\n\tlsr\tr1, r1, #0x10\n\tstrh\tr1, [r0, #0x2]\n\tbx\tlr\n.Lfe1:\n\t.size\t StoreWordInTwoHalfwords,.Lfe1-StoreWordInTwoHalfwords\n\n.text\n\t.align\t2, 0\n","proto":{"StoreWordInTwoHalfwords":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void StoreWordInTwoHalfwords(u16 * a0, u32 a1) {\n *a0 = a1;\n a0[1] = a1 >> 16;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void StoreWordInTwoHalfwords(void *arg0, u16 arg1) {\n arg0->unk0 = arg1;\n arg0->unk2 = (s16) (arg1 >> 0x10);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3922: warning: dereferencing `void *' pointer","/c.c:3922: request for member `unk0' in something not a structure or union","/c.c:3923: warning: dereferencing `void *' pointer","/c.c:3923: request for member `unk2' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StoreWordInTwoHalfwords` — benchmark function pokeemerald:StoreWordInTwoHalfwords:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStoreWordInTwoHalfwords\n\t.type\t StoreWordInTwoHalfwords,function\n\t.thumb_func\nStoreWordInTwoHalfwords:\n\tstrh\tr1, [r0]\n\tlsr\tr1, r1, #0x10\n\tstrh\tr1, [r0, #0x2]\n\tbx\tlr\n.Lfe1:\n\t.size\t StoreWordInTwoHalfwords,.Lfe1-StoreWordInTwoHalfwords\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StoreWordInTwoHalfwords # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StoreWordInTwoHalfwords` — benchmark function pokeemerald:StoreWordInTwoHalfwords:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StoreWordInTwoHalfwords:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStoreWordInTwoHalfwords\n\t.type\t StoreWordInTwoHalfwords,function\n\t.thumb_func\nStoreWordInTwoHalfwords:\n\tstrh\tr1, [r0]\n\tlsr\tr1, r1, #0x10\n\tstrh\tr1, [r0, #0x2]\n\tbx\tlr\n.Lfe1:\n\t.size\t StoreWordInTwoHalfwords,.Lfe1-StoreWordInTwoHalfwords\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StoreWordInTwoHalfwords\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StoreWordInTwoHalfwords # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StringAppend:agbcc","sym":"StringAppend","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","call","branch"],"loc":7,"refSource":"u8 *StringAppend(u8 *dest, const u8 *src)\n{\n while (*dest != EOS)\n dest++;\n\n return StringCopy(dest, src);\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L88-L94","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringAppend\n\t.type\t StringAppend,function\n\t.thumb_func\nStringAppend:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n.L7:\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tStringCopy\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringAppend,.Lfe1-StringAppend\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-9801ce0c65ce.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 StringAppend(u8 * a0, u32 a1) {\n u8 * v0;\n for (v0 = a0; *v0 != 255; v0 = v0 + 1) {\n }\n return StringCopy(v0, a1);\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 *StringAppend(u8 *dest, u8 *src) {\n u8 *var_r2;\n\n var_r2 = dest;\nloop_2:\n if (*var_r2 != 0xFF) {\n var_r2 += 1;\n goto loop_2;\n }\n return StringCopy(var_r2, src);\n}\n","score":5,"maxScore":13,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":88,"lines":10,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StringAppend` — benchmark function pokeemerald:StringAppend:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringAppend\n\t.type\t StringAppend,function\n\t.thumb_func\nStringAppend:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n.L7:\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tStringCopy\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringAppend,.Lfe1-StringAppend\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-9801ce0c65ce.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 *StringAppend(u8 *dest, const u8 *src);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringAppend # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StringAppend` — benchmark function pokeemerald:StringAppend:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringAppend:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringAppend\n\t.type\t StringAppend,function\n\t.thumb_func\nStringAppend:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n.L7:\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tStringCopy\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringAppend,.Lfe1-StringAppend\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringAppend # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StringCompare:agbcc","sym":"StringCompare","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","branch","pointer","arithmetic"],"loc":12,"refSource":"s32 StringCompare(const u8 *str1, const u8 *str2)\n{\n while (*str1 == *str2)\n {\n if (*str1 == EOS)\n return 0;\n str1++;\n str2++;\n }\n\n return *str1 - *str2;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L124-L135","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompare\n\t.type\t StringCompare,function\n\t.thumb_func\nStringCompare:\n\tadd\tr2, r0, #0\n\tb\t.L9\n.L5:\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L6:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L9:\n\tldrb\tr0, [r2]\n\tldrb\tr3, [r1]\n\tcmp\tr0, r3\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L8:\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCompare,.Lfe1-StringCompare\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'StringCompare' — structure: cannot structure 'StringCompare': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tStringCompare */\n/* \t.type\t StringCompare,function */\n/* \t.thumb_func */\n/* StringCompare: */\n/* \tadd\tr2, r0, #0 */\n/* \tb\t.L9 */\n/* .L5: */\n/* \tcmp\tr0, #0xff */\n/* \tbne\t.L6\t@cond_branch */\n/* \tmov\tr0, #0x0 */\n/* \tb\t.L8 */\n/* .L6: */\n/* \tadd\tr2, r2, #0x1 */\n/* \tadd\tr1, r1, #0x1 */\n/* .L9: */\n/* \tldrb\tr0, [r2] */\n/* \tldrb\tr3, [r1] */\n/* \tcmp\tr0, r3 */\n/* \tbeq\t.L5\t@cond_branch */\n/* \tldrb\tr0, [r2] */\n/* \tldrb\tr1, [r1] */\n/* \tsub\tr0, r0, r1 */\n/* .L8: */\n/* \tbx\tlr */\n/* .Lfe1: */\n/* \t.size\t StringCompare,.Lfe1-StringCompare */\n/* .text */\n/* \t.align\t2, 0 */\nvoid StringCompare(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'StringCompare': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":38,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'StringCompare': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 StringCompare(u8 *arg0, u8 *arg1) {\n u8 *var_r1;\n u8 *var_r2;\n u8 temp_r0;\n\n var_r1 = arg1;\n var_r2 = arg0;\nloop_4:\n temp_r0 = *var_r2;\n if (temp_r0 != *var_r1) {\n return *var_r2 - *var_r1;\n }\n if (temp_r0 == 0xFF) {\n return 0;\n }\n var_r2 += 1;\n var_r1 += 1;\n goto loop_4;\n}\n","score":21,"maxScore":23,"compileErrors":null,"breakdown":{"insert":7,"delete":9,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":88,"lines":18,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":21,"maxScore":23,"ratio":0.9130434782608695,"kinds":{"insert":7,"delete":9,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StringCompare` — benchmark function pokeemerald:StringCompare:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompare\n\t.type\t StringCompare,function\n\t.thumb_func\nStringCompare:\n\tadd\tr2, r0, #0\n\tb\t.L9\n.L5:\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L6:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L9:\n\tldrb\tr0, [r2]\n\tldrb\tr3, [r1]\n\tcmp\tr0, r3\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L8:\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCompare,.Lfe1-StringCompare\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringCompare # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StringCompare` — benchmark function pokeemerald:StringCompare:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCompare:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompare\n\t.type\t StringCompare,function\n\t.thumb_func\nStringCompare:\n\tadd\tr2, r0, #0\n\tb\t.L9\n.L5:\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L6:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L9:\n\tldrb\tr0, [r2]\n\tldrb\tr3, [r1]\n\tcmp\tr0, r3\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L8:\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCompare,.Lfe1-StringCompare\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCompare # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StringCompareN:agbcc","sym":"StringCompareN","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","branch","pointer","arithmetic"],"loc":14,"refSource":"s32 StringCompareN(const u8 *str1, const u8 *str2, u32 n)\n{\n while (*str1 == *str2)\n {\n if (*str1 == EOS)\n return 0;\n str1++;\n str2++;\n if (--n == 0)\n return 0;\n }\n\n return *str1 - *str2;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L137-L150","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompareN\n\t.type\t StringCompareN,function\n\t.thumb_func\nStringCompareN:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tb\t.L3\n.L5:\n\tcmp\tr0, #0xff\n\tbeq\t.L10\t@cond_branch\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n.L10:\n\tmov\tr0, #0x0\n\tb\t.L9\n.L3:\n\tldrb\tr0, [r3]\n\tldrb\tr4, [r1]\n\tcmp\tr0, r4\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r3]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L9:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCompareN,.Lfe1-StringCompareN\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 StringCompareN(u8 * a0, u8 * a1, u32 a2) {\n u8 * v0;\n u8 * v1;\n s32 v2;\n v0 = a0;\n v1 = a1;\n v2 = a2;\n while (*v0 == *v1) {\n if (*v0 != 255) {\n v0 = v0 + 1;\n v1 = v1 + 1;\n v2 = v2 - 1;\n if (v2 == 0) return 0;\n } else {\n return 0;\n }\n }\n return *v0 - *v1;\n}\n","score":0,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":19,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 StringCompareN(u8 *arg0, u8 *arg1, s32 arg2) {\n s32 var_r2;\n u8 *var_r1;\n u8 *var_r3;\n u8 temp_r0;\n\n var_r1 = arg1;\n var_r2 = arg2;\n var_r3 = arg0;\nloop_4:\n temp_r0 = *var_r3;\n if (temp_r0 != *var_r1) {\n return *var_r3 - *var_r1;\n }\n if ((temp_r0 == 0xFF) || (var_r3 += 1, var_r1 += 1, var_r2 -= 1, (var_r2 == 0))) {\n return 0;\n }\n goto loop_4;\n}\n","score":18,"maxScore":27,"compileErrors":null,"breakdown":{"insert":5,"delete":8,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":88,"lines":18,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StringCompareN` — benchmark function pokeemerald:StringCompareN:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompareN\n\t.type\t StringCompareN,function\n\t.thumb_func\nStringCompareN:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tb\t.L3\n.L5:\n\tcmp\tr0, #0xff\n\tbeq\t.L10\t@cond_branch\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n.L10:\n\tmov\tr0, #0x0\n\tb\t.L9\n.L3:\n\tldrb\tr0, [r3]\n\tldrb\tr4, [r1]\n\tcmp\tr0, r4\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r3]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L9:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCompareN,.Lfe1-StringCompareN\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringCompareN # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StringCompareN` — benchmark function pokeemerald:StringCompareN:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCompareN:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompareN\n\t.type\t StringCompareN,function\n\t.thumb_func\nStringCompareN:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tb\t.L3\n.L5:\n\tcmp\tr0, #0xff\n\tbeq\t.L10\t@cond_branch\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n.L10:\n\tmov\tr0, #0x0\n\tb\t.L9\n.L3:\n\tldrb\tr0, [r3]\n\tldrb\tr4, [r1]\n\tcmp\tr0, r4\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r3]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L9:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCompareN,.Lfe1-StringCompareN\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCompareN # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StringCopy:agbcc","sym":"StringCopy","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","branch"],"loc":12,"refSource":"u8 *StringCopy(u8 *dest, const u8 *src)\n{\n while (*src != EOS)\n {\n *dest = *src;\n dest++;\n src++;\n }\n\n *dest = EOS;\n return dest;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L75-L86","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopy\n\t.type\t StringCopy,function\n\t.thumb_func\nStringCopy:\n\tadd\tr3, r0, #0\n\tb\t.L7\n.L5:\n\tstrb\tr2, [r3]\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr2, [r1]\n\tadd\tr0, r2, #0\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n\tstrb\tr0, [r3]\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCopy,.Lfe1-StringCopy\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"u8 * StringCopy(u8 * a0, u8 * a1) {\n u8 * v0;\n u8 * v1;\n v0 = a1;\n v1 = a0;\n while (*v0 != 255) {\n *v1 = *v0;\n v1 = v1 + 1;\n v0 = v0 + 1;\n }\n *v1 = 255;\n return v1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 *StringCopy(u8 *arg0, u8 *arg1) {\n u8 *var_r1;\n u8 *var_r3;\n u8 temp_r2;\n\n var_r1 = arg1;\n var_r3 = arg0;\nloop_2:\n temp_r2 = *var_r1;\n if (temp_r2 != 0xFF) {\n *var_r3 = temp_r2;\n var_r3 += 1;\n var_r1 += 1;\n goto loop_2;\n }\n *var_r3 = 0xFF;\n return var_r3;\n}\n","score":14,"maxScore":16,"compileErrors":null,"breakdown":{"insert":3,"delete":7,"replace":1,"opMismatch":1,"argMismatch":2},"quality":{"score":88,"lines":17,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StringCopy` — benchmark function pokeemerald:StringCopy:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopy\n\t.type\t StringCopy,function\n\t.thumb_func\nStringCopy:\n\tadd\tr3, r0, #0\n\tb\t.L7\n.L5:\n\tstrb\tr2, [r3]\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr2, [r1]\n\tadd\tr0, r2, #0\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n\tstrb\tr0, [r3]\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCopy,.Lfe1-StringCopy\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringCopy # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StringCopy` — benchmark function pokeemerald:StringCopy:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCopy:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopy\n\t.type\t StringCopy,function\n\t.thumb_func\nStringCopy:\n\tadd\tr3, r0, #0\n\tb\t.L7\n.L5:\n\tstrb\tr2, [r3]\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr2, [r1]\n\tadd\tr0, r2, #0\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n\tstrb\tr0, [r3]\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCopy,.Lfe1-StringCopy\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCopy # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StringCopyN:agbcc","sym":"StringCopyN","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","array"],"loc":9,"refSource":"u8 *StringCopyN(u8 *dest, const u8 *src, u8 n)\n{\n u16 i;\n\n for (i = 0; i < n; i++)\n dest[i] = src[i];\n\n return &dest[n];\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L96-L104","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopyN\n\t.type\t StringCopyN,function\n\t.thumb_func\nStringCopyN:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr3, #0x0\n\tadd\tr0, r5, #0\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tadd\tr1, r4, r3\n\tadd\tr0, r6, r3\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r2\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r4, r5\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCopyN,.Lfe1-StringCopyN\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 StringCopyN(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n if (0 < (u8)a2) {\n v0 = 0;\n do {\n *(u8 *)(a0 + v0) = *(u8 *)(a1 + v0);\n v0 = (u16)(v0 + 1);\n } while (v0 < (u8)a2);\n }\n return a0 + (u8)a2;\n}\n","score":15,"maxScore":27,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":2,"opMismatch":2,"argMismatch":5},"quality":{"score":84,"lines":11,"gotos":0,"casts":6,"unkGlue":0,"rawMem":2,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 StringCopyN(s32 arg0, s32 arg1, u8 arg2) {\n u16 var_r3;\n u8 temp_r5;\n\n temp_r5 = arg2;\n var_r3 = 0;\n if ((u32) temp_r5 > 0U) {\n do {\n *(arg0 + var_r3) = *(arg1 + var_r3);\n var_r3 += 1;\n } while ((u32) var_r3 < (u32) temp_r5);\n }\n return arg0 + temp_r5;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":98,"lines":13,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3929: invalid type argument of `unary *'"]},"gapSize":{"decompiler":"asmlift","score":15,"maxScore":27,"ratio":0.5555555555555556,"kinds":{"insert":4,"delete":2,"replace":2,"opMismatch":2,"argMismatch":5}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StringCopyN` — benchmark function pokeemerald:StringCopyN:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopyN\n\t.type\t StringCopyN,function\n\t.thumb_func\nStringCopyN:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr3, #0x0\n\tadd\tr0, r5, #0\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tadd\tr1, r4, r3\n\tadd\tr0, r6, r3\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r2\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r4, r5\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCopyN,.Lfe1-StringCopyN\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringCopyN # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StringCopyN` — benchmark function pokeemerald:StringCopyN:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCopyN:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopyN\n\t.type\t StringCopyN,function\n\t.thumb_func\nStringCopyN:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr3, #0x0\n\tadd\tr0, r5, #0\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tadd\tr1, r4, r3\n\tadd\tr0, r6, r3\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r2\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r4, r5\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCopyN,.Lfe1-StringCopyN\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCopyN # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StringLength:agbcc","sym":"StringLength","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","array","branch"],"loc":9,"refSource":"u16 StringLength(const u8 *str)\n{\n u16 length = 0;\n\n while (str[length] != EOS)\n length++;\n\n return length;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L114-L122","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringLength\n\t.type\t StringLength,function\n\t.thumb_func\nStringLength:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tadd\tr0, r2, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringLength,.Lfe1-StringLength\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 StringLength(u8 * a0) {\n s32 v0;\n for (v0 = 0; *(a0 + v0) != 255; v0 = (u16)(v0 + 1)) {\n }\n return v0;\n}\n","score":0,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u16 StringLength(u8 *arg0) {\n u16 var_r1;\n\n var_r1 = 0;\n if (*arg0 != 0xFF) {\n do {\n var_r1 += 1;\n } while (*(arg0 + var_r1) != 0xFF);\n }\n return var_r1;\n}\n","score":0,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":10,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StringLength` — benchmark function pokeemerald:StringLength:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringLength\n\t.type\t StringLength,function\n\t.thumb_func\nStringLength:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tadd\tr0, r2, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringLength,.Lfe1-StringLength\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringLength # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StringLength` — benchmark function pokeemerald:StringLength:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringLength:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringLength\n\t.type\t StringLength,function\n\t.thumb_func\nStringLength:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tadd\tr0, r2, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringLength,.Lfe1-StringLength\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringLength # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:TranslateBigMonSizeTableIndex:agbcc","sym":"TranslateBigMonSizeTableIndex","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","branch","array","struct","table"],"loc":11,"refSource":"static u8 TranslateBigMonSizeTableIndex(u16 a)\n{\n u8 i;\n\n for (i = 1; i < 15; i++)\n {\n if (a < sBigMonSizeTable[i].unk4)\n return i - 1;\n }\n return i;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon_size_record.c#L67-L77","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t2, 0\n\t.type\t sBigMonSizeTable,object\nsBigMonSizeTable:\n\t.short\t0x122\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0x0\n\t.space\t2\n\t.short\t0x12c\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xa\n\t.space\t2\n\t.short\t0x190\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0x6e\n\t.space\t2\n\t.short\t0x1f4\n\t.byte\t0x4\n\t.space\t1\n\t.short\t0x136\n\t.space\t2\n\t.short\t0x258\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0x2c6\n\t.space\t2\n\t.short\t0x2bc\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xa96\n\t.space\t2\n\t.short\t0x320\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0x1e1e\n\t.space\t2\n\t.short\t0x384\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x452e\n\t.space\t2\n\t.short\t0x3e8\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x7fc6\n\t.space\t2\n\t.short\t0x44c\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0xba5e\n\t.space\t2\n\t.short\t0x4b0\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xe16e\n\t.space\t2\n\t.short\t0x514\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0xf4f6\n\t.space\t2\n\t.short\t0x578\n\t.byte\t0x5\n\t.space\t1\n\t.short\t0xfcc6\n\t.space\t2\n\t.short\t0x5dc\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0xfeba\n\t.space\t2\n\t.short\t0x640\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xff82\n\t.space\t2\n\t.short\t0x6a4\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xffe6\n\t.space\t2\n\t.size\t sBigMonSizeTable,128\n.text\n\t.align\t2, 0\n\t.type\t TranslateBigMonSizeTableIndex,function\n\t.thumb_func\nTranslateBigMonSizeTableIndex:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tmov\tr1, #0x1\n\tldr\tr3, .L10\n.L6:\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x4]\n\tcmp\tr2, r0\n\tbcs\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tsBigMonSizeTable\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0xe\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r1, #0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t TranslateBigMonSizeTableIndex,.Lfe1-TranslateBigMonSizeTableIndex\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'TranslateBigMonSizeTableIndex' — lift: cannot lift 'TranslateBigMonSizeTableIndex': reads the sub-word data table 'sBigMonSizeTable' (.space) — sub-word table data is not modelled */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* \t.section .rodata */\n/* \t.align\t2, 0 */\n/* \t.type\t sBigMonSizeTable,object */\n/* sBigMonSizeTable: */\n/* \t.short\t0x122 */\n/* \t.byte\t0x1 */\n/* \t.space\t1 */\n/* \t.short\t0x0 */\n/* \t.space\t2 */\n/* \t.short\t0x12c */\n/* \t.byte\t0x1 */\n/* \t.space\t1 */\n/* \t.short\t0xa */\n/* \t.space\t2 */\n/* \t.short\t0x190 */\n/* \t.byte\t0x2 */\n/* \t.space\t1 */\n/* \t.short\t0x6e */\n/* \t.space\t2 */\n/* \t.short\t0x1f4 */\n/* \t.byte\t0x4 */\n/* \t.space\t1 */\n/* \t.short\t0x136 */\n/* \t.space\t2 */\n/* \t.short\t0x258 */\n/* \t.byte\t0x14 */\n/* \t.space\t1 */\n/* \t.short\t0x2c6 */\n/* \t.space\t2 */\n/* \t.short\t0x2bc */\n/* \t.byte\t0x32 */\n/* \t.space\t1 */\n/* \t.short\t0xa96 */\n/* \t.space\t2 */\n/* \t.short\t0x320 */\n/* \t.byte\t0x64 */\n/* \t.space\t1 */\n/* \t.short\t0x1e1e */\n/* \t.space\t2 */\n/* \t.short\t0x384 */\n/* \t.byte\t0x96 */\n/* \t.space\t1 */\n/* \t.short\t0x452e */\n/* \t.space\t2 */\n/* \t.short\t0x3e8 */\n/* \t.byte\t0x96 */\n/* \t.space\t1 */\n/* \t.short\t0x7fc6 */\n/* \t.space\t2 */\n/* \t.short\t0x44c */\n/* \t.byte\t0x64 */\n/* \t.space\t1 */\n/* \t.short\t0xba5e */\n/* \t.space\t2 */\n/* \t.short\t0x4b0 */\n/* \t.byte\t0x32 */\n/* \t.space\t1 */\n/* \t.short\t0xe16e */\n/* \t.space\t2 */\n/* \t.short\t0x514 */\n/* \t.byte\t0x14 */\n/* \t.space\t1 */\n/* \t.short\t0xf4f6 */\n/* \t.space\t2 */\n/* \t.short\t0x578 */\n/* \t.byte\t0x5 */\n/* \t.space\t1 */\n/* \t.short\t0xfcc6 */\n/* \t.space\t2 */\n/* \t.short\t0x5dc */\n/* \t.byte\t0x2 */\n/* \t.space\t1 */\n/* \t.short\t0xfeba */\n/* \t.space\t2 */\n/* \t.short\t0x640 */\n/* \t.byte\t0x1 */\n/* \t.space\t1 */\n/* \t.short\t0xff82 */\n/* \t.space\t2 */\n/* \t.short\t0x6a4 */\n/* \t.byte\t0x1 */\n/* \t.space\t1 */\n/* \t.short\t0xffe6 */\n/* \t.space\t2 */\n/* \t.size\t sBigMonSizeTable,128 */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.type\t TranslateBigMonSizeTableIndex,function */\n/* \t.thumb_func */\n/* TranslateBigMonSizeTableIndex: */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr2, r0, #0x10 */\n/* \tmov\tr1, #0x1 */\n/* \tldr\tr3, .L10 */\n/* .L6: */\n/* \tlsl\tr0, r1, #0x3 */\n/* \tadd\tr0, r0, r3 */\n/* \tldrh\tr0, [r0, #0x4] */\n/* \tcmp\tr2, r0 */\n/* \tbcs\t.L5\t@cond_branch */\n/* \tsub\tr0, r1, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tb\t.L9 */\n/* .L11: */\n/* \t.align\t2, 0 */\n/* .L10: */\n/* \t.word\tsBigMonSizeTable */\n/* .L5: */\n/* \tadd\tr0, r1, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr1, r0, #0x18 */\n/* \tcmp\tr1, #0xe */\n/* \tbls\t.L6\t@cond_branch */\n/* \tadd\tr0, r1, #0 */\n/* .L9: */\n/* \tbx\tlr */\n/* .Lfe1: */\n/* \t.size\t TranslateBigMonSizeTableIndex,.Lfe1-TranslateBigMonSizeTableIndex */\n/* .text */\n/* \t.align\t2, 0 */\nvoid TranslateBigMonSizeTableIndex(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'TranslateBigMonSizeTableIndex': reads the sub-word data table 'sBigMonSizeTable' (.space) — sub-word table data is not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":129,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'TranslateBigMonSizeTableIndex': reads the sub-word data table 'sBigMonSizeTable' (.space) — sub-word table data is not modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"struct _struct_sBigMonSizeTable_0x8 {\n /* 0x0 */ char pad0[4];\n /* 0x4 */ u16 unk4; /* inferred */\n /* 0x6 */ char pad6[2];\n}; /* size = 0x8 */\n\nstatic struct _struct_sBigMonSizeTable_0x8 sBigMonSizeTable[0x10]; /* unable to generate initializer: non-zero padding; const */\n\nu8 TranslateBigMonSizeTableIndex(u16 arg0) {\n u8 var_r1;\n\n var_r1 = 1;\nloop_1:\n if ((u32) arg0 < (u32) sBigMonSizeTable[var_r1].unk4) {\n return (u8) (var_r1 - 1);\n }\n var_r1 += 1;\n if ((u32) var_r1 > 0xEU) {\n return var_r1;\n }\n goto loop_1;\n}\n","score":19,"maxScore":30,"compileErrors":null,"breakdown":{"insert":8,"delete":9,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":86,"lines":19,"gotos":1,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":19,"maxScore":30,"ratio":0.6333333333333333,"kinds":{"insert":8,"delete":9,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `TranslateBigMonSizeTableIndex` — benchmark function pokeemerald:TranslateBigMonSizeTableIndex:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t2, 0\n\t.type\t sBigMonSizeTable,object\nsBigMonSizeTable:\n\t.short\t0x122\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0x0\n\t.space\t2\n\t.short\t0x12c\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xa\n\t.space\t2\n\t.short\t0x190\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0x6e\n\t.space\t2\n\t.short\t0x1f4\n\t.byte\t0x4\n\t.space\t1\n\t.short\t0x136\n\t.space\t2\n\t.short\t0x258\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0x2c6\n\t.space\t2\n\t.short\t0x2bc\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xa96\n\t.space\t2\n\t.short\t0x320\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0x1e1e\n\t.space\t2\n\t.short\t0x384\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x452e\n\t.space\t2\n\t.short\t0x3e8\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x7fc6\n\t.space\t2\n\t.short\t0x44c\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0xba5e\n\t.space\t2\n\t.short\t0x4b0\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xe16e\n\t.space\t2\n\t.short\t0x514\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0xf4f6\n\t.space\t2\n\t.short\t0x578\n\t.byte\t0x5\n\t.space\t1\n\t.short\t0xfcc6\n\t.space\t2\n\t.short\t0x5dc\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0xfeba\n\t.space\t2\n\t.short\t0x640\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xff82\n\t.space\t2\n\t.short\t0x6a4\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xffe6\n\t.space\t2\n\t.size\t sBigMonSizeTable,128\n.text\n\t.align\t2, 0\n\t.type\t TranslateBigMonSizeTableIndex,function\n\t.thumb_func\nTranslateBigMonSizeTableIndex:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tmov\tr1, #0x1\n\tldr\tr3, .L10\n.L6:\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x4]\n\tcmp\tr2, r0\n\tbcs\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tsBigMonSizeTable\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0xe\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r1, #0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t TranslateBigMonSizeTableIndex,.Lfe1-TranslateBigMonSizeTableIndex\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function TranslateBigMonSizeTableIndex # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `TranslateBigMonSizeTableIndex` — benchmark function pokeemerald:TranslateBigMonSizeTableIndex:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: 56ce4fcbfc759a141745683a121cfdfe917df4e58aae212cb087bda7b6105714\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:TranslateBigMonSizeTableIndex:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t2, 0\n\t.type\t sBigMonSizeTable,object\nsBigMonSizeTable:\n\t.short\t0x122\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0x0\n\t.space\t2\n\t.short\t0x12c\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xa\n\t.space\t2\n\t.short\t0x190\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0x6e\n\t.space\t2\n\t.short\t0x1f4\n\t.byte\t0x4\n\t.space\t1\n\t.short\t0x136\n\t.space\t2\n\t.short\t0x258\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0x2c6\n\t.space\t2\n\t.short\t0x2bc\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xa96\n\t.space\t2\n\t.short\t0x320\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0x1e1e\n\t.space\t2\n\t.short\t0x384\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x452e\n\t.space\t2\n\t.short\t0x3e8\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x7fc6\n\t.space\t2\n\t.short\t0x44c\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0xba5e\n\t.space\t2\n\t.short\t0x4b0\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xe16e\n\t.space\t2\n\t.short\t0x514\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0xf4f6\n\t.space\t2\n\t.short\t0x578\n\t.byte\t0x5\n\t.space\t1\n\t.short\t0xfcc6\n\t.space\t2\n\t.short\t0x5dc\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0xfeba\n\t.space\t2\n\t.short\t0x640\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xff82\n\t.space\t2\n\t.short\t0x6a4\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xffe6\n\t.space\t2\n\t.size\t sBigMonSizeTable,128\n.text\n\t.align\t2, 0\n\t.type\t TranslateBigMonSizeTableIndex,function\n\t.thumb_func\nTranslateBigMonSizeTableIndex:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tmov\tr1, #0x1\n\tldr\tr3, .L10\n.L6:\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x4]\n\tcmp\tr2, r0\n\tbcs\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tsBigMonSizeTable\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0xe\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r1, #0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t TranslateBigMonSizeTableIndex,.Lfe1-TranslateBigMonSizeTableIndex\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name TranslateBigMonSizeTableIndex # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:AbsMax:agbcc","sym":"AbsMax","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","branch","abs"],"loc":15,"refSource":"u32 AbsMax(s32 a, s32 b)\n{\n if (a < 0) {\n a = -a;\n }\n\n if (b < 0) {\n b = -b;\n }\n\n if (b < a) {\n return a;\n }\n return b;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L433-L447","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tAbsMax\n\t.type\t AbsMax,function\n\t.thumb_func\nAbsMax:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr2, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr2, r2\n.L3:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tneg\tr0, r0\n.L4:\n\tcmp\tr0, r2\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n.L6:\n\tbx\tlr\n.Lfe1:\n\t.size\t AbsMax,.Lfe1-AbsMax\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 AbsMax(s32 a0, s32 a1) {\n if (a0 < 0) a0 = -a0;\n if (a1 < 0) a1 = -a1;\n if (a1 < a0) a1 = a0;\n return a1;\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 AbsMax(s32 arg0, s32 arg1) {\n s32 var_r0;\n s32 var_r2;\n\n var_r2 = arg0;\n var_r0 = arg1;\n if (var_r2 < 0) {\n var_r2 = 0 - var_r2;\n }\n if (var_r0 < 0) {\n var_r0 = 0 - var_r0;\n }\n if (var_r0 < var_r2) {\n var_r0 = var_r2;\n }\n return var_r0;\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `AbsMax` — benchmark function sa3:AbsMax:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tAbsMax\n\t.type\t AbsMax,function\n\t.thumb_func\nAbsMax:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr2, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr2, r2\n.L3:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tneg\tr0, r0\n.L4:\n\tcmp\tr0, r2\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n.L6:\n\tbx\tlr\n.Lfe1:\n\t.size\t AbsMax,.Lfe1-AbsMax\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function AbsMax # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `AbsMax` — benchmark function sa3:AbsMax:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:AbsMax:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tAbsMax\n\t.type\t AbsMax,function\n\t.thumb_func\nAbsMax:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr2, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr2, r2\n.L3:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tneg\tr0, r0\n.L4:\n\tcmp\tr0, r2\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n.L6:\n\tbx\tlr\n.Lfe1:\n\t.size\t AbsMax,.Lfe1-AbsMax\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name AbsMax # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:Base10DigitsToHexNibbles:agbcc","sym":"Base10DigitsToHexNibbles","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","soft-div","bitwise","shift"],"loc":19,"refSource":"u32 Base10DigitsToHexNibbles(u16 num)\n{\n u8 i;\n u16 result;\n u8 lowDigit;\n u16 remainder = num;\n\n result = 0;\n for (i = 0; i < 4; i++) {\n s32 divisor = Div(remainder, 10);\n lowDigit = remainder - (divisor * 10);\n remainder = divisor;\n\n result |= lowDigit << (i * 4);\n }\n\n return result;\n}\n","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L147-L164","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tBase10DigitsToHexNibbles\n\t.type\t Base10DigitsToHexNibbles,function\n\t.thumb_func\nBase10DigitsToHexNibbles:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x0\n\tmov\tr5, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tmov\tr1, #0xa\n\tbl\tDiv\n\tlsl\tr1, r0, #0x2\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tsub\tr1, r4, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr0, r5, #0x2\n\tlsl\tr1, r1, r0\n\torr\tr6, r6, r1\n\tlsl\tr0, r6, #0x10\n\tlsr\tr6, r0, #0x10\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r6, #0\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Base10DigitsToHexNibbles,.Lfe1-Base10DigitsToHexNibbles\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 Base10DigitsToHexNibbles(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n v1 = (u16)a0;\n v3 = 0;\n v2 = 0;\n do {\n v0 = Div(v1, 10);\n v3 = (u16)(v3 | (u8)(v1 - v0 * 10) << (v2 << 2));\n v1 = (u16)v0;\n v2 = (u8)(v2 + 1);\n } while (v2 <= 3);\n return v3;\n}\n","score":9,"maxScore":32,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":1,"opMismatch":1,"argMismatch":3},"quality":{"score":94,"lines":16,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u16 Div(u16, s32); /* extern */\n\nu16 Base10DigitsToHexNibbles(u16 arg0) {\n u16 temp_r0;\n u16 var_r4;\n u16 var_r6;\n u8 temp_r1;\n u8 var_r5;\n\n var_r4 = arg0;\n var_r6 = 0;\n var_r5 = 0;\n do {\n temp_r0 = Div(var_r4, 0xA);\n temp_r1 = var_r4 - (temp_r0 * 0xA);\n var_r4 = temp_r0;\n var_r6 |= temp_r1 << (var_r5 * 4);\n var_r5 += 1;\n } while ((u32) var_r5 <= 3U);\n return var_r6;\n}\n","score":13,"maxScore":32,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":2,"opMismatch":0,"argMismatch":8},"quality":{"score":100,"lines":19,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"Div() resolves to an inline macro (int division) — soft-div idiom.","gapSize":{"decompiler":"asmlift","score":9,"maxScore":32,"ratio":0.28125,"kinds":{"insert":2,"delete":2,"replace":1,"opMismatch":1,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Base10DigitsToHexNibbles` — benchmark function sa3:Base10DigitsToHexNibbles:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tBase10DigitsToHexNibbles\n\t.type\t Base10DigitsToHexNibbles,function\n\t.thumb_func\nBase10DigitsToHexNibbles:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x0\n\tmov\tr5, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tmov\tr1, #0xa\n\tbl\tDiv\n\tlsl\tr1, r0, #0x2\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tsub\tr1, r4, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr0, r5, #0x2\n\tlsl\tr1, r1, r0\n\torr\tr6, r6, r1\n\tlsl\tr0, r6, #0x10\n\tlsr\tr6, r0, #0x10\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r6, #0\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Base10DigitsToHexNibbles,.Lfe1-Base10DigitsToHexNibbles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Base10DigitsToHexNibbles # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Base10DigitsToHexNibbles` — benchmark function sa3:Base10DigitsToHexNibbles:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:Base10DigitsToHexNibbles:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tBase10DigitsToHexNibbles\n\t.type\t Base10DigitsToHexNibbles,function\n\t.thumb_func\nBase10DigitsToHexNibbles:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x0\n\tmov\tr5, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tmov\tr1, #0xa\n\tbl\tDiv\n\tlsl\tr1, r0, #0x2\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tsub\tr1, r4, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr0, r5, #0x2\n\tlsl\tr1, r1, r0\n\torr\tr6, r6, r1\n\tlsl\tr0, r6, #0x10\n\tlsr\tr6, r0, #0x10\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r6, #0\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Base10DigitsToHexNibbles,.Lfe1-Base10DigitsToHexNibbles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Base10DigitsToHexNibbles # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:EwramFree:agbcc","sym":"EwramFree","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","pointer","loop","branch"],"loc":26,"refSource":"void EwramFree(void *p)\n{\n struct EwramNode *node, *slow, *fast, *tmp;\n\n if (p && ewram_end != p) {\n node = p - offsetof(struct EwramNode, space);\n\n for (fast = slow = (struct EwramNode *)gEwramHeap; node != fast; fast = fast->next)\n slow = fast;\n\n if (node->state < 0)\n node->state = -node->state;\n\n if ((void *)slow + slow->state == node && slow->state > 0) {\n slow->next = fast->next;\n slow->state += node->state;\n node = slow;\n }\n\n tmp = (void *)node + node->state;\n if (tmp == node->next && tmp->state > 0) {\n node->state += tmp->state;\n node->next = tmp->next;\n }\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L63-L97","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramFree\n\t.type\t EwramFree,function\n\t.thumb_func\nEwramFree:\n\tpush\t{r4, lr}\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L12\n\tldr\tr0, [r0]\n\tcmp\tr0, r1\n\tbeq\t.L3\t@cond_branch\n\tsub\tr1, r1, #0x8\n\tldr\tr3, .L12+0x4\n\tadd\tr4, r3, #0\n\tcmp\tr1, r3\n\tbeq\t.L5\t@cond_branch\n.L7:\n\tadd\tr3, r4, #0\n\tldr\tr4, [r3]\n\tcmp\tr1, r4\n\tbne\t.L7\t@cond_branch\n.L5:\n\tldr\tr0, [r1, #0x4]\n\tcmp\tr0, #0\n\tbge\t.L9\t@cond_branch\n\tneg\tr0, r0\n\tstr\tr0, [r1, #0x4]\n.L9:\n\tldr\tr2, [r3, #0x4]\n\tadd\tr0, r3, r2\n\tcmp\tr0, r1\n\tbne\t.L10\t@cond_branch\n\tcmp\tr2, #0\n\tble\t.L10\t@cond_branch\n\tldr\tr0, [r4]\n\tstr\tr0, [r3]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr0, r2, r0\n\tstr\tr0, [r3, #0x4]\n\tadd\tr1, r3, #0\n.L10:\n\tldr\tr3, [r1, #0x4]\n\tadd\tr2, r1, r3\n\tldr\tr0, [r1]\n\tcmp\tr2, r0\n\tbne\t.L3\t@cond_branch\n\tldr\tr0, [r2, #0x4]\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tadd\tr0, r3, r0\n\tstr\tr0, [r1, #0x4]\n\tldr\tr0, [r2]\n\tstr\tr0, [r1]\n.L3:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tewram_end\n\t.word\tgEwramHeap\n.Lfe1:\n\t.size\t EwramFree,.Lfe1-EwramFree\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz","proto":{"EwramFree":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'EwramFree' — structure: cannot structure 'EwramFree': loop condition or a post-loop value reads a pre-update loop variable */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tEwramFree */\n/* \t.type\t EwramFree,function */\n/* \t.thumb_func */\n/* EwramFree: */\n/* \tpush\t{r4, lr} */\n/* \tadd\tr1, r0, #0 */\n/* \tcmp\tr1, #0 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tldr\tr0, .L12 */\n/* \tldr\tr0, [r0] */\n/* \tcmp\tr0, r1 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tsub\tr1, r1, #0x8 */\n/* \tldr\tr3, .L12+0x4 */\n/* \tadd\tr4, r3, #0 */\n/* \tcmp\tr1, r3 */\n/* \tbeq\t.L5\t@cond_branch */\n/* .L7: */\n/* \tadd\tr3, r4, #0 */\n/* \tldr\tr4, [r3] */\n/* \tcmp\tr1, r4 */\n/* \tbne\t.L7\t@cond_branch */\n/* .L5: */\n/* \tldr\tr0, [r1, #0x4] */\n/* \tcmp\tr0, #0 */\n/* \tbge\t.L9\t@cond_branch */\n/* \tneg\tr0, r0 */\n/* \tstr\tr0, [r1, #0x4] */\n/* .L9: */\n/* \tldr\tr2, [r3, #0x4] */\n/* \tadd\tr0, r3, r2 */\n/* \tcmp\tr0, r1 */\n/* \tbne\t.L10\t@cond_branch */\n/* \tcmp\tr2, #0 */\n/* \tble\t.L10\t@cond_branch */\n/* \tldr\tr0, [r4] */\n/* \tstr\tr0, [r3] */\n/* \tldr\tr0, [r1, #0x4] */\n/* \tadd\tr0, r2, r0 */\n/* \tstr\tr0, [r3, #0x4] */\n/* \tadd\tr1, r3, #0 */\n/* .L10: */\n/* \tldr\tr3, [r1, #0x4] */\n/* \tadd\tr2, r1, r3 */\n/* \tldr\tr0, [r1] */\n/* \tcmp\tr2, r0 */\n/* \tbne\t.L3\t@cond_branch */\n/* \tldr\tr0, [r2, #0x4] */\n/* \tcmp\tr0, #0 */\n/* \tble\t.L3\t@cond_branch */\n/* \tadd\tr0, r3, r0 */\n/* \tstr\tr0, [r1, #0x4] */\n/* \tldr\tr0, [r2] */\n/* \tstr\tr0, [r1] */\n/* .L3: */\n/* \tpop\t{r4} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L13: */\n/* \t.align\t2, 0 */\n/* .L12: */\n/* \t.word\tewram_end */\n/* \t.word\tgEwramHeap */\n/* .Lfe1: */\n/* \t.size\t EwramFree,.Lfe1-EwramFree */\n/* .text */\n/* \t.align\t2, 0 */\nvoid EwramFree(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'EwramFree': loop condition or a post-loop value reads a pre-update loop variable\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":77,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'EwramFree': loop condition or a post-loop value reads a pre-update loop variable"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void EwramFree(void *p) {\n s32 temp_r0;\n s32 temp_r0_2;\n s32 temp_r2;\n s32 temp_r3;\n u8 *temp_r2_2;\n u8 *var_r1;\n u8 *var_r3;\n u8 *var_r4;\n\n if ((p != NULL) && (ewram_end != p)) {\n var_r1 = p - 8;\n var_r3 = gEwramHeap;\n var_r4 = gEwramHeap;\n if (var_r1 != gEwramHeap) {\n do {\n var_r3 = var_r4;\n var_r4 = *var_r3;\n } while (var_r1 != var_r4);\n }\n temp_r0 = var_r1->unk4;\n if (temp_r0 < 0) {\n var_r1->unk4 = (s32) (0 - temp_r0);\n }\n temp_r2 = var_r3->unk4;\n if ((&var_r3[temp_r2] == var_r1) && (temp_r2 > 0)) {\n var_r3->unk0 = (s32) *var_r4;\n var_r3->unk4 = (s32) (temp_r2 + var_r1->unk4);\n var_r1 = var_r3;\n }\n temp_r3 = var_r1->unk4;\n temp_r2_2 = &var_r1[temp_r3];\n if (temp_r2_2 == var_r1->unk0) {\n temp_r0_2 = temp_r2_2->unk4;\n if (temp_r0_2 > 0) {\n var_r1->unk4 = (s32) (temp_r3 + temp_r0_2);\n var_r1->unk0 = (s32) temp_r2_2->unk0;\n }\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":94,"lines":40,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:323: warning: assignment makes pointer from integer without a cast","/c.c:326: request for member `unk4' in something not a structure or union","/c.c:328: request for member `unk4' in something not a structure or union","/c.c:330: request for member `unk4' in something not a structure or union","/c.c:332: request for member `unk0' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `EwramFree` — benchmark function sa3:EwramFree:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramFree\n\t.type\t EwramFree,function\n\t.thumb_func\nEwramFree:\n\tpush\t{r4, lr}\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L12\n\tldr\tr0, [r0]\n\tcmp\tr0, r1\n\tbeq\t.L3\t@cond_branch\n\tsub\tr1, r1, #0x8\n\tldr\tr3, .L12+0x4\n\tadd\tr4, r3, #0\n\tcmp\tr1, r3\n\tbeq\t.L5\t@cond_branch\n.L7:\n\tadd\tr3, r4, #0\n\tldr\tr4, [r3]\n\tcmp\tr1, r4\n\tbne\t.L7\t@cond_branch\n.L5:\n\tldr\tr0, [r1, #0x4]\n\tcmp\tr0, #0\n\tbge\t.L9\t@cond_branch\n\tneg\tr0, r0\n\tstr\tr0, [r1, #0x4]\n.L9:\n\tldr\tr2, [r3, #0x4]\n\tadd\tr0, r3, r2\n\tcmp\tr0, r1\n\tbne\t.L10\t@cond_branch\n\tcmp\tr2, #0\n\tble\t.L10\t@cond_branch\n\tldr\tr0, [r4]\n\tstr\tr0, [r3]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr0, r2, r0\n\tstr\tr0, [r3, #0x4]\n\tadd\tr1, r3, #0\n.L10:\n\tldr\tr3, [r1, #0x4]\n\tadd\tr2, r1, r3\n\tldr\tr0, [r1]\n\tcmp\tr2, r0\n\tbne\t.L3\t@cond_branch\n\tldr\tr0, [r2, #0x4]\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tadd\tr0, r3, r0\n\tstr\tr0, [r1, #0x4]\n\tldr\tr0, [r2]\n\tstr\tr0, [r1]\n.L3:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tewram_end\n\t.word\tgEwramHeap\n.Lfe1:\n\t.size\t EwramFree,.Lfe1-EwramFree\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid EwramFree(void *p);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function EwramFree # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `EwramFree` — benchmark function sa3:EwramFree:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:EwramFree:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramFree\n\t.type\t EwramFree,function\n\t.thumb_func\nEwramFree:\n\tpush\t{r4, lr}\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L12\n\tldr\tr0, [r0]\n\tcmp\tr0, r1\n\tbeq\t.L3\t@cond_branch\n\tsub\tr1, r1, #0x8\n\tldr\tr3, .L12+0x4\n\tadd\tr4, r3, #0\n\tcmp\tr1, r3\n\tbeq\t.L5\t@cond_branch\n.L7:\n\tadd\tr3, r4, #0\n\tldr\tr4, [r3]\n\tcmp\tr1, r4\n\tbne\t.L7\t@cond_branch\n.L5:\n\tldr\tr0, [r1, #0x4]\n\tcmp\tr0, #0\n\tbge\t.L9\t@cond_branch\n\tneg\tr0, r0\n\tstr\tr0, [r1, #0x4]\n.L9:\n\tldr\tr2, [r3, #0x4]\n\tadd\tr0, r3, r2\n\tcmp\tr0, r1\n\tbne\t.L10\t@cond_branch\n\tcmp\tr2, #0\n\tble\t.L10\t@cond_branch\n\tldr\tr0, [r4]\n\tstr\tr0, [r3]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr0, r2, r0\n\tstr\tr0, [r3, #0x4]\n\tadd\tr1, r3, #0\n.L10:\n\tldr\tr3, [r1, #0x4]\n\tadd\tr2, r1, r3\n\tldr\tr0, [r1]\n\tcmp\tr2, r0\n\tbne\t.L3\t@cond_branch\n\tldr\tr0, [r2, #0x4]\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tadd\tr0, r3, r0\n\tstr\tr0, [r1, #0x4]\n\tldr\tr0, [r2]\n\tstr\tr0, [r1]\n.L3:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tewram_end\n\t.word\tgEwramHeap\n.Lfe1:\n\t.size\t EwramFree,.Lfe1-EwramFree\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"EwramFree\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EwramFree # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:EwramInitHeap:agbcc","sym":"EwramInitHeap","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","global","pointer"],"loc":6,"refSource":"void EwramInitHeap(void)\n{\n struct EwramNode *root = (struct EwramNode *)&gEwramHeap[0];\n root->next = NULL;\n root->state = sizeof(gEwramHeap);\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L7-L12","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramInitHeap\n\t.type\t EwramInitHeap,function\n\t.thumb_func\nEwramInitHeap:\n\tldr\tr0, .L3\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tldr\tr1, .L3+0x4\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgEwramHeap\n\t.word\t0x20080\n.Lfe1:\n\t.size\t EwramInitHeap,.Lfe1-EwramInitHeap\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz","proto":{"EwramInitHeap":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gEwramHeap","shape":"u8[]"}],"outcome":"match","source":"void EwramInitHeap(void) {\n s32 * p0;\n p0 = (s32 *)&gEwramHeap;\n *p0 = 0;\n p0[1] = 131200;\n return;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void EwramInitHeap(void) {\n gEwramHeap->unk0 = 0;\n gEwramHeap->unk4 = 0x20080;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:307: request for member `unk0' in something not a structure or union","/c.c:308: request for member `unk4' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `EwramInitHeap` — benchmark function sa3:EwramInitHeap:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramInitHeap\n\t.type\t EwramInitHeap,function\n\t.thumb_func\nEwramInitHeap:\n\tldr\tr0, .L3\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tldr\tr1, .L3+0x4\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgEwramHeap\n\t.word\t0x20080\n.Lfe1:\n\t.size\t EwramInitHeap,.Lfe1-EwramInitHeap\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid EwramInitHeap(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function EwramInitHeap # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `EwramInitHeap` — benchmark function sa3:EwramInitHeap:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:EwramInitHeap:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramInitHeap\n\t.type\t EwramInitHeap,function\n\t.thumb_func\nEwramInitHeap:\n\tldr\tr0, .L3\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tldr\tr1, .L3+0x4\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgEwramHeap\n\t.word\t0x20080\n.Lfe1:\n\t.size\t EwramInitHeap,.Lfe1-EwramInitHeap\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"EwramInitHeap\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EwramInitHeap # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:EwramMalloc:agbcc","sym":"EwramMalloc","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","struct","field","pointer","branch"],"loc":37,"refSource":"void *EwramMalloc(u32 req)\n{\n struct EwramNode *node;\n s32 requestedSpace = req;\n\n requestedSpace = (req + 3) / 4;\n if (requestedSpace != 0) {\n requestedSpace = requestedSpace * 4 + sizeof(struct EwramNode);\n node = (struct EwramNode *)gEwramHeap;\n while (1) {\n if (requestedSpace <= (u32)node->state) {\n if (requestedSpace == node->state) {\n node->state = -requestedSpace;\n return node->space;\n }\n\n if (requestedSpace + (s32)sizeof(struct EwramNode) <= node->state) {\n struct EwramNode *addr = (void *)node + requestedSpace;\n\n addr->next = node->next;\n ++node;\n --node;\n addr->state = node->state - requestedSpace;\n node->next = addr;\n node->state = -requestedSpace;\n return node->space;\n }\n }\n ++requestedSpace;\n --requestedSpace;\n if (!node->next)\n return ewram_end;\n node = node->next;\n }\n }\n return ewram_end;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L14-L61","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramMalloc\n\t.type\t EwramMalloc,function\n\t.thumb_func\nEwramMalloc:\n\tadd\tr2, r0, #0\n\tadd\tr0, r2, #0x3\n\tlsr\tr2, r0, #0x2\n\tcmp\tr2, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r2, #0x2\n\tadd\tr2, r0, #0\n\tadd\tr2, r2, #0x8\n\tldr\tr3, .L14\n.L6:\n\tldr\tr1, [r3, #0x4]\n\tcmp\tr2, r1\n\tbhi\t.L7\t@cond_branch\n\tcmp\tr2, r1\n\tbne\t.L8\t@cond_branch\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgEwramHeap\n.L8:\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tcmp\tr0, r1\n\tbgt\t.L7\t@cond_branch\n\tadd\tr1, r3, r2\n\tldr\tr0, [r3]\n\tstr\tr0, [r1]\n\tldr\tr0, [r3, #0x4]\n\tsub\tr0, r0, r2\n\tstr\tr0, [r1, #0x4]\n\tstr\tr1, [r3]\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L7:\n\tldr\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr3, r0, #0\n\tb\t.L6\n.L3:\n\tldr\tr0, .L16\n\tldr\tr0, [r0]\n.L13:\n\tbx\tlr\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tewram_end\n.Lfe1:\n\t.size\t EwramMalloc,.Lfe1-EwramMalloc\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'EwramMalloc' — structure: cannot structure 'EwramMalloc': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tEwramMalloc */\n/* \t.type\t EwramMalloc,function */\n/* \t.thumb_func */\n/* EwramMalloc: */\n/* \tadd\tr2, r0, #0 */\n/* \tadd\tr0, r2, #0x3 */\n/* \tlsr\tr2, r0, #0x2 */\n/* \tcmp\tr2, #0 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tlsl\tr0, r2, #0x2 */\n/* \tadd\tr2, r0, #0 */\n/* \tadd\tr2, r2, #0x8 */\n/* \tldr\tr3, .L14 */\n/* .L6: */\n/* \tldr\tr1, [r3, #0x4] */\n/* \tcmp\tr2, r1 */\n/* \tbhi\t.L7\t@cond_branch */\n/* \tcmp\tr2, r1 */\n/* \tbne\t.L8\t@cond_branch */\n/* \tneg\tr0, r2 */\n/* \tstr\tr0, [r3, #0x4] */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x8 */\n/* \tb\t.L13 */\n/* .L15: */\n/* \t.align\t2, 0 */\n/* .L14: */\n/* \t.word\tgEwramHeap */\n/* .L8: */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x8 */\n/* \tcmp\tr0, r1 */\n/* \tbgt\t.L7\t@cond_branch */\n/* \tadd\tr1, r3, r2 */\n/* \tldr\tr0, [r3] */\n/* \tstr\tr0, [r1] */\n/* \tldr\tr0, [r3, #0x4] */\n/* \tsub\tr0, r0, r2 */\n/* \tstr\tr0, [r1, #0x4] */\n/* \tstr\tr1, [r3] */\n/* \tneg\tr0, r2 */\n/* \tstr\tr0, [r3, #0x4] */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x8 */\n/* \tb\t.L13 */\n/* .L7: */\n/* \tldr\tr0, [r3] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tadd\tr3, r0, #0 */\n/* \tb\t.L6 */\n/* .L3: */\n/* \tldr\tr0, .L16 */\n/* \tldr\tr0, [r0] */\n/* .L13: */\n/* \tbx\tlr */\n/* .L17: */\n/* \t.align\t2, 0 */\n/* .L16: */\n/* \t.word\tewram_end */\n/* .Lfe1: */\n/* \t.size\t EwramMalloc,.Lfe1-EwramMalloc */\n/* .text */\n/* \t.align\t2, 0 */\nvoid EwramMalloc(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'EwramMalloc': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":74,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'EwramMalloc': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *EwramMalloc(u32 req) {\n u32 temp_r1;\n u32 temp_r2;\n u32 temp_r2_2;\n u8 *temp_r0;\n u8 *temp_r1_2;\n u8 *var_r3;\n\n temp_r2 = (u32) (req + 3) >> 2;\n if (temp_r2 != 0) {\n temp_r2_2 = (temp_r2 * 4) + 8;\n var_r3 = gEwramHeap;\nloop_2:\n temp_r1 = var_r3->unk4;\n if (temp_r2_2 <= temp_r1) {\n if (temp_r2_2 == temp_r1) {\n var_r3->unk4 = (u32) (0 - temp_r2_2);\n return &var_r3[8];\n }\n if ((s32) (temp_r2_2 + 8) <= (s32) temp_r1) {\n temp_r1_2 = var_r3 + temp_r2_2;\n temp_r1_2->unk0 = (u8 *) var_r3->unk0;\n temp_r1_2->unk4 = (s32) (var_r3->unk4 - temp_r2_2);\n var_r3->unk0 = temp_r1_2;\n var_r3->unk4 = (u32) (0 - temp_r2_2);\n return &var_r3[8];\n }\n goto block_7;\n }\nblock_7:\n temp_r0 = var_r3->unk0;\n if (temp_r0 != NULL) {\n var_r3 = temp_r0;\n goto loop_2;\n }\n goto block_9;\n }\nblock_9:\n return ewram_end;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":54,"lines":39,"gotos":3,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:319: request for member `unk4' in something not a structure or union","/c.c:322: request for member `unk4' in something not a structure or union","/c.c:327: request for member `unk0' in something not a structure or union","/c.c:328: request for member `unk4' in something not a structure or union","/c.c:329: request for member `unk0' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `EwramMalloc` — benchmark function sa3:EwramMalloc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramMalloc\n\t.type\t EwramMalloc,function\n\t.thumb_func\nEwramMalloc:\n\tadd\tr2, r0, #0\n\tadd\tr0, r2, #0x3\n\tlsr\tr2, r0, #0x2\n\tcmp\tr2, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r2, #0x2\n\tadd\tr2, r0, #0\n\tadd\tr2, r2, #0x8\n\tldr\tr3, .L14\n.L6:\n\tldr\tr1, [r3, #0x4]\n\tcmp\tr2, r1\n\tbhi\t.L7\t@cond_branch\n\tcmp\tr2, r1\n\tbne\t.L8\t@cond_branch\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgEwramHeap\n.L8:\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tcmp\tr0, r1\n\tbgt\t.L7\t@cond_branch\n\tadd\tr1, r3, r2\n\tldr\tr0, [r3]\n\tstr\tr0, [r1]\n\tldr\tr0, [r3, #0x4]\n\tsub\tr0, r0, r2\n\tstr\tr0, [r1, #0x4]\n\tstr\tr1, [r3]\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L7:\n\tldr\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr3, r0, #0\n\tb\t.L6\n.L3:\n\tldr\tr0, .L16\n\tldr\tr0, [r0]\n.L13:\n\tbx\tlr\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tewram_end\n.Lfe1:\n\t.size\t EwramMalloc,.Lfe1-EwramMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *EwramMalloc(u32 req);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function EwramMalloc # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `EwramMalloc` — benchmark function sa3:EwramMalloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:EwramMalloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramMalloc\n\t.type\t EwramMalloc,function\n\t.thumb_func\nEwramMalloc:\n\tadd\tr2, r0, #0\n\tadd\tr0, r2, #0x3\n\tlsr\tr2, r0, #0x2\n\tcmp\tr2, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r2, #0x2\n\tadd\tr2, r0, #0\n\tadd\tr2, r2, #0x8\n\tldr\tr3, .L14\n.L6:\n\tldr\tr1, [r3, #0x4]\n\tcmp\tr2, r1\n\tbhi\t.L7\t@cond_branch\n\tcmp\tr2, r1\n\tbne\t.L8\t@cond_branch\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgEwramHeap\n.L8:\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tcmp\tr0, r1\n\tbgt\t.L7\t@cond_branch\n\tadd\tr1, r3, r2\n\tldr\tr0, [r3]\n\tstr\tr0, [r1]\n\tldr\tr0, [r3, #0x4]\n\tsub\tr0, r0, r2\n\tstr\tr0, [r1, #0x4]\n\tstr\tr1, [r3]\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L7:\n\tldr\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr3, r0, #0\n\tb\t.L6\n.L3:\n\tldr\tr0, .L16\n\tldr\tr0, [r0]\n.L13:\n\tbx\tlr\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tewram_end\n.Lfe1:\n\t.size\t EwramMalloc,.Lfe1-EwramMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EwramMalloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:GetInput:agbcc","sym":"GetInput","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","bitwise","array","branch","global","shift"],"loc":50,"refSource":"void GetInput(void)\n{\n s8 i;\n u8 *repeatKeyCounters = gRepeatedKeysTestCounter, *firstIntervals = gKeysFirstRepeatIntervals,\n *continuedHoldIntervals = gKeysContinuedRepeatIntervals;\n\n gInput = (~REG_KEYINPUT & KEYS_MASK);\n\n // My guess is that whilst the input recorder\n // is running we still want to know the actual\n // input. For example; to be able to know when\n // to exit the demo\n gPhysicalInput = gInput;\n\n#ifndef COLLECT_RINGS_ROM\n if (gInputRecorder.mode == RECORDER_RECORD) {\n InputRecorderWrite(gInput);\n } else if (gInputRecorder.mode == RECORDER_PLAYBACK) {\n gInput = InputRecorderRead();\n }\n#endif\n\n gPressedKeys = (gInput ^ gPrevInput) & gInput;\n gReleasedKeys = (gInput ^ gPrevInput) & gPrevInput;\n gPrevInput = gInput;\n\n // Repeated keys will be the currently pressed keys\n gRepeatedKeys = gPressedKeys;\n\n // Calculate the next repeated state for every key\n for (i = 0; i < 10; i++) {\n if (!GetBit(gInput, i)) {\n // If a key is not pressed, reset its counter\n // to the settings for that key's\n // first repeat interval\n repeatKeyCounters[i] = firstIntervals[i];\n } else if (repeatKeyCounters[i] > 0) {\n // If the key is not yet ready to be repeated\n // continue to wait\n repeatKeyCounters[i]--;\n } else {\n // If the key is ready to be repeated,\n // add the key to the repeated keys\n gRepeatedKeys |= 1 << i;\n // And reset its counter to the settings\n // for continued hold interval\n repeatKeyCounters[i] = continuedHoldIntervals[i];\n }\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/core.c#L971-L1020","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetInput\n\t.type\t GetInput,function\n\t.thumb_func\nGetInput:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tldr\tr7, .L16\n\tldr\tr0, .L16+0x4\n\tmov\tr9, r0\n\tldr\tr1, .L16+0x8\n\tmov\tr8, r1\n\tldr\tr4, .L16+0xc\n\tldr\tr0, .L16+0x10\n\tldrh\tr1, [r0]\n\tldr\tr2, .L16+0x14\n\tadd\tr0, r2, #0\n\tbic\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tldr\tr1, .L16+0x18\n\tstrh\tr0, [r1]\n\tldr\tr0, .L16+0x1c\n\tldrb\tr0, [r0, #0x8]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldrh\tr0, [r4]\n\tbl\tInputRecorderWrite\n\tb\t.L4\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgRepeatedKeysTestCounter\n\t.word\tgKeysFirstRepeatIntervals\n\t.word\tgKeysContinuedRepeatIntervals\n\t.word\tgInput\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgPhysicalInput\n\t.word\tgInputRecorder\n.L3:\n\tcmp\tr0, #0x2\n\tbne\t.L4\t@cond_branch\n\tbl\tInputRecorderRead\n\tstrh\tr0, [r4]\n.L4:\n\tldr\tr2, .L18\n\tldr\tr6, .L18+0x4\n\tldr\tr5, .L18+0x8\n\tldrh\tr3, [r6]\n\tldrh\tr4, [r5]\n\tadd\tr0, r3, #0\n\teor\tr0, r0, r4\n\tadd\tr1, r0, #0\n\tand\tr1, r1, r3\n\tstrh\tr1, [r2]\n\tldr\tr2, .L18+0xc\n\tand\tr0, r0, r4\n\tstrh\tr0, [r2]\n\tstrh\tr3, [r5]\n\tldr\tr0, .L18+0x10\n\tstrh\tr1, [r0]\n\tmov\tr1, #0x0\n\tmov\tip, r6\n\tmov\tr6, #0x1\n\tadd\tr5, r0, #0\n.L9:\n\tmov\tr3, ip\n\tldrh\tr0, [r3]\n\tlsl\tr1, r1, #0x18\n\tasr\tr2, r1, #0x18\n\tasr\tr0, r0, r2\n\tand\tr0, r0, r6\n\tadd\tr4, r1, #0\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tadd\tr0, r7, r2\n\tmov\tr3, r9\n\tadd\tr1, r3, r2\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r0]\n\tb\t.L8\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgPressedKeys\n\t.word\tgInput\n\t.word\tgPrevInput\n\t.word\tgReleasedKeys\n\t.word\tgRepeatedKeys\n.L10:\n\tadd\tr3, r7, r2\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tb\t.L15\n.L12:\n\tadd\tr0, r6, #0\n\tlsl\tr0, r0, r2\n\tldrh\tr1, [r5]\n\torr\tr0, r0, r1\n\tstrh\tr0, [r5]\n\tmov\tr1, r8\n\tadd\tr0, r1, r2\n\tldrb\tr0, [r0]\n.L15:\n\tstrb\tr0, [r3]\n.L8:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x11\n\tadd\tr0, r4, r2\n\tlsr\tr1, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tcmp\tr0, #0x9\n\tble\t.L9\t@cond_branch\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t GetInput,.Lfe1-GetInput\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-9580348e8bae.i.gz","proto":{"GetInput":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'GetInput' — structure: cannot structure 'GetInput': do-while condition or a post-loop value reads a pre-update loop variable */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tGetInput */\n/* \t.type\t GetInput,function */\n/* \t.thumb_func */\n/* GetInput: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, r9 */\n/* \tmov\tr6, r8 */\n/* \tpush\t{r6, r7} */\n/* \tldr\tr7, .L16 */\n/* \tldr\tr0, .L16+0x4 */\n/* \tmov\tr9, r0 */\n/* \tldr\tr1, .L16+0x8 */\n/* \tmov\tr8, r1 */\n/* \tldr\tr4, .L16+0xc */\n/* \tldr\tr0, .L16+0x10 */\n/* \tldrh\tr1, [r0] */\n/* \tldr\tr2, .L16+0x14 */\n/* \tadd\tr0, r2, #0 */\n/* \tbic\tr0, r0, r1 */\n/* \tstrh\tr0, [r4] */\n/* \tldr\tr1, .L16+0x18 */\n/* \tstrh\tr0, [r1] */\n/* \tldr\tr0, .L16+0x1c */\n/* \tldrb\tr0, [r0, #0x8] */\n/* \tcmp\tr0, #0x1 */\n/* \tbne\t.L3\t@cond_branch */\n/* \tldrh\tr0, [r4] */\n/* \tbl\tInputRecorderWrite */\n/* \tb\t.L4 */\n/* .L17: */\n/* \t.align\t2, 0 */\n/* .L16: */\n/* \t.word\tgRepeatedKeysTestCounter */\n/* \t.word\tgKeysFirstRepeatIntervals */\n/* \t.word\tgKeysContinuedRepeatIntervals */\n/* \t.word\tgInput */\n/* \t.word\t0x4000130 */\n/* \t.word\t0x3ff */\n/* \t.word\tgPhysicalInput */\n/* \t.word\tgInputRecorder */\n/* .L3: */\n/* \tcmp\tr0, #0x2 */\n/* \tbne\t.L4\t@cond_branch */\n/* \tbl\tInputRecorderRead */\n/* \tstrh\tr0, [r4] */\n/* .L4: */\n/* \tldr\tr2, .L18 */\n/* \tldr\tr6, .L18+0x4 */\n/* \tldr\tr5, .L18+0x8 */\n/* \tldrh\tr3, [r6] */\n/* \tldrh\tr4, [r5] */\n/* \tadd\tr0, r3, #0 */\n/* \teor\tr0, r0, r4 */\n/* \tadd\tr1, r0, #0 */\n/* \tand\tr1, r1, r3 */\n/* \tstrh\tr1, [r2] */\n/* \tldr\tr2, .L18+0xc */\n/* \tand\tr0, r0, r4 */\n/* \tstrh\tr0, [r2] */\n/* \tstrh\tr3, [r5] */\n/* \tldr\tr0, .L18+0x10 */\n/* \tstrh\tr1, [r0] */\n/* \tmov\tr1, #0x0 */\n/* \tmov\tip, r6 */\n/* \tmov\tr6, #0x1 */\n/* \tadd\tr5, r0, #0 */\n/* .L9: */\n/* \tmov\tr3, ip */\n/* \tldrh\tr0, [r3] */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tasr\tr2, r1, #0x18 */\n/* \tasr\tr0, r0, r2 */\n/* \tand\tr0, r0, r6 */\n/* \tadd\tr4, r1, #0 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L10\t@cond_branch */\n/* \tadd\tr0, r7, r2 */\n/* \tmov\tr3, r9 */\n/* \tadd\tr1, r3, r2 */\n/* \tldrb\tr1, [r1] */\n/* \tstrb\tr1, [r0] */\n/* \tb\t.L8 */\n/* .L19: */\n/* \t.align\t2, 0 */\n/* .L18: */\n/* \t.word\tgPressedKeys */\n/* \t.word\tgInput */\n/* \t.word\tgPrevInput */\n/* \t.word\tgReleasedKeys */\n/* \t.word\tgRepeatedKeys */\n/* .L10: */\n/* \tadd\tr3, r7, r2 */\n/* \tldrb\tr0, [r3] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L12\t@cond_branch */\n/* \tsub\tr0, r0, #0x1 */\n/* \tb\t.L15 */\n/* .L12: */\n/* \tadd\tr0, r6, #0 */\n/* \tlsl\tr0, r0, r2 */\n/* \tldrh\tr1, [r5] */\n/* \torr\tr0, r0, r1 */\n/* \tstrh\tr0, [r5] */\n/* \tmov\tr1, r8 */\n/* \tadd\tr0, r1, r2 */\n/* \tldrb\tr0, [r0] */\n/* .L15: */\n/* \tstrb\tr0, [r3] */\n/* .L8: */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x11 */\n/* \tadd\tr0, r4, r2 */\n/* \tlsr\tr1, r0, #0x18 */\n/* \tasr\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0x9 */\n/* \tble\t.L9\t@cond_branch */\n/* \tpop\t{r3, r4} */\n/* \tmov\tr8, r3 */\n/* \tmov\tr9, r4 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .Lfe1: */\n/* \t.size\t GetInput,.Lfe1-GetInput */\n/* .text */\n/* \t.align\t2, 0 */\nvoid GetInput(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'GetInput': do-while condition or a post-loop value reads a pre-update loop variable\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":136,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'GetInput': do-while condition or a post-loop value reads a pre-update loop variable"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void GetInput(void) {\n s32 temp_r0_2;\n s32 temp_r4;\n s8 temp_r2;\n s8 var_r1;\n u16 temp_r0;\n u16 temp_r1;\n u32 temp_r0_3;\n u8 *temp_r3;\n u8 temp_r0_4;\n u8 var_r0;\n\n temp_r0 = 0x3FF & ~*(u16 *)0x04000130;\n gInput = temp_r0;\n gPhysicalInput = temp_r0;\n if (gInputRecorder.mode == 1) {\n InputRecorderWrite(gInput);\n } else if (gInputRecorder.mode == 2) {\n gInput = InputRecorderRead();\n }\n temp_r0_2 = gInput ^ gPrevInput;\n temp_r1 = temp_r0_2 & gInput;\n gPressedKeys = temp_r1;\n gReleasedKeys = temp_r0_2 & gPrevInput;\n gPrevInput = gInput;\n gRepeatedKeys = temp_r1;\n var_r1 = 0;\n do {\n temp_r2 = var_r1;\n temp_r4 = var_r1 << 0x18;\n if (!(((s32) gInput >> temp_r2) & 1)) {\n gRepeatedKeysTestCounter[temp_r2] = gKeysFirstRepeatIntervals[temp_r2];\n } else {\n temp_r3 = &gRepeatedKeysTestCounter[temp_r2];\n temp_r0_4 = *temp_r3;\n if (temp_r0_4 != 0) {\n var_r0 = temp_r0_4 - 1;\n } else {\n gRepeatedKeys |= 1 << temp_r2;\n var_r0 = gKeysContinuedRepeatIntervals[temp_r2];\n }\n *temp_r3 = var_r0;\n }\n temp_r0_3 = temp_r4 + 0x01000000;\n var_r1 = (s8) (temp_r0_3 >> 0x18);\n } while ((s32) ((s32) temp_r0_3 >> 0x18) <= 9);\n}\n","score":70,"maxScore":117,"compileErrors":null,"breakdown":{"insert":12,"delete":18,"replace":2,"opMismatch":1,"argMismatch":37},"quality":{"score":92,"lines":46,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":1}},"gapSize":{"decompiler":"m2c","score":70,"maxScore":117,"ratio":0.5982905982905983,"kinds":{"insert":12,"delete":18,"replace":2,"opMismatch":1,"argMismatch":37}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GetInput` — benchmark function sa3:GetInput:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetInput\n\t.type\t GetInput,function\n\t.thumb_func\nGetInput:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tldr\tr7, .L16\n\tldr\tr0, .L16+0x4\n\tmov\tr9, r0\n\tldr\tr1, .L16+0x8\n\tmov\tr8, r1\n\tldr\tr4, .L16+0xc\n\tldr\tr0, .L16+0x10\n\tldrh\tr1, [r0]\n\tldr\tr2, .L16+0x14\n\tadd\tr0, r2, #0\n\tbic\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tldr\tr1, .L16+0x18\n\tstrh\tr0, [r1]\n\tldr\tr0, .L16+0x1c\n\tldrb\tr0, [r0, #0x8]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldrh\tr0, [r4]\n\tbl\tInputRecorderWrite\n\tb\t.L4\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgRepeatedKeysTestCounter\n\t.word\tgKeysFirstRepeatIntervals\n\t.word\tgKeysContinuedRepeatIntervals\n\t.word\tgInput\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgPhysicalInput\n\t.word\tgInputRecorder\n.L3:\n\tcmp\tr0, #0x2\n\tbne\t.L4\t@cond_branch\n\tbl\tInputRecorderRead\n\tstrh\tr0, [r4]\n.L4:\n\tldr\tr2, .L18\n\tldr\tr6, .L18+0x4\n\tldr\tr5, .L18+0x8\n\tldrh\tr3, [r6]\n\tldrh\tr4, [r5]\n\tadd\tr0, r3, #0\n\teor\tr0, r0, r4\n\tadd\tr1, r0, #0\n\tand\tr1, r1, r3\n\tstrh\tr1, [r2]\n\tldr\tr2, .L18+0xc\n\tand\tr0, r0, r4\n\tstrh\tr0, [r2]\n\tstrh\tr3, [r5]\n\tldr\tr0, .L18+0x10\n\tstrh\tr1, [r0]\n\tmov\tr1, #0x0\n\tmov\tip, r6\n\tmov\tr6, #0x1\n\tadd\tr5, r0, #0\n.L9:\n\tmov\tr3, ip\n\tldrh\tr0, [r3]\n\tlsl\tr1, r1, #0x18\n\tasr\tr2, r1, #0x18\n\tasr\tr0, r0, r2\n\tand\tr0, r0, r6\n\tadd\tr4, r1, #0\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tadd\tr0, r7, r2\n\tmov\tr3, r9\n\tadd\tr1, r3, r2\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r0]\n\tb\t.L8\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgPressedKeys\n\t.word\tgInput\n\t.word\tgPrevInput\n\t.word\tgReleasedKeys\n\t.word\tgRepeatedKeys\n.L10:\n\tadd\tr3, r7, r2\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tb\t.L15\n.L12:\n\tadd\tr0, r6, #0\n\tlsl\tr0, r0, r2\n\tldrh\tr1, [r5]\n\torr\tr0, r0, r1\n\tstrh\tr0, [r5]\n\tmov\tr1, r8\n\tadd\tr0, r1, r2\n\tldrb\tr0, [r0]\n.L15:\n\tstrb\tr0, [r3]\n.L8:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x11\n\tadd\tr0, r4, r2\n\tlsr\tr1, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tcmp\tr0, #0x9\n\tble\t.L9\t@cond_branch\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t GetInput,.Lfe1-GetInput\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-9580348e8bae.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid GetInput(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GetInput # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GetInput` — benchmark function sa3:GetInput:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:GetInput:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetInput\n\t.type\t GetInput,function\n\t.thumb_func\nGetInput:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tldr\tr7, .L16\n\tldr\tr0, .L16+0x4\n\tmov\tr9, r0\n\tldr\tr1, .L16+0x8\n\tmov\tr8, r1\n\tldr\tr4, .L16+0xc\n\tldr\tr0, .L16+0x10\n\tldrh\tr1, [r0]\n\tldr\tr2, .L16+0x14\n\tadd\tr0, r2, #0\n\tbic\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tldr\tr1, .L16+0x18\n\tstrh\tr0, [r1]\n\tldr\tr0, .L16+0x1c\n\tldrb\tr0, [r0, #0x8]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldrh\tr0, [r4]\n\tbl\tInputRecorderWrite\n\tb\t.L4\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgRepeatedKeysTestCounter\n\t.word\tgKeysFirstRepeatIntervals\n\t.word\tgKeysContinuedRepeatIntervals\n\t.word\tgInput\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgPhysicalInput\n\t.word\tgInputRecorder\n.L3:\n\tcmp\tr0, #0x2\n\tbne\t.L4\t@cond_branch\n\tbl\tInputRecorderRead\n\tstrh\tr0, [r4]\n.L4:\n\tldr\tr2, .L18\n\tldr\tr6, .L18+0x4\n\tldr\tr5, .L18+0x8\n\tldrh\tr3, [r6]\n\tldrh\tr4, [r5]\n\tadd\tr0, r3, #0\n\teor\tr0, r0, r4\n\tadd\tr1, r0, #0\n\tand\tr1, r1, r3\n\tstrh\tr1, [r2]\n\tldr\tr2, .L18+0xc\n\tand\tr0, r0, r4\n\tstrh\tr0, [r2]\n\tstrh\tr3, [r5]\n\tldr\tr0, .L18+0x10\n\tstrh\tr1, [r0]\n\tmov\tr1, #0x0\n\tmov\tip, r6\n\tmov\tr6, #0x1\n\tadd\tr5, r0, #0\n.L9:\n\tmov\tr3, ip\n\tldrh\tr0, [r3]\n\tlsl\tr1, r1, #0x18\n\tasr\tr2, r1, #0x18\n\tasr\tr0, r0, r2\n\tand\tr0, r0, r6\n\tadd\tr4, r1, #0\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tadd\tr0, r7, r2\n\tmov\tr3, r9\n\tadd\tr1, r3, r2\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r0]\n\tb\t.L8\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgPressedKeys\n\t.word\tgInput\n\t.word\tgPrevInput\n\t.word\tgReleasedKeys\n\t.word\tgRepeatedKeys\n.L10:\n\tadd\tr3, r7, r2\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tb\t.L15\n.L12:\n\tadd\tr0, r6, #0\n\tlsl\tr0, r0, r2\n\tldrh\tr1, [r5]\n\torr\tr0, r0, r1\n\tstrh\tr0, [r5]\n\tmov\tr1, r8\n\tadd\tr0, r1, r2\n\tldrb\tr0, [r0]\n.L15:\n\tstrb\tr0, [r3]\n.L8:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x11\n\tadd\tr0, r4, r2\n\tlsr\tr1, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tcmp\tr0, #0x9\n\tble\t.L9\t@cond_branch\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t GetInput,.Lfe1-GetInput\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GetInput\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetInput # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:GetSaveSectorChecksum:agbcc","sym":"GetSaveSectorChecksum","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","cast","sizeof","struct"],"loc":15,"refSource":"u32 GetSaveSectorChecksum(SaveSectorData *sector)\n{\n u8 *ptr = (u8 *)sector;\n\n u32 checkSum = 0;\n u32 i = 0;\n\n u32 size = (sizeof(SaveSectorData) - sizeof(sector->checksum));\n\n for (; i < size; i += sizeof(u32)) {\n checkSum += *((u32 *)(ptr + i));\n }\n\n return checkSum;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/code_0_0.c#L1036-L1050","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetSaveSectorChecksum\n\t.type\t GetSaveSectorChecksum,function\n\t.thumb_func\nGetSaveSectorChecksum:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr4, #0xda\n\tlsl\tr4, r4, #0x2\n.L6:\n\tadd\tr0, r3, r1\n\tldr\tr0, [r0]\n\tadd\tr2, r2, r0\n\tadd\tr1, r1, #0x4\n\tcmp\tr1, r4\n\tbcc\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GetSaveSectorChecksum,.Lfe1-GetSaveSectorChecksum\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 GetSaveSectorChecksum(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n v2 = 0;\n v1 = 0;\n do {\n v0 = *(s32 *)(a0 + v1);\n v2 = v2 + v0;\n v1 = v1 + 4;\n } while (v1 < 218 << 2);\n return v2;\n}\n","score":5,"maxScore":18,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":1,"opMismatch":1,"argMismatch":0},"quality":{"score":96,"lines":13,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 GetSaveSectorChecksum(s32 arg0) {\n s32 var_r2;\n u32 var_r1;\n\n var_r2 = 0;\n var_r1 = 0;\n do {\n var_r2 += *(arg0 + var_r1);\n var_r1 += 4;\n } while (var_r1 < 0x368U);\n return var_r2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:964: invalid type argument of `unary *'"]},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":18,"ratio":0.2777777777777778,"kinds":{"insert":2,"delete":1,"replace":1,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GetSaveSectorChecksum` — benchmark function sa3:GetSaveSectorChecksum:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetSaveSectorChecksum\n\t.type\t GetSaveSectorChecksum,function\n\t.thumb_func\nGetSaveSectorChecksum:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr4, #0xda\n\tlsl\tr4, r4, #0x2\n.L6:\n\tadd\tr0, r3, r1\n\tldr\tr0, [r0]\n\tadd\tr2, r2, r0\n\tadd\tr1, r1, #0x4\n\tcmp\tr1, r4\n\tbcc\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GetSaveSectorChecksum,.Lfe1-GetSaveSectorChecksum\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GetSaveSectorChecksum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GetSaveSectorChecksum` — benchmark function sa3:GetSaveSectorChecksum:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:GetSaveSectorChecksum:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetSaveSectorChecksum\n\t.type\t GetSaveSectorChecksum,function\n\t.thumb_func\nGetSaveSectorChecksum:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr4, #0xda\n\tlsl\tr4, r4, #0x2\n.L6:\n\tadd\tr0, r3, r1\n\tldr\tr0, [r0]\n\tadd\tr2, r2, r0\n\tadd\tr1, r1, #0x4\n\tcmp\tr1, r4\n\tbcc\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GetSaveSectorChecksum,.Lfe1-GetSaveSectorChecksum\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetSaveSectorChecksum # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:numToASCII:agbcc","sym":"numToASCII","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","array","bitwise","branch","shift"],"loc":15,"refSource":"void numToASCII(u8 digits[5], u16 number)\n{\n u8 i;\n\n for (i = 0; i < 4; number <<= 4, i++) {\n u16 value = ((number & 0xF000) >> 12);\n if (value > 9) {\n digits[i] = value + 87;\n } else {\n digits[i] = value + '0';\n }\n }\n\n digits[i] = 0;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L127-L141","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnumToASCII\n\t.type\t numToASCII,function\n\t.thumb_func\nnumToASCII:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tmov\tr2, #0x0\n\tmov\tr5, #0xf0\n\tlsl\tr5, r5, #0x8\n.L6:\n\tadd\tr0, r3, #0\n\tand\tr0, r0, r5\n\tlsr\tr0, r0, #0xc\n\tcmp\tr0, #0x9\n\tbls\t.L7\t@cond_branch\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x57\n\tb\t.L10\n.L7:\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x30\n.L10:\n\tstrb\tr0, [r1]\n\tlsl\tr0, r3, #0x14\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr1, r4, r2\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t numToASCII,.Lfe1-numToASCII\n\n.text\n\t.align\t2, 0\n","proto":{"numToASCII":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void numToASCII(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n u8 * v2;\n s32 v3;\n v0 = (u16)a1;\n v1 = 0;\n do {\n if ((v0 & 240 << 8) >> 12 <= 9) {\n v2 = (u8 *)(a0 + v1);\n v3 = ((v0 & 240 << 8) >> 12) + 48;\n } else {\n v2 = (u8 *)(a0 + v1);\n v3 = ((v0 & 240 << 8) >> 12) + 87;\n }\n *v2 = v3;\n v0 = v0 << 20 >> 16;\n v1 = (u8)(v1 + 1);\n } while (v1 <= 3);\n *(u8 *)(a0 + v1) = 0;\n return;\n}\n","score":14,"maxScore":31,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":2,"opMismatch":2,"argMismatch":10},"quality":{"score":90,"lines":22,"gotos":0,"casts":5,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void numToASCII(s32 arg0, u16 arg1) {\n s8 *var_r1;\n s8 var_r0;\n u16 var_r3;\n u32 temp_r0;\n u8 var_r2;\n\n var_r3 = arg1;\n var_r2 = 0;\n do {\n temp_r0 = (u32) (var_r3 & 0xF000) >> 0xC;\n if (temp_r0 > 9U) {\n var_r1 = arg0 + var_r2;\n var_r0 = temp_r0 + 0x57;\n } else {\n var_r1 = arg0 + var_r2;\n var_r0 = temp_r0 + 0x30;\n }\n *var_r1 = var_r0;\n var_r3 *= 0x10;\n var_r2 += 1;\n } while ((u32) var_r2 <= 3U);\n *(arg0 + var_r2) = 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":23,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:319: warning: assignment makes pointer from integer without a cast","/c.c:322: warning: assignment makes pointer from integer without a cast","/c.c:329: invalid type argument of `unary *'"]},"gapSize":{"decompiler":"asmlift","score":14,"maxScore":31,"ratio":0.45161290322580644,"kinds":{"insert":0,"delete":0,"replace":2,"opMismatch":2,"argMismatch":10}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `numToASCII` — benchmark function sa3:numToASCII:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnumToASCII\n\t.type\t numToASCII,function\n\t.thumb_func\nnumToASCII:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tmov\tr2, #0x0\n\tmov\tr5, #0xf0\n\tlsl\tr5, r5, #0x8\n.L6:\n\tadd\tr0, r3, #0\n\tand\tr0, r0, r5\n\tlsr\tr0, r0, #0xc\n\tcmp\tr0, #0x9\n\tbls\t.L7\t@cond_branch\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x57\n\tb\t.L10\n.L7:\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x30\n.L10:\n\tstrb\tr0, [r1]\n\tlsl\tr0, r3, #0x14\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr1, r4, r2\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t numToASCII,.Lfe1-numToASCII\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function numToASCII # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `numToASCII` — benchmark function sa3:numToASCII:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:numToASCII:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnumToASCII\n\t.type\t numToASCII,function\n\t.thumb_func\nnumToASCII:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tmov\tr2, #0x0\n\tmov\tr5, #0xf0\n\tlsl\tr5, r5, #0x8\n.L6:\n\tadd\tr0, r3, #0\n\tand\tr0, r0, r5\n\tlsr\tr0, r0, #0xc\n\tcmp\tr0, #0x9\n\tbls\t.L7\t@cond_branch\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x57\n\tb\t.L10\n.L7:\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x30\n.L10:\n\tstrb\tr0, [r1]\n\tlsl\tr0, r3, #0x14\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr1, r4, r2\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t numToASCII,.Lfe1-numToASCII\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"numToASCII\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name numToASCII # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:OamMalloc:agbcc","sym":"OamMalloc","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["branch","global","array","struct","field"],"loc":27,"refSource":"OamData *OamMalloc(u8 order)\n{\n OamData *result;\n\n if (order > 31) {\n order = 31;\n }\n\n if (gOamFreeIndex > OAM_ENTRY_COUNT - 1) {\n result = (OamData *)iwram_end;\n } else {\n if (gOamMallocOrders_StartIndex[order] == 0xFF) {\n gOamMallocBuffer[gOamFreeIndex].split.fractional = 0xFF;\n gOamMallocOrders_StartIndex[order] = gOamFreeIndex;\n gOamMallocOrders_EndIndex[order] = gOamFreeIndex;\n } else {\n gOamMallocBuffer[gOamFreeIndex].split.fractional = 0xFF;\n gOamMallocBuffer[gOamMallocOrders_EndIndex[order]].split.fractional = gOamFreeIndex;\n gOamMallocOrders_EndIndex[order] = gOamFreeIndex;\n }\n\n gOamFreeIndex++;\n result = &gOamMallocBuffer[gOamFreeIndex - 1];\n }\n\n return result;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L931-L957","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tOamMalloc\n\t.type\t OamMalloc,function\n\t.thumb_func\nOamMalloc:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1f\n\tbls\t.L3\t@cond_branch\n\tmov\tr5, #0x1f\n.L3:\n\tldr\tr0, .L8\n\tmov\tr1, #0x0\n\tldrsb\tr1, [r0, r1]\n\tadd\tr4, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L4\t@cond_branch\n\tldr\tr0, .L8+0x4\n\tldr\tr0, [r0]\n\tb\t.L5\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgOamFreeIndex\n\t.word\tiwram_end\n.L4:\n\tldr\tr0, .L10\n\tadd\tr2, r5, r0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tldr\tr1, .L10+0x4\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L10+0x8\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0]\n\tb\t.L7\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n.L6:\n\tldr\tr3, .L12\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldr\tr2, .L12+0x4\n\tadd\tr2, r5, r2\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n.L7:\n\tldrb\tr0, [r4]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4]\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tldr\tr1, .L12+0x8\n\tadd\tr0, r0, r1\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n\t.word\tgOamMallocBuffer+-0x8\n.Lfe1:\n\t.size\t OamMalloc,.Lfe1-OamMalloc\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-9580348e8bae.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'OamMalloc' — lift: cannot lift 'OamMalloc': literal-pool load of pool word 'gOamMallocBuffer+-0x8' is a symbol offset or code label — not modelled */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tOamMalloc */\n/* \t.type\t OamMalloc,function */\n/* \t.thumb_func */\n/* OamMalloc: */\n/* \tpush\t{r4, r5, lr} */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tcmp\tr5, #0x1f */\n/* \tbls\t.L3\t@cond_branch */\n/* \tmov\tr5, #0x1f */\n/* .L3: */\n/* \tldr\tr0, .L8 */\n/* \tmov\tr1, #0x0 */\n/* \tldrsb\tr1, [r0, r1] */\n/* \tadd\tr4, r0, #0 */\n/* \tcmp\tr1, #0 */\n/* \tbge\t.L4\t@cond_branch */\n/* \tldr\tr0, .L8+0x4 */\n/* \tldr\tr0, [r0] */\n/* \tb\t.L5 */\n/* .L9: */\n/* \t.align\t2, 0 */\n/* .L8: */\n/* \t.word\tgOamFreeIndex */\n/* \t.word\tiwram_end */\n/* .L4: */\n/* \tldr\tr0, .L10 */\n/* \tadd\tr2, r5, r0 */\n/* \tldrb\tr0, [r2] */\n/* \tcmp\tr0, #0xff */\n/* \tbne\t.L6\t@cond_branch */\n/* \tldr\tr1, .L10+0x4 */\n/* \tldrb\tr0, [r4] */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tadd\tr0, r0, r1 */\n/* \tmov\tr1, #0xff */\n/* \tstrb\tr1, [r0, #0x6] */\n/* \tldrb\tr0, [r4] */\n/* \tstrb\tr0, [r2] */\n/* \tldr\tr0, .L10+0x8 */\n/* \tadd\tr0, r5, r0 */\n/* \tldrb\tr1, [r4] */\n/* \tstrb\tr1, [r0] */\n/* \tb\t.L7 */\n/* .L11: */\n/* \t.align\t2, 0 */\n/* .L10: */\n/* \t.word\tgOamMallocOrders_StartIndex */\n/* \t.word\tgOamMallocBuffer */\n/* \t.word\tgOamMallocOrders_EndIndex */\n/* .L6: */\n/* \tldr\tr3, .L12 */\n/* \tldrb\tr0, [r4] */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tadd\tr0, r0, r3 */\n/* \tmov\tr1, #0xff */\n/* \tstrb\tr1, [r0, #0x6] */\n/* \tldr\tr2, .L12+0x4 */\n/* \tadd\tr2, r5, r2 */\n/* \tldrb\tr0, [r2] */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tadd\tr0, r0, r3 */\n/* \tldrb\tr1, [r4] */\n/* \tstrb\tr1, [r0, #0x6] */\n/* \tldrb\tr0, [r4] */\n/* \tstrb\tr0, [r2] */\n/* .L7: */\n/* \tldrb\tr0, [r4] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tstrb\tr0, [r4] */\n/* \tldrb\tr0, [r4] */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tldr\tr1, .L12+0x8 */\n/* \tadd\tr0, r0, r1 */\n/* .L5: */\n/* \tpop\t{r4, r5} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .L13: */\n/* \t.align\t2, 0 */\n/* .L12: */\n/* \t.word\tgOamMallocBuffer */\n/* \t.word\tgOamMallocOrders_EndIndex */\n/* \t.word\tgOamMallocBuffer+-0x8 */\n/* .Lfe1: */\n/* \t.size\t OamMalloc,.Lfe1-OamMalloc */\n/* .text */\n/* \t.align\t2, 0 */\nvoid OamMalloc(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'OamMalloc': literal-pool load of pool word 'gOamMallocBuffer+-0x8' is a symbol offset or code label — not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":98,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'OamMalloc': literal-pool load of pool word 'gOamMallocBuffer+-0x8' is a symbol offset or code label — not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"OamData *OamMalloc(u8 order) {\n u8 *temp_r2;\n u8 *temp_r2_2;\n u8 var_r5;\n\n var_r5 = order;\n if ((u32) var_r5 > 0x1FU) {\n var_r5 = 0x1F;\n }\n if ((s32) (s8) gOamFreeIndex < 0) {\n return (OamData *) iwram_end;\n }\n temp_r2 = &gOamMallocOrders_StartIndex[var_r5];\n if (*temp_r2 == 0xFF) {\n gOamMallocBuffer[gOamFreeIndex].unk6 = 0xFF;\n *temp_r2 = gOamFreeIndex;\n gOamMallocOrders_EndIndex[var_r5] = gOamFreeIndex;\n } else {\n gOamMallocBuffer[gOamFreeIndex].unk6 = 0xFF;\n temp_r2_2 = &gOamMallocOrders_EndIndex[var_r5];\n gOamMallocBuffer[*temp_r2_2].unk6 = (u8) gOamFreeIndex;\n *temp_r2_2 = gOamFreeIndex;\n }\n gOamFreeIndex += 1;\n return &(gOamMallocBuffer - 8)[gOamFreeIndex];\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":96,"lines":25,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:931: union has no member named `unk6'","/c.c:935: union has no member named `unk6'","/c.c:937: union has no member named `unk6'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `OamMalloc` — benchmark function sa3:OamMalloc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tOamMalloc\n\t.type\t OamMalloc,function\n\t.thumb_func\nOamMalloc:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1f\n\tbls\t.L3\t@cond_branch\n\tmov\tr5, #0x1f\n.L3:\n\tldr\tr0, .L8\n\tmov\tr1, #0x0\n\tldrsb\tr1, [r0, r1]\n\tadd\tr4, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L4\t@cond_branch\n\tldr\tr0, .L8+0x4\n\tldr\tr0, [r0]\n\tb\t.L5\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgOamFreeIndex\n\t.word\tiwram_end\n.L4:\n\tldr\tr0, .L10\n\tadd\tr2, r5, r0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tldr\tr1, .L10+0x4\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L10+0x8\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0]\n\tb\t.L7\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n.L6:\n\tldr\tr3, .L12\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldr\tr2, .L12+0x4\n\tadd\tr2, r5, r2\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n.L7:\n\tldrb\tr0, [r4]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4]\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tldr\tr1, .L12+0x8\n\tadd\tr0, r0, r1\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n\t.word\tgOamMallocBuffer+-0x8\n.Lfe1:\n\t.size\t OamMalloc,.Lfe1-OamMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-9580348e8bae.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nOamData *OamMalloc(u8 order);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function OamMalloc # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `OamMalloc` — benchmark function sa3:OamMalloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:OamMalloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tOamMalloc\n\t.type\t OamMalloc,function\n\t.thumb_func\nOamMalloc:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1f\n\tbls\t.L3\t@cond_branch\n\tmov\tr5, #0x1f\n.L3:\n\tldr\tr0, .L8\n\tmov\tr1, #0x0\n\tldrsb\tr1, [r0, r1]\n\tadd\tr4, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L4\t@cond_branch\n\tldr\tr0, .L8+0x4\n\tldr\tr0, [r0]\n\tb\t.L5\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgOamFreeIndex\n\t.word\tiwram_end\n.L4:\n\tldr\tr0, .L10\n\tadd\tr2, r5, r0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tldr\tr1, .L10+0x4\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L10+0x8\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0]\n\tb\t.L7\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n.L6:\n\tldr\tr3, .L12\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldr\tr2, .L12+0x4\n\tadd\tr2, r5, r2\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n.L7:\n\tldrb\tr0, [r4]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4]\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tldr\tr1, .L12+0x8\n\tadd\tr0, r0, r1\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n\t.word\tgOamMallocBuffer+-0x8\n.Lfe1:\n\t.size\t OamMalloc,.Lfe1-OamMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name OamMalloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:ProcessOamBuffers:agbcc","sym":"ProcessOamBuffers","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","struct","loop","dma","call"],"loc":71,"refSource":"void ProcessOamBuffers(void)\n{\n OamData *dstOam = &gOamBuffer[0];\n u8 i = 0;\n s32 r3;\n\n for (r3 = 0; r3 < 32; r3++) {\n s8 index = gOamMallocOrders_StartIndex[r3];\n\n while (index != -1) {\n u8 newI;\n u8 *byteArray = gOamMallocCopiedOrder;\n DmaCopy16(3, &gOamMallocBuffer[index], dstOam, sizeof(OamDataShort));\n dstOam++;\n\n byteArray += index;\n newI = i++;\n *byteArray = newI;\n index = gOamMallocBuffer[index].split.fractional;\n };\n }\n\n if (gFlags & FLAGS_800) {\n r3 = gOamFreeIndex;\n dstOam = &gOamBuffer[r3];\n\n while (r3 < gOamFirstPausedIndex) {\n DmaFill16(3, 0x200, dstOam, sizeof(OamDataShort));\n dstOam++;\n r3++;\n }\n } else if (gFlags & FLAGS_PAUSE_GAME) {\n /* Push all active OAM entries to te end of OAM temporarily while\n * the game is paused */\n s32 k, l;\n r3 = gOamFreeIndex - 1;\n dstOam = &gOamBuffer[r3];\n\n for (k = l = 0; r3 >= 0;) {\n s32 size = sizeof(OamDataShort);\n DmaCopy16(3, dstOam - k, &gOamBuffer[OAM_ENTRY_COUNT - 1 - l], size);\n k++, r3--, l++;\n }\n\n // _08005A5E\n\n gOamFirstPausedIndex = OAM_ENTRY_COUNT - gOamFreeIndex;\n\n for (r3 = 0; r3 < gOamFirstPausedIndex; r3++) {\n DmaFill16(3, 0x200, &gOamBuffer[r3], sizeof(OamDataShort));\n#ifndef NON_MATCHING\n // unlike when using --, using ++ changes the condition to something entirely\n // different unless we tell the compiler that we want to use r3's values\n // (without actually doing so)\n asm(\"\" ::\"r\"(r3));\n#endif\n }\n\n } else {\n gOamFirstPausedIndex = 0;\n }\n\n gOamFreeIndex = 0;\n if (gFlags & FLAGS_4000) {\n CpuFill32(-1, gOamMallocOrders_StartIndex, sizeof(gOamMallocOrders_StartIndex));\n CpuFill32(-1, gOamMallocOrders_EndIndex, sizeof(gOamMallocOrders_EndIndex));\n } else {\n DmaFill32(3, -1, gOamMallocOrders_StartIndex, sizeof(gOamMallocOrders_StartIndex));\n DmaFill32(3, -1, gOamMallocOrders_EndIndex, sizeof(gOamMallocOrders_EndIndex));\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L959-L1029","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessOamBuffers\n\t.type\t ProcessOamBuffers,function\n\t.thumb_func\nProcessOamBuffers:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x10\n\tldr\tr5, .L32\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tmov\tr3, #0x0\n\tldr\tr1, .L32+0x4\n\tmov\tsl, r1\n\tmov\tr2, sp\n\tadd\tr2, r2, #0x8\n\tstr\tr2, [sp, #0xc]\n.L6:\n\tldr\tr1, .L32+0x8\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tadd\tr6, r3, #0x1\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbeq\t.L5\t@cond_branch\n\tldr\tr4, .L32+0xc\n\tmov\tr8, r1\n\tldr\tr0, .L32+0x10\n\tmov\tip, r0\n\tldr\tr7, .L32+0x14\n.L9:\n\tasr\tr2, r2, #0x18\n\tlsl\tr3, r2, #0x3\n\tadd\tr3, r3, r7\n\tstr\tr3, [r4]\n\tstr\tr5, [r4, #0x4]\n\tldr\tr0, .L32+0x18\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr2, r2, ip\n\tmov\tr1, r9\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tstrb\tr1, [r2]\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tcmp\tr0, r8\n\tbne\t.L9\t@cond_branch\n.L5:\n\tadd\tr3, r6, #0\n\tcmp\tr3, #0x1f\n\tble\t.L6\t@cond_branch\n\tldr\tr2, .L32+0x1c\n\tldr\tr1, [r2]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L32+0x20\n\tldrb\tr3, [r0]\n\tlsl\tr0, r3, #0x3\n\tldr\tr1, .L32\n\tadd\tr5, r0, r1\n\tmov\tr2, sl\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr4, sp\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tadd\tr7, r1, #0\n\tldr\tr1, .L32+0xc\n\tldr\tr6, .L32+0x24\n.L15:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr5, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr3, r3, #0x1\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tblt\t.L15\t@cond_branch\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgOamBuffer\n\t.word\tgOamFirstPausedIndex\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t0x40000d4\n\t.word\tgOamMallocCopiedOrder\n\t.word\tgOamMallocBuffer\n\t.word\t-0x7ffffffd\n\t.word\tgFlags\n\t.word\tgOamFreeIndex\n\t.word\t-0x7efffffd\n.L12:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr1, .L34\n\tldrb\tr0, [r1]\n\tsub\tr3, r0, #0x1\n\tlsl\tr0, r3, #0x3\n\tldr\tr2, .L34+0x4\n\tadd\tr5, r0, r2\n\tcmp\tr3, #0\n\tblt\t.L20\t@cond_branch\n\tldr\tr2, .L34+0x8\n\tldr\tr6, .L34+0xc\n\tldr\tr0, .L34+0x4\n\tmov\tr1, #0xfe\n\tlsl\tr1, r1, #0x2\n\tadd\tr4, r0, r1\n\tadd\tr1, r5, #0\n.L22:\n\tstr\tr1, [r2]\n\tstr\tr4, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr1, r1, #0x8\n\tsub\tr3, r3, #0x1\n\tsub\tr4, r4, #0x8\n\tcmp\tr3, #0\n\tbge\t.L22\t@cond_branch\n.L20:\n\tldr\tr2, .L34\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x80\n\tsub\tr0, r0, r1\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n\tmov\tr3, #0x0\n\tldrb\tr0, [r1]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr5, sp\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr7, r2, #0\n\tldr\tr1, .L34+0x8\n\tadd\tr4, r0, #0\n\tldr\tr6, .L34+0x10\n\tldr\tr2, .L34+0x4\n.L27:\n\tstrh\tr7, [r5]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr2, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\t.code\t16\n\tadd\tr2, r2, #0x8\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r4\n\tblt\t.L27\t@cond_branch\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgOamFreeIndex\n\t.word\tgOamBuffer\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffd\n\t.word\t-0x7efffffd\n.L18:\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n.L17:\n\tmov\tr0, #0x0\n\tldr\tr2, .L36\n\tstrb\tr0, [r2]\n\tldr\tr1, .L36+0x4\n\tldr\tr0, [r1]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x7\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L30\t@cond_branch\n\tmov\tr4, #0x1\n\tneg\tr4, r4\n\tstr\tr4, [sp, #0x4]\n\tadd\tr0, sp, #0x4\n\tldr\tr5, .L36+0x8\n\tldr\tr1, .L36+0xc\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tstr\tr4, [sp, #0x8]\n\tldr\tr1, .L36+0x10\n\tldr\tr0, [sp, #0xc]\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tb\t.L31\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgOamFreeIndex\n\t.word\tgFlags\n\t.word\t0x5000008\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocOrders_EndIndex\n.L30:\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tstr\tr1, [sp, #0x8]\n\tldr\tr0, .L38\n\tldr\tr2, [sp, #0xc]\n\tstr\tr2, [r0]\n\tldr\tr2, .L38+0x4\n\tstr\tr2, [r0, #0x4]\n\tldr\tr2, .L38+0x8\n\tstr\tr2, [r0, #0x8]\n\tldr\tr3, [r0, #0x8]\n\tstr\tr1, [sp, #0x8]\n\tldr\tr1, [sp, #0xc]\n\tstr\tr1, [r0]\n\tldr\tr1, .L38+0xc\n\tstr\tr1, [r0, #0x4]\n\tstr\tr2, [r0, #0x8]\n\tldr\tr0, [r0, #0x8]\n.L31:\n\tadd\tsp, sp, #0x10\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0x40000d4\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t-0x7afffff8\n\t.word\tgOamMallocOrders_EndIndex\n.Lfe1:\n\t.size\t ProcessOamBuffers,.Lfe1-ProcessOamBuffers\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-0fac75cf4324.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'ProcessOamBuffers' — lift: cannot lift 'ProcessOamBuffers': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tProcessOamBuffers */\n/* \t.type\t ProcessOamBuffers,function */\n/* \t.thumb_func */\n/* ProcessOamBuffers: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, sl */\n/* \tmov\tr6, r9 */\n/* \tmov\tr5, r8 */\n/* \tpush\t{r5, r6, r7} */\n/* \tadd\tsp, sp, #-0x10 */\n/* \tldr\tr5, .L32 */\n/* \tmov\tr0, #0x0 */\n/* \tmov\tr9, r0 */\n/* \tmov\tr3, #0x0 */\n/* \tldr\tr1, .L32+0x4 */\n/* \tmov\tsl, r1 */\n/* \tmov\tr2, sp */\n/* \tadd\tr2, r2, #0x8 */\n/* \tstr\tr2, [sp, #0xc] */\n/* .L6: */\n/* \tldr\tr1, .L32+0x8 */\n/* \tadd\tr0, r3, r1 */\n/* \tldrb\tr0, [r0] */\n/* \tlsl\tr2, r0, #0x18 */\n/* \tasr\tr0, r2, #0x18 */\n/* \tadd\tr6, r3, #0x1 */\n/* \tmov\tr1, #0x1 */\n/* \tneg\tr1, r1 */\n/* \tcmp\tr0, r1 */\n/* \tbeq\t.L5\t@cond_branch */\n/* \tldr\tr4, .L32+0xc */\n/* \tmov\tr8, r1 */\n/* \tldr\tr0, .L32+0x10 */\n/* \tmov\tip, r0 */\n/* \tldr\tr7, .L32+0x14 */\n/* .L9: */\n/* \tasr\tr2, r2, #0x18 */\n/* \tlsl\tr3, r2, #0x3 */\n/* \tadd\tr3, r3, r7 */\n/* \tstr\tr3, [r4] */\n/* \tstr\tr5, [r4, #0x4] */\n/* \tldr\tr0, .L32+0x18 */\n/* \tstr\tr0, [r4, #0x8] */\n/* \tldr\tr0, [r4, #0x8] */\n/* \tadd\tr5, r5, #0x8 */\n/* \tadd\tr2, r2, ip */\n/* \tmov\tr1, r9 */\n/* \tadd\tr0, r1, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tmov\tr9, r0 */\n/* \tstrb\tr1, [r2] */\n/* \tldrb\tr0, [r3, #0x6] */\n/* \tlsl\tr2, r0, #0x18 */\n/* \tasr\tr0, r2, #0x18 */\n/* \tcmp\tr0, r8 */\n/* \tbne\t.L9\t@cond_branch */\n/* .L5: */\n/* \tadd\tr3, r6, #0 */\n/* \tcmp\tr3, #0x1f */\n/* \tble\t.L6\t@cond_branch */\n/* \tldr\tr2, .L32+0x1c */\n/* \tldr\tr1, [r2] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L12\t@cond_branch */\n/* \tldr\tr0, .L32+0x20 */\n/* \tldrb\tr3, [r0] */\n/* \tlsl\tr0, r3, #0x3 */\n/* \tldr\tr1, .L32 */\n/* \tadd\tr5, r0, r1 */\n/* \tmov\tr2, sl */\n/* \tldrb\tr0, [r2] */\n/* \tcmp\tr3, r0 */\n/* \tbge\t.L17\t@cond_branch */\n/* \tmov\tr4, sp */\n/* \tmov\tr1, #0x80 */\n/* \tlsl\tr1, r1, #0x2 */\n/* \tadd\tr7, r1, #0 */\n/* \tldr\tr1, .L32+0xc */\n/* \tldr\tr6, .L32+0x24 */\n/* .L15: */\n/* \tstrh\tr7, [r4] */\n/* \tmov\tr0, sp */\n/* \tstr\tr0, [r1] */\n/* \tstr\tr5, [r1, #0x4] */\n/* \tstr\tr6, [r1, #0x8] */\n/* \tldr\tr0, [r1, #0x8] */\n/* \tadd\tr5, r5, #0x8 */\n/* \tadd\tr3, r3, #0x1 */\n/* \tldrb\tr0, [r2] */\n/* \tcmp\tr3, r0 */\n/* \tblt\t.L15\t@cond_branch */\n/* \tb\t.L17 */\n/* .L33: */\n/* \t.align\t2, 0 */\n/* .L32: */\n/* \t.word\tgOamBuffer */\n/* \t.word\tgOamFirstPausedIndex */\n/* \t.word\tgOamMallocOrders_StartIndex */\n/* \t.word\t0x40000d4 */\n/* \t.word\tgOamMallocCopiedOrder */\n/* \t.word\tgOamMallocBuffer */\n/* \t.word\t-0x7ffffffd */\n/* \t.word\tgFlags */\n/* \t.word\tgOamFreeIndex */\n/* \t.word\t-0x7efffffd */\n/* .L12: */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L18\t@cond_branch */\n/* \tldr\tr1, .L34 */\n/* \tldrb\tr0, [r1] */\n/* \tsub\tr3, r0, #0x1 */\n/* \tlsl\tr0, r3, #0x3 */\n/* \tldr\tr2, .L34+0x4 */\n/* \tadd\tr5, r0, r2 */\n/* \tcmp\tr3, #0 */\n/* \tblt\t.L20\t@cond_branch */\n/* \tldr\tr2, .L34+0x8 */\n/* \tldr\tr6, .L34+0xc */\n/* \tldr\tr0, .L34+0x4 */\n/* \tmov\tr1, #0xfe */\n/* \tlsl\tr1, r1, #0x2 */\n/* \tadd\tr4, r0, r1 */\n/* \tadd\tr1, r5, #0 */\n/* .L22: */\n/* \tstr\tr1, [r2] */\n/* \tstr\tr4, [r2, #0x4] */\n/* \tstr\tr6, [r2, #0x8] */\n/* \tldr\tr0, [r2, #0x8] */\n/* \tsub\tr1, r1, #0x8 */\n/* \tsub\tr3, r3, #0x1 */\n/* \tsub\tr4, r4, #0x8 */\n/* \tcmp\tr3, #0 */\n/* \tbge\t.L22\t@cond_branch */\n/* .L20: */\n/* \tldr\tr2, .L34 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x80 */\n/* \tsub\tr0, r0, r1 */\n/* \tmov\tr1, sl */\n/* \tstrb\tr0, [r1] */\n/* \tmov\tr3, #0x0 */\n/* \tldrb\tr0, [r1] */\n/* \tcmp\tr3, r0 */\n/* \tbge\t.L17\t@cond_branch */\n/* \tmov\tr5, sp */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x2 */\n/* \tadd\tr7, r2, #0 */\n/* \tldr\tr1, .L34+0x8 */\n/* \tadd\tr4, r0, #0 */\n/* \tldr\tr6, .L34+0x10 */\n/* \tldr\tr2, .L34+0x4 */\n/* .L27: */\n/* \tstrh\tr7, [r5] */\n/* \tmov\tr0, sp */\n/* \tstr\tr0, [r1] */\n/* \tstr\tr2, [r1, #0x4] */\n/* \tstr\tr6, [r1, #0x8] */\n/* \tldr\tr0, [r1, #0x8] */\n/* \t.code\t16 */\n/* \tadd\tr2, r2, #0x8 */\n/* \tadd\tr3, r3, #0x1 */\n/* \tcmp\tr3, r4 */\n/* \tblt\t.L27\t@cond_branch */\n/* \tb\t.L17 */\n/* .L35: */\n/* \t.align\t2, 0 */\n/* .L34: */\n/* \t.word\tgOamFreeIndex */\n/* \t.word\tgOamBuffer */\n/* \t.word\t0x40000d4 */\n/* \t.word\t-0x7ffffffd */\n/* \t.word\t-0x7efffffd */\n/* .L18: */\n/* \tmov\tr1, sl */\n/* \tstrb\tr0, [r1] */\n/* .L17: */\n/* \tmov\tr0, #0x0 */\n/* \tldr\tr2, .L36 */\n/* \tstrb\tr0, [r2] */\n/* \tldr\tr1, .L36+0x4 */\n/* \tldr\tr0, [r1] */\n/* \tmov\tr1, #0x80 */\n/* \tlsl\tr1, r1, #0x7 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L30\t@cond_branch */\n/* \tmov\tr4, #0x1 */\n/* \tneg\tr4, r4 */\n/* \tstr\tr4, [sp, #0x4] */\n/* \tadd\tr0, sp, #0x4 */\n/* \tldr\tr5, .L36+0x8 */\n/* \tldr\tr1, .L36+0xc */\n/* \tadd\tr2, r5, #0 */\n/* \tbl\tCpuSet */\n/* \tstr\tr4, [sp, #0x8] */\n/* \tldr\tr1, .L36+0x10 */\n/* \tldr\tr0, [sp, #0xc] */\n/* \tadd\tr2, r5, #0 */\n/* \tbl\tCpuSet */\n/* \tb\t.L31 */\n/* .L37: */\n/* \t.align\t2, 0 */\n/* .L36: */\n/* \t.word\tgOamFreeIndex */\n/* \t.word\tgFlags */\n/* \t.word\t0x5000008 */\n/* \t.word\tgOamMallocOrders_StartIndex */\n/* \t.word\tgOamMallocOrders_EndIndex */\n/* .L30: */\n/* \tmov\tr1, #0x1 */\n/* \tneg\tr1, r1 */\n/* \tstr\tr1, [sp, #0x8] */\n/* \tldr\tr0, .L38 */\n/* \tldr\tr2, [sp, #0xc] */\n/* \tstr\tr2, [r0] */\n/* \tldr\tr2, .L38+0x4 */\n/* \tstr\tr2, [r0, #0x4] */\n/* \tldr\tr2, .L38+0x8 */\n/* \tstr\tr2, [r0, #0x8] */\n/* \tldr\tr3, [r0, #0x8] */\n/* \tstr\tr1, [sp, #0x8] */\n/* \tldr\tr1, [sp, #0xc] */\n/* \tstr\tr1, [r0] */\n/* \tldr\tr1, .L38+0xc */\n/* \tstr\tr1, [r0, #0x4] */\n/* \tstr\tr2, [r0, #0x8] */\n/* \tldr\tr0, [r0, #0x8] */\n/* .L31: */\n/* \tadd\tsp, sp, #0x10 */\n/* \tpop\t{r3, r4, r5} */\n/* \tmov\tr8, r3 */\n/* \tmov\tr9, r4 */\n/* \tmov\tsl, r5 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L39: */\n/* \t.align\t2, 0 */\n/* .L38: */\n/* \t.word\t0x40000d4 */\n/* \t.word\tgOamMallocOrders_StartIndex */\n/* \t.word\t-0x7afffff8 */\n/* \t.word\tgOamMallocOrders_EndIndex */\n/* .Lfe1: */\n/* \t.size\t ProcessOamBuffers,.Lfe1-ProcessOamBuffers */\n/* .text */\n/* \t.align\t2, 0 */\nvoid ProcessOamBuffers(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'ProcessOamBuffers': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":265,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'ProcessOamBuffers': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void ProcessOamBuffers(void) {\n OamData *temp_r3;\n OamData *var_r1;\n OamData *var_r2_2;\n OamData *var_r4;\n OamData *var_r5;\n OamData *var_r5_2;\n s32 temp_r2;\n s32 temp_r3_2;\n s32 var_r2;\n s32 var_r3;\n s32 var_r3_3;\n s32 var_r3_4;\n u8 temp_r0;\n u8 temp_r0_2;\n u8 temp_r0_3;\n u8 temp_r1;\n u8 var_r3_2;\n u8 var_r9;\n\n var_r5 = gOamBuffer;\n var_r9 = 0;\n var_r3 = 0;\n unkspC = &unksp0 + 8;\n do {\n temp_r0 = gOamMallocOrders_StartIndex[var_r3];\n var_r2 = temp_r0 << 0x18;\n if ((s8) temp_r0 != -1) {\n do {\n temp_r2 = var_r2 >> 0x18;\n temp_r3 = &gOamMallocBuffer[temp_r2];\n (void *)0x040000D4->unk0 = temp_r3;\n (void *)0x040000D4->unk4 = var_r5;\n (void *)0x040000D4->unk8 = 0x80000003;\n var_r5 += 8;\n temp_r1 = var_r9;\n var_r9 = temp_r1 + 1;\n gOamMallocCopiedOrder[temp_r2] = temp_r1;\n temp_r0_2 = temp_r3->unk6;\n var_r2 = temp_r0_2 << 0x18;\n } while ((s8) temp_r0_2 != -1);\n }\n var_r3 += 1;\n } while (var_r3 <= 0x1F);\n if (0x800 & gFlags) {\n var_r3_2 = gOamFreeIndex;\n var_r5_2 = &gOamBuffer[var_r3_2];\n if ((s32) var_r3_2 < (s32) gOamFirstPausedIndex) {\n do {\n unksp0 = 0x200;\n (void *)0x040000D4->unk0 = (OamData *) &unksp0;\n (void *)0x040000D4->unk4 = var_r5_2;\n (void *)0x040000D4->unk8 = 0x81000003;\n var_r5_2 += 8;\n var_r3_2 += 1;\n } while ((s32) var_r3_2 < (s32) gOamFirstPausedIndex);\n }\n } else {\n temp_r0_3 = 0x400 & gFlags;\n if (temp_r0_3 != 0) {\n var_r3_3 = gOamFreeIndex - 1;\n if (var_r3_3 >= 0) {\n var_r4 = &gOamBuffer[0x7F];\n var_r1 = &gOamBuffer[var_r3_3];\n do {\n (void *)0x040000D4->unk0 = var_r1;\n (void *)0x040000D4->unk4 = var_r4;\n (void *)0x040000D4->unk8 = 0x80000003;\n var_r1 -= 8;\n var_r3_3 -= 1;\n var_r4 -= 8;\n } while (var_r3_3 >= 0);\n }\n gOamFirstPausedIndex = 0x80 - gOamFreeIndex;\n var_r3_4 = 0;\n if ((s32) gOamFirstPausedIndex > 0) {\n var_r2_2 = gOamBuffer;\n do {\n unksp0 = 0x200;\n (void *)0x040000D4->unk0 = (OamData *) &unksp0;\n (void *)0x040000D4->unk4 = var_r2_2;\n (void *)0x040000D4->unk8 = 0x81000003;\n var_r2_2 += 8;\n var_r3_4 += 1;\n } while (var_r3_4 < (s32) gOamFirstPausedIndex);\n }\n } else {\n gOamFirstPausedIndex = temp_r0_3;\n }\n }\n gOamFreeIndex = 0;\n if (gFlags & 0x4000) {\n unksp4 = -1;\n CpuSet(&unksp4, gOamMallocOrders_StartIndex, 0x05000008U);\n unksp8 = -1;\n CpuSet(unkspC, gOamMallocOrders_EndIndex, 0x05000008U);\n return;\n }\n unksp8 = -1;\n (void *)0x040000D4->unk0 = unkspC;\n (void *)0x040000D4->unk4 = (OamData *) gOamMallocOrders_StartIndex;\n (void *)0x040000D4->unk8 = 0x85000008;\n temp_r3_2 = (void *)0x040000D4->unk8;\n unksp8 = -1;\n (void *)0x040000D4->unk0 = unkspC;\n (void *)0x040000D4->unk4 = (OamData *) gOamMallocOrders_EndIndex;\n (void *)0x040000D4->unk8 = 0x85000008;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":107,"gotos":0,"casts":28,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:941: `unkspC' undeclared (first use in this function)","/c.c:941: (Each undeclared identifier is reported only once","/c.c:941: for each function it appears in.)","/c.c:941: `unksp0' undeclared (first use in this function)","/c.c:949: invalid type argument of `->'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ProcessOamBuffers` — benchmark function sa3:ProcessOamBuffers:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessOamBuffers\n\t.type\t ProcessOamBuffers,function\n\t.thumb_func\nProcessOamBuffers:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x10\n\tldr\tr5, .L32\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tmov\tr3, #0x0\n\tldr\tr1, .L32+0x4\n\tmov\tsl, r1\n\tmov\tr2, sp\n\tadd\tr2, r2, #0x8\n\tstr\tr2, [sp, #0xc]\n.L6:\n\tldr\tr1, .L32+0x8\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tadd\tr6, r3, #0x1\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbeq\t.L5\t@cond_branch\n\tldr\tr4, .L32+0xc\n\tmov\tr8, r1\n\tldr\tr0, .L32+0x10\n\tmov\tip, r0\n\tldr\tr7, .L32+0x14\n.L9:\n\tasr\tr2, r2, #0x18\n\tlsl\tr3, r2, #0x3\n\tadd\tr3, r3, r7\n\tstr\tr3, [r4]\n\tstr\tr5, [r4, #0x4]\n\tldr\tr0, .L32+0x18\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr2, r2, ip\n\tmov\tr1, r9\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tstrb\tr1, [r2]\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tcmp\tr0, r8\n\tbne\t.L9\t@cond_branch\n.L5:\n\tadd\tr3, r6, #0\n\tcmp\tr3, #0x1f\n\tble\t.L6\t@cond_branch\n\tldr\tr2, .L32+0x1c\n\tldr\tr1, [r2]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L32+0x20\n\tldrb\tr3, [r0]\n\tlsl\tr0, r3, #0x3\n\tldr\tr1, .L32\n\tadd\tr5, r0, r1\n\tmov\tr2, sl\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr4, sp\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tadd\tr7, r1, #0\n\tldr\tr1, .L32+0xc\n\tldr\tr6, .L32+0x24\n.L15:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr5, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr3, r3, #0x1\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tblt\t.L15\t@cond_branch\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgOamBuffer\n\t.word\tgOamFirstPausedIndex\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t0x40000d4\n\t.word\tgOamMallocCopiedOrder\n\t.word\tgOamMallocBuffer\n\t.word\t-0x7ffffffd\n\t.word\tgFlags\n\t.word\tgOamFreeIndex\n\t.word\t-0x7efffffd\n.L12:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr1, .L34\n\tldrb\tr0, [r1]\n\tsub\tr3, r0, #0x1\n\tlsl\tr0, r3, #0x3\n\tldr\tr2, .L34+0x4\n\tadd\tr5, r0, r2\n\tcmp\tr3, #0\n\tblt\t.L20\t@cond_branch\n\tldr\tr2, .L34+0x8\n\tldr\tr6, .L34+0xc\n\tldr\tr0, .L34+0x4\n\tmov\tr1, #0xfe\n\tlsl\tr1, r1, #0x2\n\tadd\tr4, r0, r1\n\tadd\tr1, r5, #0\n.L22:\n\tstr\tr1, [r2]\n\tstr\tr4, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr1, r1, #0x8\n\tsub\tr3, r3, #0x1\n\tsub\tr4, r4, #0x8\n\tcmp\tr3, #0\n\tbge\t.L22\t@cond_branch\n.L20:\n\tldr\tr2, .L34\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x80\n\tsub\tr0, r0, r1\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n\tmov\tr3, #0x0\n\tldrb\tr0, [r1]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr5, sp\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr7, r2, #0\n\tldr\tr1, .L34+0x8\n\tadd\tr4, r0, #0\n\tldr\tr6, .L34+0x10\n\tldr\tr2, .L34+0x4\n.L27:\n\tstrh\tr7, [r5]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr2, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\t.code\t16\n\tadd\tr2, r2, #0x8\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r4\n\tblt\t.L27\t@cond_branch\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgOamFreeIndex\n\t.word\tgOamBuffer\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffd\n\t.word\t-0x7efffffd\n.L18:\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n.L17:\n\tmov\tr0, #0x0\n\tldr\tr2, .L36\n\tstrb\tr0, [r2]\n\tldr\tr1, .L36+0x4\n\tldr\tr0, [r1]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x7\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L30\t@cond_branch\n\tmov\tr4, #0x1\n\tneg\tr4, r4\n\tstr\tr4, [sp, #0x4]\n\tadd\tr0, sp, #0x4\n\tldr\tr5, .L36+0x8\n\tldr\tr1, .L36+0xc\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tstr\tr4, [sp, #0x8]\n\tldr\tr1, .L36+0x10\n\tldr\tr0, [sp, #0xc]\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tb\t.L31\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgOamFreeIndex\n\t.word\tgFlags\n\t.word\t0x5000008\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocOrders_EndIndex\n.L30:\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tstr\tr1, [sp, #0x8]\n\tldr\tr0, .L38\n\tldr\tr2, [sp, #0xc]\n\tstr\tr2, [r0]\n\tldr\tr2, .L38+0x4\n\tstr\tr2, [r0, #0x4]\n\tldr\tr2, .L38+0x8\n\tstr\tr2, [r0, #0x8]\n\tldr\tr3, [r0, #0x8]\n\tstr\tr1, [sp, #0x8]\n\tldr\tr1, [sp, #0xc]\n\tstr\tr1, [r0]\n\tldr\tr1, .L38+0xc\n\tstr\tr1, [r0, #0x4]\n\tstr\tr2, [r0, #0x8]\n\tldr\tr0, [r0, #0x8]\n.L31:\n\tadd\tsp, sp, #0x10\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0x40000d4\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t-0x7afffff8\n\t.word\tgOamMallocOrders_EndIndex\n.Lfe1:\n\t.size\t ProcessOamBuffers,.Lfe1-ProcessOamBuffers\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-0fac75cf4324.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid ProcessOamBuffers(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ProcessOamBuffers # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ProcessOamBuffers` — benchmark function sa3:ProcessOamBuffers:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:ProcessOamBuffers:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessOamBuffers\n\t.type\t ProcessOamBuffers,function\n\t.thumb_func\nProcessOamBuffers:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x10\n\tldr\tr5, .L32\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tmov\tr3, #0x0\n\tldr\tr1, .L32+0x4\n\tmov\tsl, r1\n\tmov\tr2, sp\n\tadd\tr2, r2, #0x8\n\tstr\tr2, [sp, #0xc]\n.L6:\n\tldr\tr1, .L32+0x8\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tadd\tr6, r3, #0x1\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbeq\t.L5\t@cond_branch\n\tldr\tr4, .L32+0xc\n\tmov\tr8, r1\n\tldr\tr0, .L32+0x10\n\tmov\tip, r0\n\tldr\tr7, .L32+0x14\n.L9:\n\tasr\tr2, r2, #0x18\n\tlsl\tr3, r2, #0x3\n\tadd\tr3, r3, r7\n\tstr\tr3, [r4]\n\tstr\tr5, [r4, #0x4]\n\tldr\tr0, .L32+0x18\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr2, r2, ip\n\tmov\tr1, r9\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tstrb\tr1, [r2]\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tcmp\tr0, r8\n\tbne\t.L9\t@cond_branch\n.L5:\n\tadd\tr3, r6, #0\n\tcmp\tr3, #0x1f\n\tble\t.L6\t@cond_branch\n\tldr\tr2, .L32+0x1c\n\tldr\tr1, [r2]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L32+0x20\n\tldrb\tr3, [r0]\n\tlsl\tr0, r3, #0x3\n\tldr\tr1, .L32\n\tadd\tr5, r0, r1\n\tmov\tr2, sl\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr4, sp\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tadd\tr7, r1, #0\n\tldr\tr1, .L32+0xc\n\tldr\tr6, .L32+0x24\n.L15:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr5, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr3, r3, #0x1\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tblt\t.L15\t@cond_branch\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgOamBuffer\n\t.word\tgOamFirstPausedIndex\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t0x40000d4\n\t.word\tgOamMallocCopiedOrder\n\t.word\tgOamMallocBuffer\n\t.word\t-0x7ffffffd\n\t.word\tgFlags\n\t.word\tgOamFreeIndex\n\t.word\t-0x7efffffd\n.L12:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr1, .L34\n\tldrb\tr0, [r1]\n\tsub\tr3, r0, #0x1\n\tlsl\tr0, r3, #0x3\n\tldr\tr2, .L34+0x4\n\tadd\tr5, r0, r2\n\tcmp\tr3, #0\n\tblt\t.L20\t@cond_branch\n\tldr\tr2, .L34+0x8\n\tldr\tr6, .L34+0xc\n\tldr\tr0, .L34+0x4\n\tmov\tr1, #0xfe\n\tlsl\tr1, r1, #0x2\n\tadd\tr4, r0, r1\n\tadd\tr1, r5, #0\n.L22:\n\tstr\tr1, [r2]\n\tstr\tr4, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr1, r1, #0x8\n\tsub\tr3, r3, #0x1\n\tsub\tr4, r4, #0x8\n\tcmp\tr3, #0\n\tbge\t.L22\t@cond_branch\n.L20:\n\tldr\tr2, .L34\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x80\n\tsub\tr0, r0, r1\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n\tmov\tr3, #0x0\n\tldrb\tr0, [r1]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr5, sp\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr7, r2, #0\n\tldr\tr1, .L34+0x8\n\tadd\tr4, r0, #0\n\tldr\tr6, .L34+0x10\n\tldr\tr2, .L34+0x4\n.L27:\n\tstrh\tr7, [r5]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr2, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\t.code\t16\n\tadd\tr2, r2, #0x8\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r4\n\tblt\t.L27\t@cond_branch\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgOamFreeIndex\n\t.word\tgOamBuffer\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffd\n\t.word\t-0x7efffffd\n.L18:\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n.L17:\n\tmov\tr0, #0x0\n\tldr\tr2, .L36\n\tstrb\tr0, [r2]\n\tldr\tr1, .L36+0x4\n\tldr\tr0, [r1]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x7\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L30\t@cond_branch\n\tmov\tr4, #0x1\n\tneg\tr4, r4\n\tstr\tr4, [sp, #0x4]\n\tadd\tr0, sp, #0x4\n\tldr\tr5, .L36+0x8\n\tldr\tr1, .L36+0xc\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tstr\tr4, [sp, #0x8]\n\tldr\tr1, .L36+0x10\n\tldr\tr0, [sp, #0xc]\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tb\t.L31\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgOamFreeIndex\n\t.word\tgFlags\n\t.word\t0x5000008\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocOrders_EndIndex\n.L30:\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tstr\tr1, [sp, #0x8]\n\tldr\tr0, .L38\n\tldr\tr2, [sp, #0xc]\n\tstr\tr2, [r0]\n\tldr\tr2, .L38+0x4\n\tstr\tr2, [r0, #0x4]\n\tldr\tr2, .L38+0x8\n\tstr\tr2, [r0, #0x8]\n\tldr\tr3, [r0, #0x8]\n\tstr\tr1, [sp, #0x8]\n\tldr\tr1, [sp, #0xc]\n\tstr\tr1, [r0]\n\tldr\tr1, .L38+0xc\n\tstr\tr1, [r0, #0x4]\n\tstr\tr2, [r0, #0x8]\n\tldr\tr0, [r0, #0x8]\n.L31:\n\tadd\tsp, sp, #0x10\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0x40000d4\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t-0x7afffff8\n\t.word\tgOamMallocOrders_EndIndex\n.Lfe1:\n\t.size\t ProcessOamBuffers,.Lfe1-ProcessOamBuffers\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ProcessOamBuffers # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:Random:agbcc","sym":"Random","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","pointer","arithmetic"],"loc":16,"refSource":"u16 Random(void)\n{\n u32 new;\n u32 *pPrev = &gRngPrevValue;\n u32 *pCurrent = &gRngValue;\n\n u32 prev = *pPrev;\n gRngPrevValue = *pCurrent;\n\n new = prev + RAND_CONST;\n new += *pCurrent;\n\n gRngValue = new;\n\n return ((u16 *)&gRngValue)[1];\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L402-L425","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr3, .L3\n\tldr\tr1, .L3+0x4\n\tldr\tr0, [r3]\n\tldr\tr2, [r1]\n\tstr\tr2, [r3]\n\tldr\tr3, .L3+0x8\n\tadd\tr0, r0, r3\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldrh\tr0, [r1, #0x2]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n\t.word\t0x37119371\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-3c6c541b53d3.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'Random' — raise: cannot recover struct 'Struct0': field at offset 2 overlaps the prior field (aligned to 4) — unions not modelled */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tRandom */\n/* \t.type\t Random,function */\n/* \t.thumb_func */\n/* Random: */\n/* \tldr\tr3, .L3 */\n/* \tldr\tr1, .L3+0x4 */\n/* \tldr\tr0, [r3] */\n/* \tldr\tr2, [r1] */\n/* \tstr\tr2, [r3] */\n/* \tldr\tr3, .L3+0x8 */\n/* \tadd\tr0, r0, r3 */\n/* \tadd\tr0, r0, r2 */\n/* \tstr\tr0, [r1] */\n/* \tldrh\tr0, [r1, #0x2] */\n/* \tbx\tlr */\n/* .L4: */\n/* \t.align\t2, 0 */\n/* .L3: */\n/* \t.word\tgRngPrevValue */\n/* \t.word\tgRngValue */\n/* \t.word\t0x37119371 */\n/* .Lfe1: */\n/* \t.size\t Random,.Lfe1-Random */\n/* \t.comm\tgRngPrevValue, 4\t@ 4 */\n/* \t.comm\tgRngValue, 4\t@ 4 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid Random(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': field at offset 2 overlaps the prior field (aligned to 4) — unions not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":37,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["raise: cannot recover struct 'Struct0': field at offset 2 overlaps the prior field (aligned to 4) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u16 Random(void) {\n u32 temp_r0;\n\n temp_r0 = gRngPrevValue;\n gRngPrevValue = gRngValue.unk0;\n gRngValue.unk0 += temp_r0 + 0x37119371;\n return gRngValue.unk2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":7,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:313: request for member `unk0' in something not a structure or union","/c.c:314: request for member `unk0' in something not a structure or union","/c.c:315: request for member `unk2' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Random` — benchmark function sa3:Random:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr3, .L3\n\tldr\tr1, .L3+0x4\n\tldr\tr0, [r3]\n\tldr\tr2, [r1]\n\tstr\tr2, [r3]\n\tldr\tr3, .L3+0x8\n\tadd\tr0, r0, r3\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldrh\tr0, [r1, #0x2]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n\t.word\t0x37119371\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-3c6c541b53d3.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu16 Random(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Random # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Random` — benchmark function sa3:Random:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:Random:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr3, .L3\n\tldr\tr1, .L3+0x4\n\tldr\tr0, [r3]\n\tldr\tr2, [r1]\n\tstr\tr2, [r3]\n\tldr\tr3, .L3+0x8\n\tadd\tr0, r0, r3\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldrh\tr0, [r1, #0x2]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n\t.word\t0x37119371\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Random # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8004418:agbcc","sym":"sa2__sub_8004418","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["branch","cast","fixed-point","array","memcpy"],"loc":53,"refSource":"s16 sa2__sub_8004418(s16 x, s16 y)\n{\n s16 fraction;\n s32 result;\n u8 index = 0;\n u8 array[8];\n memcpy(array, unkFractions, sizeof(array));\n\n if ((x | y) == 0) {\n result = -1;\n } else {\n if (x <= 0) {\n x = -x;\n index = 4;\n }\n if (y <= 0) {\n y = -y;\n index += 2;\n }\n if (x >= y) {\n // fraction = y*0.5 / x\n y *= Q(0.5);\n\n if (x == 0) {\n fraction = y;\n } else {\n fraction = y / x;\n }\n } else {\n index += 1;\n\n x *= Q(0.5);\n\n if (y == 0) {\n fraction = x;\n } else {\n fraction = x / y;\n }\n }\n\n if (array[index] & 0x01) {\n fraction = Q(0.5) - fraction;\n }\n\n {\n s32 val = array[index] * Q(0.5);\n fraction += val;\n result = ((u32)(fraction << 22) >> 22);\n }\n }\n\n return result;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L73-L125","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.type\t unkFractions,object\n\t.size\t unkFractions,8\nunkFractions:\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x2\n\t.byte\t0x3\n\t.byte\t0x6\n\t.byte\t0x7\n\t.byte\t0x5\n\t.byte\t0x4\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8004418\n\t.type\t sa2__sub_8004418,function\n\t.thumb_func\nsa2__sub_8004418:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x8\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tmov\tr6, #0x0\n\tldr\tr1, .L15\n\tmov\tr0, sp\n\tmov\tr2, #0x8\n\tbl\tmemcpy\n\tlsl\tr0, r4, #0x10\n\tasr\tr1, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr2, r0, #0x10\n\tadd\tr0, r1, #0\n\torr\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tb\t.L4\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\tunkFractions\n.L3:\n\tcmp\tr1, #0\n\tbgt\t.L5\t@cond_branch\n\tneg\tr0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x4\n.L5:\n\tcmp\tr2, #0\n\tbgt\t.L6\t@cond_branch\n\tneg\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tadd\tr0, r6, #0x2\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L6:\n\tlsl\tr0, r4, #0x10\n\tasr\tr2, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr1, r0, #0x10\n\tcmp\tr2, r1\n\tblt\t.L7\t@cond_branch\n\tlsl\tr0, r1, #0x17\n\tlsr\tr5, r0, #0x10\n\tcmp\tr2, #0\n\tbne\t.L8\t@cond_branch\n\tadd\tr2, r5, #0\n\tb\t.L10\n.L8:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r2, #0\n\tb\t.L14\n.L7:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tlsl\tr0, r2, #0x17\n\tlsr\tr4, r0, #0x10\n\tcmp\tr1, #0\n\tbne\t.L11\t@cond_branch\n\tadd\tr2, r4, #0\n\tb\t.L10\n.L11:\n\tlsl\tr0, r4, #0x10\n\tasr\tr0, r0, #0x10\n.L14:\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L10:\n\tmov\tr0, sp\n\tadd\tr3, r0, r6\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr2, r1, #0x10\n.L13:\n\tldrb\tr1, [r3]\n\tlsl\tr1, r1, #0x7\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x16\n\tlsr\tr0, r0, #0x16\n.L4:\n\tadd\tsp, sp, #0x8\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8004418,.Lfe1-sa2__sub_8004418\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-4e7a3b17981a.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sa2__sub_8004418' — lift: cannot lift 'sa2__sub_8004418': reads the sub-word data table 'unkFractions' (.byte) — sub-word table data is not modelled */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* \t.section .rodata */\n/* \t.type\t unkFractions,object */\n/* \t.size\t unkFractions,8 */\n/* unkFractions: */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x2 */\n/* \t.byte\t0x3 */\n/* \t.byte\t0x6 */\n/* \t.byte\t0x7 */\n/* \t.byte\t0x5 */\n/* \t.byte\t0x4 */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tsa2__sub_8004418 */\n/* \t.type\t sa2__sub_8004418,function */\n/* \t.thumb_func */\n/* sa2__sub_8004418: */\n/* \tpush\t{r4, r5, r6, lr} */\n/* \tadd\tsp, sp, #-0x8 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr4, r0, #0x10 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr5, r1, #0x10 */\n/* \tmov\tr6, #0x0 */\n/* \tldr\tr1, .L15 */\n/* \tmov\tr0, sp */\n/* \tmov\tr2, #0x8 */\n/* \tbl\tmemcpy */\n/* \tlsl\tr0, r4, #0x10 */\n/* \tasr\tr1, r0, #0x10 */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tasr\tr2, r0, #0x10 */\n/* \tadd\tr0, r1, #0 */\n/* \torr\tr0, r0, r2 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L3\t@cond_branch */\n/* \tmov\tr0, #0x1 */\n/* \tneg\tr0, r0 */\n/* \tb\t.L4 */\n/* .L16: */\n/* \t.align\t2, 0 */\n/* .L15: */\n/* \t.word\tunkFractions */\n/* .L3: */\n/* \tcmp\tr1, #0 */\n/* \tbgt\t.L5\t@cond_branch */\n/* \tneg\tr0, r1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr4, r0, #0x10 */\n/* \tmov\tr6, #0x4 */\n/* .L5: */\n/* \tcmp\tr2, #0 */\n/* \tbgt\t.L6\t@cond_branch */\n/* \tneg\tr0, r2 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr5, r0, #0x10 */\n/* \tadd\tr0, r6, #0x2 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr6, r0, #0x18 */\n/* .L6: */\n/* \tlsl\tr0, r4, #0x10 */\n/* \tasr\tr2, r0, #0x10 */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tasr\tr1, r0, #0x10 */\n/* \tcmp\tr2, r1 */\n/* \tblt\t.L7\t@cond_branch */\n/* \tlsl\tr0, r1, #0x17 */\n/* \tlsr\tr5, r0, #0x10 */\n/* \tcmp\tr2, #0 */\n/* \tbne\t.L8\t@cond_branch */\n/* \tadd\tr2, r5, #0 */\n/* \tb\t.L10 */\n/* .L8: */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tadd\tr1, r2, #0 */\n/* \tb\t.L14 */\n/* .L7: */\n/* \tadd\tr0, r6, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr6, r0, #0x18 */\n/* \tlsl\tr0, r2, #0x17 */\n/* \tlsr\tr4, r0, #0x10 */\n/* \tcmp\tr1, #0 */\n/* \tbne\t.L11\t@cond_branch */\n/* \tadd\tr2, r4, #0 */\n/* \tb\t.L10 */\n/* .L11: */\n/* \tlsl\tr0, r4, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* .L14: */\n/* \tbl\t__divsi3 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr2, r0, #0x10 */\n/* .L10: */\n/* \tmov\tr0, sp */\n/* \tadd\tr3, r0, r6 */\n/* \tldrb\tr1, [r3] */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L13\t@cond_branch */\n/* \tmov\tr1, #0x80 */\n/* \tlsl\tr0, r2, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tsub\tr1, r1, r0 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr2, r1, #0x10 */\n/* .L13: */\n/* \tldrb\tr1, [r3] */\n/* \tlsl\tr1, r1, #0x7 */\n/* \tlsl\tr0, r2, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x16 */\n/* \tlsr\tr0, r0, #0x16 */\n/* .L4: */\n/* \tadd\tsp, sp, #0x8 */\n/* \tpop\t{r4, r5, r6} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .Lfe1: */\n/* \t.size\t sa2__sub_8004418,.Lfe1-sa2__sub_8004418 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid sa2__sub_8004418(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sa2__sub_8004418': reads the sub-word data table 'unkFractions' (.byte) — sub-word table data is not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":134,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sa2__sub_8004418': reads the sub-word data table 'unkFractions' (.byte) — sub-word table data is not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s16 sa2__sub_8004418(s16 x, s16 y) {\n s16 temp_r1;\n s16 temp_r2;\n s16 temp_r2_2;\n s16 var_r0;\n s16 var_r1;\n u16 temp_r4;\n u16 temp_r5;\n u16 var_r2;\n u16 var_r4;\n u16 var_r5;\n u8 *temp_r3;\n u8 var_r6;\n\n var_r4 = (u16) x;\n var_r5 = (u16) y;\n var_r6 = 0;\n memcpy(&unksp0, unkFractions, 8U);\n temp_r1 = (s16) var_r4;\n temp_r2 = (s16) var_r5;\n if ((temp_r1 | temp_r2) == 0) {\n return -1;\n }\n if ((s32) temp_r1 <= 0) {\n var_r4 = 0 - temp_r1;\n var_r6 = 4;\n }\n if ((s32) temp_r2 <= 0) {\n var_r5 = 0 - temp_r2;\n var_r6 += 2;\n }\n temp_r2_2 = (s16) var_r4;\n var_r1 = (s16) var_r5;\n if ((s32) temp_r2_2 >= (s32) var_r1) {\n temp_r5 = var_r1 << 7;\n if (temp_r2_2 == 0) {\n var_r2 = temp_r5;\n } else {\n var_r0 = (s16) temp_r5;\n var_r1 = temp_r2_2;\n goto block_13;\n }\n } else {\n var_r6 += 1;\n temp_r4 = temp_r2_2 << 7;\n if (var_r1 == 0) {\n var_r2 = temp_r4;\n } else {\n var_r0 = (s16) temp_r4;\nblock_13:\n var_r2 = (u16) (var_r0 / var_r1);\n }\n }\n temp_r3 = &unksp0 + var_r6;\n if (1 & *temp_r3) {\n var_r2 = 0x80 - (s16) var_r2;\n }\n return (s16) ((u32) (((s16) var_r2 + (*temp_r3 << 7)) << 0x16) >> 0x16);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":76,"lines":58,"gotos":1,"casts":17,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:363: `unksp0' undeclared (first use in this function)","/c.c:363: (Each undeclared identifier is reported only once","/c.c:363: for each function it appears in.)"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8004418` — benchmark function sa3:sa2__sub_8004418:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.type\t unkFractions,object\n\t.size\t unkFractions,8\nunkFractions:\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x2\n\t.byte\t0x3\n\t.byte\t0x6\n\t.byte\t0x7\n\t.byte\t0x5\n\t.byte\t0x4\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8004418\n\t.type\t sa2__sub_8004418,function\n\t.thumb_func\nsa2__sub_8004418:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x8\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tmov\tr6, #0x0\n\tldr\tr1, .L15\n\tmov\tr0, sp\n\tmov\tr2, #0x8\n\tbl\tmemcpy\n\tlsl\tr0, r4, #0x10\n\tasr\tr1, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr2, r0, #0x10\n\tadd\tr0, r1, #0\n\torr\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tb\t.L4\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\tunkFractions\n.L3:\n\tcmp\tr1, #0\n\tbgt\t.L5\t@cond_branch\n\tneg\tr0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x4\n.L5:\n\tcmp\tr2, #0\n\tbgt\t.L6\t@cond_branch\n\tneg\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tadd\tr0, r6, #0x2\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L6:\n\tlsl\tr0, r4, #0x10\n\tasr\tr2, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr1, r0, #0x10\n\tcmp\tr2, r1\n\tblt\t.L7\t@cond_branch\n\tlsl\tr0, r1, #0x17\n\tlsr\tr5, r0, #0x10\n\tcmp\tr2, #0\n\tbne\t.L8\t@cond_branch\n\tadd\tr2, r5, #0\n\tb\t.L10\n.L8:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r2, #0\n\tb\t.L14\n.L7:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tlsl\tr0, r2, #0x17\n\tlsr\tr4, r0, #0x10\n\tcmp\tr1, #0\n\tbne\t.L11\t@cond_branch\n\tadd\tr2, r4, #0\n\tb\t.L10\n.L11:\n\tlsl\tr0, r4, #0x10\n\tasr\tr0, r0, #0x10\n.L14:\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L10:\n\tmov\tr0, sp\n\tadd\tr3, r0, r6\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr2, r1, #0x10\n.L13:\n\tldrb\tr1, [r3]\n\tlsl\tr1, r1, #0x7\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x16\n\tlsr\tr0, r0, #0x16\n.L4:\n\tadd\tsp, sp, #0x8\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8004418,.Lfe1-sa2__sub_8004418\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-4e7a3b17981a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns16 sa2__sub_8004418(s16 x, s16 y);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8004418 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8004418` — benchmark function sa3:sa2__sub_8004418:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8004418:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.type\t unkFractions,object\n\t.size\t unkFractions,8\nunkFractions:\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x2\n\t.byte\t0x3\n\t.byte\t0x6\n\t.byte\t0x7\n\t.byte\t0x5\n\t.byte\t0x4\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8004418\n\t.type\t sa2__sub_8004418,function\n\t.thumb_func\nsa2__sub_8004418:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x8\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tmov\tr6, #0x0\n\tldr\tr1, .L15\n\tmov\tr0, sp\n\tmov\tr2, #0x8\n\tbl\tmemcpy\n\tlsl\tr0, r4, #0x10\n\tasr\tr1, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr2, r0, #0x10\n\tadd\tr0, r1, #0\n\torr\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tb\t.L4\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\tunkFractions\n.L3:\n\tcmp\tr1, #0\n\tbgt\t.L5\t@cond_branch\n\tneg\tr0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x4\n.L5:\n\tcmp\tr2, #0\n\tbgt\t.L6\t@cond_branch\n\tneg\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tadd\tr0, r6, #0x2\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L6:\n\tlsl\tr0, r4, #0x10\n\tasr\tr2, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr1, r0, #0x10\n\tcmp\tr2, r1\n\tblt\t.L7\t@cond_branch\n\tlsl\tr0, r1, #0x17\n\tlsr\tr5, r0, #0x10\n\tcmp\tr2, #0\n\tbne\t.L8\t@cond_branch\n\tadd\tr2, r5, #0\n\tb\t.L10\n.L8:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r2, #0\n\tb\t.L14\n.L7:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tlsl\tr0, r2, #0x17\n\tlsr\tr4, r0, #0x10\n\tcmp\tr1, #0\n\tbne\t.L11\t@cond_branch\n\tadd\tr2, r4, #0\n\tb\t.L10\n.L11:\n\tlsl\tr0, r4, #0x10\n\tasr\tr0, r0, #0x10\n.L14:\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L10:\n\tmov\tr0, sp\n\tadd\tr3, r0, r6\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr2, r1, #0x10\n.L13:\n\tldrb\tr1, [r3]\n\tlsl\tr1, r1, #0x7\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x16\n\tlsr\tr0, r0, #0x16\n.L4:\n\tadd\tsp, sp, #0x8\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8004418,.Lfe1-sa2__sub_8004418\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8004418 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8007858:agbcc","sym":"sa2__sub_8007858","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","global","bitwise","cast"],"loc":23,"refSource":"void sa2__sub_8007858(u8 param0, int_vcount minY, int_vcount maxY, u16 param3, u16 param4)\n{\n u16 *cursor;\n\n gFlags |= FLAGS_EXECUTE_HBLANK_COPY;\n\n gHBlankCopyTarget = (void *)&((u8 *)®_BG0HOFS)[param0 * 4];\n gHBlankCopySize = 4;\n\n cursor = &((u16 *)gBgOffsetsHBlankPrimary)[minY * 2];\n\n param4 = (param4 - minY) & 0x1FF;\n param3 &= 0x1FF;\n\n while (minY < maxY) {\n *cursor = param3;\n cursor++;\n *cursor = param4--;\n cursor++;\n\n minY++;\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L826-L848","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007858\n\t.type\t sa2__sub_8007858,function\n\t.thumb_func\nsa2__sub_8007858:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r3, #0\n\tldr\tr3, [sp, #0x14]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr6, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr4, r3, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tsub\tr4, r4, r5\n\tldr\tr1, .L7+0x14\n\tadd\tr0, r1, #0\n\tand\tr4, r4, r0\n\tand\tr7, r7, r0\n\tcmp\tr5, r6\n\tbcs\t.L4\t@cond_branch\n.L5:\n\tstrh\tr7, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r4, #0\n\tsub\tr1, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr4, r1, #0x10\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, r6\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007858,.Lfe1-sa2__sub_8007858\n\n.text\n\t.align\t2, 0\n","proto":{"sa2__sub_8007858":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sa2__sub_8007858' — lift: cannot lift 'sa2__sub_8007858': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tsa2__sub_8007858 */\n/* \t.type\t sa2__sub_8007858,function */\n/* \t.thumb_func */\n/* sa2__sub_8007858: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tadd\tr7, r3, #0 */\n/* \tldr\tr3, [sp, #0x14] */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tlsr\tr5, r1, #0x18 */\n/* \tlsl\tr2, r2, #0x18 */\n/* \tlsr\tr6, r2, #0x18 */\n/* \tlsl\tr3, r3, #0x10 */\n/* \tlsr\tr4, r3, #0x10 */\n/* \tldr\tr2, .L7 */\n/* \tldr\tr1, [r2] */\n/* \tmov\tr3, #0x4 */\n/* \torr\tr1, r1, r3 */\n/* \tstr\tr1, [r2] */\n/* \tldr\tr1, .L7+0x4 */\n/* \tlsr\tr0, r0, #0x16 */\n/* \tldr\tr2, .L7+0x8 */\n/* \tadd\tr0, r0, r2 */\n/* \tstr\tr0, [r1] */\n/* \tldr\tr0, .L7+0xc */\n/* \tstrb\tr3, [r0] */\n/* \tldr\tr0, .L7+0x10 */\n/* \tlsl\tr1, r5, #0x2 */\n/* \tldr\tr0, [r0] */\n/* \tadd\tr2, r0, r1 */\n/* \tsub\tr4, r4, r5 */\n/* \tldr\tr1, .L7+0x14 */\n/* \tadd\tr0, r1, #0 */\n/* \tand\tr4, r4, r0 */\n/* \tand\tr7, r7, r0 */\n/* \tcmp\tr5, r6 */\n/* \tbcs\t.L4\t@cond_branch */\n/* .L5: */\n/* \tstrh\tr7, [r2] */\n/* \tadd\tr2, r2, #0x2 */\n/* \tadd\tr0, r4, #0 */\n/* \tsub\tr1, r0, #0x1 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr4, r1, #0x10 */\n/* \tstrh\tr0, [r2] */\n/* \tadd\tr2, r2, #0x2 */\n/* \tadd\tr0, r5, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tcmp\tr5, r6 */\n/* \tbcc\t.L5\t@cond_branch */\n/* .L4: */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L8: */\n/* \t.align\t2, 0 */\n/* .L7: */\n/* \t.word\tgFlags */\n/* \t.word\tgHBlankCopyTarget */\n/* \t.word\t0x4000010 */\n/* \t.word\tgHBlankCopySize */\n/* \t.word\tgBgOffsetsHBlankPrimary */\n/* \t.word\t0x1ff */\n/* .Lfe1: */\n/* \t.size\t sa2__sub_8007858,.Lfe1-sa2__sub_8007858 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid sa2__sub_8007858(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sa2__sub_8007858': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":78,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sa2__sub_8007858': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern s32 gBgOffsetsHBlankPrimary;\nextern s32 gFlags;\nextern s8 gHBlankCopySize;\nextern s32 gHBlankCopyTarget;\n\nvoid sa2__sub_8007858(s32 arg0, u8 arg1, u8 arg2, s32 arg3, s32 arg4) {\n u16 temp_r0;\n u16 var_r4;\n u8 temp_r6;\n u8 var_r5;\n void *var_r2;\n\n var_r5 = arg1;\n temp_r6 = arg2;\n gFlags |= 4;\n gHBlankCopyTarget = ((u32) (arg0 << 0x18) >> 0x16) + 0x04000010;\n gHBlankCopySize = 4;\n var_r2 = gBgOffsetsHBlankPrimary + (var_r5 * 4);\n var_r4 = ((u16) arg4 - var_r5) & 0x1FF;\n if ((u32) var_r5 < (u32) temp_r6) {\n do {\n var_r2->unk0 = (s16) (arg3 & 0x1FF);\n temp_r0 = var_r4;\n var_r4 = temp_r0 - 1;\n var_r2->unk2 = temp_r0;\n var_r2 = var_r2 + 2 + 2;\n var_r5 += 1;\n } while ((u32) var_r5 < (u32) temp_r6);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":90,"lines":28,"gotos":0,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:919: conflicting types for `gBgOffsetsHBlankPrimary'","/c.c:877: previous declaration of `gBgOffsetsHBlankPrimary'","/c.c:920: conflicting types for `gFlags'","/c.c:917: previous declaration of `gFlags'","/c.c:921: conflicting types for `gHBlankCopySize'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8007858` — benchmark function sa3:sa2__sub_8007858:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007858\n\t.type\t sa2__sub_8007858,function\n\t.thumb_func\nsa2__sub_8007858:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r3, #0\n\tldr\tr3, [sp, #0x14]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr6, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr4, r3, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tsub\tr4, r4, r5\n\tldr\tr1, .L7+0x14\n\tadd\tr0, r1, #0\n\tand\tr4, r4, r0\n\tand\tr7, r7, r0\n\tcmp\tr5, r6\n\tbcs\t.L4\t@cond_branch\n.L5:\n\tstrh\tr7, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r4, #0\n\tsub\tr1, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr4, r1, #0x10\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, r6\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007858,.Lfe1-sa2__sub_8007858\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8007858 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8007858` — benchmark function sa3:sa2__sub_8007858:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8007858:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007858\n\t.type\t sa2__sub_8007858,function\n\t.thumb_func\nsa2__sub_8007858:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r3, #0\n\tldr\tr3, [sp, #0x14]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr6, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr4, r3, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tsub\tr4, r4, r5\n\tldr\tr1, .L7+0x14\n\tadd\tr0, r1, #0\n\tand\tr4, r4, r0\n\tand\tr7, r7, r0\n\tcmp\tr5, r6\n\tbcs\t.L4\t@cond_branch\n.L5:\n\tstrh\tr7, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r4, #0\n\tsub\tr1, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr4, r1, #0x10\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, r6\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007858,.Lfe1-sa2__sub_8007858\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_8007858\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8007858 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_80078D4:agbcc","sym":"sa2__sub_80078D4","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["mmio","global","dma","bitwise"],"loc":15,"refSource":"void sa2__sub_80078D4(u8 bg, int_vcount minY, int_vcount maxY, u16 offsetEven, u16 offsetOdd)\n{\n s32 fillVal;\n\n gFlags |= FLAGS_EXECUTE_HBLANK_COPY;\n\n gHBlankCopyTarget = (void *)&((u8 *)®_BG0HOFS)[bg * 4];\n gHBlankCopySize = 4;\n\n if (minY < maxY) {\n fillVal = (offsetEven %= 512u) | ((offsetOdd % 512u) << 16);\n\n DmaFill32(3, fillVal, &((u16 *)gBgOffsetsHBlankPrimary)[minY * 2], (maxY - minY) * 4);\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L850-L864","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80078D4\n\t.type\t sa2__sub_80078D4,function\n\t.thumb_func\nsa2__sub_80078D4:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x18]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr7, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tldr\tr2, .L4\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L4+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L4+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L4+0xc\n\tstrb\tr3, [r0]\n\tcmp\tr5, r7\n\tbcs\t.L3\t@cond_branch\n\tldr\tr2, .L4+0x10\n\tadd\tr1, r6, #0\n\tand\tr1, r1, r2\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r2\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tstr\tr1, [sp]\n\tldr\tr2, .L4+0x14\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldr\tr0, .L4+0x18\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2, #0x4]\n\tsub\tr0, r7, r5\n\tmov\tr1, #0x85\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n.L3:\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\t0x1ff\n\t.word\t0x40000d4\n\t.word\tgBgOffsetsHBlankPrimary\n.Lfe1:\n\t.size\t sa2__sub_80078D4,.Lfe1-sa2__sub_80078D4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sa2__sub_80078D4' — lift: cannot lift 'sa2__sub_80078D4': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tsa2__sub_80078D4 */\n/* \t.type\t sa2__sub_80078D4,function */\n/* \t.thumb_func */\n/* sa2__sub_80078D4: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tadd\tsp, sp, #-0x4 */\n/* \tldr\tr4, [sp, #0x18] */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tlsr\tr5, r1, #0x18 */\n/* \tlsl\tr2, r2, #0x18 */\n/* \tlsr\tr7, r2, #0x18 */\n/* \tlsl\tr3, r3, #0x10 */\n/* \tlsr\tr6, r3, #0x10 */\n/* \tlsl\tr4, r4, #0x10 */\n/* \tlsr\tr4, r4, #0x10 */\n/* \tldr\tr2, .L4 */\n/* \tldr\tr1, [r2] */\n/* \tmov\tr3, #0x4 */\n/* \torr\tr1, r1, r3 */\n/* \tstr\tr1, [r2] */\n/* \tldr\tr1, .L4+0x4 */\n/* \tlsr\tr0, r0, #0x16 */\n/* \tldr\tr2, .L4+0x8 */\n/* \tadd\tr0, r0, r2 */\n/* \tstr\tr0, [r1] */\n/* \tldr\tr0, .L4+0xc */\n/* \tstrb\tr3, [r0] */\n/* \tcmp\tr5, r7 */\n/* \tbcs\t.L3\t@cond_branch */\n/* \tldr\tr2, .L4+0x10 */\n/* \tadd\tr1, r6, #0 */\n/* \tand\tr1, r1, r2 */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r2 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \torr\tr1, r1, r0 */\n/* \tstr\tr1, [sp] */\n/* \tldr\tr2, .L4+0x14 */\n/* \tmov\tr0, sp */\n/* \tstr\tr0, [r2] */\n/* \tldr\tr0, .L4+0x18 */\n/* \tlsl\tr1, r5, #0x2 */\n/* \tldr\tr0, [r0] */\n/* \tadd\tr0, r0, r1 */\n/* \tstr\tr0, [r2, #0x4] */\n/* \tsub\tr0, r7, r5 */\n/* \tmov\tr1, #0x85 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \torr\tr0, r0, r1 */\n/* \tstr\tr0, [r2, #0x8] */\n/* \tldr\tr0, [r2, #0x8] */\n/* .L3: */\n/* \tadd\tsp, sp, #0x4 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L5: */\n/* \t.align\t2, 0 */\n/* .L4: */\n/* \t.word\tgFlags */\n/* \t.word\tgHBlankCopyTarget */\n/* \t.word\t0x4000010 */\n/* \t.word\tgHBlankCopySize */\n/* \t.word\t0x1ff */\n/* \t.word\t0x40000d4 */\n/* \t.word\tgBgOffsetsHBlankPrimary */\n/* .Lfe1: */\n/* \t.size\t sa2__sub_80078D4,.Lfe1-sa2__sub_80078D4 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid sa2__sub_80078D4(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sa2__sub_80078D4': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":81,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sa2__sub_80078D4': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern s32 gBgOffsetsHBlankPrimary;\nextern s32 gFlags;\nextern s8 gHBlankCopySize;\nextern s32 gHBlankCopyTarget;\n\ns32 sa2__sub_80078D4(s32 arg0, u8 arg1, u8 arg2, u16 arg3, s32 arg5) {\n s8 *var_r0;\n u8 temp_r5;\n u8 temp_r7;\n\n temp_r5 = arg1;\n temp_r7 = arg2;\n gFlags |= 4;\n gHBlankCopyTarget = ((u32) (arg0 << 0x18) >> 0x16) + 0x04000010;\n var_r0 = &gHBlankCopySize;\n gHBlankCopySize = 4;\n if ((u32) temp_r5 < (u32) temp_r7) {\n unksp0 = (arg3 & 0x1FF) | (((u16) arg5 & 0x1FF) << 0x10);\n (void *)0x040000D4->unk0 = &unksp0;\n (void *)0x040000D4->unk4 = (s32) (gBgOffsetsHBlankPrimary + (temp_r5 * 4));\n (void *)0x040000D4->unk8 = (s32) ((temp_r7 - temp_r5) | 0x85000000);\n var_r0 = (s8 *) (void *)0x040000D4->unk8;\n }\n return (s32) var_r0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":23,"gotos":0,"casts":12,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:919: conflicting types for `gBgOffsetsHBlankPrimary'","/c.c:877: previous declaration of `gBgOffsetsHBlankPrimary'","/c.c:920: conflicting types for `gFlags'","/c.c:917: previous declaration of `gFlags'","/c.c:921: conflicting types for `gHBlankCopySize'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80078D4` — benchmark function sa3:sa2__sub_80078D4:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80078D4\n\t.type\t sa2__sub_80078D4,function\n\t.thumb_func\nsa2__sub_80078D4:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x18]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr7, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tldr\tr2, .L4\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L4+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L4+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L4+0xc\n\tstrb\tr3, [r0]\n\tcmp\tr5, r7\n\tbcs\t.L3\t@cond_branch\n\tldr\tr2, .L4+0x10\n\tadd\tr1, r6, #0\n\tand\tr1, r1, r2\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r2\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tstr\tr1, [sp]\n\tldr\tr2, .L4+0x14\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldr\tr0, .L4+0x18\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2, #0x4]\n\tsub\tr0, r7, r5\n\tmov\tr1, #0x85\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n.L3:\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\t0x1ff\n\t.word\t0x40000d4\n\t.word\tgBgOffsetsHBlankPrimary\n.Lfe1:\n\t.size\t sa2__sub_80078D4,.Lfe1-sa2__sub_80078D4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80078D4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80078D4` — benchmark function sa3:sa2__sub_80078D4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80078D4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80078D4\n\t.type\t sa2__sub_80078D4,function\n\t.thumb_func\nsa2__sub_80078D4:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x18]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr7, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tldr\tr2, .L4\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L4+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L4+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L4+0xc\n\tstrb\tr3, [r0]\n\tcmp\tr5, r7\n\tbcs\t.L3\t@cond_branch\n\tldr\tr2, .L4+0x10\n\tadd\tr1, r6, #0\n\tand\tr1, r1, r2\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r2\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tstr\tr1, [sp]\n\tldr\tr2, .L4+0x14\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldr\tr0, .L4+0x18\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2, #0x4]\n\tsub\tr0, r7, r5\n\tmov\tr1, #0x85\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n.L3:\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\t0x1ff\n\t.word\t0x40000d4\n\t.word\tgBgOffsetsHBlankPrimary\n.Lfe1:\n\t.size\t sa2__sub_80078D4,.Lfe1-sa2__sub_80078D4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80078D4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8007958:agbcc","sym":"sa2__sub_8007958","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","global","bitwise","arithmetic"],"loc":24,"refSource":"void sa2__sub_8007958(u8 bg, int_vcount minY, int_vcount maxY, s16 param3, s8 param4, u16 param5, u16 param6)\n{\n u16 *cursor;\n\n gFlags |= FLAGS_EXECUTE_HBLANK_COPY;\n\n gHBlankCopyTarget = (void *)&((u8 *)®_BG0HOFS)[bg * 4];\n gHBlankCopySize = 4;\n\n cursor = &((u16 *)gBgOffsetsHBlankPrimary)[minY * 2];\n\n while (minY < maxY) {\n *cursor = (param3 + param5) & 0x1FF;\n cursor++;\n *cursor = param6;\n cursor++;\n\n param3 = -(param3 + param4);\n param4 = -param4;\n\n minY++;\n }\n}\n","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L866-L888","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007958\n\t.type\t sa2__sub_8007958,function\n\t.thumb_func\nsa2__sub_8007958:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x20]\n\tldr\tr5, [sp, #0x24]\n\tldr\tr6, [sp, #0x28]\n\tmov\tr8, r6\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr7, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tip, r2\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tmov\tr9, r5\n\tmov\tr1, r8\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r7, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tcmp\tr7, ip\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L7+0x14\n\tadd\tr3, r0, #0\n.L5:\n\tmov\tr1, r9\n\tadd\tr0, r1, r6\n\tand\tr0, r0, r3\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tstrh\tr5, [r2]\n\tadd\tr2, r2, #0x2\n\tlsl\tr1, r4, #0x18\n\tasr\tr1, r1, #0x18\n\tlsl\tr0, r6, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tneg\tr0, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr6, r0, #0x10\n\tneg\tr1, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr4, r1, #0x18\n\tadd\tr0, r7, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr7, r0, #0x18\n\tcmp\tr7, ip\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007958,.Lfe1-sa2__sub_8007958\n\n.text\n\t.align\t2, 0\n","proto":{"sa2__sub_8007958":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sa2__sub_8007958' — lift: cannot lift 'sa2__sub_8007958': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tsa2__sub_8007958 */\n/* \t.type\t sa2__sub_8007958,function */\n/* \t.thumb_func */\n/* sa2__sub_8007958: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, r9 */\n/* \tmov\tr6, r8 */\n/* \tpush\t{r6, r7} */\n/* \tadd\tsp, sp, #-0x4 */\n/* \tldr\tr4, [sp, #0x20] */\n/* \tldr\tr5, [sp, #0x24] */\n/* \tldr\tr6, [sp, #0x28] */\n/* \tmov\tr8, r6 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tlsr\tr7, r1, #0x18 */\n/* \tlsl\tr2, r2, #0x18 */\n/* \tlsr\tr2, r2, #0x18 */\n/* \tmov\tip, r2 */\n/* \tlsl\tr3, r3, #0x10 */\n/* \tlsr\tr6, r3, #0x10 */\n/* \tlsl\tr4, r4, #0x18 */\n/* \tlsr\tr4, r4, #0x18 */\n/* \tlsl\tr5, r5, #0x10 */\n/* \tlsr\tr5, r5, #0x10 */\n/* \tmov\tr9, r5 */\n/* \tmov\tr1, r8 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr5, r1, #0x10 */\n/* \tldr\tr2, .L7 */\n/* \tldr\tr1, [r2] */\n/* \tmov\tr3, #0x4 */\n/* \torr\tr1, r1, r3 */\n/* \tstr\tr1, [r2] */\n/* \tldr\tr1, .L7+0x4 */\n/* \tlsr\tr0, r0, #0x16 */\n/* \tldr\tr2, .L7+0x8 */\n/* \tadd\tr0, r0, r2 */\n/* \tstr\tr0, [r1] */\n/* \tldr\tr0, .L7+0xc */\n/* \tstrb\tr3, [r0] */\n/* \tldr\tr0, .L7+0x10 */\n/* \tlsl\tr1, r7, #0x2 */\n/* \tldr\tr0, [r0] */\n/* \tadd\tr2, r0, r1 */\n/* \tcmp\tr7, ip */\n/* \tbcs\t.L4\t@cond_branch */\n/* \tldr\tr0, .L7+0x14 */\n/* \tadd\tr3, r0, #0 */\n/* .L5: */\n/* \tmov\tr1, r9 */\n/* \tadd\tr0, r1, r6 */\n/* \tand\tr0, r0, r3 */\n/* \tstrh\tr0, [r2] */\n/* \tadd\tr2, r2, #0x2 */\n/* \tstrh\tr5, [r2] */\n/* \tadd\tr2, r2, #0x2 */\n/* \tlsl\tr1, r4, #0x18 */\n/* \tasr\tr1, r1, #0x18 */\n/* \tlsl\tr0, r6, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tadd\tr0, r0, r1 */\n/* \tneg\tr0, r0 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr6, r0, #0x10 */\n/* \tneg\tr1, r1 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tlsr\tr4, r1, #0x18 */\n/* \tadd\tr0, r7, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr7, r0, #0x18 */\n/* \tcmp\tr7, ip */\n/* \tbcc\t.L5\t@cond_branch */\n/* .L4: */\n/* \tadd\tsp, sp, #0x4 */\n/* \tpop\t{r3, r4} */\n/* \tmov\tr8, r3 */\n/* \tmov\tr9, r4 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L8: */\n/* \t.align\t2, 0 */\n/* .L7: */\n/* \t.word\tgFlags */\n/* \t.word\tgHBlankCopyTarget */\n/* \t.word\t0x4000010 */\n/* \t.word\tgHBlankCopySize */\n/* \t.word\tgBgOffsetsHBlankPrimary */\n/* \t.word\t0x1ff */\n/* .Lfe1: */\n/* \t.size\t sa2__sub_8007958,.Lfe1-sa2__sub_8007958 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid sa2__sub_8007958(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sa2__sub_8007958': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":104,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sa2__sub_8007958': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern s32 gBgOffsetsHBlankPrimary;\nextern s32 gFlags;\nextern s8 gHBlankCopySize;\nextern s32 gHBlankCopyTarget;\n\nvoid sa2__sub_8007958(s32 arg0, u8 arg1, u8 arg2, u16 arg3, s32 arg5, s32 arg6, s32 arg7) {\n s8 temp_r1;\n u16 var_r6;\n u8 temp_r2;\n u8 var_r4;\n u8 var_r7;\n void *var_r2;\n\n var_r7 = arg1;\n temp_r2 = arg2;\n var_r6 = arg3;\n var_r4 = (u8) arg5;\n gFlags |= 4;\n gHBlankCopyTarget = ((u32) (arg0 << 0x18) >> 0x16) + 0x04000010;\n gHBlankCopySize = 4;\n var_r2 = gBgOffsetsHBlankPrimary + (var_r7 * 4);\n if ((u32) var_r7 < (u32) temp_r2) {\n do {\n var_r2->unk0 = (s16) (((u16) arg6 + var_r6) & 0x1FF);\n var_r2->unk2 = (u16) arg7;\n var_r2 = var_r2 + 2 + 2;\n temp_r1 = (s8) var_r4;\n var_r6 = 0 - ((s16) var_r6 + temp_r1);\n var_r4 = 0 - temp_r1;\n var_r7 += 1;\n } while ((u32) var_r7 < (u32) temp_r2);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":31,"gotos":0,"casts":11,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:919: conflicting types for `gBgOffsetsHBlankPrimary'","/c.c:877: previous declaration of `gBgOffsetsHBlankPrimary'","/c.c:920: conflicting types for `gFlags'","/c.c:917: previous declaration of `gFlags'","/c.c:921: conflicting types for `gHBlankCopySize'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8007958` — benchmark function sa3:sa2__sub_8007958:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007958\n\t.type\t sa2__sub_8007958,function\n\t.thumb_func\nsa2__sub_8007958:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x20]\n\tldr\tr5, [sp, #0x24]\n\tldr\tr6, [sp, #0x28]\n\tmov\tr8, r6\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr7, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tip, r2\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tmov\tr9, r5\n\tmov\tr1, r8\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r7, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tcmp\tr7, ip\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L7+0x14\n\tadd\tr3, r0, #0\n.L5:\n\tmov\tr1, r9\n\tadd\tr0, r1, r6\n\tand\tr0, r0, r3\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tstrh\tr5, [r2]\n\tadd\tr2, r2, #0x2\n\tlsl\tr1, r4, #0x18\n\tasr\tr1, r1, #0x18\n\tlsl\tr0, r6, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tneg\tr0, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr6, r0, #0x10\n\tneg\tr1, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr4, r1, #0x18\n\tadd\tr0, r7, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr7, r0, #0x18\n\tcmp\tr7, ip\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007958,.Lfe1-sa2__sub_8007958\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8007958 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8007958` — benchmark function sa3:sa2__sub_8007958:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8007958:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007958\n\t.type\t sa2__sub_8007958,function\n\t.thumb_func\nsa2__sub_8007958:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x20]\n\tldr\tr5, [sp, #0x24]\n\tldr\tr6, [sp, #0x28]\n\tmov\tr8, r6\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr7, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tip, r2\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tmov\tr9, r5\n\tmov\tr1, r8\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r7, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tcmp\tr7, ip\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L7+0x14\n\tadd\tr3, r0, #0\n.L5:\n\tmov\tr1, r9\n\tadd\tr0, r1, r6\n\tand\tr0, r0, r3\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tstrh\tr5, [r2]\n\tadd\tr2, r2, #0x2\n\tlsl\tr1, r4, #0x18\n\tasr\tr1, r1, #0x18\n\tlsl\tr0, r6, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tneg\tr0, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr6, r0, #0x10\n\tneg\tr1, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr4, r1, #0x18\n\tadd\tr0, r7, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr7, r0, #0x18\n\tcmp\tr7, ip\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007958,.Lfe1-sa2__sub_8007958\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_8007958\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8007958 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8083504:agbcc","sym":"sa2__sub_8083504","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","branch","fixed-point","shift"],"loc":26,"refSource":"void SA2_LABEL(sub_8083504)(UNK_8085D14_2 *arg0, UNK_8085D14_2 *arg1, UNK_8085D14_2 *arg2)\n{\n s32 var_r3, var_r4;\n\n if (arg1->unk2 != 0x400) {\n var_r3 = (arg1->unk2 * arg0->unk8) >> 0xA;\n arg2->unk2 = ((arg1->unk2 * arg0->unk2) >> 0xA);\n } else {\n var_r3 = arg0->unk8;\n }\n if (arg1->unk4 != 0x400) {\n var_r4 = (arg1->unk4 * arg0->unkC) >> 0xA;\n arg2->unk4 = ((arg1->unk4 * arg0->unk4) >> 0xA);\n } else {\n var_r4 = arg0->unkC;\n }\n\n if (arg1->unk0 != 0) {\n arg2->unk8 = (arg1->unk8 + (((var_r3 * (COS(arg1->unk0) >> 6)) >> 8) - ((var_r4 * (SIN(arg1->unk0) >> 6)) >> 8)));\n arg2->unkC = arg1->unkC + (((var_r3 * (SIN(arg1->unk0) >> 6)) >> 8) + ((var_r4 * (COS(arg1->unk0) >> 6)) >> 8));\n } else {\n arg2->unk8 = (arg1->unk8 + var_r3);\n arg2->unkC = arg1->unkC + var_r4;\n }\n arg2->unk0 = ((arg0->unk0 + arg1->unk0) & (SIN_PERIOD - 1));\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L67-L92","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8083504\n\t.type\t sa2__sub_8083504,function\n\t.thumb_func\nsa2__sub_8083504:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tadd\tr7, r2, #0\n\tmov\tr0, #0x2\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, [r6, #0x8]\n\tmul\tr0, r0, r1\n\tasr\tr3, r0, #0xa\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x2]\n\tb\t.L4\n.L3:\n\tldr\tr3, [r6, #0x8]\n.L4:\n\tmov\tr0, #0x4\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, [r6, #0xc]\n\tmul\tr0, r0, r1\n\tasr\tr4, r0, #0xa\n\tmov\tr2, #0x4\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x4]\n\tb\t.L6\n.L5:\n\tldr\tr4, [r6, #0xc]\n.L6:\n\tldrh\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr0, .L10\n\tmov\tip, r0\n\tldrh\tr1, [r5]\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tmov\tr8, r2\n\tadd\tr0, r1, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tsub\tr2, r2, r0\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r2\n\tstr\tr0, [r7, #0x8]\n\tldrh\tr1, [r5]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tadd\tr1, r1, r8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tadd\tr2, r2, r0\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r2\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgSineTable\n.L7:\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r3\n\tstr\tr0, [r7, #0x8]\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r4\n.L9:\n\tstr\tr0, [r7, #0xc]\n\tldrh\tr0, [r5]\n\tldrh\tr6, [r6]\n\tadd\tr0, r0, r6\n\tldr\tr2, .L12\n\tadd\tr1, r2, #0\n\tand\tr0, r0, r1\n\tstrh\tr0, [r7]\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0x3ff\n.Lfe1:\n\t.size\t sa2__sub_8083504,.Lfe1-sa2__sub_8083504\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-13f369a7ed62.i.gz","proto":{"sa2__sub_8083504":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","symbolsUsed":[{"name":"gSineTable","shape":"s16[]"}],"outcome":"nonmatch","source":"struct Struct0 { u16 field_0; u8 _pad0[6]; s32 field_8; s32 field_12; };\nstruct Struct1 { u16 field_0; u16 field_2; u16 field_4; s32 field_8; s32 field_12; };\nstruct Struct2 { u16 field_0; u8 _pad0[6]; s32 field_8; s32 field_12; };\nvoid sa2__sub_8083504(struct Struct0 * a0, struct Struct2 * a1, struct Struct1 * a2, u32 a3) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n s32 v6;\n u16 * p0;\n p0 = (u16 *)&gSineTable;\n v0 = *(s16 *)(a1 + 2);\n if (v0 == 128 << 3) {\n v4 = a0->field_8;\n } else {\n v1 = a0->field_8;\n a2->field_2 = *(s16 *)(a0 + 2) * v0 >> 10;\n v4 = v1 * v0 >> 10;\n }\n v2 = *(s16 *)(a1 + 4);\n if (v2 == 128 << 3) {\n v5 = a0->field_12;\n } else {\n v3 = a0->field_12;\n a2->field_4 = *(s16 *)(a0 + 4) * v2 >> 10;\n v5 = v3 * v2 >> 10;\n }\n if (a1->field_0 == 0) {\n a2->field_8 = a1->field_8 + v4;\n v6 = a1->field_12 + v5;\n } else {\n a2->field_8 = a1->field_8 + ((v4 * (p0[a1->field_0 + (128 << 1)] << 16 >> 22) >> 8) - ((p0[a1->field_0] << 16 >> 22) * v5 >> 8));\n v6 = a1->field_12 + ((v4 * (p0[a1->field_0] << 16 >> 22) >> 8) + ((p0[a1->field_0 + (128 << 1)] << 16 >> 22) * v5 >> 8));\n }\n a2->field_12 = v6;\n a2->field_0 = a1->field_0 + a0->field_0 & 1023;\n return;\n}\n","score":85,"maxScore":125,"compileErrors":null,"breakdown":{"insert":17,"delete":15,"replace":11,"opMismatch":3,"argMismatch":39},"quality":{"score":78,"lines":40,"gotos":0,"casts":5,"unkGlue":0,"rawMem":4,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sa2__sub_8083504(void *arg0, void *arg1, void *arg2) {\n s16 temp_r1;\n s16 temp_r1_2;\n s32 var_r0;\n s32 var_r3;\n s32 var_r4;\n u16 temp_r1_3;\n u16 temp_r1_4;\n\n temp_r1 = arg1->unk2;\n if (temp_r1 != 0x400) {\n var_r3 = (s32) (arg0->unk8 * temp_r1) >> 0xA;\n arg2->unk2 = (s16) ((s32) (arg0->unk2 * temp_r1) >> 0xA);\n } else {\n var_r3 = arg0->unk8;\n }\n temp_r1_2 = arg1->unk4;\n if (temp_r1_2 != 0x400) {\n var_r4 = (s32) (arg0->unkC * temp_r1_2) >> 0xA;\n arg2->unk4 = (s16) ((s32) (arg0->unk4 * temp_r1_2) >> 0xA);\n } else {\n var_r4 = arg0->unkC;\n }\n if (arg1->unk0 != 0) {\n temp_r1_3 = arg1->unk0;\n arg2->unk8 = (s32) (arg1->unk8 + (((s32) (var_r3 * ((s32) ((u16) gSineTable[temp_r1_3 + 0x100] << 0x10) >> 0x16)) >> 8) - ((s32) (((s32) ((u16) gSineTable[temp_r1_3] << 0x10) >> 0x16) * var_r4) >> 8)));\n temp_r1_4 = arg1->unk0;\n var_r0 = arg1->unkC + (((s32) (var_r3 * ((s32) ((u16) gSineTable[temp_r1_4] << 0x10) >> 0x16)) >> 8) + ((s32) (((s32) ((u16) gSineTable[temp_r1_4 + 0x100] << 0x10) >> 0x16) * var_r4) >> 8));\n } else {\n arg2->unk8 = (s32) (arg1->unk8 + var_r3);\n var_r0 = arg1->unkC + var_r4;\n }\n arg2->unkC = var_r0;\n arg2->unk0 = (s16) ((arg1->unk0 + arg0->unk0) & 0x3FF);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":34,"gotos":0,"casts":21,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:330: warning: dereferencing `void *' pointer","/c.c:330: request for member `unk2' in something not a structure or union","/c.c:332: warning: dereferencing `void *' pointer","/c.c:332: request for member `unk8' in something not a structure or union","/c.c:333: warning: dereferencing `void *' pointer"]},"gapSize":{"decompiler":"asmlift","score":85,"maxScore":125,"ratio":0.68,"kinds":{"insert":17,"delete":15,"replace":11,"opMismatch":3,"argMismatch":39}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8083504` — benchmark function sa3:sa2__sub_8083504:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8083504\n\t.type\t sa2__sub_8083504,function\n\t.thumb_func\nsa2__sub_8083504:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tadd\tr7, r2, #0\n\tmov\tr0, #0x2\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, [r6, #0x8]\n\tmul\tr0, r0, r1\n\tasr\tr3, r0, #0xa\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x2]\n\tb\t.L4\n.L3:\n\tldr\tr3, [r6, #0x8]\n.L4:\n\tmov\tr0, #0x4\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, [r6, #0xc]\n\tmul\tr0, r0, r1\n\tasr\tr4, r0, #0xa\n\tmov\tr2, #0x4\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x4]\n\tb\t.L6\n.L5:\n\tldr\tr4, [r6, #0xc]\n.L6:\n\tldrh\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr0, .L10\n\tmov\tip, r0\n\tldrh\tr1, [r5]\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tmov\tr8, r2\n\tadd\tr0, r1, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tsub\tr2, r2, r0\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r2\n\tstr\tr0, [r7, #0x8]\n\tldrh\tr1, [r5]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tadd\tr1, r1, r8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tadd\tr2, r2, r0\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r2\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgSineTable\n.L7:\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r3\n\tstr\tr0, [r7, #0x8]\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r4\n.L9:\n\tstr\tr0, [r7, #0xc]\n\tldrh\tr0, [r5]\n\tldrh\tr6, [r6]\n\tadd\tr0, r0, r6\n\tldr\tr2, .L12\n\tadd\tr1, r2, #0\n\tand\tr0, r0, r1\n\tstrh\tr0, [r7]\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0x3ff\n.Lfe1:\n\t.size\t sa2__sub_8083504,.Lfe1-sa2__sub_8083504\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-13f369a7ed62.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8083504 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8083504` — benchmark function sa3:sa2__sub_8083504:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8083504:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8083504\n\t.type\t sa2__sub_8083504,function\n\t.thumb_func\nsa2__sub_8083504:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tadd\tr7, r2, #0\n\tmov\tr0, #0x2\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, [r6, #0x8]\n\tmul\tr0, r0, r1\n\tasr\tr3, r0, #0xa\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x2]\n\tb\t.L4\n.L3:\n\tldr\tr3, [r6, #0x8]\n.L4:\n\tmov\tr0, #0x4\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, [r6, #0xc]\n\tmul\tr0, r0, r1\n\tasr\tr4, r0, #0xa\n\tmov\tr2, #0x4\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x4]\n\tb\t.L6\n.L5:\n\tldr\tr4, [r6, #0xc]\n.L6:\n\tldrh\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr0, .L10\n\tmov\tip, r0\n\tldrh\tr1, [r5]\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tmov\tr8, r2\n\tadd\tr0, r1, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tsub\tr2, r2, r0\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r2\n\tstr\tr0, [r7, #0x8]\n\tldrh\tr1, [r5]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tadd\tr1, r1, r8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tadd\tr2, r2, r0\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r2\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgSineTable\n.L7:\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r3\n\tstr\tr0, [r7, #0x8]\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r4\n.L9:\n\tstr\tr0, [r7, #0xc]\n\tldrh\tr0, [r5]\n\tldrh\tr6, [r6]\n\tadd\tr0, r0, r6\n\tldr\tr2, .L12\n\tadd\tr1, r2, #0\n\tand\tr0, r0, r1\n\tstrh\tr0, [r7]\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0x3ff\n.Lfe1:\n\t.size\t sa2__sub_8083504,.Lfe1-sa2__sub_8083504\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_8083504\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8083504 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_80838CC:agbcc","sym":"sa2__sub_80838CC","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","arithmetic","shift"],"loc":7,"refSource":"void SA2_LABEL(sub_80838CC)(UNK_8085D14 *arg0, UNK_8085D14 *arg1, UNK_8085D14 *arg2)\n{\n arg2->unk0 = (((arg0->unk6 * arg1->unk0) + (arg0->unk0 * arg1->unk6) + (arg0->unk2 * arg1->unk4)) - (arg0->unk4 * arg1->unk2)) >> 0xA;\n arg2->unk2 = (((arg0->unk6 * arg1->unk2) - (arg0->unk0 * arg1->unk4)) + (arg0->unk2 * arg1->unk6) + (arg0->unk4 * arg1->unk0)) >> 0xA;\n arg2->unk4 = ((((arg0->unk6 * arg1->unk4) + (arg0->unk0 * arg1->unk2)) - (arg0->unk2 * arg1->unk0)) + (arg0->unk4 * arg1->unk6)) >> 0xA;\n arg2->unk6 = ((((arg0->unk6 * arg1->unk6) - (arg0->unk0 * arg1->unk0)) - (arg0->unk2 * arg1->unk2)) - (arg0->unk4 * arg1->unk4)) >> 0xA;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L177-L183","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80838CC\n\t.type\t sa2__sub_80838CC,function\n\t.thumb_func\nsa2__sub_80838CC:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x0\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x2\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x4\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x4]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x6\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr5, #0x4\n\tldrsh\tr4, [r0, r5]\n\tmov\tr6, #0x4\n\tldrsh\tr0, [r1, r6]\n\tmul\tr0, r0, r4\n\tsub\tr3, r3, r0\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x6]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_80838CC,.Lfe1-sa2__sub_80838CC\n\n.text\n\t.align\t2, 0\n","proto":{"sa2__sub_80838CC":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void sa2__sub_80838CC(s16 * a0, s16 * a1, u16 * a2) {\n *a2 = *(a1 + 0) * *(a0 + 3) + *(a1 + 3) * *(a0 + 0) + *(a1 + 2) * *(a0 + 1) - *(a1 + 1) * *(a0 + 2) >> 10;\n a2[1] = *(a1 + 1) * *(a0 + 3) - *(a1 + 2) * *(a0 + 0) + *(a1 + 3) * *(a0 + 1) + *(a1 + 0) * *(a0 + 2) >> 10;\n a2[2] = *(a1 + 2) * *(a0 + 3) + *(a1 + 1) * *(a0 + 0) - *(a1 + 0) * *(a0 + 1) + *(a1 + 3) * *(a0 + 2) >> 10;\n a2[3] = *(a1 + 3) * *(a0 + 3) - *(a1 + 0) * *(a0 + 0) - *(a1 + 1) * *(a0 + 1) - *(a1 + 2) * *(a0 + 2) >> 10;\n return;\n}\n","score":59,"maxScore":104,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":59},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sa2__sub_80838CC(void *arg0, void *arg1, void *arg2) {\n arg2->unk0 = (s16) ((s32) (((arg1->unk0 * arg0->unk6) + (arg1->unk6 * arg0->unk0) + (arg1->unk4 * arg0->unk2)) - (arg1->unk2 * arg0->unk4)) >> 0xA);\n arg2->unk2 = (s16) ((s32) (((arg1->unk2 * arg0->unk6) - (arg1->unk4 * arg0->unk0)) + (arg1->unk6 * arg0->unk2) + (arg1->unk0 * arg0->unk4)) >> 0xA);\n arg2->unk4 = (s16) ((s32) ((((arg1->unk4 * arg0->unk6) + (arg1->unk2 * arg0->unk0)) - (arg1->unk0 * arg0->unk2)) + (arg1->unk6 * arg0->unk4)) >> 0xA);\n arg2->unk6 = (s16) ((s32) ((((arg1->unk6 * arg0->unk6) - (arg1->unk0 * arg0->unk0)) - (arg1->unk2 * arg0->unk2)) - (arg1->unk4 * arg0->unk4)) >> 0xA);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":6,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:323: warning: dereferencing `void *' pointer","/c.c:323: request for member `unk0' in something not a structure or union","/c.c:323: request for member `unk6' in something not a structure or union","/c.c:323: request for member `unk4' in something not a structure or union","/c.c:323: request for member `unk2' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":59,"maxScore":104,"ratio":0.5673076923076923,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":59}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80838CC` — benchmark function sa3:sa2__sub_80838CC:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80838CC\n\t.type\t sa2__sub_80838CC,function\n\t.thumb_func\nsa2__sub_80838CC:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x0\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x2\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x4\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x4]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x6\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr5, #0x4\n\tldrsh\tr4, [r0, r5]\n\tmov\tr6, #0x4\n\tldrsh\tr0, [r1, r6]\n\tmul\tr0, r0, r4\n\tsub\tr3, r3, r0\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x6]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_80838CC,.Lfe1-sa2__sub_80838CC\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80838CC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80838CC` — benchmark function sa3:sa2__sub_80838CC:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80838CC:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80838CC\n\t.type\t sa2__sub_80838CC,function\n\t.thumb_func\nsa2__sub_80838CC:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x0\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x2\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x4\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x4]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x6\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr5, #0x4\n\tldrsh\tr4, [r0, r5]\n\tmov\tr6, #0x4\n\tldrsh\tr0, [r1, r6]\n\tmul\tr0, r0, r4\n\tsub\tr3, r3, r0\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x6]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_80838CC,.Lfe1-sa2__sub_80838CC\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_80838CC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80838CC # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_808399C:agbcc","sym":"sa2__sub_808399C","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","arithmetic","shift"],"loc":10,"refSource":"void SA2_LABEL(sub_808399C)(UNK_8085D14 *arg0, UNK_8085D14 *arg1)\n{\n s16 r6 = arg0->unk0;\n s16 r5 = arg0->unk2;\n s16 r4 = arg0->unk4;\n arg0->unk0 = (((arg0->unk6 * arg1->unk0) + (r6 * arg1->unk6) + (r5 * arg1->unk4)) - (r4 * arg1->unk2)) >> 10;\n arg0->unk2 = (((arg0->unk6 * arg1->unk2) - (r6 * arg1->unk4)) + (r5 * arg1->unk6) + (r4 * arg1->unk0)) >> 10;\n arg0->unk4 = ((((arg0->unk6 * arg1->unk4) + (r6 * arg1->unk2)) - (r5 * arg1->unk0)) + (r4 * arg1->unk6)) >> 10;\n arg0->unk6 = ((((arg0->unk6 * arg1->unk6) - (r6 * arg1->unk0)) - (r5 * arg1->unk2)) - (r4 * arg1->unk4)) >> 10;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L185-L194","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808399C\n\t.type\t sa2__sub_808399C,function\n\t.thumb_func\nsa2__sub_808399C:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr4, #0x0\n\tldrsh\tr2, [r1, r4]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr6, [r0, r7]\n\tmov\tr4, #0x6\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr5, [r0, r7]\n\tmov\tr4, #0x4\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr4, [r0, r7]\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tsub\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x2\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x2]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x4\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x4]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x6\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr6, #0x2\n\tldrsh\tr3, [r1, r6]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr1, [r1, r7]\n\tmul\tr1, r1, r4\n\tsub\tr2, r2, r1\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_808399C,.Lfe1-sa2__sub_808399C\n\n.text\n\t.align\t2, 0\n","proto":{"sa2__sub_808399C":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void sa2__sub_808399C(u16 * a0, s16 * a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n v0 = *(a0 + 0);\n v1 = *(a0 + 1);\n v2 = *(a0 + 2);\n *a0 = *(a1 + 0) * *(a0 + 3) + *(a1 + 3) * v0 + *(a1 + 2) * v1 - *(a1 + 1) * v2 >> 10;\n a0[1] = *(a1 + 1) * *(a0 + 3) - *(a1 + 2) * v0 + *(a1 + 3) * v1 + *(a1 + 0) * v2 >> 10;\n a0[2] = *(a1 + 2) * *(a0 + 3) + *(a1 + 1) * v0 - *(a1 + 0) * v1 + *(a1 + 3) * v2 >> 10;\n a0[3] = *(a1 + 3) * *(a0 + 3) - *(a1 + 0) * v0 - *(a1 + 1) * v1 - *(a1 + 2) * v2 >> 10;\n return;\n}\n","score":41,"maxScore":90,"compileErrors":null,"breakdown":{"insert":4,"delete":11,"replace":3,"opMismatch":0,"argMismatch":23},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sa2__sub_808399C(void *arg0, void *arg1) {\n s16 temp_r4;\n s16 temp_r5;\n s16 temp_r6;\n\n temp_r6 = arg0->unk0;\n temp_r5 = arg0->unk2;\n temp_r4 = arg0->unk4;\n arg0->unk0 = (s16) ((s32) (((arg1->unk0 * arg0->unk6) + (arg1->unk6 * temp_r6) + (arg1->unk4 * temp_r5)) - (arg1->unk2 * temp_r4)) >> 0xA);\n arg0->unk2 = (s16) ((s32) (((arg1->unk2 * arg0->unk6) - (arg1->unk4 * temp_r6)) + (arg1->unk6 * temp_r5) + (arg1->unk0 * temp_r4)) >> 0xA);\n arg0->unk4 = (s16) ((s32) ((((arg1->unk4 * arg0->unk6) + (arg1->unk2 * temp_r6)) - (arg1->unk0 * temp_r5)) + (arg1->unk6 * temp_r4)) >> 0xA);\n arg0->unk6 = (s16) ((s32) ((((arg1->unk6 * arg0->unk6) - (arg1->unk0 * temp_r6)) - (arg1->unk2 * temp_r5)) - (arg1->unk4 * temp_r4)) >> 0xA);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":12,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:327: warning: dereferencing `void *' pointer","/c.c:327: request for member `unk0' in something not a structure or union","/c.c:328: warning: dereferencing `void *' pointer","/c.c:328: request for member `unk2' in something not a structure or union","/c.c:329: warning: dereferencing `void *' pointer"]},"gapSize":{"decompiler":"asmlift","score":41,"maxScore":90,"ratio":0.45555555555555555,"kinds":{"insert":4,"delete":11,"replace":3,"opMismatch":0,"argMismatch":23}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_808399C` — benchmark function sa3:sa2__sub_808399C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808399C\n\t.type\t sa2__sub_808399C,function\n\t.thumb_func\nsa2__sub_808399C:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr4, #0x0\n\tldrsh\tr2, [r1, r4]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr6, [r0, r7]\n\tmov\tr4, #0x6\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr5, [r0, r7]\n\tmov\tr4, #0x4\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr4, [r0, r7]\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tsub\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x2\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x2]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x4\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x4]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x6\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr6, #0x2\n\tldrsh\tr3, [r1, r6]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr1, [r1, r7]\n\tmul\tr1, r1, r4\n\tsub\tr2, r2, r1\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_808399C,.Lfe1-sa2__sub_808399C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_808399C # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_808399C` — benchmark function sa3:sa2__sub_808399C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_808399C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808399C\n\t.type\t sa2__sub_808399C,function\n\t.thumb_func\nsa2__sub_808399C:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr4, #0x0\n\tldrsh\tr2, [r1, r4]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr6, [r0, r7]\n\tmov\tr4, #0x6\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr5, [r0, r7]\n\tmov\tr4, #0x4\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr4, [r0, r7]\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tsub\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x2\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x2]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x4\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x4]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x6\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr6, #0x2\n\tldrsh\tr3, [r1, r6]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr1, [r1, r7]\n\tmul\tr1, r1, r4\n\tsub\tr2, r2, r1\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_808399C,.Lfe1-sa2__sub_808399C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_808399C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_808399C # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_808558C:agbcc","sym":"sa2__sub_808558C","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","bitwise","branch","shift"],"loc":14,"refSource":"s16 SA2_LABEL(sub_808558C)(u16 angleA, u16 angleB, u8 numDecimalBits)\n{\n u32 c1 = (1 << numDecimalBits);\n u16 c2 = c1 - 1;\n\n angleB -= angleA;\n angleB &= c2;\n\n if (angleB <= (c1 / 2)) {\n return angleB;\n } else {\n return (angleB - c1);\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L469-L482","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808558C\n\t.type\t sa2__sub_808558C,function\n\t.thumb_func\nsa2__sub_808558C:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr4, #0x1\n\tlsl\tr4, r4, r2\n\tsub\tr1, r4, #0x1\n\tsub\tr0, r3, r0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tlsr\tr0, r4, #0x1\n\tcmp\tr3, r0\n\tbls\t.L3\t@cond_branch\n\tsub\tr0, r3, r4\n\tlsl\tr0, r0, #0x10\n\tb\t.L7\n.L3:\n\tlsl\tr0, r3, #0x10\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_808558C,.Lfe1-sa2__sub_808558C\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 sa2__sub_808558C(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n if ((u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) <= 1 << (u8)a2 >> 1) {\n v0 = (u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) << 16;\n } else {\n v0 = (u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) - (1 << (u8)a2) << 16;\n }\n return v0 >> 16;\n}\n","score":23,"maxScore":27,"compileErrors":null,"breakdown":{"insert":2,"delete":9,"replace":4,"opMismatch":1,"argMismatch":7},"quality":{"score":88,"lines":9,"gotos":0,"casts":14,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sa2__sub_808558C(u16 arg0, u16 arg1, u8 arg2) {\n s32 var_r0;\n u16 temp_r3;\n u32 temp_r4;\n\n temp_r4 = 1 << arg2;\n temp_r3 = (arg1 - arg0) & (temp_r4 - 1);\n if ((u32) temp_r3 > (u32) (temp_r4 >> 1)) {\n var_r0 = (temp_r3 - temp_r4) << 0x10;\n } else {\n var_r0 = temp_r3 << 0x10;\n }\n return var_r0 >> 0x10;\n}\n","score":16,"maxScore":25,"compileErrors":null,"breakdown":{"insert":0,"delete":3,"replace":3,"opMismatch":0,"argMismatch":10},"quality":{"score":100,"lines":13,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":16,"maxScore":25,"ratio":0.64,"kinds":{"insert":0,"delete":3,"replace":3,"opMismatch":0,"argMismatch":10}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_808558C` — benchmark function sa3:sa2__sub_808558C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808558C\n\t.type\t sa2__sub_808558C,function\n\t.thumb_func\nsa2__sub_808558C:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr4, #0x1\n\tlsl\tr4, r4, r2\n\tsub\tr1, r4, #0x1\n\tsub\tr0, r3, r0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tlsr\tr0, r4, #0x1\n\tcmp\tr3, r0\n\tbls\t.L3\t@cond_branch\n\tsub\tr0, r3, r4\n\tlsl\tr0, r0, #0x10\n\tb\t.L7\n.L3:\n\tlsl\tr0, r3, #0x10\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_808558C,.Lfe1-sa2__sub_808558C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_808558C # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_808558C` — benchmark function sa3:sa2__sub_808558C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_808558C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808558C\n\t.type\t sa2__sub_808558C,function\n\t.thumb_func\nsa2__sub_808558C:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr4, #0x1\n\tlsl\tr4, r4, r2\n\tsub\tr1, r4, #0x1\n\tsub\tr0, r3, r0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tlsr\tr0, r4, #0x1\n\tcmp\tr3, r0\n\tbls\t.L3\t@cond_branch\n\tsub\tr0, r3, r4\n\tlsl\tr0, r0, #0x10\n\tb\t.L7\n.L3:\n\tlsl\tr0, r3, #0x10\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_808558C,.Lfe1-sa2__sub_808558C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_808558C # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_80855C0:agbcc","sym":"sa2__sub_80855C0","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","int64","shift"],"loc":6,"refSource":"u32 SA2_LABEL(sub_80855C0)(s32 a, s32 b, s32 c, u8 d)\n{\n s64 e = (s64)c * (a - b);\n\n return a - (e >> d);\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L484-L489","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80855C0\n\t.type\t sa2__sub_80855C0,function\n\t.thumb_func\nsa2__sub_80855C0:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr6, r8\n\tpush\t{r6}\n\tmov\tr8, r0\n\tadd\tr4, r1, #0\n\tadd\tr0, r2, #0\n\tlsl\tr6, r3, #0x18\n\tlsr\tr6, r6, #0x18\n\tasr\tr1, r0, #0x1f\n\tmov\tr2, r8\n\tsub\tr4, r2, r4\n\tasr\tr5, r4, #0x1f\n\tadd\tr3, r5, #0\n\tadd\tr2, r4, #0\n\tbl\t__muldi3\n\tadd\tr2, r6, #0\n\tbl\t__ashrdi3\n\tmov\tr2, r8\n\tsub\tr2, r2, r0\n\tmov\tr8, r2\n\tmov\tr0, r8\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80855C0,.Lfe1-sa2__sub_80855C0\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 sa2__sub_80855C0(u32 a0, u32 a1, u32 a2, u32 a3, u32 a4) {\n return a0 - __ashrdi3(__muldi3(a2, a2 >> 31, a0 - a1, a0 - a1 >> 31), a2 >> 31, (u8)a3, a0 - a1 >> 31);\n}\n","score":31,"maxScore":38,"compileErrors":null,"breakdown":{"insert":12,"delete":7,"replace":2,"opMismatch":0,"argMismatch":10},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 __ashrdi3(s32, s32, u8); /* extern */\ns32 __muldi3(s32, s32, s32, s32); /* extern */\n\ns32 sa2__sub_80855C0(s32 arg0, s32 arg1, s32 arg2, u8 arg3) {\n s32 temp_r4;\n s32 temp_ret;\n\n temp_r4 = arg0 - arg1;\n temp_ret = __muldi3(arg2, arg2 >> 0x1F, temp_r4, temp_r4 >> 0x1F);\n return arg0 - __ashrdi3(temp_ret, SECOND_REG(temp_ret), arg3);\n}\n","score":20,"maxScore":28,"compileErrors":null,"breakdown":{"insert":2,"delete":6,"replace":1,"opMismatch":0,"argMismatch":11},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":20,"maxScore":28,"ratio":0.7142857142857143,"kinds":{"insert":2,"delete":6,"replace":1,"opMismatch":0,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80855C0` — benchmark function sa3:sa2__sub_80855C0:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80855C0\n\t.type\t sa2__sub_80855C0,function\n\t.thumb_func\nsa2__sub_80855C0:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr6, r8\n\tpush\t{r6}\n\tmov\tr8, r0\n\tadd\tr4, r1, #0\n\tadd\tr0, r2, #0\n\tlsl\tr6, r3, #0x18\n\tlsr\tr6, r6, #0x18\n\tasr\tr1, r0, #0x1f\n\tmov\tr2, r8\n\tsub\tr4, r2, r4\n\tasr\tr5, r4, #0x1f\n\tadd\tr3, r5, #0\n\tadd\tr2, r4, #0\n\tbl\t__muldi3\n\tadd\tr2, r6, #0\n\tbl\t__ashrdi3\n\tmov\tr2, r8\n\tsub\tr2, r2, r0\n\tmov\tr8, r2\n\tmov\tr0, r8\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80855C0,.Lfe1-sa2__sub_80855C0\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80855C0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80855C0` — benchmark function sa3:sa2__sub_80855C0:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80855C0:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80855C0\n\t.type\t sa2__sub_80855C0,function\n\t.thumb_func\nsa2__sub_80855C0:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr6, r8\n\tpush\t{r6}\n\tmov\tr8, r0\n\tadd\tr4, r1, #0\n\tadd\tr0, r2, #0\n\tlsl\tr6, r3, #0x18\n\tlsr\tr6, r6, #0x18\n\tasr\tr1, r0, #0x1f\n\tmov\tr2, r8\n\tsub\tr4, r2, r4\n\tasr\tr5, r4, #0x1f\n\tadd\tr3, r5, #0\n\tadd\tr2, r4, #0\n\tbl\t__muldi3\n\tadd\tr2, r6, #0\n\tbl\t__ashrdi3\n\tmov\tr2, r8\n\tsub\tr2, r2, r0\n\tmov\tr8, r2\n\tmov\tr0, r8\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80855C0,.Lfe1-sa2__sub_80855C0\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80855C0 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8085654:agbcc","sym":"sa2__sub_8085654","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","arithmetic","int64","shift"],"loc":9,"refSource":"s32 SA2_LABEL(sub_8085654)(s32 a, s32 b, s32 c, u8 d, u8 e)\n{\n do {\n a -= (((s64)c * (s64)(a - b))) >> d;\n e -= 1;\n } while (e != 0xFF);\n\n return a;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L509-L517","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085654\n\t.type\t sa2__sub_8085654,function\n\t.thumb_func\nsa2__sub_8085654:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr4, r0, #0\n\tmov\tr8, r1\n\tadd\tr6, r2, #0\n\tldr\tr0, [sp, #0x18]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr7, r3, #0x18\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n.L3:\n\tadd\tr0, r6, #0\n\tasr\tr1, r6, #0x1f\n\tmov\tr3, r8\n\tsub\tr2, r4, r3\n\tasr\tr3, r2, #0x1f\n\tbl\t__muldi3\n\tadd\tr2, r7, #0\n\tbl\t__ashrdi3\n\tsub\tr4, r4, r0\n\tsub\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0xff\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r4, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8085654,.Lfe1-sa2__sub_8085654\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sa2__sub_8085654' — lift: cannot lift 'sa2__sub_8085654': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tsa2__sub_8085654 */\n/* \t.type\t sa2__sub_8085654,function */\n/* \t.thumb_func */\n/* sa2__sub_8085654: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, r8 */\n/* \tpush\t{r7} */\n/* \tadd\tr4, r0, #0 */\n/* \tmov\tr8, r1 */\n/* \tadd\tr6, r2, #0 */\n/* \tldr\tr0, [sp, #0x18] */\n/* \tlsl\tr3, r3, #0x18 */\n/* \tlsr\tr7, r3, #0x18 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* .L3: */\n/* \tadd\tr0, r6, #0 */\n/* \tasr\tr1, r6, #0x1f */\n/* \tmov\tr3, r8 */\n/* \tsub\tr2, r4, r3 */\n/* \tasr\tr3, r2, #0x1f */\n/* \tbl\t__muldi3 */\n/* \tadd\tr2, r7, #0 */\n/* \tbl\t__ashrdi3 */\n/* \tsub\tr4, r4, r0 */\n/* \tsub\tr0, r5, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tcmp\tr5, #0xff */\n/* \tbne\t.L3\t@cond_branch */\n/* \tadd\tr0, r4, #0 */\n/* \tpop\t{r3} */\n/* \tmov\tr8, r3 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .Lfe1: */\n/* \t.size\t sa2__sub_8085654,.Lfe1-sa2__sub_8085654 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid sa2__sub_8085654(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sa2__sub_8085654': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":50,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sa2__sub_8085654': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 __ashrdi3(s32, s32, u8); /* extern */\ns32 __muldi3(s32, s32, s32, s32); /* extern */\n\ns32 sa2__sub_8085654(s32 arg0, s32 arg1, s32 arg2, u8 arg3, s32 arg4) {\n s32 temp_r2;\n s32 temp_ret;\n s32 var_r4;\n u8 var_r5;\n\n var_r4 = arg0;\n var_r5 = (u8) arg4;\n do {\n temp_r2 = var_r4 - arg1;\n temp_ret = __muldi3(arg2, arg2 >> 0x1F, temp_r2, temp_r2 >> 0x1F);\n var_r4 -= __ashrdi3(temp_ret, SECOND_REG(temp_ret), arg3);\n var_r5 -= 1;\n } while (var_r5 != 0xFF);\n return var_r4;\n}\n","score":31,"maxScore":40,"compileErrors":null,"breakdown":{"insert":9,"delete":2,"replace":3,"opMismatch":0,"argMismatch":17},"quality":{"score":100,"lines":17,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":31,"maxScore":40,"ratio":0.775,"kinds":{"insert":9,"delete":2,"replace":3,"opMismatch":0,"argMismatch":17}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085654` — benchmark function sa3:sa2__sub_8085654:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085654\n\t.type\t sa2__sub_8085654,function\n\t.thumb_func\nsa2__sub_8085654:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr4, r0, #0\n\tmov\tr8, r1\n\tadd\tr6, r2, #0\n\tldr\tr0, [sp, #0x18]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr7, r3, #0x18\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n.L3:\n\tadd\tr0, r6, #0\n\tasr\tr1, r6, #0x1f\n\tmov\tr3, r8\n\tsub\tr2, r4, r3\n\tasr\tr3, r2, #0x1f\n\tbl\t__muldi3\n\tadd\tr2, r7, #0\n\tbl\t__ashrdi3\n\tsub\tr4, r4, r0\n\tsub\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0xff\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r4, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8085654,.Lfe1-sa2__sub_8085654\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085654 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085654` — benchmark function sa3:sa2__sub_8085654:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085654:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085654\n\t.type\t sa2__sub_8085654,function\n\t.thumb_func\nsa2__sub_8085654:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr4, r0, #0\n\tmov\tr8, r1\n\tadd\tr6, r2, #0\n\tldr\tr0, [sp, #0x18]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr7, r3, #0x18\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n.L3:\n\tadd\tr0, r6, #0\n\tasr\tr1, r6, #0x1f\n\tmov\tr3, r8\n\tsub\tr2, r4, r3\n\tasr\tr3, r2, #0x1f\n\tbl\t__muldi3\n\tadd\tr2, r7, #0\n\tbl\t__ashrdi3\n\tsub\tr4, r4, r0\n\tsub\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0xff\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r4, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8085654,.Lfe1-sa2__sub_8085654\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085654 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_80856DC:agbcc","sym":"sa2__sub_80856DC","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div"],"loc":1,"refSource":"s32 SA2_LABEL(sub_80856DC)(s32 a, s32 b, s32 c) { return (a * 7 + b * 6 - c) / 12; }","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L529-L529","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856DC\n\t.type\t sa2__sub_80856DC,function\n\t.thumb_func\nsa2__sub_80856DC:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r3, #0x3\n\tsub\tr0, r0, r3\n\tlsl\tr3, r1, #0x1\n\tadd\tr3, r3, r1\n\tlsl\tr3, r3, #0x1\n\tadd\tr0, r0, r3\n\tsub\tr0, r0, r2\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856DC,.Lfe1-sa2__sub_80856DC\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 sa2__sub_80856DC(s32 a0, s32 a1, s32 a2) {\n return (a0 * 7 + a1 * 6 - a2) / 12;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sa2__sub_80856DC(s32 arg0, s32 arg1, s32 arg2) {\n return (s32) (((arg0 * 7) + (arg1 * 6)) - arg2) / 12;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80856DC` — benchmark function sa3:sa2__sub_80856DC:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856DC\n\t.type\t sa2__sub_80856DC,function\n\t.thumb_func\nsa2__sub_80856DC:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r3, #0x3\n\tsub\tr0, r0, r3\n\tlsl\tr3, r1, #0x1\n\tadd\tr3, r3, r1\n\tlsl\tr3, r3, #0x1\n\tadd\tr0, r0, r3\n\tsub\tr0, r0, r2\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856DC,.Lfe1-sa2__sub_80856DC\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80856DC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80856DC` — benchmark function sa3:sa2__sub_80856DC:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80856DC:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856DC\n\t.type\t sa2__sub_80856DC,function\n\t.thumb_func\nsa2__sub_80856DC:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r3, #0x3\n\tsub\tr0, r0, r3\n\tlsl\tr3, r1, #0x1\n\tadd\tr3, r3, r1\n\tlsl\tr3, r3, #0x1\n\tadd\tr0, r0, r3\n\tsub\tr0, r0, r2\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856DC,.Lfe1-sa2__sub_80856DC\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80856DC # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_80856F8:agbcc","sym":"sa2__sub_80856F8","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div"],"loc":1,"refSource":"s32 SA2_LABEL(sub_80856F8)(s32 a, s32 b, s32 c) { return ((b * 6 - a) + c * 7) / 12; }","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L531-L531","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856F8\n\t.type\t sa2__sub_80856F8,function\n\t.thumb_func\nsa2__sub_80856F8:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r3\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856F8,.Lfe1-sa2__sub_80856F8\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 sa2__sub_80856F8(s32 a0, s32 a1, s32 a2) {\n return (a1 * 6 - a0 + a2 * 7) / 12;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sa2__sub_80856F8(s32 arg0, s32 arg1, s32 arg2) {\n return (s32) (((arg1 * 6) - arg0) + (arg2 * 7)) / 12;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80856F8` — benchmark function sa3:sa2__sub_80856F8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856F8\n\t.type\t sa2__sub_80856F8,function\n\t.thumb_func\nsa2__sub_80856F8:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r3\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856F8,.Lfe1-sa2__sub_80856F8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80856F8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80856F8` — benchmark function sa3:sa2__sub_80856F8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80856F8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856F8\n\t.type\t sa2__sub_80856F8,function\n\t.thumb_func\nsa2__sub_80856F8:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r3\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856F8,.Lfe1-sa2__sub_80856F8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80856F8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8085714:agbcc","sym":"sa2__sub_8085714","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","shift"],"loc":1,"refSource":"s32 SA2_LABEL(sub_8085714)(s32 a, s32 b, s32 c) { return ((a + b * 8) - c) >> 3; }","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L533-L533","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085714\n\t.type\t sa2__sub_8085714,function\n\t.thumb_func\nsa2__sub_8085714:\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r0, r1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085714,.Lfe1-sa2__sub_8085714\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 sa2__sub_8085714(s32 a0, s32 a1, s32 a2) {\n return a0 + (a1 << 3) - a2 >> 3;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sa2__sub_8085714(s32 arg0, s32 arg1, s32 arg2) {\n return (s32) ((arg0 + (arg1 * 8)) - arg2) >> 3;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085714` — benchmark function sa3:sa2__sub_8085714:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085714\n\t.type\t sa2__sub_8085714,function\n\t.thumb_func\nsa2__sub_8085714:\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r0, r1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085714,.Lfe1-sa2__sub_8085714\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085714 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085714` — benchmark function sa3:sa2__sub_8085714:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085714:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085714\n\t.type\t sa2__sub_8085714,function\n\t.thumb_func\nsa2__sub_8085714:\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r0, r1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085714,.Lfe1-sa2__sub_8085714\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085714 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8085720:agbcc","sym":"sa2__sub_8085720","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","shift"],"loc":1,"refSource":"s32 SA2_LABEL(sub_8085720)(s32 a, s32 b, s32 c) { return ((b * 8 - a) + c) >> 3; }","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L535-L535","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085720\n\t.type\t sa2__sub_8085720,function\n\t.thumb_func\nsa2__sub_8085720:\n\tlsl\tr1, r1, #0x3\n\tsub\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tasr\tr1, r1, #0x3\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085720,.Lfe1-sa2__sub_8085720\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 sa2__sub_8085720(s32 a0, s32 a1, s32 a2) {\n return (a1 << 3) - a0 + a2 >> 3;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sa2__sub_8085720(s32 arg0, s32 arg1, s32 arg2) {\n return (s32) (((arg1 * 8) - arg0) + arg2) >> 3;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085720` — benchmark function sa3:sa2__sub_8085720:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085720\n\t.type\t sa2__sub_8085720,function\n\t.thumb_func\nsa2__sub_8085720:\n\tlsl\tr1, r1, #0x3\n\tsub\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tasr\tr1, r1, #0x3\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085720,.Lfe1-sa2__sub_8085720\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085720 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085720` — benchmark function sa3:sa2__sub_8085720:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085720:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085720\n\t.type\t sa2__sub_8085720,function\n\t.thumb_func\nsa2__sub_8085720:\n\tlsl\tr1, r1, #0x3\n\tsub\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tasr\tr1, r1, #0x3\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085720,.Lfe1-sa2__sub_8085720\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085720 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8085758:agbcc","sym":"sa2__sub_8085758","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"s32 SA2_LABEL(sub_8085758)(s32 a, s32 b) { return b - a; }","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L539-L539","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085758\n\t.type\t sa2__sub_8085758,function\n\t.thumb_func\nsa2__sub_8085758:\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085758,.Lfe1-sa2__sub_8085758\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 sa2__sub_8085758(u32 a0, u32 a1) {\n return a1 - a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sa2__sub_8085758(s32 arg0, s32 arg1) {\n return arg1 - arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085758` — benchmark function sa3:sa2__sub_8085758:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085758\n\t.type\t sa2__sub_8085758,function\n\t.thumb_func\nsa2__sub_8085758:\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085758,.Lfe1-sa2__sub_8085758\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085758 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085758` — benchmark function sa3:sa2__sub_8085758:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085758:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085758\n\t.type\t sa2__sub_8085758,function\n\t.thumb_func\nsa2__sub_8085758:\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085758,.Lfe1-sa2__sub_8085758\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085758 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8085798:agbcc","sym":"sa2__sub_8085798","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","shift"],"loc":1,"refSource":"s32 SA2_LABEL(sub_8085798)(s32 a, s32 b, s32 c) { return ((c - a) + ((c - a) >> 1)) - (b >> 1); }","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L549-L549","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085798\n\t.type\t sa2__sub_8085798,function\n\t.thumb_func\nsa2__sub_8085798:\n\tsub\tr0, r2, r0\n\tasr\tr2, r0, #0x1\n\tadd\tr0, r0, r2\n\tasr\tr1, r1, #0x1\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085798,.Lfe1-sa2__sub_8085798\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 sa2__sub_8085798(s32 a0, s32 a1, s32 a2) {\n return a2 - a0 + (a2 - a0 >> 1) - (a1 >> 1);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sa2__sub_8085798(s32 arg0, s32 arg1, s32 arg2) {\n s32 temp_r0;\n\n temp_r0 = arg2 - arg0;\n return (temp_r0 + (temp_r0 >> 1)) - (arg1 >> 1);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085798` — benchmark function sa3:sa2__sub_8085798:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085798\n\t.type\t sa2__sub_8085798,function\n\t.thumb_func\nsa2__sub_8085798:\n\tsub\tr0, r2, r0\n\tasr\tr2, r0, #0x1\n\tadd\tr0, r0, r2\n\tasr\tr1, r1, #0x1\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085798,.Lfe1-sa2__sub_8085798\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085798 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085798` — benchmark function sa3:sa2__sub_8085798:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085798:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085798\n\t.type\t sa2__sub_8085798,function\n\t.thumb_func\nsa2__sub_8085798:\n\tsub\tr0, r2, r0\n\tasr\tr2, r0, #0x1\n\tadd\tr0, r0, r2\n\tasr\tr1, r1, #0x1\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085798,.Lfe1-sa2__sub_8085798\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085798 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_808595C:agbcc","sym":"sa2__sub_808595C","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","shift"],"loc":8,"refSource":"s32 SA2_LABEL(sub_808595C)(s32 a, s32 b, s32 c)\n{\n s32 e = (b - a);\n s32 f = (c - b);\n f -= e;\n f >>= 1;\n return e + f;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L580-L587","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808595C\n\t.type\t sa2__sub_808595C,function\n\t.thumb_func\nsa2__sub_808595C:\n\tsub\tr0, r1, r0\n\tsub\tr2, r2, r1\n\tsub\tr2, r2, r0\n\tasr\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_808595C,.Lfe1-sa2__sub_808595C\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 sa2__sub_808595C(s32 a0, s32 a1, s32 a2) {\n return a1 - a0 + (a2 - a1 - (a1 - a0) >> 1);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sa2__sub_808595C(s32 arg0, s32 arg1, s32 arg2) {\n s32 temp_r0;\n\n temp_r0 = arg1 - arg0;\n return temp_r0 + ((s32) ((arg2 - arg1) - temp_r0) >> 1);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_808595C` — benchmark function sa3:sa2__sub_808595C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808595C\n\t.type\t sa2__sub_808595C,function\n\t.thumb_func\nsa2__sub_808595C:\n\tsub\tr0, r1, r0\n\tsub\tr2, r2, r1\n\tsub\tr2, r2, r0\n\tasr\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_808595C,.Lfe1-sa2__sub_808595C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_808595C # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_808595C` — benchmark function sa3:sa2__sub_808595C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_808595C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808595C\n\t.type\t sa2__sub_808595C,function\n\t.thumb_func\nsa2__sub_808595C:\n\tsub\tr0, r1, r0\n\tsub\tr2, r2, r1\n\tsub\tr2, r2, r0\n\tasr\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_808595C,.Lfe1-sa2__sub_808595C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_808595C # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:SeedRng:agbcc","sym":"SeedRng","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","store"],"loc":5,"refSource":"void SeedRng(u32 a, u32 b)\n{\n gRngPrevValue = a;\n gRngValue = b;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L427-L431","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSeedRng\n\t.type\t SeedRng,function\n\t.thumb_func\nSeedRng:\n\tldr\tr2, .L3\n\tstr\tr0, [r2]\n\tldr\tr0, .L3+0x4\n\tstr\tr1, [r0]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n.Lfe1:\n\t.size\t SeedRng,.Lfe1-SeedRng\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\n","proto":{"SeedRng":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gRngPrevValue","shape":"scalar u32"},{"name":"gRngValue","shape":"scalar u32"}],"outcome":"match","source":"void SeedRng(u32 a0, u32 a1) {\n gRngPrevValue = a0;\n gRngValue = a1;\n return;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"extern s32 gRngPrevValue;\nextern s32 gRngValue;\n\nvoid SeedRng(s32 arg0, s32 arg1) {\n gRngPrevValue = arg0;\n gRngValue = arg1;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `SeedRng` — benchmark function sa3:SeedRng:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSeedRng\n\t.type\t SeedRng,function\n\t.thumb_func\nSeedRng:\n\tldr\tr2, .L3\n\tstr\tr0, [r2]\n\tldr\tr0, .L3+0x4\n\tstr\tr1, [r0]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n.Lfe1:\n\t.size\t SeedRng,.Lfe1-SeedRng\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function SeedRng # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `SeedRng` — benchmark function sa3:SeedRng:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:SeedRng:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSeedRng\n\t.type\t SeedRng,function\n\t.thumb_func\nSeedRng:\n\tldr\tr2, .L3\n\tstr\tr0, [r2]\n\tldr\tr0, .L3+0x4\n\tstr\tr1, [r0]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n.Lfe1:\n\t.size\t SeedRng,.Lfe1-SeedRng\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"SeedRng\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name SeedRng # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:VerifyFlashSector_Core:agbcc","sym":"VerifyFlashSector_Core","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","cast","branch"],"loc":9,"refSource":"u32 VerifyFlashSector_Core(u8 *src, u8 *tgt, u32 size)\n{\n while (size-- != 0) {\n if (*tgt++ != *src++)\n return (uintptr_t)(tgt - 1);\n }\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/lib/agb_flash/agb_flash.c#L286-L294","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVerifyFlashSector_Core\n\t.type\t VerifyFlashSector_Core,function\n\t.thumb_func\nVerifyFlashSector_Core:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr2, r2, #0x1\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr2, r0\n\tbeq\t.L4\t@cond_branch\n\tadd\tr5, r0, #0\n.L5:\n\tldrb\tr1, [r3]\n\tldrb\tr0, [r4]\n\tadd\tr4, r4, #0x1\n\tadd\tr3, r3, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r3, #0x1\n\tb\t.L8\n.L3:\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, r5\n\tbne\t.L5\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L8:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t VerifyFlashSector_Core,.Lfe1-VerifyFlashSector_Core\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"u8 * VerifyFlashSector_Core(u8 * a0, u8 * a1, u32 a2) {\n u8 * v0;\n u8 * v1;\n s32 v2;\n if (a2 - 1 != -1) {\n v0 = a1;\n v1 = a0;\n v2 = a2 - 1;\n while (*v0 == *v1) {\n v0 = v0 + 1;\n v1 = v1 + 1;\n v2 = v2 - 1;\n if (v2 == -1) return (u8 *)0;\n }\n return v0 + 1 - 1;\n } else {\n return (u8 *)0;\n }\n}\n","score":19,"maxScore":27,"compileErrors":null,"breakdown":{"insert":3,"delete":3,"replace":3,"opMismatch":2,"argMismatch":8},"quality":{"score":100,"lines":19,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 VerifyFlashSector_Core(u8 *arg0, u8 *arg1, s32 arg2) {\n s32 var_r2;\n u8 *var_r3;\n u8 *var_r4;\n u8 temp_r0;\n u8 temp_r1;\n\n var_r4 = arg0;\n var_r3 = arg1;\n var_r2 = arg2 - 1;\n if (var_r2 != -1) {\nloop_2:\n temp_r1 = *var_r3;\n temp_r0 = *var_r4;\n var_r4 += 1;\n var_r3 += 1;\n if (temp_r1 != temp_r0) {\n return var_r3 - 1;\n }\n var_r2 -= 1;\n if (var_r2 == -1) {\n goto block_5;\n }\n goto loop_2;\n }\nblock_5:\n return 0;\n}\n","score":28,"maxScore":35,"compileErrors":null,"breakdown":{"insert":11,"delete":12,"replace":1,"opMismatch":1,"argMismatch":3},"quality":{"score":76,"lines":27,"gotos":2,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":19,"maxScore":27,"ratio":0.7037037037037037,"kinds":{"insert":3,"delete":3,"replace":3,"opMismatch":2,"argMismatch":8}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `VerifyFlashSector_Core` — benchmark function sa3:VerifyFlashSector_Core:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVerifyFlashSector_Core\n\t.type\t VerifyFlashSector_Core,function\n\t.thumb_func\nVerifyFlashSector_Core:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr2, r2, #0x1\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr2, r0\n\tbeq\t.L4\t@cond_branch\n\tadd\tr5, r0, #0\n.L5:\n\tldrb\tr1, [r3]\n\tldrb\tr0, [r4]\n\tadd\tr4, r4, #0x1\n\tadd\tr3, r3, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r3, #0x1\n\tb\t.L8\n.L3:\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, r5\n\tbne\t.L5\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L8:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t VerifyFlashSector_Core,.Lfe1-VerifyFlashSector_Core\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function VerifyFlashSector_Core # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `VerifyFlashSector_Core` — benchmark function sa3:VerifyFlashSector_Core:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:VerifyFlashSector_Core:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVerifyFlashSector_Core\n\t.type\t VerifyFlashSector_Core,function\n\t.thumb_func\nVerifyFlashSector_Core:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr2, r2, #0x1\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr2, r0\n\tbeq\t.L4\t@cond_branch\n\tadd\tr5, r0, #0\n.L5:\n\tldrb\tr1, [r3]\n\tldrb\tr0, [r4]\n\tadd\tr4, r4, #0x1\n\tadd\tr3, r3, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r3, #0x1\n\tb\t.L8\n.L3:\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, r5\n\tbne\t.L5\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L8:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t VerifyFlashSector_Core,.Lfe1-VerifyFlashSector_Core\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VerifyFlashSector_Core # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:VramGetTotalAllocatedTiles:agbcc","sym":"VramGetTotalAllocatedTiles","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","global","array","branch"],"loc":14,"refSource":"u16 VramGetTotalAllocatedTiles(void)\n{\n u16 i;\n u16 count = 0;\n\n for (i = 0; i < gVramHeapMaxTileSlots / VRAM_TILE_SLOTS_PER_SEGMENT; ++i) {\n if (gVramHeapState[i]) {\n count += gVramHeapState[i];\n i = gVramHeapState[i] - 1 + i; // next slot to check, -1 because of ++i\n }\n }\n return count * VRAM_TILE_SLOTS_PER_SEGMENT;\n}\n","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_vram.c#L46-L58","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramGetTotalAllocatedTiles\n\t.type\t VramGetTotalAllocatedTiles,function\n\t.thumb_func\nVramGetTotalAllocatedTiles:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tldr\tr0, .L9\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L9+0x4\n\tadd\tr4, r0, #0\n\tldr\tr0, .L9+0x8\n\tadd\tr5, r0, #0\n.L6:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, r5\n\tadd\tr0, r1, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tcmp\tr2, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tlsl\tr0, r3, #0x12\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\t0xffff\n.Lfe1:\n\t.size\t VramGetTotalAllocatedTiles,.Lfe1-VramGetTotalAllocatedTiles\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-648ffdb40ca9.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gVramHeapMaxTileSlots","shape":"scalar u16"},{"name":"gVramHeapState","shape":"u16[]"}],"outcome":"nonmatch","source":"s32 VramGetTotalAllocatedTiles(void) {\n s32 v0;\n s32 v1;\n s32 v2;\n v0 = gVramHeapMaxTileSlots;\n if (0 >= v0 >> 2) {\n v2 = 0;\n } else {\n v1 = 0;\n v2 = 0;\n do {\n if (gVramHeapState[v1] != 0) {\n v2 = (u16)(v2 + gVramHeapState[v1]);\n v1 = (u16)(gVramHeapState[v1] + (v1 + 65535));\n }\n v1 = (u16)(v1 + 1);\n } while (v1 < v0 >> 2);\n }\n return v2 << 18 >> 16;\n}\n","score":25,"maxScore":43,"compileErrors":null,"breakdown":{"insert":6,"delete":4,"replace":2,"opMismatch":2,"argMismatch":11},"quality":{"score":96,"lines":20,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u16 VramGetTotalAllocatedTiles(void) {\n u16 temp_r1;\n u16 var_r2;\n u16 var_r3;\n u32 temp_r0;\n\n var_r3 = 0;\n var_r2 = 0;\n temp_r0 = (u16) gVramHeapMaxTileSlots >> 2;\n if (temp_r0 > 0U) {\n do {\n temp_r1 = gVramHeapState[var_r2];\n if (temp_r1 != 0) {\n var_r3 += temp_r1;\n var_r2 = temp_r1 + (var_r2 + 0xFFFF);\n }\n var_r2 += 1;\n } while ((u32) var_r2 < temp_r0);\n }\n return (u16) (var_r3 * 4);\n}\n","score":16,"maxScore":38,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":1,"opMismatch":2,"argMismatch":11},"quality":{"score":96,"lines":20,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":16,"maxScore":38,"ratio":0.42105263157894735,"kinds":{"insert":1,"delete":1,"replace":1,"opMismatch":2,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `VramGetTotalAllocatedTiles` — benchmark function sa3:VramGetTotalAllocatedTiles:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramGetTotalAllocatedTiles\n\t.type\t VramGetTotalAllocatedTiles,function\n\t.thumb_func\nVramGetTotalAllocatedTiles:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tldr\tr0, .L9\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L9+0x4\n\tadd\tr4, r0, #0\n\tldr\tr0, .L9+0x8\n\tadd\tr5, r0, #0\n.L6:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, r5\n\tadd\tr0, r1, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tcmp\tr2, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tlsl\tr0, r3, #0x12\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\t0xffff\n.Lfe1:\n\t.size\t VramGetTotalAllocatedTiles,.Lfe1-VramGetTotalAllocatedTiles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-648ffdb40ca9.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu16 VramGetTotalAllocatedTiles(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function VramGetTotalAllocatedTiles # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `VramGetTotalAllocatedTiles` — benchmark function sa3:VramGetTotalAllocatedTiles:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:VramGetTotalAllocatedTiles:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramGetTotalAllocatedTiles\n\t.type\t VramGetTotalAllocatedTiles,function\n\t.thumb_func\nVramGetTotalAllocatedTiles:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tldr\tr0, .L9\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L9+0x4\n\tadd\tr4, r0, #0\n\tldr\tr0, .L9+0x8\n\tadd\tr5, r0, #0\n.L6:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, r5\n\tadd\tr0, r1, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tcmp\tr2, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tlsl\tr0, r3, #0x12\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\t0xffff\n.Lfe1:\n\t.size\t VramGetTotalAllocatedTiles,.Lfe1-VramGetTotalAllocatedTiles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VramGetTotalAllocatedTiles # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:VramMalloc:agbcc","sym":"VramMalloc","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","nested","global","array","branch","pointer"],"loc":27,"refSource":"void *VramMalloc(u32 numTiles)\n{\n u16 i, j;\n u32 count = numTiles;\n count = (count + (VRAM_TILE_SLOTS_PER_SEGMENT - 1)) / VRAM_TILE_SLOTS_PER_SEGMENT; // round up\n\n for (i = 0; i < gVramHeapMaxTileSlots / VRAM_TILE_SLOTS_PER_SEGMENT; i++) {\n if (gVramHeapState[i] == 0) {\n for (j = 0; j < count; j++) {\n if (i + j >= (gVramHeapMaxTileSlots / VRAM_TILE_SLOTS_PER_SEGMENT)) {\n return ewram_end;\n }\n if (gVramHeapState[i + j] != 0) {\n break;\n }\n }\n\n if (j == count) {\n gVramHeapState[i] = count;\n return (void *)(gVramHeapStartAddr + i * VRAM_HEAP_SEGMENT_SIZE);\n }\n } else {\n i = (gVramHeapState[i] - 1) + i; // next slot to check, -1 because of ++i\n }\n }\n return ewram_end;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_vram.c#L5-L31","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramMalloc\n\t.type\t VramMalloc,function\n\t.thumb_func\nVramMalloc:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tr5, r0, #0\n\tadd\tr0, r5, #0x3\n\tlsr\tr5, r0, #0x2\n\tmov\tr4, #0x0\n\tldr\tr1, .L20\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tmov\tr9, r1\n\tcmp\tr4, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tmov\tr8, r0\n.L6:\n\tlsl\tr1, r4, #0x1\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tldrh\tr2, [r0]\n\tcmp\tr2, #0\n\tbne\t.L7\t@cond_branch\n\tmov\tr3, #0x0\n\tldr\tr7, .L20\n\tmov\tip, r7\n\tldr\tr0, .L20+0x4\n\tmov\tsl, r0\n\tldr\tr6, .L20+0x8\n\tb\t.L8\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\tewram_end\n.L10:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n.L8:\n\tcmp\tr3, r5\n\tbcs\t.L9\t@cond_branch\n\tadd\tr2, r4, r3\n\tmov\tr7, ip\n\tldrh\tr0, [r7]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr2, r0\n\tblt\t.L12\t@cond_branch\n\tldr\tr0, [r6]\n\tb\t.L19\n.L12:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, sl\n\tldrh\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n.L9:\n\tcmp\tr3, r5\n\tbne\t.L5\t@cond_branch\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tstrh\tr5, [r0]\n\tldr\tr0, .L22\n\tlsl\tr1, r4, #0x7\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tb\t.L19\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgVramHeapStartAddr\n.L7:\n\tldr\tr7, .L24\n\tadd\tr0, r4, r7\n\tadd\tr0, r2, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr1, r9\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr4, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L24+0x4\n\tldr\tr0, [r0]\n.L19:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\t0xffff\n\t.word\tewram_end\n.Lfe1:\n\t.size\t VramMalloc,.Lfe1-VramMalloc\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-648ffdb40ca9.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'VramMalloc' — structure: cannot structure 'VramMalloc': unrecovered back-edge into block #5 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tVramMalloc */\n/* \t.type\t VramMalloc,function */\n/* \t.thumb_func */\n/* VramMalloc: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, sl */\n/* \tmov\tr6, r9 */\n/* \tmov\tr5, r8 */\n/* \tpush\t{r5, r6, r7} */\n/* \tadd\tr5, r0, #0 */\n/* \tadd\tr0, r5, #0x3 */\n/* \tlsr\tr5, r0, #0x2 */\n/* \tmov\tr4, #0x0 */\n/* \tldr\tr1, .L20 */\n/* \tldrh\tr0, [r1] */\n/* \tlsr\tr0, r0, #0x2 */\n/* \tmov\tr9, r1 */\n/* \tcmp\tr4, r0 */\n/* \tbcs\t.L4\t@cond_branch */\n/* \tldr\tr0, .L20+0x4 */\n/* \tmov\tr8, r0 */\n/* .L6: */\n/* \tlsl\tr1, r4, #0x1 */\n/* \tmov\tr2, r8 */\n/* \tadd\tr0, r1, r2 */\n/* \tldrh\tr2, [r0] */\n/* \tcmp\tr2, #0 */\n/* \tbne\t.L7\t@cond_branch */\n/* \tmov\tr3, #0x0 */\n/* \tldr\tr7, .L20 */\n/* \tmov\tip, r7 */\n/* \tldr\tr0, .L20+0x4 */\n/* \tmov\tsl, r0 */\n/* \tldr\tr6, .L20+0x8 */\n/* \tb\t.L8 */\n/* .L21: */\n/* \t.align\t2, 0 */\n/* .L20: */\n/* \t.word\tgVramHeapMaxTileSlots */\n/* \t.word\tgVramHeapState */\n/* \t.word\tewram_end */\n/* .L10: */\n/* \tadd\tr0, r3, #0x1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr3, r0, #0x10 */\n/* .L8: */\n/* \tcmp\tr3, r5 */\n/* \tbcs\t.L9\t@cond_branch */\n/* \tadd\tr2, r4, r3 */\n/* \tmov\tr7, ip */\n/* \tldrh\tr0, [r7] */\n/* \tlsr\tr0, r0, #0x2 */\n/* \tcmp\tr2, r0 */\n/* \tblt\t.L12\t@cond_branch */\n/* \tldr\tr0, [r6] */\n/* \tb\t.L19 */\n/* .L12: */\n/* \tlsl\tr0, r2, #0x1 */\n/* \tadd\tr0, r0, sl */\n/* \tldrh\tr0, [r0] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L10\t@cond_branch */\n/* .L9: */\n/* \tcmp\tr3, r5 */\n/* \tbne\t.L5\t@cond_branch */\n/* \tmov\tr2, r8 */\n/* \tadd\tr0, r1, r2 */\n/* \tstrh\tr5, [r0] */\n/* \tldr\tr0, .L22 */\n/* \tlsl\tr1, r4, #0x7 */\n/* \tldr\tr0, [r0] */\n/* \tadd\tr0, r0, r1 */\n/* \tb\t.L19 */\n/* .L23: */\n/* \t.align\t2, 0 */\n/* .L22: */\n/* \t.word\tgVramHeapStartAddr */\n/* .L7: */\n/* \tldr\tr7, .L24 */\n/* \tadd\tr0, r4, r7 */\n/* \tadd\tr0, r2, r0 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr4, r0, #0x10 */\n/* .L5: */\n/* \tadd\tr0, r4, #0x1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr4, r0, #0x10 */\n/* \tmov\tr1, r9 */\n/* \tldrh\tr0, [r1] */\n/* \tlsr\tr0, r0, #0x2 */\n/* \tcmp\tr4, r0 */\n/* \tbcc\t.L6\t@cond_branch */\n/* .L4: */\n/* \tldr\tr0, .L24+0x4 */\n/* \tldr\tr0, [r0] */\n/* .L19: */\n/* \tpop\t{r3, r4, r5} */\n/* \tmov\tr8, r3 */\n/* \tmov\tr9, r4 */\n/* \tmov\tsl, r5 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .L25: */\n/* \t.align\t2, 0 */\n/* .L24: */\n/* \t.word\t0xffff */\n/* \t.word\tewram_end */\n/* .Lfe1: */\n/* \t.size\t VramMalloc,.Lfe1-VramMalloc */\n/* .text */\n/* \t.align\t2, 0 */\nvoid VramMalloc(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'VramMalloc': unrecovered back-edge into block #5 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":122,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'VramMalloc': unrecovered back-edge into block #5 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void *VramMalloc(u32 numTiles) {\n s32 temp_r2_2;\n u16 temp_r2;\n u16 var_r4;\n u32 temp_r5;\n u32 var_r3;\n\n temp_r5 = (u32) (numTiles + 3) >> 2;\n var_r4 = 0;\n if ((u32) ((u16) gVramHeapMaxTileSlots >> 2) > 0U) {\nloop_2:\n temp_r2 = gVramHeapState[var_r4];\n if (temp_r2 == 0) {\n var_r3 = 0;\nloop_5:\n if (var_r3 < temp_r5) {\n temp_r2_2 = var_r4 + var_r3;\n if (temp_r2_2 >= (s32) ((u16) gVramHeapMaxTileSlots >> 2)) {\n return ewram_end;\n }\n if (gVramHeapState[temp_r2_2] != 0) {\n goto block_9;\n }\n var_r3 = (u32) (u16) (var_r3 + 1);\n goto loop_5;\n }\nblock_9:\n if (var_r3 == temp_r5) {\n gVramHeapState[var_r4] = (u16) temp_r5;\n return gVramHeapStartAddr + (var_r4 << 7);\n }\n goto block_12;\n }\n var_r4 = temp_r2 + (var_r4 + 0xFFFF);\nblock_12:\n var_r4 += 1;\n if ((u32) var_r4 >= (u32) ((u16) gVramHeapMaxTileSlots >> 2)) {\n goto block_13;\n }\n goto loop_2;\n }\nblock_13:\n return ewram_end;\n}\n","score":63,"maxScore":95,"compileErrors":null,"breakdown":{"insert":9,"delete":28,"replace":1,"opMismatch":5,"argMismatch":20},"quality":{"score":52,"lines":43,"gotos":5,"casts":11,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":63,"maxScore":95,"ratio":0.6631578947368421,"kinds":{"insert":9,"delete":28,"replace":1,"opMismatch":5,"argMismatch":20}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `VramMalloc` — benchmark function sa3:VramMalloc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramMalloc\n\t.type\t VramMalloc,function\n\t.thumb_func\nVramMalloc:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tr5, r0, #0\n\tadd\tr0, r5, #0x3\n\tlsr\tr5, r0, #0x2\n\tmov\tr4, #0x0\n\tldr\tr1, .L20\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tmov\tr9, r1\n\tcmp\tr4, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tmov\tr8, r0\n.L6:\n\tlsl\tr1, r4, #0x1\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tldrh\tr2, [r0]\n\tcmp\tr2, #0\n\tbne\t.L7\t@cond_branch\n\tmov\tr3, #0x0\n\tldr\tr7, .L20\n\tmov\tip, r7\n\tldr\tr0, .L20+0x4\n\tmov\tsl, r0\n\tldr\tr6, .L20+0x8\n\tb\t.L8\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\tewram_end\n.L10:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n.L8:\n\tcmp\tr3, r5\n\tbcs\t.L9\t@cond_branch\n\tadd\tr2, r4, r3\n\tmov\tr7, ip\n\tldrh\tr0, [r7]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr2, r0\n\tblt\t.L12\t@cond_branch\n\tldr\tr0, [r6]\n\tb\t.L19\n.L12:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, sl\n\tldrh\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n.L9:\n\tcmp\tr3, r5\n\tbne\t.L5\t@cond_branch\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tstrh\tr5, [r0]\n\tldr\tr0, .L22\n\tlsl\tr1, r4, #0x7\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tb\t.L19\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgVramHeapStartAddr\n.L7:\n\tldr\tr7, .L24\n\tadd\tr0, r4, r7\n\tadd\tr0, r2, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr1, r9\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr4, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L24+0x4\n\tldr\tr0, [r0]\n.L19:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\t0xffff\n\t.word\tewram_end\n.Lfe1:\n\t.size\t VramMalloc,.Lfe1-VramMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-648ffdb40ca9.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *VramMalloc(u32 numTiles);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function VramMalloc # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `VramMalloc` — benchmark function sa3:VramMalloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: ef3d67ad1b424bcfe605cc70dc427f0f5b29654398a54506bcad670196f3a639\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:VramMalloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramMalloc\n\t.type\t VramMalloc,function\n\t.thumb_func\nVramMalloc:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tr5, r0, #0\n\tadd\tr0, r5, #0x3\n\tlsr\tr5, r0, #0x2\n\tmov\tr4, #0x0\n\tldr\tr1, .L20\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tmov\tr9, r1\n\tcmp\tr4, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tmov\tr8, r0\n.L6:\n\tlsl\tr1, r4, #0x1\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tldrh\tr2, [r0]\n\tcmp\tr2, #0\n\tbne\t.L7\t@cond_branch\n\tmov\tr3, #0x0\n\tldr\tr7, .L20\n\tmov\tip, r7\n\tldr\tr0, .L20+0x4\n\tmov\tsl, r0\n\tldr\tr6, .L20+0x8\n\tb\t.L8\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\tewram_end\n.L10:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n.L8:\n\tcmp\tr3, r5\n\tbcs\t.L9\t@cond_branch\n\tadd\tr2, r4, r3\n\tmov\tr7, ip\n\tldrh\tr0, [r7]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr2, r0\n\tblt\t.L12\t@cond_branch\n\tldr\tr0, [r6]\n\tb\t.L19\n.L12:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, sl\n\tldrh\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n.L9:\n\tcmp\tr3, r5\n\tbne\t.L5\t@cond_branch\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tstrh\tr5, [r0]\n\tldr\tr0, .L22\n\tlsl\tr1, r4, #0x7\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tb\t.L19\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgVramHeapStartAddr\n.L7:\n\tldr\tr7, .L24\n\tadd\tr0, r4, r7\n\tadd\tr0, r2, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr1, r9\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr4, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L24+0x4\n\tldr\tr0, [r0]\n.L19:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\t0xffff\n\t.word\tewram_end\n.Lfe1:\n\t.size\t VramMalloc,.Lfe1-VramMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VramMalloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80014440_15040:gcc2.7.2kmc","sym":"func_80014440_15040","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","global","array"],"loc":8,"refSource":"void func_80014440_15040(void) {\n s32 i;\n\n gDefaultFontPalette[0] = 0;\n for (i = 1; i < 256; i++) {\n gDefaultFontPalette[i] = 0xFFFF;\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/10AD0.c#L32-L39","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\taddiu\tv0,v0,0\n 8:\tsh\tzero,0(v0)\n c:\tli\ta0,1\n 10:\tli\ta1,0xffff\n 14:\taddiu\tv1,v0,2\n 18:\tsh\ta1,0(v1)\n 1c:\taddiu\ta0,a0,1\n 20:\tslti\tv0,a0,256\n 24:\tbnez\tv0,18 \n 28:\taddiu\tv1,v1,2\n 2c:\tjr\tra\n 30:\tnop\n\t...\n","proto":{"func_80014440_15040":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-4d63b4a654117c31/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_80014440_15040\n00000000 *UND*\t00000000 gDefaultFontPalette\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gDefaultFontPalette\n00000004 R_MIPS_LO16 gDefaultFontPalette\n\n\nContents of section .text:\n 0000 3c020000 24420000 a4400000 24040001 <...$B...@..$...\n 0010 3405ffff 24430002 a4650000 24840001 4...$C...e..$...\n 0020 28820100 1440fffc 24630002 03e00008 (....@..$c......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gDefaultFontPalette"}],"outcome":"nonmatch","source":"void func_80014440_15040(void) {\n u16 * v0;\n s32 v1;\n *(u16 *)&gDefaultFontPalette = 0;\n v1 = 1;\n v0 = (u16 *)((u32)&gDefaultFontPalette + 2);\n do {\n *v0 = 65535;\n v1 = v1 + 1;\n v0 = v0 + 1;\n } while (v1 < 256);\n return;\n}\n","score":2,"maxScore":14,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":98,"lines":13,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern s16 gDefaultFontPalette;\n\nvoid func_80014440_15040(void) {\n s16 *var_v1;\n s32 var_a0;\n\n gDefaultFontPalette = 0;\n var_a0 = 1;\n var_v1 = &gDefaultFontPalette + 2;\n do {\n *var_v1 = 0xFFFF;\n var_a0 += 1;\n var_v1 += 2;\n } while (var_a0 < 0x100);\n}\n","score":8,"maxScore":14,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":1,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":13,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/10AD0.c: fills a font palette global; index 0 cleared, rest set to white","gapSize":{"decompiler":"asmlift","score":2,"maxScore":14,"ratio":0.14285714285714285,"kinds":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80014440_15040` — benchmark function snowboardkids2:func_80014440_15040:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80014440_15040\n lui\t$v0, %hi(gDefaultFontPalette)\n addiu\t$v0, $v0, %lo(gDefaultFontPalette)\n sh\t$zero, 0($v0)\n li\t$a0, 1\n li\t$a1, 0xffff\n addiu\t$v1, $v0, 2\n.L18:\n sh\t$a1, 0($v1)\n addiu\t$a0, $a0, 1\n slti\t$v0, $a0, 256\n bnez\t$v0, .L18\n addiu\t$v1, $v1, 2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80014440_15040 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80014440_15040` — benchmark function snowboardkids2:func_80014440_15040:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80014440_15040:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\taddiu\tv0,v0,0\n 8:\tsh\tzero,0(v0)\n c:\tli\ta0,1\n 10:\tli\ta1,0xffff\n 14:\taddiu\tv1,v0,2\n 18:\tsh\ta1,0(v1)\n 1c:\taddiu\ta0,a0,1\n 20:\tslti\tv0,a0,256\n 24:\tbnez\tv0,18 \n 28:\taddiu\tv1,v1,2\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-4d63b4a654117c31/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_80014440_15040\n00000000 *UND*\t00000000 gDefaultFontPalette\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gDefaultFontPalette\n00000004 R_MIPS_LO16 gDefaultFontPalette\n\n\nContents of section .text:\n 0000 3c020000 24420000 a4400000 24040001 <...$B...@..$...\n 0010 3405ffff 24430002 a4650000 24840001 4...$C...e..$...\n 0020 28820100 1440fffc 24630002 03e00008 (....@..$c......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80014440_15040\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80014440_15040 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc","sym":"func_800154A8_160A8","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","branch","call"],"loc":15,"refSource":"void func_800154A8_160A8(s8 *arg0, u16 arg1) {\n s32 end;\n s32 ptr;\n\n if (arg1 == 0) {\n return;\n }\n\n ptr = (s32)arg0;\n end = arg1 + ptr;\n do {\n *(s8 *)ptr = 0;\n ptr++;\n } while (ptr < end);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/15690.c#L304-L318","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta1,a1,0xffff\n 4:\tbeqz\ta1,24 \n 8:\tnop\n c:\taddu\ta1,a1,a0\n 10:\tsb\tzero,0(a0)\n 14:\taddiu\ta0,a0,1\n 18:\tslt\tv0,a0,a1\n 1c:\tbnezl\tv0,14 \n 20:\tsb\tzero,0(a0)\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dd25ecd019108913/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_800154A8_160A8\n\n\nContents of section .text:\n 0000 30a5ffff 10a00007 00000000 00a42821 0.............(!\n 0010 a0800000 24840001 0085102a 5440fffd ....$......*T@..\n 0020 a0800000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800154A8_160A8' — lift: cannot lift 'func_800154A8_160A8': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tandi\ta1,a1,0xffff */\n/* 4:\tbeqz\ta1,24 */\n/* 8:\tnop */\n/* c:\taddu\ta1,a1,a0 */\n/* 10:\tsb\tzero,0(a0) */\n/* 14:\taddiu\ta0,a0,1 */\n/* 18:\tslt\tv0,a0,a1 */\n/* 1c:\tbnezl\tv0,14 */\n/* 20:\tsb\tzero,0(a0) */\n/* 24:\tjr\tra */\n/* 28:\tnop */\n/* 2c:\tnop */\nvoid func_800154A8_160A8(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800154A8_160A8': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800154A8_160A8': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_800154A8_160A8(s8 *arg0, s32 arg1) {\n s32 temp_a1;\n s32 temp_a1_2;\n s8 *var_a0;\n\n var_a0 = arg0;\n temp_a1 = arg1 & 0xFFFF;\n if (temp_a1 != 0) {\n temp_a1_2 = temp_a1 + var_a0;\n do {\n *var_a0 = 0;\n var_a0 += 1;\n } while ((s32) var_a0 < temp_a1_2);\n }\n}\n","score":1,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":14,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":1,"maxScore":11,"ratio":0.09090909090909091,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800154A8_160A8` — benchmark function snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800154A8_160A8\n andi\t$a1, $a1, 0xffff\n beqz\t$a1, .L24\n nop\n addu\t$a1, $a1, $a0\n sb\t$zero, 0($a0)\n.L14:\n addiu\t$a0, $a0, 1\n slt\t$v0, $a0, $a1\n bnezl\t$v0, .L14\n sb\t$zero, 0($a0)\n.L24:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800154A8_160A8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800154A8_160A8` — benchmark function snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta1,a1,0xffff\n 4:\tbeqz\ta1,24 \n 8:\tnop\n c:\taddu\ta1,a1,a0\n 10:\tsb\tzero,0(a0)\n 14:\taddiu\ta0,a0,1\n 18:\tslt\tv0,a0,a1\n 1c:\tbnezl\tv0,14 \n 20:\tsb\tzero,0(a0)\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dd25ecd019108913/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_800154A8_160A8\n\n\nContents of section .text:\n 0000 30a5ffff 10a00007 00000000 00a42821 0.............(!\n 0010 a0800000 24840001 0085102a 5440fffd ....$......*T@..\n 0020 a0800000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800154A8_160A8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc","sym":"func_800167B0_173B0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","struct","field","call"],"loc":16,"refSource":"void func_800167B0_173B0(Struct16728 *arg0) {\n if (arg0->unkC == 0) {\n arg0->unkD++;\n if ((arg0->unkD & 1) == 0) {\n arg0->unkE = (arg0->unkE + 1) & 1;\n arg0->unk8 = arg0->unkE + 7;\n }\n if (arg0->unkD == 0x10) {\n arg0->unkD = 0;\n arg0->unkC = 0x1E;\n }\n } else {\n arg0->unkC--;\n }\n debugEnqueueCallback(8, 1, func_8000FED0_10AD0, arg0);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/16FA0.c#L132-L147","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tmove\ta3,a0\n 8:\tsw\tra,16(sp)\n c:\tlbu\tv0,12(a3)\n 10:\tbnez\tv0,60 \n 14:\taddiu\tv0,v0,-1\n 18:\tlbu\tv0,13(a3)\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\tv0,13(a3)\n 24:\tandi\tv0,v0,0x1\n 28:\tbnez\tv0,48 \n 2c:\tnop\n 30:\tlbu\tv0,14(a3)\n 34:\taddiu\tv0,v0,1\n 38:\tandi\tv0,v0,0x1\n 3c:\tsb\tv0,14(a3)\n 40:\taddiu\tv0,v0,7\n 44:\tsh\tv0,8(a3)\n 48:\tlbu\tv1,13(a3)\n 4c:\tli\tv0,16\n 50:\tbne\tv1,v0,68 \n 54:\tli\ta0,8\n 58:\tli\tv0,30\n 5c:\tsb\tzero,13(a3)\n 60:\tsb\tv0,12(a3)\n 64:\tli\ta0,8\n 68:\tlui\ta2,0x0\n 6c:\taddiu\ta2,a2,0\n 70:\tjal\t0 \n 74:\tli\ta1,1\n 78:\tlw\tra,16(sp)\n 7c:\tjr\tra\n 80:\taddiu\tsp,sp,24\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-02e6b011bd38.i.gz","proto":{"func_800167B0_173B0":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0966834a6ef2f06d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800167B0_173B0\n00000000 *UND*\t00000000 func_8000FED0_10AD0\n00000000 *UND*\t00000000 debugEnqueueCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000068 R_MIPS_HI16 func_8000FED0_10AD0\n0000006c R_MIPS_LO16 func_8000FED0_10AD0\n00000070 R_MIPS_26 debugEnqueueCallback\n\n\nContents of section .text:\n 0000 27bdffe8 00803821 afbf0010 90e2000c '.....8!........\n 0010 14400013 2442ffff 90e2000d 24420001 .@..$B......$B..\n 0020 a0e2000d 30420001 14400007 00000000 ....0B...@......\n 0030 90e2000e 24420001 30420001 a0e2000e ....$B..0B......\n 0040 24420007 a4e20008 90e3000d 24020010 $B..........$...\n 0050 14620005 24040008 2402001e a0e0000d .b..$...$.......\n 0060 a0e2000c 24040008 3c060000 24c60000 ....$...<...$...\n 0070 0c000000 24050001 8fbf0010 03e00008 ....$...........\n 0080 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800167B0_173B0' — lift: cannot lift 'func_800167B0_173B0': function call 'jal' at 0x70 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tmove\ta3,a0 */\n/* 8:\tsw\tra,16(sp) */\n/* c:\tlbu\tv0,12(a3) */\n/* 10:\tbnez\tv0,60 */\n/* 14:\taddiu\tv0,v0,-1 */\n/* 18:\tlbu\tv0,13(a3) */\n/* 1c:\taddiu\tv0,v0,1 */\n/* 20:\tsb\tv0,13(a3) */\n/* 24:\tandi\tv0,v0,0x1 */\n/* 28:\tbnez\tv0,48 */\n/* 2c:\tnop */\n/* 30:\tlbu\tv0,14(a3) */\n/* 34:\taddiu\tv0,v0,1 */\n/* 38:\tandi\tv0,v0,0x1 */\n/* 3c:\tsb\tv0,14(a3) */\n/* 40:\taddiu\tv0,v0,7 */\n/* 44:\tsh\tv0,8(a3) */\n/* 48:\tlbu\tv1,13(a3) */\n/* 4c:\tli\tv0,16 */\n/* 50:\tbne\tv1,v0,68 */\n/* 54:\tli\ta0,8 */\n/* 58:\tli\tv0,30 */\n/* 5c:\tsb\tzero,13(a3) */\n/* 60:\tsb\tv0,12(a3) */\n/* 64:\tli\ta0,8 */\n/* 68:\tlui\ta2,0x0 */\n/* 6c:\taddiu\ta2,a2,0 */\n/* 70:\tjal\t0 */\n/* 74:\tli\ta1,1 */\n/* 78:\tlw\tra,16(sp) */\n/* 7c:\tjr\tra */\n/* 80:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid func_800167B0_173B0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800167B0_173B0': function call 'jal' at 0x70 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":42,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800167B0_173B0': function call 'jal' at 0x70 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_800167B0_173B0(Struct16728 *arg0) {\n u8 temp_v0;\n u8 temp_v0_2;\n u8 temp_v0_3;\n u8 var_v0;\n\n temp_v0 = arg0->unkC;\n var_v0 = temp_v0 - 1;\n if (temp_v0 == 0) {\n temp_v0_2 = arg0->unkD + 1;\n arg0->unkD = temp_v0_2;\n if (!(temp_v0_2 & 1)) {\n temp_v0_3 = (arg0->unkE + 1) & 1;\n arg0->unkE = temp_v0_3;\n arg0->unk8 = temp_v0_3 + 7;\n }\n if (arg0->unkD == 0x10) {\n var_v0 = 0x1E;\n arg0->unkD = 0;\n goto block_5;\n }\n } else {\nblock_5:\n arg0->unkC = var_v0;\n }\n debugEnqueueCallback(8U, 1U, func_8000FED0_10AD0, arg0);\n}\n","score":3,"maxScore":33,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":88,"lines":26,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/16FA0.c: animation ticker; toggles a frame index with bit math then re-enqueues itself","gapSize":{"decompiler":"m2c","score":3,"maxScore":33,"ratio":0.09090909090909091,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800167B0_173B0` — benchmark function snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800167B0_173B0\n addiu\t$sp, $sp, -24\n move\t$a3, $a0\n sw\t$ra, 16($sp)\n lbu\t$v0, 12($a3)\n bnez\t$v0, .L60\n addiu\t$v0, $v0, -1\n lbu\t$v0, 13($a3)\n addiu\t$v0, $v0, 1\n sb\t$v0, 13($a3)\n andi\t$v0, $v0, 0x1\n bnez\t$v0, .L48\n nop\n lbu\t$v0, 14($a3)\n addiu\t$v0, $v0, 1\n andi\t$v0, $v0, 0x1\n sb\t$v0, 14($a3)\n addiu\t$v0, $v0, 7\n sh\t$v0, 8($a3)\n.L48:\n lbu\t$v1, 13($a3)\n li\t$v0, 16\n bne\t$v1, $v0, .L68\n li\t$a0, 8\n li\t$v0, 30\n sb\t$zero, 13($a3)\n.L60:\n sb\t$v0, 12($a3)\n li\t$a0, 8\n.L68:\n lui\t$a2, %hi(func_8000FED0_10AD0)\n addiu\t$a2, $a2, %lo(func_8000FED0_10AD0)\n jal\tdebugEnqueueCallback\n li\t$a1, 1\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-02e6b011bd38.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800167B0_173B0(Struct16728 *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800167B0_173B0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800167B0_173B0` — benchmark function snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tmove\ta3,a0\n 8:\tsw\tra,16(sp)\n c:\tlbu\tv0,12(a3)\n 10:\tbnez\tv0,60 \n 14:\taddiu\tv0,v0,-1\n 18:\tlbu\tv0,13(a3)\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\tv0,13(a3)\n 24:\tandi\tv0,v0,0x1\n 28:\tbnez\tv0,48 \n 2c:\tnop\n 30:\tlbu\tv0,14(a3)\n 34:\taddiu\tv0,v0,1\n 38:\tandi\tv0,v0,0x1\n 3c:\tsb\tv0,14(a3)\n 40:\taddiu\tv0,v0,7\n 44:\tsh\tv0,8(a3)\n 48:\tlbu\tv1,13(a3)\n 4c:\tli\tv0,16\n 50:\tbne\tv1,v0,68 \n 54:\tli\ta0,8\n 58:\tli\tv0,30\n 5c:\tsb\tzero,13(a3)\n 60:\tsb\tv0,12(a3)\n 64:\tli\ta0,8\n 68:\tlui\ta2,0x0\n 6c:\taddiu\ta2,a2,0\n 70:\tjal\t0 \n 74:\tli\ta1,1\n 78:\tlw\tra,16(sp)\n 7c:\tjr\tra\n 80:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0966834a6ef2f06d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800167B0_173B0\n00000000 *UND*\t00000000 func_8000FED0_10AD0\n00000000 *UND*\t00000000 debugEnqueueCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000068 R_MIPS_HI16 func_8000FED0_10AD0\n0000006c R_MIPS_LO16 func_8000FED0_10AD0\n00000070 R_MIPS_26 debugEnqueueCallback\n\n\nContents of section .text:\n 0000 27bdffe8 00803821 afbf0010 90e2000c '.....8!........\n 0010 14400013 2442ffff 90e2000d 24420001 .@..$B......$B..\n 0020 a0e2000d 30420001 14400007 00000000 ....0B...@......\n 0030 90e2000e 24420001 30420001 a0e2000e ....$B..0B......\n 0040 24420007 a4e20008 90e3000d 24020010 $B..........$...\n 0050 14620005 24040008 2402001e a0e0000d .b..$...$.......\n 0060 a0e2000c 24040008 3c060000 24c60000 ....$...<...$...\n 0070 0c000000 24050001 8fbf0010 03e00008 ....$...........\n 0080 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800167B0_173B0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800167B0_173B0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc","sym":"func_80018DC0_199C0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","call","global","branch"],"loc":14,"refSource":"void func_80018DC0_199C0(void) {\n task_mem_199C0 *mem;\n\n mem = (task_mem_199C0 *)allocateTaskMemory(4);\n mem->unk2 = 0;\n mem->unk0 = 0;\n\n if (D_800A8CC8_A0038 != 4) {\n func_800574A0_580A0(2);\n }\n\n createTaskQueue(D_8008D78C_8E38C[D_800A8CC8_A0038], 0x5A);\n setGameStateHandler(func_80018E2C_19A2C);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/199C0.c#L16-L29","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tli\ta0,4\n 10:\tsb\tzero,2(v0)\n 14:\tlui\tv1,0x0\n 18:\tlbu\tv1,0(v1)\n 1c:\tsh\tzero,0(v0)\n 20:\tli\tv0,4\n 24:\tbeq\tv1,v0,34 \n 28:\tnop\n 2c:\tjal\t0 \n 30:\tli\ta0,2\n 34:\tlui\tv0,0x0\n 38:\tlbu\tv0,0(v0)\n 3c:\tsll\tv0,v0,0x2\n 40:\tlui\ta0,0x0\n 44:\taddu\ta0,a0,v0\n 48:\tlw\ta0,0(a0)\n 4c:\tjal\t0 \n 50:\tli\ta1,90\n 54:\tlui\ta0,0x0\n 58:\tjal\t0 \n 5c:\taddiu\ta0,a0,0\n 60:\tlw\tra,16(sp)\n 64:\tjr\tra\n 68:\taddiu\tsp,sp,24\n 6c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-163252facba5.i.gz","proto":{"func_80018DC0_199C0":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-72d0c8d03e081c13/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80018DC0_199C0\n00000000 *UND*\t00000000 allocateTaskMemory\n00000000 *UND*\t00000000 D_800A8CC8_A0038\n00000000 *UND*\t00000000 func_800574A0_580A0\n00000000 *UND*\t00000000 D_8008D78C_8E38C\n00000000 *UND*\t00000000 createTaskQueue\n00000000 *UND*\t00000000 func_80018E2C_19A2C\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 allocateTaskMemory\n00000014 R_MIPS_HI16 D_800A8CC8_A0038\n00000018 R_MIPS_LO16 D_800A8CC8_A0038\n0000002c R_MIPS_26 func_800574A0_580A0\n00000034 R_MIPS_HI16 D_800A8CC8_A0038\n00000038 R_MIPS_LO16 D_800A8CC8_A0038\n00000040 R_MIPS_HI16 D_8008D78C_8E38C\n00000048 R_MIPS_LO16 D_8008D78C_8E38C\n0000004c R_MIPS_26 createTaskQueue\n00000054 R_MIPS_HI16 func_80018E2C_19A2C\n0000005c R_MIPS_LO16 func_80018E2C_19A2C\n00000058 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 24040004 '...........$...\n 0010 a0400002 3c030000 90630000 a4400000 .@..<....c...@..\n 0020 24020004 10620003 00000000 0c000000 $....b..........\n 0030 24040002 3c020000 90420000 00021080 $...<....B......\n 0040 3c040000 00822021 8c840000 0c000000 <..... !........\n 0050 2405005a 3c040000 0c000000 24840000 $..Z<.......$...\n 0060 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80018DC0_199C0' — lift: cannot lift 'func_80018DC0_199C0': function call 'jal' at 0x8 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tjal\t0 */\n/* c:\tli\ta0,4 */\n/* 10:\tsb\tzero,2(v0) */\n/* 14:\tlui\tv1,0x0 */\n/* 18:\tlbu\tv1,0(v1) */\n/* 1c:\tsh\tzero,0(v0) */\n/* 20:\tli\tv0,4 */\n/* 24:\tbeq\tv1,v0,34 */\n/* 28:\tnop */\n/* 2c:\tjal\t0 */\n/* 30:\tli\ta0,2 */\n/* 34:\tlui\tv0,0x0 */\n/* 38:\tlbu\tv0,0(v0) */\n/* 3c:\tsll\tv0,v0,0x2 */\n/* 40:\tlui\ta0,0x0 */\n/* 44:\taddu\ta0,a0,v0 */\n/* 48:\tlw\ta0,0(a0) */\n/* 4c:\tjal\t0 */\n/* 50:\tli\ta1,90 */\n/* 54:\tlui\ta0,0x0 */\n/* 58:\tjal\t0 */\n/* 5c:\taddiu\ta0,a0,0 */\n/* 60:\tlw\tra,16(sp) */\n/* 64:\tjr\tra */\n/* 68:\taddiu\tsp,sp,24 */\n/* 6c:\tnop */\nvoid func_80018DC0_199C0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80018DC0_199C0': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":36,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80018DC0_199C0': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_80018DC0_199C0(void) {\n void *temp_v0;\n\n temp_v0 = allocateTaskMemory(4);\n temp_v0->unk2 = 0;\n temp_v0->unk0 = 0;\n if (D_800A8CC8_A0038 != 4) {\n func_800574A0_580A0(2);\n }\n createTaskQueue(D_8008D78C_8E38C[D_800A8CC8_A0038], 0x5A);\n setGameStateHandler(func_80018E2C_19A2C);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":11,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:1837: request for member `unk2' in something not a structure or union","/c.i:1838: request for member `unk0' in something not a structure or union"]},"note":"src/199C0.c: task init; allocates task memory, dispatches by global index","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80018DC0_199C0` — benchmark function snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80018DC0_199C0\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tallocateTaskMemory\n li\t$a0, 4\n sb\t$zero, 2($v0)\n lui\t$v1, %hi(D_800A8CC8_A0038)\n lbu\t$v1, %lo(D_800A8CC8_A0038)($v1)\n sh\t$zero, 0($v0)\n li\t$v0, 4\n beq\t$v1, $v0, .L34\n nop\n jal\tfunc_800574A0_580A0\n li\t$a0, 2\n.L34:\n lui\t$v0, %hi(D_800A8CC8_A0038)\n lbu\t$v0, %lo(D_800A8CC8_A0038)($v0)\n sll\t$v0, $v0, 0x2\n lui\t$a0, %hi(D_8008D78C_8E38C)\n addu\t$a0, $a0, $v0\n lw\t$a0, %lo(D_8008D78C_8E38C)($a0)\n jal\tcreateTaskQueue\n li\t$a1, 90\n lui\t$a0, %hi(func_80018E2C_19A2C)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80018E2C_19A2C)\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-163252facba5.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80018DC0_199C0(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80018DC0_199C0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80018DC0_199C0` — benchmark function snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tli\ta0,4\n 10:\tsb\tzero,2(v0)\n 14:\tlui\tv1,0x0\n 18:\tlbu\tv1,0(v1)\n 1c:\tsh\tzero,0(v0)\n 20:\tli\tv0,4\n 24:\tbeq\tv1,v0,34 \n 28:\tnop\n 2c:\tjal\t0 \n 30:\tli\ta0,2\n 34:\tlui\tv0,0x0\n 38:\tlbu\tv0,0(v0)\n 3c:\tsll\tv0,v0,0x2\n 40:\tlui\ta0,0x0\n 44:\taddu\ta0,a0,v0\n 48:\tlw\ta0,0(a0)\n 4c:\tjal\t0 \n 50:\tli\ta1,90\n 54:\tlui\ta0,0x0\n 58:\tjal\t0 \n 5c:\taddiu\ta0,a0,0\n 60:\tlw\tra,16(sp)\n 64:\tjr\tra\n 68:\taddiu\tsp,sp,24\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-72d0c8d03e081c13/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80018DC0_199C0\n00000000 *UND*\t00000000 allocateTaskMemory\n00000000 *UND*\t00000000 D_800A8CC8_A0038\n00000000 *UND*\t00000000 func_800574A0_580A0\n00000000 *UND*\t00000000 D_8008D78C_8E38C\n00000000 *UND*\t00000000 createTaskQueue\n00000000 *UND*\t00000000 func_80018E2C_19A2C\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 allocateTaskMemory\n00000014 R_MIPS_HI16 D_800A8CC8_A0038\n00000018 R_MIPS_LO16 D_800A8CC8_A0038\n0000002c R_MIPS_26 func_800574A0_580A0\n00000034 R_MIPS_HI16 D_800A8CC8_A0038\n00000038 R_MIPS_LO16 D_800A8CC8_A0038\n00000040 R_MIPS_HI16 D_8008D78C_8E38C\n00000048 R_MIPS_LO16 D_8008D78C_8E38C\n0000004c R_MIPS_26 createTaskQueue\n00000054 R_MIPS_HI16 func_80018E2C_19A2C\n0000005c R_MIPS_LO16 func_80018E2C_19A2C\n00000058 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 24040004 '...........$...\n 0010 a0400002 3c030000 90630000 a4400000 .@..<....c...@..\n 0020 24020004 10620003 00000000 0c000000 $....b..........\n 0030 24040002 3c020000 90420000 00021080 $...<....B......\n 0040 3c040000 00822021 8c840000 0c000000 <..... !........\n 0050 2405005a 3c040000 0c000000 24840000 $..Z<.......$...\n 0060 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80018DC0_199C0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80018DC0_199C0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc","sym":"func_8001BCDC_1C8DC","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","struct","field","global","branch"],"loc":20,"refSource":"void func_8001BCDC_1C8DC(void) {\n GameState *state = getCurrentAllocation();\n s32 i;\n s32 j;\n u8 count;\n\n for (i = 0; i < 9; i++) {\n count = 0;\n\n for (j = 0; j < D_800AFE8C_A71FC->unk8; j++) {\n if (state->unk59A[j] == 1 || state->unk59A[j] == 3) {\n count++;\n }\n }\n\n if (count == 0) {\n state->unk5B8[i] = 0;\n }\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1BBA0.c#L87-L106","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\tra,24(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tmove\tt0,v0\n 14:\tmove\ta2,zero\n 18:\tlui\tv0,0x0\n 1c:\tlw\tv0,0(v0)\n 20:\tlbu\tv0,8(v0)\n 24:\tmove\ta1,zero\n 28:\tblez\tv0,68 \n 2c:\tmove\ta0,zero\n 30:\tmove\ta3,v0\n 34:\taddu\tv0,t0,a0\n 38:\tlbu\tv0,1434(v0)\n 3c:\txori\tv1,v0,0x1\n 40:\tsltiu\tv1,v1,1\n 44:\txori\tv0,v0,0x3\n 48:\tsltiu\tv0,v0,1\n 4c:\tor\tv1,v1,v0\n 50:\tbnezl\tv1,58 \n 54:\taddiu\ta1,a1,1\n 58:\taddiu\ta0,a0,1\n 5c:\tslt\tv0,a0,a3\n 60:\tbnez\tv0,38 \n 64:\taddu\tv0,t0,a0\n 68:\tandi\tv0,a1,0xff\n 6c:\tbnezl\tv0,80 \n 70:\taddiu\ta2,a2,1\n 74:\taddu\tv0,t0,a2\n 78:\tsb\tzero,1464(v0)\n 7c:\taddiu\ta2,a2,1\n 80:\tslti\tv0,a2,9\n 84:\tbnez\tv0,18 \n 88:\tnop\n 8c:\tlw\tra,24(sp)\n 90:\tjr\tra\n 94:\taddiu\tsp,sp,32\n\t...\n","proto":{"func_8001BCDC_1C8DC":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3b0d9b3084dd05cc/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000098 func_8001BCDC_1C8DC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 D_800AFE8C_A71FC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_HI16 D_800AFE8C_A71FC\n0000001c R_MIPS_LO16 D_800AFE8C_A71FC\n\n\nContents of section .text:\n 0000 27bdffe0 afbf0018 0c000000 00000000 '...............\n 0010 00404021 00003021 3c020000 8c420000 .@@!..0!<....B..\n 0020 90420008 00002821 1840000f 00002021 .B....(!.@.... !\n 0030 00403821 01041021 9042059a 38430001 .@8!...!.B..8C..\n 0040 2c630001 38420003 2c420001 00621825 ,c..8B..,B...b.%\n 0050 54600001 24a50001 24840001 0087102a T`..$...$......*\n 0060 1440fff5 01041021 30a200ff 54400004 .@.....!0...T@..\n 0070 24c60001 01061021 a04005b8 24c60001 $......!.@..$...\n 0080 28c20009 1440ffe4 00000000 8fbf0018 (....@..........\n 0090 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8001BCDC_1C8DC' — lift: cannot lift 'func_8001BCDC_1C8DC': function call 'jal' at 0x8 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-32 */\n/* 4:\tsw\tra,24(sp) */\n/* 8:\tjal\t0 */\n/* c:\tnop */\n/* 10:\tmove\tt0,v0 */\n/* 14:\tmove\ta2,zero */\n/* 18:\tlui\tv0,0x0 */\n/* 1c:\tlw\tv0,0(v0) */\n/* 20:\tlbu\tv0,8(v0) */\n/* 24:\tmove\ta1,zero */\n/* 28:\tblez\tv0,68 */\n/* 2c:\tmove\ta0,zero */\n/* 30:\tmove\ta3,v0 */\n/* 34:\taddu\tv0,t0,a0 */\n/* 38:\tlbu\tv0,1434(v0) */\n/* 3c:\txori\tv1,v0,0x1 */\n/* 40:\tsltiu\tv1,v1,1 */\n/* 44:\txori\tv0,v0,0x3 */\n/* 48:\tsltiu\tv0,v0,1 */\n/* 4c:\tor\tv1,v1,v0 */\n/* 50:\tbnezl\tv1,58 */\n/* 54:\taddiu\ta1,a1,1 */\n/* 58:\taddiu\ta0,a0,1 */\n/* 5c:\tslt\tv0,a0,a3 */\n/* 60:\tbnez\tv0,38 */\n/* 64:\taddu\tv0,t0,a0 */\n/* 68:\tandi\tv0,a1,0xff */\n/* 6c:\tbnezl\tv0,80 */\n/* 70:\taddiu\ta2,a2,1 */\n/* 74:\taddu\tv0,t0,a2 */\n/* 78:\tsb\tzero,1464(v0) */\n/* 7c:\taddiu\ta2,a2,1 */\n/* 80:\tslti\tv0,a2,9 */\n/* 84:\tbnez\tv0,18 */\n/* 88:\tnop */\n/* 8c:\tlw\tra,24(sp) */\n/* 90:\tjr\tra */\n/* 94:\taddiu\tsp,sp,32 */\n/* \t... */\nvoid func_8001BCDC_1C8DC(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8001BCDC_1C8DC': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":47,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8001BCDC_1C8DC': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *getCurrentAllocation(); /* extern */\nextern void *D_800AFE8C_A71FC;\n\nvoid func_8001BCDC_1C8DC(void) {\n s32 var_a0;\n s32 var_a1;\n s32 var_a2;\n u8 temp_v0;\n u8 temp_v0_2;\n void *temp_t0;\n void *var_v0;\n\n temp_t0 = getCurrentAllocation();\n var_a2 = 0;\n do {\n temp_v0 = D_800AFE8C_A71FC->unk8;\n var_a1 = 0;\n var_a0 = 0;\n if ((s32) temp_v0 > 0) {\n var_v0 = temp_t0;\n do {\n temp_v0_2 = var_v0->unk59A;\n if (((temp_v0_2 == 1) | (temp_v0_2 == 3)) != 0) {\n var_a1 += 1;\n }\n var_a0 += 1;\n var_v0 = temp_t0 + var_a0;\n } while (var_a0 < (s32) temp_v0);\n }\n if (!(var_a1 & 0xFF)) {\n (temp_t0 + var_a2)->unk5B8 = 0;\n }\n var_a2 += 1;\n } while (var_a2 < 9);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":98,"lines":33,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: kmc gcc (docker) failed: /c.i:2621: conflicting types for `D_800AFE8C_A71FC'","/c.i:2540: previous declaration of `D_800AFE8C_A71FC'","/c.i:2633: request for member `unk8' in something not a structure or union","/c.i:2639: request for member `unk59A' in something not a structure or union","/c.i:2648: request for member `unk5B8' in something not a structure or union"]},"note":"src/1BBA0.c: nested loop counting active players, clears a flag row when none remain","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8001BCDC_1C8DC` — benchmark function snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001BCDC_1C8DC\n addiu\t$sp, $sp, -32\n sw\t$ra, 24($sp)\n jal\tgetCurrentAllocation\n nop\n move\t$t0, $v0\n move\t$a2, $zero\n.L18:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v0, 8($v0)\n move\t$a1, $zero\n blez\t$v0, .L68\n move\t$a0, $zero\n move\t$a3, $v0\n addu\t$v0, $t0, $a0\n.L38:\n lbu\t$v0, 1434($v0)\n xori\t$v1, $v0, 0x1\n sltiu\t$v1, $v1, 1\n xori\t$v0, $v0, 0x3\n sltiu\t$v0, $v0, 1\n or\t$v1, $v1, $v0\n bnezl\t$v1, .L58\n addiu\t$a1, $a1, 1\n.L58:\n addiu\t$a0, $a0, 1\n slt\t$v0, $a0, $a3\n bnez\t$v0, .L38\n addu\t$v0, $t0, $a0\n.L68:\n andi\t$v0, $a1, 0xff\n bnezl\t$v0, .L80\n addiu\t$a2, $a2, 1\n addu\t$v0, $t0, $a2\n sb\t$zero, 1464($v0)\n addiu\t$a2, $a2, 1\n.L80:\n slti\t$v0, $a2, 9\n bnez\t$v0, .L18\n nop\n lw\t$ra, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001BCDC_1C8DC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001BCDC_1C8DC` — benchmark function snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\tra,24(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tmove\tt0,v0\n 14:\tmove\ta2,zero\n 18:\tlui\tv0,0x0\n 1c:\tlw\tv0,0(v0)\n 20:\tlbu\tv0,8(v0)\n 24:\tmove\ta1,zero\n 28:\tblez\tv0,68 \n 2c:\tmove\ta0,zero\n 30:\tmove\ta3,v0\n 34:\taddu\tv0,t0,a0\n 38:\tlbu\tv0,1434(v0)\n 3c:\txori\tv1,v0,0x1\n 40:\tsltiu\tv1,v1,1\n 44:\txori\tv0,v0,0x3\n 48:\tsltiu\tv0,v0,1\n 4c:\tor\tv1,v1,v0\n 50:\tbnezl\tv1,58 \n 54:\taddiu\ta1,a1,1\n 58:\taddiu\ta0,a0,1\n 5c:\tslt\tv0,a0,a3\n 60:\tbnez\tv0,38 \n 64:\taddu\tv0,t0,a0\n 68:\tandi\tv0,a1,0xff\n 6c:\tbnezl\tv0,80 \n 70:\taddiu\ta2,a2,1\n 74:\taddu\tv0,t0,a2\n 78:\tsb\tzero,1464(v0)\n 7c:\taddiu\ta2,a2,1\n 80:\tslti\tv0,a2,9\n 84:\tbnez\tv0,18 \n 88:\tnop\n 8c:\tlw\tra,24(sp)\n 90:\tjr\tra\n 94:\taddiu\tsp,sp,32\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3b0d9b3084dd05cc/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000098 func_8001BCDC_1C8DC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 D_800AFE8C_A71FC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_HI16 D_800AFE8C_A71FC\n0000001c R_MIPS_LO16 D_800AFE8C_A71FC\n\n\nContents of section .text:\n 0000 27bdffe0 afbf0018 0c000000 00000000 '...............\n 0010 00404021 00003021 3c020000 8c420000 .@@!..0!<....B..\n 0020 90420008 00002821 1840000f 00002021 .B....(!.@.... !\n 0030 00403821 01041021 9042059a 38430001 .@8!...!.B..8C..\n 0040 2c630001 38420003 2c420001 00621825 ,c..8B..,B...b.%\n 0050 54600001 24a50001 24840001 0087102a T`..$...$......*\n 0060 1440fff5 01041021 30a200ff 54400004 .@.....!0...T@..\n 0070 24c60001 01061021 a04005b8 24c60001 $......!.@..$...\n 0080 28c20009 1440ffe4 00000000 8fbf0018 (....@..........\n 0090 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001BCDC_1C8DC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001BCDC_1C8DC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc","sym":"func_8001BD74_1C974","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","pointer","memory"],"loc":10,"refSource":"void func_8001BD74_1C974(s8 *a0) {\n if (*a0 == 3) {\n *a0 = 2;\n } else if (*a0 == 8) {\n *a0 = 7;\n } else if (*a0 != 4) {\n } else {\n *a0 = 0;\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1BBA0.c#L108-L117","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlb\tv1,0(a0)\n 4:\tli\tv0,3\n 8:\tbne\tv1,v0,1c \n c:\tli\tv0,8\n 10:\tli\tv0,2\n 14:\tj\t38 \n 18:\tsb\tv0,0(a0)\n 1c:\tbne\tv1,v0,30 \n 20:\tli\tv0,4\n 24:\tli\tv0,7\n 28:\tj\t38 \n 2c:\tsb\tv0,0(a0)\n 30:\tbeql\tv1,v0,38 \n 34:\tsb\tzero,0(a0)\n 38:\tjr\tra\n 3c:\tnop\n","proto":{"func_8001BD74_1C974":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-bf8de6181edf7df5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001BD74_1C974\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 .text\n00000028 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 80830000 24020003 14620004 24020008 ....$....b..$...\n 0010 24020002 0800000e a0820000 14620004 $............b..\n 0020 24020004 24020007 0800000e a0820000 $...$...........\n 0030 50620001 a0800000 03e00008 00000000 Pb..............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8001BD74_1C974' — lift: cannot lift 'func_8001BD74_1C974': unmodelled control transfer 'beql' at 0x30 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlb\tv1,0(a0) */\n/* 4:\tli\tv0,3 */\n/* 8:\tbne\tv1,v0,1c */\n/* c:\tli\tv0,8 */\n/* 10:\tli\tv0,2 */\n/* 14:\tj\t38 */\n/* 18:\tsb\tv0,0(a0) */\n/* 1c:\tbne\tv1,v0,30 */\n/* 20:\tli\tv0,4 */\n/* 24:\tli\tv0,7 */\n/* 28:\tj\t38 */\n/* 2c:\tsb\tv0,0(a0) */\n/* 30:\tbeql\tv1,v0,38 */\n/* 34:\tsb\tzero,0(a0) */\n/* 38:\tjr\tra */\n/* 3c:\tnop */\nvoid func_8001BD74_1C974(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8001BD74_1C974': unmodelled control transfer 'beql' at 0x30 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":24,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8001BD74_1C974': unmodelled control transfer 'beql' at 0x30 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_8001BD74_1C974(s8 *arg0) {\n s8 temp_v1;\n\n temp_v1 = *arg0;\n switch (temp_v1) { /* irregular */\n case 3:\n *arg0 = 2;\n return;\n case 8:\n *arg0 = 7;\n return;\n case 4:\n *arg0 = 0;\n return;\n }\n}\n","score":14,"maxScore":23,"compileErrors":null,"breakdown":{"insert":7,"delete":1,"replace":3,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/1BBA0.c: remaps a state byte through a pointer via an if-chain; pure leaf","gapSize":{"decompiler":"m2c","score":14,"maxScore":23,"ratio":0.6086956521739131,"kinds":{"insert":7,"delete":1,"replace":3,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8001BD74_1C974` — benchmark function snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001BD74_1C974\n lb\t$v1, 0($a0)\n li\t$v0, 3\n bne\t$v1, $v0, .L1c\n li\t$v0, 8\n li\t$v0, 2\n j\t.L38\n sb\t$v0, 0($a0)\n.L1c:\n bne\t$v1, $v0, .L30\n li\t$v0, 4\n li\t$v0, 7\n j\t.L38\n sb\t$v0, 0($a0)\n.L30:\n beql\t$v1, $v0, .L38\n sb\t$zero, 0($a0)\n.L38:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001BD74_1C974 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001BD74_1C974` — benchmark function snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlb\tv1,0(a0)\n 4:\tli\tv0,3\n 8:\tbne\tv1,v0,1c \n c:\tli\tv0,8\n 10:\tli\tv0,2\n 14:\tj\t38 \n 18:\tsb\tv0,0(a0)\n 1c:\tbne\tv1,v0,30 \n 20:\tli\tv0,4\n 24:\tli\tv0,7\n 28:\tj\t38 \n 2c:\tsb\tv0,0(a0)\n 30:\tbeql\tv1,v0,38 \n 34:\tsb\tzero,0(a0)\n 38:\tjr\tra\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-bf8de6181edf7df5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001BD74_1C974\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 .text\n00000028 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 80830000 24020003 14620004 24020008 ....$....b..$...\n 0010 24020002 0800000e a0820000 14620004 $............b..\n 0020 24020004 24020007 0800000e a0820000 $...$...........\n 0030 50620001 a0800000 03e00008 00000000 Pb..............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001BD74_1C974\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001BD74_1C974 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80021C00_22800:gcc2.7.2kmc","sym":"func_80021C00_22800","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["call","branch","compare"],"loc":9,"refSource":"void func_80021C00_22800(void) {\n s16 result = func_80069810_6A410();\n\n if (result == 0xFF) {\n terminateSchedulerWithCallback(&func_80021D00_22900);\n } else if (result == 1) {\n setGameStateHandler(&func_80021C58_22858);\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/227D0.c#L18-L26","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tsll\tv0,v0,0x10\n 14:\tsra\tv1,v0,0x10\n 18:\tli\tv0,255\n 1c:\tbne\tv1,v0,38 \n 20:\tli\tv0,1\n 24:\tlui\ta0,0x0\n 28:\tjal\t0 \n 2c:\taddiu\ta0,a0,0\n 30:\tj\t4c \n 34:\tnop\n 38:\tbne\tv1,v0,4c \n 3c:\tnop\n 40:\tlui\ta0,0x0\n 44:\tjal\t0 \n 48:\taddiu\ta0,a0,0\n 4c:\tlw\tra,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-c3df422c9dc8.i.gz","proto":{"func_80021C00_22800":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1bbfd2db97d42027/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80021C00_22800\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021D00_22900\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n00000000 *UND*\t00000000 func_80021C58_22858\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 func_80069810_6A410\n00000024 R_MIPS_HI16 func_80021D00_22900\n0000002c R_MIPS_LO16 func_80021D00_22900\n00000028 R_MIPS_26 terminateSchedulerWithCallback\n00000030 R_MIPS_26 .text\n00000040 R_MIPS_HI16 func_80021C58_22858\n00000048 R_MIPS_LO16 func_80021C58_22858\n00000044 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 00021400 00021c03 240200ff 14620006 ........$....b..\n 0020 24020001 3c040000 0c000000 24840000 $...<.......$...\n 0030 08000013 00000000 14620004 00000000 .........b......\n 0040 3c040000 0c000000 24840000 8fbf0010 <.......$.......\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80021C00_22800' — lift: cannot lift 'func_80021C00_22800': function call 'jal' at 0x8 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tjal\t0 */\n/* c:\tnop */\n/* 10:\tsll\tv0,v0,0x10 */\n/* 14:\tsra\tv1,v0,0x10 */\n/* 18:\tli\tv0,255 */\n/* 1c:\tbne\tv1,v0,38 */\n/* 20:\tli\tv0,1 */\n/* 24:\tlui\ta0,0x0 */\n/* 28:\tjal\t0 */\n/* 2c:\taddiu\ta0,a0,0 */\n/* 30:\tj\t4c */\n/* 34:\tnop */\n/* 38:\tbne\tv1,v0,4c */\n/* 3c:\tnop */\n/* 40:\tlui\ta0,0x0 */\n/* 44:\tjal\t0 */\n/* 48:\taddiu\ta0,a0,0 */\n/* 4c:\tlw\tra,16(sp) */\n/* 50:\tjr\tra */\n/* 54:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid func_80021C00_22800(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80021C00_22800': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":31,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80021C00_22800': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_80021C00_22800(void) {\n s16 temp_v0;\n\n temp_v0 = func_80069810_6A410();\n switch (temp_v0) { /* irregular */\n case 0xFF:\n terminateSchedulerWithCallback(func_80021D00_22900);\n return;\n case 0x1:\n setGameStateHandler(func_80021C58_22858);\n return;\n }\n}\n","score":7,"maxScore":24,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":12,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/227D0.c: game-state dispatch on a poll result","gapSize":{"decompiler":"m2c","score":7,"maxScore":24,"ratio":0.2916666666666667,"kinds":{"insert":2,"delete":2,"replace":1,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80021C00_22800` — benchmark function snowboardkids2:func_80021C00_22800:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80021C00_22800\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tfunc_80069810_6A410\n nop\n sll\t$v0, $v0, 0x10\n sra\t$v1, $v0, 0x10\n li\t$v0, 255\n bne\t$v1, $v0, .L38\n li\t$v0, 1\n lui\t$a0, %hi(func_80021D00_22900)\n jal\tterminateSchedulerWithCallback\n addiu\t$a0, $a0, %lo(func_80021D00_22900)\n j\t.L4c\n nop\n.L38:\n bne\t$v1, $v0, .L4c\n nop\n lui\t$a0, %hi(func_80021C58_22858)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80021C58_22858)\n.L4c:\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-c3df422c9dc8.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80021C00_22800(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80021C00_22800 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80021C00_22800` — benchmark function snowboardkids2:func_80021C00_22800:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80021C00_22800:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tsll\tv0,v0,0x10\n 14:\tsra\tv1,v0,0x10\n 18:\tli\tv0,255\n 1c:\tbne\tv1,v0,38 \n 20:\tli\tv0,1\n 24:\tlui\ta0,0x0\n 28:\tjal\t0 \n 2c:\taddiu\ta0,a0,0\n 30:\tj\t4c \n 34:\tnop\n 38:\tbne\tv1,v0,4c \n 3c:\tnop\n 40:\tlui\ta0,0x0\n 44:\tjal\t0 \n 48:\taddiu\ta0,a0,0\n 4c:\tlw\tra,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1bbfd2db97d42027/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80021C00_22800\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021D00_22900\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n00000000 *UND*\t00000000 func_80021C58_22858\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 func_80069810_6A410\n00000024 R_MIPS_HI16 func_80021D00_22900\n0000002c R_MIPS_LO16 func_80021D00_22900\n00000028 R_MIPS_26 terminateSchedulerWithCallback\n00000030 R_MIPS_26 .text\n00000040 R_MIPS_HI16 func_80021C58_22858\n00000048 R_MIPS_LO16 func_80021C58_22858\n00000044 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 00021400 00021c03 240200ff 14620006 ........$....b..\n 0020 24020001 3c040000 0c000000 24840000 $...<.......$...\n 0030 08000013 00000000 14620004 00000000 .........b......\n 0040 3c040000 0c000000 24840000 8fbf0010 <.......$.......\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80021C00_22800\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80021C00_22800 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80021D88_22988:gcc2.7.2kmc","sym":"func_80021D88_22988","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["call","branch","local"],"loc":12,"refSource":"void func_80021D88_22988(void) {\n s16 result;\n\n getCurrentAllocation();\n result = func_80069810_6A410();\n\n if (result == 1) {\n setGameStateHandler(func_80021DE8_229E8);\n } else if (result == 0xFF) {\n terminateSchedulerWithCallback(func_80022108_22D08);\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/22920.c#L35-L46","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tjal\t0 \n 14:\tnop\n 18:\tsll\tv0,v0,0x10\n 1c:\tsra\tv1,v0,0x10\n 20:\tli\tv0,1\n 24:\tbne\tv1,v0,40 \n 28:\tli\tv0,255\n 2c:\tlui\ta0,0x0\n 30:\tjal\t0 \n 34:\taddiu\ta0,a0,0\n 38:\tj\t54 \n 3c:\tnop\n 40:\tbne\tv1,v0,54 \n 44:\tnop\n 48:\tlui\ta0,0x0\n 4c:\tjal\t0 \n 50:\taddiu\ta0,a0,0\n 54:\tlw\tra,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-e0cb1bd24f0c.i.gz","proto":{"func_80021D88_22988":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-a50ccb5d3e41fbec/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80021D88_22988\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021DE8_229E8\n00000000 *UND*\t00000000 setGameStateHandler\n00000000 *UND*\t00000000 func_80022108_22D08\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000010 R_MIPS_26 func_80069810_6A410\n0000002c R_MIPS_HI16 func_80021DE8_229E8\n00000034 R_MIPS_LO16 func_80021DE8_229E8\n00000030 R_MIPS_26 setGameStateHandler\n00000038 R_MIPS_26 .text\n00000048 R_MIPS_HI16 func_80022108_22D08\n00000050 R_MIPS_LO16 func_80022108_22D08\n0000004c R_MIPS_26 terminateSchedulerWithCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 0c000000 00000000 00021400 00021c03 ................\n 0020 24020001 14620006 240200ff 3c040000 $....b..$...<...\n 0030 0c000000 24840000 08000015 00000000 ....$...........\n 0040 14620004 00000000 3c040000 0c000000 .b......<.......\n 0050 24840000 8fbf0010 03e00008 27bd0018 $...........'...\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80021D88_22988' — lift: cannot lift 'func_80021D88_22988': function call 'jal' at 0x8 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tjal\t0 */\n/* c:\tnop */\n/* 10:\tjal\t0 */\n/* 14:\tnop */\n/* 18:\tsll\tv0,v0,0x10 */\n/* 1c:\tsra\tv1,v0,0x10 */\n/* 20:\tli\tv0,1 */\n/* 24:\tbne\tv1,v0,40 */\n/* 28:\tli\tv0,255 */\n/* 2c:\tlui\ta0,0x0 */\n/* 30:\tjal\t0 */\n/* 34:\taddiu\ta0,a0,0 */\n/* 38:\tj\t54 */\n/* 3c:\tnop */\n/* 40:\tbne\tv1,v0,54 */\n/* 44:\tnop */\n/* 48:\tlui\ta0,0x0 */\n/* 4c:\tjal\t0 */\n/* 50:\taddiu\ta0,a0,0 */\n/* 54:\tlw\tra,16(sp) */\n/* 58:\tjr\tra */\n/* 5c:\taddiu\tsp,sp,24 */\nvoid func_80021D88_22988(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80021D88_22988': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80021D88_22988': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_80021D88_22988(void) {\n s16 temp_v0;\n\n getCurrentAllocation();\n temp_v0 = func_80069810_6A410();\n switch (temp_v0) { /* irregular */\n case 0x1:\n setGameStateHandler(func_80021DE8_229E8);\n return;\n case 0xFF:\n terminateSchedulerWithCallback(func_80022108_22D08);\n return;\n }\n}\n","score":7,"maxScore":28,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/22920.c: game-state dispatch","gapSize":{"decompiler":"m2c","score":7,"maxScore":28,"ratio":0.25,"kinds":{"insert":4,"delete":2,"replace":1,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80021D88_22988` — benchmark function snowboardkids2:func_80021D88_22988:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80021D88_22988\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tgetCurrentAllocation\n nop\n jal\tfunc_80069810_6A410\n nop\n sll\t$v0, $v0, 0x10\n sra\t$v1, $v0, 0x10\n li\t$v0, 1\n bne\t$v1, $v0, .L40\n li\t$v0, 255\n lui\t$a0, %hi(func_80021DE8_229E8)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80021DE8_229E8)\n j\t.L54\n nop\n.L40:\n bne\t$v1, $v0, .L54\n nop\n lui\t$a0, %hi(func_80022108_22D08)\n jal\tterminateSchedulerWithCallback\n addiu\t$a0, $a0, %lo(func_80022108_22D08)\n.L54:\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-e0cb1bd24f0c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80021D88_22988(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80021D88_22988 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80021D88_22988` — benchmark function snowboardkids2:func_80021D88_22988:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80021D88_22988:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tjal\t0 \n 14:\tnop\n 18:\tsll\tv0,v0,0x10\n 1c:\tsra\tv1,v0,0x10\n 20:\tli\tv0,1\n 24:\tbne\tv1,v0,40 \n 28:\tli\tv0,255\n 2c:\tlui\ta0,0x0\n 30:\tjal\t0 \n 34:\taddiu\ta0,a0,0\n 38:\tj\t54 \n 3c:\tnop\n 40:\tbne\tv1,v0,54 \n 44:\tnop\n 48:\tlui\ta0,0x0\n 4c:\tjal\t0 \n 50:\taddiu\ta0,a0,0\n 54:\tlw\tra,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-a50ccb5d3e41fbec/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80021D88_22988\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021DE8_229E8\n00000000 *UND*\t00000000 setGameStateHandler\n00000000 *UND*\t00000000 func_80022108_22D08\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000010 R_MIPS_26 func_80069810_6A410\n0000002c R_MIPS_HI16 func_80021DE8_229E8\n00000034 R_MIPS_LO16 func_80021DE8_229E8\n00000030 R_MIPS_26 setGameStateHandler\n00000038 R_MIPS_26 .text\n00000048 R_MIPS_HI16 func_80022108_22D08\n00000050 R_MIPS_LO16 func_80022108_22D08\n0000004c R_MIPS_26 terminateSchedulerWithCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 0c000000 00000000 00021400 00021c03 ................\n 0020 24020001 14620006 240200ff 3c040000 $....b..$...<...\n 0030 0c000000 24840000 08000015 00000000 ....$...........\n 0040 14620004 00000000 3c040000 0c000000 .b......<.......\n 0050 24840000 8fbf0010 03e00008 27bd0018 $...........'...\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80021D88_22988\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80021D88_22988 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc","sym":"func_80028BB0_297B0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","bitwise","call"],"loc":9,"refSource":"void func_80028BB0_297B0(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = randB() & 0xF;\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028C08_29808);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L42-L50","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\tlhu\ta1,44(s0)\n 24:\taddiu\ta0,s0,4\n 28:\tandi\tv0,v0,0xf\n 2c:\tjal\t0 \n 30:\tsh\tv0,90(s0)\n 34:\tjal\t0 \n 38:\tmove\ta0,s0\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,20(sp)\n 4c:\tlw\ts0,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-02d774e5b23e4379/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80028BB0_297B0\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028C08_29808\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n0000002c R_MIPS_26 createYRotationMatrix\n00000034 R_MIPS_26 func_8002A290_2AE90\n0000003c R_MIPS_HI16 func_80028C08_29808\n00000044 R_MIPS_LO16 func_80028C08_29808\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 9605002c 26040004 3042000f 0c000000 ...,&...0B......\n 0030 a602005a 0c000000 02002021 3c040000 ...Z...... !<...\n 0040 0c000000 24840000 8fbf0014 8fb00010 ....$...........\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a0010034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80028BB0_297B0' — lift: cannot lift 'func_80028BB0_297B0': function call 'jal' at 0x18 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tsb\tzero,94(s0) */\n/* 14:\tsb\tzero,97(s0) */\n/* 18:\tjal\t0 */\n/* 1c:\tsb\tzero,98(s0) */\n/* 20:\tlhu\ta1,44(s0) */\n/* 24:\taddiu\ta0,s0,4 */\n/* 28:\tandi\tv0,v0,0xf */\n/* 2c:\tjal\t0 */\n/* 30:\tsh\tv0,90(s0) */\n/* 34:\tjal\t0 */\n/* 38:\tmove\ta0,s0 */\n/* 3c:\tlui\ta0,0x0 */\n/* 40:\tjal\t0 */\n/* 44:\taddiu\ta0,a0,0 */\n/* 48:\tlw\tra,20(sp) */\n/* 4c:\tlw\ts0,16(sp) */\n/* 50:\tjr\tra */\n/* 54:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid func_80028BB0_297B0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80028BB0_297B0': function call 'jal' at 0x18 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":31,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80028BB0_297B0': function call 'jal' at 0x18 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_80028BB0_297B0(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = randB() & 0xF;\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028C08_29808);\n}\n","score":0,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80028BB0_297B0` — benchmark function snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80028BB0_297B0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n sb\t$zero, 94($s0)\n sb\t$zero, 97($s0)\n jal\trandB\n sb\t$zero, 98($s0)\n lhu\t$a1, 44($s0)\n addiu\t$a0, $s0, 4\n andi\t$v0, $v0, 0xf\n jal\tcreateYRotationMatrix\n sh\t$v0, 90($s0)\n jal\tfunc_8002A290_2AE90\n move\t$a0, $s0\n lui\t$a0, %hi(func_80028C08_29808)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80028C08_29808)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80028BB0_297B0(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80028BB0_297B0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80028BB0_297B0` — benchmark function snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\tlhu\ta1,44(s0)\n 24:\taddiu\ta0,s0,4\n 28:\tandi\tv0,v0,0xf\n 2c:\tjal\t0 \n 30:\tsh\tv0,90(s0)\n 34:\tjal\t0 \n 38:\tmove\ta0,s0\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,20(sp)\n 4c:\tlw\ts0,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-02d774e5b23e4379/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80028BB0_297B0\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028C08_29808\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n0000002c R_MIPS_26 createYRotationMatrix\n00000034 R_MIPS_26 func_8002A290_2AE90\n0000003c R_MIPS_HI16 func_80028C08_29808\n00000044 R_MIPS_LO16 func_80028C08_29808\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 9605002c 26040004 3042000f 0c000000 ...,&...0B......\n 0030 a602005a 0c000000 02002021 3c040000 ...Z...... !<...\n 0040 0c000000 24840000 8fbf0014 8fb00010 ....$...........\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a0010034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80028BB0_297B0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80028D90_29990:gcc2.7.2kmc","sym":"func_80028D90_29990","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","bitwise","call"],"loc":9,"refSource":"void func_80028D90_29990(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = arg0->unk5A + (randB() & 0xF);\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028DF0_299F0);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L123-L131","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\taddiu\ta0,s0,4\n 24:\tlhu\tv1,90(s0)\n 28:\tlhu\ta1,44(s0)\n 2c:\tandi\tv0,v0,0xf\n 30:\taddu\tv1,v1,v0\n 34:\tjal\t0 \n 38:\tsh\tv1,90(s0)\n 3c:\tjal\t0 \n 40:\tmove\ta0,s0\n 44:\tlui\ta0,0x0\n 48:\tjal\t0 \n 4c:\taddiu\ta0,a0,0\n 50:\tlw\tra,20(sp)\n 54:\tlw\ts0,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-49adcb1d8c59c3fb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80028D90_29990\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028DF0_299F0\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n00000034 R_MIPS_26 createYRotationMatrix\n0000003c R_MIPS_26 func_8002A290_2AE90\n00000044 R_MIPS_HI16 func_80028DF0_299F0\n0000004c R_MIPS_LO16 func_80028DF0_299F0\n00000048 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 26040004 9603005a 9605002c 3042000f &......Z...,0B..\n 0030 00621821 0c000000 a603005a 0c000000 .b.!.......Z....\n 0040 02002021 3c040000 0c000000 24840000 .. !<.......$...\n 0050 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a001003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80028D90_29990' — lift: cannot lift 'func_80028D90_29990': function call 'jal' at 0x18 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tsb\tzero,94(s0) */\n/* 14:\tsb\tzero,97(s0) */\n/* 18:\tjal\t0 */\n/* 1c:\tsb\tzero,98(s0) */\n/* 20:\taddiu\ta0,s0,4 */\n/* 24:\tlhu\tv1,90(s0) */\n/* 28:\tlhu\ta1,44(s0) */\n/* 2c:\tandi\tv0,v0,0xf */\n/* 30:\taddu\tv1,v1,v0 */\n/* 34:\tjal\t0 */\n/* 38:\tsh\tv1,90(s0) */\n/* 3c:\tjal\t0 */\n/* 40:\tmove\ta0,s0 */\n/* 44:\tlui\ta0,0x0 */\n/* 48:\tjal\t0 */\n/* 4c:\taddiu\ta0,a0,0 */\n/* 50:\tlw\tra,20(sp) */\n/* 54:\tlw\ts0,16(sp) */\n/* 58:\tjr\tra */\n/* 5c:\taddiu\tsp,sp,24 */\nvoid func_80028D90_29990(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80028D90_29990': function call 'jal' at 0x18 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80028D90_29990': function call 'jal' at 0x18 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_80028D90_29990(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = (u16) arg0->unk5A + (randB() & 0xF);\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028DF0_299F0);\n}\n","score":0,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80028D90_29990` — benchmark function snowboardkids2:func_80028D90_29990:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80028D90_29990\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n sb\t$zero, 94($s0)\n sb\t$zero, 97($s0)\n jal\trandB\n sb\t$zero, 98($s0)\n addiu\t$a0, $s0, 4\n lhu\t$v1, 90($s0)\n lhu\t$a1, 44($s0)\n andi\t$v0, $v0, 0xf\n addu\t$v1, $v1, $v0\n jal\tcreateYRotationMatrix\n sh\t$v1, 90($s0)\n jal\tfunc_8002A290_2AE90\n move\t$a0, $s0\n lui\t$a0, %hi(func_80028DF0_299F0)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80028DF0_299F0)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80028D90_29990(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80028D90_29990 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80028D90_29990` — benchmark function snowboardkids2:func_80028D90_29990:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80028D90_29990:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\taddiu\ta0,s0,4\n 24:\tlhu\tv1,90(s0)\n 28:\tlhu\ta1,44(s0)\n 2c:\tandi\tv0,v0,0xf\n 30:\taddu\tv1,v1,v0\n 34:\tjal\t0 \n 38:\tsh\tv1,90(s0)\n 3c:\tjal\t0 \n 40:\tmove\ta0,s0\n 44:\tlui\ta0,0x0\n 48:\tjal\t0 \n 4c:\taddiu\ta0,a0,0\n 50:\tlw\tra,20(sp)\n 54:\tlw\ts0,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-49adcb1d8c59c3fb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80028D90_29990\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028DF0_299F0\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n00000034 R_MIPS_26 createYRotationMatrix\n0000003c R_MIPS_26 func_8002A290_2AE90\n00000044 R_MIPS_HI16 func_80028DF0_299F0\n0000004c R_MIPS_LO16 func_80028DF0_299F0\n00000048 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 26040004 9603005a 9605002c 3042000f &......Z...,0B..\n 0030 00621821 0c000000 a603005a 0c000000 .b.!.......Z....\n 0040 02002021 3c040000 0c000000 24840000 .. !<.......$...\n 0050 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a001003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80028D90_29990 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc","sym":"func_8002A2D0_2AED0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","bitwise","branch","call"],"loc":32,"refSource":"void func_8002A2D0_2AED0(Func297D8Arg *arg0) {\n s32 result;\n\n getCurrentAllocation();\n applyTransformToModel(arg0->model, &arg0->matrix);\n\n if (arg0->unk50 != arg0->unk52) {\n arg0->unk52 = arg0->unk50;\n setModelAnimation(arg0->model, arg0->unk50);\n arg0->unk62 = 0;\n }\n\n if (arg0->unk62 != -1) {\n result = clearModelRotation(arg0->model);\n } else {\n result = 0;\n }\n\n if (result != 0) {\n arg0->unk37 = 1;\n arg0->unk62 = (arg0->unk62 & 0x7F) + 1;\n if (arg0->unk50 == 0x98) {\n if (arg0->unk5E == 2) {\n arg0->unk50 = 0x90;\n } else {\n arg0->unk50 = arg0->unk58;\n }\n }\n }\n\n updateModelGeometry(arg0->model);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L862-L893","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,24(sp)\n 8:\tsw\tra,28(sp)\n c:\tjal\t0 \n 10:\tmove\ts0,a0\n 14:\tlw\ta0,0(s0)\n 18:\tjal\t0 \n 1c:\taddiu\ta1,s0,4\n 20:\tlh\tv1,80(s0)\n 24:\tlh\tv0,82(s0)\n 28:\tbeq\tv1,v0,44 \n 2c:\tmove\ta2,v1\n 30:\tlw\ta0,0(s0)\n 34:\tlh\ta1,80(s0)\n 38:\tjal\t0 \n 3c:\tsh\ta2,82(s0)\n 40:\tsb\tzero,98(s0)\n 44:\tlb\tv1,98(s0)\n 48:\tli\tv0,-1\n 4c:\tbeq\tv1,v0,60 \n 50:\tmove\tv0,zero\n 54:\tlw\ta0,0(s0)\n 58:\tjal\t0 \n 5c:\tnop\n 60:\tbeqz\tv0,a0 \n 64:\tli\tv1,1\n 68:\tlbu\tv0,98(s0)\n 6c:\tsb\tv1,55(s0)\n 70:\tlh\tv1,80(s0)\n 74:\tandi\tv0,v0,0x7f\n 78:\taddiu\tv0,v0,1\n 7c:\tsb\tv0,98(s0)\n 80:\tli\tv0,152\n 84:\tbne\tv1,v0,a0 \n 88:\tli\tv0,2\n 8c:\tlbu\tv1,94(s0)\n 90:\tbeq\tv1,v0,9c \n 94:\tli\tv0,144\n 98:\tlhu\tv0,88(s0)\n 9c:\tsh\tv0,80(s0)\n a0:\tjal\t0 \n a4:\tlw\ta0,0(s0)\n a8:\tlw\tra,28(sp)\n ac:\tlw\ts0,24(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,32\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3384bda726611237/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002A2D0_2AED0\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 applyTransformToModel\n00000000 *UND*\t00000000 setModelAnimation\n00000000 *UND*\t00000000 clearModelRotation\n00000000 *UND*\t00000000 updateModelGeometry\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_26 applyTransformToModel\n00000038 R_MIPS_26 setModelAnimation\n00000058 R_MIPS_26 clearModelRotation\n000000a0 R_MIPS_26 updateModelGeometry\n\n\nContents of section .text:\n 0000 27bdffe0 afb00018 afbf001c 0c000000 '...............\n 0010 00808021 8e040000 0c000000 26050004 ...!........&...\n 0020 86030050 86020052 10620006 00603021 ...P...R.b...`0!\n 0030 8e040000 86050050 0c000000 a6060052 .......P.......R\n 0040 a2000062 82030062 2402ffff 10620004 ...b...b$....b..\n 0050 00001021 8e040000 0c000000 00000000 ...!............\n 0060 1040000f 24030001 92020062 a2030037 .@..$......b...7\n 0070 86030050 3042007f 24420001 a2020062 ...P0B..$B.....b\n 0080 24020098 14620006 24020002 9203005e $....b..$......^\n 0090 10620002 24020090 96020058 a6020050 .b..$......X...P\n 00a0 0c000000 8e040000 8fbf001c 8fb00018 ................\n 00b0 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a001007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8002A2D0_2AED0' — lift: cannot lift 'func_8002A2D0_2AED0': function call 'jal' at 0xc — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-32 */\n/* 4:\tsw\ts0,24(sp) */\n/* 8:\tsw\tra,28(sp) */\n/* c:\tjal\t0 */\n/* 10:\tmove\ts0,a0 */\n/* 14:\tlw\ta0,0(s0) */\n/* 18:\tjal\t0 */\n/* 1c:\taddiu\ta1,s0,4 */\n/* 20:\tlh\tv1,80(s0) */\n/* 24:\tlh\tv0,82(s0) */\n/* 28:\tbeq\tv1,v0,44 */\n/* 2c:\tmove\ta2,v1 */\n/* 30:\tlw\ta0,0(s0) */\n/* 34:\tlh\ta1,80(s0) */\n/* 38:\tjal\t0 */\n/* 3c:\tsh\ta2,82(s0) */\n/* 40:\tsb\tzero,98(s0) */\n/* 44:\tlb\tv1,98(s0) */\n/* 48:\tli\tv0,-1 */\n/* 4c:\tbeq\tv1,v0,60 */\n/* 50:\tmove\tv0,zero */\n/* 54:\tlw\ta0,0(s0) */\n/* 58:\tjal\t0 */\n/* 5c:\tnop */\n/* 60:\tbeqz\tv0,a0 */\n/* 64:\tli\tv1,1 */\n/* 68:\tlbu\tv0,98(s0) */\n/* 6c:\tsb\tv1,55(s0) */\n/* 70:\tlh\tv1,80(s0) */\n/* 74:\tandi\tv0,v0,0x7f */\n/* 78:\taddiu\tv0,v0,1 */\n/* 7c:\tsb\tv0,98(s0) */\n/* 80:\tli\tv0,152 */\n/* 84:\tbne\tv1,v0,a0 */\n/* 88:\tli\tv0,2 */\n/* 8c:\tlbu\tv1,94(s0) */\n/* 90:\tbeq\tv1,v0,9c */\n/* 94:\tli\tv0,144 */\n/* 98:\tlhu\tv0,88(s0) */\n/* 9c:\tsh\tv0,80(s0) */\n/* a0:\tjal\t0 */\n/* a4:\tlw\ta0,0(s0) */\n/* a8:\tlw\tra,28(sp) */\n/* ac:\tlw\ts0,24(sp) */\n/* b0:\tjr\tra */\n/* b4:\taddiu\tsp,sp,32 */\n/* \t... */\nvoid func_8002A2D0_2AED0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8002A2D0_2AED0': function call 'jal' at 0xc — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":55,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8002A2D0_2AED0': function call 'jal' at 0xc — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_8002A2D0_2AED0(Func297D8Arg *arg0) {\n s16 temp_v1;\n s32 var_v0;\n u16 var_v0_2;\n\n getCurrentAllocation();\n applyTransformToModel(arg0->model, &arg0->matrix);\n temp_v1 = arg0->unk50;\n if (temp_v1 != arg0->unk52) {\n arg0->unk52 = temp_v1;\n setModelAnimation(arg0->model, arg0->unk50);\n arg0->unk62 = 0;\n }\n var_v0 = 0;\n if (arg0->unk62 != -1) {\n var_v0 = clearModelRotation(arg0->model);\n }\n if (var_v0 != 0) {\n arg0->unk37 = 1;\n arg0->unk62 = ((u8) arg0->unk62 & 0x7F) + 1;\n if (arg0->unk50 == 0x98) {\n var_v0_2 = 0x90;\n if (arg0->unk5E != 2) {\n var_v0_2 = arg0->unk58;\n }\n arg0->unk50 = (s16) var_v0_2;\n }\n }\n updateModelGeometry(arg0->model);\n}\n","score":6,"maxScore":47,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":29,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":47,"ratio":0.1276595744680851,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":5}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8002A2D0_2AED0` — benchmark function snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002A2D0_2AED0\n addiu\t$sp, $sp, -32\n sw\t$s0, 24($sp)\n sw\t$ra, 28($sp)\n jal\tgetCurrentAllocation\n move\t$s0, $a0\n lw\t$a0, 0($s0)\n jal\tapplyTransformToModel\n addiu\t$a1, $s0, 4\n lh\t$v1, 80($s0)\n lh\t$v0, 82($s0)\n beq\t$v1, $v0, .L44\n move\t$a2, $v1\n lw\t$a0, 0($s0)\n lh\t$a1, 80($s0)\n jal\tsetModelAnimation\n sh\t$a2, 82($s0)\n sb\t$zero, 98($s0)\n.L44:\n lb\t$v1, 98($s0)\n li\t$v0, -1\n beq\t$v1, $v0, .L60\n move\t$v0, $zero\n lw\t$a0, 0($s0)\n jal\tclearModelRotation\n nop\n.L60:\n beqz\t$v0, .La0\n li\t$v1, 1\n lbu\t$v0, 98($s0)\n sb\t$v1, 55($s0)\n lh\t$v1, 80($s0)\n andi\t$v0, $v0, 0x7f\n addiu\t$v0, $v0, 1\n sb\t$v0, 98($s0)\n li\t$v0, 152\n bne\t$v1, $v0, .La0\n li\t$v0, 2\n lbu\t$v1, 94($s0)\n beq\t$v1, $v0, .L9c\n li\t$v0, 144\n lhu\t$v0, 88($s0)\n.L9c:\n sh\t$v0, 80($s0)\n.La0:\n jal\tupdateModelGeometry\n lw\t$a0, 0($s0)\n lw\t$ra, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8002A2D0_2AED0(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002A2D0_2AED0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002A2D0_2AED0` — benchmark function snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,24(sp)\n 8:\tsw\tra,28(sp)\n c:\tjal\t0 \n 10:\tmove\ts0,a0\n 14:\tlw\ta0,0(s0)\n 18:\tjal\t0 \n 1c:\taddiu\ta1,s0,4\n 20:\tlh\tv1,80(s0)\n 24:\tlh\tv0,82(s0)\n 28:\tbeq\tv1,v0,44 \n 2c:\tmove\ta2,v1\n 30:\tlw\ta0,0(s0)\n 34:\tlh\ta1,80(s0)\n 38:\tjal\t0 \n 3c:\tsh\ta2,82(s0)\n 40:\tsb\tzero,98(s0)\n 44:\tlb\tv1,98(s0)\n 48:\tli\tv0,-1\n 4c:\tbeq\tv1,v0,60 \n 50:\tmove\tv0,zero\n 54:\tlw\ta0,0(s0)\n 58:\tjal\t0 \n 5c:\tnop\n 60:\tbeqz\tv0,a0 \n 64:\tli\tv1,1\n 68:\tlbu\tv0,98(s0)\n 6c:\tsb\tv1,55(s0)\n 70:\tlh\tv1,80(s0)\n 74:\tandi\tv0,v0,0x7f\n 78:\taddiu\tv0,v0,1\n 7c:\tsb\tv0,98(s0)\n 80:\tli\tv0,152\n 84:\tbne\tv1,v0,a0 \n 88:\tli\tv0,2\n 8c:\tlbu\tv1,94(s0)\n 90:\tbeq\tv1,v0,9c \n 94:\tli\tv0,144\n 98:\tlhu\tv0,88(s0)\n 9c:\tsh\tv0,80(s0)\n a0:\tjal\t0 \n a4:\tlw\ta0,0(s0)\n a8:\tlw\tra,28(sp)\n ac:\tlw\ts0,24(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,32\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3384bda726611237/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002A2D0_2AED0\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 applyTransformToModel\n00000000 *UND*\t00000000 setModelAnimation\n00000000 *UND*\t00000000 clearModelRotation\n00000000 *UND*\t00000000 updateModelGeometry\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_26 applyTransformToModel\n00000038 R_MIPS_26 setModelAnimation\n00000058 R_MIPS_26 clearModelRotation\n000000a0 R_MIPS_26 updateModelGeometry\n\n\nContents of section .text:\n 0000 27bdffe0 afb00018 afbf001c 0c000000 '...............\n 0010 00808021 8e040000 0c000000 26050004 ...!........&...\n 0020 86030050 86020052 10620006 00603021 ...P...R.b...`0!\n 0030 8e040000 86050050 0c000000 a6060052 .......P.......R\n 0040 a2000062 82030062 2402ffff 10620004 ...b...b$....b..\n 0050 00001021 8e040000 0c000000 00000000 ...!............\n 0060 1040000f 24030001 92020062 a2030037 .@..$......b...7\n 0070 86030050 3042007f 24420001 a2020062 ...P0B..$B.....b\n 0080 24020098 14620006 24020002 9203005e $....b..$......^\n 0090 10620002 24020090 96020058 a6020050 .b..$......X...P\n 00a0 0c000000 8e040000 8fbf001c 8fb00018 ................\n 00b0 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a001007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002A2D0_2AED0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc","sym":"func_8002A390_2AF90","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["switch","struct","call","branch","global"],"loc":49,"refSource":"s32 func_8002A390_2AF90(Func8002A390Arg *arg0) {\n GameState *state;\n s32 stateVal;\n\n state = getCurrentAllocation();\n stateVal = arg0->unk5E;\n\n switch (stateVal) {\n case 0:\n if (func_8002A4AC_2B0AC(&arg0->matrix, arg0->unk5D) != 0) {\n return 1;\n }\n if (state->unk421 != 0) {\n return 0;\n }\n if (func_8002ACFC_2B8FC(arg0->matrix.translation.x, arg0->matrix.translation.z, arg0->unk2E) == 0) {\n return 0;\n }\n arg0->unk54 = arg0->unk50;\n if (arg0->unk5D == 5) {\n arg0->unk50 = 0x21;\n } else {\n arg0->unk50 = 0;\n }\n arg0->unk61 = arg0->unk5E;\n arg0->unk5E = 0x44;\n break;\n case 1:\n case 2:\n case 3:\n case 4:\n if (func_8002A7CC_2B3CC(arg0) == 0) {\n return 0;\n }\n arg0->unk61 = arg0->unk5E;\n arg0->unk5E = 0;\n break;\n case 0x44:\n if (func_8002A7CC_2B3CC(arg0) == 0) {\n return 0;\n }\n arg0->unk61 = arg0->unk5E;\n arg0->unk5E = 0;\n arg0->unk50 = arg0->unk54;\n break;\n }\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L34-L82","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,24(sp)\n 10:\tjal\t0 \n 14:\tsw\ts1,20(sp)\n 18:\tlbu\tv1,94(s0)\n 1c:\tmove\ts1,v0\n 20:\tslti\tv0,v1,5\n 24:\tbeqzl\tv0,44 \n 28:\tli\tv0,68\n 2c:\tbnez\tv1,c0 \n 30:\tnop\n 34:\tbeqz\tv1,54 \n 38:\tmove\tv0,zero\n 3c:\tj\t108 \n 40:\tnop\n 44:\tbeq\tv1,v0,e0 \n 48:\tmove\tv0,zero\n 4c:\tj\t108 \n 50:\tnop\n 54:\tlbu\ta1,93(s0)\n 58:\tjal\t0 \n 5c:\taddiu\ta0,s0,4\n 60:\tbnez\tv0,108 \n 64:\tli\tv0,1\n 68:\tlbu\tv0,1057(s1)\n 6c:\tbnez\tv0,108 \n 70:\tmove\tv0,zero\n 74:\tlw\ta0,24(s0)\n 78:\tlw\ta1,32(s0)\n 7c:\tjal\t0 \n 80:\tlh\ta2,46(s0)\n 84:\tbeqz\tv0,108 \n 88:\tmove\tv0,zero\n 8c:\tlhu\tv0,80(s0)\n 90:\tlbu\tv1,93(s0)\n 94:\tsh\tv0,84(s0)\n 98:\tli\tv0,5\n 9c:\tbnel\tv1,v0,ac \n a0:\tsh\tzero,80(s0)\n a4:\tli\tv0,33\n a8:\tsh\tv0,80(s0)\n ac:\tlbu\tv1,94(s0)\n b0:\tli\tv0,68\n b4:\tsb\tv0,94(s0)\n b8:\tj\t104 \n bc:\tsb\tv1,97(s0)\n c0:\tjal\t0 \n c4:\tmove\ta0,s0\n c8:\tbeqz\tv0,108 \n cc:\tmove\tv0,zero\n d0:\tlbu\tv0,94(s0)\n d4:\tsb\tzero,94(s0)\n d8:\tj\t104 \n dc:\tsb\tv0,97(s0)\n e0:\tjal\t0 \n e4:\tmove\ta0,s0\n e8:\tbeqz\tv0,108 \n ec:\tmove\tv0,zero\n f0:\tlbu\tv0,94(s0)\n f4:\tlhu\tv1,84(s0)\n f8:\tsb\tzero,94(s0)\n fc:\tsb\tv0,97(s0)\n 100:\tsh\tv1,80(s0)\n 104:\tmove\tv0,zero\n 108:\tlw\tra,24(sp)\n 10c:\tlw\ts1,20(sp)\n 110:\tlw\ts0,16(sp)\n 114:\tjr\tra\n 118:\taddiu\tsp,sp,32\n 11c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e91a09b3f45124d2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000011c func_8002A390_2AF90\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8002A4AC_2B0AC\n00000000 *UND*\t00000000 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 func_8002A7CC_2B3CC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 getCurrentAllocation\n0000003c R_MIPS_26 .text\n0000004c R_MIPS_26 .text\n00000058 R_MIPS_26 func_8002A4AC_2B0AC\n0000007c R_MIPS_26 func_8002ACFC_2B8FC\n000000b8 R_MIPS_26 .text\n000000c0 R_MIPS_26 func_8002A7CC_2B3CC\n000000d8 R_MIPS_26 .text\n000000e0 R_MIPS_26 func_8002A7CC_2B3CC\n\n\nContents of section .text:\n 0000 27bdffe0 afb00010 00808021 afbf0018 '..........!....\n 0010 0c000000 afb10014 9203005e 00408821 ...........^.@.!\n 0020 28620005 50400007 24020044 14600024 (b..P@..$..D.`.$\n 0030 00000000 10600007 00001021 08000042 .....`.....!...B\n 0040 00000000 10620026 00001021 08000042 .....b.&...!...B\n 0050 00000000 9205005d 0c000000 26040004 .......]....&...\n 0060 14400029 24020001 92220421 14400026 .@.)$....\".!.@.&\n 0070 00001021 8e040018 8e050020 0c000000 ...!....... ....\n 0080 8606002e 10400020 00001021 96020050 .....@. ...!...P\n 0090 9203005d a6020054 24020005 54620003 ...]...T$...Tb..\n 00a0 a6000050 24020021 a6020050 9203005e ...P$..!...P...^\n 00b0 24020044 a202005e 08000041 a2030061 $..D...^...A...a\n 00c0 0c000000 02002021 1040000f 00001021 ...... !.@.....!\n 00d0 9202005e a200005e 08000041 a2020061 ...^...^...A...a\n 00e0 0c000000 02002021 10400007 00001021 ...... !.@.....!\n 00f0 9202005e 96030054 a200005e a2020061 ...^...T...^...a\n 0100 a6030050 00001021 8fbf0018 8fb10014 ...P...!........\n 0110 8fb00010 03e00008 27bd0020 00000000 ........'.. ....\nContents of section .reginfo:\n 0000 a003007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8002A390_2AF90' — lift: cannot lift 'func_8002A390_2AF90': function call 'jal' at 0x10 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-32 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,24(sp) */\n/* 10:\tjal\t0 */\n/* 14:\tsw\ts1,20(sp) */\n/* 18:\tlbu\tv1,94(s0) */\n/* 1c:\tmove\ts1,v0 */\n/* 20:\tslti\tv0,v1,5 */\n/* 24:\tbeqzl\tv0,44 */\n/* 28:\tli\tv0,68 */\n/* 2c:\tbnez\tv1,c0 */\n/* 30:\tnop */\n/* 34:\tbeqz\tv1,54 */\n/* 38:\tmove\tv0,zero */\n/* 3c:\tj\t108 */\n/* 40:\tnop */\n/* 44:\tbeq\tv1,v0,e0 */\n/* 48:\tmove\tv0,zero */\n/* 4c:\tj\t108 */\n/* 50:\tnop */\n/* 54:\tlbu\ta1,93(s0) */\n/* 58:\tjal\t0 */\n/* 5c:\taddiu\ta0,s0,4 */\n/* 60:\tbnez\tv0,108 */\n/* 64:\tli\tv0,1 */\n/* 68:\tlbu\tv0,1057(s1) */\n/* 6c:\tbnez\tv0,108 */\n/* 70:\tmove\tv0,zero */\n/* 74:\tlw\ta0,24(s0) */\n/* 78:\tlw\ta1,32(s0) */\n/* 7c:\tjal\t0 */\n/* 80:\tlh\ta2,46(s0) */\n/* 84:\tbeqz\tv0,108 */\n/* 88:\tmove\tv0,zero */\n/* 8c:\tlhu\tv0,80(s0) */\n/* 90:\tlbu\tv1,93(s0) */\n/* 94:\tsh\tv0,84(s0) */\n/* 98:\tli\tv0,5 */\n/* 9c:\tbnel\tv1,v0,ac */\n/* a0:\tsh\tzero,80(s0) */\n/* a4:\tli\tv0,33 */\n/* a8:\tsh\tv0,80(s0) */\n/* ac:\tlbu\tv1,94(s0) */\n/* b0:\tli\tv0,68 */\n/* b4:\tsb\tv0,94(s0) */\n/* b8:\tj\t104 */\n/* bc:\tsb\tv1,97(s0) */\n/* c0:\tjal\t0 */\n/* c4:\tmove\ta0,s0 */\n/* c8:\tbeqz\tv0,108 */\n/* cc:\tmove\tv0,zero */\n/* d0:\tlbu\tv0,94(s0) */\n/* d4:\tsb\tzero,94(s0) */\n/* d8:\tj\t104 */\n/* dc:\tsb\tv0,97(s0) */\n/* e0:\tjal\t0 */\n/* e4:\tmove\ta0,s0 */\n/* e8:\tbeqz\tv0,108 */\n/* ec:\tmove\tv0,zero */\n/* f0:\tlbu\tv0,94(s0) */\n/* f4:\tlhu\tv1,84(s0) */\n/* f8:\tsb\tzero,94(s0) */\n/* fc:\tsb\tv0,97(s0) */\n/* 100:\tsh\tv1,80(s0) */\n/* 104:\tmove\tv0,zero */\n/* 108:\tlw\tra,24(sp) */\n/* 10c:\tlw\ts1,20(sp) */\n/* 110:\tlw\ts0,16(sp) */\n/* 114:\tjr\tra */\n/* 118:\taddiu\tsp,sp,32 */\n/* 11c:\tnop */\nvoid func_8002A390_2AF90(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8002A390_2AF90': function call 'jal' at 0x10 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":80,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8002A390_2AF90': function call 'jal' at 0x10 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 func_8002A4AC_2B0AC(void *, u8); /* extern */\ns32 func_8002A7CC_2B3CC(void *); /* extern */\ns32 func_8002ACFC_2B8FC(s32, s32, s16); /* extern */\nvoid *getCurrentAllocation(); /* extern */\n\ns32 func_8002A390_2AF90(void *arg0) {\n s32 var_v0;\n u8 temp_v0;\n u8 temp_v0_2;\n u8 temp_v1;\n u8 temp_v1_2;\n void *temp_s1;\n\n temp_v1 = arg0->unk5E;\n temp_s1 = getCurrentAllocation();\n if ((s32) temp_v1 >= 5) {\n if (temp_v1 != 0x44) {\n return 0;\n }\n var_v0 = 0;\n if (func_8002A7CC_2B3CC(arg0) != 0) {\n temp_v0 = arg0->unk5E;\n arg0->unk5E = 0U;\n arg0->unk61 = temp_v0;\n arg0->unk50 = (u16) arg0->unk54;\n goto block_20;\n }\n /* Duplicate return node #21. Try simplifying control flow for better match */\n return var_v0;\n }\n if (temp_v1 == 0) {\n if (temp_v1 != 0) {\n return 0;\n }\n var_v0 = 1;\n if (func_8002A4AC_2B0AC(arg0 + 4, arg0->unk5D) == 0) {\n var_v0 = 0;\n if (temp_s1->unk421 == 0) {\n var_v0 = 0;\n if (func_8002ACFC_2B8FC(arg0->unk18, arg0->unk20, arg0->unk2E) != 0) {\n arg0->unk54 = (u16) arg0->unk50;\n if (arg0->unk5D != 5) {\n arg0->unk50 = 0U;\n } else {\n arg0->unk50 = 0x21U;\n }\n temp_v1_2 = arg0->unk5E;\n arg0->unk5E = 0x44U;\n arg0->unk61 = temp_v1_2;\n goto block_20;\n }\n }\n }\n /* Duplicate return node #21. Try simplifying control flow for better match */\n return var_v0;\n }\n var_v0 = 0;\n if (func_8002A7CC_2B3CC(arg0) != 0) {\n temp_v0_2 = arg0->unk5E;\n arg0->unk5E = 0U;\n arg0->unk61 = temp_v0_2;\nblock_20:\n var_v0 = 0;\n }\n return var_v0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":76,"lines":64,"gotos":2,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:2636: request for member `unk5E' in something not a structure or union","/c.i:2644: request for member `unk5E' in something not a structure or union","/c.i:2645: request for member `unk5E' in something not a structure or union","/c.i:2646: request for member `unk61' in something not a structure or union","/c.i:2647: request for member `unk50' in something not a structure or union"]},"note":"src/2AF90.c: state-machine step with fall-through switch cases over a mode byte","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8002A390_2AF90` — benchmark function snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002A390_2AF90\n addiu\t$sp, $sp, -32\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 24($sp)\n jal\tgetCurrentAllocation\n sw\t$s1, 20($sp)\n lbu\t$v1, 94($s0)\n move\t$s1, $v0\n slti\t$v0, $v1, 5\n beqzl\t$v0, .L44\n li\t$v0, 68\n bnez\t$v1, .Lc0\n nop\n beqz\t$v1, .L54\n move\t$v0, $zero\n j\t.L108\n nop\n.L44:\n beq\t$v1, $v0, .Le0\n move\t$v0, $zero\n j\t.L108\n nop\n.L54:\n lbu\t$a1, 93($s0)\n jal\tfunc_8002A4AC_2B0AC\n addiu\t$a0, $s0, 4\n bnez\t$v0, .L108\n li\t$v0, 1\n lbu\t$v0, 1057($s1)\n bnez\t$v0, .L108\n move\t$v0, $zero\n lw\t$a0, 24($s0)\n lw\t$a1, 32($s0)\n jal\tfunc_8002ACFC_2B8FC\n lh\t$a2, 46($s0)\n beqz\t$v0, .L108\n move\t$v0, $zero\n lhu\t$v0, 80($s0)\n lbu\t$v1, 93($s0)\n sh\t$v0, 84($s0)\n li\t$v0, 5\n bnel\t$v1, $v0, .Lac\n sh\t$zero, 80($s0)\n li\t$v0, 33\n sh\t$v0, 80($s0)\n.Lac:\n lbu\t$v1, 94($s0)\n li\t$v0, 68\n sb\t$v0, 94($s0)\n j\t.L104\n sb\t$v1, 97($s0)\n.Lc0:\n jal\tfunc_8002A7CC_2B3CC\n move\t$a0, $s0\n beqz\t$v0, .L108\n move\t$v0, $zero\n lbu\t$v0, 94($s0)\n sb\t$zero, 94($s0)\n j\t.L104\n sb\t$v0, 97($s0)\n.Le0:\n jal\tfunc_8002A7CC_2B3CC\n move\t$a0, $s0\n beqz\t$v0, .L108\n move\t$v0, $zero\n lbu\t$v0, 94($s0)\n lhu\t$v1, 84($s0)\n sb\t$zero, 94($s0)\n sb\t$v0, 97($s0)\n sh\t$v1, 80($s0)\n.L104:\n move\t$v0, $zero\n.L108:\n lw\t$ra, 24($sp)\n lw\t$s1, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002A390_2AF90 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002A390_2AF90` — benchmark function snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,24(sp)\n 10:\tjal\t0 \n 14:\tsw\ts1,20(sp)\n 18:\tlbu\tv1,94(s0)\n 1c:\tmove\ts1,v0\n 20:\tslti\tv0,v1,5\n 24:\tbeqzl\tv0,44 \n 28:\tli\tv0,68\n 2c:\tbnez\tv1,c0 \n 30:\tnop\n 34:\tbeqz\tv1,54 \n 38:\tmove\tv0,zero\n 3c:\tj\t108 \n 40:\tnop\n 44:\tbeq\tv1,v0,e0 \n 48:\tmove\tv0,zero\n 4c:\tj\t108 \n 50:\tnop\n 54:\tlbu\ta1,93(s0)\n 58:\tjal\t0 \n 5c:\taddiu\ta0,s0,4\n 60:\tbnez\tv0,108 \n 64:\tli\tv0,1\n 68:\tlbu\tv0,1057(s1)\n 6c:\tbnez\tv0,108 \n 70:\tmove\tv0,zero\n 74:\tlw\ta0,24(s0)\n 78:\tlw\ta1,32(s0)\n 7c:\tjal\t0 \n 80:\tlh\ta2,46(s0)\n 84:\tbeqz\tv0,108 \n 88:\tmove\tv0,zero\n 8c:\tlhu\tv0,80(s0)\n 90:\tlbu\tv1,93(s0)\n 94:\tsh\tv0,84(s0)\n 98:\tli\tv0,5\n 9c:\tbnel\tv1,v0,ac \n a0:\tsh\tzero,80(s0)\n a4:\tli\tv0,33\n a8:\tsh\tv0,80(s0)\n ac:\tlbu\tv1,94(s0)\n b0:\tli\tv0,68\n b4:\tsb\tv0,94(s0)\n b8:\tj\t104 \n bc:\tsb\tv1,97(s0)\n c0:\tjal\t0 \n c4:\tmove\ta0,s0\n c8:\tbeqz\tv0,108 \n cc:\tmove\tv0,zero\n d0:\tlbu\tv0,94(s0)\n d4:\tsb\tzero,94(s0)\n d8:\tj\t104 \n dc:\tsb\tv0,97(s0)\n e0:\tjal\t0 \n e4:\tmove\ta0,s0\n e8:\tbeqz\tv0,108 \n ec:\tmove\tv0,zero\n f0:\tlbu\tv0,94(s0)\n f4:\tlhu\tv1,84(s0)\n f8:\tsb\tzero,94(s0)\n fc:\tsb\tv0,97(s0)\n 100:\tsh\tv1,80(s0)\n 104:\tmove\tv0,zero\n 108:\tlw\tra,24(sp)\n 10c:\tlw\ts1,20(sp)\n 110:\tlw\ts0,16(sp)\n 114:\tjr\tra\n 118:\taddiu\tsp,sp,32\n 11c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e91a09b3f45124d2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000011c func_8002A390_2AF90\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8002A4AC_2B0AC\n00000000 *UND*\t00000000 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 func_8002A7CC_2B3CC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 getCurrentAllocation\n0000003c R_MIPS_26 .text\n0000004c R_MIPS_26 .text\n00000058 R_MIPS_26 func_8002A4AC_2B0AC\n0000007c R_MIPS_26 func_8002ACFC_2B8FC\n000000b8 R_MIPS_26 .text\n000000c0 R_MIPS_26 func_8002A7CC_2B3CC\n000000d8 R_MIPS_26 .text\n000000e0 R_MIPS_26 func_8002A7CC_2B3CC\n\n\nContents of section .text:\n 0000 27bdffe0 afb00010 00808021 afbf0018 '..........!....\n 0010 0c000000 afb10014 9203005e 00408821 ...........^.@.!\n 0020 28620005 50400007 24020044 14600024 (b..P@..$..D.`.$\n 0030 00000000 10600007 00001021 08000042 .....`.....!...B\n 0040 00000000 10620026 00001021 08000042 .....b.&...!...B\n 0050 00000000 9205005d 0c000000 26040004 .......]....&...\n 0060 14400029 24020001 92220421 14400026 .@.)$....\".!.@.&\n 0070 00001021 8e040018 8e050020 0c000000 ...!....... ....\n 0080 8606002e 10400020 00001021 96020050 .....@. ...!...P\n 0090 9203005d a6020054 24020005 54620003 ...]...T$...Tb..\n 00a0 a6000050 24020021 a6020050 9203005e ...P$..!...P...^\n 00b0 24020044 a202005e 08000041 a2030061 $..D...^...A...a\n 00c0 0c000000 02002021 1040000f 00001021 ...... !.@.....!\n 00d0 9202005e a200005e 08000041 a2020061 ...^...^...A...a\n 00e0 0c000000 02002021 10400007 00001021 ...... !.@.....!\n 00f0 9202005e 96030054 a200005e a2020061 ...^...T...^...a\n 0100 a6030050 00001021 8fbf0018 8fb10014 ...P...!........\n 0110 8fb00010 03e00008 27bd0020 00000000 ........'.. ....\nContents of section .reginfo:\n 0000 a003007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002A390_2AF90 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc","sym":"func_8002ACFC_2B8FC","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["call","fixedpoint","branch","global"],"loc":14,"refSource":"s32 func_8002ACFC_2B8FC(s32 arg0, s32 arg1, s16 arg2) {\n GameState *state;\n s16 angle;\n\n state = getCurrentAllocation();\n angle = func_8006D21C_6DE1C(state->unk3EC, state->unk3F0, arg0, arg1);\n\n if (arg2 - 0x238 < angle && angle < arg2 + 0x238) {\n if (distance_2d(state->unk3EC - arg0, state->unk3F0 - arg1) <= 0x280000) {\n return 1;\n }\n }\n return 0;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L88-L101","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,24(sp)\n 8:\tmove\ts2,a0\n c:\tsw\ts3,28(sp)\n 10:\tmove\ts3,a1\n 14:\tsw\ts0,16(sp)\n 18:\tmove\ts0,a2\n 1c:\tsw\tra,32(sp)\n 20:\tjal\t0 \n 24:\tsw\ts1,20(sp)\n 28:\tmove\ts1,v0\n 2c:\tlw\ta0,1004(s1)\n 30:\tlw\ta1,1008(s1)\n 34:\tmove\ta2,s2\n 38:\tjal\t0 \n 3c:\tmove\ta3,s3\n 40:\tsll\ts0,s0,0x10\n 44:\tsra\ts0,s0,0x10\n 48:\taddiu\tv1,s0,-568\n 4c:\tsll\tv0,v0,0x10\n 50:\tsra\ta0,v0,0x10\n 54:\tslt\tv1,v1,a0\n 58:\tbeqz\tv1,98 \n 5c:\taddiu\tv0,s0,568\n 60:\tslt\tv0,a0,v0\n 64:\tbeqz\tv0,9c \n 68:\tmove\tv0,zero\n 6c:\tlw\ta0,1004(s1)\n 70:\tlw\ta1,1008(s1)\n 74:\tsubu\ta0,a0,s2\n 78:\tjal\t0 \n 7c:\tsubu\ta1,a1,s3\n 80:\tlui\tv1,0x28\n 84:\tslt\tv1,v1,v0\n 88:\tbnez\tv1,9c \n 8c:\tmove\tv0,zero\n 90:\tj\t9c \n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tlw\tra,32(sp)\n a0:\tlw\ts3,28(sp)\n a4:\tlw\ts2,24(sp)\n a8:\tlw\ts1,20(sp)\n ac:\tlw\ts0,16(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,40\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0e839e3e93bac188/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8006D21C_6DE1C\n00000000 *UND*\t00000000 distance_2d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 getCurrentAllocation\n00000038 R_MIPS_26 func_8006D21C_6DE1C\n00000078 R_MIPS_26 distance_2d\n00000090 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffd8 afb20018 00809021 afb3001c '..........!....\n 0010 00a09821 afb00010 00c08021 afbf0020 ...!.......!... \n 0020 0c000000 afb10014 00408821 8e2403ec .........@.!.$..\n 0030 8e2503f0 02403021 0c000000 02603821 .%...@0!.....`8!\n 0040 00108400 00108403 2603fdc8 00021400 ........&.......\n 0050 00022403 0064182a 1060000f 26020238 ..$..d.*.`..&..8\n 0060 0082102a 1040000d 00001021 8e2403ec ...*.@.....!.$..\n 0070 8e2503f0 00922023 0c000000 00b32823 .%.... #......(#\n 0080 3c030028 0062182a 14600004 00001021 <..(.b.*.`.....!\n 0090 08000027 24020001 00001021 8fbf0020 ...'$......!... \n 00a0 8fb3001c 8fb20018 8fb10014 8fb00010 ................\n 00b0 03e00008 27bd0028 00000000 00000000 ....'..(........\nContents of section .reginfo:\n 0000 a00f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8002ACFC_2B8FC' — lift: cannot lift 'func_8002ACFC_2B8FC': function call 'jal' at 0x20 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-40 */\n/* 4:\tsw\ts2,24(sp) */\n/* 8:\tmove\ts2,a0 */\n/* c:\tsw\ts3,28(sp) */\n/* 10:\tmove\ts3,a1 */\n/* 14:\tsw\ts0,16(sp) */\n/* 18:\tmove\ts0,a2 */\n/* 1c:\tsw\tra,32(sp) */\n/* 20:\tjal\t0 */\n/* 24:\tsw\ts1,20(sp) */\n/* 28:\tmove\ts1,v0 */\n/* 2c:\tlw\ta0,1004(s1) */\n/* 30:\tlw\ta1,1008(s1) */\n/* 34:\tmove\ta2,s2 */\n/* 38:\tjal\t0 */\n/* 3c:\tmove\ta3,s3 */\n/* 40:\tsll\ts0,s0,0x10 */\n/* 44:\tsra\ts0,s0,0x10 */\n/* 48:\taddiu\tv1,s0,-568 */\n/* 4c:\tsll\tv0,v0,0x10 */\n/* 50:\tsra\ta0,v0,0x10 */\n/* 54:\tslt\tv1,v1,a0 */\n/* 58:\tbeqz\tv1,98 */\n/* 5c:\taddiu\tv0,s0,568 */\n/* 60:\tslt\tv0,a0,v0 */\n/* 64:\tbeqz\tv0,9c */\n/* 68:\tmove\tv0,zero */\n/* 6c:\tlw\ta0,1004(s1) */\n/* 70:\tlw\ta1,1008(s1) */\n/* 74:\tsubu\ta0,a0,s2 */\n/* 78:\tjal\t0 */\n/* 7c:\tsubu\ta1,a1,s3 */\n/* 80:\tlui\tv1,0x28 */\n/* 84:\tslt\tv1,v1,v0 */\n/* 88:\tbnez\tv1,9c */\n/* 8c:\tmove\tv0,zero */\n/* 90:\tj\t9c */\n/* 94:\tli\tv0,1 */\n/* 98:\tmove\tv0,zero */\n/* 9c:\tlw\tra,32(sp) */\n/* a0:\tlw\ts3,28(sp) */\n/* a4:\tlw\ts2,24(sp) */\n/* a8:\tlw\ts1,20(sp) */\n/* ac:\tlw\ts0,16(sp) */\n/* b0:\tjr\tra */\n/* b4:\taddiu\tsp,sp,40 */\n/* \t... */\nvoid func_8002ACFC_2B8FC(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8002ACFC_2B8FC': function call 'jal' at 0x20 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":55,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8002ACFC_2B8FC': function call 'jal' at 0x20 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 distance_2d(s32, s32); /* extern */\ns16 func_8006D21C_6DE1C(s32, s32, s32, s32); /* extern */\nvoid *getCurrentAllocation(); /* extern */\n\ns32 func_8002ACFC_2B8FC(s32 arg0, s32 arg1, s16 arg2) {\n s16 temp_v0_2;\n void *temp_v0;\n\n temp_v0 = getCurrentAllocation();\n temp_v0_2 = func_8006D21C_6DE1C(temp_v0->unk3EC, temp_v0->unk3F0, arg0, arg1);\n if ((arg2 - 0x238) < temp_v0_2) {\n if ((temp_v0_2 < (arg2 + 0x238)) && (distance_2d(temp_v0->unk3EC - arg0, temp_v0->unk3F0 - arg1) <= 0x280000)) {\n return 1;\n }\n /* Duplicate return node #5. Try simplifying control flow for better match */\n return 0;\n }\n return 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:2610: request for member `unk3EC' in something not a structure or union","/c.i:2610: request for member `unk3F0' in something not a structure or union","/c.i:2612: request for member `unk3EC' in something not a structure or union","/c.i:2612: request for member `unk3F0' in something not a structure or union"]},"note":"src/2AF90.c: proximity/heading test against the player position; fixed-point distance check","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8002ACFC_2B8FC` — benchmark function snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002ACFC_2B8FC\n addiu\t$sp, $sp, -40\n sw\t$s2, 24($sp)\n move\t$s2, $a0\n sw\t$s3, 28($sp)\n move\t$s3, $a1\n sw\t$s0, 16($sp)\n move\t$s0, $a2\n sw\t$ra, 32($sp)\n jal\tgetCurrentAllocation\n sw\t$s1, 20($sp)\n move\t$s1, $v0\n lw\t$a0, 1004($s1)\n lw\t$a1, 1008($s1)\n move\t$a2, $s2\n jal\tfunc_8006D21C_6DE1C\n move\t$a3, $s3\n sll\t$s0, $s0, 0x10\n sra\t$s0, $s0, 0x10\n addiu\t$v1, $s0, -568\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n slt\t$v1, $v1, $a0\n beqz\t$v1, .L98\n addiu\t$v0, $s0, 568\n slt\t$v0, $a0, $v0\n beqz\t$v0, .L9c\n move\t$v0, $zero\n lw\t$a0, 1004($s1)\n lw\t$a1, 1008($s1)\n subu\t$a0, $a0, $s2\n jal\tdistance_2d\n subu\t$a1, $a1, $s3\n lui\t$v1, 0x28\n slt\t$v1, $v1, $v0\n bnez\t$v1, .L9c\n move\t$v0, $zero\n j\t.L9c\n li\t$v0, 1\n.L98:\n move\t$v0, $zero\n.L9c:\n lw\t$ra, 32($sp)\n lw\t$s3, 28($sp)\n lw\t$s2, 24($sp)\n lw\t$s1, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002ACFC_2B8FC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002ACFC_2B8FC` — benchmark function snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,24(sp)\n 8:\tmove\ts2,a0\n c:\tsw\ts3,28(sp)\n 10:\tmove\ts3,a1\n 14:\tsw\ts0,16(sp)\n 18:\tmove\ts0,a2\n 1c:\tsw\tra,32(sp)\n 20:\tjal\t0 \n 24:\tsw\ts1,20(sp)\n 28:\tmove\ts1,v0\n 2c:\tlw\ta0,1004(s1)\n 30:\tlw\ta1,1008(s1)\n 34:\tmove\ta2,s2\n 38:\tjal\t0 \n 3c:\tmove\ta3,s3\n 40:\tsll\ts0,s0,0x10\n 44:\tsra\ts0,s0,0x10\n 48:\taddiu\tv1,s0,-568\n 4c:\tsll\tv0,v0,0x10\n 50:\tsra\ta0,v0,0x10\n 54:\tslt\tv1,v1,a0\n 58:\tbeqz\tv1,98 \n 5c:\taddiu\tv0,s0,568\n 60:\tslt\tv0,a0,v0\n 64:\tbeqz\tv0,9c \n 68:\tmove\tv0,zero\n 6c:\tlw\ta0,1004(s1)\n 70:\tlw\ta1,1008(s1)\n 74:\tsubu\ta0,a0,s2\n 78:\tjal\t0 \n 7c:\tsubu\ta1,a1,s3\n 80:\tlui\tv1,0x28\n 84:\tslt\tv1,v1,v0\n 88:\tbnez\tv1,9c \n 8c:\tmove\tv0,zero\n 90:\tj\t9c \n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tlw\tra,32(sp)\n a0:\tlw\ts3,28(sp)\n a4:\tlw\ts2,24(sp)\n a8:\tlw\ts1,20(sp)\n ac:\tlw\ts0,16(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,40\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0e839e3e93bac188/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8006D21C_6DE1C\n00000000 *UND*\t00000000 distance_2d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 getCurrentAllocation\n00000038 R_MIPS_26 func_8006D21C_6DE1C\n00000078 R_MIPS_26 distance_2d\n00000090 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffd8 afb20018 00809021 afb3001c '..........!....\n 0010 00a09821 afb00010 00c08021 afbf0020 ...!.......!... \n 0020 0c000000 afb10014 00408821 8e2403ec .........@.!.$..\n 0030 8e2503f0 02403021 0c000000 02603821 .%...@0!.....`8!\n 0040 00108400 00108403 2603fdc8 00021400 ........&.......\n 0050 00022403 0064182a 1060000f 26020238 ..$..d.*.`..&..8\n 0060 0082102a 1040000d 00001021 8e2403ec ...*.@.....!.$..\n 0070 8e2503f0 00922023 0c000000 00b32823 .%.... #......(#\n 0080 3c030028 0062182a 14600004 00001021 <..(.b.*.`.....!\n 0090 08000027 24020001 00001021 8fbf0020 ...'$......!... \n 00a0 8fb3001c 8fb20018 8fb10014 8fb00010 ................\n 00b0 03e00008 27bd0028 00000000 00000000 ....'..(........\nContents of section .reginfo:\n 0000 a00f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002ACFC_2B8FC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc","sym":"func_8002ADB4_2B9B4","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["fixedpoint","bitwise","branch","compare"],"loc":52,"refSource":"s16 func_8002ADB4_2B9B4(s16 arg0, s16 arg1) {\n s16 target;\n s16 current;\n s32 diff;\n s16 absDiff;\n s16 direction;\n\n target = arg0;\n current = arg1;\n\n if (arg0 == arg1) {\n goto done;\n }\n\n diff = arg0 - arg1;\n diff = ABS(diff);\n\n if ((s16)diff >= 0x1001) {\n if (arg1 < arg0) {\n current = arg1 + 0x2000;\n } else {\n target = arg0 + 0x2000;\n }\n }\n\n arg0 = target;\n arg1 = current;\n\n diff = arg0 - arg1;\n absDiff = ABS(diff);\n\n if (absDiff >= 0xAAB) {\n current += 0x1000;\n goto done;\n }\n\n if (arg1 < arg0) {\n direction = 1;\n } else {\n direction = -1;\n }\n\n if (absDiff >= 0x80) {\n current += direction << 7;\n goto done;\n }\n\n current = (current + absDiff * direction) & 0x1FFF;\n\ndone:\n return current;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L103-L162","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,a0\n 4:\tsll\tv0,a0,0x10\n 8:\tsra\ta2,v0,0x10\n c:\tsll\tv0,a1,0x10\n 10:\tsra\tv1,v0,0x10\n 14:\tbeq\ta2,v1,c0 \n 18:\tmove\ta3,a1\n 1c:\tsubu\tv0,a2,v1\n 20:\tbltzl\tv0,28 \n 24:\tnegu\tv0,v0\n 28:\tsll\tv0,v0,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tslti\tv0,v0,4097\n 34:\tbnez\tv0,50 \n 38:\tsll\tv0,t0,0x10\n 3c:\tslt\tv0,v1,a2\n 40:\tbeqzl\tv0,4c \n 44:\taddiu\tt0,a0,8192\n 48:\taddiu\ta3,a1,8192\n 4c:\tsll\tv0,t0,0x10\n 50:\tsra\ta1,v0,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tsra\tv1,v0,0x10\n 5c:\tsubu\tv0,a1,v1\n 60:\tbgez\tv0,6c \n 64:\tmove\ta2,v0\n 68:\tnegu\ta2,a2\n 6c:\tsll\tv0,a2,0x10\n 70:\tsra\ta0,v0,0x10\n 74:\tslti\tv0,a0,2731\n 78:\tbnezl\tv0,88 \n 7c:\tslt\tv0,v1,a1\n 80:\tj\tc0 \n 84:\taddiu\ta3,a3,4096\n 88:\txori\tv0,v0,0x1\n 8c:\tnegu\tv0,v0\n 90:\tori\tv1,v0,0x1\n 94:\tslti\tv0,a0,128\n 98:\tbnez\tv0,ac \n 9c:\tnop\n a0:\tsll\tv0,v1,0x7\n a4:\tj\tc0 \n a8:\taddu\ta3,a3,v0\n ac:\tnop\n b0:\tmult\ta2,v1\n b4:\tmflo\tv0\n b8:\taddu\tv0,a3,v0\n bc:\tandi\ta3,v0,0x1fff\n c0:\tsll\tv0,a3,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-032753bac235c323/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000cc func_8002ADB4_2B9B4\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000080 R_MIPS_26 .text\n000000a4 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00804021 00041400 00023403 00051400 ..@!......4.....\n 0010 00021c03 10c3002a 00a03821 00c31023 .......*..8!...#\n 0020 04420001 00021023 00021400 00021403 .B.....#........\n 0030 28421001 14400006 00081400 0066102a (B...@.......f.*\n 0040 50400002 24882000 24a72000 00081400 P@..$. .$. .....\n 0050 00022c03 00071400 00021c03 00a31023 ..,............#\n 0060 04410002 00403021 00063023 00061400 .A...@0!..0#....\n 0070 00022403 28820aab 54400003 0065102a ..$.(...T@...e.*\n 0080 08000030 24e71000 38420001 00021023 ...0$...8B.....#\n 0090 34430001 28820080 14400004 00000000 4C..(....@......\n 00a0 000311c0 08000030 00e23821 00000000 .......0..8!....\n 00b0 00c30018 00001012 00e21021 30471fff ...........!0G..\n 00c0 00071400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8002ADB4_2B9B4' — lift: cannot lift 'func_8002ADB4_2B9B4': unmodelled control transfer 'bltzl' at 0x20 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tt0,a0 */\n/* 4:\tsll\tv0,a0,0x10 */\n/* 8:\tsra\ta2,v0,0x10 */\n/* c:\tsll\tv0,a1,0x10 */\n/* 10:\tsra\tv1,v0,0x10 */\n/* 14:\tbeq\ta2,v1,c0 */\n/* 18:\tmove\ta3,a1 */\n/* 1c:\tsubu\tv0,a2,v1 */\n/* 20:\tbltzl\tv0,28 */\n/* 24:\tnegu\tv0,v0 */\n/* 28:\tsll\tv0,v0,0x10 */\n/* 2c:\tsra\tv0,v0,0x10 */\n/* 30:\tslti\tv0,v0,4097 */\n/* 34:\tbnez\tv0,50 */\n/* 38:\tsll\tv0,t0,0x10 */\n/* 3c:\tslt\tv0,v1,a2 */\n/* 40:\tbeqzl\tv0,4c */\n/* 44:\taddiu\tt0,a0,8192 */\n/* 48:\taddiu\ta3,a1,8192 */\n/* 4c:\tsll\tv0,t0,0x10 */\n/* 50:\tsra\ta1,v0,0x10 */\n/* 54:\tsll\tv0,a3,0x10 */\n/* 58:\tsra\tv1,v0,0x10 */\n/* 5c:\tsubu\tv0,a1,v1 */\n/* 60:\tbgez\tv0,6c */\n/* 64:\tmove\ta2,v0 */\n/* 68:\tnegu\ta2,a2 */\n/* 6c:\tsll\tv0,a2,0x10 */\n/* 70:\tsra\ta0,v0,0x10 */\n/* 74:\tslti\tv0,a0,2731 */\n/* 78:\tbnezl\tv0,88 */\n/* 7c:\tslt\tv0,v1,a1 */\n/* 80:\tj\tc0 */\n/* 84:\taddiu\ta3,a3,4096 */\n/* 88:\txori\tv0,v0,0x1 */\n/* 8c:\tnegu\tv0,v0 */\n/* 90:\tori\tv1,v0,0x1 */\n/* 94:\tslti\tv0,a0,128 */\n/* 98:\tbnez\tv0,ac */\n/* 9c:\tnop */\n/* a0:\tsll\tv0,v1,0x7 */\n/* a4:\tj\tc0 */\n/* a8:\taddu\ta3,a3,v0 */\n/* ac:\tnop */\n/* b0:\tmult\ta2,v1 */\n/* b4:\tmflo\tv0 */\n/* b8:\taddu\tv0,a3,v0 */\n/* bc:\tandi\ta3,v0,0x1fff */\n/* c0:\tsll\tv0,a3,0x10 */\n/* c4:\tjr\tra */\n/* c8:\tsra\tv0,v0,0x10 */\n/* cc:\tnop */\nvoid func_8002ADB4_2B9B4(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8002ADB4_2B9B4': unmodelled control transfer 'bltzl' at 0x20 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":60,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8002ADB4_2B9B4': unmodelled control transfer 'bltzl' at 0x20 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 func_8002ADB4_2B9B4(s16 arg0, s16 arg1) {\n s16 temp_v0;\n s16 var_a2;\n s16 var_a3;\n s16 var_t0;\n s16 var_v0;\n s32 temp_a1;\n s32 temp_v1;\n s32 var_v0_2;\n\n var_t0 = arg0;\n var_a3 = arg1;\n if (arg0 != arg1) {\n var_v0 = arg0 - arg1;\n if (var_v0 < 0) {\n var_v0 = -var_v0;\n }\n var_v0_2 = var_t0 << 0x10;\n if (var_v0 >= 0x1001) {\n if (arg1 >= arg0) {\n var_t0 = arg0 + 0x2000;\n } else {\n var_a3 = arg1 + 0x2000;\n }\n var_v0_2 = var_t0 << 0x10;\n }\n temp_a1 = var_v0_2 >> 0x10;\n temp_v0 = temp_a1 - var_a3;\n var_a2 = temp_v0;\n if (temp_v0 < 0) {\n var_a2 = -var_a2;\n }\n if (var_a2 < 0xAAB) {\n temp_v1 = -(var_a3 >= temp_a1) | 1;\n if (var_a2 >= 0x80) {\n var_a3 += temp_v1 << 7;\n } else {\n var_a3 = (var_a3 + (var_a2 * temp_v1)) & 0x1FFF;\n }\n } else {\n var_a3 += 0x1000;\n }\n }\n return var_a3;\n}\n","score":55,"maxScore":69,"compileErrors":null,"breakdown":{"insert":18,"delete":16,"replace":1,"opMismatch":0,"argMismatch":20},"quality":{"score":100,"lines":44,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/2AF90.c: angle interpolation with wrap handling; pure leaf, uses ABS macro","gapSize":{"decompiler":"m2c","score":55,"maxScore":69,"ratio":0.7971014492753623,"kinds":{"insert":18,"delete":16,"replace":1,"opMismatch":0,"argMismatch":20}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8002ADB4_2B9B4` — benchmark function snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002ADB4_2B9B4\n move\t$t0, $a0\n sll\t$v0, $a0, 0x10\n sra\t$a2, $v0, 0x10\n sll\t$v0, $a1, 0x10\n sra\t$v1, $v0, 0x10\n beq\t$a2, $v1, .Lc0\n move\t$a3, $a1\n subu\t$v0, $a2, $v1\n bltzl\t$v0, .L28\n negu\t$v0, $v0\n.L28:\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 4097\n bnez\t$v0, .L50\n sll\t$v0, $t0, 0x10\n slt\t$v0, $v1, $a2\n beqzl\t$v0, .L4c\n addiu\t$t0, $a0, 8192\n addiu\t$a3, $a1, 8192\n.L4c:\n sll\t$v0, $t0, 0x10\n.L50:\n sra\t$a1, $v0, 0x10\n sll\t$v0, $a3, 0x10\n sra\t$v1, $v0, 0x10\n subu\t$v0, $a1, $v1\n bgez\t$v0, .L6c\n move\t$a2, $v0\n negu\t$a2, $a2\n.L6c:\n sll\t$v0, $a2, 0x10\n sra\t$a0, $v0, 0x10\n slti\t$v0, $a0, 2731\n bnezl\t$v0, .L88\n slt\t$v0, $v1, $a1\n j\t.Lc0\n addiu\t$a3, $a3, 4096\n.L88:\n xori\t$v0, $v0, 0x1\n negu\t$v0, $v0\n ori\t$v1, $v0, 0x1\n slti\t$v0, $a0, 128\n bnez\t$v0, .Lac\n nop\n sll\t$v0, $v1, 0x7\n j\t.Lc0\n addu\t$a3, $a3, $v0\n.Lac:\n nop\n mult\t$a2, $v1\n mflo\t$v0\n addu\t$v0, $a3, $v0\n andi\t$a3, $v0, 0x1fff\n.Lc0:\n sll\t$v0, $a3, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002ADB4_2B9B4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002ADB4_2B9B4` — benchmark function snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,a0\n 4:\tsll\tv0,a0,0x10\n 8:\tsra\ta2,v0,0x10\n c:\tsll\tv0,a1,0x10\n 10:\tsra\tv1,v0,0x10\n 14:\tbeq\ta2,v1,c0 \n 18:\tmove\ta3,a1\n 1c:\tsubu\tv0,a2,v1\n 20:\tbltzl\tv0,28 \n 24:\tnegu\tv0,v0\n 28:\tsll\tv0,v0,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tslti\tv0,v0,4097\n 34:\tbnez\tv0,50 \n 38:\tsll\tv0,t0,0x10\n 3c:\tslt\tv0,v1,a2\n 40:\tbeqzl\tv0,4c \n 44:\taddiu\tt0,a0,8192\n 48:\taddiu\ta3,a1,8192\n 4c:\tsll\tv0,t0,0x10\n 50:\tsra\ta1,v0,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tsra\tv1,v0,0x10\n 5c:\tsubu\tv0,a1,v1\n 60:\tbgez\tv0,6c \n 64:\tmove\ta2,v0\n 68:\tnegu\ta2,a2\n 6c:\tsll\tv0,a2,0x10\n 70:\tsra\ta0,v0,0x10\n 74:\tslti\tv0,a0,2731\n 78:\tbnezl\tv0,88 \n 7c:\tslt\tv0,v1,a1\n 80:\tj\tc0 \n 84:\taddiu\ta3,a3,4096\n 88:\txori\tv0,v0,0x1\n 8c:\tnegu\tv0,v0\n 90:\tori\tv1,v0,0x1\n 94:\tslti\tv0,a0,128\n 98:\tbnez\tv0,ac \n 9c:\tnop\n a0:\tsll\tv0,v1,0x7\n a4:\tj\tc0 \n a8:\taddu\ta3,a3,v0\n ac:\tnop\n b0:\tmult\ta2,v1\n b4:\tmflo\tv0\n b8:\taddu\tv0,a3,v0\n bc:\tandi\ta3,v0,0x1fff\n c0:\tsll\tv0,a3,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-032753bac235c323/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000cc func_8002ADB4_2B9B4\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000080 R_MIPS_26 .text\n000000a4 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00804021 00041400 00023403 00051400 ..@!......4.....\n 0010 00021c03 10c3002a 00a03821 00c31023 .......*..8!...#\n 0020 04420001 00021023 00021400 00021403 .B.....#........\n 0030 28421001 14400006 00081400 0066102a (B...@.......f.*\n 0040 50400002 24882000 24a72000 00081400 P@..$. .$. .....\n 0050 00022c03 00071400 00021c03 00a31023 ..,............#\n 0060 04410002 00403021 00063023 00061400 .A...@0!..0#....\n 0070 00022403 28820aab 54400003 0065102a ..$.(...T@...e.*\n 0080 08000030 24e71000 38420001 00021023 ...0$...8B.....#\n 0090 34430001 28820080 14400004 00000000 4C..(....@......\n 00a0 000311c0 08000030 00e23821 00000000 .......0..8!....\n 00b0 00c30018 00001012 00e21021 30471fff ...........!0G..\n 00c0 00071400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002ADB4_2B9B4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc","sym":"func_8002B4B8_2C0B8","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","branch","fixedpoint"],"loc":13,"refSource":"s16 func_8002B4B8_2C0B8(u16 arg0, u16 arg1) {\n s16 diff;\n\n arg0 &= 0x1FFF;\n arg1 &= 0x1FFF;\n diff = (arg1 - arg0) & 0x1FFF;\n\n if (diff >= 0x1001) {\n diff |= 0xE000;\n }\n\n return diff;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L168-L180","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0x1fff\n 4:\tandi\ta1,a1,0x1fff\n 8:\tsubu\ta1,a1,a0\n c:\tandi\ta1,a1,0x1fff\n 10:\tslti\tv0,a1,4097\n 14:\tbnez\tv0,20 \n 18:\tmove\tv1,a1\n 1c:\tori\tv1,a1,0xe000\n 20:\tsll\tv0,v1,0x10\n 24:\tjr\tra\n 28:\tsra\tv0,v0,0x10\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e937fcabf56e4964/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_8002B4B8_2C0B8\n\n\nContents of section .text:\n 0000 30841fff 30a51fff 00a42823 30a51fff 0...0.....(#0...\n 0010 28a21001 14400002 00a01821 34a3e000 (....@.....!4...\n 0020 00031400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/regcopy-ret","symbolsUsed":[],"outcome":"nonmatch","source":"s32 func_8002B4B8_2C0B8(u32 a0, u32 a1) {\n s32 v0;\n s32 w0;\n v0 = (a1 & 8191) - (a0 & 8191) & 8191;\n w0 = v0;\n if (w0 >= 4097) w0 = w0 | 57344;\n v0 = w0 << 16 >> 16;\n return v0;\n}\n","score":2,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 func_8002B4B8_2C0B8(s32 arg0, s32 arg1) {\n s16 temp_a1;\n s16 var_v1;\n\n temp_a1 = ((arg1 & 0x1FFF) - (arg0 & 0x1FFF)) & 0x1FFF;\n var_v1 = temp_a1;\n if (temp_a1 >= 0x1001) {\n var_v1 = temp_a1 | 0xE000;\n }\n return var_v1;\n}\n","score":2,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":10,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/2AF90.c: signed angle difference in 13-bit angle space; pure leaf","gapSize":{"decompiler":"asmlift","score":2,"maxScore":11,"ratio":0.18181818181818182,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8002B4B8_2C0B8` — benchmark function snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002B4B8_2C0B8\n andi\t$a0, $a0, 0x1fff\n andi\t$a1, $a1, 0x1fff\n subu\t$a1, $a1, $a0\n andi\t$a1, $a1, 0x1fff\n slti\t$v0, $a1, 4097\n bnez\t$v0, .L20\n move\t$v1, $a1\n ori\t$v1, $a1, 0xe000\n.L20:\n sll\t$v0, $v1, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002B4B8_2C0B8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002B4B8_2C0B8` — benchmark function snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0x1fff\n 4:\tandi\ta1,a1,0x1fff\n 8:\tsubu\ta1,a1,a0\n c:\tandi\ta1,a1,0x1fff\n 10:\tslti\tv0,a1,4097\n 14:\tbnez\tv0,20 \n 18:\tmove\tv1,a1\n 1c:\tori\tv1,a1,0xe000\n 20:\tsll\tv0,v1,0x10\n 24:\tjr\tra\n 28:\tsra\tv0,v0,0x10\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e937fcabf56e4964/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_8002B4B8_2C0B8\n\n\nContents of section .text:\n 0000 30841fff 30a51fff 00a42823 30a51fff 0...0.....(#0...\n 0010 28a21001 14400002 00a01821 34a3e000 (....@.....!4...\n 0020 00031400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002B4B8_2C0B8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc","sym":"func_8002BE94_2CA94","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","struct","array","call"],"loc":7,"refSource":"void func_8002BE94_2CA94(Struct2C8F0 *arg0) {\n s32 i;\n\n for (i = 0; i < arg0->unkD5; i++) {\n arg0->elems[i].unk0 = destroySceneModel(arg0->elems[i].unk0);\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2C8F0.c#L47-L53","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,32(sp)\n 8:\tmove\ts2,a0\n c:\tsw\tra,36(sp)\n 10:\tsw\ts1,28(sp)\n 14:\tsw\ts0,24(sp)\n 18:\tlbu\tv0,213(s2)\n 1c:\tblez\tv0,48 \n 20:\tmove\ts1,zero\n 24:\tmove\ts0,s2\n 28:\tlw\ta0,0(s0)\n 2c:\tjal\t0 \n 30:\taddiu\ts1,s1,1\n 34:\tsw\tv0,0(s0)\n 38:\tlbu\tv0,213(s2)\n 3c:\tslt\tv0,s1,v0\n 40:\tbnez\tv0,28 \n 44:\taddiu\ts0,s0,100\n 48:\tlw\tra,36(sp)\n 4c:\tlw\ts2,32(sp)\n 50:\tlw\ts1,28(sp)\n 54:\tlw\ts0,24(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,40\n","proto":{"func_8002BE94_2CA94":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-768f1f5763ffb52a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_8002BE94_2CA94\n00000000 *UND*\t00000000 destroySceneModel\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 destroySceneModel\n\n\nContents of section .text:\n 0000 27bdffd8 afb20020 00809021 afbf0024 '...... ...!...$\n 0010 afb1001c afb00018 924200d5 1840000a .........B...@..\n 0020 00008821 02408021 8e040000 0c000000 ...!.@.!........\n 0030 26310001 ae020000 924200d5 0222102a &1.......B...\".*\n 0040 1440fff9 26100064 8fbf0024 8fb20020 .@..&..d...$... \n 0050 8fb1001c 8fb00018 03e00008 27bd0028 ............'..(\nContents of section .reginfo:\n 0000 a0070014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8002BE94_2CA94' — lift: cannot lift 'func_8002BE94_2CA94': function call 'jal' at 0x2c — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-40 */\n/* 4:\tsw\ts2,32(sp) */\n/* 8:\tmove\ts2,a0 */\n/* c:\tsw\tra,36(sp) */\n/* 10:\tsw\ts1,28(sp) */\n/* 14:\tsw\ts0,24(sp) */\n/* 18:\tlbu\tv0,213(s2) */\n/* 1c:\tblez\tv0,48 */\n/* 20:\tmove\ts1,zero */\n/* 24:\tmove\ts0,s2 */\n/* 28:\tlw\ta0,0(s0) */\n/* 2c:\tjal\t0 */\n/* 30:\taddiu\ts1,s1,1 */\n/* 34:\tsw\tv0,0(s0) */\n/* 38:\tlbu\tv0,213(s2) */\n/* 3c:\tslt\tv0,s1,v0 */\n/* 40:\tbnez\tv0,28 */\n/* 44:\taddiu\ts0,s0,100 */\n/* 48:\tlw\tra,36(sp) */\n/* 4c:\tlw\ts2,32(sp) */\n/* 50:\tlw\ts1,28(sp) */\n/* 54:\tlw\ts0,24(sp) */\n/* 58:\tjr\tra */\n/* 5c:\taddiu\tsp,sp,40 */\nvoid func_8002BE94_2CA94(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8002BE94_2CA94': function call 'jal' at 0x2c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8002BE94_2CA94': function call 'jal' at 0x2c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 destroySceneModel(s32); /* extern */\n\nvoid func_8002BE94_2CA94(s32 *arg0) {\n s32 *var_s0;\n s32 var_s1;\n\n var_s1 = 0;\n if ((s32) arg0->unkD5 > 0) {\n var_s0 = arg0;\n do {\n var_s1 += 1;\n *var_s0 = destroySceneModel(*var_s0);\n var_s0 += 0x64;\n } while (var_s1 < (s32) arg0->unkD5);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":98,"lines":14,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: kmc gcc (docker) failed: /c.i:2472: conflicting types for `destroySceneModel'","/c.i:2433: previous declaration of `destroySceneModel'","/c.i:2477: request for member `unkD5' in something not a structure or union","/c.i:2483: request for member `unkD5' in something not a structure or union"]},"note":"src/2C8F0.c: destroys each scene model in a fixed array up to a live count","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8002BE94_2CA94` — benchmark function snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002BE94_2CA94\n addiu\t$sp, $sp, -40\n sw\t$s2, 32($sp)\n move\t$s2, $a0\n sw\t$ra, 36($sp)\n sw\t$s1, 28($sp)\n sw\t$s0, 24($sp)\n lbu\t$v0, 213($s2)\n blez\t$v0, .L48\n move\t$s1, $zero\n move\t$s0, $s2\n.L28:\n lw\t$a0, 0($s0)\n jal\tdestroySceneModel\n addiu\t$s1, $s1, 1\n sw\t$v0, 0($s0)\n lbu\t$v0, 213($s2)\n slt\t$v0, $s1, $v0\n bnez\t$v0, .L28\n addiu\t$s0, $s0, 100\n.L48:\n lw\t$ra, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002BE94_2CA94 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002BE94_2CA94` — benchmark function snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,32(sp)\n 8:\tmove\ts2,a0\n c:\tsw\tra,36(sp)\n 10:\tsw\ts1,28(sp)\n 14:\tsw\ts0,24(sp)\n 18:\tlbu\tv0,213(s2)\n 1c:\tblez\tv0,48 \n 20:\tmove\ts1,zero\n 24:\tmove\ts0,s2\n 28:\tlw\ta0,0(s0)\n 2c:\tjal\t0 \n 30:\taddiu\ts1,s1,1\n 34:\tsw\tv0,0(s0)\n 38:\tlbu\tv0,213(s2)\n 3c:\tslt\tv0,s1,v0\n 40:\tbnez\tv0,28 \n 44:\taddiu\ts0,s0,100\n 48:\tlw\tra,36(sp)\n 4c:\tlw\ts2,32(sp)\n 50:\tlw\ts1,28(sp)\n 54:\tlw\ts0,24(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,40\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-768f1f5763ffb52a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_8002BE94_2CA94\n00000000 *UND*\t00000000 destroySceneModel\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 destroySceneModel\n\n\nContents of section .text:\n 0000 27bdffd8 afb20020 00809021 afbf0024 '...... ...!...$\n 0010 afb1001c afb00018 924200d5 1840000a .........B...@..\n 0020 00008821 02408021 8e040000 0c000000 ...!.@.!........\n 0030 26310001 ae020000 924200d5 0222102a &1.......B...\".*\n 0040 1440fff9 26100064 8fbf0024 8fb20020 .@..&..d...$... \n 0050 8fb1001c 8fb00018 03e00008 27bd0028 ............'..(\nContents of section .reginfo:\n 0000 a0070014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8002BE94_2CA94\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002BE94_2CA94 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc","sym":"func_80035F80_36B80","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","call","cast","return"],"loc":7,"refSource":"void *func_80035F80_36B80(s32 arg0) {\n if ((u8)arg0 != 1) {\n return loadCompressedData(&_3F6950_ROM_START, &_3F6950_ROM_END, 0x508);\n } else {\n return loadCompressedData(&_459E00_ROM_START, &_459E00_ROM_END, 0x22E8);\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/36B80.c#L8-L14","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tandi\ta0,a0,0xff\n 8:\tli\tv0,1\n c:\tbne\ta0,v0,2c \n 10:\tsw\tra,16(sp)\n 14:\tlui\ta0,0x0\n 18:\taddiu\ta0,a0,0\n 1c:\tlui\ta1,0x0\n 20:\taddiu\ta1,a1,0\n 24:\tj\t40 \n 28:\tli\ta2,8936\n 2c:\tlui\ta0,0x0\n 30:\taddiu\ta0,a0,0\n 34:\tlui\ta1,0x0\n 38:\taddiu\ta1,a1,0\n 3c:\tli\ta2,1288\n 40:\tjal\t0 \n 44:\tnop\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-cd71a6e037df.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-307c44b8cf52b911/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80035F80_36B80\n00000000 *UND*\t00000000 _459E00_ROM_START\n00000000 *UND*\t00000000 _459E00_ROM_END\n00000000 *UND*\t00000000 _3F6950_ROM_START\n00000000 *UND*\t00000000 _3F6950_ROM_END\n00000000 *UND*\t00000000 loadCompressedData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_HI16 _459E00_ROM_START\n00000018 R_MIPS_LO16 _459E00_ROM_START\n0000001c R_MIPS_HI16 _459E00_ROM_END\n00000020 R_MIPS_LO16 _459E00_ROM_END\n00000024 R_MIPS_26 .text\n0000002c R_MIPS_HI16 _3F6950_ROM_START\n00000030 R_MIPS_LO16 _3F6950_ROM_START\n00000034 R_MIPS_HI16 _3F6950_ROM_END\n00000038 R_MIPS_LO16 _3F6950_ROM_END\n00000040 R_MIPS_26 loadCompressedData\n\n\nContents of section .text:\n 0000 27bdffe8 308400ff 24020001 14820007 '...0...$.......\n 0010 afbf0010 3c040000 24840000 3c050000 ....<...$...<...\n 0020 24a50000 08000010 240622e8 3c040000 $.......$.\".<...\n 0030 24840000 3c050000 24a50000 24060508 $...<...$...$...\n 0040 0c000000 00000000 8fbf0010 03e00008 ................\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80035F80_36B80' — lift: cannot lift 'func_80035F80_36B80': function call 'jal' at 0x40 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tandi\ta0,a0,0xff */\n/* 8:\tli\tv0,1 */\n/* c:\tbne\ta0,v0,2c */\n/* 10:\tsw\tra,16(sp) */\n/* 14:\tlui\ta0,0x0 */\n/* 18:\taddiu\ta0,a0,0 */\n/* 1c:\tlui\ta1,0x0 */\n/* 20:\taddiu\ta1,a1,0 */\n/* 24:\tj\t40 */\n/* 28:\tli\ta2,8936 */\n/* 2c:\tlui\ta0,0x0 */\n/* 30:\taddiu\ta0,a0,0 */\n/* 34:\tlui\ta1,0x0 */\n/* 38:\taddiu\ta1,a1,0 */\n/* 3c:\tli\ta2,1288 */\n/* 40:\tjal\t0 */\n/* 44:\tnop */\n/* 48:\tlw\tra,16(sp) */\n/* 4c:\tjr\tra */\n/* 50:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid func_80035F80_36B80(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80035F80_36B80': function call 'jal' at 0x40 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":30,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80035F80_36B80': function call 'jal' at 0x40 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void *func_80035F80_36B80(s32 arg0) {\n s32 var_a2;\n u32 **var_a0;\n u32 **var_a1;\n\n if ((arg0 & 0xFF) == 1) {\n var_a0 = &_459E00_ROM_START;\n var_a1 = &_459E00_ROM_END;\n var_a2 = 0x22E8;\n } else {\n var_a0 = &_3F6950_ROM_START;\n var_a1 = &_3F6950_ROM_END;\n var_a2 = 0x508;\n }\n return loadCompressedData(var_a0, var_a1, var_a2);\n}\n","score":0,"maxScore":21,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/36B80.c: selects one of two compressed assets to load","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80035F80_36B80` — benchmark function snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80035F80_36B80\n addiu\t$sp, $sp, -24\n andi\t$a0, $a0, 0xff\n li\t$v0, 1\n bne\t$a0, $v0, .L2c\n sw\t$ra, 16($sp)\n lui\t$a0, %hi(_459E00_ROM_START)\n addiu\t$a0, $a0, %lo(_459E00_ROM_START)\n lui\t$a1, %hi(_459E00_ROM_END)\n addiu\t$a1, $a1, %lo(_459E00_ROM_END)\n j\t.L40\n li\t$a2, 8936\n.L2c:\n lui\t$a0, %hi(_3F6950_ROM_START)\n addiu\t$a0, $a0, %lo(_3F6950_ROM_START)\n lui\t$a1, %hi(_3F6950_ROM_END)\n addiu\t$a1, $a1, %lo(_3F6950_ROM_END)\n li\t$a2, 1288\n.L40:\n jal\tloadCompressedData\n nop\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-cd71a6e037df.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80035F80_36B80(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80035F80_36B80 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80035F80_36B80` — benchmark function snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tandi\ta0,a0,0xff\n 8:\tli\tv0,1\n c:\tbne\ta0,v0,2c \n 10:\tsw\tra,16(sp)\n 14:\tlui\ta0,0x0\n 18:\taddiu\ta0,a0,0\n 1c:\tlui\ta1,0x0\n 20:\taddiu\ta1,a1,0\n 24:\tj\t40 \n 28:\tli\ta2,8936\n 2c:\tlui\ta0,0x0\n 30:\taddiu\ta0,a0,0\n 34:\tlui\ta1,0x0\n 38:\taddiu\ta1,a1,0\n 3c:\tli\ta2,1288\n 40:\tjal\t0 \n 44:\tnop\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-307c44b8cf52b911/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80035F80_36B80\n00000000 *UND*\t00000000 _459E00_ROM_START\n00000000 *UND*\t00000000 _459E00_ROM_END\n00000000 *UND*\t00000000 _3F6950_ROM_START\n00000000 *UND*\t00000000 _3F6950_ROM_END\n00000000 *UND*\t00000000 loadCompressedData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_HI16 _459E00_ROM_START\n00000018 R_MIPS_LO16 _459E00_ROM_START\n0000001c R_MIPS_HI16 _459E00_ROM_END\n00000020 R_MIPS_LO16 _459E00_ROM_END\n00000024 R_MIPS_26 .text\n0000002c R_MIPS_HI16 _3F6950_ROM_START\n00000030 R_MIPS_LO16 _3F6950_ROM_START\n00000034 R_MIPS_HI16 _3F6950_ROM_END\n00000038 R_MIPS_LO16 _3F6950_ROM_END\n00000040 R_MIPS_26 loadCompressedData\n\n\nContents of section .text:\n 0000 27bdffe8 308400ff 24020001 14820007 '...0...$.......\n 0010 afbf0010 3c040000 24840000 3c050000 ....<...$...<...\n 0020 24a50000 08000010 240622e8 3c040000 $.......$.\".<...\n 0030 24840000 3c050000 24a50000 24060508 $...<...$...$...\n 0040 0c000000 00000000 8fbf0010 03e00008 ................\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80035F80_36B80 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc","sym":"func_80037FE0_38BE0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["array","global","compare"],"loc":3,"refSource":"s32 func_80037FE0_38BE0(u8 arg0) {\n return EepromSaveData->save_slot_status[arg0] == 1;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/38BE0.c#L4-L6","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlw\tv0,0(v0)\n 8:\tandi\ta0,a0,0xff\n c:\taddu\tv0,v0,a0\n 10:\tlbu\tv0,16(v0)\n 14:\txori\tv0,v0,0x1\n 18:\tjr\tra\n 1c:\tsltiu\tv0,v0,1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ce80f7f2e88c6fb7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 func_80037FE0_38BE0\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 EepromSaveData\n00000004 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 3c020000 8c420000 308400ff 00441021 <....B..0....D.!\n 0010 90420010 38420001 03e00008 2c420001 .B..8B......,B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"EepromSaveData","shape":"pointer"}],"outcome":"match","source":"u32 func_80037FE0_38BE0(u32 a0) {\n return (((u8 *)EepromSaveData + (a0 & 255))[16] ^ 1) < 1;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern s32 EepromSaveData;\n\ns32 func_80037FE0_38BE0(s32 arg0) {\n return (EepromSaveData + (arg0 & 0xFF))->unk10 == 1;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: kmc gcc (docker) failed: /c.i:1846: conflicting types for `EepromSaveData'","/c.i:1845: previous declaration of `EepromSaveData'","/c.i:1848: invalid type argument of `->'"]},"note":"src/38BE0.c: save-slot-in-use predicate; leaf","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80037FE0_38BE0` — benchmark function snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80037FE0_38BE0\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n andi\t$a0, $a0, 0xff\n addu\t$v0, $v0, $a0\n lbu\t$v0, 16($v0)\n xori\t$v0, $v0, 0x1\n jr\t$ra\n sltiu\t$v0, $v0, 1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80037FE0_38BE0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80037FE0_38BE0` — benchmark function snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlw\tv0,0(v0)\n 8:\tandi\ta0,a0,0xff\n c:\taddu\tv0,v0,a0\n 10:\tlbu\tv0,16(v0)\n 14:\txori\tv0,v0,0x1\n 18:\tjr\tra\n 1c:\tsltiu\tv0,v0,1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ce80f7f2e88c6fb7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 func_80037FE0_38BE0\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 EepromSaveData\n00000004 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 3c020000 8c420000 308400ff 00441021 <....B..0....D.!\n 0010 90420010 38420001 03e00008 2c420001 .B..8B......,B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80037FE0_38BE0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80038000_38C00:gcc2.7.2kmc","sym":"func_80038000_38C00","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","global","struct","field"],"loc":13,"refSource":"u8 func_80038000_38C00(u8 arg0) {\n arg0 &= 0xFF;\n if (arg0 < 6) {\n return 1;\n }\n if (arg0 == 6) {\n return EepromSaveData->setting_4E;\n }\n if (arg0 == 7) {\n return EepromSaveData->setting_4F;\n }\n return EepromSaveData->setting_50;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/38BE0.c#L8-L20","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0xff\n 4:\tsltiu\tv0,a0,6\n 8:\tbnez\tv0,50 \n c:\tli\tv0,1\n 10:\tli\tv0,6\n 14:\tbne\ta0,v0,2c \n 18:\tli\tv0,7\n 1c:\tlui\tv0,0x0\n 20:\tlw\tv0,0(v0)\n 24:\tj\t50 \n 28:\tlbu\tv0,78(v0)\n 2c:\tbeq\ta0,v0,44 \n 30:\tnop\n 34:\tlui\tv0,0x0\n 38:\tlw\tv0,0(v0)\n 3c:\tj\t50 \n 40:\tlbu\tv0,80(v0)\n 44:\tlui\tv0,0x0\n 48:\tlw\tv0,0(v0)\n 4c:\tlbu\tv0,79(v0)\n 50:\tjr\tra\n 54:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-deab83b78ab9ef69/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80038000_38C00\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 EepromSaveData\n00000020 R_MIPS_LO16 EepromSaveData\n00000024 R_MIPS_26 .text\n00000034 R_MIPS_HI16 EepromSaveData\n00000038 R_MIPS_LO16 EepromSaveData\n0000003c R_MIPS_26 .text\n00000044 R_MIPS_HI16 EepromSaveData\n00000048 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 308400ff 2c820006 14400011 24020001 0...,....@..$...\n 0010 24020006 14820005 24020007 3c020000 $.......$...<...\n 0020 8c420000 08000014 9042004e 10820005 .B.......B.N....\n 0030 00000000 3c020000 8c420000 08000014 ....<....B......\n 0040 90420050 3c020000 8c420000 9042004f .B.P<....B...B.O\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"EepromSaveData","shape":"pointer"}],"outcome":"nonmatch","source":"s32 func_80038000_38C00(u32 a0) {\n s32 v0;\n if ((a0 & 255) < 6) {\n v0 = 1;\n } else {\n switch (a0 & 255) {\n case 6:\n v0 = EepromSaveData->setting_4E;\n break;\n case 7:\n v0 = EepromSaveData->setting_4F;\n break;\n default:\n v0 = EepromSaveData->setting_50;\n }\n }\n return v0;\n}\n","score":9,"maxScore":26,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":96,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern void *EepromSaveData;\n\nu8 func_80038000_38C00(s32 arg0) {\n u32 temp_a0;\n u8 var_v0;\n\n temp_a0 = arg0 & 0xFF;\n var_v0 = 1;\n if (temp_a0 >= 6U) {\n switch (temp_a0) { /* irregular */\n case 6:\n return EepromSaveData->unk4E;\n case 7:\n var_v0 = EepromSaveData->unk4F;\n /* Duplicate return node #6. Try simplifying control flow for better match */\n return var_v0;\n default:\n return EepromSaveData->unk50;\n }\n } else {\n return var_v0;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":96,"lines":21,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: kmc gcc (docker) failed: /c.i:1846: conflicting types for `EepromSaveData'","/c.i:1845: previous declaration of `EepromSaveData'","/c.i:1855: request for member `unk4E' in something not a structure or union","/c.i:1857: request for member `unk4F' in something not a structure or union","/c.i:1860: request for member `unk50' in something not a structure or union"]},"note":"src/38BE0.c: settings getter with if-chain over a global struct; leaf","gapSize":{"decompiler":"asmlift","score":9,"maxScore":26,"ratio":0.34615384615384615,"kinds":{"insert":4,"delete":2,"replace":1,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80038000_38C00` — benchmark function snowboardkids2:func_80038000_38C00:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80038000_38C00\n andi\t$a0, $a0, 0xff\n sltiu\t$v0, $a0, 6\n bnez\t$v0, .L50\n li\t$v0, 1\n li\t$v0, 6\n bne\t$a0, $v0, .L2c\n li\t$v0, 7\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n j\t.L50\n lbu\t$v0, 78($v0)\n.L2c:\n beq\t$a0, $v0, .L44\n nop\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n j\t.L50\n lbu\t$v0, 80($v0)\n.L44:\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n lbu\t$v0, 79($v0)\n.L50:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80038000_38C00 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80038000_38C00` — benchmark function snowboardkids2:func_80038000_38C00:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80038000_38C00:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0xff\n 4:\tsltiu\tv0,a0,6\n 8:\tbnez\tv0,50 \n c:\tli\tv0,1\n 10:\tli\tv0,6\n 14:\tbne\ta0,v0,2c \n 18:\tli\tv0,7\n 1c:\tlui\tv0,0x0\n 20:\tlw\tv0,0(v0)\n 24:\tj\t50 \n 28:\tlbu\tv0,78(v0)\n 2c:\tbeq\ta0,v0,44 \n 30:\tnop\n 34:\tlui\tv0,0x0\n 38:\tlw\tv0,0(v0)\n 3c:\tj\t50 \n 40:\tlbu\tv0,80(v0)\n 44:\tlui\tv0,0x0\n 48:\tlw\tv0,0(v0)\n 4c:\tlbu\tv0,79(v0)\n 50:\tjr\tra\n 54:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-deab83b78ab9ef69/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80038000_38C00\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 EepromSaveData\n00000020 R_MIPS_LO16 EepromSaveData\n00000024 R_MIPS_26 .text\n00000034 R_MIPS_HI16 EepromSaveData\n00000038 R_MIPS_LO16 EepromSaveData\n0000003c R_MIPS_26 .text\n00000044 R_MIPS_HI16 EepromSaveData\n00000048 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 308400ff 2c820006 14400011 24020001 0...,....@..$...\n 0010 24020006 14820005 24020007 3c020000 $.......$...<...\n 0020 8c420000 08000014 9042004e 10820005 .B.......B.N....\n 0030 00000000 3c020000 8c420000 08000014 ....<....B......\n 0040 90420050 3c020000 8c420000 9042004f .B.P<....B...B.O\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80038000_38C00 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80051C80_52880:gcc2.7.2kmc","sym":"func_80051C80_52880","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","call","array"],"loc":22,"refSource":"void func_80051C80_52880(s32 *arg0, s32 arg1) {\n s32 dist;\n\n dist = distance_2d(arg0[0], arg0[2]);\n\n if (!(dist >= 0x20000)) {\n if (dist != 0) {\n arg0[0] = (s64)((s64)arg0[0] * 0x20000) / dist;\n arg0[2] = (s64)((s64)arg0[2] * 0x20000) / dist;\n } else {\n arg0[2] = 0x20000;\n }\n }\n\n dist = distance_3d(arg0[0], arg0[1], arg0[2]);\n\n if (dist != 0) {\n arg0[0] = (s64)((s64)arg0[0] * arg1) / dist;\n arg0[1] = (s64)((s64)arg0[1] * arg1) / dist;\n arg0[2] = (s64)((s64)arg0[2] * arg1) / dist;\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/52880.c#L137-L158","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\ts3,52(sp)\n 8:\tmove\ts3,a0\n c:\tsw\ts4,56(sp)\n 10:\tmove\ts4,a1\n 14:\tsw\tra,60(sp)\n 18:\tsw\ts2,48(sp)\n 1c:\tsw\ts1,44(sp)\n 20:\tsw\ts0,40(sp)\n 24:\tlw\ta0,0(s3)\n 28:\tjal\t0 \n 2c:\tlw\ta1,8(s3)\n 30:\tmove\tv1,v0\n 34:\tlui\tv0,0x1\n 38:\tori\tv0,v0,0xffff\n 3c:\tslt\tv0,v0,v1\n 40:\tbnez\tv0,b4 \n 44:\tnop\n 48:\tbeqz\tv1,ac \n 4c:\tlui\ts2,0x2\n 50:\tlw\tv0,0(s3)\n 54:\tmult\tv0,s2\n 58:\tmove\ts1,v1\n 5c:\tsra\ts0,v1,0x1f\n 60:\tmove\ta2,s0\n 64:\tmfhi\ta0\n 68:\tmflo\ta1\n\t...\n 74:\tjal\t0 \n 78:\tmove\ta3,s1\n 7c:\tlw\ta0,8(s3)\n 80:\tmult\ta0,s2\n 84:\tmove\ta2,s0\n 88:\tmove\ta3,s1\n 8c:\tmfhi\ta0\n 90:\tmflo\ta1\n\t...\n 9c:\tjal\t0 \n a0:\tsw\tv1,0(s3)\n a4:\tj\tb4 \n a8:\tsw\tv1,8(s3)\n ac:\tlui\tv0,0x2\n b0:\tsw\tv0,8(s3)\n b4:\tlw\ta0,0(s3)\n b8:\tlw\ta1,4(s3)\n bc:\tjal\t0 \n c0:\tlw\ta2,8(s3)\n c4:\tmove\tv1,v0\n c8:\tbeqz\tv1,14c \n cc:\tmove\ts1,v1\n d0:\tlw\tv0,0(s3)\n d4:\tmult\tv0,s4\n d8:\tsra\ts0,v1,0x1f\n dc:\tmove\ta2,s0\n e0:\tmfhi\ta0\n e4:\tmflo\ta1\n\t...\n f0:\tjal\t0 \n f4:\tmove\ta3,s1\n f8:\tlw\ta0,4(s3)\n fc:\tmult\ta0,s4\n 100:\tmove\ta2,s0\n 104:\tmove\ta3,s1\n 108:\tmfhi\ta0\n 10c:\tmflo\ta1\n\t...\n 118:\tjal\t0 \n 11c:\tsw\tv1,0(s3)\n 120:\tlw\ta0,8(s3)\n 124:\tmult\ta0,s4\n 128:\tmove\ta2,s0\n 12c:\tmove\ta3,s1\n 130:\tmfhi\ta0\n 134:\tmflo\ta1\n\t...\n 140:\tjal\t0 \n 144:\tsw\tv1,4(s3)\n 148:\tsw\tv1,8(s3)\n 14c:\tlw\tra,60(sp)\n 150:\tlw\ts4,56(sp)\n 154:\tlw\ts3,52(sp)\n 158:\tlw\ts2,48(sp)\n 15c:\tlw\ts1,44(sp)\n 160:\tlw\ts0,40(sp)\n 164:\tjr\tra\n 168:\taddiu\tsp,sp,64\n 16c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dab5be0e70b1fe00/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 *UND*\t00000000 __divdi3\n00000000 g F .text\t0000016c func_80051C80_52880\n00000000 *UND*\t00000000 distance_2d\n00000000 *UND*\t00000000 distance_3d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000028 R_MIPS_26 distance_2d\n00000074 R_MIPS_26 __divdi3\n0000009c R_MIPS_26 __divdi3\n000000a4 R_MIPS_26 .text\n000000bc R_MIPS_26 distance_3d\n000000f0 R_MIPS_26 __divdi3\n00000118 R_MIPS_26 __divdi3\n00000140 R_MIPS_26 __divdi3\n\n\nContents of section .text:\n 0000 27bdffc0 afb30034 00809821 afb40038 '......4...!...8\n 0010 00a0a021 afbf003c afb20030 afb1002c ...!...<...0...,\n 0020 afb00028 8e640000 0c000000 8e650008 ...(.d.......e..\n 0030 00401821 3c020001 3442ffff 0043102a .@.!<...4B...C.*\n 0040 1440001c 00000000 10600018 3c120002 .@.......`..<...\n 0050 8e620000 00520018 00608821 000387c3 .b...R...`.!....\n 0060 02003021 00002010 00002812 00000000 ..0!.. ...(.....\n 0070 00000000 0c000000 02203821 8e640008 ......... 8!.d..\n 0080 00920018 02003021 02203821 00002010 ......0!. 8!.. .\n 0090 00002812 00000000 00000000 0c000000 ..(.............\n 00a0 ae630000 0800002d ae630008 3c020002 .c.....-.c..<...\n 00b0 ae620008 8e640000 8e650004 0c000000 .b...d...e......\n 00c0 8e660008 00401821 10600020 00608821 .f...@.!.`. .`.!\n 00d0 8e620000 00540018 000387c3 02003021 .b...T........0!\n 00e0 00002010 00002812 00000000 00000000 .. ...(.........\n 00f0 0c000000 02203821 8e640004 00940018 ..... 8!.d......\n 0100 02003021 02203821 00002010 00002812 ..0!. 8!.. ...(.\n 0110 00000000 00000000 0c000000 ae630000 .............c..\n 0120 8e640008 00940018 02003021 02203821 .d........0!. 8!\n 0130 00002010 00002812 00000000 00000000 .. ...(.........\n 0140 0c000000 ae630004 ae630008 8fbf003c .....c...c.....<\n 0150 8fb40038 8fb30034 8fb20030 8fb1002c ...8...4...0...,\n 0160 8fb00028 03e00008 27bd0040 00000000 ...(....'..@....\nContents of section .reginfo:\n 0000 a01f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80051C80_52880' — lift: cannot lift 'func_80051C80_52880': function call 'jal' at 0x28 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-64 */\n/* 4:\tsw\ts3,52(sp) */\n/* 8:\tmove\ts3,a0 */\n/* c:\tsw\ts4,56(sp) */\n/* 10:\tmove\ts4,a1 */\n/* 14:\tsw\tra,60(sp) */\n/* 18:\tsw\ts2,48(sp) */\n/* 1c:\tsw\ts1,44(sp) */\n/* 20:\tsw\ts0,40(sp) */\n/* 24:\tlw\ta0,0(s3) */\n/* 28:\tjal\t0 */\n/* 2c:\tlw\ta1,8(s3) */\n/* 30:\tmove\tv1,v0 */\n/* 34:\tlui\tv0,0x1 */\n/* 38:\tori\tv0,v0,0xffff */\n/* 3c:\tslt\tv0,v0,v1 */\n/* 40:\tbnez\tv0,b4 */\n/* 44:\tnop */\n/* 48:\tbeqz\tv1,ac */\n/* 4c:\tlui\ts2,0x2 */\n/* 50:\tlw\tv0,0(s3) */\n/* 54:\tmult\tv0,s2 */\n/* 58:\tmove\ts1,v1 */\n/* 5c:\tsra\ts0,v1,0x1f */\n/* 60:\tmove\ta2,s0 */\n/* 64:\tmfhi\ta0 */\n/* 68:\tmflo\ta1 */\n/* \t... */\n/* 74:\tjal\t0 */\n/* 78:\tmove\ta3,s1 */\n/* 7c:\tlw\ta0,8(s3) */\n/* 80:\tmult\ta0,s2 */\n/* 84:\tmove\ta2,s0 */\n/* 88:\tmove\ta3,s1 */\n/* 8c:\tmfhi\ta0 */\n/* 90:\tmflo\ta1 */\n/* \t... */\n/* 9c:\tjal\t0 */\n/* a0:\tsw\tv1,0(s3) */\n/* a4:\tj\tb4 */\n/* a8:\tsw\tv1,8(s3) */\n/* ac:\tlui\tv0,0x2 */\n/* b0:\tsw\tv0,8(s3) */\n/* b4:\tlw\ta0,0(s3) */\n/* b8:\tlw\ta1,4(s3) */\n/* bc:\tjal\t0 */\n/* c0:\tlw\ta2,8(s3) */\n/* c4:\tmove\tv1,v0 */\n/* c8:\tbeqz\tv1,14c */\n/* cc:\tmove\ts1,v1 */\n/* d0:\tlw\tv0,0(s3) */\n/* d4:\tmult\tv0,s4 */\n/* d8:\tsra\ts0,v1,0x1f */\n/* dc:\tmove\ta2,s0 */\n/* e0:\tmfhi\ta0 */\n/* e4:\tmflo\ta1 */\n/* \t... */\n/* f0:\tjal\t0 */\n/* f4:\tmove\ta3,s1 */\n/* f8:\tlw\ta0,4(s3) */\n/* fc:\tmult\ta0,s4 */\n/* 100:\tmove\ta2,s0 */\n/* 104:\tmove\ta3,s1 */\n/* 108:\tmfhi\ta0 */\n/* 10c:\tmflo\ta1 */\n/* \t... */\n/* 118:\tjal\t0 */\n/* 11c:\tsw\tv1,0(s3) */\n/* 120:\tlw\ta0,8(s3) */\n/* 124:\tmult\ta0,s4 */\n/* 128:\tmove\ta2,s0 */\n/* 12c:\tmove\ta3,s1 */\n/* 130:\tmfhi\ta0 */\n/* 134:\tmflo\ta1 */\n/* \t... */\n/* 140:\tjal\t0 */\n/* 144:\tsw\tv1,4(s3) */\n/* 148:\tsw\tv1,8(s3) */\n/* 14c:\tlw\tra,60(sp) */\n/* 150:\tlw\ts4,56(sp) */\n/* 154:\tlw\ts3,52(sp) */\n/* 158:\tlw\ts2,48(sp) */\n/* 15c:\tlw\ts1,44(sp) */\n/* 160:\tlw\ts0,40(sp) */\n/* 164:\tjr\tra */\n/* 168:\taddiu\tsp,sp,64 */\n/* 16c:\tnop */\nvoid func_80051C80_52880(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80051C80_52880': function call 'jal' at 0x28 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":95,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80051C80_52880': function call 'jal' at 0x28 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u64 __divdi3(s32, s32, s32, s32); /* extern */\ns32 distance_2d(u32, u32); /* extern */\ns32 distance_3d(u32, u32, u32); /* extern */\n\nvoid func_80051C80_52880(void *arg0, s32 arg1) {\n s32 temp_s0;\n s32 temp_s0_2;\n s32 temp_v0;\n s32 temp_v0_2;\n u32 temp_a0;\n u32 temp_a0_2;\n u32 temp_v0_3;\n\n temp_v0 = distance_2d(arg0->unk0, arg0->unk8);\n if (temp_v0 <= 0x1FFFF) {\n if (temp_v0 != 0) {\n temp_s0 = temp_v0 >> 0x1F;\n arg0->unk0 = (u32) __divdi3(arg0->unk0 / 32768, arg0->unk0 * 0x20000, temp_s0, temp_v0);\n arg0->unk8 = (u32) __divdi3(arg0->unk8 / 32768, arg0->unk8 * 0x20000, temp_s0, temp_v0);\n } else {\n arg0->unk8 = 0x20000U;\n }\n }\n temp_v0_2 = distance_3d(arg0->unk0, arg0->unk4, arg0->unk8);\n if (temp_v0_2 != 0) {\n temp_v0_3 = arg0->unk0;\n temp_s0_2 = temp_v0_2 >> 0x1F;\n temp_a0 = arg0->unk4;\n arg0->unk0 = (u32) __divdi3(MULT_HI(temp_v0_3, arg1), temp_v0_3 * arg1, temp_s0_2, temp_v0_2);\n temp_a0_2 = arg0->unk8;\n arg0->unk4 = (u32) __divdi3(MULT_HI(temp_a0, arg1), temp_a0 * arg1, temp_s0_2, temp_v0_2);\n arg0->unk8 = (u32) __divdi3(MULT_HI(temp_a0_2, arg1), temp_a0_2 * arg1, temp_s0_2, temp_v0_2);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":94,"lines":32,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:1839: request for member `unk0' in something not a structure or union","/c.i:1839: request for member `unk8' in something not a structure or union","/c.i:1843: request for member `unk0' in something not a structure or union","/c.i:1844: request for member `unk8' in something not a structure or union","/c.i:1846: request for member `unk8' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80051C80_52880` — benchmark function snowboardkids2:func_80051C80_52880:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80051C80_52880\n addiu\t$sp, $sp, -64\n sw\t$s3, 52($sp)\n move\t$s3, $a0\n sw\t$s4, 56($sp)\n move\t$s4, $a1\n sw\t$ra, 60($sp)\n sw\t$s2, 48($sp)\n sw\t$s1, 44($sp)\n sw\t$s0, 40($sp)\n lw\t$a0, 0($s3)\n jal\tdistance_2d\n lw\t$a1, 8($s3)\n move\t$v1, $v0\n lui\t$v0, 0x1\n ori\t$v0, $v0, 0xffff\n slt\t$v0, $v0, $v1\n bnez\t$v0, .Lb4\n nop\n beqz\t$v1, .Lac\n lui\t$s2, 0x2\n lw\t$v0, 0($s3)\n mult\t$v0, $s2\n move\t$s1, $v1\n sra\t$s0, $v1, 0x1f\n move\t$a2, $s0\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n move\t$a3, $s1\n lw\t$a0, 8($s3)\n mult\t$a0, $s2\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 0($s3)\n j\t.Lb4\n sw\t$v1, 8($s3)\n.Lac:\n lui\t$v0, 0x2\n sw\t$v0, 8($s3)\n.Lb4:\n lw\t$a0, 0($s3)\n lw\t$a1, 4($s3)\n jal\tdistance_3d\n lw\t$a2, 8($s3)\n move\t$v1, $v0\n beqz\t$v1, .L14c\n move\t$s1, $v1\n lw\t$v0, 0($s3)\n mult\t$v0, $s4\n sra\t$s0, $v1, 0x1f\n move\t$a2, $s0\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n move\t$a3, $s1\n lw\t$a0, 4($s3)\n mult\t$a0, $s4\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 0($s3)\n lw\t$a0, 8($s3)\n mult\t$a0, $s4\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 4($s3)\n sw\t$v1, 8($s3)\n.L14c:\n lw\t$ra, 60($sp)\n lw\t$s4, 56($sp)\n lw\t$s3, 52($sp)\n lw\t$s2, 48($sp)\n lw\t$s1, 44($sp)\n lw\t$s0, 40($sp)\n jr\t$ra\n addiu\t$sp, $sp, 64\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80051C80_52880 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80051C80_52880` — benchmark function snowboardkids2:func_80051C80_52880:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80051C80_52880:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\ts3,52(sp)\n 8:\tmove\ts3,a0\n c:\tsw\ts4,56(sp)\n 10:\tmove\ts4,a1\n 14:\tsw\tra,60(sp)\n 18:\tsw\ts2,48(sp)\n 1c:\tsw\ts1,44(sp)\n 20:\tsw\ts0,40(sp)\n 24:\tlw\ta0,0(s3)\n 28:\tjal\t0 \n 2c:\tlw\ta1,8(s3)\n 30:\tmove\tv1,v0\n 34:\tlui\tv0,0x1\n 38:\tori\tv0,v0,0xffff\n 3c:\tslt\tv0,v0,v1\n 40:\tbnez\tv0,b4 \n 44:\tnop\n 48:\tbeqz\tv1,ac \n 4c:\tlui\ts2,0x2\n 50:\tlw\tv0,0(s3)\n 54:\tmult\tv0,s2\n 58:\tmove\ts1,v1\n 5c:\tsra\ts0,v1,0x1f\n 60:\tmove\ta2,s0\n 64:\tmfhi\ta0\n 68:\tmflo\ta1\n\t...\n 74:\tjal\t0 \n 78:\tmove\ta3,s1\n 7c:\tlw\ta0,8(s3)\n 80:\tmult\ta0,s2\n 84:\tmove\ta2,s0\n 88:\tmove\ta3,s1\n 8c:\tmfhi\ta0\n 90:\tmflo\ta1\n\t...\n 9c:\tjal\t0 \n a0:\tsw\tv1,0(s3)\n a4:\tj\tb4 \n a8:\tsw\tv1,8(s3)\n ac:\tlui\tv0,0x2\n b0:\tsw\tv0,8(s3)\n b4:\tlw\ta0,0(s3)\n b8:\tlw\ta1,4(s3)\n bc:\tjal\t0 \n c0:\tlw\ta2,8(s3)\n c4:\tmove\tv1,v0\n c8:\tbeqz\tv1,14c \n cc:\tmove\ts1,v1\n d0:\tlw\tv0,0(s3)\n d4:\tmult\tv0,s4\n d8:\tsra\ts0,v1,0x1f\n dc:\tmove\ta2,s0\n e0:\tmfhi\ta0\n e4:\tmflo\ta1\n\t...\n f0:\tjal\t0 \n f4:\tmove\ta3,s1\n f8:\tlw\ta0,4(s3)\n fc:\tmult\ta0,s4\n 100:\tmove\ta2,s0\n 104:\tmove\ta3,s1\n 108:\tmfhi\ta0\n 10c:\tmflo\ta1\n\t...\n 118:\tjal\t0 \n 11c:\tsw\tv1,0(s3)\n 120:\tlw\ta0,8(s3)\n 124:\tmult\ta0,s4\n 128:\tmove\ta2,s0\n 12c:\tmove\ta3,s1\n 130:\tmfhi\ta0\n 134:\tmflo\ta1\n\t...\n 140:\tjal\t0 \n 144:\tsw\tv1,4(s3)\n 148:\tsw\tv1,8(s3)\n 14c:\tlw\tra,60(sp)\n 150:\tlw\ts4,56(sp)\n 154:\tlw\ts3,52(sp)\n 158:\tlw\ts2,48(sp)\n 15c:\tlw\ts1,44(sp)\n 160:\tlw\ts0,40(sp)\n 164:\tjr\tra\n 168:\taddiu\tsp,sp,64\n 16c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dab5be0e70b1fe00/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 *UND*\t00000000 __divdi3\n00000000 g F .text\t0000016c func_80051C80_52880\n00000000 *UND*\t00000000 distance_2d\n00000000 *UND*\t00000000 distance_3d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000028 R_MIPS_26 distance_2d\n00000074 R_MIPS_26 __divdi3\n0000009c R_MIPS_26 __divdi3\n000000a4 R_MIPS_26 .text\n000000bc R_MIPS_26 distance_3d\n000000f0 R_MIPS_26 __divdi3\n00000118 R_MIPS_26 __divdi3\n00000140 R_MIPS_26 __divdi3\n\n\nContents of section .text:\n 0000 27bdffc0 afb30034 00809821 afb40038 '......4...!...8\n 0010 00a0a021 afbf003c afb20030 afb1002c ...!...<...0...,\n 0020 afb00028 8e640000 0c000000 8e650008 ...(.d.......e..\n 0030 00401821 3c020001 3442ffff 0043102a .@.!<...4B...C.*\n 0040 1440001c 00000000 10600018 3c120002 .@.......`..<...\n 0050 8e620000 00520018 00608821 000387c3 .b...R...`.!....\n 0060 02003021 00002010 00002812 00000000 ..0!.. ...(.....\n 0070 00000000 0c000000 02203821 8e640008 ......... 8!.d..\n 0080 00920018 02003021 02203821 00002010 ......0!. 8!.. .\n 0090 00002812 00000000 00000000 0c000000 ..(.............\n 00a0 ae630000 0800002d ae630008 3c020002 .c.....-.c..<...\n 00b0 ae620008 8e640000 8e650004 0c000000 .b...d...e......\n 00c0 8e660008 00401821 10600020 00608821 .f...@.!.`. .`.!\n 00d0 8e620000 00540018 000387c3 02003021 .b...T........0!\n 00e0 00002010 00002812 00000000 00000000 .. ...(.........\n 00f0 0c000000 02203821 8e640004 00940018 ..... 8!.d......\n 0100 02003021 02203821 00002010 00002812 ..0!. 8!.. ...(.\n 0110 00000000 00000000 0c000000 ae630000 .............c..\n 0120 8e640008 00940018 02003021 02203821 .d........0!. 8!\n 0130 00002010 00002812 00000000 00000000 .. ...(.........\n 0140 0c000000 ae630004 ae630008 8fbf003c .....c...c.....<\n 0150 8fb40038 8fb30034 8fb20030 8fb1002c ...8...4...0...,\n 0160 8fb00028 03e00008 27bd0040 00000000 ...(....'..@....\nContents of section .reginfo:\n 0000 a01f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80051C80_52880 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc","sym":"func_800B0DC0_1DCF60","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["pointer","struct","cast","memory"],"loc":3,"refSource":"s32 func_800B0DC0_1DCF60(TableHeader *table) {\n return *(s32 *)(table->countOffset + (s32)table);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1DCF60.c#L14-L16","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,4(a0)\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tlw\tv0,0(v0)\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-b8ee1bad664b02b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_800B0DC0_1DCF60\n\n\nContents of section .text:\n 0000 8c820004 00441021 03e00008 8c420000 .....D.!.....B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 func_800B0DC0_1DCF60(s32 * a0) {\n return *(a0[1] + a0);\n}\n","score":1,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 func_800B0DC0_1DCF60(void *arg0) {\n return *(arg0->unk4 + arg0);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:1828: request for member `unk4' in something not a structure or union"]},"note":"src/1DCF60.c: reads a count field via base-relative offset; pure leaf","gapSize":{"decompiler":"asmlift","score":1,"maxScore":5,"ratio":0.2,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B0DC0_1DCF60` — benchmark function snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B0DC0_1DCF60\n lw\t$v0, 4($a0)\n addu\t$v0, $v0, $a0\n jr\t$ra\n lw\t$v0, 0($v0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B0DC0_1DCF60 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B0DC0_1DCF60` — benchmark function snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,4(a0)\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tlw\tv0,0(v0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-b8ee1bad664b02b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_800B0DC0_1DCF60\n\n\nContents of section .text:\n 0000 8c820004 00441021 03e00008 8c420000 .....D.!.....B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B0DC0_1DCF60 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc","sym":"func_800B4B30_1E1BE0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","call"],"loc":11,"refSource":"void func_800B4B30_1E1BE0(s16 arg0, s16 arg1, s16 arg2, s16 arg3) {\n s16 temp;\n\n if (arg3 <= 0) {\n temp = func_800B4AFC_1E1BAC(arg0);\n func_80058360_58F60(temp, arg1, arg2 + 0x80, 0);\n } else {\n temp = func_800B4AFC_1E1BAC(arg0);\n func_80057DF0_589F0(temp, arg1, arg2 + 0x80, 0, arg3);\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E1BA0.c#L40-L50","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts1,28(sp)\n 8:\tmove\ts1,a1\n c:\tsw\ts2,32(sp)\n 10:\tmove\ts2,a2\n 14:\tsll\ta3,a3,0x10\n 18:\tsw\ts0,24(sp)\n 1c:\tsra\ts0,a3,0x10\n 20:\tbgtz\ts0,60 \n 24:\tsw\tra,36(sp)\n 28:\tsll\ta0,a0,0x10\n 2c:\tjal\t0 \n 30:\tsra\ta0,a0,0x10\n 34:\tsll\tv0,v0,0x10\n 38:\tsra\ta0,v0,0x10\n 3c:\tsll\ta1,s1,0x10\n 40:\tsra\ta1,a1,0x10\n 44:\tsll\ta2,s2,0x10\n 48:\tsra\ta2,a2,0x10\n 4c:\taddiu\ta2,a2,128\n 50:\tjal\t0 \n 54:\tmove\ta3,zero\n 58:\tj\t94 \n 5c:\tnop\n 60:\tsll\ta0,a0,0x10\n 64:\tjal\t0 \n 68:\tsra\ta0,a0,0x10\n 6c:\tsw\ts0,16(sp)\n 70:\tsll\tv0,v0,0x10\n 74:\tsra\ta0,v0,0x10\n 78:\tsll\ta1,s1,0x10\n 7c:\tsra\ta1,a1,0x10\n 80:\tsll\ta2,s2,0x10\n 84:\tsra\ta2,a2,0x10\n 88:\taddiu\ta2,a2,128\n 8c:\tjal\t0 \n 90:\tmove\ta3,zero\n 94:\tlw\tra,36(sp)\n 98:\tlw\ts2,32(sp)\n 9c:\tlw\ts1,28(sp)\n a0:\tlw\ts0,24(sp)\n a4:\tjr\tra\n a8:\taddiu\tsp,sp,40\n ac:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-7a362db8d24a.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-12749b0eb3179cef/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000ac func_800B4B30_1E1BE0\n00000000 *UND*\t00000000 func_800B4AFC_1E1BAC\n00000000 *UND*\t00000000 func_80058360_58F60\n00000000 *UND*\t00000000 func_80057DF0_589F0\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 func_800B4AFC_1E1BAC\n00000050 R_MIPS_26 func_80058360_58F60\n00000058 R_MIPS_26 .text\n00000064 R_MIPS_26 func_800B4AFC_1E1BAC\n0000008c R_MIPS_26 func_80057DF0_589F0\n\n\nContents of section .text:\n 0000 27bdffd8 afb1001c 00a08821 afb20020 '..........!... \n 0010 00c09021 00073c00 afb00018 00078403 ...!..<.........\n 0020 1e00000f afbf0024 00042400 0c000000 .......$..$.....\n 0030 00042403 00021400 00022403 00112c00 ..$.......$...,.\n 0040 00052c03 00123400 00063403 24c60080 ..,...4...4.$...\n 0050 0c000000 00003821 08000025 00000000 ......8!...%....\n 0060 00042400 0c000000 00042403 afb00010 ..$.......$.....\n 0070 00021400 00022403 00112c00 00052c03 ......$...,...,.\n 0080 00123400 00063403 24c60080 0c000000 ..4...4.$.......\n 0090 00003821 8fbf0024 8fb20020 8fb1001c ..8!...$... ....\n 00a0 8fb00018 03e00008 27bd0028 00000000 ........'..(....\nContents of section .reginfo:\n 0000 a00700f4 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800B4B30_1E1BE0' — lift: cannot lift 'func_800B4B30_1E1BE0': function call 'jal' at 0x2c — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-40 */\n/* 4:\tsw\ts1,28(sp) */\n/* 8:\tmove\ts1,a1 */\n/* c:\tsw\ts2,32(sp) */\n/* 10:\tmove\ts2,a2 */\n/* 14:\tsll\ta3,a3,0x10 */\n/* 18:\tsw\ts0,24(sp) */\n/* 1c:\tsra\ts0,a3,0x10 */\n/* 20:\tbgtz\ts0,60 */\n/* 24:\tsw\tra,36(sp) */\n/* 28:\tsll\ta0,a0,0x10 */\n/* 2c:\tjal\t0 */\n/* 30:\tsra\ta0,a0,0x10 */\n/* 34:\tsll\tv0,v0,0x10 */\n/* 38:\tsra\ta0,v0,0x10 */\n/* 3c:\tsll\ta1,s1,0x10 */\n/* 40:\tsra\ta1,a1,0x10 */\n/* 44:\tsll\ta2,s2,0x10 */\n/* 48:\tsra\ta2,a2,0x10 */\n/* 4c:\taddiu\ta2,a2,128 */\n/* 50:\tjal\t0 */\n/* 54:\tmove\ta3,zero */\n/* 58:\tj\t94 */\n/* 5c:\tnop */\n/* 60:\tsll\ta0,a0,0x10 */\n/* 64:\tjal\t0 */\n/* 68:\tsra\ta0,a0,0x10 */\n/* 6c:\tsw\ts0,16(sp) */\n/* 70:\tsll\tv0,v0,0x10 */\n/* 74:\tsra\ta0,v0,0x10 */\n/* 78:\tsll\ta1,s1,0x10 */\n/* 7c:\tsra\ta1,a1,0x10 */\n/* 80:\tsll\ta2,s2,0x10 */\n/* 84:\tsra\ta2,a2,0x10 */\n/* 88:\taddiu\ta2,a2,128 */\n/* 8c:\tjal\t0 */\n/* 90:\tmove\ta3,zero */\n/* 94:\tlw\tra,36(sp) */\n/* 98:\tlw\ts2,32(sp) */\n/* 9c:\tlw\ts1,28(sp) */\n/* a0:\tlw\ts0,24(sp) */\n/* a4:\tjr\tra */\n/* a8:\taddiu\tsp,sp,40 */\n/* ac:\tnop */\nvoid func_800B4B30_1E1BE0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B4B30_1E1BE0': function call 'jal' at 0x2c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":52,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B4B30_1E1BE0': function call 'jal' at 0x2c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 func_800B4AFC_1E1BAC(s16, s32); /* extern */\n\nvoid func_800B4B30_1E1BE0(s16 arg0, s16 arg1, s16 arg2, s16 arg3) {\n s32 temp_a3;\n\n temp_a3 = arg3 << 0x10;\n if (arg3 <= 0) {\n func_80058360_58F60((s32) func_800B4AFC_1E1BAC(arg0, temp_a3), (s32) arg1, arg2 + 0x80, 0);\n return;\n }\n func_80057DF0_589F0((s32) func_800B4AFC_1E1BAC(arg0, temp_a3), (s32) arg1, arg2 + 0x80, 0, (s32) arg3);\n}\n","score":1,"maxScore":44,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":94,"lines":10,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":1,"maxScore":44,"ratio":0.022727272727272728,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B4B30_1E1BE0` — benchmark function snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B4B30_1E1BE0\n addiu\t$sp, $sp, -40\n sw\t$s1, 28($sp)\n move\t$s1, $a1\n sw\t$s2, 32($sp)\n move\t$s2, $a2\n sll\t$a3, $a3, 0x10\n sw\t$s0, 24($sp)\n sra\t$s0, $a3, 0x10\n bgtz\t$s0, .L60\n sw\t$ra, 36($sp)\n sll\t$a0, $a0, 0x10\n jal\tfunc_800B4AFC_1E1BAC\n sra\t$a0, $a0, 0x10\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n sll\t$a1, $s1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$a2, $s2, 0x10\n sra\t$a2, $a2, 0x10\n addiu\t$a2, $a2, 128\n jal\tfunc_80058360_58F60\n move\t$a3, $zero\n j\t.L94\n nop\n.L60:\n sll\t$a0, $a0, 0x10\n jal\tfunc_800B4AFC_1E1BAC\n sra\t$a0, $a0, 0x10\n sw\t$s0, 16($sp)\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n sll\t$a1, $s1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$a2, $s2, 0x10\n sra\t$a2, $a2, 0x10\n addiu\t$a2, $a2, 128\n jal\tfunc_80057DF0_589F0\n move\t$a3, $zero\n.L94:\n lw\t$ra, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-7a362db8d24a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800B4B30_1E1BE0(s16 arg0, s16 arg1, s16 arg2, s16 arg3);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B4B30_1E1BE0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B4B30_1E1BE0` — benchmark function snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts1,28(sp)\n 8:\tmove\ts1,a1\n c:\tsw\ts2,32(sp)\n 10:\tmove\ts2,a2\n 14:\tsll\ta3,a3,0x10\n 18:\tsw\ts0,24(sp)\n 1c:\tsra\ts0,a3,0x10\n 20:\tbgtz\ts0,60 \n 24:\tsw\tra,36(sp)\n 28:\tsll\ta0,a0,0x10\n 2c:\tjal\t0 \n 30:\tsra\ta0,a0,0x10\n 34:\tsll\tv0,v0,0x10\n 38:\tsra\ta0,v0,0x10\n 3c:\tsll\ta1,s1,0x10\n 40:\tsra\ta1,a1,0x10\n 44:\tsll\ta2,s2,0x10\n 48:\tsra\ta2,a2,0x10\n 4c:\taddiu\ta2,a2,128\n 50:\tjal\t0 \n 54:\tmove\ta3,zero\n 58:\tj\t94 \n 5c:\tnop\n 60:\tsll\ta0,a0,0x10\n 64:\tjal\t0 \n 68:\tsra\ta0,a0,0x10\n 6c:\tsw\ts0,16(sp)\n 70:\tsll\tv0,v0,0x10\n 74:\tsra\ta0,v0,0x10\n 78:\tsll\ta1,s1,0x10\n 7c:\tsra\ta1,a1,0x10\n 80:\tsll\ta2,s2,0x10\n 84:\tsra\ta2,a2,0x10\n 88:\taddiu\ta2,a2,128\n 8c:\tjal\t0 \n 90:\tmove\ta3,zero\n 94:\tlw\tra,36(sp)\n 98:\tlw\ts2,32(sp)\n 9c:\tlw\ts1,28(sp)\n a0:\tlw\ts0,24(sp)\n a4:\tjr\tra\n a8:\taddiu\tsp,sp,40\n ac:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-12749b0eb3179cef/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000ac func_800B4B30_1E1BE0\n00000000 *UND*\t00000000 func_800B4AFC_1E1BAC\n00000000 *UND*\t00000000 func_80058360_58F60\n00000000 *UND*\t00000000 func_80057DF0_589F0\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 func_800B4AFC_1E1BAC\n00000050 R_MIPS_26 func_80058360_58F60\n00000058 R_MIPS_26 .text\n00000064 R_MIPS_26 func_800B4AFC_1E1BAC\n0000008c R_MIPS_26 func_80057DF0_589F0\n\n\nContents of section .text:\n 0000 27bdffd8 afb1001c 00a08821 afb20020 '..........!... \n 0010 00c09021 00073c00 afb00018 00078403 ...!..<.........\n 0020 1e00000f afbf0024 00042400 0c000000 .......$..$.....\n 0030 00042403 00021400 00022403 00112c00 ..$.......$...,.\n 0040 00052c03 00123400 00063403 24c60080 ..,...4...4.$...\n 0050 0c000000 00003821 08000025 00000000 ......8!...%....\n 0060 00042400 0c000000 00042403 afb00010 ..$.......$.....\n 0070 00021400 00022403 00112c00 00052c03 ......$...,...,.\n 0080 00123400 00063403 24c60080 0c000000 ..4...4.$.......\n 0090 00003821 8fbf0024 8fb20020 8fb1001c ..8!...$... ....\n 00a0 8fb00018 03e00008 27bd0028 00000000 ........'..(....\nContents of section .reginfo:\n 0000 a00700f4 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B4B30_1E1BE0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc","sym":"func_800B5B7C_1E2C2C","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct"],"loc":33,"refSource":"void func_800B5B7C_1E2C2C(func_800B5E64_1E2F14_arg0 *arg0, u16 arg1) {\n arg0->unk20 = 0;\n arg0->unk22 = 0;\n arg0->unk24 = 0;\n arg0->unk26 = 0;\n arg0->unk28 = 0;\n arg0->unk2A = 0;\n arg0->unk2C = 0;\n arg0->unk2E = 0;\n arg0->unk30 = 0;\n arg0->unk32 = 0;\n arg0->unk34 = 0;\n arg0->unk38 = 0;\n arg0->unk3C = 0;\n arg0->unk40 = 0;\n arg0->unk44 = 0;\n arg0->unk48 = 0;\n arg0->unk4C = 0;\n arg0->unk50 = 0;\n arg0->unk54 = 0;\n arg0->unk58 = 0;\n arg0->unk5A = 0;\n arg0->unk5C = 0;\n arg0->unk5E = 0;\n arg0->unk60 = 0;\n arg0->unk62 = 0;\n arg0->unk64 = 0;\n arg0->unk68 = 0;\n arg0->unk6C = 0;\n arg0->unk6E = arg1;\n arg0->unk70 = 0;\n arg0->unk71 = 0;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E2BE0.c#L21-L53","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsh\tzero,32(a0)\n 4:\tsh\tzero,34(a0)\n 8:\tsh\tzero,36(a0)\n c:\tsh\tzero,38(a0)\n 10:\tsh\tzero,40(a0)\n 14:\tsh\tzero,42(a0)\n 18:\tsh\tzero,44(a0)\n 1c:\tsh\tzero,46(a0)\n 20:\tsh\tzero,48(a0)\n 24:\tsh\tzero,50(a0)\n 28:\tsw\tzero,52(a0)\n 2c:\tsw\tzero,56(a0)\n 30:\tsw\tzero,60(a0)\n 34:\tsw\tzero,64(a0)\n 38:\tsw\tzero,68(a0)\n 3c:\tsw\tzero,72(a0)\n 40:\tsw\tzero,76(a0)\n 44:\tsw\tzero,80(a0)\n 48:\tsw\tzero,84(a0)\n 4c:\tsh\tzero,88(a0)\n 50:\tsh\tzero,90(a0)\n 54:\tsh\tzero,92(a0)\n 58:\tsh\tzero,94(a0)\n 5c:\tsh\tzero,96(a0)\n 60:\tsh\tzero,98(a0)\n 64:\tsw\tzero,100(a0)\n 68:\tsw\tzero,104(a0)\n 6c:\tsh\tzero,108(a0)\n 70:\tsh\ta1,110(a0)\n 74:\tsb\tzero,112(a0)\n 78:\tjr\tra\n 7c:\tsb\tzero,113(a0)\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0fd05b0dfbce2e59/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000080 func_800B5B7C_1E2C2C\n\n\nContents of section .text:\n 0000 a4800020 a4800022 a4800024 a4800026 ... ...\"...$...&\n 0010 a4800028 a480002a a480002c a480002e ...(...*...,....\n 0020 a4800030 a4800032 ac800034 ac800038 ...0...2...4...8\n 0030 ac80003c ac800040 ac800044 ac800048 ...<...@...D...H\n 0040 ac80004c ac800050 ac800054 a4800058 ...L...P...T...X\n 0050 a480005a a480005c a480005e a4800060 ...Z...\\...^...`\n 0060 a4800062 ac800064 ac800068 a480006c ...b...d...h...l\n 0070 a485006e a0800070 03e00008 a0800071 ...n...p.......q\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"struct Struct0 { u8 _pad0[32]; u16 field_32; u16 field_34; u16 field_36; u16 field_38; u16 field_40; u16 field_42; u16 field_44; u16 field_46; u16 field_48; u16 field_50; s32 field_52; s32 field_56; s32 field_60; s32 field_64; s32 field_68; s32 field_72; s32 field_76; s32 field_80; s32 field_84; u16 field_88; u16 field_90; u16 field_92; u16 field_94; u16 field_96; u16 field_98; s32 field_100; s32 field_104; u16 field_108; u16 field_110; u8 field_112; u8 field_113; };\ns32 func_800B5B7C_1E2C2C(struct Struct0 * a0, u32 a1) {\n a0->field_32 = 0;\n a0->field_34 = 0;\n a0->field_36 = 0;\n a0->field_38 = 0;\n a0->field_40 = 0;\n a0->field_42 = 0;\n a0->field_44 = 0;\n a0->field_46 = 0;\n a0->field_48 = 0;\n a0->field_50 = 0;\n a0->field_52 = 0;\n a0->field_56 = 0;\n a0->field_60 = 0;\n a0->field_64 = 0;\n a0->field_68 = 0;\n a0->field_72 = 0;\n a0->field_76 = 0;\n a0->field_80 = 0;\n a0->field_84 = 0;\n a0->field_88 = 0;\n a0->field_90 = 0;\n a0->field_92 = 0;\n a0->field_94 = 0;\n a0->field_96 = 0;\n a0->field_98 = 0;\n a0->field_100 = 0;\n a0->field_104 = 0;\n a0->field_108 = 0;\n a0->field_110 = a1;\n a0->field_112 = 0;\n a0->field_113 = 0;\n return;\n}\n","score":0,"maxScore":32,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":35,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_800B5B7C_1E2C2C(void *arg0, s16 arg1) {\n arg0->unk20 = 0;\n arg0->unk22 = 0;\n arg0->unk24 = 0;\n arg0->unk26 = 0;\n arg0->unk28 = 0;\n arg0->unk2A = 0;\n arg0->unk2C = 0;\n arg0->unk2E = 0;\n arg0->unk30 = 0;\n arg0->unk32 = 0;\n arg0->unk34 = 0;\n arg0->unk38 = 0;\n arg0->unk3C = 0;\n arg0->unk40 = 0;\n arg0->unk44 = 0;\n arg0->unk48 = 0;\n arg0->unk4C = 0;\n arg0->unk50 = 0;\n arg0->unk54 = 0;\n arg0->unk58 = 0;\n arg0->unk5A = 0;\n arg0->unk5C = 0;\n arg0->unk5E = 0;\n arg0->unk60 = 0;\n arg0->unk62 = 0;\n arg0->unk64 = 0;\n arg0->unk68 = 0;\n arg0->unk6C = 0;\n arg0->unk6E = arg1;\n arg0->unk70 = 0;\n arg0->unk71 = 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":33,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:1879: request for member `unk20' in something not a structure or union","/c.i:1880: request for member `unk22' in something not a structure or union","/c.i:1881: request for member `unk24' in something not a structure or union","/c.i:1882: request for member `unk26' in something not a structure or union","/c.i:1883: request for member `unk28' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B5B7C_1E2C2C` — benchmark function snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B5B7C_1E2C2C\n sh\t$zero, 32($a0)\n sh\t$zero, 34($a0)\n sh\t$zero, 36($a0)\n sh\t$zero, 38($a0)\n sh\t$zero, 40($a0)\n sh\t$zero, 42($a0)\n sh\t$zero, 44($a0)\n sh\t$zero, 46($a0)\n sh\t$zero, 48($a0)\n sh\t$zero, 50($a0)\n sw\t$zero, 52($a0)\n sw\t$zero, 56($a0)\n sw\t$zero, 60($a0)\n sw\t$zero, 64($a0)\n sw\t$zero, 68($a0)\n sw\t$zero, 72($a0)\n sw\t$zero, 76($a0)\n sw\t$zero, 80($a0)\n sw\t$zero, 84($a0)\n sh\t$zero, 88($a0)\n sh\t$zero, 90($a0)\n sh\t$zero, 92($a0)\n sh\t$zero, 94($a0)\n sh\t$zero, 96($a0)\n sh\t$zero, 98($a0)\n sw\t$zero, 100($a0)\n sw\t$zero, 104($a0)\n sh\t$zero, 108($a0)\n sh\t$a1, 110($a0)\n sb\t$zero, 112($a0)\n jr\t$ra\n sb\t$zero, 113($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B5B7C_1E2C2C # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B5B7C_1E2C2C` — benchmark function snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsh\tzero,32(a0)\n 4:\tsh\tzero,34(a0)\n 8:\tsh\tzero,36(a0)\n c:\tsh\tzero,38(a0)\n 10:\tsh\tzero,40(a0)\n 14:\tsh\tzero,42(a0)\n 18:\tsh\tzero,44(a0)\n 1c:\tsh\tzero,46(a0)\n 20:\tsh\tzero,48(a0)\n 24:\tsh\tzero,50(a0)\n 28:\tsw\tzero,52(a0)\n 2c:\tsw\tzero,56(a0)\n 30:\tsw\tzero,60(a0)\n 34:\tsw\tzero,64(a0)\n 38:\tsw\tzero,68(a0)\n 3c:\tsw\tzero,72(a0)\n 40:\tsw\tzero,76(a0)\n 44:\tsw\tzero,80(a0)\n 48:\tsw\tzero,84(a0)\n 4c:\tsh\tzero,88(a0)\n 50:\tsh\tzero,90(a0)\n 54:\tsh\tzero,92(a0)\n 58:\tsh\tzero,94(a0)\n 5c:\tsh\tzero,96(a0)\n 60:\tsh\tzero,98(a0)\n 64:\tsw\tzero,100(a0)\n 68:\tsw\tzero,104(a0)\n 6c:\tsh\tzero,108(a0)\n 70:\tsh\ta1,110(a0)\n 74:\tsb\tzero,112(a0)\n 78:\tjr\tra\n 7c:\tsb\tzero,113(a0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0fd05b0dfbce2e59/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000080 func_800B5B7C_1E2C2C\n\n\nContents of section .text:\n 0000 a4800020 a4800022 a4800024 a4800026 ... ...\"...$...&\n 0010 a4800028 a480002a a480002c a480002e ...(...*...,....\n 0020 a4800030 a4800032 ac800034 ac800038 ...0...2...4...8\n 0030 ac80003c ac800040 ac800044 ac800048 ...<...@...D...H\n 0040 ac80004c ac800050 ac800054 a4800058 ...L...P...T...X\n 0050 a480005a a480005c a480005e a4800060 ...Z...\\...^...`\n 0060 a4800062 ac800064 ac800068 a480006c ...b...d...h...l\n 0070 a485006e a0800070 03e00008 a0800071 ...n...p.......q\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B5B7C_1E2C2C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc","sym":"func_800B68F4_1E39A4","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct"],"loc":8,"refSource":"void func_800B68F4_1E39A4(unk_func_800B68F4_1E39A4 *arg0, s32 arg1, s32 arg2, s32 arg3) {\n arg0->unk60 = arg1;\n arg0->unk54 = arg1;\n arg0->unk64 = arg2;\n arg0->unk58 = arg2;\n arg0->unk68 = arg3;\n arg0->unk5C = arg3;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L134-L141","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,96(a0)\n 4:\tsw\ta1,84(a0)\n 8:\tsw\ta2,100(a0)\n c:\tsw\ta2,88(a0)\n 10:\tsw\ta3,104(a0)\n 14:\tjr\tra\n 18:\tsw\ta3,92(a0)\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-025493b1a49c21ff/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_800B68F4_1E39A4\n\n\nContents of section .text:\n 0000 ac850060 ac850054 ac860064 ac860058 ...`...T...d...X\n 0010 ac870068 03e00008 ac87005c 00000000 ...h.......\\....\nContents of section .reginfo:\n 0000 800000f0 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 func_800B68F4_1E39A4(s32 * a0, u32 a1, u32 a2, u32 a3) {\n a0[24] = a1;\n a0[21] = a1;\n a0[25] = a2;\n a0[22] = a2;\n a0[26] = a3;\n a0[23] = a3;\n return;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_800B68F4_1E39A4(void *arg0, s32 arg1, s32 arg2, s32 arg3) {\n arg0->unk60 = arg1;\n arg0->unk54 = arg1;\n arg0->unk64 = arg2;\n arg0->unk58 = arg2;\n arg0->unk68 = arg3;\n arg0->unk5C = arg3;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:3444: request for member `unk60' in something not a structure or union","/c.i:3445: request for member `unk54' in something not a structure or union","/c.i:3446: request for member `unk64' in something not a structure or union","/c.i:3447: request for member `unk58' in something not a structure or union","/c.i:3448: request for member `unk68' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B68F4_1E39A4` — benchmark function snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B68F4_1E39A4\n sw\t$a1, 96($a0)\n sw\t$a1, 84($a0)\n sw\t$a2, 100($a0)\n sw\t$a2, 88($a0)\n sw\t$a3, 104($a0)\n jr\t$ra\n sw\t$a3, 92($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B68F4_1E39A4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B68F4_1E39A4` — benchmark function snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,96(a0)\n 4:\tsw\ta1,84(a0)\n 8:\tsw\ta2,100(a0)\n c:\tsw\ta2,88(a0)\n 10:\tsw\ta3,104(a0)\n 14:\tjr\tra\n 18:\tsw\ta3,92(a0)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-025493b1a49c21ff/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_800B68F4_1E39A4\n\n\nContents of section .text:\n 0000 ac850060 ac850054 ac860064 ac860058 ...`...T...d...X\n 0010 ac870068 03e00008 ac87005c 00000000 ...h.......\\....\nContents of section .reginfo:\n 0000 800000f0 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B68F4_1E39A4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc","sym":"func_800B7620_1E46D0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","bitwise","branch","call"],"loc":31,"refSource":"void func_800B7620_1E46D0(CutsceneSlotData *arg0, s32 arg1, s16 arg2, s16 arg3) {\n s32 temp_a0;\n s32 temp_v0;\n s32 temp_v1;\n s32 var_v0;\n s32 var_v1;\n\n arg0->unk0.Two = 6;\n arg0->unk94 = arg1;\n arg0->unk92 = arg3;\n arg0->unk84 = arg2;\n arg0->unk86 = arg2;\n temp_a0 = ((s16)atan2Fixed(arg0->unk20_u.unk20_s32, arg0->unk2C) + 0x1000) & 0x1FFF;\n arg0->unk9C_u.unk9C_s32 = temp_a0;\n temp_v1 = approximateCos(temp_a0) << 2;\n if (temp_v1 == 0) {\n var_v1 = (arg0->unk20_u.unk20_s32 << 8) / ((approximateSin(arg0->unk9C_u.s.unk9E) << 2) >> 8);\n var_v1 = (var_v1 > 0) ? var_v1 : -var_v1;\n arg0->unk98 = var_v1;\n } else {\n var_v0 = (arg0->unk2C << 8) / (temp_v1 >> 8);\n var_v0 = (var_v0 > 0) ? var_v0 : -var_v0;\n arg0->unk98 = var_v0;\n }\n temp_v0 = arg0->unk94;\n if (temp_v0 > 0) {\n arg0->unk7A = (arg0->unk9C_u.unk9C_s32 + 0x800) & 0x1FFF;\n } else if (temp_v0 < 0) {\n arg0->unk7A = (arg0->unk9C_u.unk9C_s32 - 0x800) & 0x1FFF;\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L576-L606","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tlw\ta0,36(s0)\n 14:\tsw\ta1,148(s0)\n 18:\tlw\ta1,44(s0)\n 1c:\tli\tv0,6\n 20:\tsb\tv0,0(s0)\n 24:\tsh\ta3,146(s0)\n 28:\tsh\ta2,132(s0)\n 2c:\tjal\t0 \n 30:\tsh\ta2,134(s0)\n 34:\tsll\ta0,v0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\taddiu\ta0,a0,4096\n 40:\tandi\ta0,a0,0x1fff\n 44:\tjal\t0 \n 48:\tsw\ta0,156(s0)\n 4c:\tsll\tv1,v0,0x2\n 50:\tbnez\tv1,b8 \n 54:\tsra\tv1,v1,0x8\n 58:\tlh\ta0,158(s0)\n 5c:\tjal\t0 \n 60:\tnop\n 64:\tlw\tv1,36(s0)\n 68:\tsll\tv0,v0,0x2\n 6c:\tsra\tv0,v0,0x8\n 70:\tsll\tv1,v1,0x8\n 74:\tdiv\tzero,v1,v0\n 78:\tbnez\tv0,84 \n 7c:\tnop\n 80:\tbreak\t0x7\n 84:\tli\tat,-1\n 88:\tbne\tv0,at,9c \n 8c:\tlui\tat,0x8000\n 90:\tbne\tv1,at,9c \n 94:\tnop\n 98:\tbreak\t0x6\n 9c:\tmflo\tv1\n\t...\n a8:\tbltzl\tv1,b0 \n ac:\tnegu\tv1,v1\n b0:\tj\t100 \n b4:\tsw\tv1,152(s0)\n b8:\tlw\tv0,44(s0)\n bc:\tsll\tv0,v0,0x8\n c0:\tdiv\tzero,v0,v1\n c4:\tbnez\tv1,d0 \n c8:\tnop\n cc:\tbreak\t0x7\n d0:\tli\tat,-1\n d4:\tbne\tv1,at,e8 \n d8:\tlui\tat,0x8000\n dc:\tbne\tv0,at,e8 \n e0:\tnop\n e4:\tbreak\t0x6\n e8:\tmflo\tv0\n\t...\n f4:\tbltzl\tv0,fc \n f8:\tnegu\tv0,v0\n fc:\tsw\tv0,152(s0)\n 100:\tlw\tv0,148(s0)\n 104:\tblez\tv0,118 \n 108:\tnop\n 10c:\tlw\tv0,156(s0)\n 110:\tj\t128 \n 114:\taddiu\tv0,v0,2048\n 118:\tbgez\tv0,130 \n 11c:\tnop\n 120:\tlw\tv0,156(s0)\n 124:\taddiu\tv0,v0,-2048\n 128:\tandi\tv0,v0,0x1fff\n 12c:\tsh\tv0,122(s0)\n 130:\tlw\tra,20(sp)\n 134:\tlw\ts0,16(sp)\n 138:\tjr\tra\n 13c:\taddiu\tsp,sp,24\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-73e26b51fe075bc1/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000140 func_800B7620_1E46D0\n00000000 *UND*\t00000000 atan2Fixed\n00000000 *UND*\t00000000 approximateCos\n00000000 *UND*\t00000000 approximateSin\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 atan2Fixed\n00000044 R_MIPS_26 approximateCos\n0000005c R_MIPS_26 approximateSin\n000000b0 R_MIPS_26 .text\n00000110 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 8e040024 ae050094 8e05002c 24020006 ...$.......,$...\n 0020 a2020000 a6070092 a6060084 0c000000 ................\n 0030 a6060086 00022400 00042403 24841000 ......$...$.$...\n 0040 30841fff 0c000000 ae04009c 00021880 0...............\n 0050 14600019 00031a03 8604009e 0c000000 .`..............\n 0060 00000000 8e030024 00021080 00021203 .......$........\n 0070 00031a00 0062001a 14400002 00000000 .....b...@......\n 0080 0007000d 2401ffff 14410004 3c018000 ....$....A..<...\n 0090 14610002 00000000 0006000d 00001812 .a..............\n 00a0 00000000 00000000 04620001 00031823 .........b.....#\n 00b0 08000040 ae030098 8e02002c 00021200 ...@.......,....\n 00c0 0043001a 14600002 00000000 0007000d .C...`..........\n 00d0 2401ffff 14610004 3c018000 14410002 $....a..<....A..\n 00e0 00000000 0006000d 00001012 00000000 ................\n 00f0 00000000 04420001 00021023 ae020098 .....B.....#....\n 0100 8e020094 18400004 00000000 8e02009c .....@..........\n 0110 0800004a 24420800 04410005 00000000 ...J$B...A......\n 0120 8e02009c 2442f800 30421fff a602007a ....$B..0B.....z\n 0130 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a00100fe 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800B7620_1E46D0' — lift: cannot lift 'func_800B7620_1E46D0': function call 'jal' at 0x2c — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tlw\ta0,36(s0) */\n/* 14:\tsw\ta1,148(s0) */\n/* 18:\tlw\ta1,44(s0) */\n/* 1c:\tli\tv0,6 */\n/* 20:\tsb\tv0,0(s0) */\n/* 24:\tsh\ta3,146(s0) */\n/* 28:\tsh\ta2,132(s0) */\n/* 2c:\tjal\t0 */\n/* 30:\tsh\ta2,134(s0) */\n/* 34:\tsll\ta0,v0,0x10 */\n/* 38:\tsra\ta0,a0,0x10 */\n/* 3c:\taddiu\ta0,a0,4096 */\n/* 40:\tandi\ta0,a0,0x1fff */\n/* 44:\tjal\t0 */\n/* 48:\tsw\ta0,156(s0) */\n/* 4c:\tsll\tv1,v0,0x2 */\n/* 50:\tbnez\tv1,b8 */\n/* 54:\tsra\tv1,v1,0x8 */\n/* 58:\tlh\ta0,158(s0) */\n/* 5c:\tjal\t0 */\n/* 60:\tnop */\n/* 64:\tlw\tv1,36(s0) */\n/* 68:\tsll\tv0,v0,0x2 */\n/* 6c:\tsra\tv0,v0,0x8 */\n/* 70:\tsll\tv1,v1,0x8 */\n/* 74:\tdiv\tzero,v1,v0 */\n/* 78:\tbnez\tv0,84 */\n/* 7c:\tnop */\n/* 80:\tbreak\t0x7 */\n/* 84:\tli\tat,-1 */\n/* 88:\tbne\tv0,at,9c */\n/* 8c:\tlui\tat,0x8000 */\n/* 90:\tbne\tv1,at,9c */\n/* 94:\tnop */\n/* 98:\tbreak\t0x6 */\n/* 9c:\tmflo\tv1 */\n/* \t... */\n/* a8:\tbltzl\tv1,b0 */\n/* ac:\tnegu\tv1,v1 */\n/* b0:\tj\t100 */\n/* b4:\tsw\tv1,152(s0) */\n/* b8:\tlw\tv0,44(s0) */\n/* bc:\tsll\tv0,v0,0x8 */\n/* c0:\tdiv\tzero,v0,v1 */\n/* c4:\tbnez\tv1,d0 */\n/* c8:\tnop */\n/* cc:\tbreak\t0x7 */\n/* d0:\tli\tat,-1 */\n/* d4:\tbne\tv1,at,e8 */\n/* d8:\tlui\tat,0x8000 */\n/* dc:\tbne\tv0,at,e8 */\n/* e0:\tnop */\n/* e4:\tbreak\t0x6 */\n/* e8:\tmflo\tv0 */\n/* \t... */\n/* f4:\tbltzl\tv0,fc */\n/* f8:\tnegu\tv0,v0 */\n/* fc:\tsw\tv0,152(s0) */\n/* 100:\tlw\tv0,148(s0) */\n/* 104:\tblez\tv0,118 */\n/* 108:\tnop */\n/* 10c:\tlw\tv0,156(s0) */\n/* 110:\tj\t128 */\n/* 114:\taddiu\tv0,v0,2048 */\n/* 118:\tbgez\tv0,130 */\n/* 11c:\tnop */\n/* 120:\tlw\tv0,156(s0) */\n/* 124:\taddiu\tv0,v0,-2048 */\n/* 128:\tandi\tv0,v0,0x1fff */\n/* 12c:\tsh\tv0,122(s0) */\n/* 130:\tlw\tra,20(sp) */\n/* 134:\tlw\ts0,16(sp) */\n/* 138:\tjr\tra */\n/* 13c:\taddiu\tsp,sp,24 */\nvoid func_800B7620_1E46D0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B7620_1E46D0': function call 'jal' at 0x2c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":86,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B7620_1E46D0': function call 'jal' at 0x2c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 approximateCos(s32); /* extern */\ns32 approximateSin(s16); /* extern */\ns16 atan2Fixed(s32, s32); /* extern */\n\nvoid func_800B7620_1E46D0(void *arg0, s32 arg1, s16 arg2, s16 arg3) {\n s32 temp_a0;\n s32 temp_v0;\n s32 temp_v1;\n s32 var_v0;\n s32 var_v0_2;\n s32 var_v1;\n\n arg0->unk94 = arg1;\n arg0->unk0 = 6;\n arg0->unk92 = arg3;\n arg0->unk84 = arg2;\n arg0->unk86 = arg2;\n temp_a0 = (atan2Fixed(arg0->unk24, arg0->unk2C) + 0x1000) & 0x1FFF;\n arg0->unk9C = temp_a0;\n temp_v1 = approximateCos(temp_a0) * 4;\n if (temp_v1 == 0) {\n var_v1 = (s32) (arg0->unk24 << 8) / (s32) ((s32) (approximateSin(arg0->unk9E) * 4) >> 8);\n if (var_v1 < 0) {\n var_v1 = -var_v1;\n }\n arg0->unk98 = var_v1;\n } else {\n var_v0 = (s32) (arg0->unk2C << 8) / (s32) (temp_v1 >> 8);\n if (var_v0 < 0) {\n var_v0 = -var_v0;\n }\n arg0->unk98 = var_v0;\n }\n temp_v0 = arg0->unk94;\n if (temp_v0 > 0) {\n var_v0_2 = arg0->unk9C + 0x800;\n goto block_11;\n }\n if (temp_v0 < 0) {\n var_v0_2 = arg0->unk9C - 0x800;\nblock_11:\n arg0->unk7A = (s16) (var_v0_2 & 0x1FFF);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":76,"lines":42,"gotos":1,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: kmc gcc (docker) failed: /c.i:3443: conflicting types for `approximateCos'","/c.i:1870: previous declaration of `approximateCos'","/c.i:3445: conflicting types for `atan2Fixed'","/c.i:1868: previous declaration of `atan2Fixed'","/c.i:3453: request for member `unk94' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B7620_1E46D0` — benchmark function snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B7620_1E46D0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n lw\t$a0, 36($s0)\n sw\t$a1, 148($s0)\n lw\t$a1, 44($s0)\n li\t$v0, 6\n sb\t$v0, 0($s0)\n sh\t$a3, 146($s0)\n sh\t$a2, 132($s0)\n jal\tatan2Fixed\n sh\t$a2, 134($s0)\n sll\t$a0, $v0, 0x10\n sra\t$a0, $a0, 0x10\n addiu\t$a0, $a0, 4096\n andi\t$a0, $a0, 0x1fff\n jal\tapproximateCos\n sw\t$a0, 156($s0)\n sll\t$v1, $v0, 0x2\n bnez\t$v1, .Lb8\n sra\t$v1, $v1, 0x8\n lh\t$a0, 158($s0)\n jal\tapproximateSin\n nop\n lw\t$v1, 36($s0)\n sll\t$v0, $v0, 0x2\n sra\t$v0, $v0, 0x8\n sll\t$v1, $v1, 0x8\n div\t$zero, $v1, $v0\n bnez\t$v0, .L84\n nop\n break\t0x7\n.L84:\n li\t$at, -1\n bne\t$v0, $at, .L9c\n lui\t$at, 0x8000\n bne\t$v1, $at, .L9c\n nop\n break\t0x6\n.L9c:\n mflo\t$v1\n bltzl\t$v1, .Lb0\n negu\t$v1, $v1\n.Lb0:\n j\t.L100\n sw\t$v1, 152($s0)\n.Lb8:\n lw\t$v0, 44($s0)\n sll\t$v0, $v0, 0x8\n div\t$zero, $v0, $v1\n bnez\t$v1, .Ld0\n nop\n break\t0x7\n.Ld0:\n li\t$at, -1\n bne\t$v1, $at, .Le8\n lui\t$at, 0x8000\n bne\t$v0, $at, .Le8\n nop\n break\t0x6\n.Le8:\n mflo\t$v0\n bltzl\t$v0, .Lfc\n negu\t$v0, $v0\n.Lfc:\n sw\t$v0, 152($s0)\n.L100:\n lw\t$v0, 148($s0)\n blez\t$v0, .L118\n nop\n lw\t$v0, 156($s0)\n j\t.L128\n addiu\t$v0, $v0, 2048\n.L118:\n bgez\t$v0, .L130\n nop\n lw\t$v0, 156($s0)\n addiu\t$v0, $v0, -2048\n.L128:\n andi\t$v0, $v0, 0x1fff\n sh\t$v0, 122($s0)\n.L130:\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B7620_1E46D0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B7620_1E46D0` — benchmark function snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tlw\ta0,36(s0)\n 14:\tsw\ta1,148(s0)\n 18:\tlw\ta1,44(s0)\n 1c:\tli\tv0,6\n 20:\tsb\tv0,0(s0)\n 24:\tsh\ta3,146(s0)\n 28:\tsh\ta2,132(s0)\n 2c:\tjal\t0 \n 30:\tsh\ta2,134(s0)\n 34:\tsll\ta0,v0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\taddiu\ta0,a0,4096\n 40:\tandi\ta0,a0,0x1fff\n 44:\tjal\t0 \n 48:\tsw\ta0,156(s0)\n 4c:\tsll\tv1,v0,0x2\n 50:\tbnez\tv1,b8 \n 54:\tsra\tv1,v1,0x8\n 58:\tlh\ta0,158(s0)\n 5c:\tjal\t0 \n 60:\tnop\n 64:\tlw\tv1,36(s0)\n 68:\tsll\tv0,v0,0x2\n 6c:\tsra\tv0,v0,0x8\n 70:\tsll\tv1,v1,0x8\n 74:\tdiv\tzero,v1,v0\n 78:\tbnez\tv0,84 \n 7c:\tnop\n 80:\tbreak\t0x7\n 84:\tli\tat,-1\n 88:\tbne\tv0,at,9c \n 8c:\tlui\tat,0x8000\n 90:\tbne\tv1,at,9c \n 94:\tnop\n 98:\tbreak\t0x6\n 9c:\tmflo\tv1\n\t...\n a8:\tbltzl\tv1,b0 \n ac:\tnegu\tv1,v1\n b0:\tj\t100 \n b4:\tsw\tv1,152(s0)\n b8:\tlw\tv0,44(s0)\n bc:\tsll\tv0,v0,0x8\n c0:\tdiv\tzero,v0,v1\n c4:\tbnez\tv1,d0 \n c8:\tnop\n cc:\tbreak\t0x7\n d0:\tli\tat,-1\n d4:\tbne\tv1,at,e8 \n d8:\tlui\tat,0x8000\n dc:\tbne\tv0,at,e8 \n e0:\tnop\n e4:\tbreak\t0x6\n e8:\tmflo\tv0\n\t...\n f4:\tbltzl\tv0,fc \n f8:\tnegu\tv0,v0\n fc:\tsw\tv0,152(s0)\n 100:\tlw\tv0,148(s0)\n 104:\tblez\tv0,118 \n 108:\tnop\n 10c:\tlw\tv0,156(s0)\n 110:\tj\t128 \n 114:\taddiu\tv0,v0,2048\n 118:\tbgez\tv0,130 \n 11c:\tnop\n 120:\tlw\tv0,156(s0)\n 124:\taddiu\tv0,v0,-2048\n 128:\tandi\tv0,v0,0x1fff\n 12c:\tsh\tv0,122(s0)\n 130:\tlw\tra,20(sp)\n 134:\tlw\ts0,16(sp)\n 138:\tjr\tra\n 13c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-73e26b51fe075bc1/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000140 func_800B7620_1E46D0\n00000000 *UND*\t00000000 atan2Fixed\n00000000 *UND*\t00000000 approximateCos\n00000000 *UND*\t00000000 approximateSin\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 atan2Fixed\n00000044 R_MIPS_26 approximateCos\n0000005c R_MIPS_26 approximateSin\n000000b0 R_MIPS_26 .text\n00000110 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 8e040024 ae050094 8e05002c 24020006 ...$.......,$...\n 0020 a2020000 a6070092 a6060084 0c000000 ................\n 0030 a6060086 00022400 00042403 24841000 ......$...$.$...\n 0040 30841fff 0c000000 ae04009c 00021880 0...............\n 0050 14600019 00031a03 8604009e 0c000000 .`..............\n 0060 00000000 8e030024 00021080 00021203 .......$........\n 0070 00031a00 0062001a 14400002 00000000 .....b...@......\n 0080 0007000d 2401ffff 14410004 3c018000 ....$....A..<...\n 0090 14610002 00000000 0006000d 00001812 .a..............\n 00a0 00000000 00000000 04620001 00031823 .........b.....#\n 00b0 08000040 ae030098 8e02002c 00021200 ...@.......,....\n 00c0 0043001a 14600002 00000000 0007000d .C...`..........\n 00d0 2401ffff 14610004 3c018000 14410002 $....a..<....A..\n 00e0 00000000 0006000d 00001012 00000000 ................\n 00f0 00000000 04420001 00021023 ae020098 .....B.....#....\n 0100 8e020094 18400004 00000000 8e02009c .....@..........\n 0110 0800004a 24420800 04410005 00000000 ...J$B...A......\n 0120 8e02009c 2442f800 30421fff a602007a ....$B..0B.....z\n 0130 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a00100fe 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B7620_1E46D0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc","sym":"func_800B7760_1E4810","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","branch","call"],"loc":15,"refSource":"void func_800B7760_1E4810(CutsceneSlotData *arg0, s32 arg1, s16 arg2) {\n s32 diff;\n s32 delta;\n\n if (arg2 > 0) {\n diff = arg1 - arg0->unk54;\n delta = diff / arg2;\n arg0->unk60 = arg1;\n arg0->unk6C = delta;\n } else {\n arg0->unk54 = arg1;\n arg0->unk60 = arg1;\n arg0->unk6C = 0;\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L608-L622","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta2,a2,0x10\n 4:\tsra\ta2,a2,0x10\n 8:\tblezl\ta2,54 \n c:\tsw\ta1,84(a0)\n 10:\tlw\tv0,84(a0)\n 14:\tsubu\tv0,a1,v0\n 18:\tdiv\tzero,v0,a2\n 1c:\tbnez\ta2,28 \n 20:\tnop\n 24:\tbreak\t0x7\n 28:\tli\tat,-1\n 2c:\tbne\ta2,at,40 \n 30:\tlui\tat,0x8000\n 34:\tbne\tv0,at,40 \n 38:\tnop\n 3c:\tbreak\t0x6\n 40:\tmflo\tv0\n 44:\tsw\ta1,96(a0)\n 48:\tnop\n 4c:\tj\t5c \n 50:\tsw\tv0,108(a0)\n 54:\tsw\ta1,96(a0)\n 58:\tsw\tzero,108(a0)\n 5c:\tjr\tra\n 60:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-7077fb1721cb5369/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000064 func_800B7760_1E4810\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000004c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00063400 00063403 58c00012 ac850054 ..4...4.X......T\n 0010 8c820054 00a21023 0046001a 14c00002 ...T...#.F......\n 0020 00000000 0007000d 2401ffff 14c10004 ........$.......\n 0030 3c018000 14410002 00000000 0006000d <....A..........\n 0040 00001012 ac850060 00000000 08000017 .......`........\n 0050 ac82006c ac850060 ac80006c 03e00008 ...l...`...l....\n 0060 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800B7760_1E4810' — lift: cannot lift 'func_800B7760_1E4810': unmodelled control transfer 'blezl' at 0x8 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsll\ta2,a2,0x10 */\n/* 4:\tsra\ta2,a2,0x10 */\n/* 8:\tblezl\ta2,54 */\n/* c:\tsw\ta1,84(a0) */\n/* 10:\tlw\tv0,84(a0) */\n/* 14:\tsubu\tv0,a1,v0 */\n/* 18:\tdiv\tzero,v0,a2 */\n/* 1c:\tbnez\ta2,28 */\n/* 20:\tnop */\n/* 24:\tbreak\t0x7 */\n/* 28:\tli\tat,-1 */\n/* 2c:\tbne\ta2,at,40 */\n/* 30:\tlui\tat,0x8000 */\n/* 34:\tbne\tv0,at,40 */\n/* 38:\tnop */\n/* 3c:\tbreak\t0x6 */\n/* 40:\tmflo\tv0 */\n/* 44:\tsw\ta1,96(a0) */\n/* 48:\tnop */\n/* 4c:\tj\t5c */\n/* 50:\tsw\tv0,108(a0) */\n/* 54:\tsw\ta1,96(a0) */\n/* 58:\tsw\tzero,108(a0) */\n/* 5c:\tjr\tra */\n/* 60:\tnop */\n/* \t... */\nvoid func_800B7760_1E4810(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B7760_1E4810': unmodelled control transfer 'blezl' at 0x8 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":34,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B7760_1E4810': unmodelled control transfer 'blezl' at 0x8 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_800B7760_1E4810(void *arg0, s32 arg1, s16 arg2) {\n if (arg2 <= 0) {\n arg0->unk54 = arg1;\n arg0->unk60 = arg1;\n arg0->unk6C = 0;\n return;\n }\n arg0->unk60 = arg1;\n arg0->unk6C = (s32) ((s32) (arg1 - arg0->unk54) / arg2);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":10,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:3445: request for member `unk54' in something not a structure or union","/c.i:3446: request for member `unk60' in something not a structure or union","/c.i:3447: request for member `unk6C' in something not a structure or union","/c.i:3450: request for member `unk60' in something not a structure or union","/c.i:3451: request for member `unk6C' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B7760_1E4810` — benchmark function snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B7760_1E4810\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n blezl\t$a2, .L54\n sw\t$a1, 84($a0)\n lw\t$v0, 84($a0)\n subu\t$v0, $a1, $v0\n div\t$zero, $v0, $a2\n bnez\t$a2, .L28\n nop\n break\t0x7\n.L28:\n li\t$at, -1\n bne\t$a2, $at, .L40\n lui\t$at, 0x8000\n bne\t$v0, $at, .L40\n nop\n break\t0x6\n.L40:\n mflo\t$v0\n sw\t$a1, 96($a0)\n nop\n j\t.L5c\n sw\t$v0, 108($a0)\n.L54:\n sw\t$a1, 96($a0)\n sw\t$zero, 108($a0)\n.L5c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B7760_1E4810 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B7760_1E4810` — benchmark function snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta2,a2,0x10\n 4:\tsra\ta2,a2,0x10\n 8:\tblezl\ta2,54 \n c:\tsw\ta1,84(a0)\n 10:\tlw\tv0,84(a0)\n 14:\tsubu\tv0,a1,v0\n 18:\tdiv\tzero,v0,a2\n 1c:\tbnez\ta2,28 \n 20:\tnop\n 24:\tbreak\t0x7\n 28:\tli\tat,-1\n 2c:\tbne\ta2,at,40 \n 30:\tlui\tat,0x8000\n 34:\tbne\tv0,at,40 \n 38:\tnop\n 3c:\tbreak\t0x6\n 40:\tmflo\tv0\n 44:\tsw\ta1,96(a0)\n 48:\tnop\n 4c:\tj\t5c \n 50:\tsw\tv0,108(a0)\n 54:\tsw\ta1,96(a0)\n 58:\tsw\tzero,108(a0)\n 5c:\tjr\tra\n 60:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-7077fb1721cb5369/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000064 func_800B7760_1E4810\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000004c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00063400 00063403 58c00012 ac850054 ..4...4.X......T\n 0010 8c820054 00a21023 0046001a 14c00002 ...T...#.F......\n 0020 00000000 0007000d 2401ffff 14c10004 ........$.......\n 0030 3c018000 14410002 00000000 0006000d <....A..........\n 0040 00001012 ac850060 00000000 08000017 .......`........\n 0050 ac82006c ac850060 ac80006c 03e00008 ...l...`...l....\n 0060 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B7760_1E4810 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc","sym":"func_800B93F0_1E64A0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","call"],"loc":15,"refSource":"s32 func_800B93F0_1E64A0(s32 arg0) {\n s32 result;\n\n if (arg0 == 0) {\n arg0 = 1;\n }\n\n result = 0x4000000 / arg0;\n\n if (result >= 0x4000) {\n result = 0x4000;\n }\n\n return result;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E64A0.c#L16-L30","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqzl\ta0,8 \n 4:\tli\ta0,1\n 8:\tlui\tv0,0x400\n c:\tdiv\tzero,v0,a0\n 10:\tbnez\ta0,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta0,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\tv0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmflo\ta0\n 38:\tslti\tv0,a0,16384\n 3c:\tnop\n 40:\tbeqzl\tv0,48 \n 44:\tli\ta0,16384\n 48:\tjr\tra\n 4c:\tmove\tv0,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-224f646ab8fe4f42/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 func_800B93F0_1E64A0\n\n\nContents of section .text:\n 0000 50800001 24040001 3c020400 0044001a P...$...<....D..\n 0010 14800002 00000000 0007000d 2401ffff ............$...\n 0020 14810004 3c018000 14410002 00000000 ....<....A......\n 0030 0006000d 00002012 28824000 00000000 ...... .(.@.....\n 0040 50400001 24044000 03e00008 00801021 P@..$.@........!\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800B93F0_1E64A0' — lift: cannot lift 'func_800B93F0_1E64A0': unmodelled control transfer 'beqzl' at 0x0 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tbeqzl\ta0,8 */\n/* 4:\tli\ta0,1 */\n/* 8:\tlui\tv0,0x400 */\n/* c:\tdiv\tzero,v0,a0 */\n/* 10:\tbnez\ta0,1c */\n/* 14:\tnop */\n/* 18:\tbreak\t0x7 */\n/* 1c:\tli\tat,-1 */\n/* 20:\tbne\ta0,at,34 */\n/* 24:\tlui\tat,0x8000 */\n/* 28:\tbne\tv0,at,34 */\n/* 2c:\tnop */\n/* 30:\tbreak\t0x6 */\n/* 34:\tmflo\ta0 */\n/* 38:\tslti\tv0,a0,16384 */\n/* 3c:\tnop */\n/* 40:\tbeqzl\tv0,48 */\n/* 44:\tli\ta0,16384 */\n/* 48:\tjr\tra */\n/* 4c:\tmove\tv0,a0 */\nvoid func_800B93F0_1E64A0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B93F0_1E64A0': unmodelled control transfer 'beqzl' at 0x0 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":28,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B93F0_1E64A0': unmodelled control transfer 'beqzl' at 0x0 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 func_800B93F0_1E64A0(s32 arg0) {\n s32 var_a0;\n s32 var_a0_2;\n\n var_a0_2 = arg0;\n if (var_a0_2 == 0) {\n var_a0_2 = 1;\n }\n var_a0 = 0x04000000 / var_a0_2;\n if (var_a0 >= 0x4000) {\n var_a0 = 0x4000;\n }\n return var_a0;\n}\n","score":0,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B93F0_1E64A0` — benchmark function snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B93F0_1E64A0\n beqzl\t$a0, .L8\n li\t$a0, 1\n.L8:\n lui\t$v0, 0x400\n div\t$zero, $v0, $a0\n bnez\t$a0, .L1c\n nop\n break\t0x7\n.L1c:\n li\t$at, -1\n bne\t$a0, $at, .L34\n lui\t$at, 0x8000\n bne\t$v0, $at, .L34\n nop\n break\t0x6\n.L34:\n mflo\t$a0\n slti\t$v0, $a0, 16384\n nop\n beqzl\t$v0, .L48\n li\t$a0, 16384\n.L48:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B93F0_1E64A0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B93F0_1E64A0` — benchmark function snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqzl\ta0,8 \n 4:\tli\ta0,1\n 8:\tlui\tv0,0x400\n c:\tdiv\tzero,v0,a0\n 10:\tbnez\ta0,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta0,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\tv0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmflo\ta0\n 38:\tslti\tv0,a0,16384\n 3c:\tnop\n 40:\tbeqzl\tv0,48 \n 44:\tli\ta0,16384\n 48:\tjr\tra\n 4c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-224f646ab8fe4f42/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 func_800B93F0_1E64A0\n\n\nContents of section .text:\n 0000 50800001 24040001 3c020400 0044001a P...$...<....D..\n 0010 14800002 00000000 0007000d 2401ffff ............$...\n 0020 14810004 3c018000 14410002 00000000 ....<....A......\n 0030 0006000d 00002012 28824000 00000000 ...... .(.@.....\n 0040 50400001 24044000 03e00008 00801021 P@..$.@........!\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B93F0_1E64A0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc","sym":"func_800B9C20_1E6CD0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","call"],"loc":5,"refSource":"void func_800B9C20_1E6CD0(cutsceneSys2Wait_exec_asset *arg0) {\n arg0->unkA0 = freeNodeMemory(arg0->unkA0);\n arg0->unk8 = freeNodeMemory(arg0->unk8);\n arg0->unkC = freeNodeMemory(arg0->unkC);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E64A0.c#L201-L205","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tjal\t0 \n 14:\tlw\ta0,160(s0)\n 18:\tlw\ta0,8(s0)\n 1c:\tjal\t0 \n 20:\tsw\tv0,160(s0)\n 24:\tlw\ta0,12(s0)\n 28:\tjal\t0 \n 2c:\tsw\tv0,8(s0)\n 30:\tsw\tv0,12(s0)\n 34:\tlw\tra,20(sp)\n 38:\tlw\ts0,16(sp)\n 3c:\tjr\tra\n 40:\taddiu\tsp,sp,24\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-089cd7a701ec1012/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000044 func_800B9C20_1E6CD0\n00000000 *UND*\t00000000 freeNodeMemory\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 freeNodeMemory\n0000001c R_MIPS_26 freeNodeMemory\n00000028 R_MIPS_26 freeNodeMemory\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 0c000000 8e0400a0 8e040008 0c000000 ................\n 0020 ae0200a0 8e04000c 0c000000 ae020008 ................\n 0030 ae02000c 8fbf0014 8fb00010 03e00008 ................\n 0040 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800B9C20_1E6CD0' — lift: cannot lift 'func_800B9C20_1E6CD0': function call 'jal' at 0x10 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tjal\t0 */\n/* 14:\tlw\ta0,160(s0) */\n/* 18:\tlw\ta0,8(s0) */\n/* 1c:\tjal\t0 */\n/* 20:\tsw\tv0,160(s0) */\n/* 24:\tlw\ta0,12(s0) */\n/* 28:\tjal\t0 */\n/* 2c:\tsw\tv0,8(s0) */\n/* 30:\tsw\tv0,12(s0) */\n/* 34:\tlw\tra,20(sp) */\n/* 38:\tlw\ts0,16(sp) */\n/* 3c:\tjr\tra */\n/* 40:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid func_800B9C20_1E6CD0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B9C20_1E6CD0': function call 'jal' at 0x10 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":26,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B9C20_1E6CD0': function call 'jal' at 0x10 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 freeNodeMemory(s32); /* extern */\n\nvoid func_800B9C20_1E6CD0(void *arg0) {\n arg0->unkA0 = freeNodeMemory(arg0->unkA0);\n arg0->unk8 = freeNodeMemory(arg0->unk8);\n arg0->unkC = freeNodeMemory(arg0->unkC);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":6,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:3410: request for member `unkA0' in something not a structure or union","/c.i:3411: request for member `unk8' in something not a structure or union","/c.i:3412: request for member `unkC' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B9C20_1E6CD0` — benchmark function snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B9C20_1E6CD0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n jal\tfreeNodeMemory\n lw\t$a0, 160($s0)\n lw\t$a0, 8($s0)\n jal\tfreeNodeMemory\n sw\t$v0, 160($s0)\n lw\t$a0, 12($s0)\n jal\tfreeNodeMemory\n sw\t$v0, 8($s0)\n sw\t$v0, 12($s0)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B9C20_1E6CD0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B9C20_1E6CD0` — benchmark function snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tjal\t0 \n 14:\tlw\ta0,160(s0)\n 18:\tlw\ta0,8(s0)\n 1c:\tjal\t0 \n 20:\tsw\tv0,160(s0)\n 24:\tlw\ta0,12(s0)\n 28:\tjal\t0 \n 2c:\tsw\tv0,8(s0)\n 30:\tsw\tv0,12(s0)\n 34:\tlw\tra,20(sp)\n 38:\tlw\ts0,16(sp)\n 3c:\tjr\tra\n 40:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-089cd7a701ec1012/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000044 func_800B9C20_1E6CD0\n00000000 *UND*\t00000000 freeNodeMemory\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 freeNodeMemory\n0000001c R_MIPS_26 freeNodeMemory\n00000028 R_MIPS_26 freeNodeMemory\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 0c000000 8e0400a0 8e040008 0c000000 ................\n 0020 ae0200a0 8e04000c 0c000000 ae020008 ................\n 0030 ae02000c 8fbf0014 8fb00010 03e00008 ................\n 0040 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B9C20_1E6CD0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:GenericTriggerInit:gcc2.7.2kmc","sym":"GenericTriggerInit","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field","call","global"],"loc":9,"refSource":"void GenericTriggerInit(EventTrigger *arg0) {\n u8 eventId = arg0->eventId;\n arg0->unk1 = 0;\n arg0->unk4 = 0;\n arg0->unk6 = -0x68;\n arg0->unk8 = 0;\n arg0->unkC = &D_8008D714_8E314[eventId * 20];\n setCallback(GenericTriggerCheck);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/198B0.c#L10-L18","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tlbu\tv1,0(a0)\n c:\tli\tv0,-104\n 10:\tsb\tzero,1(a0)\n 14:\tsh\tzero,4(a0)\n 18:\tsh\tv0,6(a0)\n 1c:\tsh\tzero,8(a0)\n 20:\tsll\tv0,v1,0x2\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\tv0,v0,v1\n 38:\tsw\tv0,12(a0)\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-179f8d5e0521.i.gz","proto":{"GenericTriggerInit":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-17b75d3a9e5de8d3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 GenericTriggerInit\n00000000 *UND*\t00000000 D_8008D714_8E314\n00000000 *UND*\t00000000 GenericTriggerCheck\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 D_8008D714_8E314\n00000030 R_MIPS_LO16 D_8008D714_8E314\n0000003c R_MIPS_HI16 GenericTriggerCheck\n00000044 R_MIPS_LO16 GenericTriggerCheck\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 90830000 2402ff98 '...........$...\n 0010 a0800001 a4800004 a4820006 a4800008 ................\n 0020 00031080 00431021 00021080 3c030000 .....C.!....<...\n 0030 24630000 00431021 ac82000c 3c040000 $c...C.!....<...\n 0040 0c000000 24840000 8fbf0010 03e00008 ....$...........\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'GenericTriggerInit' — lift: cannot lift 'GenericTriggerInit': function call 'jal' at 0x40 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tlbu\tv1,0(a0) */\n/* c:\tli\tv0,-104 */\n/* 10:\tsb\tzero,1(a0) */\n/* 14:\tsh\tzero,4(a0) */\n/* 18:\tsh\tv0,6(a0) */\n/* 1c:\tsh\tzero,8(a0) */\n/* 20:\tsll\tv0,v1,0x2 */\n/* 24:\taddu\tv0,v0,v1 */\n/* 28:\tsll\tv0,v0,0x2 */\n/* 2c:\tlui\tv1,0x0 */\n/* 30:\taddiu\tv1,v1,0 */\n/* 34:\taddu\tv0,v0,v1 */\n/* 38:\tsw\tv0,12(a0) */\n/* 3c:\tlui\ta0,0x0 */\n/* 40:\tjal\t0 */\n/* 44:\taddiu\ta0,a0,0 */\n/* 48:\tlw\tra,16(sp) */\n/* 4c:\tjr\tra */\n/* 50:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid GenericTriggerInit(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'GenericTriggerInit': function call 'jal' at 0x40 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":30,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'GenericTriggerInit': function call 'jal' at 0x40 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void GenericTriggerInit(EventTrigger *arg0) {\n arg0->unk1 = 0;\n arg0->unk4 = 0;\n arg0->unk6 = -0x68;\n arg0->unk8 = 0;\n arg0->unkC = ((u8) arg0->eventId * 0x14) + D_8008D714_8E314;\n setCallback(GenericTriggerCheck);\n}\n","score":0,"maxScore":21,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/198B0.c: initializes an event trigger struct and registers its check callback","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GenericTriggerInit` — benchmark function snowboardkids2:GenericTriggerInit:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GenericTriggerInit\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n lbu\t$v1, 0($a0)\n li\t$v0, -104\n sb\t$zero, 1($a0)\n sh\t$zero, 4($a0)\n sh\t$v0, 6($a0)\n sh\t$zero, 8($a0)\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_8008D714_8E314)\n addiu\t$v1, $v1, %lo(D_8008D714_8E314)\n addu\t$v0, $v0, $v1\n sw\t$v0, 12($a0)\n lui\t$a0, %hi(GenericTriggerCheck)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(GenericTriggerCheck)\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-179f8d5e0521.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid GenericTriggerInit(EventTrigger *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GenericTriggerInit # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GenericTriggerInit` — benchmark function snowboardkids2:GenericTriggerInit:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:GenericTriggerInit:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tlbu\tv1,0(a0)\n c:\tli\tv0,-104\n 10:\tsb\tzero,1(a0)\n 14:\tsh\tzero,4(a0)\n 18:\tsh\tv0,6(a0)\n 1c:\tsh\tzero,8(a0)\n 20:\tsll\tv0,v1,0x2\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\tv0,v0,v1\n 38:\tsw\tv0,12(a0)\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-17b75d3a9e5de8d3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 GenericTriggerInit\n00000000 *UND*\t00000000 D_8008D714_8E314\n00000000 *UND*\t00000000 GenericTriggerCheck\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 D_8008D714_8E314\n00000030 R_MIPS_LO16 D_8008D714_8E314\n0000003c R_MIPS_HI16 GenericTriggerCheck\n00000044 R_MIPS_LO16 GenericTriggerCheck\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 90830000 2402ff98 '...........$...\n 0010 a0800001 a4800004 a4820006 a4800008 ................\n 0020 00031080 00431021 00021080 3c030000 .....C.!....<...\n 0030 24630000 00431021 ac82000c 3c040000 $c...C.!....<...\n 0040 0c000000 24840000 8fbf0010 03e00008 ....$...........\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GenericTriggerInit\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GenericTriggerInit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc","sym":"getTableEntryByU16Index","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","array","field","pointer"],"loc":15,"refSource":"void getTableEntryByU16Index(DataTable_19E80 *arg0, u16 arg1, OutputStruct_19E80 *arg2) {\n u16 index_offset;\n TableEntry_19E80 *entry_ptr;\n TableEntry_19E80 *index_table;\n TableEntry_19E80 *entry;\n\n entry_ptr = arg0->entries;\n index_table = &entry_ptr[arg0->index_table_offset];\n entry_ptr = &entry_ptr[arg1];\n\n arg2->data_ptr = &arg0->header[entry_ptr->data_offset];\n arg2->index_ptr = &index_table[entry_ptr->index_offset * 2];\n arg2->field1 = entry_ptr->field1;\n arg2->field2 = entry_ptr->field2;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/19E80.c#L3-L17","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,4(a0)\n 4:\taddiu\ta3,a0,8\n 8:\tandi\ta1,a1,0xffff\n c:\tsll\ta1,a1,0x4\n 10:\tsll\tv1,v1,0x4\n 14:\taddu\tv1,a3,v1\n 18:\taddu\ta3,a3,a1\n 1c:\tlw\tv0,0(a3)\n 20:\taddu\ta0,a0,v0\n 24:\tsw\ta0,0(a2)\n 28:\tlhu\tv0,4(a3)\n 2c:\tsll\tv0,v0,0x5\n 30:\taddu\tv1,v1,v0\n 34:\tsw\tv1,4(a2)\n 38:\tlhu\tv0,6(a3)\n 3c:\tsh\tv0,8(a2)\n 40:\tlhu\tv0,8(a3)\n 44:\tjr\tra\n 48:\tsh\tv0,10(a2)\n 4c:\tnop\n","proto":{"getTableEntryByU16Index":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-38e285a16bb25525/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c getTableEntryByU16Index\n\n\nContents of section .text:\n 0000 8c830004 24870008 30a5ffff 00052900 ....$...0.....).\n 0010 00031900 00e31821 00e53821 8ce20000 .......!..8!....\n 0020 00822021 acc40000 94e20004 00021140 .. !...........@\n 0030 00621821 acc30004 94e20006 a4c20008 .b.!............\n 0040 94e20008 03e00008 a4c2000a 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"struct Struct0 { s32 field_0; u16 field_4; u16 field_6; u16 field_8; };\nstruct Struct1 { s32 field_0; s32 field_4; u16 field_8; u16 field_10; };\nvoid getTableEntryByU16Index(s32 * a0, u32 a1, struct Struct1 * a2) {\n s32 v0;\n v0 = a0[1];\n a2->field_0 = a0 + ((struct Struct0 *)(a0 + 2 + ((a1 & 65535) << 4)))->field_0;\n a2->field_4 = a0 + 2 + (v0 << 4) + (((struct Struct0 *)(a0 + 2 + ((a1 & 65535) << 4)))->field_4 << 5);\n a2->field_8 = ((struct Struct0 *)(a0 + 2 + ((a1 & 65535) << 4)))->field_6;\n a2->field_10 = ((struct Struct0 *)(a0 + 2 + ((a1 & 65535) << 4)))->field_8;\n return;\n}\n","score":25,"maxScore":28,"compileErrors":null,"breakdown":{"insert":9,"delete":8,"replace":0,"opMismatch":0,"argMismatch":8},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void getTableEntryByU16Index(void *arg0, s32 arg1, void *arg2) {\n void *temp_a3;\n void *temp_a3_2;\n\n temp_a3 = arg0 + 8;\n temp_a3_2 = temp_a3 + ((arg1 & 0xFFFF) * 0x10);\n arg2->unk0 = (void *) (arg0 + temp_a3_2->unk0);\n arg2->unk4 = (void *) (temp_a3 + (arg0->unk4 * 0x10) + (temp_a3_2->unk4 << 5));\n arg2->unk8 = (u16) temp_a3_2->unk6;\n arg2->unkA = (u16) temp_a3_2->unk8;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":96,"lines":10,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:1846: request for member `unk0' in something not a structure or union","/c.i:1847: request for member `unk4' in something not a structure or union","/c.i:1848: request for member `unk8' in something not a structure or union","/c.i:1848: request for member `unk6' in something not a structure or union","/c.i:1849: request for member `unkA' in something not a structure or union"]},"note":"src/19E80.c: table lookup, pointer/array arithmetic, no calls","gapSize":{"decompiler":"asmlift","score":25,"maxScore":28,"ratio":0.8928571428571429,"kinds":{"insert":9,"delete":8,"replace":0,"opMismatch":0,"argMismatch":8}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `getTableEntryByU16Index` — benchmark function snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel getTableEntryByU16Index\n lw\t$v1, 4($a0)\n addiu\t$a3, $a0, 8\n andi\t$a1, $a1, 0xffff\n sll\t$a1, $a1, 0x4\n sll\t$v1, $v1, 0x4\n addu\t$v1, $a3, $v1\n addu\t$a3, $a3, $a1\n lw\t$v0, 0($a3)\n addu\t$a0, $a0, $v0\n sw\t$a0, 0($a2)\n lhu\t$v0, 4($a3)\n sll\t$v0, $v0, 0x5\n addu\t$v1, $v1, $v0\n sw\t$v1, 4($a2)\n lhu\t$v0, 6($a3)\n sh\t$v0, 8($a2)\n lhu\t$v0, 8($a3)\n jr\t$ra\n sh\t$v0, 10($a2)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function getTableEntryByU16Index # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `getTableEntryByU16Index` — benchmark function snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,4(a0)\n 4:\taddiu\ta3,a0,8\n 8:\tandi\ta1,a1,0xffff\n c:\tsll\ta1,a1,0x4\n 10:\tsll\tv1,v1,0x4\n 14:\taddu\tv1,a3,v1\n 18:\taddu\ta3,a3,a1\n 1c:\tlw\tv0,0(a3)\n 20:\taddu\ta0,a0,v0\n 24:\tsw\ta0,0(a2)\n 28:\tlhu\tv0,4(a3)\n 2c:\tsll\tv0,v0,0x5\n 30:\taddu\tv1,v1,v0\n 34:\tsw\tv1,4(a2)\n 38:\tlhu\tv0,6(a3)\n 3c:\tsh\tv0,8(a2)\n 40:\tlhu\tv0,8(a3)\n 44:\tjr\tra\n 48:\tsh\tv0,10(a2)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-38e285a16bb25525/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c getTableEntryByU16Index\n\n\nContents of section .text:\n 0000 8c830004 24870008 30a5ffff 00052900 ....$...0.....).\n 0010 00031900 00e31821 00e53821 8ce20000 .......!..8!....\n 0020 00822021 acc40000 94e20004 00021140 .. !...........@\n 0030 00621821 acc30004 94e20006 a4c20008 .b.!............\n 0040 94e20008 03e00008 a4c2000a 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"getTableEntryByU16Index\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name getTableEntryByU16Index # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc","sym":"initSteppedMatrixController","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","call","memory","global"],"loc":7,"refSource":"void initSteppedMatrixController(SteppedMatrixState *state) {\n memcpy(&state->matrix, identityMatrix, 0x20);\n state->frameDelay = 0;\n state->stepIndex = 0;\n setCleanupCallback(cleanupSteppedMatrixController);\n setCallback(updateSteppedMatrixController);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/76B0.c#L30-L36","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\taddiu\ta0,s0,4\n 10:\tlui\ta1,0x0\n 14:\taddiu\ta1,a1,0\n 18:\tsw\tra,20(sp)\n 1c:\tjal\t0 \n 20:\tli\ta2,32\n 24:\tlui\ta0,0x0\n 28:\taddiu\ta0,a0,0\n 2c:\tsh\tzero,36(s0)\n 30:\tjal\t0 \n 34:\tsh\tzero,40(s0)\n 38:\tlui\ta0,0x0\n 3c:\tjal\t0 \n 40:\taddiu\ta0,a0,0\n 44:\tlw\tra,20(sp)\n 48:\tlw\ts0,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-1f4f9d8c2067.i.gz","proto":{"initSteppedMatrixController":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1f9fb46d4e427117/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 initSteppedMatrixController\n00000000 *UND*\t00000000 identityMatrix\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 cleanupSteppedMatrixController\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 updateSteppedMatrixController\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 identityMatrix\n00000014 R_MIPS_LO16 identityMatrix\n0000001c R_MIPS_26 memcpy\n00000024 R_MIPS_HI16 cleanupSteppedMatrixController\n00000028 R_MIPS_LO16 cleanupSteppedMatrixController\n00000030 R_MIPS_26 setCleanupCallback\n00000038 R_MIPS_HI16 updateSteppedMatrixController\n00000040 R_MIPS_LO16 updateSteppedMatrixController\n0000003c R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 26040004 '..........!&...\n 0010 3c050000 24a50000 afbf0014 0c000000 <...$...........\n 0020 24060020 3c040000 24840000 a6000024 $.. <...$......$\n 0030 0c000000 a6000028 3c040000 0c000000 .......(<.......\n 0040 24840000 8fbf0014 8fb00010 03e00008 $...............\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'initSteppedMatrixController' — lift: cannot lift 'initSteppedMatrixController': function call 'jal' at 0x1c — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\taddiu\ta0,s0,4 */\n/* 10:\tlui\ta1,0x0 */\n/* 14:\taddiu\ta1,a1,0 */\n/* 18:\tsw\tra,20(sp) */\n/* 1c:\tjal\t0 */\n/* 20:\tli\ta2,32 */\n/* 24:\tlui\ta0,0x0 */\n/* 28:\taddiu\ta0,a0,0 */\n/* 2c:\tsh\tzero,36(s0) */\n/* 30:\tjal\t0 */\n/* 34:\tsh\tzero,40(s0) */\n/* 38:\tlui\ta0,0x0 */\n/* 3c:\tjal\t0 */\n/* 40:\taddiu\ta0,a0,0 */\n/* 44:\tlw\tra,20(sp) */\n/* 48:\tlw\ts0,16(sp) */\n/* 4c:\tjr\tra */\n/* 50:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid initSteppedMatrixController(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'initSteppedMatrixController': function call 'jal' at 0x1c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":30,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'initSteppedMatrixController': function call 'jal' at 0x1c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void initSteppedMatrixController(SteppedMatrixState *state) {\n memcpy(&state->matrix, identityMatrix, 0x20U);\n state->frameDelay = 0;\n state->stepIndex = 0;\n setCleanupCallback(cleanupSteppedMatrixController);\n setCallback(updateSteppedMatrixController);\n}\n","score":0,"maxScore":21,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/76B0.c: copies identity matrix into task state, registers callbacks","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `initSteppedMatrixController` — benchmark function snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel initSteppedMatrixController\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n addiu\t$a0, $s0, 4\n lui\t$a1, %hi(identityMatrix)\n addiu\t$a1, $a1, %lo(identityMatrix)\n sw\t$ra, 20($sp)\n jal\tmemcpy\n li\t$a2, 32\n lui\t$a0, %hi(cleanupSteppedMatrixController)\n addiu\t$a0, $a0, %lo(cleanupSteppedMatrixController)\n sh\t$zero, 36($s0)\n jal\tsetCleanupCallback\n sh\t$zero, 40($s0)\n lui\t$a0, %hi(updateSteppedMatrixController)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(updateSteppedMatrixController)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-1f4f9d8c2067.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid initSteppedMatrixController(SteppedMatrixState *state);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function initSteppedMatrixController # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `initSteppedMatrixController` — benchmark function snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\taddiu\ta0,s0,4\n 10:\tlui\ta1,0x0\n 14:\taddiu\ta1,a1,0\n 18:\tsw\tra,20(sp)\n 1c:\tjal\t0 \n 20:\tli\ta2,32\n 24:\tlui\ta0,0x0\n 28:\taddiu\ta0,a0,0\n 2c:\tsh\tzero,36(s0)\n 30:\tjal\t0 \n 34:\tsh\tzero,40(s0)\n 38:\tlui\ta0,0x0\n 3c:\tjal\t0 \n 40:\taddiu\ta0,a0,0\n 44:\tlw\tra,20(sp)\n 48:\tlw\ts0,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1f9fb46d4e427117/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 initSteppedMatrixController\n00000000 *UND*\t00000000 identityMatrix\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 cleanupSteppedMatrixController\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 updateSteppedMatrixController\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 identityMatrix\n00000014 R_MIPS_LO16 identityMatrix\n0000001c R_MIPS_26 memcpy\n00000024 R_MIPS_HI16 cleanupSteppedMatrixController\n00000028 R_MIPS_LO16 cleanupSteppedMatrixController\n00000030 R_MIPS_26 setCleanupCallback\n00000038 R_MIPS_HI16 updateSteppedMatrixController\n00000040 R_MIPS_LO16 updateSteppedMatrixController\n0000003c R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 26040004 '..........!&...\n 0010 3c050000 24a50000 afbf0014 0c000000 <...$...........\n 0020 24060020 3c040000 24840000 a6000024 $.. <...$......$\n 0030 0c000000 a6000028 3c040000 0c000000 .......(<.......\n 0040 24840000 8fbf0014 8fb00010 03e00008 $...............\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"initSteppedMatrixController\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name initSteppedMatrixController # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc","sym":"loadAssetGroupResources","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","struct","array","call","cast"],"loc":22,"refSource":"void loadAssetGroupResources(AssetGroupTaskData *taskData) {\n AssetGroupTableEntry *entry;\n AssetEntry *assetList;\n s32 i;\n\n entry = &assetGroupTable[taskData->groupIndex];\n assetList = entry->assetList;\n\n setCleanupCallback(freeAssetGroupResources);\n i = 0;\n\n taskData->unk10 = NULL;\n taskData->unkC = NULL;\n\n taskData->loadedAssets = allocateNodeMemory(entry->assetCount * 4);\n\n for (i = 0; i < entry->assetCount; i++) {\n taskData->loadedAssets[i] = loadCompressedData(assetList[i].unk0, assetList[i].unk4, assetList[i].unk8);\n }\n\n setCallback(func_80003184_3D84);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/3B80.c#L80-L101","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-48\n 4:\tsw\ts3,36(sp)\n 8:\tmove\ts3,a0\n c:\tsw\tra,40(sp)\n 10:\tsw\ts2,32(sp)\n 14:\tsw\ts1,28(sp)\n 18:\tsw\ts0,24(sp)\n 1c:\tlbu\tv1,196(s3)\n 20:\tsll\tv0,v1,0x1\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\ts2,v0,v1\n 38:\tlw\ts0,0(s2)\n 3c:\tlui\ta0,0x0\n 40:\taddiu\ta0,a0,0\n 44:\tjal\t0 \n 48:\tmove\ts1,zero\n 4c:\tsw\tzero,16(s3)\n 50:\tsw\tzero,12(s3)\n 54:\tlbu\ta0,8(s2)\n 58:\tjal\t0 \n 5c:\tsll\ta0,a0,0x2\n 60:\tsw\tv0,4(s3)\n 64:\tlbu\tv0,8(s2)\n 68:\tblez\tv0,a8 \n 6c:\tnop\n 70:\tlw\ta0,0(s0)\n 74:\tlw\ta1,4(s0)\n 78:\tlw\ta2,8(s0)\n 7c:\tjal\t0 \n 80:\taddiu\ts0,s0,12\n 84:\tlw\tv1,4(s3)\n 88:\tsll\ta0,s1,0x2\n 8c:\taddu\ta0,a0,v1\n 90:\tsw\tv0,0(a0)\n 94:\tlbu\tv0,8(s2)\n 98:\taddiu\ts1,s1,1\n 9c:\tslt\tv0,s1,v0\n a0:\tbnez\tv0,70 \n a4:\tnop\n a8:\tlui\ta0,0x0\n ac:\tjal\t0 \n b0:\taddiu\ta0,a0,0\n b4:\tlw\tra,40(sp)\n b8:\tlw\ts3,36(sp)\n bc:\tlw\ts2,32(sp)\n c0:\tlw\ts1,28(sp)\n c4:\tlw\ts0,24(sp)\n c8:\tjr\tra\n cc:\taddiu\tsp,sp,48\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-96e61b4ff9f1.i.gz","proto":{"loadAssetGroupResources":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ea902f2bbc2f0c1a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000d0 loadAssetGroupResources\n00000000 *UND*\t00000000 assetGroupTable\n00000000 *UND*\t00000000 freeAssetGroupResources\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 allocateNodeMemory\n00000000 *UND*\t00000000 loadCompressedData\n00000000 *UND*\t00000000 func_80003184_3D84\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 assetGroupTable\n00000030 R_MIPS_LO16 assetGroupTable\n0000003c R_MIPS_HI16 freeAssetGroupResources\n00000040 R_MIPS_LO16 freeAssetGroupResources\n00000044 R_MIPS_26 setCleanupCallback\n00000058 R_MIPS_26 allocateNodeMemory\n0000007c R_MIPS_26 loadCompressedData\n000000a8 R_MIPS_HI16 func_80003184_3D84\n000000b0 R_MIPS_LO16 func_80003184_3D84\n000000ac R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffd0 afb30024 00809821 afbf0028 '......$...!...(\n 0010 afb20020 afb1001c afb00018 926300c4 ... .........c..\n 0020 00031040 00431021 00021080 3c030000 ...@.C.!....<...\n 0030 24630000 00439021 8e500000 3c040000 $c...C.!.P..<...\n 0040 24840000 0c000000 00008821 ae600010 $..........!.`..\n 0050 ae60000c 92440008 0c000000 00042080 .`...D........ .\n 0060 ae620004 92420008 1840000f 00000000 .b...B...@......\n 0070 8e040000 8e050004 8e060008 0c000000 ................\n 0080 2610000c 8e630004 00112080 00832021 &....c.... ... !\n 0090 ac820000 92420008 26310001 0222102a .....B..&1...\".*\n 00a0 1440fff3 00000000 3c040000 0c000000 .@......<.......\n 00b0 24840000 8fbf0028 8fb30024 8fb20020 $......(...$... \n 00c0 8fb1001c 8fb00018 03e00008 27bd0030 ............'..0\nContents of section .reginfo:\n 0000 a00f007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'loadAssetGroupResources' — lift: cannot lift 'loadAssetGroupResources': function call 'jal' at 0x44 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-48 */\n/* 4:\tsw\ts3,36(sp) */\n/* 8:\tmove\ts3,a0 */\n/* c:\tsw\tra,40(sp) */\n/* 10:\tsw\ts2,32(sp) */\n/* 14:\tsw\ts1,28(sp) */\n/* 18:\tsw\ts0,24(sp) */\n/* 1c:\tlbu\tv1,196(s3) */\n/* 20:\tsll\tv0,v1,0x1 */\n/* 24:\taddu\tv0,v0,v1 */\n/* 28:\tsll\tv0,v0,0x2 */\n/* 2c:\tlui\tv1,0x0 */\n/* 30:\taddiu\tv1,v1,0 */\n/* 34:\taddu\ts2,v0,v1 */\n/* 38:\tlw\ts0,0(s2) */\n/* 3c:\tlui\ta0,0x0 */\n/* 40:\taddiu\ta0,a0,0 */\n/* 44:\tjal\t0 */\n/* 48:\tmove\ts1,zero */\n/* 4c:\tsw\tzero,16(s3) */\n/* 50:\tsw\tzero,12(s3) */\n/* 54:\tlbu\ta0,8(s2) */\n/* 58:\tjal\t0 */\n/* 5c:\tsll\ta0,a0,0x2 */\n/* 60:\tsw\tv0,4(s3) */\n/* 64:\tlbu\tv0,8(s2) */\n/* 68:\tblez\tv0,a8 */\n/* 6c:\tnop */\n/* 70:\tlw\ta0,0(s0) */\n/* 74:\tlw\ta1,4(s0) */\n/* 78:\tlw\ta2,8(s0) */\n/* 7c:\tjal\t0 */\n/* 80:\taddiu\ts0,s0,12 */\n/* 84:\tlw\tv1,4(s3) */\n/* 88:\tsll\ta0,s1,0x2 */\n/* 8c:\taddu\ta0,a0,v1 */\n/* 90:\tsw\tv0,0(a0) */\n/* 94:\tlbu\tv0,8(s2) */\n/* 98:\taddiu\ts1,s1,1 */\n/* 9c:\tslt\tv0,s1,v0 */\n/* a0:\tbnez\tv0,70 */\n/* a4:\tnop */\n/* a8:\tlui\ta0,0x0 */\n/* ac:\tjal\t0 */\n/* b0:\taddiu\ta0,a0,0 */\n/* b4:\tlw\tra,40(sp) */\n/* b8:\tlw\ts3,36(sp) */\n/* bc:\tlw\ts2,32(sp) */\n/* c0:\tlw\ts1,28(sp) */\n/* c4:\tlw\ts0,24(sp) */\n/* c8:\tjr\tra */\n/* cc:\taddiu\tsp,sp,48 */\nvoid loadAssetGroupResources(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'loadAssetGroupResources': function call 'jal' at 0x44 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":60,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'loadAssetGroupResources': function call 'jal' at 0x44 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void loadAssetGroupResources(AssetGroupTaskData *taskData) {\n AssetEntry *var_s0;\n AssetGroupTableEntry *temp_s2;\n s32 temp_a2;\n s32 var_s1;\n void *temp_a0;\n void *temp_a1;\n\n temp_s2 = &assetGroupTable[taskData->groupIndex];\n var_s0 = temp_s2->assetList;\n var_s1 = 0;\n setCleanupCallback(freeAssetGroupResources);\n taskData->unk10 = NULL;\n taskData->unkC = NULL;\n taskData->loadedAssets = allocateNodeMemory(temp_s2->assetCount * 4);\n if ((s32) temp_s2->assetCount > 0) {\n do {\n temp_a0 = var_s0->unk0;\n temp_a1 = var_s0->unk4;\n temp_a2 = var_s0->unk8;\n var_s0 += 0xC;\n taskData->loadedAssets[var_s1] = loadCompressedData(temp_a0, temp_a1, temp_a2);\n var_s1 += 1;\n } while (var_s1 < (s32) temp_s2->assetCount);\n }\n setCallback(func_80003184_3D84);\n}\n","score":30,"maxScore":55,"compileErrors":null,"breakdown":{"insert":3,"delete":0,"replace":2,"opMismatch":0,"argMismatch":25},"quality":{"score":100,"lines":26,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/3B80.c: loads each compressed asset in a group into a freshly allocated pointer array","gapSize":{"decompiler":"m2c","score":30,"maxScore":55,"ratio":0.5454545454545454,"kinds":{"insert":3,"delete":0,"replace":2,"opMismatch":0,"argMismatch":25}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loadAssetGroupResources` — benchmark function snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loadAssetGroupResources\n addiu\t$sp, $sp, -48\n sw\t$s3, 36($sp)\n move\t$s3, $a0\n sw\t$ra, 40($sp)\n sw\t$s2, 32($sp)\n sw\t$s1, 28($sp)\n sw\t$s0, 24($sp)\n lbu\t$v1, 196($s3)\n sll\t$v0, $v1, 0x1\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(assetGroupTable)\n addiu\t$v1, $v1, %lo(assetGroupTable)\n addu\t$s2, $v0, $v1\n lw\t$s0, 0($s2)\n lui\t$a0, %hi(freeAssetGroupResources)\n addiu\t$a0, $a0, %lo(freeAssetGroupResources)\n jal\tsetCleanupCallback\n move\t$s1, $zero\n sw\t$zero, 16($s3)\n sw\t$zero, 12($s3)\n lbu\t$a0, 8($s2)\n jal\tallocateNodeMemory\n sll\t$a0, $a0, 0x2\n sw\t$v0, 4($s3)\n lbu\t$v0, 8($s2)\n blez\t$v0, .La8\n nop\n.L70:\n lw\t$a0, 0($s0)\n lw\t$a1, 4($s0)\n lw\t$a2, 8($s0)\n jal\tloadCompressedData\n addiu\t$s0, $s0, 12\n lw\t$v1, 4($s3)\n sll\t$a0, $s1, 0x2\n addu\t$a0, $a0, $v1\n sw\t$v0, 0($a0)\n lbu\t$v0, 8($s2)\n addiu\t$s1, $s1, 1\n slt\t$v0, $s1, $v0\n bnez\t$v0, .L70\n nop\n.La8:\n lui\t$a0, %hi(func_80003184_3D84)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80003184_3D84)\n lw\t$ra, 40($sp)\n lw\t$s3, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 48\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-96e61b4ff9f1.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid loadAssetGroupResources(AssetGroupTaskData *taskData);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loadAssetGroupResources # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loadAssetGroupResources` — benchmark function snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: fa4857d091be1016a2f3aadaa8194898a24a97d406983798355f7df87d978a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-48\n 4:\tsw\ts3,36(sp)\n 8:\tmove\ts3,a0\n c:\tsw\tra,40(sp)\n 10:\tsw\ts2,32(sp)\n 14:\tsw\ts1,28(sp)\n 18:\tsw\ts0,24(sp)\n 1c:\tlbu\tv1,196(s3)\n 20:\tsll\tv0,v1,0x1\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\ts2,v0,v1\n 38:\tlw\ts0,0(s2)\n 3c:\tlui\ta0,0x0\n 40:\taddiu\ta0,a0,0\n 44:\tjal\t0 \n 48:\tmove\ts1,zero\n 4c:\tsw\tzero,16(s3)\n 50:\tsw\tzero,12(s3)\n 54:\tlbu\ta0,8(s2)\n 58:\tjal\t0 \n 5c:\tsll\ta0,a0,0x2\n 60:\tsw\tv0,4(s3)\n 64:\tlbu\tv0,8(s2)\n 68:\tblez\tv0,a8 \n 6c:\tnop\n 70:\tlw\ta0,0(s0)\n 74:\tlw\ta1,4(s0)\n 78:\tlw\ta2,8(s0)\n 7c:\tjal\t0 \n 80:\taddiu\ts0,s0,12\n 84:\tlw\tv1,4(s3)\n 88:\tsll\ta0,s1,0x2\n 8c:\taddu\ta0,a0,v1\n 90:\tsw\tv0,0(a0)\n 94:\tlbu\tv0,8(s2)\n 98:\taddiu\ts1,s1,1\n 9c:\tslt\tv0,s1,v0\n a0:\tbnez\tv0,70 \n a4:\tnop\n a8:\tlui\ta0,0x0\n ac:\tjal\t0 \n b0:\taddiu\ta0,a0,0\n b4:\tlw\tra,40(sp)\n b8:\tlw\ts3,36(sp)\n bc:\tlw\ts2,32(sp)\n c0:\tlw\ts1,28(sp)\n c4:\tlw\ts0,24(sp)\n c8:\tjr\tra\n cc:\taddiu\tsp,sp,48\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ea902f2bbc2f0c1a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000d0 loadAssetGroupResources\n00000000 *UND*\t00000000 assetGroupTable\n00000000 *UND*\t00000000 freeAssetGroupResources\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 allocateNodeMemory\n00000000 *UND*\t00000000 loadCompressedData\n00000000 *UND*\t00000000 func_80003184_3D84\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 assetGroupTable\n00000030 R_MIPS_LO16 assetGroupTable\n0000003c R_MIPS_HI16 freeAssetGroupResources\n00000040 R_MIPS_LO16 freeAssetGroupResources\n00000044 R_MIPS_26 setCleanupCallback\n00000058 R_MIPS_26 allocateNodeMemory\n0000007c R_MIPS_26 loadCompressedData\n000000a8 R_MIPS_HI16 func_80003184_3D84\n000000b0 R_MIPS_LO16 func_80003184_3D84\n000000ac R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffd0 afb30024 00809821 afbf0028 '......$...!...(\n 0010 afb20020 afb1001c afb00018 926300c4 ... .........c..\n 0020 00031040 00431021 00021080 3c030000 ...@.C.!....<...\n 0030 24630000 00439021 8e500000 3c040000 $c...C.!.P..<...\n 0040 24840000 0c000000 00008821 ae600010 $..........!.`..\n 0050 ae60000c 92440008 0c000000 00042080 .`...D........ .\n 0060 ae620004 92420008 1840000f 00000000 .b...B...@......\n 0070 8e040000 8e050004 8e060008 0c000000 ................\n 0080 2610000c 8e630004 00112080 00832021 &....c.... ... !\n 0090 ac820000 92420008 26310001 0222102a .....B..&1...\".*\n 00a0 1440fff3 00000000 3c040000 0c000000 .@......<.......\n 00b0 24840000 8fbf0028 8fb30024 8fb20020 $......(...$... \n 00c0 8fb1001c 8fb00018 03e00008 27bd0030 ............'..0\nContents of section .reginfo:\n 0000 a00f007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"loadAssetGroupResources\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name loadAssetGroupResources # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absdiff:agbcc","sym":"absdiff","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absdiff(int a,int b){ return a>b?a-b:b-a; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tabsdiff\n\t.type\t absdiff,function\n\t.thumb_func\nabsdiff:\n\tsub\tr2, r1, r0\n\tcmp\tr0, r1\n\tble\t.L3\t@cond_branch\n\tsub\tr2, r0, r1\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t absdiff,.Lfe1-absdiff\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 absdiff(u32 a0, u32 a1) {\n s32 v0;\n if (a0 <= a1) {\n v0 = a1 - a0;\n } else {\n v0 = a0 - a1;\n }\n return v0;\n}\n","score":3,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 absdiff(s32 arg0, s32 arg1) {\n s32 var_r2;\n\n var_r2 = arg1 - arg0;\n if (arg0 > arg1) {\n var_r2 = arg0 - arg1;\n }\n return var_r2;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absdiff` — benchmark function synthetic:absdiff:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tabsdiff\n\t.type\t absdiff,function\n\t.thumb_func\nabsdiff:\n\tsub\tr2, r1, r0\n\tcmp\tr0, r1\n\tble\t.L3\t@cond_branch\n\tsub\tr2, r0, r1\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t absdiff,.Lfe1-absdiff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absdiff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absdiff` — benchmark function synthetic:absdiff:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absdiff:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tabsdiff\n\t.type\t absdiff,function\n\t.thumb_func\nabsdiff:\n\tsub\tr2, r1, r0\n\tcmp\tr0, r1\n\tble\t.L3\t@cond_branch\n\tsub\tr2, r0, r1\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t absdiff,.Lfe1-absdiff\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name absdiff # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absdiff:gcc2.7.2kmc","sym":"absdiff","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absdiff(int a,int b){ return a>b?a-b:b-a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a1,a0\n 4:\tbnez\tv0,10 \n 8:\tsubu\tv0,a0,a1\n c:\tsubu\tv0,a1,a0\n 10:\tjr\tra\n 14:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-463517d84d0cef9e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 absdiff\n\n\nContents of section .text:\n 0000 00a4102a 14400002 00851023 00a41023 ...*.@.....#...#\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 absdiff(s32 a0, s32 a1) {\n s32 v0;\n if (a1 < a0) {\n v0 = a0 - a1;\n } else {\n v0 = a1 - a0;\n }\n return v0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 absdiff(s32 arg0, s32 arg1) {\n s32 var_v0;\n\n var_v0 = arg0 - arg1;\n if (arg1 >= arg0) {\n var_v0 = arg1 - arg0;\n }\n return var_v0;\n}\n","score":3,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absdiff` — benchmark function synthetic:absdiff:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel absdiff\n slt\t$v0, $a1, $a0\n bnez\t$v0, .L10\n subu\t$v0, $a0, $a1\n subu\t$v0, $a1, $a0\n.L10:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absdiff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absdiff` — benchmark function synthetic:absdiff:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absdiff:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a1,a0\n 4:\tbnez\tv0,10 \n 8:\tsubu\tv0,a0,a1\n c:\tsubu\tv0,a1,a0\n 10:\tjr\tra\n 14:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-463517d84d0cef9e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 absdiff\n\n\nContents of section .text:\n 0000 00a4102a 14400002 00851023 00a41023 ...*.@.....#...#\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name absdiff # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absdiff:ido7.1","sym":"absdiff","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absdiff(int a,int b){ return a>b?a-b:b-a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a1,a0\n 4:\tbeqz\tat,14 \n 8:\tsubu\tv1,a1,a0\n c:\tjr\tra\n 10:\tsubu\tv0,a0,a1\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c absdiff\n\n\nContents of section .text:\n 0000 00a4082a 10200003 00a41823 03e00008 ...*. .....#....\n 0010 00851023 03e00008 00601025 00000000 ...#.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000003e 00000000 . .........>....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003e 00000000 00000000 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 36333531 37643834 64306365 ef-463517d84d0ce\n 0130 6639652f 7265662e 63006162 73646966 f9e/ref.c.absdif\n 0140 66000000 61627364 69666600 00000000 f...absdiff.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000007 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 absdiff(s32 a0, s32 a1) {\n if (a1 < a0) {\n return a0 - a1;\n } else {\n return a1 - a0;\n }\n}\n","score":2,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 absdiff(s32 arg0, s32 arg1) {\n if (arg1 < arg0) {\n return arg0 - arg1;\n }\n return arg1 - arg0;\n}\n","score":2,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":7,"ratio":0.2857142857142857,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absdiff` — benchmark function synthetic:absdiff:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel absdiff\n slt\t$at, $a1, $a0\n beqz\t$at, .L14\n subu\t$v1, $a1, $a0\n jr\t$ra\n subu\t$v0, $a0, $a1\n.L14:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absdiff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absdiff` — benchmark function synthetic:absdiff:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absdiff:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a1,a0\n 4:\tbeqz\tat,14 \n 8:\tsubu\tv1,a1,a0\n c:\tjr\tra\n 10:\tsubu\tv0,a0,a1\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c absdiff\n\n\nContents of section .text:\n 0000 00a4082a 10200003 00a41823 03e00008 ...*. .....#....\n 0010 00851023 03e00008 00601025 00000000 ...#.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000003e 00000000 . .........>....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003e 00000000 00000000 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 36333531 37643834 64306365 ef-463517d84d0ce\n 0130 6639652f 7265662e 63006162 73646966 f9e/ref.c.absdif\n 0140 66000000 61627364 69666600 00000000 f...absdiff.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000007 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name absdiff # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absdiff:mwcc_242_81","sym":"absdiff","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absdiff(int a,int b){ return a>b?a-b:b-a; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tsubf r0,r3,r4\n 8:\tble 10 \n c:\tsubf r0,r4,r3\n 10:\tmr r3,r0\n 14:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 absdiff\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 absdiff\n\n\nContents of section .text:\n 0000 7c032000 7c032050 40810008 7c041850 |. .|. P@...|..P\n 0010 7c030378 4e800020 |..xN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 absdiff(s32 a0, s32 a1) {\n s32 v0;\n if (a0 <= a1) {\n v0 = a1 - a0;\n } else {\n v0 = a0 - a1;\n }\n return v0;\n}\n","score":3,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 absdiff(s32 arg0, s32 arg1) {\n s32 var_r0;\n\n var_r0 = arg1 - arg0;\n if (arg0 > arg1) {\n var_r0 = arg0 - arg1;\n }\n return var_r0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absdiff` — benchmark function synthetic:absdiff:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel absdiff\n cmpw r3,r4\n subf r0,r3,r4\n ble .L10\n subf r0,r4,r3\n.L10:\n mr r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absdiff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absdiff` — benchmark function synthetic:absdiff:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absdiff:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tsubf r0,r3,r4\n 8:\tble 10 \n c:\tsubf r0,r4,r3\n 10:\tmr r3,r0\n 14:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 absdiff\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 absdiff\n\n\nContents of section .text:\n 0000 7c032000 7c032050 40810008 7c041850 |. .|. P@...|..P\n 0010 7c030378 4e800020 |..xN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name absdiff # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absi:agbcc","sym":"absi","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absi(int x){ return x<0?-x:x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tabsi\n\t.type\t absi,function\n\t.thumb_func\nabsi:\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr0, r0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t absi,.Lfe1-absi\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 absi(s32 a0) {\n if (a0 < 0) a0 = -a0;\n return a0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 absi(s32 arg0) {\n s32 var_r0;\n\n var_r0 = arg0;\n if (var_r0 < 0) {\n var_r0 = 0 - var_r0;\n }\n return var_r0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absi` — benchmark function synthetic:absi:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tabsi\n\t.type\t absi,function\n\t.thumb_func\nabsi:\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr0, r0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t absi,.Lfe1-absi\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absi` — benchmark function synthetic:absi:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absi:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tabsi\n\t.type\t absi,function\n\t.thumb_func\nabsi:\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr0, r0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t absi,.Lfe1-absi\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name absi # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absi:gcc2.7.2kmc","sym":"absi","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absi(int x){ return x<0?-x:x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,a0\n 4:\tbltzl\tv0,c \n 8:\tnegu\tv0,v0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d5a2469bd227d9c3/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 absi\n\n\nContents of section .text:\n 0000 00801021 04420001 00021023 03e00008 ...!.B.....#....\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'absi' — lift: cannot lift 'absi': unmodelled control transfer 'bltzl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv0,a0 */\n/* 4:\tbltzl\tv0,c */\n/* 8:\tnegu\tv0,v0 */\n/* c:\tjr\tra */\n/* 10:\tnop */\n/* \t... */\nvoid absi(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'absi': unmodelled control transfer 'bltzl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":14,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'absi': unmodelled control transfer 'bltzl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 absi(s32 arg0) {\n s32 var_v0;\n\n var_v0 = arg0;\n if (var_v0 < 0) {\n var_v0 = -var_v0;\n }\n return var_v0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absi` — benchmark function synthetic:absi:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel absi\n move\t$v0, $a0\n bltzl\t$v0, .Lc\n negu\t$v0, $v0\n.Lc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absi` — benchmark function synthetic:absi:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absi:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,a0\n 4:\tbltzl\tv0,c \n 8:\tnegu\tv0,v0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d5a2469bd227d9c3/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 absi\n\n\nContents of section .text:\n 0000 00801021 04420001 00021023 03e00008 ...!.B.....#....\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name absi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absi:ido7.1","sym":"absi","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absi(int x){ return x<0?-x:x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tmove\tv1,a0\n 8:\tjr\tra\n c:\tnegu\tv0,a0\n 10:\tjr\tra\n 14:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 absi\n\n\nContents of section .text:\n 0000 04810003 00801825 03e00008 00041023 .......%.......#\n 0010 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 35613234 36396264 32323764 ef-d5a2469bd227d\n 0130 3963332f 7265662e 63006162 73690000 9c3/ref.c.absi..\n 0140 61627369 00000000 00000000 00000001 absi............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 absi(s32 a0) {\n if (a0 < 0) {\n return -a0;\n } else {\n return a0;\n }\n}\n","score":2,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 absi(s32 arg0) {\n if (arg0 < 0) {\n return -arg0;\n }\n return arg0;\n}\n","score":2,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":6,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absi` — benchmark function synthetic:absi:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel absi\n bgez\t$a0, .L10\n move\t$v1, $a0\n jr\t$ra\n negu\t$v0, $a0\n.L10:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absi` — benchmark function synthetic:absi:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absi:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tmove\tv1,a0\n 8:\tjr\tra\n c:\tnegu\tv0,a0\n 10:\tjr\tra\n 14:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 absi\n\n\nContents of section .text:\n 0000 04810003 00801825 03e00008 00041023 .......%.......#\n 0010 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 35613234 36396264 32323764 ef-d5a2469bd227d\n 0130 3963332f 7265662e 63006162 73690000 9c3/ref.c.absi..\n 0140 61627369 00000000 00000000 00000001 absi............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name absi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absi:mwcc_242_81","sym":"absi","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absi(int x){ return x<0?-x:x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrawi r4,r3,31\n 4:\txor r0,r4,r3\n 8:\tsubf r3,r4,r0\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 absi\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 absi\n\n\nContents of section .text:\n 0000 7c64fe70 7c801a78 7c640050 4e800020 |d.p|..x|d.PN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 absi(s32 a0) {\n return (a0 >> 31 ^ a0) - (a0 >> 31);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 absi(s32 arg0) {\n s32 temp_r4;\n\n temp_r4 = arg0 >> 0x1F;\n return (temp_r4 ^ arg0) - temp_r4;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absi` — benchmark function synthetic:absi:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel absi\n srawi r4,r3,31\n xor r0,r4,r3\n subf r3,r4,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absi` — benchmark function synthetic:absi:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absi:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrawi r4,r3,31\n 4:\txor r0,r4,r3\n 8:\tsubf r3,r4,r0\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 absi\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 absi\n\n\nContents of section .text:\n 0000 7c64fe70 7c801a78 7c640050 4e800020 |d.p|..x|d.PN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name absi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:add:agbcc","sym":"add","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int add(int a,int b){ return a+b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tadd\n\t.type\t add,function\n\t.thumb_func\nadd:\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t add,.Lfe1-add\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 add(u32 a0, u32 a1) {\n return a0 + a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 add(s32 arg0, s32 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add` — benchmark function synthetic:add:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tadd\n\t.type\t add,function\n\t.thumb_func\nadd:\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t add,.Lfe1-add\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add` — benchmark function synthetic:add:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:add:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tadd\n\t.type\t add,function\n\t.thumb_func\nadd:\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t add,.Lfe1-add\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name add # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:add:gcc2.7.2kmc","sym":"add","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int add(int a,int b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddu\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-133ae1fb7cf38ace/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 add\n\n\nContents of section .text:\n 0000 03e00008 00851021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 add(u32 a0, u32 a1) {\n return a0 + a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 add(s32 arg0, s32 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add` — benchmark function synthetic:add:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add\n jr\t$ra\n addu\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add` — benchmark function synthetic:add:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:add:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddu\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-133ae1fb7cf38ace/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 add\n\n\nContents of section .text:\n 0000 03e00008 00851021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name add # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:add:ido7.1","sym":"add","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic"],"loc":1,"refSource":"int add(int a,int b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddu\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 add\n\n\nContents of section .text:\n 0000 03e00008 00851021 00000000 00000000 .......!........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 33336165 31666237 63663338 ef-133ae1fb7cf38\n 0130 6163652f 7265662e 63006164 64000000 ace/ref.c.add...\n 0140 61646400 00000000 00000001 00000000 add.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 add(u32 a0, u32 a1) {\n return a0 + a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 add(s32 arg0, s32 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add` — benchmark function synthetic:add:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add\n jr\t$ra\n addu\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add` — benchmark function synthetic:add:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:add:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddu\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 add\n\n\nContents of section .text:\n 0000 03e00008 00851021 00000000 00000000 .......!........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 33336165 31666237 63663338 ef-133ae1fb7cf38\n 0130 6163652f 7265662e 63006164 64000000 ace/ref.c.add...\n 0140 61646400 00000000 00000001 00000000 add.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:add:mwcc_242_81","sym":"add","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int add(int a,int b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tadd r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 add\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 add\n\n\nContents of section .text:\n 0000 7c632214 4e800020 |c\".N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 add(u32 a0, u32 a1) {\n return a0 + a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 add(s32 arg0, s32 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add` — benchmark function synthetic:add:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add\n add r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add` — benchmark function synthetic:add:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:add:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tadd r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 add\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 add\n\n\nContents of section .text:\n 0000 7c632214 4e800020 |c\".N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:addu8:agbcc","sym":"addu8","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"u8 addu8(u8 a,u8 b){ return a+b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\taddu8\n\t.type\t addu8,function\n\t.thumb_func\naddu8:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t addu8,.Lfe1-addu8\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 addu8(u32 a0, u32 a1) {\n return (u8)((u8)a0 + (u8)a1);\n}\n","score":4,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":98,"lines":3,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u8 addu8(u8 arg0, u8 arg1) {\n return (u8) (arg0 + arg1);\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `addu8` — benchmark function synthetic:addu8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\taddu8\n\t.type\t addu8,function\n\t.thumb_func\naddu8:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t addu8,.Lfe1-addu8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function addu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `addu8` — benchmark function synthetic:addu8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:addu8:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\taddu8\n\t.type\t addu8,function\n\t.thumb_func\naddu8:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t addu8,.Lfe1-addu8\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name addu8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:addu8:gcc2.7.2kmc","sym":"addu8","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"u8 addu8(u8 a,u8 b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0xff\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-58d9a3ec3194e30b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c addu8\n\n\nContents of section .text:\n 0000 00851021 03e00008 304200ff 00000000 ...!....0B......\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 addu8(u32 a0, u32 a1) {\n return a0 + a1 & 255;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 addu8(s32 arg0, s32 arg1) {\n return (arg0 + arg1) & 0xFF;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `addu8` — benchmark function synthetic:addu8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel addu8\n addu\t$v0, $a0, $a1\n jr\t$ra\n andi\t$v0, $v0, 0xff\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function addu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `addu8` — benchmark function synthetic:addu8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:addu8:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0xff\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-58d9a3ec3194e30b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c addu8\n\n\nContents of section .text:\n 0000 00851021 03e00008 304200ff 00000000 ...!....0B......\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name addu8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:addu8:ido7.1","sym":"addu8","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"u8 addu8(u8 a,u8 b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tandi\tv0,v0,0xff\n 8:\tsw\ta0,0(sp)\n c:\tjr\tra\n 10:\tsw\ta1,4(sp)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 addu8\n\n\nContents of section .text:\n 0000 00851021 304200ff afa40000 03e00008 ...!0B..........\n 0010 afa50004 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 38643961 33656333 31393465 ef-58d9a3ec3194e\n 0130 3330622f 7265662e 63006164 64753800 30b/ref.c.addu8.\n 0140 61646475 38000000 00000000 00000001 addu8...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 addu8(u32 a0, u32 a1) {\n return a0 + a1 & 255;\n}\n","score":4,"maxScore":6,"compileErrors":null,"breakdown":{"insert":1,"delete":3,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 addu8(s32 arg0, s32 arg1) {\n return (arg0 + arg1) & 0xFF;\n}\n","score":4,"maxScore":6,"compileErrors":null,"breakdown":{"insert":1,"delete":3,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":4,"maxScore":6,"ratio":0.6666666666666666,"kinds":{"insert":1,"delete":3,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `addu8` — benchmark function synthetic:addu8:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel addu8\n addu\t$v0, $a0, $a1\n andi\t$v0, $v0, 0xff\n sw\t$a0, 0($sp)\n jr\t$ra\n sw\t$a1, 4($sp)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function addu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `addu8` — benchmark function synthetic:addu8:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:addu8:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tandi\tv0,v0,0xff\n 8:\tsw\ta0,0(sp)\n c:\tjr\tra\n 10:\tsw\ta1,4(sp)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 addu8\n\n\nContents of section .text:\n 0000 00851021 304200ff afa40000 03e00008 ...!0B..........\n 0010 afa50004 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 38643961 33656333 31393465 ef-58d9a3ec3194e\n 0130 3330622f 7265662e 63006164 64753800 30b/ref.c.addu8.\n 0140 61646475 38000000 00000000 00000001 addu8...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name addu8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:addu8:mwcc_242_81","sym":"addu8","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"u8 addu8(u8 a,u8 b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tadd r0,r3,r4\n 4:\tclrlwi r3,r0,24\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c addu8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 addu8\n\n\nContents of section .text:\n 0000 7c032214 5403063e 4e800020 |.\".T..>N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 addu8(u32 a0, u32 a1) {\n return a0 + a1 & 255;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u8 addu8(s32 arg0, s32 arg1) {\n return (u8) (arg0 + arg1);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `addu8` — benchmark function synthetic:addu8:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel addu8\n add r0,r3,r4\n clrlwi r3,r0,24\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function addu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `addu8` — benchmark function synthetic:addu8:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:addu8:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tadd r0,r3,r4\n 4:\tclrlwi r3,r0,24\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c addu8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 addu8\n\n\nContents of section .text:\n 0000 7c032214 5403063e 4e800020 |.\".T..>N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name addu8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:aidx:agbcc","sym":"aidx","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","array","variable-index"],"loc":1,"refSource":"int aidx(int *p,int i){ return p[i]; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\taidx\n\t.type\t aidx,function\n\t.thumb_func\naidx:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t aidx,.Lfe1-aidx\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 aidx(s32 * a0, u32 a1) {\n return a0[a1];\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 aidx(s32 arg0, s32 arg1) {\n return *((arg1 * 4) + arg0);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:3: invalid type argument of `unary *'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `aidx` — benchmark function synthetic:aidx:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\taidx\n\t.type\t aidx,function\n\t.thumb_func\naidx:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t aidx,.Lfe1-aidx\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function aidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `aidx` — benchmark function synthetic:aidx:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:aidx:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\taidx\n\t.type\t aidx,function\n\t.thumb_func\naidx:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t aidx,.Lfe1-aidx\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name aidx # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:aidx:gcc2.7.2kmc","sym":"aidx","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","array","variable-index"],"loc":1,"refSource":"int aidx(int *p,int i){ return p[i]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta1,a1,0x2\n 4:\taddu\ta1,a1,a0\n 8:\tjr\tra\n c:\tlw\tv0,0(a1)\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b19b8a8ca21876a7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 aidx\n\n\nContents of section .text:\n 0000 00052880 00a42821 03e00008 8ca20000 ..(...(!........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 aidx(s32 * a0, u32 a1) {\n return a0[a1];\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 aidx(s32 arg0, s32 arg1) {\n return *((arg1 * 4) + arg0);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: invalid type argument of `unary *'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `aidx` — benchmark function synthetic:aidx:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel aidx\n sll\t$a1, $a1, 0x2\n addu\t$a1, $a1, $a0\n jr\t$ra\n lw\t$v0, 0($a1)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function aidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `aidx` — benchmark function synthetic:aidx:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:aidx:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta1,a1,0x2\n 4:\taddu\ta1,a1,a0\n 8:\tjr\tra\n c:\tlw\tv0,0(a1)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b19b8a8ca21876a7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 aidx\n\n\nContents of section .text:\n 0000 00052880 00a42821 03e00008 8ca20000 ..(...(!........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name aidx # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:aidx:ido7.1","sym":"aidx","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","array","variable-index"],"loc":1,"refSource":"int aidx(int *p,int i){ return p[i]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x2\n 4:\taddu\tt7,a0,t6\n 8:\tjr\tra\n c:\tlw\tv0,0(t7)\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 aidx\n\n\nContents of section .text:\n 0000 00057080 008e7821 03e00008 8de20000 ..p...x!........\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 31396238 61386361 32313837 ef-b19b8a8ca2187\n 0130 3661372f 7265662e 63006169 64780000 6a7/ref.c.aidx..\n 0140 61696478 00000000 00000000 00000001 aidx............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 aidx(s32 * a0, u32 a1) {\n return a0[a1];\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 aidx(s32 arg0, s32 arg1) {\n return *(arg0 + (arg1 * 4));\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: Dereferenced a non-pointer."]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `aidx` — benchmark function synthetic:aidx:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel aidx\n sll\t$t6, $a1, 0x2\n addu\t$t7, $a0, $t6\n jr\t$ra\n lw\t$v0, 0($t7)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function aidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `aidx` — benchmark function synthetic:aidx:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:aidx:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x2\n 4:\taddu\tt7,a0,t6\n 8:\tjr\tra\n c:\tlw\tv0,0(t7)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 aidx\n\n\nContents of section .text:\n 0000 00057080 008e7821 03e00008 8de20000 ..p...x!........\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 31396238 61386361 32313837 ef-b19b8a8ca2187\n 0130 3661372f 7265662e 63006169 64780000 6a7/ref.c.aidx..\n 0140 61696478 00000000 00000000 00000001 aidx............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name aidx # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:aidx:mwcc_242_81","sym":"aidx","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","array","variable-index"],"loc":1,"refSource":"int aidx(int *p,int i){ return p[i]; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,2\n 4:\tlwzx r3,r3,r0\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c aidx\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 aidx\n\n\nContents of section .text:\n 0000 5480103a 7c63002e 4e800020 T..:|c..N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 aidx(s32 * a0, u32 a1) {\n return a0[a1];\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 aidx(s32 arg0, s32 arg1) {\n return *(arg0 + (arg1 * 4));\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^","# pointer/array required"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `aidx` — benchmark function synthetic:aidx:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel aidx\n slwi r0,r4,2\n lwzx r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function aidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `aidx` — benchmark function synthetic:aidx:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:aidx:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,2\n 4:\tlwzx r3,r3,r0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c aidx\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 aidx\n\n\nContents of section .text:\n 0000 5480103a 7c63002e 4e800020 T..:|c..N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name aidx # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:arraysum:agbcc","sym":"arraysum","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for","memory","array"],"loc":1,"refSource":"int arraysum(int *a,int n){ int s=0,i; for(i=0;i= a1) {\n v1 = 0;\n } else {\n v0 = a0;\n v1 = 0;\n v2 = a1;\n do {\n v1 = v1 + *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":10,"maxScore":14,"compileErrors":null,"breakdown":{"insert":3,"delete":1,"replace":0,"opMismatch":1,"argMismatch":5},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 arraysum(s32 *arg0, s32 arg1) {\n s32 *var_r3;\n s32 temp_r0;\n s32 var_r1;\n s32 var_r2;\n\n var_r1 = arg1;\n var_r2 = 0;\n if (var_r1 > 0) {\n var_r3 = arg0;\n do {\n temp_r0 = *var_r3;\n var_r3 += 4;\n var_r2 += temp_r0;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n return var_r2;\n}\n","score":8,"maxScore":12,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":1,"opMismatch":1,"argMismatch":5},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":8,"maxScore":12,"ratio":0.6666666666666666,"kinds":{"insert":1,"delete":0,"replace":1,"opMismatch":1,"argMismatch":5}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `arraysum` — benchmark function synthetic:arraysum:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tarraysum\n\t.type\t arraysum,function\n\t.thumb_func\narraysum:\n\tmov\tr2, #0x0\n\tcmp\tr2, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr3, r0, #0\n.L6:\n\tldmia\tr3!, {r0}\n\tadd\tr2, r2, r0\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t arraysum,.Lfe1-arraysum\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function arraysum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `arraysum` — benchmark function synthetic:arraysum:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:arraysum:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tarraysum\n\t.type\t arraysum,function\n\t.thumb_func\narraysum:\n\tmov\tr2, #0x0\n\tcmp\tr2, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr3, r0, #0\n.L6:\n\tldmia\tr3!, {r0}\n\tadd\tr2, r2, r0\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t arraysum,.Lfe1-arraysum\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name arraysum # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:arraysum:gcc2.7.2kmc","sym":"arraysum","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for","memory","array"],"loc":1,"refSource":"int arraysum(int *a,int n){ int s=0,i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,28 \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\taddiu\ta2,a2,1\n 18:\taddu\tv1,v1,v0\n 1c:\tslt\tv0,a2,a1\n 20:\tbnez\tv0,10 \n 24:\taddiu\ta0,a0,4\n 28:\tmove\tv0,v1\n 2c:\tjr\tra\n 30:\taddiu\tsp,sp,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-18db9a7b8961e02d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 arraysum\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00007 00001821 '.....0!.......!\n 0010 8c820000 24c60001 00621821 00c5102a ....$....b.!...*\n 0020 1440fffb 24840004 00601021 03e00008 .@..$....`.!....\n 0030 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 arraysum(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n v0 = a0;\n v1 = 0;\n v2 = 0;\n while (v1 < a1) {\n v1 = v1 + 1;\n v2 = v2 + *v0;\n v0 = v0 + 1;\n }\n return v2;\n}\n","score":6,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 arraysum(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 var_a2;\n s32 var_v1;\n\n var_a0 = arg0;\n var_a2 = 0;\n var_v1 = 0;\n if (arg1 > 0) {\n do {\n var_a2 += 1;\n var_v1 += *var_a0;\n var_a0 += 4;\n } while (var_a2 < arg1);\n }\n return var_v1;\n}\n","score":9,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":13,"ratio":0.46153846153846156,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `arraysum` — benchmark function synthetic:arraysum:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel arraysum\n addiu\t$sp, $sp, -8\n move\t$a2, $zero\n blez\t$a1, .L28\n move\t$v1, $zero\n.L10:\n lw\t$v0, 0($a0)\n addiu\t$a2, $a2, 1\n addu\t$v1, $v1, $v0\n slt\t$v0, $a2, $a1\n bnez\t$v0, .L10\n addiu\t$a0, $a0, 4\n.L28:\n move\t$v0, $v1\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function arraysum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `arraysum` — benchmark function synthetic:arraysum:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:arraysum:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,28 \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\taddiu\ta2,a2,1\n 18:\taddu\tv1,v1,v0\n 1c:\tslt\tv0,a2,a1\n 20:\tbnez\tv0,10 \n 24:\taddiu\ta0,a0,4\n 28:\tmove\tv0,v1\n 2c:\tjr\tra\n 30:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-18db9a7b8961e02d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 arraysum\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00007 00001821 '.....0!.......!\n 0010 8c820000 24c60001 00621821 00c5102a ....$....b.!...*\n 0020 1440fffb 24840004 00601021 03e00008 .@..$....`.!....\n 0030 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name arraysum # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:arraysum:ido7.1","sym":"arraysum","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for","memory","array"],"loc":1,"refSource":"int arraysum(int *a,int n){ int s=0,i; for(i=0;i:\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,70 \n 8:\tmove\tv0,zero\n c:\tandi\tt0,a1,0x3\n 10:\tbeqz\tt0,38 \n 14:\tmove\ta3,t0\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\tt7,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\taddiu\ta2,a2,4\n 2c:\tbne\ta3,v0,20 \n 30:\taddu\tv1,v1,t7\n 34:\tbeq\tv0,a1,70 \n 38:\tsll\tt8,v0,0x2\n 3c:\tsll\tt9,a1,0x2\n 40:\taddu\ta3,t9,a0\n 44:\taddu\ta2,a0,t8\n 48:\tlw\tt1,0(a2)\n 4c:\tlw\tt2,4(a2)\n 50:\tlw\tt3,8(a2)\n 54:\taddu\tv1,v1,t1\n 58:\tlw\tt4,12(a2)\n 5c:\taddu\tv1,v1,t2\n 60:\taddiu\ta2,a2,16\n 64:\taddu\tv1,v1,t3\n 68:\tbne\ta2,a3,48 \n 6c:\taddu\tv1,v1,t4\n 70:\tjr\tra\n 74:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 arraysum\n\n\nContents of section .text:\n 0000 00001825 18a0001a 00001025 30a80003 ...%.......%0...\n 0010 11000009 01003825 00007080 008e3021 ......8%..p...0!\n 0020 8ccf0000 24420001 24c60004 14e2fffc ....$B..$.......\n 0030 006f1821 1045000e 0002c080 0005c880 .o.!.E..........\n 0040 03243821 00983021 8cc90000 8cca0004 .$8!..0!........\n 0050 8ccb0008 00691821 8ccc000c 006a1821 .....i.!.....j.!\n 0060 24c60010 006b1821 14c7fff7 006c1821 $....k.!.....l.!\n 0070 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8300dffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300dffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000004 000001e8 p...............\n 0010 00000005 00000330 00000001 000001ec .......0........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000038 00000294 .......P...8....\n 0040 0000000c 000002cc 00000001 000002d8 ................\n 0050 00000000 00000000 00000001 00000320 ............... \n 0060 08080802 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000078 20200001 00000001 .......x ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 38646239 61376238 39363165 ef-18db9a7b8961e\n 0130 3032642f 7265662e 63006172 72617973 02d/ref.c.arrays\n 0140 756d0000 61727261 7973756d 00000000 um..arraysum....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 0000001e ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000004 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'arraysum' — lift: cannot lift 'arraysum': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tblez\ta1,70 */\n/* 8:\tmove\tv0,zero */\n/* c:\tandi\tt0,a1,0x3 */\n/* 10:\tbeqz\tt0,38 */\n/* 14:\tmove\ta3,t0 */\n/* 18:\tsll\tt6,zero,0x2 */\n/* 1c:\taddu\ta2,a0,t6 */\n/* 20:\tlw\tt7,0(a2) */\n/* 24:\taddiu\tv0,v0,1 */\n/* 28:\taddiu\ta2,a2,4 */\n/* 2c:\tbne\ta3,v0,20 */\n/* 30:\taddu\tv1,v1,t7 */\n/* 34:\tbeq\tv0,a1,70 */\n/* 38:\tsll\tt8,v0,0x2 */\n/* 3c:\tsll\tt9,a1,0x2 */\n/* 40:\taddu\ta3,t9,a0 */\n/* 44:\taddu\ta2,a0,t8 */\n/* 48:\tlw\tt1,0(a2) */\n/* 4c:\tlw\tt2,4(a2) */\n/* 50:\tlw\tt3,8(a2) */\n/* 54:\taddu\tv1,v1,t1 */\n/* 58:\tlw\tt4,12(a2) */\n/* 5c:\taddu\tv1,v1,t2 */\n/* 60:\taddiu\ta2,a2,16 */\n/* 64:\taddu\tv1,v1,t3 */\n/* 68:\tbne\ta2,a3,48 */\n/* 6c:\taddu\tv1,v1,t4 */\n/* 70:\tjr\tra */\n/* 74:\tmove\tv0,v1 */\n/* \t... */\nvoid arraysum(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'arraysum': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":39,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'arraysum': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 arraysum(s32 arg0, s32 arg1) {\n s32 *var_a2;\n s32 temp_t0;\n s32 temp_t3;\n s32 temp_t4;\n s32 temp_t7;\n s32 temp_v1;\n s32 var_v0;\n s32 var_v1;\n void *var_a2_2;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg1 > 0) {\n temp_t0 = arg1 & 3;\n if (temp_t0 != 0) {\n var_a2 = arg0 + (0 * 4);\n do {\n temp_t7 = *var_a2;\n var_v0 += 1;\n var_a2 += 4;\n var_v1 += temp_t7;\n } while (temp_t0 != var_v0);\n if (var_v0 != arg1) {\n goto block_5;\n }\n } else {\nblock_5:\n var_a2_2 = arg0 + (var_v0 * 4);\n do {\n temp_t3 = var_a2_2->unk8;\n temp_t4 = var_a2_2->unkC;\n temp_v1 = var_v1 + var_a2_2->unk0 + var_a2_2->unk4;\n var_a2_2 += 0x10;\n var_v1 = temp_v1 + temp_t3 + temp_t4;\n } while (var_a2_2 != ((arg1 * 4) + arg0));\n }\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":88,"lines":39,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 32: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 33: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 34: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 35: Bad operand type for += or -=","cfe: Error: /cand.c, line 37: Unacceptable operand of == or !="]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `arraysum` — benchmark function synthetic:arraysum:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel arraysum\n move\t$v1, $zero\n blez\t$a1, .L70\n move\t$v0, $zero\n andi\t$t0, $a1, 0x3\n beqz\t$t0, .L38\n move\t$a3, $t0\n sll\t$t6, $zero, 0x2\n addu\t$a2, $a0, $t6\n.L20:\n lw\t$t7, 0($a2)\n addiu\t$v0, $v0, 1\n addiu\t$a2, $a2, 4\n bne\t$a3, $v0, .L20\n addu\t$v1, $v1, $t7\n beq\t$v0, $a1, .L70\n.L38:\n sll\t$t8, $v0, 0x2\n sll\t$t9, $a1, 0x2\n addu\t$a3, $t9, $a0\n addu\t$a2, $a0, $t8\n.L48:\n lw\t$t1, 0($a2)\n lw\t$t2, 4($a2)\n lw\t$t3, 8($a2)\n addu\t$v1, $v1, $t1\n lw\t$t4, 12($a2)\n addu\t$v1, $v1, $t2\n addiu\t$a2, $a2, 16\n addu\t$v1, $v1, $t3\n bne\t$a2, $a3, .L48\n addu\t$v1, $v1, $t4\n.L70:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function arraysum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `arraysum` — benchmark function synthetic:arraysum:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:arraysum:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,70 \n 8:\tmove\tv0,zero\n c:\tandi\tt0,a1,0x3\n 10:\tbeqz\tt0,38 \n 14:\tmove\ta3,t0\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\tt7,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\taddiu\ta2,a2,4\n 2c:\tbne\ta3,v0,20 \n 30:\taddu\tv1,v1,t7\n 34:\tbeq\tv0,a1,70 \n 38:\tsll\tt8,v0,0x2\n 3c:\tsll\tt9,a1,0x2\n 40:\taddu\ta3,t9,a0\n 44:\taddu\ta2,a0,t8\n 48:\tlw\tt1,0(a2)\n 4c:\tlw\tt2,4(a2)\n 50:\tlw\tt3,8(a2)\n 54:\taddu\tv1,v1,t1\n 58:\tlw\tt4,12(a2)\n 5c:\taddu\tv1,v1,t2\n 60:\taddiu\ta2,a2,16\n 64:\taddu\tv1,v1,t3\n 68:\tbne\ta2,a3,48 \n 6c:\taddu\tv1,v1,t4\n 70:\tjr\tra\n 74:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 arraysum\n\n\nContents of section .text:\n 0000 00001825 18a0001a 00001025 30a80003 ...%.......%0...\n 0010 11000009 01003825 00007080 008e3021 ......8%..p...0!\n 0020 8ccf0000 24420001 24c60004 14e2fffc ....$B..$.......\n 0030 006f1821 1045000e 0002c080 0005c880 .o.!.E..........\n 0040 03243821 00983021 8cc90000 8cca0004 .$8!..0!........\n 0050 8ccb0008 00691821 8ccc000c 006a1821 .....i.!.....j.!\n 0060 24c60010 006b1821 14c7fff7 006c1821 $....k.!.....l.!\n 0070 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8300dffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300dffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000004 000001e8 p...............\n 0010 00000005 00000330 00000001 000001ec .......0........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000038 00000294 .......P...8....\n 0040 0000000c 000002cc 00000001 000002d8 ................\n 0050 00000000 00000000 00000001 00000320 ............... \n 0060 08080802 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000078 20200001 00000001 .......x ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 38646239 61376238 39363165 ef-18db9a7b8961e\n 0130 3032642f 7265662e 63006172 72617973 02d/ref.c.arrays\n 0140 756d0000 61727261 7973756d 00000000 um..arraysum....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 0000001e ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000004 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name arraysum # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:arraysum:mwcc_242_81","sym":"arraysum","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for","memory","array"],"loc":1,"refSource":"int arraysum(int *a,int n){ int s=0,i; for(i=0;i:\n 0:\tcmpwi r4,0\n 4:\tli r7,0\n 8:\tli r8,0\n c:\tble a8 \n 10:\tcmpwi r4,8\n 14:\taddi r5,r4,-8\n 18:\tble 80 \n 1c:\taddi r0,r5,7\n 20:\tmr r6,r3\n 24:\tsrwi r0,r0,3\n 28:\tmtctr r0\n 2c:\tcmpwi r5,0\n 30:\tble 80 \n 34:\tlwz r5,0(r6)\n 38:\taddi r8,r8,8\n 3c:\tlwz r0,4(r6)\n 40:\tadd r7,r7,r5\n 44:\tlwz r5,8(r6)\n 48:\tadd r7,r7,r0\n 4c:\tlwz r0,12(r6)\n 50:\tadd r7,r7,r5\n 54:\tlwz r5,16(r6)\n 58:\tadd r7,r7,r0\n 5c:\tlwz r0,20(r6)\n 60:\tadd r7,r7,r5\n 64:\tlwz r5,24(r6)\n 68:\tadd r7,r7,r0\n 6c:\tlwz r0,28(r6)\n 70:\tadd r7,r7,r5\n 74:\taddi r6,r6,32\n 78:\tadd r7,r7,r0\n 7c:\tbdnz 34 \n 80:\tslwi r5,r8,2\n 84:\tsubf r0,r8,r4\n 88:\tadd r3,r3,r5\n 8c:\tmtctr r0\n 90:\tcmpw r8,r4\n 94:\tbge a8 \n 98:\tlwz r0,0(r3)\n 9c:\taddi r3,r3,4\n a0:\tadd r7,r7,r0\n a4:\tbdnz 98 \n a8:\tmr r3,r7\n ac:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000b0 arraysum\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 arraysum\n\n\nContents of section .text:\n 0000 2c040000 38e00000 39000000 4081009c ,...8...9...@...\n 0010 2c040008 38a4fff8 40810068 38050007 ,...8...@..h8...\n 0020 7c661b78 5400e8fe 7c0903a6 2c050000 |f.xT...|...,...\n 0030 40810050 80a60000 39080008 80060004 @..P....9.......\n 0040 7ce72a14 80a60008 7ce70214 8006000c |.*.....|.......\n 0050 7ce72a14 80a60010 7ce70214 80060014 |.*.....|.......\n 0060 7ce72a14 80a60018 7ce70214 8006001c |.*.....|.......\n 0070 7ce72a14 38c60020 7ce70214 4200ffb8 |.*.8.. |...B...\n 0080 5505103a 7c082050 7c632a14 7c0903a6 U..:|. P|c*.|...\n 0090 7c082000 40800014 80030000 38630004 |. .@.......8c..\n 00a0 7ce70214 4200fff4 7ce33b78 4e800020 |...B...|.;xN.. \nContents of section .mwcats.text:\n 0000 020000b0 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 arraysum(s32 * a0, u32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 * v4;\n s32 v5;\n s32 v6;\n if (a1 <= 0) {\n v2 = 0;\n } else {\n if (a1 <= 8) {\n v1 = 0;\n v2 = 0;\n } else {\n v0 = a0;\n v1 = 0;\n v2 = 0;\n for (v3 = a1 + -8 + 7 >> 3; v3 != 0; v3 = v3 - 1) {\n v1 = v1 + 8;\n v2 = v2 + *v0 + v0[1] + v0[2] + v0[3] + v0[4] + v0[5] + v0[6] + v0[7];\n v0 = v0 + 8;\n }\n }\n v5 = v2;\n v6 = a1 - v1;\n v4 = a0 + (v1 << 2);\n while (v6 != 0) {\n v5 = v5 + *v4;\n v4 = v4 + 1;\n v6 = v6 - 1;\n }\n v2 = v5;\n }\n return v2;\n}\n","score":113,"maxScore":120,"compileErrors":null,"breakdown":{"insert":76,"delete":3,"replace":6,"opMismatch":6,"argMismatch":22},"quality":{"score":100,"lines":36,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 arraysum(void *arg0, s32 arg1) {\n s32 *var_r3;\n s32 temp_r0;\n s32 temp_r0_2;\n s32 temp_r5;\n s32 temp_r7;\n s32 var_ctr_2;\n s32 var_r7;\n s32 var_r8;\n u32 var_ctr;\n void *var_r6;\n\n var_r7 = 0;\n var_r8 = 0;\n if (arg1 > 0) {\n temp_r5 = arg1 - 8;\n if (arg1 > 8) {\n var_r6 = arg0;\n var_ctr = (u32) (temp_r5 + 7) >> 3U;\n if (temp_r5 > 0) {\n do {\n var_r8 += 8;\n temp_r0 = var_r6->unk1C;\n temp_r7 = var_r7 + var_r6->unk0 + var_r6->unk4 + var_r6->unk8 + var_r6->unkC + var_r6->unk10 + var_r6->unk14 + var_r6->unk18;\n var_r6 += 0x20;\n var_r7 = temp_r7 + temp_r0;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r3 = arg0 + (var_r8 * 4);\n var_ctr_2 = arg1 - var_r8;\n if (var_r8 < arg1) {\n do {\n temp_r0_2 = *var_r3;\n var_r3 += 4;\n var_r7 += temp_r0_2;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r7;\n}\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":100,"lines":42,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class","# Error: ^^","# Error: ^","# illegal type"]},"gapSize":{"decompiler":"asmlift","score":113,"maxScore":120,"ratio":0.9416666666666667,"kinds":{"insert":76,"delete":3,"replace":6,"opMismatch":6,"argMismatch":22}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `arraysum` — benchmark function synthetic:arraysum:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel arraysum\n cmpwi r4,0\n li r7,0\n li r8,0\n ble .La8\n cmpwi r4,8\n addi r5,r4,-8\n ble .L80\n addi r0,r5,7\n mr r6,r3\n srwi r0,r0,3\n mtctr r0\n cmpwi r5,0\n ble .L80\n.L34:\n lwz r5,0(r6)\n addi r8,r8,8\n lwz r0,4(r6)\n add r7,r7,r5\n lwz r5,8(r6)\n add r7,r7,r0\n lwz r0,12(r6)\n add r7,r7,r5\n lwz r5,16(r6)\n add r7,r7,r0\n lwz r0,20(r6)\n add r7,r7,r5\n lwz r5,24(r6)\n add r7,r7,r0\n lwz r0,28(r6)\n add r7,r7,r5\n addi r6,r6,32\n add r7,r7,r0\n bdnz .L34\n.L80:\n slwi r5,r8,2\n subf r0,r8,r4\n add r3,r3,r5\n mtctr r0\n cmpw r8,r4\n bge .La8\n.L98:\n lwz r0,0(r3)\n addi r3,r3,4\n add r7,r7,r0\n bdnz .L98\n.La8:\n mr r3,r7\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function arraysum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `arraysum` — benchmark function synthetic:arraysum:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:arraysum:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r4,0\n 4:\tli r7,0\n 8:\tli r8,0\n c:\tble a8 \n 10:\tcmpwi r4,8\n 14:\taddi r5,r4,-8\n 18:\tble 80 \n 1c:\taddi r0,r5,7\n 20:\tmr r6,r3\n 24:\tsrwi r0,r0,3\n 28:\tmtctr r0\n 2c:\tcmpwi r5,0\n 30:\tble 80 \n 34:\tlwz r5,0(r6)\n 38:\taddi r8,r8,8\n 3c:\tlwz r0,4(r6)\n 40:\tadd r7,r7,r5\n 44:\tlwz r5,8(r6)\n 48:\tadd r7,r7,r0\n 4c:\tlwz r0,12(r6)\n 50:\tadd r7,r7,r5\n 54:\tlwz r5,16(r6)\n 58:\tadd r7,r7,r0\n 5c:\tlwz r0,20(r6)\n 60:\tadd r7,r7,r5\n 64:\tlwz r5,24(r6)\n 68:\tadd r7,r7,r0\n 6c:\tlwz r0,28(r6)\n 70:\tadd r7,r7,r5\n 74:\taddi r6,r6,32\n 78:\tadd r7,r7,r0\n 7c:\tbdnz 34 \n 80:\tslwi r5,r8,2\n 84:\tsubf r0,r8,r4\n 88:\tadd r3,r3,r5\n 8c:\tmtctr r0\n 90:\tcmpw r8,r4\n 94:\tbge a8 \n 98:\tlwz r0,0(r3)\n 9c:\taddi r3,r3,4\n a0:\tadd r7,r7,r0\n a4:\tbdnz 98 \n a8:\tmr r3,r7\n ac:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000b0 arraysum\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 arraysum\n\n\nContents of section .text:\n 0000 2c040000 38e00000 39000000 4081009c ,...8...9...@...\n 0010 2c040008 38a4fff8 40810068 38050007 ,...8...@..h8...\n 0020 7c661b78 5400e8fe 7c0903a6 2c050000 |f.xT...|...,...\n 0030 40810050 80a60000 39080008 80060004 @..P....9.......\n 0040 7ce72a14 80a60008 7ce70214 8006000c |.*.....|.......\n 0050 7ce72a14 80a60010 7ce70214 80060014 |.*.....|.......\n 0060 7ce72a14 80a60018 7ce70214 8006001c |.*.....|.......\n 0070 7ce72a14 38c60020 7ce70214 4200ffb8 |.*.8.. |...B...\n 0080 5505103a 7c082050 7c632a14 7c0903a6 U..:|. P|c*.|...\n 0090 7c082000 40800014 80030000 38630004 |. .@.......8c..\n 00a0 7ce70214 4200fff4 7ce33b78 4e800020 |...B...|.;xN.. \nContents of section .mwcats.text:\n 0000 020000b0 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name arraysum # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:astore:agbcc","sym":"astore","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","array","store"],"loc":1,"refSource":"void astore(int *p,int i,int v){ p[i]=v; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tastore\n\t.type\t astore,function\n\t.thumb_func\nastore:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t astore,.Lfe1-astore\n","ctx":"void astore(int*,int,int);","proto":{"astore":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void astore(s32 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void astore(s32 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = arg2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `astore` — benchmark function synthetic:astore:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tastore\n\t.type\t astore,function\n\t.thumb_func\nastore:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t astore,.Lfe1-astore\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid astore(int*,int,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function astore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `astore` — benchmark function synthetic:astore:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:astore:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tastore\n\t.type\t astore,function\n\t.thumb_func\nastore:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t astore,.Lfe1-astore\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"astore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name astore # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:astore:gcc2.7.2kmc","sym":"astore","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","array","store"],"loc":1,"refSource":"void astore(int *p,int i,int v){ p[i]=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta1,a1,0x2\n 4:\taddu\ta1,a1,a0\n 8:\tjr\tra\n c:\tsw\ta2,0(a1)\n","ctx":"void astore(int*,int,int);","proto":{"astore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-9b130275db981c73/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 astore\n\n\nContents of section .text:\n 0000 00052880 00a42821 03e00008 aca60000 ..(...(!........\nContents of section .reginfo:\n 0000 80000070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void astore(s32 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void astore(s32 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = arg2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `astore` — benchmark function synthetic:astore:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel astore\n sll\t$a1, $a1, 0x2\n addu\t$a1, $a1, $a0\n jr\t$ra\n sw\t$a2, 0($a1)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid astore(int*,int,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function astore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `astore` — benchmark function synthetic:astore:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:astore:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta1,a1,0x2\n 4:\taddu\ta1,a1,a0\n 8:\tjr\tra\n c:\tsw\ta2,0(a1)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-9b130275db981c73/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 astore\n\n\nContents of section .text:\n 0000 00052880 00a42821 03e00008 aca60000 ..(...(!........\nContents of section .reginfo:\n 0000 80000070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"astore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name astore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:astore:ido7.1","sym":"astore","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","array","store"],"loc":1,"refSource":"void astore(int *p,int i,int v){ p[i]=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x2\n 4:\taddu\tt7,a0,t6\n 8:\tjr\tra\n c:\tsw\ta2,0(t7)\n","ctx":"void astore(int*,int,int);","proto":{"astore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 astore\n\n\nContents of section .text:\n 0000 00057080 008e7821 03e00008 ade60000 ..p...x!........\nContents of section .options:\n 0000 01200000 00000000 8000c070 00000000 . .........p....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c070 00000000 00000000 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 62313330 32373564 62393831 ef-9b130275db981\n 0130 6337332f 7265662e 63006173 746f7265 c73/ref.c.astore\n 0140 00000000 6173746f 72650000 00000000 ....astore......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void astore(s32 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void astore(s32 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = arg2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `astore` — benchmark function synthetic:astore:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel astore\n sll\t$t6, $a1, 0x2\n addu\t$t7, $a0, $t6\n jr\t$ra\n sw\t$a2, 0($t7)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid astore(int*,int,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function astore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `astore` — benchmark function synthetic:astore:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:astore:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x2\n 4:\taddu\tt7,a0,t6\n 8:\tjr\tra\n c:\tsw\ta2,0(t7)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 astore\n\n\nContents of section .text:\n 0000 00057080 008e7821 03e00008 ade60000 ..p...x!........\nContents of section .options:\n 0000 01200000 00000000 8000c070 00000000 . .........p....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c070 00000000 00000000 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 62313330 32373564 62393831 ef-9b130275db981\n 0130 6337332f 7265662e 63006173 746f7265 c73/ref.c.astore\n 0140 00000000 6173746f 72650000 00000000 ....astore......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"astore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name astore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:astore:mwcc_242_81","sym":"astore","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","array","store"],"loc":1,"refSource":"void astore(int *p,int i,int v){ p[i]=v; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,2\n 4:\tstwx r5,r3,r0\n 8:\tblr\n","ctx":"void astore(int*,int,int);","proto":{"astore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c astore\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 astore\n\n\nContents of section .text:\n 0000 5480103a 7ca3012e 4e800020 T..:|...N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void astore(s32 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void astore(s32 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = arg2;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `astore` — benchmark function synthetic:astore:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel astore\n slwi r0,r4,2\n stwx r5,r3,r0\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid astore(int*,int,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function astore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `astore` — benchmark function synthetic:astore:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:astore:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,2\n 4:\tstwx r5,r3,r0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c astore\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 astore\n\n\nContents of section .text:\n 0000 5480103a 7ca3012e 4e800020 T..:|...N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"astore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name astore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:avg2:agbcc","sym":"avg2","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int avg2(int a,int b){ return (a+b)/2; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tavg2\n\t.type\t avg2,function\n\t.thumb_func\navg2:\n\tadd\tr0, r0, r1\n\tlsr\tr1, r0, #0x1f\n\tadd\tr0, r0, r1\n\tasr\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t avg2,.Lfe1-avg2\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 avg2(s32 a0, s32 a1) {\n return (a0 + a1) / 2;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 avg2(s32 arg0, s32 arg1) {\n u32 temp_r0;\n\n temp_r0 = arg0 + arg1;\n return (s32) (temp_r0 + (temp_r0 >> 0x1F)) >> 1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `avg2` — benchmark function synthetic:avg2:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tavg2\n\t.type\t avg2,function\n\t.thumb_func\navg2:\n\tadd\tr0, r0, r1\n\tlsr\tr1, r0, #0x1f\n\tadd\tr0, r0, r1\n\tasr\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t avg2,.Lfe1-avg2\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function avg2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `avg2` — benchmark function synthetic:avg2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:avg2:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tavg2\n\t.type\t avg2,function\n\t.thumb_func\navg2:\n\tadd\tr0, r0, r1\n\tlsr\tr1, r0, #0x1f\n\tadd\tr0, r0, r1\n\tasr\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t avg2,.Lfe1-avg2\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name avg2 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:avg2:gcc2.7.2kmc","sym":"avg2","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int avg2(int a,int b){ return (a+b)/2; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tsrl\tv1,v0,0x1f\n 8:\taddu\tv0,v0,v1\n c:\tjr\tra\n 10:\tsra\tv0,v0,0x1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1c63b47c226d2034/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 avg2\n\n\nContents of section .text:\n 0000 00851021 00021fc2 00431021 03e00008 ...!.....C.!....\n 0010 00021043 00000000 00000000 00000000 ...C............\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 avg2(s32 a0, s32 a1) {\n return (a0 + a1) / 2;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 avg2(s32 arg0, s32 arg1) {\n u32 temp_v0;\n\n temp_v0 = arg0 + arg1;\n return (s32) (temp_v0 + (temp_v0 >> 0x1F)) >> 1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `avg2` — benchmark function synthetic:avg2:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel avg2\n addu\t$v0, $a0, $a1\n srl\t$v1, $v0, 0x1f\n addu\t$v0, $v0, $v1\n jr\t$ra\n sra\t$v0, $v0, 0x1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function avg2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `avg2` — benchmark function synthetic:avg2:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:avg2:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tsrl\tv1,v0,0x1f\n 8:\taddu\tv0,v0,v1\n c:\tjr\tra\n 10:\tsra\tv0,v0,0x1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1c63b47c226d2034/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 avg2\n\n\nContents of section .text:\n 0000 00851021 00021fc2 00431021 03e00008 ...!.....C.!....\n 0010 00021043 00000000 00000000 00000000 ...C............\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name avg2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:avg2:ido7.1","sym":"avg2","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int avg2(int a,int b){ return (a+b)/2; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tbgez\tv0,10 \n 8:\tmove\tat,v0\n c:\taddiu\tat,v0,1\n 10:\tsra\tv0,at,0x1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c avg2\n\n\nContents of section .text:\n 0000 00851021 04410002 00400821 24410001 ...!.A...@.!$A..\n 0010 00011043 03e00008 00000000 00000000 ...C............\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 63363362 34376332 32366432 ef-1c63b47c226d2\n 0130 3033342f 7265662e 63006176 67320000 034/ref.c.avg2..\n 0140 61766732 00000000 00000000 00000001 avg2............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned/regcopy","outcome":"nonmatch","source":"s32 avg2(u32 a0, u32 a1) {\n s32 v0;\n s32 w0;\n v0 = a0 + a1;\n w0 = v0;\n if (w0 < 0) w0 = w0 + 1;\n return w0 >> 1;\n}\n","score":4,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 avg2(s32 arg0, s32 arg1) {\n return (s32) (arg0 + arg1) / 2;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `avg2` — benchmark function synthetic:avg2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel avg2\n addu\t$v0, $a0, $a1\n bgez\t$v0, .L10\n move\t$at, $v0\n addiu\t$at, $v0, 1\n.L10:\n sra\t$v0, $at, 0x1\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function avg2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `avg2` — benchmark function synthetic:avg2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:avg2:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tbgez\tv0,10 \n 8:\tmove\tat,v0\n c:\taddiu\tat,v0,1\n 10:\tsra\tv0,at,0x1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c avg2\n\n\nContents of section .text:\n 0000 00851021 04410002 00400821 24410001 ...!.A...@.!$A..\n 0010 00011043 03e00008 00000000 00000000 ...C............\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 63363362 34376332 32366432 ef-1c63b47c226d2\n 0130 3033342f 7265662e 63006176 67320000 034/ref.c.avg2..\n 0140 61766732 00000000 00000000 00000001 avg2............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name avg2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:avg2:mwcc_242_81","sym":"avg2","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int avg2(int a,int b){ return (a+b)/2; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tadd r3,r3,r4\n 4:\tsrwi r0,r3,31\n 8:\tadd r0,r0,r3\n c:\tsrawi r3,r0,1\n 10:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 avg2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 avg2\n\n\nContents of section .text:\n 0000 7c632214 54600ffe 7c001a14 7c030e70 |c\".T`..|...|..p\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 avg2(u32 a0, u32 a1) {\n return (a0 + a1 >> 31) + (a0 + a1) >> 1;\n}\n","score":2,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 avg2(s32 arg0, s32 arg1) {\n u32 temp_r3;\n\n temp_r3 = arg0 + arg1;\n return (s32) ((temp_r3 >> 0x1FU) + temp_r3) >> 1;\n}\n","score":1,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":1,"maxScore":5,"ratio":0.2,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `avg2` — benchmark function synthetic:avg2:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel avg2\n add r3,r3,r4\n srwi r0,r3,31\n add r0,r0,r3\n srawi r3,r0,1\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function avg2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `avg2` — benchmark function synthetic:avg2:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:avg2:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tadd r3,r3,r4\n 4:\tsrwi r0,r3,31\n 8:\tadd r0,r0,r3\n c:\tsrawi r3,r0,1\n 10:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 avg2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 avg2\n\n\nContents of section .text:\n 0000 7c632214 54600ffe 7c001a14 7c030e70 |c\".T`..|...|..p\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name avg2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:band:agbcc","sym":"band","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int band(int a,int b){ return a&b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tband\n\t.type\t band,function\n\t.thumb_func\nband:\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t band,.Lfe1-band\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 band(u32 a0, u32 a1) {\n return a0 & a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 band(s32 arg0, s32 arg1) {\n return arg0 & arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `band` — benchmark function synthetic:band:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tband\n\t.type\t band,function\n\t.thumb_func\nband:\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t band,.Lfe1-band\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function band # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `band` — benchmark function synthetic:band:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:band:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tband\n\t.type\t band,function\n\t.thumb_func\nband:\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t band,.Lfe1-band\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name band # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:band:gcc2.7.2kmc","sym":"band","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int band(int a,int b){ return a&b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tand\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b0bc44488a7f6329/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 band\n\n\nContents of section .text:\n 0000 03e00008 00851024 00000000 00000000 .......$........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 band(u32 a0, u32 a1) {\n return a0 & a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 band(s32 arg0, s32 arg1) {\n return arg0 & arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `band` — benchmark function synthetic:band:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel band\n jr\t$ra\n and\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function band # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `band` — benchmark function synthetic:band:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:band:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tand\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b0bc44488a7f6329/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 band\n\n\nContents of section .text:\n 0000 03e00008 00851024 00000000 00000000 .......$........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name band # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:band:ido7.1","sym":"band","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise"],"loc":1,"refSource":"int band(int a,int b){ return a&b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tand\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 band\n\n\nContents of section .text:\n 0000 03e00008 00851024 00000000 00000000 .......$........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 30626334 34343838 61376636 ef-b0bc44488a7f6\n 0130 3332392f 7265662e 63006261 6e640000 329/ref.c.band..\n 0140 62616e64 00000000 00000000 00000001 band............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 band(u32 a0, u32 a1) {\n return a0 & a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 band(s32 arg0, s32 arg1) {\n return arg0 & arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `band` — benchmark function synthetic:band:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel band\n jr\t$ra\n and\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function band # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `band` — benchmark function synthetic:band:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:band:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tand\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 band\n\n\nContents of section .text:\n 0000 03e00008 00851024 00000000 00000000 .......$........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 30626334 34343838 61376636 ef-b0bc44488a7f6\n 0130 3332392f 7265662e 63006261 6e640000 329/ref.c.band..\n 0140 62616e64 00000000 00000000 00000001 band............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name band # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:band:mwcc_242_81","sym":"band","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int band(int a,int b){ return a&b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tand r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 band\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 band\n\n\nContents of section .text:\n 0000 7c632038 4e800020 |c 8N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 band(u32 a0, u32 a1) {\n return a0 & a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 band(s32 arg0, s32 arg1) {\n return arg0 & arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `band` — benchmark function synthetic:band:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel band\n and r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function band # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `band` — benchmark function synthetic:band:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:band:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tand r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 band\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 band\n\n\nContents of section .text:\n 0000 7c632038 4e800020 |c 8N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name band # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bittest:agbcc","sym":"bittest","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"int bittest(int x,int n){ return (x>>n)&1; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbittest\n\t.type\t bittest,function\n\t.thumb_func\nbittest:\n\tadd\tr2, r0, #0\n\tasr\tr2, r2, r1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t bittest,.Lfe1-bittest\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 bittest(s32 a0, s32 a1) {\n return 1 & a0 >> a1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bittest(s32 arg0, s32 arg1) {\n return 1 & (arg0 >> arg1);\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bittest` — benchmark function synthetic:bittest:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbittest\n\t.type\t bittest,function\n\t.thumb_func\nbittest:\n\tadd\tr2, r0, #0\n\tasr\tr2, r2, r1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t bittest,.Lfe1-bittest\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bittest # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bittest` — benchmark function synthetic:bittest:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bittest:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbittest\n\t.type\t bittest,function\n\t.thumb_func\nbittest:\n\tadd\tr2, r0, #0\n\tasr\tr2, r2, r1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t bittest,.Lfe1-bittest\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bittest # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bittest:gcc2.7.2kmc","sym":"bittest","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"int bittest(int x,int n){ return (x>>n)&1; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrav\tv0,a0,a1\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0x1\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2d92365ec0ecd7e5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c bittest\n\n\nContents of section .text:\n 0000 00a41007 03e00008 30420001 00000000 ........0B......\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 bittest(s32 a0, s32 a1) {\n return a0 >> a1 & 1;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bittest(s32 arg0, s32 arg1) {\n return (arg0 >> arg1) & 1;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bittest` — benchmark function synthetic:bittest:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bittest\n srav\t$v0, $a0, $a1\n jr\t$ra\n andi\t$v0, $v0, 0x1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bittest # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bittest` — benchmark function synthetic:bittest:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bittest:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrav\tv0,a0,a1\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0x1\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2d92365ec0ecd7e5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c bittest\n\n\nContents of section .text:\n 0000 00a41007 03e00008 30420001 00000000 ........0B......\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bittest # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bittest:ido7.1","sym":"bittest","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"int bittest(int x,int n){ return (x>>n)&1; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrav\tv0,a0,a1\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0x1\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c bittest\n\n\nContents of section .text:\n 0000 00a41007 03e00008 30420001 00000000 ........0B......\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 64393233 36356563 30656364 ef-2d92365ec0ecd\n 0130 3765352f 7265662e 63006269 74746573 7e5/ref.c.bittes\n 0140 74000000 62697474 65737400 00000000 t...bittest.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000003 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 bittest(s32 a0, s32 a1) {\n return a0 >> a1 & 1;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bittest(s32 arg0, s32 arg1) {\n return (arg0 >> arg1) & 1;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bittest` — benchmark function synthetic:bittest:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bittest\n srav\t$v0, $a0, $a1\n jr\t$ra\n andi\t$v0, $v0, 0x1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bittest # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bittest` — benchmark function synthetic:bittest:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bittest:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrav\tv0,a0,a1\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0x1\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c bittest\n\n\nContents of section .text:\n 0000 00a41007 03e00008 30420001 00000000 ........0B......\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 64393233 36356563 30656364 ef-2d92365ec0ecd\n 0130 3765352f 7265662e 63006269 74746573 7e5/ref.c.bittes\n 0140 74000000 62697474 65737400 00000000 t...bittest.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000003 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bittest # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bittest:mwcc_242_81","sym":"bittest","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"int bittest(int x,int n){ return (x>>n)&1; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsraw r0,r3,r4\n 4:\tclrlwi r3,r0,31\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c bittest\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bittest\n\n\nContents of section .text:\n 0000 7c602630 540307fe 4e800020 |`&0T...N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 bittest(s32 a0, s32 a1) {\n return a0 >> a1 & 1;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bittest(s32 arg0, s32 arg1) {\n return (arg0 >> arg1) & 1;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bittest` — benchmark function synthetic:bittest:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bittest\n sraw r0,r3,r4\n clrlwi r3,r0,31\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bittest # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bittest` — benchmark function synthetic:bittest:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bittest:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsraw r0,r3,r4\n 4:\tclrlwi r3,r0,31\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c bittest\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bittest\n\n\nContents of section .text:\n 0000 7c602630 540307fe 4e800020 |`&0T...N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bittest # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bnot:agbcc","sym":"bnot","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bnot(int a){ return ~a; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbnot\n\t.type\t bnot,function\n\t.thumb_func\nbnot:\n\tmvn\tr0, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t bnot,.Lfe1-bnot\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bnot(u32 a0) {\n return ~a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bnot(s32 arg0) {\n return ~arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bnot` — benchmark function synthetic:bnot:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbnot\n\t.type\t bnot,function\n\t.thumb_func\nbnot:\n\tmvn\tr0, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t bnot,.Lfe1-bnot\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bnot # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bnot` — benchmark function synthetic:bnot:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bnot:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbnot\n\t.type\t bnot,function\n\t.thumb_func\nbnot:\n\tmvn\tr0, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t bnot,.Lfe1-bnot\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bnot # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bnot:gcc2.7.2kmc","sym":"bnot","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bnot(int a){ return ~a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnor\tv0,zero,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c1b5fb7d6632a6b2/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 bnot\n\n\nContents of section .text:\n 0000 03e00008 00041027 00000000 00000000 .......'........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bnot(u32 a0) {\n return ~a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bnot(s32 arg0) {\n return ~arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bnot` — benchmark function synthetic:bnot:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bnot\n jr\t$ra\n nor\t$v0, $zero, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bnot # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bnot` — benchmark function synthetic:bnot:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bnot:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnor\tv0,zero,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c1b5fb7d6632a6b2/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 bnot\n\n\nContents of section .text:\n 0000 03e00008 00041027 00000000 00000000 .......'........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bnot # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bnot:ido7.1","sym":"bnot","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise"],"loc":1,"refSource":"int bnot(int a){ return ~a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnor\tv0,a0,zero\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 bnot\n\n\nContents of section .text:\n 0000 03e00008 00801027 00000000 00000000 .......'........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 31623566 62376436 36333261 ef-c1b5fb7d6632a\n 0130 3662322f 7265662e 6300626e 6f740000 6b2/ref.c.bnot..\n 0140 626e6f74 00000000 00000000 00000001 bnot............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bnot(u32 a0) {\n return ~a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bnot(s32 arg0) {\n return ~arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bnot` — benchmark function synthetic:bnot:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bnot\n jr\t$ra\n nor\t$v0, $a0, $zero\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bnot # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bnot` — benchmark function synthetic:bnot:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bnot:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnor\tv0,a0,zero\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 bnot\n\n\nContents of section .text:\n 0000 03e00008 00801027 00000000 00000000 .......'........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 31623566 62376436 36333261 ef-c1b5fb7d6632a\n 0130 3662322f 7265662e 6300626e 6f740000 6b2/ref.c.bnot..\n 0140 626e6f74 00000000 00000000 00000001 bnot............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bnot # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bnot:mwcc_242_81","sym":"bnot","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bnot(int a){ return ~a; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnot r3,r3\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 bnot\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bnot\n\n\nContents of section .text:\n 0000 7c6318f8 4e800020 |c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bnot(u32 a0) {\n return ~a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bnot(s32 arg0) {\n return ~arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bnot` — benchmark function synthetic:bnot:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bnot\n not r3,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bnot # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bnot` — benchmark function synthetic:bnot:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bnot:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnot r3,r3\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 bnot\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bnot\n\n\nContents of section .text:\n 0000 7c6318f8 4e800020 |c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bnot # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bor:agbcc","sym":"bor","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bor(int a,int b){ return a|b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbor\n\t.type\t bor,function\n\t.thumb_func\nbor:\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t bor,.Lfe1-bor\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bor(u32 a0, u32 a1) {\n return a0 | a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bor(s32 arg0, s32 arg1) {\n return arg0 | arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bor` — benchmark function synthetic:bor:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbor\n\t.type\t bor,function\n\t.thumb_func\nbor:\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t bor,.Lfe1-bor\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bor` — benchmark function synthetic:bor:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bor:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbor\n\t.type\t bor,function\n\t.thumb_func\nbor:\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t bor,.Lfe1-bor\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bor # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bor:gcc2.7.2kmc","sym":"bor","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bor(int a,int b){ return a|b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tor\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-266486f82fb4444f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 bor\n\n\nContents of section .text:\n 0000 03e00008 00851025 00000000 00000000 .......%........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bor(u32 a0, u32 a1) {\n return a0 | a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bor(s32 arg0, s32 arg1) {\n return arg0 | arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bor` — benchmark function synthetic:bor:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bor\n jr\t$ra\n or\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bor` — benchmark function synthetic:bor:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bor:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tor\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-266486f82fb4444f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 bor\n\n\nContents of section .text:\n 0000 03e00008 00851025 00000000 00000000 .......%........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bor:ido7.1","sym":"bor","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise"],"loc":1,"refSource":"int bor(int a,int b){ return a|b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tor\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 bor\n\n\nContents of section .text:\n 0000 03e00008 00851025 00000000 00000000 .......%........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 36363438 36663832 66623434 ef-266486f82fb44\n 0130 3434662f 7265662e 6300626f 72000000 44f/ref.c.bor...\n 0140 626f7200 00000000 00000001 00000000 bor.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bor(u32 a0, u32 a1) {\n return a0 | a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bor(s32 arg0, s32 arg1) {\n return arg0 | arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bor` — benchmark function synthetic:bor:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bor\n jr\t$ra\n or\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bor` — benchmark function synthetic:bor:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bor:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tor\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 bor\n\n\nContents of section .text:\n 0000 03e00008 00851025 00000000 00000000 .......%........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 36363438 36663832 66623434 ef-266486f82fb44\n 0130 3434662f 7265662e 6300626f 72000000 44f/ref.c.bor...\n 0140 626f7200 00000000 00000001 00000000 bor.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bor:mwcc_242_81","sym":"bor","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bor(int a,int b){ return a|b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tor r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 bor\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bor\n\n\nContents of section .text:\n 0000 7c632378 4e800020 |c#xN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bor(u32 a0, u32 a1) {\n return a0 | a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bor(s32 arg0, s32 arg1) {\n return arg0 | arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bor` — benchmark function synthetic:bor:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bor\n or r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bor` — benchmark function synthetic:bor:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bor:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tor r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 bor\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bor\n\n\nContents of section .text:\n 0000 7c632378 4e800020 |c#xN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:breakloop:agbcc","sym":"breakloop","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for","break","memory"],"loc":1,"refSource":"int breakloop(int *a,int n){ int i; for(i=0;i= 0)) {\n var_r2 += 4;\n var_r3 += 1;\n goto loop_2;\n }\n return var_r3;\n}\n","score":7,"maxScore":15,"compileErrors":null,"breakdown":{"insert":3,"delete":3,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":88,"lines":13,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":7,"maxScore":15,"ratio":0.4666666666666667,"kinds":{"insert":3,"delete":3,"replace":0,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `breakloop` — benchmark function synthetic:breakloop:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbreakloop\n\t.type\t breakloop,function\n\t.thumb_func\nbreakloop:\n\tadd\tr2, r0, #0\n\tmov\tr3, #0x0\n\tb\t.L9\n.L5:\n\tadd\tr2, r2, #0x4\n\tadd\tr3, r3, #0x1\n.L9:\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n\tldr\tr0, [r2]\n\tcmp\tr0, #0\n\tbge\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t breakloop,.Lfe1-breakloop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function breakloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `breakloop` — benchmark function synthetic:breakloop:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:breakloop:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbreakloop\n\t.type\t breakloop,function\n\t.thumb_func\nbreakloop:\n\tadd\tr2, r0, #0\n\tmov\tr3, #0x0\n\tb\t.L9\n.L5:\n\tadd\tr2, r2, #0x4\n\tadd\tr3, r3, #0x1\n.L9:\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n\tldr\tr0, [r2]\n\tcmp\tr0, #0\n\tbge\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t breakloop,.Lfe1-breakloop\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name breakloop # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:breakloop:gcc2.7.2kmc","sym":"breakloop","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for","break","memory"],"loc":1,"refSource":"int breakloop(int *a,int n){ int i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tblez\ta1,28 \n 8:\tmove\tv1,zero\n c:\tlw\tv0,0(a0)\n 10:\tbltz\tv0,2c \n 14:\tmove\tv0,v1\n 18:\taddiu\tv1,v1,1\n 1c:\tslt\tv0,v1,a1\n 20:\tbnez\tv0,c \n 24:\taddiu\ta0,a0,4\n 28:\tmove\tv0,v1\n 2c:\tjr\tra\n 30:\taddiu\tsp,sp,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-45bfaf5f61d09bac/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 breakloop\n\n\nContents of section .text:\n 0000 27bdfff8 18a00008 00001821 8c820000 '..........!....\n 0010 04400006 00601021 24630001 0065102a .@...`.!$c...e.*\n 0020 1440fffa 24840004 00601021 03e00008 .@..$....`.!....\n 0030 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 breakloop(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n if (a1 > 0) {\n v0 = a0;\n v1 = 0;\n while (*v0 >= 0) {\n v1 = v1 + 1;\n v0 = v0 + 1;\n if (v1 >= a1) return v1;\n }\n return v1;\n } else {\n v1 = 0;\n return v1;\n }\n}\n","score":11,"maxScore":16,"compileErrors":null,"breakdown":{"insert":3,"delete":1,"replace":2,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 breakloop(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 var_v0;\n s32 var_v1;\n\n var_a0 = arg0;\n var_v1 = 0;\n if (arg1 > 0) {\nloop_1:\n var_v0 = var_v1;\n if (*var_a0 >= 0) {\n var_v1 += 1;\n var_a0 += 4;\n if (var_v1 >= arg1) {\n goto block_3;\n }\n goto loop_1;\n }\n } else {\nblock_3:\n var_v0 = var_v1;\n }\n return var_v0;\n}\n","score":5,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":76,"lines":23,"gotos":2,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":5,"maxScore":13,"ratio":0.38461538461538464,"kinds":{"insert":0,"delete":2,"replace":2,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `breakloop` — benchmark function synthetic:breakloop:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel breakloop\n addiu\t$sp, $sp, -8\n blez\t$a1, .L28\n move\t$v1, $zero\n.Lc:\n lw\t$v0, 0($a0)\n bltz\t$v0, .L2c\n move\t$v0, $v1\n addiu\t$v1, $v1, 1\n slt\t$v0, $v1, $a1\n bnez\t$v0, .Lc\n addiu\t$a0, $a0, 4\n.L28:\n move\t$v0, $v1\n.L2c:\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function breakloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `breakloop` — benchmark function synthetic:breakloop:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:breakloop:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tblez\ta1,28 \n 8:\tmove\tv1,zero\n c:\tlw\tv0,0(a0)\n 10:\tbltz\tv0,2c \n 14:\tmove\tv0,v1\n 18:\taddiu\tv1,v1,1\n 1c:\tslt\tv0,v1,a1\n 20:\tbnez\tv0,c \n 24:\taddiu\ta0,a0,4\n 28:\tmove\tv0,v1\n 2c:\tjr\tra\n 30:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-45bfaf5f61d09bac/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 breakloop\n\n\nContents of section .text:\n 0000 27bdfff8 18a00008 00001821 8c820000 '..........!....\n 0010 04400006 00601021 24630001 0065102a .@...`.!$c...e.*\n 0020 1440fffa 24840004 00601021 03e00008 .@..$....`.!....\n 0030 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name breakloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:breakloop:ido7.1","sym":"breakloop","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for","break","memory"],"loc":1,"refSource":"int breakloop(int *a,int n){ int i; for(i=0;i:\n 0:\tblez\ta1,24 \n 4:\tmove\tv1,zero\n 8:\tmove\tv0,a0\n c:\tlw\tt6,0(v0)\n 10:\tbltz\tt6,24 \n 14:\tnop\n 18:\taddiu\tv1,v1,1\n 1c:\tbne\tv1,a1,c \n 20:\taddiu\tv0,v0,4\n 24:\tjr\tra\n 28:\tmove\tv0,v1\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c breakloop\n\n\nContents of section .text:\n 0000 18a00008 00001825 00801025 8c4e0000 .......%...%.N..\n 0010 05c00004 00000000 24630001 1465fffb ........$c...e..\n 0020 24420004 03e00008 00601025 00000000 $B.......`.%....\nContents of section .options:\n 0000 01200000 00000000 8000403c 00000000 . ........@<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000403c 00000000 00000000 00000000 ..@<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000004 00000198 p...............\n 0010 00000005 000002e0 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 0000000c 0000027c 00000001 00000288 .......|........\n 0050 00000000 00000000 00000001 000002d0 ................\n 0060 08010000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000002c 20200001 00000001 ......., ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 35626661 66356636 31643039 ef-45bfaf5f61d09\n 0130 6261632f 7265662e 63006272 65616b6c bac/ref.c.breakl\n 0140 6f6f7000 62726561 6b6c6f6f 70000000 oop.breakloop...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 0000000b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000002 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 breakloop(s32 * a0, u32 a1) {\n s32 v0;\n if (a1 <= 0) {\n v0 = 0;\n } else {\n v0 = 0;\n while (*a0 >= 0) {\n v0 = v0 + 1;\n a0 = a0 + 1;\n if (v0 == a1) break;\n }\n }\n return v0;\n}\n","score":11,"maxScore":16,"compileErrors":null,"breakdown":{"insert":5,"delete":0,"replace":3,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 breakloop(s32 *arg0, s32 arg1) {\n s32 *var_v0;\n s32 var_v1;\n\n var_v1 = 0;\n if (arg1 > 0) {\n var_v0 = arg0;\nloop_2:\n if (*var_v0 >= 0) {\n var_v1 += 1;\n var_v0 += 4;\n if (var_v1 != arg1) {\n goto loop_2;\n }\n }\n }\n return var_v1;\n}\n","score":1,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":88,"lines":17,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":1,"maxScore":11,"ratio":0.09090909090909091,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `breakloop` — benchmark function synthetic:breakloop:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel breakloop\n blez\t$a1, .L24\n move\t$v1, $zero\n move\t$v0, $a0\n.Lc:\n lw\t$t6, 0($v0)\n bltz\t$t6, .L24\n nop\n addiu\t$v1, $v1, 1\n bne\t$v1, $a1, .Lc\n addiu\t$v0, $v0, 4\n.L24:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function breakloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `breakloop` — benchmark function synthetic:breakloop:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:breakloop:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta1,24 \n 4:\tmove\tv1,zero\n 8:\tmove\tv0,a0\n c:\tlw\tt6,0(v0)\n 10:\tbltz\tt6,24 \n 14:\tnop\n 18:\taddiu\tv1,v1,1\n 1c:\tbne\tv1,a1,c \n 20:\taddiu\tv0,v0,4\n 24:\tjr\tra\n 28:\tmove\tv0,v1\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c breakloop\n\n\nContents of section .text:\n 0000 18a00008 00001825 00801025 8c4e0000 .......%...%.N..\n 0010 05c00004 00000000 24630001 1465fffb ........$c...e..\n 0020 24420004 03e00008 00601025 00000000 $B.......`.%....\nContents of section .options:\n 0000 01200000 00000000 8000403c 00000000 . ........@<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000403c 00000000 00000000 00000000 ..@<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000004 00000198 p...............\n 0010 00000005 000002e0 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 0000000c 0000027c 00000001 00000288 .......|........\n 0050 00000000 00000000 00000001 000002d0 ................\n 0060 08010000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000002c 20200001 00000001 ......., ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 35626661 66356636 31643039 ef-45bfaf5f61d09\n 0130 6261632f 7265662e 63006272 65616b6c bac/ref.c.breakl\n 0140 6f6f7000 62726561 6b6c6f6f 70000000 oop.breakloop...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 0000000b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000002 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name breakloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:breakloop:mwcc_242_81","sym":"breakloop","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for","break","memory"],"loc":1,"refSource":"int breakloop(int *a,int n){ int i; for(i=0;i:\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r0,0(r3)\n 14:\tcmpwi r0,0\n 18:\tblt 28 \n 1c:\taddi r3,r3,4\n 20:\taddi r5,r5,1\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 breakloop\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 breakloop\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80030000 2c000000 41800010 38630004 ....,...A...8c..\n 0020 38a50001 4200ffec 7ca32b78 4e800020 8...B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 breakloop(s32 * a0, u32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 <= 0) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n while (*v0 >= 0) {\n v0 = v0 + 1;\n v1 = v1 + 1;\n v2 = v2 - 1;\n if (v2 == 0) break;\n }\n }\n return v1;\n}\n","score":16,"maxScore":20,"compileErrors":null,"breakdown":{"insert":8,"delete":5,"replace":1,"opMismatch":2,"argMismatch":0},"quality":{"score":100,"lines":19,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 breakloop(s32 *arg0, s32 arg1) {\n s32 *var_r3;\n s32 var_ctr;\n s32 var_r5;\n\n var_r3 = arg0;\n var_r5 = 0;\n var_ctr = arg1;\n if (arg1 > 0) {\nloop_1:\n if ((s32) *var_r3 >= 0) {\n var_r3 += 4;\n var_r5 += 1;\n var_ctr -= 1;\n if (var_ctr != 0) {\n goto loop_1;\n }\n }\n }\n return var_r5;\n}\n","score":6,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":88,"lines":20,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":14,"ratio":0.42857142857142855,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `breakloop` — benchmark function synthetic:breakloop:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel breakloop\n li r5,0\n mtctr r4\n cmpwi r4,0\n ble .L28\n.L10:\n lwz r0,0(r3)\n cmpwi r0,0\n blt .L28\n addi r3,r3,4\n addi r5,r5,1\n bdnz .L10\n.L28:\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function breakloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `breakloop` — benchmark function synthetic:breakloop:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:breakloop:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r0,0(r3)\n 14:\tcmpwi r0,0\n 18:\tblt 28 \n 1c:\taddi r3,r3,4\n 20:\taddi r5,r5,1\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 breakloop\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 breakloop\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80030000 2c000000 41800010 38630004 ....,...A...8c..\n 0020 38a50001 4200ffec 7ca32b78 4e800020 8...B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name breakloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bxor:agbcc","sym":"bxor","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bxor(int a,int b){ return a^b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbxor\n\t.type\t bxor,function\n\t.thumb_func\nbxor:\n\teor\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t bxor,.Lfe1-bxor\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bxor(u32 a0, u32 a1) {\n return a0 ^ a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bxor(s32 arg0, s32 arg1) {\n return arg0 ^ arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bxor` — benchmark function synthetic:bxor:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbxor\n\t.type\t bxor,function\n\t.thumb_func\nbxor:\n\teor\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t bxor,.Lfe1-bxor\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bxor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bxor` — benchmark function synthetic:bxor:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bxor:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbxor\n\t.type\t bxor,function\n\t.thumb_func\nbxor:\n\teor\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t bxor,.Lfe1-bxor\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bxor # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bxor:gcc2.7.2kmc","sym":"bxor","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bxor(int a,int b){ return a^b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\txor\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-51c0e01b7c069610/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 bxor\n\n\nContents of section .text:\n 0000 03e00008 00851026 00000000 00000000 .......&........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bxor(u32 a0, u32 a1) {\n return a0 ^ a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bxor(s32 arg0, s32 arg1) {\n return arg0 ^ arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bxor` — benchmark function synthetic:bxor:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bxor\n jr\t$ra\n xor\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bxor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bxor` — benchmark function synthetic:bxor:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bxor:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\txor\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-51c0e01b7c069610/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 bxor\n\n\nContents of section .text:\n 0000 03e00008 00851026 00000000 00000000 .......&........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bxor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bxor:ido7.1","sym":"bxor","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise"],"loc":1,"refSource":"int bxor(int a,int b){ return a^b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\txor\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 bxor\n\n\nContents of section .text:\n 0000 03e00008 00851026 00000000 00000000 .......&........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 31633065 30316237 63303639 ef-51c0e01b7c069\n 0130 3631302f 7265662e 63006278 6f720000 610/ref.c.bxor..\n 0140 62786f72 00000000 00000000 00000001 bxor............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bxor(u32 a0, u32 a1) {\n return a0 ^ a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bxor(s32 arg0, s32 arg1) {\n return arg0 ^ arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bxor` — benchmark function synthetic:bxor:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bxor\n jr\t$ra\n xor\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bxor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bxor` — benchmark function synthetic:bxor:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bxor:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\txor\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 bxor\n\n\nContents of section .text:\n 0000 03e00008 00851026 00000000 00000000 .......&........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 31633065 30316237 63303639 ef-51c0e01b7c069\n 0130 3631302f 7265662e 63006278 6f720000 610/ref.c.bxor..\n 0140 62786f72 00000000 00000000 00000001 bxor............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bxor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bxor:mwcc_242_81","sym":"bxor","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bxor(int a,int b){ return a^b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\txor r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 bxor\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bxor\n\n\nContents of section .text:\n 0000 7c632278 4e800020 |c\"xN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bxor(u32 a0, u32 a1) {\n return a0 ^ a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bxor(s32 arg0, s32 arg1) {\n return arg0 ^ arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bxor` — benchmark function synthetic:bxor:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bxor\n xor r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bxor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bxor` — benchmark function synthetic:bxor:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bxor:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\txor r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 bxor\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bxor\n\n\nContents of section .text:\n 0000 7c632278 4e800020 |c\"xN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bxor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:byteidx:agbcc","sym":"byteidx","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","array","byte"],"loc":1,"refSource":"u8 byteidx(u8 *p,int i){ return p[i]; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbyteidx\n\t.type\t byteidx,function\n\t.thumb_func\nbyteidx:\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t byteidx,.Lfe1-byteidx\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 byteidx(u32 a0, u32 a1) {\n return *(u8 *)(a0 + a1);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 byteidx(s32 arg0, s32 arg1) {\n return *(arg0 + arg1);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:3: invalid type argument of `unary *'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `byteidx` — benchmark function synthetic:byteidx:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbyteidx\n\t.type\t byteidx,function\n\t.thumb_func\nbyteidx:\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t byteidx,.Lfe1-byteidx\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function byteidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `byteidx` — benchmark function synthetic:byteidx:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:byteidx:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbyteidx\n\t.type\t byteidx,function\n\t.thumb_func\nbyteidx:\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t byteidx,.Lfe1-byteidx\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name byteidx # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:byteidx:gcc2.7.2kmc","sym":"byteidx","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","array","byte"],"loc":1,"refSource":"u8 byteidx(u8 *p,int i){ return p[i]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\ta0,a0,a1\n 4:\tjr\tra\n 8:\tlbu\tv0,0(a0)\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3bae94321a85d4ab/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c byteidx\n\n\nContents of section .text:\n 0000 00852021 03e00008 90820000 00000000 .. !............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 byteidx(u32 a0, u32 a1) {\n return *(u8 *)(a0 + a1);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 byteidx(s32 arg0, s32 arg1) {\n return *(arg0 + arg1);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: invalid type argument of `unary *'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `byteidx` — benchmark function synthetic:byteidx:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel byteidx\n addu\t$a0, $a0, $a1\n jr\t$ra\n lbu\t$v0, 0($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function byteidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `byteidx` — benchmark function synthetic:byteidx:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:byteidx:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\ta0,a0,a1\n 4:\tjr\tra\n 8:\tlbu\tv0,0(a0)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3bae94321a85d4ab/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c byteidx\n\n\nContents of section .text:\n 0000 00852021 03e00008 90820000 00000000 .. !............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name byteidx # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:byteidx:ido7.1","sym":"byteidx","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","array","byte"],"loc":1,"refSource":"u8 byteidx(u8 *p,int i){ return p[i]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tt6,a0,a1\n 4:\tjr\tra\n 8:\tlbu\tv0,0(t6)\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c byteidx\n\n\nContents of section .text:\n 0000 00857021 03e00008 91c20000 00000000 ..p!............\nContents of section .options:\n 0000 01200000 00000000 80004034 00000000 . ........@4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004034 00000000 00000000 00000000 ..@4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 62616539 34333231 61383564 ef-3bae94321a85d\n 0130 3461622f 7265662e 63006279 74656964 4ab/ref.c.byteid\n 0140 78000000 62797465 69647800 00000000 x...byteidx.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000003 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 byteidx(u32 a0, u32 a1) {\n return *(u8 *)(a0 + a1);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 byteidx(s32 arg0, s32 arg1) {\n return *(arg0 + arg1);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: Dereferenced a non-pointer."]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `byteidx` — benchmark function synthetic:byteidx:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel byteidx\n addu\t$t6, $a0, $a1\n jr\t$ra\n lbu\t$v0, 0($t6)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function byteidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `byteidx` — benchmark function synthetic:byteidx:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:byteidx:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tt6,a0,a1\n 4:\tjr\tra\n 8:\tlbu\tv0,0(t6)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c byteidx\n\n\nContents of section .text:\n 0000 00857021 03e00008 91c20000 00000000 ..p!............\nContents of section .options:\n 0000 01200000 00000000 80004034 00000000 . ........@4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004034 00000000 00000000 00000000 ..@4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 62616539 34333231 61383564 ef-3bae94321a85d\n 0130 3461622f 7265662e 63006279 74656964 4ab/ref.c.byteid\n 0140 78000000 62797465 69647800 00000000 x...byteidx.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000003 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name byteidx # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:byteidx:mwcc_242_81","sym":"byteidx","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","array","byte"],"loc":1,"refSource":"u8 byteidx(u8 *p,int i){ return p[i]; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbzx r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 byteidx\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 byteidx\n\n\nContents of section .text:\n 0000 7c6320ae 4e800020 |c .N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 byteidx(u32 a0, u32 a1) {\n return *(u8 *)(a0 + a1);\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 byteidx(s32 arg0, s32 arg1) {\n return *(arg0 + arg1);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^","# pointer/array required"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `byteidx` — benchmark function synthetic:byteidx:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel byteidx\n lbzx r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function byteidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `byteidx` — benchmark function synthetic:byteidx:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:byteidx:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbzx r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 byteidx\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 byteidx\n\n\nContents of section .text:\n 0000 7c6320ae 4e800020 |c .N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name byteidx # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:call1:agbcc","sym":"call1","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["call"],"loc":2,"refSource":"int helper(int);\nint call1(int x){ return helper(x)+1; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcall1\n\t.type\t call1,function\n\t.thumb_func\ncall1:\n\tpush\t{lr}\n\tbl\thelper\n\tadd\tr0, r0, #0x1\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t call1,.Lfe1-call1\n","ctx":"int helper(int);","proto":{"helper":{"params":1}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 call1(u32 a0) {\n return helper(a0) + 1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 call1(s32 arg0) {\n return helper(arg0) + 1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `call1` — benchmark function synthetic:call1:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcall1\n\t.type\t call1,function\n\t.thumb_func\ncall1:\n\tpush\t{lr}\n\tbl\thelper\n\tadd\tr0, r0, #0x1\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t call1,.Lfe1-call1\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint helper(int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function call1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `call1` — benchmark function synthetic:call1:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:call1:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcall1\n\t.type\t call1,function\n\t.thumb_func\ncall1:\n\tpush\t{lr}\n\tbl\thelper\n\tadd\tr0, r0, #0x1\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t call1,.Lfe1-call1\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"helper\": {\n \"params\": 1\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name call1 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:call1:gcc2.7.2kmc","sym":"call1","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["call"],"loc":2,"refSource":"int helper(int);\nint call1(int x){ return helper(x)+1; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tlw\tra,16(sp)\n 14:\taddiu\tv0,v0,1\n 18:\tjr\tra\n 1c:\taddiu\tsp,sp,24\n","ctx":"int helper(int);","proto":{"helper":{"params":1}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4d0f99dd30f96a0c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 call1\n00000000 *UND*\t00000000 helper\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 helper\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 8fbf0010 24420001 03e00008 27bd0018 ....$B......'...\nContents of section .reginfo:\n 0000 a0000004 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'call1' — lift: cannot lift 'call1': function call 'jal' at 0x8 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tjal\t0 */\n/* c:\tnop */\n/* 10:\tlw\tra,16(sp) */\n/* 14:\taddiu\tv0,v0,1 */\n/* 18:\tjr\tra */\n/* 1c:\taddiu\tsp,sp,24 */\nvoid call1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'call1': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'call1': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 call1(s32 arg0) {\n return helper(arg0) + 1;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `call1` — benchmark function synthetic:call1:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel call1\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\thelper\n nop\n lw\t$ra, 16($sp)\n addiu\t$v0, $v0, 1\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint helper(int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function call1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `call1` — benchmark function synthetic:call1:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:call1:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tlw\tra,16(sp)\n 14:\taddiu\tv0,v0,1\n 18:\tjr\tra\n 1c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4d0f99dd30f96a0c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 call1\n00000000 *UND*\t00000000 helper\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 helper\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 8fbf0010 24420001 03e00008 27bd0018 ....$B......'...\nContents of section .reginfo:\n 0000 a0000004 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"helper\": {\n \"params\": 1\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name call1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:call1:mwcc_242_81","sym":"call1","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["call"],"loc":2,"refSource":"int helper(int);\nint call1(int x){ return helper(x)+1; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\thelper\n 10:\tlwz r0,20(r1)\n 14:\taddi r3,r3,1\n 18:\tmtlr r0\n 1c:\taddi r1,r1,16\n 20:\tblr\n","ctx":"int helper(int);","proto":{"helper":{"params":1}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 helper\n00000000 g F .text\t00000024 call1\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 helper\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 call1\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 38630001 7c0803a6 38210010 ....8c..|...8!..\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000004 00000000 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 call1(u32 a0) {\n return helper(a0) + 1;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 call1(s32 arg0) {\n return helper(arg0) + 1;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `call1` — benchmark function synthetic:call1:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel call1\n stwu r1,-16(r1)\n mflr r0\n stw r0,20(r1)\n bl helper\n lwz r0,20(r1)\n addi r3,r3,1\n mtlr r0\n addi r1,r1,16\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint helper(int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function call1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `call1` — benchmark function synthetic:call1:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:call1:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\thelper\n 10:\tlwz r0,20(r1)\n 14:\taddi r3,r3,1\n 18:\tmtlr r0\n 1c:\taddi r1,r1,16\n 20:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 helper\n00000000 g F .text\t00000024 call1\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 helper\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 call1\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 38630001 7c0803a6 38210010 ....8c..|...8!..\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000004 00000000 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"helper\": {\n \"params\": 1\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name call1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:call2:agbcc","sym":"call2","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["call","multi-arg"],"loc":2,"refSource":"int add3(int,int,int);\nint call2(int a,int b){ return add3(a,b,a+b); }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcall2\n\t.type\t call2,function\n\t.thumb_func\ncall2:\n\tpush\t{lr}\n\tadd\tr2, r0, r1\n\tbl\tadd3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t call2,.Lfe1-call2\n","ctx":"int add3(int,int,int);","proto":{"add3":{"params":3}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 call2(u32 a0, u32 a1) {\n return add3(a0, a1, a0 + a1);\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void call2(s32 arg0, s32 arg1) {\n add3(arg0, arg1, arg0 + arg1);\n}\n","score":2,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `call2` — benchmark function synthetic:call2:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcall2\n\t.type\t call2,function\n\t.thumb_func\ncall2:\n\tpush\t{lr}\n\tadd\tr2, r0, r1\n\tbl\tadd3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t call2,.Lfe1-call2\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint add3(int,int,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function call2 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `call2` — benchmark function synthetic:call2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:call2:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcall2\n\t.type\t call2,function\n\t.thumb_func\ncall2:\n\tpush\t{lr}\n\tadd\tr2, r0, r1\n\tbl\tadd3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t call2,.Lfe1-call2\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add3\": {\n \"params\": 3\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name call2 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:call2:gcc2.7.2kmc","sym":"call2","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["call","multi-arg"],"loc":2,"refSource":"int add3(int,int,int);\nint call2(int a,int b){ return add3(a,b,a+b); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\taddu\ta2,a0,a1\n 10:\tlw\tra,16(sp)\n 14:\tjr\tra\n 18:\taddiu\tsp,sp,24\n 1c:\tnop\n","ctx":"int add3(int,int,int);","proto":{"add3":{"params":3}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-57adb8eccd0715dd/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c call2\n00000000 *UND*\t00000000 add3\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 add3\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00853021 '.............0!\n 0010 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a0000070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'call2' — lift: cannot lift 'call2': function call 'jal' at 0x8 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tjal\t0 */\n/* c:\taddu\ta2,a0,a1 */\n/* 10:\tlw\tra,16(sp) */\n/* 14:\tjr\tra */\n/* 18:\taddiu\tsp,sp,24 */\n/* 1c:\tnop */\nvoid call2(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'call2': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'call2': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void call2(s32 arg0, s32 arg1) {\n add3(arg0, arg1, arg0 + arg1);\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `call2` — benchmark function synthetic:call2:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel call2\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tadd3\n addu\t$a2, $a0, $a1\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint add3(int,int,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function call2 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `call2` — benchmark function synthetic:call2:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:call2:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\taddu\ta2,a0,a1\n 10:\tlw\tra,16(sp)\n 14:\tjr\tra\n 18:\taddiu\tsp,sp,24\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-57adb8eccd0715dd/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c call2\n00000000 *UND*\t00000000 add3\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 add3\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00853021 '.............0!\n 0010 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a0000070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add3\": {\n \"params\": 3\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name call2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:call2:mwcc_242_81","sym":"call2","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["call","multi-arg"],"loc":2,"refSource":"int add3(int,int,int);\nint call2(int a,int b){ return add3(a,b,a+b); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tadd r5,r3,r4\n c:\tstw r0,20(r1)\n 10:\tbl 10 \n\t\t\t10: R_PPC_REL24\tadd3\n 14:\tlwz r0,20(r1)\n 18:\tmtlr r0\n 1c:\taddi r1,r1,16\n 20:\tblr\n","ctx":"int add3(int,int,int);","proto":{"add3":{"params":3}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 add3\n00000000 g F .text\t00000024 call2\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_PPC_REL24 add3\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 call2\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 7ca32214 90010014 .!..|...|.\".....\n 0010 48000001 80010014 7c0803a6 38210010 H.......|...8!..\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000004 00000000 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 call2(u32 a0, u32 a1) {\n return add3(a0, a1, a0 + a1);\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void call2(s32 arg0, s32 arg1) {\n add3(arg0, arg1, arg0 + arg1);\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `call2` — benchmark function synthetic:call2:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel call2\n stwu r1,-16(r1)\n mflr r0\n add r5,r3,r4\n stw r0,20(r1)\n bl add3\n lwz r0,20(r1)\n mtlr r0\n addi r1,r1,16\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint add3(int,int,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function call2 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `call2` — benchmark function synthetic:call2:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:call2:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tadd r5,r3,r4\n c:\tstw r0,20(r1)\n 10:\tbl 10 \n\t\t\t10: R_PPC_REL24\tadd3\n 14:\tlwz r0,20(r1)\n 18:\tmtlr r0\n 1c:\taddi r1,r1,16\n 20:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 add3\n00000000 g F .text\t00000024 call2\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_PPC_REL24 add3\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 call2\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 7ca32214 90010014 .!..|...|.\".....\n 0010 48000001 80010014 7c0803a6 38210010 H.......|...8!..\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000004 00000000 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add3\": {\n \"params\": 3\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name call2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clamp0:agbcc","sym":"clamp0","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","branch"],"loc":1,"refSource":"int clamp0(int x){ if(x<0) return 0; return x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclamp0\n\t.type\t clamp0,function\n\t.thumb_func\nclamp0:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t clamp0,.Lfe1-clamp0\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 clamp0(s32 a0) {\n if (a0 < 0) a0 = 0;\n return a0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clamp0(s32 arg0) {\n s32 var_r0;\n\n var_r0 = arg0;\n if (var_r0 < 0) {\n var_r0 = 0;\n }\n return var_r0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clamp0` — benchmark function synthetic:clamp0:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclamp0\n\t.type\t clamp0,function\n\t.thumb_func\nclamp0:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t clamp0,.Lfe1-clamp0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clamp0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clamp0` — benchmark function synthetic:clamp0:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clamp0:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclamp0\n\t.type\t clamp0,function\n\t.thumb_func\nclamp0:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t clamp0,.Lfe1-clamp0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clamp0 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clamp0:gcc2.7.2kmc","sym":"clamp0","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","branch"],"loc":1,"refSource":"int clamp0(int x){ if(x<0) return 0; return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnor\tv0,zero,a0\n 4:\tsra\tv0,v0,0x1f\n 8:\tjr\tra\n c:\tand\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-31f15d35e4cb0535/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 clamp0\n\n\nContents of section .text:\n 0000 00041027 000217c3 03e00008 00821024 ...'...........$\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 clamp0(s32 a0) {\n return a0 & ~a0 >> 31;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clamp0(s32 arg0) {\n return arg0 & ((s32) ~arg0 >> 0x1F);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clamp0` — benchmark function synthetic:clamp0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clamp0\n nor\t$v0, $zero, $a0\n sra\t$v0, $v0, 0x1f\n jr\t$ra\n and\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clamp0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clamp0` — benchmark function synthetic:clamp0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clamp0:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnor\tv0,zero,a0\n 4:\tsra\tv0,v0,0x1f\n 8:\tjr\tra\n c:\tand\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-31f15d35e4cb0535/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 clamp0\n\n\nContents of section .text:\n 0000 00041027 000217c3 03e00008 00821024 ...'...........$\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clamp0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clamp0:ido7.1","sym":"clamp0","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","branch"],"loc":1,"refSource":"int clamp0(int x){ if(x<0) return 0; return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tmove\tv0,a0\n 8:\tjr\tra\n c:\tmove\tv0,zero\n 10:\tjr\tra\n 14:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 clamp0\n\n\nContents of section .text:\n 0000 04810003 00801025 03e00008 00001025 .......%.......%\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 31663135 64333565 34636230 ef-31f15d35e4cb0\n 0130 3533352f 7265662e 6300636c 616d7030 535/ref.c.clamp0\n 0140 00000000 636c616d 70300000 00000000 ....clamp0......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000006 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 clamp0(s32 a0) {\n if (a0 < 0) {\n return 0;\n } else {\n return a0;\n }\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clamp0(s32 arg0) {\n if (arg0 < 0) {\n return 0;\n }\n return arg0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clamp0` — benchmark function synthetic:clamp0:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clamp0\n bgez\t$a0, .L10\n move\t$v0, $a0\n jr\t$ra\n move\t$v0, $zero\n.L10:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clamp0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clamp0` — benchmark function synthetic:clamp0:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clamp0:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tmove\tv0,a0\n 8:\tjr\tra\n c:\tmove\tv0,zero\n 10:\tjr\tra\n 14:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 clamp0\n\n\nContents of section .text:\n 0000 04810003 00801025 03e00008 00001025 .......%.......%\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 31663135 64333565 34636230 ef-31f15d35e4cb0\n 0130 3533352f 7265662e 6300636c 616d7030 535/ref.c.clamp0\n 0140 00000000 636c616d 70300000 00000000 ....clamp0......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000006 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clamp0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clamp0:mwcc_242_81","sym":"clamp0","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","branch"],"loc":1,"refSource":"int clamp0(int x){ if(x<0) return 0; return x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrawi r0,r3,31\n 4:\tandc r3,r3,r0\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c clamp0\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clamp0\n\n\nContents of section .text:\n 0000 7c60fe70 7c630078 4e800020 |`.p|c.xN.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 clamp0(s32 a0) {\n return a0 & ~(a0 >> 31);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clamp0(s32 arg0) {\n return arg0 & ~(arg0 >> 0x1F);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clamp0` — benchmark function synthetic:clamp0:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clamp0\n srawi r0,r3,31\n andc r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clamp0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clamp0` — benchmark function synthetic:clamp0:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clamp0:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrawi r0,r3,31\n 4:\tandc r3,r3,r0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c clamp0\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clamp0\n\n\nContents of section .text:\n 0000 7c60fe70 7c630078 4e800020 |`.p|c.xN.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clamp0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampr:agbcc","sym":"clampr","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampr(int x,int lo,int hi){ if(xhi)x=hi; return x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclampr\n\t.type\t clampr,function\n\t.thumb_func\nclampr:\n\tcmp\tr0, r1\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r1, #0\n.L3:\n\tcmp\tr0, r2\n\tble\t.L4\t@cond_branch\n\tadd\tr0, r2, #0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t clampr,.Lfe1-clampr\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 clampr(s32 a0, s32 a1, s32 a2) {\n if (a0 < a1) a0 = a1;\n if (a0 > a2) a0 = a2;\n return a0;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clampr(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r0;\n\n var_r0 = arg0;\n if (var_r0 < arg1) {\n var_r0 = arg1;\n }\n if (var_r0 > arg2) {\n var_r0 = arg2;\n }\n return var_r0;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampr` — benchmark function synthetic:clampr:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclampr\n\t.type\t clampr,function\n\t.thumb_func\nclampr:\n\tcmp\tr0, r1\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r1, #0\n.L3:\n\tcmp\tr0, r2\n\tble\t.L4\t@cond_branch\n\tadd\tr0, r2, #0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t clampr,.Lfe1-clampr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampr` — benchmark function synthetic:clampr:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampr:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclampr\n\t.type\t clampr,function\n\t.thumb_func\nclampr:\n\tcmp\tr0, r1\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r1, #0\n.L3:\n\tcmp\tr0, r2\n\tble\t.L4\t@cond_branch\n\tadd\tr0, r2, #0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t clampr,.Lfe1-clampr\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampr # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampr:gcc2.7.2kmc","sym":"clampr","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampr(int x,int lo,int hi){ if(xhi)x=hi; return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tslt\tv0,a2,a0\n 10:\tbnezl\tv0,18 \n 14:\tmove\ta0,a2\n 18:\tjr\tra\n 1c:\tmove\tv0,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-83ad7d8b72cf4215/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 clampr\n\n\nContents of section .text:\n 0000 0085102a 54400001 00a02021 00c4102a ...*T@.... !...*\n 0010 54400001 00c02021 03e00008 00801021 T@.... !.......!\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'clampr' — lift: cannot lift 'clampr': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tslt\tv0,a0,a1 */\n/* 4:\tbnezl\tv0,c */\n/* 8:\tmove\ta0,a1 */\n/* c:\tslt\tv0,a2,a0 */\n/* 10:\tbnezl\tv0,18 */\n/* 14:\tmove\ta0,a2 */\n/* 18:\tjr\tra */\n/* 1c:\tmove\tv0,a0 */\nvoid clampr(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'clampr': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'clampr': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clampr(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_a0;\n\n var_a0 = arg0;\n if (var_a0 < arg1) {\n var_a0 = arg1;\n }\n if (arg2 < var_a0) {\n var_a0 = arg2;\n }\n return var_a0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampr` — benchmark function synthetic:clampr:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clampr\n slt\t$v0, $a0, $a1\n bnezl\t$v0, .Lc\n move\t$a0, $a1\n.Lc:\n slt\t$v0, $a2, $a0\n bnezl\t$v0, .L18\n move\t$a0, $a2\n.L18:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampr` — benchmark function synthetic:clampr:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampr:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tslt\tv0,a2,a0\n 10:\tbnezl\tv0,18 \n 14:\tmove\ta0,a2\n 18:\tjr\tra\n 1c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-83ad7d8b72cf4215/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 clampr\n\n\nContents of section .text:\n 0000 0085102a 54400001 00a02021 00c4102a ...*T@.... !...*\n 0010 54400001 00c02021 03e00008 00801021 T@.... !.......!\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampr:ido7.1","sym":"clampr","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampr(int x,int lo,int hi){ if(xhi)x=hi; return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a0,a1\n 4:\tbeqzl\tat,14 \n 8:\tslt\tat,a2,a0\n c:\tmove\ta0,a1\n 10:\tslt\tat,a2,a0\n 14:\tbeqz\tat,20 \n 18:\tnop\n 1c:\tmove\ta0,a2\n 20:\tjr\tra\n 24:\tmove\tv0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 clampr\n\n\nContents of section .text:\n 0000 0085082a 50200003 00c4082a 00a02025 ...*P .....*.. %\n 0010 00c4082a 10200002 00000000 00c02025 ...*. ........ %\n 0020 03e00008 00801025 00000000 00000000 .......%........\nContents of section .options:\n 0000 01200000 00000000 80000076 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002dc 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 00000008 0000027c 00000001 00000284 .......|........\n 0050 00000000 00000000 00000001 000002cc ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 33616437 64386237 32636634 ef-83ad7d8b72cf4\n 0130 3231352f 7265662e 6300636c 616d7072 215/ref.c.clampr\n 0140 00000000 636c616d 70720000 00000000 ....clampr......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 0000000a 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'clampr' — lift: cannot lift 'clampr': unmodelled control transfer 'beqzl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tslt\tat,a0,a1 */\n/* 4:\tbeqzl\tat,14 */\n/* 8:\tslt\tat,a2,a0 */\n/* c:\tmove\ta0,a1 */\n/* 10:\tslt\tat,a2,a0 */\n/* 14:\tbeqz\tat,20 */\n/* 18:\tnop */\n/* 1c:\tmove\ta0,a2 */\n/* 20:\tjr\tra */\n/* 24:\tmove\tv0,a0 */\n/* \t... */\nvoid clampr(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'clampr': unmodelled control transfer 'beqzl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":19,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'clampr': unmodelled control transfer 'beqzl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 clampr(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_a0;\n\n var_a0 = arg0;\n if (var_a0 < arg1) {\n var_a0 = arg1;\n }\n if (arg2 < var_a0) {\n var_a0 = arg2;\n }\n return var_a0;\n}\n","score":6,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":2,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":10,"ratio":0.6,"kinds":{"insert":0,"delete":0,"replace":2,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampr` — benchmark function synthetic:clampr:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clampr\n slt\t$at, $a0, $a1\n beqzl\t$at, .L14\n slt\t$at, $a2, $a0\n move\t$a0, $a1\n slt\t$at, $a2, $a0\n.L14:\n beqz\t$at, .L20\n nop\n move\t$a0, $a2\n.L20:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampr` — benchmark function synthetic:clampr:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampr:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a0,a1\n 4:\tbeqzl\tat,14 \n 8:\tslt\tat,a2,a0\n c:\tmove\ta0,a1\n 10:\tslt\tat,a2,a0\n 14:\tbeqz\tat,20 \n 18:\tnop\n 1c:\tmove\ta0,a2\n 20:\tjr\tra\n 24:\tmove\tv0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 clampr\n\n\nContents of section .text:\n 0000 0085082a 50200003 00c4082a 00a02025 ...*P .....*.. %\n 0010 00c4082a 10200002 00000000 00c02025 ...*. ........ %\n 0020 03e00008 00801025 00000000 00000000 .......%........\nContents of section .options:\n 0000 01200000 00000000 80000076 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002dc 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 00000008 0000027c 00000001 00000284 .......|........\n 0050 00000000 00000000 00000001 000002cc ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 33616437 64386237 32636634 ef-83ad7d8b72cf4\n 0130 3231352f 7265662e 6300636c 616d7072 215/ref.c.clampr\n 0140 00000000 636c616d 70720000 00000000 ....clampr......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 0000000a 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampr:mwcc_242_81","sym":"clampr","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampr(int x,int lo,int hi){ if(xhi)x=hi; return x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tbge c \n 8:\tmr r3,r4\n c:\tcmpw r3,r5\n 10:\tblelr\n 14:\tmr r3,r5\n 18:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c clampr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clampr\n\n\nContents of section .text:\n 0000 7c032000 40800008 7c832378 7c032800 |. .@...|.#x|.(.\n 0010 4c810020 7ca32b78 4e800020 L.. |.+xN.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 clampr(s32 a0, s32 a1, s32 a2) {\n if (a0 < a1) a0 = a1;\n if (a0 > a2) {\n return a2;\n } else {\n return a0;\n }\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clampr(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r3;\n\n var_r3 = arg0;\n if (var_r3 < arg1) {\n var_r3 = arg1;\n }\n if (var_r3 > arg2) {\n return arg2;\n }\n return var_r3;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampr` — benchmark function synthetic:clampr:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clampr\n cmpw r3,r4\n bge .Lc\n mr r3,r4\n.Lc:\n cmpw r3,r5\n blelr\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampr` — benchmark function synthetic:clampr:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampr:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tbge c \n 8:\tmr r3,r4\n c:\tcmpw r3,r5\n 10:\tblelr\n 14:\tmr r3,r5\n 18:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c clampr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clampr\n\n\nContents of section .text:\n 0000 7c032000 40800008 7c832378 7c032800 |. .@...|.#x|.(.\n 0010 4c810020 7ca32b78 4e800020 L.. |.+xN.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampu8:agbcc","sym":"clampu8","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampu8(int x){ if(x<0)return 0; if(x>255)return 255; return x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclampu8\n\t.type\t clampu8,function\n\t.thumb_func\nclampu8:\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L5\n.L3:\n\tcmp\tr0, #0xff\n\tble\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t clampu8,.Lfe1-clampu8\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 clampu8(u32 a0) {\n if (a0 >= 0) {\n if (a0 > 255) a0 = 255;\n } else {\n a0 = 0;\n }\n return a0;\n}\n","score":7,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clampu8(s32 arg0) {\n s32 var_r0;\n\n var_r0 = arg0;\n if (var_r0 < 0) {\n return 0;\n }\n if (var_r0 > 0xFF) {\n var_r0 = 0xFF;\n }\n return var_r0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampu8` — benchmark function synthetic:clampu8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclampu8\n\t.type\t clampu8,function\n\t.thumb_func\nclampu8:\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L5\n.L3:\n\tcmp\tr0, #0xff\n\tble\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t clampu8,.Lfe1-clampu8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampu8` — benchmark function synthetic:clampu8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampu8:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclampu8\n\t.type\t clampu8,function\n\t.thumb_func\nclampu8:\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L5\n.L3:\n\tcmp\tr0, #0xff\n\tble\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t clampu8,.Lfe1-clampu8\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampu8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampu8:gcc2.7.2kmc","sym":"clampu8","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampu8(int x){ if(x<0)return 0; if(x>255)return 255; return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tslti\tv1,a0,256\n 8:\tj\t1c \n c:\tmove\tv0,zero\n 10:\tbeqz\tv1,1c \n 14:\tli\tv0,255\n 18:\tmove\tv0,a0\n 1c:\tjr\tra\n 20:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1e97c6c02fb6dc7f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 clampu8\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 04810003 28830100 08000007 00001021 ....(..........!\n 0010 10600002 240200ff 00801021 03e00008 .`..$......!....\n 0020 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 clampu8(u32 a0) {\n if (a0 >= 0) {\n if (a0 < 256 == 0) a0 = 255;\n } else {\n a0 = 0;\n }\n return a0;\n}\n","score":8,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":3,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 clampu8(s32 arg0) {\n s32 var_v0;\n\n if (arg0 < 0) {\n return 0;\n }\n var_v0 = 0xFF;\n if (arg0 < 0x100) {\n var_v0 = arg0;\n }\n return var_v0;\n}\n","score":5,"maxScore":10,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":5,"maxScore":10,"ratio":0.5,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampu8` — benchmark function synthetic:clampu8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clampu8\n bgez\t$a0, .L10\n slti\t$v1, $a0, 256\n j\t.L1c\n move\t$v0, $zero\n.L10:\n beqz\t$v1, .L1c\n li\t$v0, 255\n move\t$v0, $a0\n.L1c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampu8` — benchmark function synthetic:clampu8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampu8:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tslti\tv1,a0,256\n 8:\tj\t1c \n c:\tmove\tv0,zero\n 10:\tbeqz\tv1,1c \n 14:\tli\tv0,255\n 18:\tmove\tv0,a0\n 1c:\tjr\tra\n 20:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1e97c6c02fb6dc7f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 clampu8\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 04810003 28830100 08000007 00001021 ....(..........!\n 0010 10600002 240200ff 00801021 03e00008 .`..$......!....\n 0020 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampu8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampu8:ido7.1","sym":"clampu8","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampu8(int x){ if(x<0)return 0; if(x>255)return 255; return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tslti\tat,a0,256\n 8:\tjr\tra\n c:\tmove\tv0,zero\n 10:\tbnez\tat,20 \n 14:\tmove\tv0,a0\n 18:\tjr\tra\n 1c:\tli\tv0,255\n 20:\tjr\tra\n 24:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 clampu8\n\n\nContents of section .text:\n 0000 04810003 28810100 03e00008 00001025 ....(..........%\n 0010 14200003 00801025 03e00008 240200ff . .....%....$...\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002dc 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 00000008 0000027c 00000001 00000284 .......|........\n 0050 00000000 00000000 00000001 000002cc ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 65393763 36633032 66623664 ef-1e97c6c02fb6d\n 0130 6337662f 7265662e 6300636c 616d7075 c7f/ref.c.clampu\n 0140 38000000 636c616d 70753800 00000000 8...clampu8.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000a 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 clampu8(s32 a0) {\n if (a0 < 0) {\n return 0;\n } else {\n if (a0 < 256 == 0) {\n return 255;\n } else {\n return a0;\n }\n }\n}\n","score":2,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clampu8(s32 arg0) {\n if (arg0 < 0) {\n return 0;\n }\n if (arg0 >= 0x100) {\n return 0xFF;\n }\n return arg0;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampu8` — benchmark function synthetic:clampu8:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clampu8\n bgez\t$a0, .L10\n slti\t$at, $a0, 256\n jr\t$ra\n move\t$v0, $zero\n.L10:\n bnez\t$at, .L20\n move\t$v0, $a0\n jr\t$ra\n li\t$v0, 255\n.L20:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampu8` — benchmark function synthetic:clampu8:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampu8:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tslti\tat,a0,256\n 8:\tjr\tra\n c:\tmove\tv0,zero\n 10:\tbnez\tat,20 \n 14:\tmove\tv0,a0\n 18:\tjr\tra\n 1c:\tli\tv0,255\n 20:\tjr\tra\n 24:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 clampu8\n\n\nContents of section .text:\n 0000 04810003 28810100 03e00008 00001025 ....(..........%\n 0010 14200003 00801025 03e00008 240200ff . .....%....$...\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002dc 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 00000008 0000027c 00000001 00000284 .......|........\n 0050 00000000 00000000 00000001 000002cc ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 65393763 36633032 66623664 ef-1e97c6c02fb6d\n 0130 6337662f 7265662e 6300636c 616d7075 c7f/ref.c.clampu\n 0140 38000000 636c616d 70753800 00000000 8...clampu8.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000a 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampu8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampu8:mwcc_242_81","sym":"clampu8","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampu8(int x){ if(x<0)return 0; if(x>255)return 255; return x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tbge 10 \n 8:\tli r3,0\n c:\tblr\n 10:\tcmpwi r3,255\n 14:\tli r0,255\n 18:\tbgt 20 \n 1c:\tmr r0,r3\n 20:\tmr r3,r0\n 24:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000028 clampu8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clampu8\n\n\nContents of section .text:\n 0000 2c030000 4080000c 38600000 4e800020 ,...@...8`..N.. \n 0010 2c0300ff 380000ff 41810008 7c601b78 ,...8...A...|`.x\n 0020 7c030378 4e800020 |..xN.. \nContents of section .mwcats.text:\n 0000 02000028 00000000 ...(.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 clampu8(s32 a0) {\n if (a0 < 0) {\n return 0;\n } else {\n if (a0 > 255) a0 = 255;\n return a0;\n }\n}\n","score":5,"maxScore":11,"compileErrors":null,"breakdown":{"insert":1,"delete":3,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clampu8(s32 arg0) {\n s32 var_r0;\n\n if (arg0 < 0) {\n return 0;\n }\n var_r0 = 0xFF;\n if (arg0 <= 0xFF) {\n var_r0 = arg0;\n }\n return var_r0;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampu8` — benchmark function synthetic:clampu8:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clampu8\n cmpwi r3,0\n bge .L10\n li r3,0\n blr\n.L10:\n cmpwi r3,255\n li r0,255\n bgt .L20\n mr r0,r3\n.L20:\n mr r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampu8` — benchmark function synthetic:clampu8:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampu8:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tbge 10 \n 8:\tli r3,0\n c:\tblr\n 10:\tcmpwi r3,255\n 14:\tli r0,255\n 18:\tbgt 20 \n 1c:\tmr r0,r3\n 20:\tmr r3,r0\n 24:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000028 clampu8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clampu8\n\n\nContents of section .text:\n 0000 2c030000 4080000c 38600000 4e800020 ,...@...8`..N.. \n 0010 2c0300ff 380000ff 41810008 7c601b78 ,...8...A...|`.x\n 0020 7c030378 4e800020 |..xN.. \nContents of section .mwcats.text:\n 0000 02000028 00000000 ...(.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampu8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clearbit:agbcc","sym":"clearbit","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int clearbit(int x,int n){ return x & ~(1< in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclearbit\n\t.type\t clearbit,function\n\t.thumb_func\nclearbit:\n\tmov\tr2, #0x1\n\tlsl\tr2, r2, r1\n\tbic\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t clearbit,.Lfe1-clearbit\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clearbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clearbit` — benchmark function synthetic:clearbit:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clearbit:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclearbit\n\t.type\t clearbit,function\n\t.thumb_func\nclearbit:\n\tmov\tr2, #0x1\n\tlsl\tr2, r2, r1\n\tbic\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t clearbit,.Lfe1-clearbit\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clearbit # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clearbit:gcc2.7.2kmc","sym":"clearbit","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int clearbit(int x,int n){ return x & ~(1<:\n 0:\tli\tv0,1\n 4:\tsllv\tv0,v0,a1\n 8:\tnor\tv0,zero,v0\n c:\tjr\tra\n 10:\tand\tv0,a0,v0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-60ad93e495830563/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 clearbit\n\n\nContents of section .text:\n 0000 24020001 00a21004 00021027 03e00008 $..........'....\n 0010 00821024 00000000 00000000 00000000 ...$............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 clearbit(u32 a0, u32 a1) {\n return a0 & ~(1 << a1);\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clearbit(s32 arg0, s32 arg1) {\n return arg0 & ~(1 << arg1);\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clearbit` — benchmark function synthetic:clearbit:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clearbit\n li\t$v0, 1\n sllv\t$v0, $v0, $a1\n nor\t$v0, $zero, $v0\n jr\t$ra\n and\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clearbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clearbit` — benchmark function synthetic:clearbit:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clearbit:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tsllv\tv0,v0,a1\n 8:\tnor\tv0,zero,v0\n c:\tjr\tra\n 10:\tand\tv0,a0,v0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-60ad93e495830563/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 clearbit\n\n\nContents of section .text:\n 0000 24020001 00a21004 00021027 03e00008 $..........'....\n 0010 00821024 00000000 00000000 00000000 ...$............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clearbit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clearbit:ido7.1","sym":"clearbit","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int clearbit(int x,int n){ return x & ~(1<:\n 0:\tli\tt6,1\n 4:\tsllv\tt7,t6,a1\n 8:\tnor\tt8,t7,zero\n c:\tjr\tra\n 10:\tand\tv0,t8,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 clearbit\n\n\nContents of section .text:\n 0000 240e0001 00ae7804 01e0c027 03e00008 $.....x....'....\n 0010 03041024 00000000 00000000 00000000 ...$............\nContents of section .options:\n 0000 01200000 00000000 8100c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002d0 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 0000000c 0000026c 00000001 00000278 .......l.......x\n 0050 00000000 00000000 00000001 000002c0 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 30616439 33653439 35383330 ef-60ad93e495830\n 0130 3536332f 7265662e 6300636c 65617262 563/ref.c.clearb\n 0140 69740000 636c6561 72626974 00000000 it..clearbit....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 00000005 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 clearbit(u32 a0, u32 a1) {\n return ~(1 << a1) & a0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clearbit(s32 arg0, s32 arg1) {\n return ~(1 << arg1) & arg0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clearbit` — benchmark function synthetic:clearbit:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clearbit\n li\t$t6, 1\n sllv\t$t7, $t6, $a1\n nor\t$t8, $t7, $zero\n jr\t$ra\n and\t$v0, $t8, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clearbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clearbit` — benchmark function synthetic:clearbit:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clearbit:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tt6,1\n 4:\tsllv\tt7,t6,a1\n 8:\tnor\tt8,t7,zero\n c:\tjr\tra\n 10:\tand\tv0,t8,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 clearbit\n\n\nContents of section .text:\n 0000 240e0001 00ae7804 01e0c027 03e00008 $.....x....'....\n 0010 03041024 00000000 00000000 00000000 ...$............\nContents of section .options:\n 0000 01200000 00000000 8100c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002d0 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 0000000c 0000026c 00000001 00000278 .......l.......x\n 0050 00000000 00000000 00000001 000002c0 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 30616439 33653439 35383330 ef-60ad93e495830\n 0130 3536332f 7265662e 6300636c 65617262 563/ref.c.clearb\n 0140 69740000 636c6561 72626974 00000000 it..clearbit....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 00000005 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clearbit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clearbit:mwcc_242_81","sym":"clearbit","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int clearbit(int x,int n){ return x & ~(1<:\n 0:\tli r0,1\n 4:\tslw r0,r0,r4\n 8:\tandc r3,r3,r0\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 clearbit\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clearbit\n\n\nContents of section .text:\n 0000 38000001 7c002030 7c630078 4e800020 8...|. 0|c.xN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 clearbit(u32 a0, u32 a1) {\n return a0 & ~(1 << a1);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clearbit(s32 arg0, s32 arg1) {\n return arg0 & ~(1 << arg1);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clearbit` — benchmark function synthetic:clearbit:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clearbit\n li r0,1\n slw r0,r0,r4\n andc r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clearbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clearbit` — benchmark function synthetic:clearbit:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clearbit:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r0,1\n 4:\tslw r0,r0,r4\n 8:\tandc r3,r3,r0\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 clearbit\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clearbit\n\n\nContents of section .text:\n 0000 38000001 7c002030 7c630078 4e800020 8...|. 0|c.xN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clearbit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:continueloop:agbcc","sym":"continueloop","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for","continue","memory"],"loc":1,"refSource":"int continueloop(int *a,int n){ int s=0,i; for(i=0;i= a1) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n do {\n if (*v0 >= 0) v1 = v1 + *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":5,"maxScore":16,"compileErrors":null,"breakdown":{"insert":3,"delete":1,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 continueloop(s32 *arg0, s32 arg1) {\n s32 *var_r0;\n s32 temp_r2;\n s32 var_r1;\n s32 var_r3;\n\n var_r0 = arg0;\n var_r1 = arg1;\n var_r3 = 0;\n if (var_r1 > 0) {\n do {\n temp_r2 = *var_r0;\n if (temp_r2 >= 0) {\n var_r3 += temp_r2;\n }\n var_r0 += 4;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n return var_r3;\n}\n","score":3,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":13,"ratio":0.23076923076923078,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `continueloop` — benchmark function synthetic:continueloop:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcontinueloop\n\t.type\t continueloop,function\n\t.thumb_func\ncontinueloop:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, #0\n\tblt\t.L5\t@cond_branch\n\tadd\tr3, r3, r2\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t continueloop,.Lfe1-continueloop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function continueloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `continueloop` — benchmark function synthetic:continueloop:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:continueloop:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcontinueloop\n\t.type\t continueloop,function\n\t.thumb_func\ncontinueloop:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, #0\n\tblt\t.L5\t@cond_branch\n\tadd\tr3, r3, r2\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t continueloop,.Lfe1-continueloop\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name continueloop # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:continueloop:gcc2.7.2kmc","sym":"continueloop","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for","continue","memory"],"loc":1,"refSource":"int continueloop(int *a,int n){ int s=0,i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,2c \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\tbgezl\tv0,1c \n 18:\taddu\tv1,v1,v0\n 1c:\taddiu\ta2,a2,1\n 20:\tslt\tv0,a2,a1\n 24:\tbnez\tv0,10 \n 28:\taddiu\ta0,a0,4\n 2c:\tmove\tv0,v1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5f5a6ee3e50ec73c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 continueloop\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00008 00001821 '.....0!.......!\n 0010 8c820000 04430001 00621821 24c60001 .....C...b.!$...\n 0020 00c5102a 1440fffa 24840004 00601021 ...*.@..$....`.!\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'continueloop' — lift: cannot lift 'continueloop': unmodelled control transfer 'bgezl' at 0x14 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-8 */\n/* 4:\tmove\ta2,zero */\n/* 8:\tblez\ta1,2c */\n/* c:\tmove\tv1,zero */\n/* 10:\tlw\tv0,0(a0) */\n/* 14:\tbgezl\tv0,1c */\n/* 18:\taddu\tv1,v1,v0 */\n/* 1c:\taddiu\ta2,a2,1 */\n/* 20:\tslt\tv0,a2,a1 */\n/* 24:\tbnez\tv0,10 */\n/* 28:\taddiu\ta0,a0,4 */\n/* 2c:\tmove\tv0,v1 */\n/* 30:\tjr\tra */\n/* 34:\taddiu\tsp,sp,8 */\n/* \t... */\nvoid continueloop(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'continueloop': unmodelled control transfer 'bgezl' at 0x14 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'continueloop': unmodelled control transfer 'bgezl' at 0x14 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 continueloop(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 temp_v0;\n s32 var_a2;\n s32 var_v1;\n\n var_a0 = arg0;\n var_a2 = 0;\n var_v1 = 0;\n if (arg1 > 0) {\n do {\n temp_v0 = *var_a0;\n if (temp_v0 >= 0) {\n var_v1 += temp_v0;\n }\n var_a2 += 1;\n var_a0 += 4;\n } while (var_a2 < arg1);\n }\n return var_v1;\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":9,"maxScore":14,"ratio":0.6428571428571429,"kinds":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `continueloop` — benchmark function synthetic:continueloop:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel continueloop\n addiu\t$sp, $sp, -8\n move\t$a2, $zero\n blez\t$a1, .L2c\n move\t$v1, $zero\n.L10:\n lw\t$v0, 0($a0)\n bgezl\t$v0, .L1c\n addu\t$v1, $v1, $v0\n.L1c:\n addiu\t$a2, $a2, 1\n slt\t$v0, $a2, $a1\n bnez\t$v0, .L10\n addiu\t$a0, $a0, 4\n.L2c:\n move\t$v0, $v1\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function continueloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `continueloop` — benchmark function synthetic:continueloop:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:continueloop:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,2c \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\tbgezl\tv0,1c \n 18:\taddu\tv1,v1,v0\n 1c:\taddiu\ta2,a2,1\n 20:\tslt\tv0,a2,a1\n 24:\tbnez\tv0,10 \n 28:\taddiu\ta0,a0,4\n 2c:\tmove\tv0,v1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5f5a6ee3e50ec73c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 continueloop\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00008 00001821 '.....0!.......!\n 0010 8c820000 04430001 00621821 24c60001 .....C...b.!$...\n 0020 00c5102a 1440fffa 24840004 00601021 ...*.@..$....`.!\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name continueloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:continueloop:ido7.1","sym":"continueloop","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for","continue","memory"],"loc":1,"refSource":"int continueloop(int *a,int n){ int s=0,i; for(i=0;i:\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,9c \n 8:\tmove\tv0,zero\n c:\tandi\ta3,a1,0x3\n 10:\tbeqz\ta3,40 \n 14:\tmove\tt0,a3\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\ta3,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\tbltz\ta3,34 \n 2c:\tnop\n 30:\taddu\tv1,v1,a3\n 34:\tbne\tt0,v0,20 \n 38:\taddiu\ta2,a2,4\n 3c:\tbeq\tv0,a1,9c \n 40:\tsll\tt7,v0,0x2\n 44:\tsll\tt8,a1,0x2\n 48:\taddu\tt0,t8,a0\n 4c:\taddu\ta2,a0,t7\n 50:\tlw\ta3,0(a2)\n 54:\tbltzl\ta3,64 \n 58:\tlw\tv0,4(a2)\n 5c:\taddu\tv1,v1,a3\n 60:\tlw\tv0,4(a2)\n 64:\tbltzl\tv0,74 \n 68:\tlw\tv0,8(a2)\n 6c:\taddu\tv1,v1,v0\n 70:\tlw\tv0,8(a2)\n 74:\tbltzl\tv0,84 \n 78:\tlw\tv0,12(a2)\n 7c:\taddu\tv1,v1,v0\n 80:\tlw\tv0,12(a2)\n 84:\taddiu\ta2,a2,16\n 88:\tbltz\tv0,94 \n 8c:\tnop\n 90:\taddu\tv1,v1,v0\n 94:\tbnel\ta2,t0,54 \n 98:\tlw\ta3,0(a2)\n 9c:\tjr\tra\n a0:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 continueloop\n\n\nContents of section .text:\n 0000 00001825 18a00025 00001025 30a70003 ...%...%...%0...\n 0010 10e0000b 00e04025 00007080 008e3021 ......@%..p...0!\n 0020 8cc70000 24420001 04e00002 00000000 ....$B..........\n 0030 00671821 1502fffa 24c60004 10450017 .g.!....$....E..\n 0040 00027880 0005c080 03044021 008f3021 ..x.......@!..0!\n 0050 8cc70000 04e20003 8cc20004 00671821 .............g.!\n 0060 8cc20004 04420003 8cc20008 00621821 .....B.......b.!\n 0070 8cc20008 04420003 8cc2000c 00621821 .....B.......b.!\n 0080 8cc2000c 24c60010 04400002 00000000 ....$....@......\n 0090 00621821 54c8ffef 8cc70000 03e00008 .b.!T...........\n 00a0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8100c1fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c1fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000008 00000228 p......).......(\n 0010 00000005 0000037c 00000001 00000230 .......|.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 0000003c 000002d8 ...........<....\n 0040 00000010 00000314 00000001 00000324 ...............$\n 0050 00000000 00000000 00000001 0000036c ...............l\n 0060 08080808 04000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000a4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d35 66356136 65653365 ps-ref-5f5a6ee3e\n 0130 35306563 3733632f 7265662e 6300636f 50ec73c/ref.c.co\n 0140 6e74696e 75656c6f 6f700000 636f6e74 ntinueloop..cont\n 0150 696e7565 6c6f6f70 00000000 00000000 inueloop........\n 0160 00000001 00000000 0000003b 00000000 ...........;....\n 0170 00000004 00000000 00000029 00000000 ...........)....\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000005 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'continueloop' — lift: cannot lift 'continueloop': unmodelled control transfer 'bltzl' at 0x54 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tblez\ta1,9c */\n/* 8:\tmove\tv0,zero */\n/* c:\tandi\ta3,a1,0x3 */\n/* 10:\tbeqz\ta3,40 */\n/* 14:\tmove\tt0,a3 */\n/* 18:\tsll\tt6,zero,0x2 */\n/* 1c:\taddu\ta2,a0,t6 */\n/* 20:\tlw\ta3,0(a2) */\n/* 24:\taddiu\tv0,v0,1 */\n/* 28:\tbltz\ta3,34 */\n/* 2c:\tnop */\n/* 30:\taddu\tv1,v1,a3 */\n/* 34:\tbne\tt0,v0,20 */\n/* 38:\taddiu\ta2,a2,4 */\n/* 3c:\tbeq\tv0,a1,9c */\n/* 40:\tsll\tt7,v0,0x2 */\n/* 44:\tsll\tt8,a1,0x2 */\n/* 48:\taddu\tt0,t8,a0 */\n/* 4c:\taddu\ta2,a0,t7 */\n/* 50:\tlw\ta3,0(a2) */\n/* 54:\tbltzl\ta3,64 */\n/* 58:\tlw\tv0,4(a2) */\n/* 5c:\taddu\tv1,v1,a3 */\n/* 60:\tlw\tv0,4(a2) */\n/* 64:\tbltzl\tv0,74 */\n/* 68:\tlw\tv0,8(a2) */\n/* 6c:\taddu\tv1,v1,v0 */\n/* 70:\tlw\tv0,8(a2) */\n/* 74:\tbltzl\tv0,84 */\n/* 78:\tlw\tv0,12(a2) */\n/* 7c:\taddu\tv1,v1,v0 */\n/* 80:\tlw\tv0,12(a2) */\n/* 84:\taddiu\ta2,a2,16 */\n/* 88:\tbltz\tv0,94 */\n/* 8c:\tnop */\n/* 90:\taddu\tv1,v1,v0 */\n/* 94:\tbnel\ta2,t0,54 */\n/* 98:\tlw\ta3,0(a2) */\n/* 9c:\tjr\tra */\n/* a0:\tmove\tv0,v1 */\n/* \t... */\nvoid continueloop(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'continueloop': unmodelled control transfer 'bltzl' at 0x54 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":50,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'continueloop': unmodelled control transfer 'bltzl' at 0x54 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 continueloop(s32 arg0, s32 arg1) {\n s32 *var_a2;\n s32 temp_a3;\n s32 temp_a3_2;\n s32 temp_a3_3;\n s32 temp_v0;\n s32 temp_v0_2;\n s32 temp_v0_3;\n s32 var_v0;\n s32 var_v1;\n void *var_a2_2;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg1 > 0) {\n temp_a3 = arg1 & 3;\n if (temp_a3 != 0) {\n var_a2 = arg0 + (0 * 4);\n do {\n temp_a3_2 = *var_a2;\n var_v0 += 1;\n if (temp_a3_2 >= 0) {\n var_v1 += temp_a3_2;\n }\n var_a2 += 4;\n } while (temp_a3 != var_v0);\n if (var_v0 != arg1) {\n goto block_7;\n }\n } else {\nblock_7:\n var_a2_2 = arg0 + (var_v0 * 4);\n do {\n temp_a3_3 = var_a2_2->unk0;\n if (temp_a3_3 >= 0) {\n var_v1 += temp_a3_3;\n }\n temp_v0 = var_a2_2->unk4;\n if (temp_v0 >= 0) {\n var_v1 += temp_v0;\n }\n temp_v0_2 = var_a2_2->unk8;\n if (temp_v0_2 >= 0) {\n var_v1 += temp_v0_2;\n }\n temp_v0_3 = var_a2_2->unkC;\n var_a2_2 += 0x10;\n if (temp_v0_3 >= 0) {\n var_v1 += temp_v0_3;\n }\n } while (var_a2_2 != ((arg1 * 4) + arg0));\n }\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":6,"quality":{"score":88,"lines":54,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 35: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 39: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 43: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 47: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 48: Bad operand type for += or -="]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `continueloop` — benchmark function synthetic:continueloop:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel continueloop\n move\t$v1, $zero\n blez\t$a1, .L9c\n move\t$v0, $zero\n andi\t$a3, $a1, 0x3\n beqz\t$a3, .L40\n move\t$t0, $a3\n sll\t$t6, $zero, 0x2\n addu\t$a2, $a0, $t6\n.L20:\n lw\t$a3, 0($a2)\n addiu\t$v0, $v0, 1\n bltz\t$a3, .L34\n nop\n addu\t$v1, $v1, $a3\n.L34:\n bne\t$t0, $v0, .L20\n addiu\t$a2, $a2, 4\n beq\t$v0, $a1, .L9c\n.L40:\n sll\t$t7, $v0, 0x2\n sll\t$t8, $a1, 0x2\n addu\t$t0, $t8, $a0\n addu\t$a2, $a0, $t7\n lw\t$a3, 0($a2)\n.L54:\n bltzl\t$a3, .L64\n lw\t$v0, 4($a2)\n addu\t$v1, $v1, $a3\n lw\t$v0, 4($a2)\n.L64:\n bltzl\t$v0, .L74\n lw\t$v0, 8($a2)\n addu\t$v1, $v1, $v0\n lw\t$v0, 8($a2)\n.L74:\n bltzl\t$v0, .L84\n lw\t$v0, 12($a2)\n addu\t$v1, $v1, $v0\n lw\t$v0, 12($a2)\n.L84:\n addiu\t$a2, $a2, 16\n bltz\t$v0, .L94\n nop\n addu\t$v1, $v1, $v0\n.L94:\n bnel\t$a2, $t0, .L54\n lw\t$a3, 0($a2)\n.L9c:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function continueloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `continueloop` — benchmark function synthetic:continueloop:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:continueloop:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,9c \n 8:\tmove\tv0,zero\n c:\tandi\ta3,a1,0x3\n 10:\tbeqz\ta3,40 \n 14:\tmove\tt0,a3\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\ta3,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\tbltz\ta3,34 \n 2c:\tnop\n 30:\taddu\tv1,v1,a3\n 34:\tbne\tt0,v0,20 \n 38:\taddiu\ta2,a2,4\n 3c:\tbeq\tv0,a1,9c \n 40:\tsll\tt7,v0,0x2\n 44:\tsll\tt8,a1,0x2\n 48:\taddu\tt0,t8,a0\n 4c:\taddu\ta2,a0,t7\n 50:\tlw\ta3,0(a2)\n 54:\tbltzl\ta3,64 \n 58:\tlw\tv0,4(a2)\n 5c:\taddu\tv1,v1,a3\n 60:\tlw\tv0,4(a2)\n 64:\tbltzl\tv0,74 \n 68:\tlw\tv0,8(a2)\n 6c:\taddu\tv1,v1,v0\n 70:\tlw\tv0,8(a2)\n 74:\tbltzl\tv0,84 \n 78:\tlw\tv0,12(a2)\n 7c:\taddu\tv1,v1,v0\n 80:\tlw\tv0,12(a2)\n 84:\taddiu\ta2,a2,16\n 88:\tbltz\tv0,94 \n 8c:\tnop\n 90:\taddu\tv1,v1,v0\n 94:\tbnel\ta2,t0,54 \n 98:\tlw\ta3,0(a2)\n 9c:\tjr\tra\n a0:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 continueloop\n\n\nContents of section .text:\n 0000 00001825 18a00025 00001025 30a70003 ...%...%...%0...\n 0010 10e0000b 00e04025 00007080 008e3021 ......@%..p...0!\n 0020 8cc70000 24420001 04e00002 00000000 ....$B..........\n 0030 00671821 1502fffa 24c60004 10450017 .g.!....$....E..\n 0040 00027880 0005c080 03044021 008f3021 ..x.......@!..0!\n 0050 8cc70000 04e20003 8cc20004 00671821 .............g.!\n 0060 8cc20004 04420003 8cc20008 00621821 .....B.......b.!\n 0070 8cc20008 04420003 8cc2000c 00621821 .....B.......b.!\n 0080 8cc2000c 24c60010 04400002 00000000 ....$....@......\n 0090 00621821 54c8ffef 8cc70000 03e00008 .b.!T...........\n 00a0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8100c1fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c1fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000008 00000228 p......).......(\n 0010 00000005 0000037c 00000001 00000230 .......|.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 0000003c 000002d8 ...........<....\n 0040 00000010 00000314 00000001 00000324 ...............$\n 0050 00000000 00000000 00000001 0000036c ...............l\n 0060 08080808 04000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000a4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d35 66356136 65653365 ps-ref-5f5a6ee3e\n 0130 35306563 3733632f 7265662e 6300636f 50ec73c/ref.c.co\n 0140 6e74696e 75656c6f 6f700000 636f6e74 ntinueloop..cont\n 0150 696e7565 6c6f6f70 00000000 00000000 inueloop........\n 0160 00000001 00000000 0000003b 00000000 ...........;....\n 0170 00000004 00000000 00000029 00000000 ...........)....\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000005 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name continueloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:continueloop:mwcc_242_81","sym":"continueloop","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for","continue","memory"],"loc":1,"refSource":"int continueloop(int *a,int n){ int s=0,i; for(i=0;i:\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r4,0(r3)\n 14:\tsrwi. r0,r4,31\n 18:\tbne 20 \n 1c:\tadd r5,r5,r4\n 20:\taddi r3,r3,4\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 continueloop\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 continueloop\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80830000 54800fff 40820008 7ca52214 ....T...@...|.\".\n 0020 38630004 4200ffec 7ca32b78 4e800020 8c..B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 continueloop(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 <= 0) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n do {\n if (*v0 >> 31 == 0) v1 = v1 + *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":12,"maxScore":16,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":1,"opMismatch":2,"argMismatch":3},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 continueloop(u32 *arg0, s32 arg1) {\n s32 var_ctr;\n s32 var_r5;\n u32 *var_r3;\n u32 temp_r4;\n\n var_r3 = arg0;\n var_r5 = 0;\n var_ctr = arg1;\n if (arg1 > 0) {\n do {\n temp_r4 = *var_r3;\n if ((temp_r4 >> 0x1FU) == 0) {\n var_r5 += temp_r4;\n }\n var_r3 += 4;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n return var_r5;\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":4},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":9,"maxScore":14,"ratio":0.6428571428571429,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `continueloop` — benchmark function synthetic:continueloop:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel continueloop\n li r5,0\n mtctr r4\n cmpwi r4,0\n ble .L28\n.L10:\n lwz r4,0(r3)\n srwi. r0,r4,31\n bne .L20\n add r5,r5,r4\n.L20:\n addi r3,r3,4\n bdnz .L10\n.L28:\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function continueloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `continueloop` — benchmark function synthetic:continueloop:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:continueloop:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r4,0(r3)\n 14:\tsrwi. r0,r4,31\n 18:\tbne 20 \n 1c:\tadd r5,r5,r4\n 20:\taddi r3,r3,4\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 continueloop\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 continueloop\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80830000 54800fff 40820008 7ca52214 ....T...@...|.\".\n 0020 38630004 4200ffec 7ca32b78 4e800020 8c..B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name continueloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countdown:agbcc","sym":"countdown","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","while"],"loc":1,"refSource":"int countdown(int n){ int c=0; while(n>0){c++;n--;} return c; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcountdown\n\t.type\t countdown,function\n\t.thumb_func\ncountdown:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tble\t.L4\t@cond_branch\n.L5:\n\tadd\tr1, r1, #0x1\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0\n\tbgt\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t countdown,.Lfe1-countdown\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 countdown(u32 a0) {\n s32 v0;\n s32 v1;\n v1 = a0;\n v0 = 0;\n while (v1 > 0) {\n v0 = v0 + 1;\n v1 = v1 - 1;\n }\n return v0;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 countdown(s32 arg0) {\n s32 var_r0;\n s32 var_r1;\n\n var_r0 = arg0;\n var_r1 = 0;\n if (var_r0 > 0) {\n do {\n var_r1 += 1;\n var_r0 -= 1;\n } while (var_r0 > 0);\n }\n return var_r1;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countdown` — benchmark function synthetic:countdown:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcountdown\n\t.type\t countdown,function\n\t.thumb_func\ncountdown:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tble\t.L4\t@cond_branch\n.L5:\n\tadd\tr1, r1, #0x1\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0\n\tbgt\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t countdown,.Lfe1-countdown\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countdown # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countdown` — benchmark function synthetic:countdown:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countdown:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcountdown\n\t.type\t countdown,function\n\t.thumb_func\ncountdown:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tble\t.L4\t@cond_branch\n.L5:\n\tadd\tr1, r1, #0x1\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0\n\tbgt\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t countdown,.Lfe1-countdown\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name countdown # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countdown:gcc2.7.2kmc","sym":"countdown","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","while"],"loc":1,"refSource":"int countdown(int n){ int c=0; while(n>0){c++;n--;} return c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,14 \n 4:\tmove\tv0,zero\n 8:\taddiu\ta0,a0,-1\n c:\tbgtz\ta0,8 \n 10:\taddiu\tv0,v0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-0c202a2d2388253f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c countdown\n\n\nContents of section .text:\n 0000 18800004 00001021 2484ffff 1c80fffe .......!$.......\n 0010 24420001 03e00008 00000000 00000000 $B..............\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 countdown(u32 a0) {\n s32 v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n while (v0 > 0) {\n v0 = v0 + -1;\n v1 = v1 + 1;\n }\n return v1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void countdown(s32 arg0) {\n s32 var_a0;\n\n var_a0 = arg0;\n if (var_a0 > 0) {\n do {\n var_a0 -= 1;\n } while (var_a0 > 0);\n }\n}\n","score":3,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countdown` — benchmark function synthetic:countdown:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel countdown\n blez\t$a0, .L14\n move\t$v0, $zero\n.L8:\n addiu\t$a0, $a0, -1\n bgtz\t$a0, .L8\n addiu\t$v0, $v0, 1\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countdown # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countdown` — benchmark function synthetic:countdown:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countdown:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,14 \n 4:\tmove\tv0,zero\n 8:\taddiu\ta0,a0,-1\n c:\tbgtz\ta0,8 \n 10:\taddiu\tv0,v0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-0c202a2d2388253f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c countdown\n\n\nContents of section .text:\n 0000 18800004 00001021 2484ffff 1c80fffe .......!$.......\n 0010 24420001 03e00008 00000000 00000000 $B..............\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name countdown # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countdown:ido7.1","sym":"countdown","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","while"],"loc":1,"refSource":"int countdown(int n){ int c=0; while(n>0){c++;n--;} return c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,14 \n 4:\tmove\tv1,zero\n 8:\taddiu\ta0,a0,-1\n c:\tbgtz\ta0,8 \n 10:\taddiu\tv1,v1,1\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c countdown\n\n\nContents of section .text:\n 0000 18800004 00001825 2484ffff 1c80fffe .......%$.......\n 0010 24630001 03e00008 00601025 00000000 $c.......`.%....\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002d0 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 0000000c 0000026c 00000001 00000278 .......l.......x\n 0050 00000000 00000000 00000001 000002c0 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 63323032 61326432 33383832 ef-0c202a2d23882\n 0130 3533662f 7265662e 6300636f 756e7464 53f/ref.c.countd\n 0140 6f776e00 636f756e 74646f77 6e000000 own.countdown...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000007 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 countdown(s32 a0) {\n s32 v0;\n v0 = 0;\n while (a0 > 0) {\n a0 = a0 + -1;\n v0 = v0 + 1;\n }\n return v0;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 countdown(s32 arg0) {\n s32 var_a0;\n s32 var_v1;\n\n var_a0 = arg0;\n var_v1 = 0;\n if (var_a0 > 0) {\n do {\n var_a0 -= 1;\n var_v1 += 1;\n } while (var_a0 > 0);\n }\n return var_v1;\n}\n","score":12,"maxScore":16,"compileErrors":null,"breakdown":{"insert":9,"delete":0,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countdown` — benchmark function synthetic:countdown:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel countdown\n blez\t$a0, .L14\n move\t$v1, $zero\n.L8:\n addiu\t$a0, $a0, -1\n bgtz\t$a0, .L8\n addiu\t$v1, $v1, 1\n.L14:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countdown # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countdown` — benchmark function synthetic:countdown:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countdown:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,14 \n 4:\tmove\tv1,zero\n 8:\taddiu\ta0,a0,-1\n c:\tbgtz\ta0,8 \n 10:\taddiu\tv1,v1,1\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c countdown\n\n\nContents of section .text:\n 0000 18800004 00001825 2484ffff 1c80fffe .......%$.......\n 0010 24630001 03e00008 00601025 00000000 $c.......`.%....\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002d0 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 0000000c 0000026c 00000001 00000278 .......l.......x\n 0050 00000000 00000000 00000001 000002c0 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 63323032 61326432 33383832 ef-0c202a2d23882\n 0130 3533662f 7265662e 6300636f 756e7464 53f/ref.c.countd\n 0140 6f776e00 636f756e 74646f77 6e000000 own.countdown...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000007 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name countdown # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countdown:mwcc_242_81","sym":"countdown","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","while"],"loc":1,"refSource":"int countdown(int n){ int c=0; while(n>0){c++;n--;} return c; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r4,0\n 8:\tble 34 \n c:\tsrwi. r0,r3,3\n 10:\tmtctr r0\n 14:\tbeq 28 \n 18:\taddi r4,r4,8\n 1c:\tbdnz 18 \n 20:\tandi. r3,r3,7\n 24:\tbeq 34 \n 28:\tmtctr r3\n 2c:\taddi r4,r4,1\n 30:\tbdnz 2c \n 34:\tmr r3,r4\n 38:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000003c countdown\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 countdown\n\n\nContents of section .text:\n 0000 2c030000 38800000 4081002c 5460e8ff ,...8...@..,T`..\n 0010 7c0903a6 41820014 38840008 4200fffc |...A...8...B...\n 0020 70630007 41820010 7c6903a6 38840001 pc..A...|i..8...\n 0030 4200fffc 7c832378 4e800020 B...|.#xN.. \nContents of section .mwcats.text:\n 0000 0200003c 00000000 ...<.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 countdown(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n if (a0 >> 3 == 0) {\n v0 = 0;\n v2 = v0;\n v3 = a0;\n do {\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n v0 = v2;\n } else {\n v0 = 0;\n v1 = a0 >> 3;\n do {\n v0 = v0 + 8;\n v1 = v1 - 1;\n } while (v1 != 0);\n if ((a0 & 7) == 0) {\n v0 = v0;\n } else {\n v0 = v0;\n a0 = a0 & 7;\n v2 = v0;\n v3 = a0;\n do {\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n v0 = v2;\n }\n }\n }\n return v0;\n}\n","score":25,"maxScore":27,"compileErrors":null,"breakdown":{"insert":12,"delete":1,"replace":5,"opMismatch":3,"argMismatch":4},"quality":{"score":100,"lines":41,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 countdown(s32 arg0) {\n s32 var_ctr_2;\n s32 var_r3;\n s32 var_r4;\n u32 temp_r0;\n u32 var_ctr;\n\n var_r3 = arg0;\n var_r4 = 0;\n if (var_r3 > 0) {\n temp_r0 = (u32) var_r3 >> 3U;\n var_ctr = temp_r0;\n if (temp_r0 != 0) {\n do {\n var_r4 += 8;\n var_ctr -= 1;\n } while (var_ctr != 0);\n var_r3 &= 7;\n if (var_r3 != 0) {\n goto block_4;\n }\n } else {\nblock_4:\n var_ctr_2 = var_r3;\n do {\n var_r4 += 1;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r4;\n}\n","score":6,"maxScore":16,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":3,"opMismatch":2,"argMismatch":0},"quality":{"score":88,"lines":31,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":16,"ratio":0.375,"kinds":{"insert":1,"delete":0,"replace":3,"opMismatch":2,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countdown` — benchmark function synthetic:countdown:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel countdown\n cmpwi r3,0\n li r4,0\n ble .L34\n srwi. r0,r3,3\n mtctr r0\n beq .L28\n.L18:\n addi r4,r4,8\n bdnz .L18\n andi. r3,r3,7\n beq .L34\n.L28:\n mtctr r3\n.L2c:\n addi r4,r4,1\n bdnz .L2c\n.L34:\n mr r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countdown # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countdown` — benchmark function synthetic:countdown:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countdown:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r4,0\n 8:\tble 34 \n c:\tsrwi. r0,r3,3\n 10:\tmtctr r0\n 14:\tbeq 28 \n 18:\taddi r4,r4,8\n 1c:\tbdnz 18 \n 20:\tandi. r3,r3,7\n 24:\tbeq 34 \n 28:\tmtctr r3\n 2c:\taddi r4,r4,1\n 30:\tbdnz 2c \n 34:\tmr r3,r4\n 38:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000003c countdown\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 countdown\n\n\nContents of section .text:\n 0000 2c030000 38800000 4081002c 5460e8ff ,...8...@..,T`..\n 0010 7c0903a6 41820014 38840008 4200fffc |...A...8...B...\n 0020 70630007 41820010 7c6903a6 38840001 pc..A...|i..8...\n 0030 4200fffc 7c832378 4e800020 B...|.#xN.. \nContents of section .mwcats.text:\n 0000 0200003c 00000000 ...<.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name countdown # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:Counter__inc:mwcc_242_81","sym":"Counter__inc","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c++","features":["c++","method","mutate"],"loc":2,"refSource":"struct Counter{int n;void inc(){ n++; }};\nextern \"C\" void Counter__inc(Counter*c){ c->inc(); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r4,0(r3)\n 4:\taddi r0,r4,1\n 8:\tstw r0,0(r3)\n c:\tblr\n","ctx":"struct Counter; void Counter__inc(struct Counter*);","proto":{"Counter__inc":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.cp\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 Counter__inc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 Counter__inc\n\n\nContents of section .text:\n 0000 80830000 38040001 90030000 4e800020 ....8.......N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void Counter__inc(s32 * a0) {\n *a0 = *a0 + 1;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Counter__inc(struct Counter *arg0) {\n *arg0 = (s32) (*arg0 + 1);\n}\n/* Warning: struct Counter is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^","# illegal operand"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Counter__inc` — benchmark function synthetic:Counter__inc:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel Counter__inc\n lwz r4,0(r3)\n addi r0,r4,1\n stw r0,0(r3)\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct Counter; void Counter__inc(struct Counter*);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c++ # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Counter__inc # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Counter__inc` — benchmark function synthetic:Counter__inc:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:Counter__inc:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r4,0(r3)\n 4:\taddi r0,r4,1\n 8:\tstw r0,0(r3)\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.cp\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 Counter__inc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 Counter__inc\n\n\nContents of section .text:\n 0000 80830000 38040001 90030000 4e800020 ....8.......N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"Counter__inc\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name Counter__inc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countpos:agbcc","sym":"countpos","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int countpos(int *a,int n){ int c=0,i; for(i=0;i0)c++; return c; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcountpos\n\t.type\t countpos,function\n\t.thumb_func\ncountpos:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tldr\tr0, [r2]\n\tcmp\tr0, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r3, #0x1\n.L5:\n\tadd\tr2, r2, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t countpos,.Lfe1-countpos\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 countpos(s32 * a0, u32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (0 >= a1) {\n v1 = 0;\n } else {\n v0 = a0;\n v1 = 0;\n v2 = a1;\n do {\n if (*v0 > 0) v1 = v1 + 1;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":5,"maxScore":17,"compileErrors":null,"breakdown":{"insert":3,"delete":1,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 countpos(s32 *arg0, s32 arg1) {\n s32 *var_r2;\n s32 var_r1;\n s32 var_r3;\n\n var_r1 = arg1;\n var_r3 = 0;\n if (var_r1 > 0) {\n var_r2 = arg0;\n do {\n if ((s32) *var_r2 > 0) {\n var_r3 += 1;\n }\n var_r2 += 4;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n return var_r3;\n}\n","score":3,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":18,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":14,"ratio":0.21428571428571427,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countpos` — benchmark function synthetic:countpos:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcountpos\n\t.type\t countpos,function\n\t.thumb_func\ncountpos:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tldr\tr0, [r2]\n\tcmp\tr0, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r3, #0x1\n.L5:\n\tadd\tr2, r2, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t countpos,.Lfe1-countpos\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countpos # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countpos` — benchmark function synthetic:countpos:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countpos:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcountpos\n\t.type\t countpos,function\n\t.thumb_func\ncountpos:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tldr\tr0, [r2]\n\tcmp\tr0, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r3, #0x1\n.L5:\n\tadd\tr2, r2, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t countpos,.Lfe1-countpos\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name countpos # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countpos:gcc2.7.2kmc","sym":"countpos","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int countpos(int *a,int n){ int c=0,i; for(i=0;i0)c++; return c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,2c \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\taddiu\ta2,a2,1\n 18:\tslt\tv0,zero,v0\n 1c:\taddu\tv1,v1,v0\n 20:\tslt\tv0,a2,a1\n 24:\tbnez\tv0,10 \n 28:\taddiu\ta0,a0,4\n 2c:\tmove\tv0,v1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a9f5abff6fff98c5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 countpos\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00008 00001821 '.....0!.......!\n 0010 8c820000 24c60001 0002102a 00621821 ....$......*.b.!\n 0020 00c5102a 1440fffa 24840004 00601021 ...*.@..$....`.!\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 countpos(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n v0 = a0;\n v1 = 0;\n v2 = 0;\n while (v1 < a1) {\n v1 = v1 + 1;\n v2 = v2 + (0 < *v0);\n v0 = v0 + 1;\n }\n return v2;\n}\n","score":6,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 countpos(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 var_a2;\n s32 var_v1;\n\n var_a0 = arg0;\n var_a2 = 0;\n var_v1 = 0;\n if (arg1 > 0) {\n do {\n var_a2 += 1;\n var_v1 += *var_a0 > 0;\n var_a0 += 4;\n } while (var_a2 < arg1);\n }\n return var_v1;\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":14,"ratio":0.42857142857142855,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countpos` — benchmark function synthetic:countpos:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel countpos\n addiu\t$sp, $sp, -8\n move\t$a2, $zero\n blez\t$a1, .L2c\n move\t$v1, $zero\n.L10:\n lw\t$v0, 0($a0)\n addiu\t$a2, $a2, 1\n slt\t$v0, $zero, $v0\n addu\t$v1, $v1, $v0\n slt\t$v0, $a2, $a1\n bnez\t$v0, .L10\n addiu\t$a0, $a0, 4\n.L2c:\n move\t$v0, $v1\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countpos # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countpos` — benchmark function synthetic:countpos:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countpos:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,2c \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\taddiu\ta2,a2,1\n 18:\tslt\tv0,zero,v0\n 1c:\taddu\tv1,v1,v0\n 20:\tslt\tv0,a2,a1\n 24:\tbnez\tv0,10 \n 28:\taddiu\ta0,a0,4\n 2c:\tmove\tv0,v1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a9f5abff6fff98c5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 countpos\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00008 00001821 '.....0!.......!\n 0010 8c820000 24c60001 0002102a 00621821 ....$......*.b.!\n 0020 00c5102a 1440fffa 24840004 00601021 ...*.@..$....`.!\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name countpos # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countpos:ido7.1","sym":"countpos","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int countpos(int *a,int n){ int c=0,i; for(i=0;i0)c++; return c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,9c \n 8:\tmove\tv0,zero\n c:\tandi\tt0,a1,0x3\n 10:\tbeqz\tt0,40 \n 14:\tmove\ta3,t0\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\tt7,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\tblez\tt7,34 \n 2c:\tnop\n 30:\taddiu\tv1,v1,1\n 34:\tbne\ta3,v0,20 \n 38:\taddiu\ta2,a2,4\n 3c:\tbeq\tv0,a1,9c \n 40:\tsll\tt8,v0,0x2\n 44:\tsll\tt9,a1,0x2\n 48:\taddu\ta3,t9,a0\n 4c:\taddu\ta2,a0,t8\n 50:\tlw\tt1,0(a2)\n 54:\tblezl\tt1,64 \n 58:\tlw\tt2,4(a2)\n 5c:\taddiu\tv1,v1,1\n 60:\tlw\tt2,4(a2)\n 64:\tblezl\tt2,74 \n 68:\tlw\tt3,8(a2)\n 6c:\taddiu\tv1,v1,1\n 70:\tlw\tt3,8(a2)\n 74:\tblezl\tt3,84 \n 78:\tlw\tt4,12(a2)\n 7c:\taddiu\tv1,v1,1\n 80:\tlw\tt4,12(a2)\n 84:\taddiu\ta2,a2,16\n 88:\tblez\tt4,94 \n 8c:\tnop\n 90:\taddiu\tv1,v1,1\n 94:\tbnel\ta2,a3,54 \n 98:\tlw\tt1,0(a2)\n 9c:\tjr\tra\n a0:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 countpos\n\n\nContents of section .text:\n 0000 00001825 18a00025 00001025 30a80003 ...%...%...%0...\n 0010 1100000b 01003825 00007080 008e3021 ......8%..p...0!\n 0020 8ccf0000 24420001 19e00002 00000000 ....$B..........\n 0030 24630001 14e2fffa 24c60004 10450017 $c......$....E..\n 0040 0002c080 0005c880 03243821 00983021 .........$8!..0!\n 0050 8cc90000 59200003 8cca0004 24630001 ....Y ......$c..\n 0060 8cca0004 59400003 8ccb0008 24630001 ....Y@......$c..\n 0070 8ccb0008 59600003 8ccc000c 24630001 ....Y`......$c..\n 0080 8ccc000c 24c60010 19800002 00000000 ....$...........\n 0090 24630001 54c7ffef 8cc90000 03e00008 $c..T...........\n 00a0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8300dffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300dffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000008 00000218 p......)........\n 0010 00000005 00000364 00000001 00000220 .......d....... \n 0020 00000004 00000254 00000000 00000000 .......T........\n 0030 00000011 00000284 00000038 000002c8 ...........8....\n 0040 0000000c 00000300 00000001 0000030c ................\n 0050 00000000 00000000 00000001 00000354 ...............T\n 0060 08080808 04000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000a4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d61 39663561 62666636 ps-ref-a9f5abff6\n 0130 66666639 3863352f 7265662e 6300636f fff98c5/ref.c.co\n 0140 756e7470 6f730000 636f756e 74706f73 untpos..countpos\n 0150 00000000 00000000 00000001 00000000 ................\n 0160 00000037 00000000 00000004 00000000 ...7............\n 0170 00000029 00000000 00000000 00000001 ...)............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000005 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'countpos' — lift: cannot lift 'countpos': unmodelled control transfer 'blezl' at 0x54 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tblez\ta1,9c */\n/* 8:\tmove\tv0,zero */\n/* c:\tandi\tt0,a1,0x3 */\n/* 10:\tbeqz\tt0,40 */\n/* 14:\tmove\ta3,t0 */\n/* 18:\tsll\tt6,zero,0x2 */\n/* 1c:\taddu\ta2,a0,t6 */\n/* 20:\tlw\tt7,0(a2) */\n/* 24:\taddiu\tv0,v0,1 */\n/* 28:\tblez\tt7,34 */\n/* 2c:\tnop */\n/* 30:\taddiu\tv1,v1,1 */\n/* 34:\tbne\ta3,v0,20 */\n/* 38:\taddiu\ta2,a2,4 */\n/* 3c:\tbeq\tv0,a1,9c */\n/* 40:\tsll\tt8,v0,0x2 */\n/* 44:\tsll\tt9,a1,0x2 */\n/* 48:\taddu\ta3,t9,a0 */\n/* 4c:\taddu\ta2,a0,t8 */\n/* 50:\tlw\tt1,0(a2) */\n/* 54:\tblezl\tt1,64 */\n/* 58:\tlw\tt2,4(a2) */\n/* 5c:\taddiu\tv1,v1,1 */\n/* 60:\tlw\tt2,4(a2) */\n/* 64:\tblezl\tt2,74 */\n/* 68:\tlw\tt3,8(a2) */\n/* 6c:\taddiu\tv1,v1,1 */\n/* 70:\tlw\tt3,8(a2) */\n/* 74:\tblezl\tt3,84 */\n/* 78:\tlw\tt4,12(a2) */\n/* 7c:\taddiu\tv1,v1,1 */\n/* 80:\tlw\tt4,12(a2) */\n/* 84:\taddiu\ta2,a2,16 */\n/* 88:\tblez\tt4,94 */\n/* 8c:\tnop */\n/* 90:\taddiu\tv1,v1,1 */\n/* 94:\tbnel\ta2,a3,54 */\n/* 98:\tlw\tt1,0(a2) */\n/* 9c:\tjr\tra */\n/* a0:\tmove\tv0,v1 */\n/* \t... */\nvoid countpos(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'countpos': unmodelled control transfer 'blezl' at 0x54 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":50,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'countpos': unmodelled control transfer 'blezl' at 0x54 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 countpos(s32 arg0, s32 arg1) {\n s32 *var_a2;\n s32 temp_t0;\n s32 temp_t4;\n s32 var_v0;\n s32 var_v1;\n void *var_a2_2;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg1 > 0) {\n temp_t0 = arg1 & 3;\n if (temp_t0 != 0) {\n var_a2 = arg0 + (0 * 4);\n do {\n var_v0 += 1;\n if (*var_a2 > 0) {\n var_v1 += 1;\n }\n var_a2 += 4;\n } while (temp_t0 != var_v0);\n if (var_v0 != arg1) {\n goto block_7;\n }\n } else {\nblock_7:\n var_a2_2 = arg0 + (var_v0 * 4);\n do {\n if (var_a2_2->unk0 > 0) {\n var_v1 += 1;\n }\n if (var_a2_2->unk4 > 0) {\n var_v1 += 1;\n }\n if (var_a2_2->unk8 > 0) {\n var_v1 += 1;\n }\n temp_t4 = var_a2_2->unkC;\n var_a2_2 += 0x10;\n if (temp_t4 > 0) {\n var_v1 += 1;\n }\n } while (var_a2_2 != ((arg1 * 4) + arg0));\n }\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":6,"quality":{"score":88,"lines":46,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 30: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 33: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 36: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 39: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 40: Bad operand type for += or -="]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countpos` — benchmark function synthetic:countpos:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel countpos\n move\t$v1, $zero\n blez\t$a1, .L9c\n move\t$v0, $zero\n andi\t$t0, $a1, 0x3\n beqz\t$t0, .L40\n move\t$a3, $t0\n sll\t$t6, $zero, 0x2\n addu\t$a2, $a0, $t6\n.L20:\n lw\t$t7, 0($a2)\n addiu\t$v0, $v0, 1\n blez\t$t7, .L34\n nop\n addiu\t$v1, $v1, 1\n.L34:\n bne\t$a3, $v0, .L20\n addiu\t$a2, $a2, 4\n beq\t$v0, $a1, .L9c\n.L40:\n sll\t$t8, $v0, 0x2\n sll\t$t9, $a1, 0x2\n addu\t$a3, $t9, $a0\n addu\t$a2, $a0, $t8\n lw\t$t1, 0($a2)\n.L54:\n blezl\t$t1, .L64\n lw\t$t2, 4($a2)\n addiu\t$v1, $v1, 1\n lw\t$t2, 4($a2)\n.L64:\n blezl\t$t2, .L74\n lw\t$t3, 8($a2)\n addiu\t$v1, $v1, 1\n lw\t$t3, 8($a2)\n.L74:\n blezl\t$t3, .L84\n lw\t$t4, 12($a2)\n addiu\t$v1, $v1, 1\n lw\t$t4, 12($a2)\n.L84:\n addiu\t$a2, $a2, 16\n blez\t$t4, .L94\n nop\n addiu\t$v1, $v1, 1\n.L94:\n bnel\t$a2, $a3, .L54\n lw\t$t1, 0($a2)\n.L9c:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countpos # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countpos` — benchmark function synthetic:countpos:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countpos:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,9c \n 8:\tmove\tv0,zero\n c:\tandi\tt0,a1,0x3\n 10:\tbeqz\tt0,40 \n 14:\tmove\ta3,t0\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\tt7,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\tblez\tt7,34 \n 2c:\tnop\n 30:\taddiu\tv1,v1,1\n 34:\tbne\ta3,v0,20 \n 38:\taddiu\ta2,a2,4\n 3c:\tbeq\tv0,a1,9c \n 40:\tsll\tt8,v0,0x2\n 44:\tsll\tt9,a1,0x2\n 48:\taddu\ta3,t9,a0\n 4c:\taddu\ta2,a0,t8\n 50:\tlw\tt1,0(a2)\n 54:\tblezl\tt1,64 \n 58:\tlw\tt2,4(a2)\n 5c:\taddiu\tv1,v1,1\n 60:\tlw\tt2,4(a2)\n 64:\tblezl\tt2,74 \n 68:\tlw\tt3,8(a2)\n 6c:\taddiu\tv1,v1,1\n 70:\tlw\tt3,8(a2)\n 74:\tblezl\tt3,84 \n 78:\tlw\tt4,12(a2)\n 7c:\taddiu\tv1,v1,1\n 80:\tlw\tt4,12(a2)\n 84:\taddiu\ta2,a2,16\n 88:\tblez\tt4,94 \n 8c:\tnop\n 90:\taddiu\tv1,v1,1\n 94:\tbnel\ta2,a3,54 \n 98:\tlw\tt1,0(a2)\n 9c:\tjr\tra\n a0:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 countpos\n\n\nContents of section .text:\n 0000 00001825 18a00025 00001025 30a80003 ...%...%...%0...\n 0010 1100000b 01003825 00007080 008e3021 ......8%..p...0!\n 0020 8ccf0000 24420001 19e00002 00000000 ....$B..........\n 0030 24630001 14e2fffa 24c60004 10450017 $c......$....E..\n 0040 0002c080 0005c880 03243821 00983021 .........$8!..0!\n 0050 8cc90000 59200003 8cca0004 24630001 ....Y ......$c..\n 0060 8cca0004 59400003 8ccb0008 24630001 ....Y@......$c..\n 0070 8ccb0008 59600003 8ccc000c 24630001 ....Y`......$c..\n 0080 8ccc000c 24c60010 19800002 00000000 ....$...........\n 0090 24630001 54c7ffef 8cc90000 03e00008 $c..T...........\n 00a0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8300dffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300dffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000008 00000218 p......)........\n 0010 00000005 00000364 00000001 00000220 .......d....... \n 0020 00000004 00000254 00000000 00000000 .......T........\n 0030 00000011 00000284 00000038 000002c8 ...........8....\n 0040 0000000c 00000300 00000001 0000030c ................\n 0050 00000000 00000000 00000001 00000354 ...............T\n 0060 08080808 04000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000a4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d61 39663561 62666636 ps-ref-a9f5abff6\n 0130 66666639 3863352f 7265662e 6300636f fff98c5/ref.c.co\n 0140 756e7470 6f730000 636f756e 74706f73 untpos..countpos\n 0150 00000000 00000000 00000001 00000000 ................\n 0160 00000037 00000000 00000004 00000000 ...7............\n 0170 00000029 00000000 00000000 00000001 ...)............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000005 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name countpos # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countpos:mwcc_242_81","sym":"countpos","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int countpos(int *a,int n){ int c=0,i; for(i=0;i0)c++; return c; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r0,0(r3)\n 14:\tcmpwi r0,0\n 18:\tble 20 \n 1c:\taddi r5,r5,1\n 20:\taddi r3,r3,4\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 countpos\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 countpos\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80030000 2c000000 40810008 38a50001 ....,...@...8...\n 0020 38630004 4200ffec 7ca32b78 4e800020 8c..B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 countpos(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 <= 0) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n do {\n if (*v0 > 0) v1 = v1 + 1;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":8,"maxScore":16,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":0,"opMismatch":2,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 countpos(s32 *arg0, s32 arg1) {\n s32 *var_r3;\n s32 var_ctr;\n s32 var_r5;\n\n var_r3 = arg0;\n var_r5 = 0;\n var_ctr = arg1;\n if (arg1 > 0) {\n do {\n if ((s32) *var_r3 > 0) {\n var_r5 += 1;\n }\n var_r3 += 4;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n return var_r5;\n}\n","score":6,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":18,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":14,"ratio":0.42857142857142855,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countpos` — benchmark function synthetic:countpos:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel countpos\n li r5,0\n mtctr r4\n cmpwi r4,0\n ble .L28\n.L10:\n lwz r0,0(r3)\n cmpwi r0,0\n ble .L20\n addi r5,r5,1\n.L20:\n addi r3,r3,4\n bdnz .L10\n.L28:\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countpos # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countpos` — benchmark function synthetic:countpos:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countpos:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r0,0(r3)\n 14:\tcmpwi r0,0\n 18:\tble 20 \n 1c:\taddi r5,r5,1\n 20:\taddi r3,r3,4\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 countpos\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 countpos\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80030000 2c000000 40810008 38a50001 ....,...@...8...\n 0020 38630004 4200ffec 7ca32b78 4e800020 8c..B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name countpos # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dadd:agbcc","sym":"dadd","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","double","arithmetic"],"loc":1,"refSource":"double dadd(double a,double b){ return a+b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdadd\n\t.type\t dadd,function\n\t.thumb_func\ndadd:\n\tpush\t{lr}\n\tbl\t__adddf3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t dadd,.Lfe1-dadd\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 dadd(void) {\n return __adddf3();\n}\n","score":2,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? __adddf3(); /* extern */\n\nvoid dadd(void) {\n __adddf3();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":4,"ratio":0.5,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dadd` — benchmark function synthetic:dadd:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdadd\n\t.type\t dadd,function\n\t.thumb_func\ndadd:\n\tpush\t{lr}\n\tbl\t__adddf3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t dadd,.Lfe1-dadd\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dadd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dadd` — benchmark function synthetic:dadd:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dadd:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdadd\n\t.type\t dadd,function\n\t.thumb_func\ndadd:\n\tpush\t{lr}\n\tbl\t__adddf3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t dadd,.Lfe1-dadd\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name dadd # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dadd:gcc2.7.2kmc","sym":"dadd","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","double","arithmetic"],"loc":1,"refSource":"double dadd(double a,double b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.d\t$f0,$f12,$f14\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f5925313b8b0efc5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 dadd\n\n\nContents of section .text:\n 0000 03e00008 462e6000 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'dadd' — lift: cannot lift 'dadd @0x4': unmodelled effect instruction 'add.d' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tadd.d\t$f0,$f12,$f14 */\n/* \t... */\nvoid dadd(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'dadd @0x4': unmodelled effect instruction 'add.d' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'dadd @0x4': unmodelled effect instruction 'add.d' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f64 dadd(f64 arg0, f64 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dadd` — benchmark function synthetic:dadd:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dadd\n jr\t$ra\n add.d\t$f0, $f12, $f14\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dadd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dadd` — benchmark function synthetic:dadd:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dadd:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.d\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f5925313b8b0efc5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 dadd\n\n\nContents of section .text:\n 0000 03e00008 462e6000 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name dadd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dadd:ido7.1","sym":"dadd","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","double","arithmetic"],"loc":1,"refSource":"double dadd(double a,double b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.d\t$f0,$f12,$f14\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 dadd\n\n\nContents of section .text:\n 0000 03e00008 462e6000 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 0000f003 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 0000f003 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 35393235 33313362 38623065 ef-f5925313b8b0e\n 0130 6663352f 7265662e 63006461 64640000 fc5/ref.c.dadd..\n 0140 64616464 00000000 00000000 00000001 dadd............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'dadd' — lift: cannot lift 'dadd @0x4': unmodelled effect instruction 'add.d' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tadd.d\t$f0,$f12,$f14 */\n/* \t... */\nvoid dadd(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'dadd @0x4': unmodelled effect instruction 'add.d' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'dadd @0x4': unmodelled effect instruction 'add.d' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f64 dadd(f64 arg0, f64 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dadd` — benchmark function synthetic:dadd:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dadd\n jr\t$ra\n add.d\t$f0, $f12, $f14\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dadd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dadd` — benchmark function synthetic:dadd:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dadd:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.d\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 dadd\n\n\nContents of section .text:\n 0000 03e00008 462e6000 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 0000f003 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 0000f003 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 35393235 33313362 38623065 ef-f5925313b8b0e\n 0130 6663352f 7265662e 63006461 64640000 fc5/ref.c.dadd..\n 0140 64616464 00000000 00000000 00000001 dadd............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name dadd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dadd:mwcc_242_81","sym":"dadd","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","double","arithmetic"],"loc":1,"refSource":"double dadd(double a,double b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfadd f1,f1,f2\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 dadd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 dadd\n\n\nContents of section .text:\n 0000 fc21102a 4e800020 .!.*N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'dadd' — lift: cannot lift 'dadd @0x0': unmodelled effect instruction 'fadd' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfadd f1,f1,f2 */\n/* 4:\tblr */\nvoid dadd(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'dadd @0x0': unmodelled effect instruction 'fadd' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":10,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'dadd @0x0': unmodelled effect instruction 'fadd' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f64 dadd(f64 farg0, f64 farg1) {\n return farg0 + farg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dadd` — benchmark function synthetic:dadd:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dadd\n fadd f1,f1,f2\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dadd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dadd` — benchmark function synthetic:dadd:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dadd:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfadd f1,f1,f2\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 dadd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 dadd\n\n\nContents of section .text:\n 0000 fc21102a 4e800020 .!.*N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name dadd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:deref:agbcc","sym":"deref","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","load"],"loc":1,"refSource":"int deref(int *p){ return *p; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tderef\n\t.type\t deref,function\n\t.thumb_func\nderef:\n\tldr\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t deref,.Lfe1-deref\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 deref(s32 * a0) {\n return *a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 deref(s32 *arg0) {\n return *arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `deref` — benchmark function synthetic:deref:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tderef\n\t.type\t deref,function\n\t.thumb_func\nderef:\n\tldr\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t deref,.Lfe1-deref\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function deref # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `deref` — benchmark function synthetic:deref:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:deref:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tderef\n\t.type\t deref,function\n\t.thumb_func\nderef:\n\tldr\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t deref,.Lfe1-deref\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name deref # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:deref:gcc2.7.2kmc","sym":"deref","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","load"],"loc":1,"refSource":"int deref(int *p){ return *p; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,0(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ddae348b93b32b1f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 deref\n\n\nContents of section .text:\n 0000 03e00008 8c820000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 deref(s32 * a0) {\n return *a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 deref(s32 *arg0) {\n return *arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `deref` — benchmark function synthetic:deref:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel deref\n jr\t$ra\n lw\t$v0, 0($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function deref # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `deref` — benchmark function synthetic:deref:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:deref:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,0(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ddae348b93b32b1f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 deref\n\n\nContents of section .text:\n 0000 03e00008 8c820000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name deref # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:deref:ido7.1","sym":"deref","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","load"],"loc":1,"refSource":"int deref(int *p){ return *p; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,0(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 deref\n\n\nContents of section .text:\n 0000 03e00008 8c820000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 64616533 34386239 33623332 ef-ddae348b93b32\n 0130 6231662f 7265662e 63006465 72656600 b1f/ref.c.deref.\n 0140 64657265 66000000 00000000 00000001 deref...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 deref(s32 * a0) {\n return *a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 deref(s32 *arg0) {\n return *arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `deref` — benchmark function synthetic:deref:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel deref\n jr\t$ra\n lw\t$v0, 0($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function deref # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `deref` — benchmark function synthetic:deref:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:deref:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,0(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 deref\n\n\nContents of section .text:\n 0000 03e00008 8c820000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 64616533 34386239 33623332 ef-ddae348b93b32\n 0130 6231662f 7265662e 63006465 72656600 b1f/ref.c.deref.\n 0140 64657265 66000000 00000000 00000001 deref...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name deref # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:deref:mwcc_242_81","sym":"deref","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","load"],"loc":1,"refSource":"int deref(int *p){ return *p; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r3,0(r3)\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 deref\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 deref\n\n\nContents of section .text:\n 0000 80630000 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 deref(s32 * a0) {\n return *a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 deref(s32 *arg0) {\n return *arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `deref` — benchmark function synthetic:deref:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel deref\n lwz r3,0(r3)\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function deref # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `deref` — benchmark function synthetic:deref:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:deref:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r3,0(r3)\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 deref\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 deref\n\n\nContents of section .text:\n 0000 80630000 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name deref # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:div2:agbcc","sym":"div2","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int div2(int a){ return a/2; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdiv2\n\t.type\t div2,function\n\t.thumb_func\ndiv2:\n\tlsr\tr1, r0, #0x1f\n\tadd\tr0, r0, r1\n\tasr\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t div2,.Lfe1-div2\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 div2(s32 a0) {\n return a0 / 2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 div2(u32 arg0) {\n return (s32) (arg0 + (arg0 >> 0x1F)) >> 1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `div2` — benchmark function synthetic:div2:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdiv2\n\t.type\t div2,function\n\t.thumb_func\ndiv2:\n\tlsr\tr1, r0, #0x1f\n\tadd\tr0, r0, r1\n\tasr\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t div2,.Lfe1-div2\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function div2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `div2` — benchmark function synthetic:div2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:div2:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdiv2\n\t.type\t div2,function\n\t.thumb_func\ndiv2:\n\tlsr\tr1, r0, #0x1f\n\tadd\tr0, r0, r1\n\tasr\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t div2,.Lfe1-div2\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name div2 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:div2:gcc2.7.2kmc","sym":"div2","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int div2(int a){ return a/2; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x1f\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tsra\tv0,v0,0x1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c4a8c16d086889e1/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 div2\n\n\nContents of section .text:\n 0000 000417c2 00441021 03e00008 00021043 .....D.!.......C\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 div2(s32 a0) {\n return a0 / 2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 div2(u32 arg0) {\n return (s32) ((arg0 >> 0x1F) + arg0) >> 1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `div2` — benchmark function synthetic:div2:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel div2\n srl\t$v0, $a0, 0x1f\n addu\t$v0, $v0, $a0\n jr\t$ra\n sra\t$v0, $v0, 0x1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function div2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `div2` — benchmark function synthetic:div2:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:div2:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x1f\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tsra\tv0,v0,0x1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c4a8c16d086889e1/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 div2\n\n\nContents of section .text:\n 0000 000417c2 00441021 03e00008 00021043 .....D.!.......C\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name div2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:div2:ido7.1","sym":"div2","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int div2(int a){ return a/2; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tsra\tv0,a0,0x1\n 8:\taddiu\tat,a0,1\n c:\tsra\tv0,at,0x1\n 10:\tjr\tra\n 14:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 div2\n\n\nContents of section .text:\n 0000 04810003 00041043 24810001 00011043 .......C$......C\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 34613863 31366430 38363838 ef-c4a8c16d08688\n 0130 3965312f 7265662e 63006469 76320000 9e1/ref.c.div2..\n 0140 64697632 00000000 00000000 00000001 div2............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 div2(u32 a0) {\n s32 v0;\n if (a0 >= 0) {\n v0 = a0 >> 1;\n } else {\n v0 = a0 + 1 >> 1;\n }\n return v0;\n}\n","score":5,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 div2(s32 arg0) {\n return arg0 / 2;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `div2` — benchmark function synthetic:div2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel div2\n bgez\t$a0, .L10\n sra\t$v0, $a0, 0x1\n addiu\t$at, $a0, 1\n sra\t$v0, $at, 0x1\n.L10:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function div2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `div2` — benchmark function synthetic:div2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:div2:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tsra\tv0,a0,0x1\n 8:\taddiu\tat,a0,1\n c:\tsra\tv0,at,0x1\n 10:\tjr\tra\n 14:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 div2\n\n\nContents of section .text:\n 0000 04810003 00041043 24810001 00011043 .......C$......C\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 34613863 31366430 38363838 ef-c4a8c16d08688\n 0130 3965312f 7265662e 63006469 76320000 9e1/ref.c.div2..\n 0140 64697632 00000000 00000000 00000001 div2............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name div2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:div2:mwcc_242_81","sym":"div2","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int div2(int a){ return a/2; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrwi r0,r3,31\n 4:\tadd r0,r0,r3\n 8:\tsrawi r3,r0,1\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 div2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 div2\n\n\nContents of section .text:\n 0000 54600ffe 7c001a14 7c030e70 4e800020 T`..|...|..pN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 div2(u32 a0) {\n return (a0 >> 31) + a0 >> 1;\n}\n","score":2,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 div2(u32 arg0) {\n return (s32) ((arg0 >> 0x1FU) + arg0) >> 1;\n}\n","score":1,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":1,"maxScore":4,"ratio":0.25,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `div2` — benchmark function synthetic:div2:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel div2\n srwi r0,r3,31\n add r0,r0,r3\n srawi r3,r0,1\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function div2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `div2` — benchmark function synthetic:div2:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:div2:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrwi r0,r3,31\n 4:\tadd r0,r0,r3\n 8:\tsrawi r3,r0,1\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 div2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 div2\n\n\nContents of section .text:\n 0000 54600ffe 7c001a14 7c030e70 4e800020 T`..|...|..pN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name div2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc:agbcc","sym":"divc","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","signed-div-const"],"loc":1,"refSource":"int divc(int a){ return a/7; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc\n\t.type\t divc,function\n\t.thumb_func\ndivc:\n\tpush\t{lr}\n\tmov\tr1, #0x7\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc,.Lfe1-divc\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc(s32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc(s32 arg0) {\n return arg0 / 7;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc` — benchmark function synthetic:divc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc\n\t.type\t divc,function\n\t.thumb_func\ndivc:\n\tpush\t{lr}\n\tmov\tr1, #0x7\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc,.Lfe1-divc\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc` — benchmark function synthetic:divc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc\n\t.type\t divc,function\n\t.thumb_func\ndivc:\n\tpush\t{lr}\n\tmov\tr1, #0x7\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc,.Lfe1-divc\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc:gcc2.7.2kmc","sym":"divc","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","signed-div-const"],"loc":1,"refSource":"int divc(int a){ return a/7; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x9249\n 4:\tori\tv0,v0,0x2493\n 8:\tmult\ta0,v0\n c:\tmfhi\tv1\n 10:\taddu\tv0,v1,a0\n 14:\tsra\tv0,v0,0x2\n 18:\tsra\ta0,a0,0x1f\n 1c:\tjr\tra\n 20:\tsubu\tv0,v0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b75f16133d0fad70/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 divc\n\n\nContents of section .text:\n 0000 3c029249 34422493 00820018 00001810 <..I4B$.........\n 0010 00641021 00021083 000427c3 03e00008 .d.!......'.....\n 0020 00441023 00000000 00000000 00000000 .D.#............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc(s32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc(s32 arg0) {\n return arg0 / 7;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc` — benchmark function synthetic:divc:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc\n lui\t$v0, 0x9249\n ori\t$v0, $v0, 0x2493\n mult\t$a0, $v0\n mfhi\t$v1\n addu\t$v0, $v1, $a0\n sra\t$v0, $v0, 0x2\n sra\t$a0, $a0, 0x1f\n jr\t$ra\n subu\t$v0, $v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc` — benchmark function synthetic:divc:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x9249\n 4:\tori\tv0,v0,0x2493\n 8:\tmult\ta0,v0\n c:\tmfhi\tv1\n 10:\taddu\tv0,v1,a0\n 14:\tsra\tv0,v0,0x2\n 18:\tsra\ta0,a0,0x1f\n 1c:\tjr\tra\n 20:\tsubu\tv0,v0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b75f16133d0fad70/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 divc\n\n\nContents of section .text:\n 0000 3c029249 34422493 00820018 00001810 <..I4B$.........\n 0010 00641021 00021083 000427c3 03e00008 .d.!......'.....\n 0020 00441023 00000000 00000000 00000000 .D.#............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc:ido7.1","sym":"divc","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","signed-div-const"],"loc":1,"refSource":"int divc(int a){ return a/7; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,7\n 4:\tdiv\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 divc\n\n\nContents of section .text:\n 0000 24010007 0081001a 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 37356631 36313333 64306661 ef-b75f16133d0fa\n 0130 6437302f 7265662e 63006469 76630000 d70/ref.c.divc..\n 0140 64697663 00000000 00000000 00000001 divc............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc(s32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc(s32 arg0) {\n return arg0 / 7;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc` — benchmark function synthetic:divc:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc\n li\t$at, 7\n div\t$zero, $a0, $at\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc` — benchmark function synthetic:divc:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,7\n 4:\tdiv\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 divc\n\n\nContents of section .text:\n 0000 24010007 0081001a 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 37356631 36313333 64306661 ef-b75f16133d0fa\n 0130 6437302f 7265662e 63006469 76630000 d70/ref.c.divc..\n 0140 64697663 00000000 00000000 00000001 divc............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc:mwcc_242_81","sym":"divc","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","signed-div-const"],"loc":1,"refSource":"int divc(int a){ return a/7; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,-28087\n 4:\taddi r0,r4,9363\n 8:\tmulhw r0,r0,r3\n c:\tadd r0,r0,r3\n 10:\tsrawi r0,r0,2\n 14:\tsrwi r3,r0,31\n 18:\tadd r3,r0,r3\n 1c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 divc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divc\n\n\nContents of section .text:\n 0000 3c809249 38042493 7c001896 7c001a14 <..I8.$.|...|...\n 0010 7c001670 54030ffe 7c601a14 4e800020 |..pT...|`..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc(s32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 divc(s32 arg0) {\n return arg0 / 7;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc` — benchmark function synthetic:divc:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc\n lis r4,-28087\n addi r0,r4,9363\n mulhw r0,r0,r3\n add r0,r0,r3\n srawi r0,r0,2\n srwi r3,r0,31\n add r3,r0,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc` — benchmark function synthetic:divc:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,-28087\n 4:\taddi r0,r4,9363\n 8:\tmulhw r0,r0,r3\n c:\tadd r0,r0,r3\n 10:\tsrawi r0,r0,2\n 14:\tsrwi r3,r0,31\n 18:\tadd r3,r0,r3\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 divc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divc\n\n\nContents of section .text:\n 0000 3c809249 38042493 7c001896 7c001a14 <..I8.$.|...|...\n 0010 7c001670 54030ffe 7c601a14 4e800020 |..pT...|`..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc10:agbcc","sym":"divc10","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc10(int a){ return a/10; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc10\n\t.type\t divc10,function\n\t.thumb_func\ndivc10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc10,.Lfe1-divc10\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc10(s32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc10(s32 arg0) {\n return arg0 / 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc10` — benchmark function synthetic:divc10:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc10\n\t.type\t divc10,function\n\t.thumb_func\ndivc10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc10,.Lfe1-divc10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc10` — benchmark function synthetic:divc10:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc10:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc10\n\t.type\t divc10,function\n\t.thumb_func\ndivc10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc10,.Lfe1-divc10\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc10 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc10:gcc2.7.2kmc","sym":"divc10","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc10(int a){ return a/10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x6666\n 4:\tori\tv0,v0,0x6667\n 8:\tmult\ta0,v0\n c:\tsra\ta0,a0,0x1f\n 10:\tmfhi\tv1\n 14:\tsra\tv0,v1,0x2\n 18:\tnop\n 1c:\tjr\tra\n 20:\tsubu\tv0,v0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-050afe56ee48148d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 divc10\n\n\nContents of section .text:\n 0000 3c026666 34426667 00820018 000427c3 <.ff4Bfg......'.\n 0010 00001810 00031083 00000000 03e00008 ................\n 0020 00441023 00000000 00000000 00000000 .D.#............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc10(s32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc10(s32 arg0) {\n return arg0 / 10;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc10` — benchmark function synthetic:divc10:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc10\n lui\t$v0, 0x6666\n ori\t$v0, $v0, 0x6667\n mult\t$a0, $v0\n sra\t$a0, $a0, 0x1f\n mfhi\t$v1\n sra\t$v0, $v1, 0x2\n nop\n jr\t$ra\n subu\t$v0, $v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc10` — benchmark function synthetic:divc10:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc10:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x6666\n 4:\tori\tv0,v0,0x6667\n 8:\tmult\ta0,v0\n c:\tsra\ta0,a0,0x1f\n 10:\tmfhi\tv1\n 14:\tsra\tv0,v1,0x2\n 18:\tnop\n 1c:\tjr\tra\n 20:\tsubu\tv0,v0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-050afe56ee48148d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 divc10\n\n\nContents of section .text:\n 0000 3c026666 34426667 00820018 000427c3 <.ff4Bfg......'.\n 0010 00001810 00031083 00000000 03e00008 ................\n 0020 00441023 00000000 00000000 00000000 .D.#............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc10:ido7.1","sym":"divc10","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc10(int a){ return a/10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdiv\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 divc10\n\n\nContents of section .text:\n 0000 2401000a 0081001a 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 35306166 65353665 65343831 ef-050afe56ee481\n 0130 3438642f 7265662e 63006469 76633130 48d/ref.c.divc10\n 0140 00000000 64697663 31300000 00000000 ....divc10......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc10(s32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc10(s32 arg0) {\n return arg0 / 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc10` — benchmark function synthetic:divc10:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc10\n li\t$at, 10\n div\t$zero, $a0, $at\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc10` — benchmark function synthetic:divc10:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc10:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdiv\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 divc10\n\n\nContents of section .text:\n 0000 2401000a 0081001a 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 35306166 65353665 65343831 ef-050afe56ee481\n 0130 3438642f 7265662e 63006469 76633130 48d/ref.c.divc10\n 0140 00000000 64697663 31300000 00000000 ....divc10......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc10:mwcc_242_81","sym":"divc10","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc10(int a){ return a/10; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,26214\n 4:\taddi r0,r4,26215\n 8:\tmulhw r0,r0,r3\n c:\tsrawi r0,r0,2\n 10:\tsrwi r3,r0,31\n 14:\tadd r3,r0,r3\n 18:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c divc10\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divc10\n\n\nContents of section .text:\n 0000 3c806666 38046667 7c001896 7c001670 <.ff8.fg|...|..p\n 0010 54030ffe 7c601a14 4e800020 T...|`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc10(s32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 divc10(s32 arg0) {\n return arg0 / 10;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc10` — benchmark function synthetic:divc10:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc10\n lis r4,26214\n addi r0,r4,26215\n mulhw r0,r0,r3\n srawi r0,r0,2\n srwi r3,r0,31\n add r3,r0,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc10` — benchmark function synthetic:divc10:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc10:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,26214\n 4:\taddi r0,r4,26215\n 8:\tmulhw r0,r0,r3\n c:\tsrawi r0,r0,2\n 10:\tsrwi r3,r0,31\n 14:\tadd r3,r0,r3\n 18:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c divc10\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divc10\n\n\nContents of section .text:\n 0000 3c806666 38046667 7c001896 7c001670 <.ff8.fg|...|..p\n 0010 54030ffe 7c601a14 4e800020 T...|`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc100:agbcc","sym":"divc100","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc100(int a){ return a/100; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc100\n\t.type\t divc100,function\n\t.thumb_func\ndivc100:\n\tpush\t{lr}\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc100,.Lfe1-divc100\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc100(s32 a0) {\n return a0 / 100;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc100(s32 arg0) {\n return arg0 / 100;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc100` — benchmark function synthetic:divc100:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc100\n\t.type\t divc100,function\n\t.thumb_func\ndivc100:\n\tpush\t{lr}\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc100,.Lfe1-divc100\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc100 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc100` — benchmark function synthetic:divc100:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc100:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc100\n\t.type\t divc100,function\n\t.thumb_func\ndivc100:\n\tpush\t{lr}\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc100,.Lfe1-divc100\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc100 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc100:gcc2.7.2kmc","sym":"divc100","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc100(int a){ return a/100; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x51eb\n 4:\tori\tv0,v0,0x851f\n 8:\tmult\ta0,v0\n c:\tsra\ta0,a0,0x1f\n 10:\tmfhi\tv1\n 14:\tsra\tv0,v1,0x5\n 18:\tnop\n 1c:\tjr\tra\n 20:\tsubu\tv0,v0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f8af8551f41dcd5f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 divc100\n\n\nContents of section .text:\n 0000 3c0251eb 3442851f 00820018 000427c3 <.Q.4B........'.\n 0010 00001810 00031143 00000000 03e00008 .......C........\n 0020 00441023 00000000 00000000 00000000 .D.#............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc100(s32 a0) {\n return a0 / 100;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc100(s32 arg0) {\n return arg0 / 100;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc100` — benchmark function synthetic:divc100:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc100\n lui\t$v0, 0x51eb\n ori\t$v0, $v0, 0x851f\n mult\t$a0, $v0\n sra\t$a0, $a0, 0x1f\n mfhi\t$v1\n sra\t$v0, $v1, 0x5\n nop\n jr\t$ra\n subu\t$v0, $v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc100 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc100` — benchmark function synthetic:divc100:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc100:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x51eb\n 4:\tori\tv0,v0,0x851f\n 8:\tmult\ta0,v0\n c:\tsra\ta0,a0,0x1f\n 10:\tmfhi\tv1\n 14:\tsra\tv0,v1,0x5\n 18:\tnop\n 1c:\tjr\tra\n 20:\tsubu\tv0,v0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f8af8551f41dcd5f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 divc100\n\n\nContents of section .text:\n 0000 3c0251eb 3442851f 00820018 000427c3 <.Q.4B........'.\n 0010 00001810 00031143 00000000 03e00008 .......C........\n 0020 00441023 00000000 00000000 00000000 .D.#............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc100 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc100:ido7.1","sym":"divc100","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc100(int a){ return a/100; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,100\n 4:\tdiv\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 divc100\n\n\nContents of section .text:\n 0000 24010064 0081001a 00001012 03e00008 $..d............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 38616638 35353166 34316463 ef-f8af8551f41dc\n 0130 6435662f 7265662e 63006469 76633130 d5f/ref.c.divc10\n 0140 30000000 64697663 31303000 00000000 0...divc100.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc100(s32 a0) {\n return a0 / 100;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc100(s32 arg0) {\n return arg0 / 100;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc100` — benchmark function synthetic:divc100:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc100\n li\t$at, 100\n div\t$zero, $a0, $at\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc100 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc100` — benchmark function synthetic:divc100:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc100:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,100\n 4:\tdiv\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 divc100\n\n\nContents of section .text:\n 0000 24010064 0081001a 00001012 03e00008 $..d............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 38616638 35353166 34316463 ef-f8af8551f41dc\n 0130 6435662f 7265662e 63006469 76633130 d5f/ref.c.divc10\n 0140 30000000 64697663 31303000 00000000 0...divc100.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc100 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc100:mwcc_242_81","sym":"divc100","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc100(int a){ return a/100; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,20972\n 4:\taddi r0,r4,-31457\n 8:\tmulhw r0,r0,r3\n c:\tsrawi r0,r0,5\n 10:\tsrwi r3,r0,31\n 14:\tadd r3,r0,r3\n 18:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c divc100\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divc100\n\n\nContents of section .text:\n 0000 3c8051ec 3804851f 7c001896 7c002e70 <.Q.8...|...|..p\n 0010 54030ffe 7c601a14 4e800020 T...|`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc100(s32 a0) {\n return a0 / 100;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 divc100(s32 arg0) {\n return arg0 / 100;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc100` — benchmark function synthetic:divc100:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc100\n lis r4,20972\n addi r0,r4,-31457\n mulhw r0,r0,r3\n srawi r0,r0,5\n srwi r3,r0,31\n add r3,r0,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc100 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc100` — benchmark function synthetic:divc100:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc100:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,20972\n 4:\taddi r0,r4,-31457\n 8:\tmulhw r0,r0,r3\n c:\tsrawi r0,r0,5\n 10:\tsrwi r3,r0,31\n 14:\tadd r3,r0,r3\n 18:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c divc100\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divc100\n\n\nContents of section .text:\n 0000 3c8051ec 3804851f 7c001896 7c002e70 <.Q.8...|...|..p\n 0010 54030ffe 7c601a14 4e800020 T...|`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc100 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divv:agbcc","sym":"divv","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","div-reg","signed"],"loc":1,"refSource":"int divv(int a,int b){ return a/b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivv\n\t.type\t divv,function\n\t.thumb_func\ndivv:\n\tpush\t{lr}\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divv,.Lfe1-divv\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divv(s32 a0, s32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divv(s32 arg0, s32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divv` — benchmark function synthetic:divv:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivv\n\t.type\t divv,function\n\t.thumb_func\ndivv:\n\tpush\t{lr}\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divv,.Lfe1-divv\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divv` — benchmark function synthetic:divv:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divv:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivv\n\t.type\t divv,function\n\t.thumb_func\ndivv:\n\tpush\t{lr}\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divv,.Lfe1-divv\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divv # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divv:gcc2.7.2kmc","sym":"divv","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","div-reg","signed"],"loc":1,"refSource":"int divv(int a,int b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tbnez\ta1,10 \n 8:\tnop\n c:\tbreak\t0x7\n 10:\tli\tat,-1\n 14:\tbne\ta1,at,28 \n 18:\tlui\tat,0x8000\n 1c:\tbne\ta0,at,28 \n 20:\tnop\n 24:\tbreak\t0x6\n 28:\tmflo\tv0\n 2c:\tjr\tra\n 30:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-624a65548825e4af/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 divv\n\n\nContents of section .text:\n 0000 0085001a 14a00002 00000000 0007000d ................\n 0010 2401ffff 14a10004 3c018000 14810002 $.......<.......\n 0020 00000000 0006000d 00001012 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divv(s32 a0, s32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divv(s32 arg0, s32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divv` — benchmark function synthetic:divv:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divv\n div\t$zero, $a0, $a1\n bnez\t$a1, .L10\n nop\n break\t0x7\n.L10:\n li\t$at, -1\n bne\t$a1, $at, .L28\n lui\t$at, 0x8000\n bne\t$a0, $at, .L28\n nop\n break\t0x6\n.L28:\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divv` — benchmark function synthetic:divv:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divv:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tbnez\ta1,10 \n 8:\tnop\n c:\tbreak\t0x7\n 10:\tli\tat,-1\n 14:\tbne\ta1,at,28 \n 18:\tlui\tat,0x8000\n 1c:\tbne\ta0,at,28 \n 20:\tnop\n 24:\tbreak\t0x6\n 28:\tmflo\tv0\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-624a65548825e4af/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 divv\n\n\nContents of section .text:\n 0000 0085001a 14a00002 00000000 0007000d ................\n 0010 2401ffff 14a10004 3c018000 14810002 $.......<.......\n 0020 00000000 0006000d 00001012 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divv:ido7.1","sym":"divv","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","div-reg","signed"],"loc":1,"refSource":"int divv(int a,int b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tmflo\tv0\n 8:\tbnez\ta1,14 \n c:\tnop\n 10:\tbreak\t0x7\n 14:\tli\tat,-1\n 18:\tbne\ta1,at,2c \n 1c:\tlui\tat,0x8000\n 20:\tbne\ta0,at,2c \n 24:\tnop\n 28:\tbreak\t0x6\n 2c:\tjr\tra\n 30:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 divv\n\n\nContents of section .text:\n 0000 0085001a 00001012 14a00002 00000000 ................\n 0010 0007000d 2401ffff 14a10004 3c018000 ....$.......<...\n 0020 14810002 00000000 0006000d 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001a8 p...............\n 0010 00000005 000002e8 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000034 00000254 ...........4...T\n 0040 00000008 00000288 00000001 00000290 ................\n 0050 00000000 00000000 00000001 000002d8 ................\n 0060 08030000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000034 20200001 00000001 .......4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 32346136 35353438 38323565 ef-624a65548825e\n 0130 3461662f 7265662e 63006469 76760000 4af/ref.c.divv..\n 0140 64697676 00000000 00000000 00000001 divv............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000d 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divv(s32 a0, s32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divv(s32 arg0, s32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divv` — benchmark function synthetic:divv:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divv\n div\t$zero, $a0, $a1\n mflo\t$v0\n bnez\t$a1, .L14\n nop\n break\t0x7\n.L14:\n li\t$at, -1\n bne\t$a1, $at, .L2c\n lui\t$at, 0x8000\n bne\t$a0, $at, .L2c\n nop\n break\t0x6\n.L2c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divv` — benchmark function synthetic:divv:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divv:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tmflo\tv0\n 8:\tbnez\ta1,14 \n c:\tnop\n 10:\tbreak\t0x7\n 14:\tli\tat,-1\n 18:\tbne\ta1,at,2c \n 1c:\tlui\tat,0x8000\n 20:\tbne\ta0,at,2c \n 24:\tnop\n 28:\tbreak\t0x6\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 divv\n\n\nContents of section .text:\n 0000 0085001a 00001012 14a00002 00000000 ................\n 0010 0007000d 2401ffff 14a10004 3c018000 ....$.......<...\n 0020 14810002 00000000 0006000d 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001a8 p...............\n 0010 00000005 000002e8 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000034 00000254 ...........4...T\n 0040 00000008 00000288 00000001 00000290 ................\n 0050 00000000 00000000 00000001 000002d8 ................\n 0060 08030000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000034 20200001 00000001 .......4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 32346136 35353438 38323565 ef-624a65548825e\n 0130 3461662f 7265662e 63006469 76760000 4af/ref.c.divv..\n 0140 64697676 00000000 00000000 00000001 divv............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000d 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divv:mwcc_242_81","sym":"divv","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","div-reg","signed"],"loc":1,"refSource":"int divv(int a,int b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivw r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 divv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divv\n\n\nContents of section .text:\n 0000 7c6323d6 4e800020 |c#.N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divv(s32 a0, s32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divv(s32 arg0, s32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divv` — benchmark function synthetic:divv:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divv\n divw r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divv` — benchmark function synthetic:divv:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divv:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivw r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 divv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divv\n\n\nContents of section .text:\n 0000 7c6323d6 4e800020 |c#.N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dotprod:agbcc","sym":"dotprod","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","memory","arithmetic"],"loc":1,"refSource":"int dotprod(int *a,int *b,int n){ int s=0,i; for(i=0;i= a2) {\n v2 = 0;\n } else {\n v0 = a0;\n v1 = a1;\n v2 = 0;\n v3 = a2;\n do {\n v2 = v2 + *v0 * *v1;\n v0 = v0 + 1;\n v1 = v1 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n }\n return v2;\n}\n","score":9,"maxScore":20,"compileErrors":null,"breakdown":{"insert":3,"delete":1,"replace":0,"opMismatch":1,"argMismatch":4},"quality":{"score":100,"lines":21,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 dotprod(s32 *arg0, s32 *arg1, s32 arg2) {\n s32 *var_r4;\n s32 *var_r5;\n s32 temp_r0;\n s32 temp_r1;\n s32 var_r2;\n s32 var_r3;\n\n var_r2 = arg2;\n var_r3 = 0;\n if (var_r2 > 0) {\n var_r5 = arg1;\n var_r4 = arg0;\n do {\n temp_r0 = *var_r4;\n var_r4 += 4;\n temp_r1 = *var_r5;\n var_r5 += 4;\n var_r3 += temp_r0 * temp_r1;\n var_r2 -= 1;\n } while (var_r2 != 0);\n }\n return var_r3;\n}\n","score":11,"maxScore":19,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":2,"opMismatch":1,"argMismatch":6},"quality":{"score":100,"lines":23,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":9,"maxScore":20,"ratio":0.45,"kinds":{"insert":3,"delete":1,"replace":0,"opMismatch":1,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dotprod` — benchmark function synthetic:dotprod:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdotprod\n\t.type\t dotprod,function\n\t.thumb_func\ndotprod:\n\tpush\t{r4, r5, lr}\n\tmov\tr3, #0x0\n\tcmp\tr3, r2\n\tbge\t.L4\t@cond_branch\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n.L6:\n\tldmia\tr4!, {r0}\n\tldmia\tr5!, {r1}\n\tmul\tr0, r0, r1\n\tadd\tr3, r3, r0\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t dotprod,.Lfe1-dotprod\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint dotprod(int*,int*,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dotprod # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dotprod` — benchmark function synthetic:dotprod:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dotprod:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdotprod\n\t.type\t dotprod,function\n\t.thumb_func\ndotprod:\n\tpush\t{r4, r5, lr}\n\tmov\tr3, #0x0\n\tcmp\tr3, r2\n\tbge\t.L4\t@cond_branch\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n.L6:\n\tldmia\tr4!, {r0}\n\tldmia\tr5!, {r1}\n\tmul\tr0, r0, r1\n\tadd\tr3, r3, r0\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t dotprod,.Lfe1-dotprod\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name dotprod # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dotprod:gcc2.7.2kmc","sym":"dotprod","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","memory","arithmetic"],"loc":1,"refSource":"int dotprod(int *a,int *b,int n){ int s=0,i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\tt0,zero\n 8:\tblez\ta2,38 \n c:\tmove\ta3,zero\n 10:\tlw\tv1,0(a0)\n 14:\tlw\tv0,0(a1)\n 18:\tmult\tv1,v0\n 1c:\tmflo\tv1\n 20:\taddiu\ta1,a1,4\n 24:\taddiu\ta0,a0,4\n 28:\taddiu\tt0,t0,1\n 2c:\tslt\tv0,t0,a2\n 30:\tbnez\tv0,10 \n 34:\taddu\ta3,a3,v1\n 38:\tmove\tv0,a3\n 3c:\tjr\tra\n 40:\taddiu\tsp,sp,8\n\t...\n","ctx":"int dotprod(int*,int*,int);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-bb273c3cb661c234/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000044 dotprod\n\n\nContents of section .text:\n 0000 27bdfff8 00004021 18c0000b 00003821 '.....@!......8!\n 0010 8c830000 8ca20000 00620018 00001812 .........b......\n 0020 24a50004 24840004 25080001 0106102a $...$...%......*\n 0030 1440fff7 00e33821 00e01021 03e00008 .@....8!...!....\n 0040 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 dotprod(s32 * a0, s32 * a1, s32 a2) {\n s32 * v0;\n s32 * v1;\n s32 v2;\n s32 v3;\n v0 = a0;\n v1 = a1;\n v2 = 0;\n v3 = 0;\n while (v2 < a2) {\n v2 = v2 + 1;\n v3 = v3 + *v0 * *v1;\n v1 = v1 + 1;\n v0 = v0 + 1;\n }\n return v3;\n}\n","score":8,"maxScore":17,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":8},"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 dotprod(s32 *arg0, s32 *arg1, s32 arg2) {\n s32 *var_a0;\n s32 *var_a1;\n s32 temp_v1;\n s32 var_a3;\n s32 var_t0;\n\n var_a0 = arg0;\n var_a1 = arg1;\n var_t0 = 0;\n var_a3 = 0;\n if (arg2 > 0) {\n do {\n temp_v1 = *var_a0 * *var_a1;\n var_a1 += 4;\n var_a0 += 4;\n var_t0 += 1;\n var_a3 += temp_v1;\n } while (var_t0 < arg2);\n }\n return var_a3;\n}\n","score":10,"maxScore":17,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":7},"quality":{"score":100,"lines":21,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":8,"maxScore":17,"ratio":0.47058823529411764,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":8}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dotprod` — benchmark function synthetic:dotprod:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dotprod\n addiu\t$sp, $sp, -8\n move\t$t0, $zero\n blez\t$a2, .L38\n move\t$a3, $zero\n.L10:\n lw\t$v1, 0($a0)\n lw\t$v0, 0($a1)\n mult\t$v1, $v0\n mflo\t$v1\n addiu\t$a1, $a1, 4\n addiu\t$a0, $a0, 4\n addiu\t$t0, $t0, 1\n slt\t$v0, $t0, $a2\n bnez\t$v0, .L10\n addu\t$a3, $a3, $v1\n.L38:\n move\t$v0, $a3\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint dotprod(int*,int*,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dotprod # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dotprod` — benchmark function synthetic:dotprod:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dotprod:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\tt0,zero\n 8:\tblez\ta2,38 \n c:\tmove\ta3,zero\n 10:\tlw\tv1,0(a0)\n 14:\tlw\tv0,0(a1)\n 18:\tmult\tv1,v0\n 1c:\tmflo\tv1\n 20:\taddiu\ta1,a1,4\n 24:\taddiu\ta0,a0,4\n 28:\taddiu\tt0,t0,1\n 2c:\tslt\tv0,t0,a2\n 30:\tbnez\tv0,10 \n 34:\taddu\ta3,a3,v1\n 38:\tmove\tv0,a3\n 3c:\tjr\tra\n 40:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-bb273c3cb661c234/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000044 dotprod\n\n\nContents of section .text:\n 0000 27bdfff8 00004021 18c0000b 00003821 '.....@!......8!\n 0010 8c830000 8ca20000 00620018 00001812 .........b......\n 0020 24a50004 24840004 25080001 0106102a $...$...%......*\n 0030 1440fff7 00e33821 00e01021 03e00008 .@....8!...!....\n 0040 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name dotprod # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dotprod:ido7.1","sym":"dotprod","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","memory","arithmetic"],"loc":1,"refSource":"int dotprod(int *a,int *b,int n){ int s=0,i; for(i=0;i:\n 0:\tsw\ta1,4(sp)\n 4:\tmove\tv1,zero\n 8:\tblez\ta2,dc \n c:\tmove\tv0,zero\n 10:\tandi\tt2,a2,0x3\n 14:\tbeqz\tt2,5c \n 18:\tmove\tt1,t2\n 1c:\tlw\tt6,4(sp)\n 20:\tsll\ta1,zero,0x2\n 24:\taddu\ta3,a0,a1\n 28:\taddu\tt0,t6,a1\n 2c:\tlw\tt7,0(a3)\n 30:\tlw\tt8,0(t0)\n 34:\taddiu\tv0,v0,1\n 38:\taddiu\ta3,a3,4\n 3c:\tmultu\tt7,t8\n 40:\taddiu\tt0,t0,4\n 44:\tmflo\tt9\n 48:\taddu\tv1,v1,t9\n 4c:\tbnel\tt1,v0,30 \n 50:\tlw\tt7,0(a3)\n 54:\tbeq\tv0,a2,dc \n 58:\tnop\n 5c:\tlw\tt3,4(sp)\n 60:\tsll\ta1,v0,0x2\n 64:\tsll\tt4,a2,0x2\n 68:\taddu\ta3,a0,a1\n 6c:\taddu\tt1,t4,t3\n 70:\taddu\tt0,t3,a1\n 74:\tlw\tt5,0(a3)\n 78:\tlw\tt6,0(t0)\n 7c:\tlw\tt8,4(a3)\n 80:\tlw\tt9,4(t0)\n 84:\tmultu\tt5,t6\n 88:\tlw\tt5,8(t0)\n 8c:\tlw\tt3,8(a3)\n 90:\taddiu\tt0,t0,16\n 94:\taddiu\ta3,a3,16\n 98:\tmflo\tt7\n 9c:\taddu\tv1,v1,t7\n a0:\tlw\tt7,-4(a3)\n a4:\tmultu\tt8,t9\n a8:\tlw\tt8,-4(t0)\n ac:\tmflo\tt4\n b0:\taddu\tv1,v1,t4\n b4:\tnop\n b8:\tmultu\tt3,t5\n bc:\tmflo\tt6\n c0:\taddu\tv1,v1,t6\n c4:\tnop\n c8:\tmultu\tt7,t8\n cc:\tmflo\tt9\n d0:\taddu\tv1,v1,t9\n d4:\tbnel\tt0,t1,78 \n d8:\tlw\tt5,0(a3)\n dc:\tjr\tra\n e0:\tmove\tv0,v1\n\t...\n","ctx":"int dotprod(int*,int*,int);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000f0 .text\n00000000 g F .text\t000000e4 dotprod\n\n\nContents of section .text:\n 0000 afa50004 00001825 18c00034 00001025 .......%...4...%\n 0010 30ca0003 11400011 01404825 8fae0004 0....@...@H%....\n 0020 00002880 00853821 01c54021 8cef0000 ..(...8!..@!....\n 0030 8d180000 24420001 24e70004 01f80019 ....$B..$.......\n 0040 25080004 0000c812 00791821 5522fff8 %........y.!U\"..\n 0050 8cef0000 10460021 00000000 8fab0004 .....F.!........\n 0060 00022880 00066080 00853821 018b4821 ..(...`...8!..H!\n 0070 01654021 8ced0000 8d0e0000 8cf80004 .e@!............\n 0080 8d190004 01ae0019 8d0d0008 8ceb0008 ................\n 0090 25080010 24e70010 00007812 006f1821 %...$.....x..o.!\n 00a0 8ceffffc 03190019 8d18fffc 00006012 ..............`.\n 00b0 006c1821 00000000 016d0019 00007012 .l.!.....m....p.\n 00c0 006e1821 00000000 01f80019 0000c812 .n.!............\n 00d0 00791821 5509ffe8 8ced0000 03e00008 .y.!U...........\n 00e0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 a300fffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300fffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000039 00000008 00000258 p......9.......X\n 0010 00000005 000003a0 00000001 00000260 ...............`\n 0020 00000004 00000294 00000000 00000000 ................\n 0030 00000011 000002c4 00000038 00000308 ...........8....\n 0040 00000008 00000340 00000001 00000348 .......@.......H\n 0050 00000000 00000000 00000001 00000390 ................\n 0060 08080808 08080200 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000e4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d62 62323733 63336362 ps-ref-bb273c3cb\n 0130 36363163 3233342f 7265662e 6300646f 661c234/ref.c.do\n 0140 7470726f 64000000 646f7470 726f6400 tprod...dotprod.\n 0150 00000000 00000001 00000000 00000036 ...............6\n 0160 00000000 00000004 00000000 00000039 ...............9\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000007 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'dotprod' — lift: cannot lift 'dotprod': unmodelled control transfer 'bnel' at 0x4c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta1,4(sp) */\n/* 4:\tmove\tv1,zero */\n/* 8:\tblez\ta2,dc */\n/* c:\tmove\tv0,zero */\n/* 10:\tandi\tt2,a2,0x3 */\n/* 14:\tbeqz\tt2,5c */\n/* 18:\tmove\tt1,t2 */\n/* 1c:\tlw\tt6,4(sp) */\n/* 20:\tsll\ta1,zero,0x2 */\n/* 24:\taddu\ta3,a0,a1 */\n/* 28:\taddu\tt0,t6,a1 */\n/* 2c:\tlw\tt7,0(a3) */\n/* 30:\tlw\tt8,0(t0) */\n/* 34:\taddiu\tv0,v0,1 */\n/* 38:\taddiu\ta3,a3,4 */\n/* 3c:\tmultu\tt7,t8 */\n/* 40:\taddiu\tt0,t0,4 */\n/* 44:\tmflo\tt9 */\n/* 48:\taddu\tv1,v1,t9 */\n/* 4c:\tbnel\tt1,v0,30 */\n/* 50:\tlw\tt7,0(a3) */\n/* 54:\tbeq\tv0,a2,dc */\n/* 58:\tnop */\n/* 5c:\tlw\tt3,4(sp) */\n/* 60:\tsll\ta1,v0,0x2 */\n/* 64:\tsll\tt4,a2,0x2 */\n/* 68:\taddu\ta3,a0,a1 */\n/* 6c:\taddu\tt1,t4,t3 */\n/* 70:\taddu\tt0,t3,a1 */\n/* 74:\tlw\tt5,0(a3) */\n/* 78:\tlw\tt6,0(t0) */\n/* 7c:\tlw\tt8,4(a3) */\n/* 80:\tlw\tt9,4(t0) */\n/* 84:\tmultu\tt5,t6 */\n/* 88:\tlw\tt5,8(t0) */\n/* 8c:\tlw\tt3,8(a3) */\n/* 90:\taddiu\tt0,t0,16 */\n/* 94:\taddiu\ta3,a3,16 */\n/* 98:\tmflo\tt7 */\n/* 9c:\taddu\tv1,v1,t7 */\n/* a0:\tlw\tt7,-4(a3) */\n/* a4:\tmultu\tt8,t9 */\n/* a8:\tlw\tt8,-4(t0) */\n/* ac:\tmflo\tt4 */\n/* b0:\taddu\tv1,v1,t4 */\n/* b4:\tnop */\n/* b8:\tmultu\tt3,t5 */\n/* bc:\tmflo\tt6 */\n/* c0:\taddu\tv1,v1,t6 */\n/* c4:\tnop */\n/* c8:\tmultu\tt7,t8 */\n/* cc:\tmflo\tt9 */\n/* d0:\taddu\tv1,v1,t9 */\n/* d4:\tbnel\tt0,t1,78 */\n/* d8:\tlw\tt5,0(a3) */\n/* dc:\tjr\tra */\n/* e0:\tmove\tv0,v1 */\n/* \t... */\nvoid dotprod(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'dotprod': unmodelled control transfer 'bnel' at 0x4c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":66,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'dotprod': unmodelled control transfer 'bnel' at 0x4c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 dotprod(s32 *arg0, s32 *arg1, s32 arg2) {\n s32 *var_a3;\n s32 *var_a3_2;\n s32 *var_t0;\n s32 *var_t0_2;\n s32 temp_lo;\n s32 temp_lo_2;\n s32 temp_t2;\n s32 temp_t3;\n s32 temp_t5;\n s32 temp_t7;\n s32 temp_t8;\n s32 temp_t9;\n s32 var_v0;\n s32 var_v1;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg2 > 0) {\n temp_t2 = arg2 & 3;\n if (temp_t2 != 0) {\n var_a3 = &arg0[0];\n var_t0 = &arg1[0];\n do {\n temp_t7 = *var_a3;\n var_v0 += 1;\n var_a3 += 4;\n temp_lo = temp_t7 * *var_t0;\n var_t0 += 4;\n var_v1 += temp_lo;\n } while (temp_t2 != var_v0);\n if (var_v0 != arg2) {\n goto block_5;\n }\n } else {\nblock_5:\n var_a3_2 = &arg0[var_v0];\n var_t0_2 = &arg1[var_v0];\n do {\n temp_t8 = var_a3_2->unk4;\n temp_t9 = var_t0_2->unk4;\n temp_lo_2 = var_a3_2->unk0 * var_t0_2->unk0;\n temp_t5 = var_t0_2->unk8;\n temp_t3 = var_a3_2->unk8;\n var_t0_2 += 0x10;\n var_a3_2 += 0x10;\n var_v1 = var_v1 + temp_lo_2 + (temp_t8 * temp_t9) + (temp_t3 * temp_t5) + (var_a3_2->unk-4 * var_t0_2->unk-4);\n } while (var_t0_2 != &arg1[arg2]);\n }\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":6,"quality":{"score":88,"lines":51,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 41: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 42: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 43: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 44: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 45: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dotprod` — benchmark function synthetic:dotprod:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dotprod\n sw\t$a1, 4($sp)\n move\t$v1, $zero\n blez\t$a2, .Ldc\n move\t$v0, $zero\n andi\t$t2, $a2, 0x3\n beqz\t$t2, .L5c\n move\t$t1, $t2\n lw\t$t6, 4($sp)\n sll\t$a1, $zero, 0x2\n addu\t$a3, $a0, $a1\n addu\t$t0, $t6, $a1\n lw\t$t7, 0($a3)\n.L30:\n lw\t$t8, 0($t0)\n addiu\t$v0, $v0, 1\n addiu\t$a3, $a3, 4\n multu\t$t7, $t8\n addiu\t$t0, $t0, 4\n mflo\t$t9\n addu\t$v1, $v1, $t9\n bnel\t$t1, $v0, .L30\n lw\t$t7, 0($a3)\n beq\t$v0, $a2, .Ldc\n nop\n.L5c:\n lw\t$t3, 4($sp)\n sll\t$a1, $v0, 0x2\n sll\t$t4, $a2, 0x2\n addu\t$a3, $a0, $a1\n addu\t$t1, $t4, $t3\n addu\t$t0, $t3, $a1\n lw\t$t5, 0($a3)\n.L78:\n lw\t$t6, 0($t0)\n lw\t$t8, 4($a3)\n lw\t$t9, 4($t0)\n multu\t$t5, $t6\n lw\t$t5, 8($t0)\n lw\t$t3, 8($a3)\n addiu\t$t0, $t0, 16\n addiu\t$a3, $a3, 16\n mflo\t$t7\n addu\t$v1, $v1, $t7\n lw\t$t7, -4($a3)\n multu\t$t8, $t9\n lw\t$t8, -4($t0)\n mflo\t$t4\n addu\t$v1, $v1, $t4\n nop\n multu\t$t3, $t5\n mflo\t$t6\n addu\t$v1, $v1, $t6\n nop\n multu\t$t7, $t8\n mflo\t$t9\n addu\t$v1, $v1, $t9\n bnel\t$t0, $t1, .L78\n lw\t$t5, 0($a3)\n.Ldc:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint dotprod(int*,int*,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dotprod # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dotprod` — benchmark function synthetic:dotprod:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dotprod:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tmove\tv1,zero\n 8:\tblez\ta2,dc \n c:\tmove\tv0,zero\n 10:\tandi\tt2,a2,0x3\n 14:\tbeqz\tt2,5c \n 18:\tmove\tt1,t2\n 1c:\tlw\tt6,4(sp)\n 20:\tsll\ta1,zero,0x2\n 24:\taddu\ta3,a0,a1\n 28:\taddu\tt0,t6,a1\n 2c:\tlw\tt7,0(a3)\n 30:\tlw\tt8,0(t0)\n 34:\taddiu\tv0,v0,1\n 38:\taddiu\ta3,a3,4\n 3c:\tmultu\tt7,t8\n 40:\taddiu\tt0,t0,4\n 44:\tmflo\tt9\n 48:\taddu\tv1,v1,t9\n 4c:\tbnel\tt1,v0,30 \n 50:\tlw\tt7,0(a3)\n 54:\tbeq\tv0,a2,dc \n 58:\tnop\n 5c:\tlw\tt3,4(sp)\n 60:\tsll\ta1,v0,0x2\n 64:\tsll\tt4,a2,0x2\n 68:\taddu\ta3,a0,a1\n 6c:\taddu\tt1,t4,t3\n 70:\taddu\tt0,t3,a1\n 74:\tlw\tt5,0(a3)\n 78:\tlw\tt6,0(t0)\n 7c:\tlw\tt8,4(a3)\n 80:\tlw\tt9,4(t0)\n 84:\tmultu\tt5,t6\n 88:\tlw\tt5,8(t0)\n 8c:\tlw\tt3,8(a3)\n 90:\taddiu\tt0,t0,16\n 94:\taddiu\ta3,a3,16\n 98:\tmflo\tt7\n 9c:\taddu\tv1,v1,t7\n a0:\tlw\tt7,-4(a3)\n a4:\tmultu\tt8,t9\n a8:\tlw\tt8,-4(t0)\n ac:\tmflo\tt4\n b0:\taddu\tv1,v1,t4\n b4:\tnop\n b8:\tmultu\tt3,t5\n bc:\tmflo\tt6\n c0:\taddu\tv1,v1,t6\n c4:\tnop\n c8:\tmultu\tt7,t8\n cc:\tmflo\tt9\n d0:\taddu\tv1,v1,t9\n d4:\tbnel\tt0,t1,78 \n d8:\tlw\tt5,0(a3)\n dc:\tjr\tra\n e0:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000f0 .text\n00000000 g F .text\t000000e4 dotprod\n\n\nContents of section .text:\n 0000 afa50004 00001825 18c00034 00001025 .......%...4...%\n 0010 30ca0003 11400011 01404825 8fae0004 0....@...@H%....\n 0020 00002880 00853821 01c54021 8cef0000 ..(...8!..@!....\n 0030 8d180000 24420001 24e70004 01f80019 ....$B..$.......\n 0040 25080004 0000c812 00791821 5522fff8 %........y.!U\"..\n 0050 8cef0000 10460021 00000000 8fab0004 .....F.!........\n 0060 00022880 00066080 00853821 018b4821 ..(...`...8!..H!\n 0070 01654021 8ced0000 8d0e0000 8cf80004 .e@!............\n 0080 8d190004 01ae0019 8d0d0008 8ceb0008 ................\n 0090 25080010 24e70010 00007812 006f1821 %...$.....x..o.!\n 00a0 8ceffffc 03190019 8d18fffc 00006012 ..............`.\n 00b0 006c1821 00000000 016d0019 00007012 .l.!.....m....p.\n 00c0 006e1821 00000000 01f80019 0000c812 .n.!............\n 00d0 00791821 5509ffe8 8ced0000 03e00008 .y.!U...........\n 00e0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 a300fffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300fffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000039 00000008 00000258 p......9.......X\n 0010 00000005 000003a0 00000001 00000260 ...............`\n 0020 00000004 00000294 00000000 00000000 ................\n 0030 00000011 000002c4 00000038 00000308 ...........8....\n 0040 00000008 00000340 00000001 00000348 .......@.......H\n 0050 00000000 00000000 00000001 00000390 ................\n 0060 08080808 08080200 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000e4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d62 62323733 63336362 ps-ref-bb273c3cb\n 0130 36363163 3233342f 7265662e 6300646f 661c234/ref.c.do\n 0140 7470726f 64000000 646f7470 726f6400 tprod...dotprod.\n 0150 00000000 00000001 00000000 00000036 ...............6\n 0160 00000000 00000004 00000000 00000039 ...............9\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000007 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name dotprod # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dotprod:mwcc_242_81","sym":"dotprod","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","memory","arithmetic"],"loc":1,"refSource":"int dotprod(int *a,int *b,int n){ int s=0,i; for(i=0;i:\n 0:\tstwu r1,-48(r1)\n 4:\tmflr r0\n 8:\tstw r0,52(r1)\n c:\taddi r11,r1,48\n 10:\tbl 10 \n\t\t\t10: R_PPC_REL24\t_savegpr_25\n 14:\tcmpwi r5,0\n 18:\tli r0,0\n 1c:\tli r8,0\n 20:\tble 114 \n 24:\tcmpwi r5,8\n 28:\taddi r10,r5,-8\n 2c:\tble dc \n 30:\taddi r9,r10,7\n 34:\tmr r6,r4\n 38:\tsrwi r9,r9,3\n 3c:\tmr r7,r3\n 40:\tmtctr r9\n 44:\tcmpwi r10,0\n 48:\tble dc \n 4c:\tlwz r10,0(r7)\n 50:\taddi r8,r8,8\n 54:\tlwz r9,0(r6)\n 58:\tlwz r12,4(r7)\n 5c:\tmullw r25,r10,r9\n 60:\tlwz r11,4(r6)\n 64:\tlwz r10,8(r7)\n 68:\tlwz r9,8(r6)\n 6c:\tlwz r26,12(r7)\n 70:\tlwz r27,12(r6)\n 74:\tmullw r11,r12,r11\n 78:\tadd r0,r0,r25\n 7c:\tlwz r28,16(r7)\n 80:\tlwz r29,16(r6)\n 84:\tlwz r30,20(r7)\n 88:\tlwz r31,20(r6)\n 8c:\tmullw r25,r10,r9\n 90:\tadd r0,r0,r11\n 94:\tlwz r12,24(r7)\n 98:\tlwz r11,24(r6)\n 9c:\tlwz r10,28(r7)\n a0:\taddi r7,r7,32\n a4:\tlwz r9,28(r6)\n a8:\tmullw r27,r26,r27\n ac:\tadd r0,r0,r25\n b0:\taddi r6,r6,32\n b4:\tmullw r29,r28,r29\n b8:\tadd r0,r0,r27\n bc:\tmullw r31,r30,r31\n c0:\tadd r0,r0,r29\n c4:\tmullw r11,r12,r11\n c8:\tadd r0,r0,r31\n cc:\tmullw r9,r10,r9\n d0:\tadd r0,r0,r11\n d4:\tadd r0,r0,r9\n d8:\tbdnz 4c \n dc:\tslwi r9,r8,2\n e0:\tsubf r6,r8,r5\n e4:\tadd r7,r4,r9\n e8:\tadd r9,r3,r9\n ec:\tmtctr r6\n f0:\tcmpw r8,r5\n f4:\tbge 114 \n f8:\tlwz r4,0(r9)\n fc:\taddi r9,r9,4\n 100:\tlwz r3,0(r7)\n 104:\taddi r7,r7,4\n 108:\tmullw r3,r4,r3\n 10c:\tadd r0,r0,r3\n 110:\tbdnz f8 \n 114:\tmr r3,r0\n 118:\taddi r11,r1,48\n 11c:\tbl 11c \n\t\t\t11c: R_PPC_REL24\t_restgpr_25\n 120:\tlwz r0,52(r1)\n 124:\tmtlr r0\n 128:\taddi r1,r1,48\n 12c:\tblr\n","ctx":"int dotprod(int*,int*,int);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 _savegpr_25\n00000000 *UND*\t00000000 _restgpr_25\n00000000 g F .text\t00000130 dotprod\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_PPC_REL24 _savegpr_25\n0000011c R_PPC_REL24 _restgpr_25\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 dotprod\n\n\nContents of section .text:\n 0000 9421ffd0 7c0802a6 90010034 39610030 .!..|......49a.0\n 0010 48000001 2c050000 38000000 39000000 H...,...8...9...\n 0020 408100f4 2c050008 3945fff8 408100b0 @...,...9E..@...\n 0030 392a0007 7c862378 5529e8fe 7c671b78 9*..|.#xU)..|g.x\n 0040 7d2903a6 2c0a0000 40810094 81470000 })..,...@....G..\n 0050 39080008 81260000 81870004 7f2a49d6 9....&.......*I.\n 0060 81660004 81470008 81260008 8347000c .f...G...&...G..\n 0070 8366000c 7d6c59d6 7c00ca14 83870010 .f..}lY.|.......\n 0080 83a60010 83c70014 83e60014 7f2a49d6 .............*I.\n 0090 7c005a14 81870018 81660018 8147001c |.Z......f...G..\n 00a0 38e70020 8126001c 7f7ad9d6 7c00ca14 8.. .&...z..|...\n 00b0 38c60020 7fbce9d6 7c00da14 7ffef9d6 8.. ....|.......\n 00c0 7c00ea14 7d6c59d6 7c00fa14 7d2a49d6 |...}lY.|...}*I.\n 00d0 7c005a14 7c004a14 4200ff74 5509103a |.Z.|.J.B..tU..:\n 00e0 7cc82850 7ce44a14 7d234a14 7cc903a6 |.(P|.J.}#J.|...\n 00f0 7c082800 40800020 80890000 39290004 |.(.@.. ....9)..\n 0100 80670000 38e70004 7c6419d6 7c001a14 .g..8...|d..|...\n 0110 4200ffe8 7c030378 39610030 48000001 B...|..x9a.0H...\n 0120 80010034 7c0803a6 38210030 4e800020 ...4|...8!.0N.. \nContents of section .mwcats.text:\n 0000 02000130 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000000 00000000 00000004 ................\n 0060 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'dotprod' — lift: cannot lift 'dotprod': stack pointer r1 used as data (address-taken local / frame arithmetic) — not supported */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tstwu r1,-48(r1) */\n/* 4:\tmflr r0 */\n/* 8:\tstw r0,52(r1) */\n/* c:\taddi r11,r1,48 */\n/* 10:\tbl 10 */\n/* \t\t\t10: R_PPC_REL24\t_savegpr_25 */\n/* 14:\tcmpwi r5,0 */\n/* 18:\tli r0,0 */\n/* 1c:\tli r8,0 */\n/* 20:\tble 114 */\n/* 24:\tcmpwi r5,8 */\n/* 28:\taddi r10,r5,-8 */\n/* 2c:\tble dc */\n/* 30:\taddi r9,r10,7 */\n/* 34:\tmr r6,r4 */\n/* 38:\tsrwi r9,r9,3 */\n/* 3c:\tmr r7,r3 */\n/* 40:\tmtctr r9 */\n/* 44:\tcmpwi r10,0 */\n/* 48:\tble dc */\n/* 4c:\tlwz r10,0(r7) */\n/* 50:\taddi r8,r8,8 */\n/* 54:\tlwz r9,0(r6) */\n/* 58:\tlwz r12,4(r7) */\n/* 5c:\tmullw r25,r10,r9 */\n/* 60:\tlwz r11,4(r6) */\n/* 64:\tlwz r10,8(r7) */\n/* 68:\tlwz r9,8(r6) */\n/* 6c:\tlwz r26,12(r7) */\n/* 70:\tlwz r27,12(r6) */\n/* 74:\tmullw r11,r12,r11 */\n/* 78:\tadd r0,r0,r25 */\n/* 7c:\tlwz r28,16(r7) */\n/* 80:\tlwz r29,16(r6) */\n/* 84:\tlwz r30,20(r7) */\n/* 88:\tlwz r31,20(r6) */\n/* 8c:\tmullw r25,r10,r9 */\n/* 90:\tadd r0,r0,r11 */\n/* 94:\tlwz r12,24(r7) */\n/* 98:\tlwz r11,24(r6) */\n/* 9c:\tlwz r10,28(r7) */\n/* a0:\taddi r7,r7,32 */\n/* a4:\tlwz r9,28(r6) */\n/* a8:\tmullw r27,r26,r27 */\n/* ac:\tadd r0,r0,r25 */\n/* b0:\taddi r6,r6,32 */\n/* b4:\tmullw r29,r28,r29 */\n/* b8:\tadd r0,r0,r27 */\n/* bc:\tmullw r31,r30,r31 */\n/* c0:\tadd r0,r0,r29 */\n/* c4:\tmullw r11,r12,r11 */\n/* c8:\tadd r0,r0,r31 */\n/* cc:\tmullw r9,r10,r9 */\n/* d0:\tadd r0,r0,r11 */\n/* d4:\tadd r0,r0,r9 */\n/* d8:\tbdnz 4c */\n/* dc:\tslwi r9,r8,2 */\n/* e0:\tsubf r6,r8,r5 */\n/* e4:\tadd r7,r4,r9 */\n/* e8:\tadd r9,r3,r9 */\n/* ec:\tmtctr r6 */\n/* f0:\tcmpw r8,r5 */\n/* f4:\tbge 114 */\n/* f8:\tlwz r4,0(r9) */\n/* fc:\taddi r9,r9,4 */\n/* 100:\tlwz r3,0(r7) */\n/* 104:\taddi r7,r7,4 */\n/* 108:\tmullw r3,r4,r3 */\n/* 10c:\tadd r0,r0,r3 */\n/* 110:\tbdnz f8 */\n/* 114:\tmr r3,r0 */\n/* 118:\taddi r11,r1,48 */\n/* 11c:\tbl 11c */\n/* \t\t\t11c: R_PPC_REL24\t_restgpr_25 */\n/* 120:\tlwz r0,52(r1) */\n/* 124:\tmtlr r0 */\n/* 128:\taddi r1,r1,48 */\n/* 12c:\tblr */\nvoid dotprod(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'dotprod': stack pointer r1 used as data (address-taken local / frame arithmetic) — not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":86,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'dotprod': stack pointer r1 used as data (address-taken local / frame arithmetic) — not supported"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 dotprod(s32 *arg0, s32 *arg1, s32 arg2, ? arg_sp0) {\n s32 *var_r6;\n s32 *var_r7;\n s32 *var_r7_2;\n s32 *var_r9;\n s32 temp_r0;\n s32 temp_r10;\n s32 temp_r10_2;\n s32 temp_r11;\n s32 temp_r12;\n s32 temp_r25;\n s32 temp_r26;\n s32 temp_r27;\n s32 temp_r28;\n s32 temp_r29;\n s32 temp_r30;\n s32 temp_r31;\n s32 temp_r3;\n s32 temp_r4;\n s32 temp_r9;\n s32 var_ctr_2;\n s32 var_r0;\n s32 var_r8;\n u32 var_ctr;\n\n var_r0 = 0;\n var_r8 = 0;\n if (arg2 > 0) {\n temp_r10 = arg2 - 8;\n if (arg2 > 8) {\n var_r6 = arg1;\n var_r7 = arg0;\n var_ctr = (u32) (temp_r10 + 7) >> 3U;\n if (temp_r10 > 0) {\n do {\n var_r8 += 8;\n temp_r26 = var_r7->unkC;\n temp_r28 = var_r7->unk10;\n temp_r29 = var_r6->unk10;\n temp_r30 = var_r7->unk14;\n temp_r31 = var_r6->unk14;\n temp_r25 = var_r7->unk8 * var_r6->unk8;\n temp_r0 = var_r0 + (var_r7->unk0 * var_r6->unk0) + (var_r7->unk4 * var_r6->unk4);\n temp_r12 = var_r7->unk18;\n temp_r11 = var_r6->unk18;\n temp_r10_2 = var_r7->unk1C;\n var_r7 += 0x20;\n temp_r9 = var_r6->unk1C;\n temp_r27 = temp_r26 * var_r6->unkC;\n var_r6 += 0x20;\n var_r0 = temp_r0 + temp_r25 + temp_r27 + (temp_r28 * temp_r29) + (temp_r30 * temp_r31) + (temp_r12 * temp_r11) + (temp_r10_2 * temp_r9);\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r7_2 = &arg1[var_r8];\n var_r9 = &arg0[var_r8];\n var_ctr_2 = arg2 - var_r8;\n if (var_r8 < arg2) {\n do {\n temp_r4 = *var_r9;\n var_r9 += 4;\n temp_r3 = *var_r7_2;\n var_r7_2 += 4;\n var_r0 += temp_r4 * temp_r3;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r0;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":70,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dotprod` — benchmark function synthetic:dotprod:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dotprod\n stwu r1,-48(r1)\n mflr r0\n stw r0,52(r1)\n addi r11,r1,48\n bl _savegpr_25\n cmpwi r5,0\n li r0,0\n li r8,0\n ble .L114\n cmpwi r5,8\n addi r10,r5,-8\n ble .Ldc\n addi r9,r10,7\n mr r6,r4\n srwi r9,r9,3\n mr r7,r3\n mtctr r9\n cmpwi r10,0\n ble .Ldc\n.L4c:\n lwz r10,0(r7)\n addi r8,r8,8\n lwz r9,0(r6)\n lwz r12,4(r7)\n mullw r25,r10,r9\n lwz r11,4(r6)\n lwz r10,8(r7)\n lwz r9,8(r6)\n lwz r26,12(r7)\n lwz r27,12(r6)\n mullw r11,r12,r11\n add r0,r0,r25\n lwz r28,16(r7)\n lwz r29,16(r6)\n lwz r30,20(r7)\n lwz r31,20(r6)\n mullw r25,r10,r9\n add r0,r0,r11\n lwz r12,24(r7)\n lwz r11,24(r6)\n lwz r10,28(r7)\n addi r7,r7,32\n lwz r9,28(r6)\n mullw r27,r26,r27\n add r0,r0,r25\n addi r6,r6,32\n mullw r29,r28,r29\n add r0,r0,r27\n mullw r31,r30,r31\n add r0,r0,r29\n mullw r11,r12,r11\n add r0,r0,r31\n mullw r9,r10,r9\n add r0,r0,r11\n add r0,r0,r9\n bdnz .L4c\n.Ldc:\n slwi r9,r8,2\n subf r6,r8,r5\n add r7,r4,r9\n add r9,r3,r9\n mtctr r6\n cmpw r8,r5\n bge .L114\n.Lf8:\n lwz r4,0(r9)\n addi r9,r9,4\n lwz r3,0(r7)\n addi r7,r7,4\n mullw r3,r4,r3\n add r0,r0,r3\n bdnz .Lf8\n.L114:\n mr r3,r0\n addi r11,r1,48\n bl _restgpr_25\n lwz r0,52(r1)\n mtlr r0\n addi r1,r1,48\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint dotprod(int*,int*,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dotprod # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dotprod` — benchmark function synthetic:dotprod:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dotprod:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-48(r1)\n 4:\tmflr r0\n 8:\tstw r0,52(r1)\n c:\taddi r11,r1,48\n 10:\tbl 10 \n\t\t\t10: R_PPC_REL24\t_savegpr_25\n 14:\tcmpwi r5,0\n 18:\tli r0,0\n 1c:\tli r8,0\n 20:\tble 114 \n 24:\tcmpwi r5,8\n 28:\taddi r10,r5,-8\n 2c:\tble dc \n 30:\taddi r9,r10,7\n 34:\tmr r6,r4\n 38:\tsrwi r9,r9,3\n 3c:\tmr r7,r3\n 40:\tmtctr r9\n 44:\tcmpwi r10,0\n 48:\tble dc \n 4c:\tlwz r10,0(r7)\n 50:\taddi r8,r8,8\n 54:\tlwz r9,0(r6)\n 58:\tlwz r12,4(r7)\n 5c:\tmullw r25,r10,r9\n 60:\tlwz r11,4(r6)\n 64:\tlwz r10,8(r7)\n 68:\tlwz r9,8(r6)\n 6c:\tlwz r26,12(r7)\n 70:\tlwz r27,12(r6)\n 74:\tmullw r11,r12,r11\n 78:\tadd r0,r0,r25\n 7c:\tlwz r28,16(r7)\n 80:\tlwz r29,16(r6)\n 84:\tlwz r30,20(r7)\n 88:\tlwz r31,20(r6)\n 8c:\tmullw r25,r10,r9\n 90:\tadd r0,r0,r11\n 94:\tlwz r12,24(r7)\n 98:\tlwz r11,24(r6)\n 9c:\tlwz r10,28(r7)\n a0:\taddi r7,r7,32\n a4:\tlwz r9,28(r6)\n a8:\tmullw r27,r26,r27\n ac:\tadd r0,r0,r25\n b0:\taddi r6,r6,32\n b4:\tmullw r29,r28,r29\n b8:\tadd r0,r0,r27\n bc:\tmullw r31,r30,r31\n c0:\tadd r0,r0,r29\n c4:\tmullw r11,r12,r11\n c8:\tadd r0,r0,r31\n cc:\tmullw r9,r10,r9\n d0:\tadd r0,r0,r11\n d4:\tadd r0,r0,r9\n d8:\tbdnz 4c \n dc:\tslwi r9,r8,2\n e0:\tsubf r6,r8,r5\n e4:\tadd r7,r4,r9\n e8:\tadd r9,r3,r9\n ec:\tmtctr r6\n f0:\tcmpw r8,r5\n f4:\tbge 114 \n f8:\tlwz r4,0(r9)\n fc:\taddi r9,r9,4\n 100:\tlwz r3,0(r7)\n 104:\taddi r7,r7,4\n 108:\tmullw r3,r4,r3\n 10c:\tadd r0,r0,r3\n 110:\tbdnz f8 \n 114:\tmr r3,r0\n 118:\taddi r11,r1,48\n 11c:\tbl 11c \n\t\t\t11c: R_PPC_REL24\t_restgpr_25\n 120:\tlwz r0,52(r1)\n 124:\tmtlr r0\n 128:\taddi r1,r1,48\n 12c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 _savegpr_25\n00000000 *UND*\t00000000 _restgpr_25\n00000000 g F .text\t00000130 dotprod\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_PPC_REL24 _savegpr_25\n0000011c R_PPC_REL24 _restgpr_25\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 dotprod\n\n\nContents of section .text:\n 0000 9421ffd0 7c0802a6 90010034 39610030 .!..|......49a.0\n 0010 48000001 2c050000 38000000 39000000 H...,...8...9...\n 0020 408100f4 2c050008 3945fff8 408100b0 @...,...9E..@...\n 0030 392a0007 7c862378 5529e8fe 7c671b78 9*..|.#xU)..|g.x\n 0040 7d2903a6 2c0a0000 40810094 81470000 })..,...@....G..\n 0050 39080008 81260000 81870004 7f2a49d6 9....&.......*I.\n 0060 81660004 81470008 81260008 8347000c .f...G...&...G..\n 0070 8366000c 7d6c59d6 7c00ca14 83870010 .f..}lY.|.......\n 0080 83a60010 83c70014 83e60014 7f2a49d6 .............*I.\n 0090 7c005a14 81870018 81660018 8147001c |.Z......f...G..\n 00a0 38e70020 8126001c 7f7ad9d6 7c00ca14 8.. .&...z..|...\n 00b0 38c60020 7fbce9d6 7c00da14 7ffef9d6 8.. ....|.......\n 00c0 7c00ea14 7d6c59d6 7c00fa14 7d2a49d6 |...}lY.|...}*I.\n 00d0 7c005a14 7c004a14 4200ff74 5509103a |.Z.|.J.B..tU..:\n 00e0 7cc82850 7ce44a14 7d234a14 7cc903a6 |.(P|.J.}#J.|...\n 00f0 7c082800 40800020 80890000 39290004 |.(.@.. ....9)..\n 0100 80670000 38e70004 7c6419d6 7c001a14 .g..8...|d..|...\n 0110 4200ffe8 7c030378 39610030 48000001 B...|..x9a.0H...\n 0120 80010034 7c0803a6 38210030 4e800020 ...4|...8!.0N.. \nContents of section .mwcats.text:\n 0000 02000130 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000000 00000000 00000004 ................\n 0060 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name dotprod # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dowhile:agbcc","sym":"dowhile","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","do-while"],"loc":1,"refSource":"int dowhile(int n){ int s=0; do{s+=n;n--;}while(n>0); return s; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdowhile\n\t.type\t dowhile,function\n\t.thumb_func\ndowhile:\n\tmov\tr1, #0x0\n.L3:\n\tadd\tr1, r1, r0\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0\n\tbgt\t.L3\t@cond_branch\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t dowhile,.Lfe1-dowhile\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 dowhile(u32 a0) {\n s32 v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n do {\n v1 = v1 + v0;\n v0 = v0 - 1;\n } while (v0 > 0);\n return v1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 dowhile(s32 arg0) {\n s32 var_r0;\n s32 var_r1;\n\n var_r0 = arg0;\n var_r1 = 0;\n do {\n var_r1 += var_r0;\n var_r0 -= 1;\n } while (var_r0 > 0);\n return var_r1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dowhile` — benchmark function synthetic:dowhile:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdowhile\n\t.type\t dowhile,function\n\t.thumb_func\ndowhile:\n\tmov\tr1, #0x0\n.L3:\n\tadd\tr1, r1, r0\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0\n\tbgt\t.L3\t@cond_branch\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t dowhile,.Lfe1-dowhile\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dowhile # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dowhile` — benchmark function synthetic:dowhile:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dowhile:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdowhile\n\t.type\t dowhile,function\n\t.thumb_func\ndowhile:\n\tmov\tr1, #0x0\n.L3:\n\tadd\tr1, r1, r0\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0\n\tbgt\t.L3\t@cond_branch\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t dowhile,.Lfe1-dowhile\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name dowhile # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dowhile:gcc2.7.2kmc","sym":"dowhile","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","do-while"],"loc":1,"refSource":"int dowhile(int n){ int s=0; do{s+=n;n--;}while(n>0); return s; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,zero\n 4:\taddu\tv0,v0,a0\n 8:\taddiu\ta0,a0,-1\n c:\tbgtzl\ta0,8 \n 10:\taddu\tv0,v0,a0\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b217463f0db4075d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c dowhile\n\n\nContents of section .text:\n 0000 00001021 00441021 2484ffff 5c80fffe ...!.D.!$...\\...\n 0010 00441021 03e00008 00000000 00000000 .D.!............\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'dowhile' — lift: cannot lift 'dowhile': unmodelled control transfer 'bgtzl' at 0xc — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv0,zero */\n/* 4:\taddu\tv0,v0,a0 */\n/* 8:\taddiu\ta0,a0,-1 */\n/* c:\tbgtzl\ta0,8 */\n/* 10:\taddu\tv0,v0,a0 */\n/* 14:\tjr\tra */\n/* 18:\tnop */\n/* 1c:\tnop */\nvoid dowhile(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'dowhile': unmodelled control transfer 'bgtzl' at 0xc — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'dowhile': unmodelled control transfer 'bgtzl' at 0xc — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void dowhile(s32 arg0) {\n s32 var_a0;\n\n var_a0 = arg0;\n do {\n var_a0 -= 1;\n } while (var_a0 > 0);\n}\n","score":4,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":7,"ratio":0.5714285714285714,"kinds":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dowhile` — benchmark function synthetic:dowhile:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dowhile\n move\t$v0, $zero\n addu\t$v0, $v0, $a0\n.L8:\n addiu\t$a0, $a0, -1\n bgtzl\t$a0, .L8\n addu\t$v0, $v0, $a0\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dowhile # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dowhile` — benchmark function synthetic:dowhile:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dowhile:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,zero\n 4:\taddu\tv0,v0,a0\n 8:\taddiu\ta0,a0,-1\n c:\tbgtzl\ta0,8 \n 10:\taddu\tv0,v0,a0\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b217463f0db4075d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c dowhile\n\n\nContents of section .text:\n 0000 00001021 00441021 2484ffff 5c80fffe ...!.D.!$...\\...\n 0010 00441021 03e00008 00000000 00000000 .D.!............\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name dowhile # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dowhile:ido7.1","sym":"dowhile","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","do-while"],"loc":1,"refSource":"int dowhile(int n){ int s=0; do{s+=n;n--;}while(n>0); return s; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\taddu\tv1,v1,a0\n 8:\taddiu\ta0,a0,-1\n c:\tbgtzl\ta0,8 \n 10:\taddu\tv1,v1,a0\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c dowhile\n\n\nContents of section .text:\n 0000 00001825 00641821 2484ffff 5c80fffe ...%.d.!$...\\...\n 0010 00641821 03e00008 00601025 00000000 .d.!.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 32313734 36336630 64623430 ef-b217463f0db40\n 0130 3735642f 7265662e 6300646f 7768696c 75d/ref.c.dowhil\n 0140 65000000 646f7768 696c6500 00000000 e...dowhile.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000007 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'dowhile' — lift: cannot lift 'dowhile': unmodelled control transfer 'bgtzl' at 0xc — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\taddu\tv1,v1,a0 */\n/* 8:\taddiu\ta0,a0,-1 */\n/* c:\tbgtzl\ta0,8 */\n/* 10:\taddu\tv1,v1,a0 */\n/* 14:\tjr\tra */\n/* 18:\tmove\tv0,v1 */\n/* 1c:\tnop */\nvoid dowhile(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'dowhile': unmodelled control transfer 'bgtzl' at 0xc — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'dowhile': unmodelled control transfer 'bgtzl' at 0xc — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 dowhile(s32 arg0) {\n s32 var_a0;\n s32 var_v1;\n\n var_a0 = arg0;\n var_v1 = 0;\n do {\n var_v1 += var_a0;\n var_a0 -= 1;\n } while (var_a0 > 0);\n return var_v1;\n}\n","score":6,"maxScore":8,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":8,"ratio":0.75,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":5}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dowhile` — benchmark function synthetic:dowhile:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dowhile\n move\t$v1, $zero\n addu\t$v1, $v1, $a0\n.L8:\n addiu\t$a0, $a0, -1\n bgtzl\t$a0, .L8\n addu\t$v1, $v1, $a0\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dowhile # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dowhile` — benchmark function synthetic:dowhile:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dowhile:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\taddu\tv1,v1,a0\n 8:\taddiu\ta0,a0,-1\n c:\tbgtzl\ta0,8 \n 10:\taddu\tv1,v1,a0\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c dowhile\n\n\nContents of section .text:\n 0000 00001825 00641821 2484ffff 5c80fffe ...%.d.!$...\\...\n 0010 00641821 03e00008 00601025 00000000 .d.!.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 32313734 36336630 64623430 ef-b217463f0db40\n 0130 3735642f 7265662e 6300646f 7768696c 75d/ref.c.dowhil\n 0140 65000000 646f7768 696c6500 00000000 e...dowhile.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000007 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name dowhile # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dowhile:mwcc_242_81","sym":"dowhile","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","do-while"],"loc":1,"refSource":"int dowhile(int n){ int s=0; do{s+=n;n--;}while(n>0); return s; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r0,0\n 4:\tadd r0,r0,r3\n 8:\taddic. r3,r3,-1\n c:\tbgt 4 \n 10:\tmr r3,r0\n 14:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 dowhile\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 dowhile\n\n\nContents of section .text:\n 0000 38000000 7c001a14 3463ffff 4181fff8 8...|...4c..A...\n 0010 7c030378 4e800020 |..xN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 dowhile(u32 a0) {\n s32 v0;\n s32 v1;\n v1 = a0;\n v0 = 0;\n do {\n v0 = v0 + v1;\n v1 = v1 + -1;\n } while (v1 > 0);\n return v0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 dowhile(s32 arg0) {\n s32 var_r0;\n s32 var_r3;\n\n var_r3 = arg0;\n var_r0 = 0;\n do {\n var_r0 += var_r3;\n var_r3 -= 1;\n } while (var_r3 > 0);\n return var_r0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dowhile` — benchmark function synthetic:dowhile:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dowhile\n li r0,0\n.L4:\n add r0,r0,r3\n addic. r3,r3,-1\n bgt .L4\n mr r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dowhile # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dowhile` — benchmark function synthetic:dowhile:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dowhile:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r0,0\n 4:\tadd r0,r0,r3\n 8:\taddic. r3,r3,-1\n c:\tbgt 4 \n 10:\tmr r3,r0\n 14:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 dowhile\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 dowhile\n\n\nContents of section .text:\n 0000 38000000 7c001a14 3463ffff 4181fff8 8...|...4c..A...\n 0010 7c030378 4e800020 |..xN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name dowhile # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:expr1:agbcc","sym":"expr1","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","expr"],"loc":1,"refSource":"int expr1(int a,int b,int c){ return a*b + c - 3; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\texpr1\n\t.type\t expr1,function\n\t.thumb_func\nexpr1:\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tsub\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t expr1,.Lfe1-expr1\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 expr1(u32 a0, u32 a1, u32 a2) {\n return a0 * a1 + a2 - 3;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 expr1(s32 arg0, s32 arg1, s32 arg2) {\n return ((arg0 * arg1) + arg2) - 3;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `expr1` — benchmark function synthetic:expr1:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\texpr1\n\t.type\t expr1,function\n\t.thumb_func\nexpr1:\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tsub\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t expr1,.Lfe1-expr1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function expr1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `expr1` — benchmark function synthetic:expr1:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:expr1:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\texpr1\n\t.type\t expr1,function\n\t.thumb_func\nexpr1:\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tsub\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t expr1,.Lfe1-expr1\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name expr1 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:expr1:gcc2.7.2kmc","sym":"expr1","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","expr"],"loc":1,"refSource":"int expr1(int a,int b,int c){ return a*b + c - 3; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmult\ta0,a1\n 8:\tmflo\tv0\n c:\taddu\tv0,v0,a2\n 10:\tnop\n 14:\tjr\tra\n 18:\taddiu\tv0,v0,-3\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-bf2c7e75346799d7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c expr1\n\n\nContents of section .text:\n 0000 00000000 00850018 00001012 00461021 .............F.!\n 0010 00000000 03e00008 2442fffd 00000000 ........$B......\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 expr1(u32 a0, u32 a1, u32 a2) {\n return a0 * a1 + a2 + -3;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 expr1(s32 arg0, s32 arg1, s32 arg2) {\n return ((arg0 * arg1) + arg2) - 3;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `expr1` — benchmark function synthetic:expr1:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel expr1\n nop\n mult\t$a0, $a1\n mflo\t$v0\n addu\t$v0, $v0, $a2\n nop\n jr\t$ra\n addiu\t$v0, $v0, -3\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function expr1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `expr1` — benchmark function synthetic:expr1:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:expr1:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmult\ta0,a1\n 8:\tmflo\tv0\n c:\taddu\tv0,v0,a2\n 10:\tnop\n 14:\tjr\tra\n 18:\taddiu\tv0,v0,-3\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-bf2c7e75346799d7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c expr1\n\n\nContents of section .text:\n 0000 00000000 00850018 00001012 00461021 .............F.!\n 0010 00000000 03e00008 2442fffd 00000000 ........$B......\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name expr1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:expr1:ido7.1","sym":"expr1","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","expr"],"loc":1,"refSource":"int expr1(int a,int b,int c){ return a*b + c - 3; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmultu\ta0,a1\n 4:\tmflo\tt6\n 8:\taddu\tv0,t6,a2\n c:\tjr\tra\n 10:\taddiu\tv0,v0,-3\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 expr1\n\n\nContents of section .text:\n 0000 00850019 00007012 01c61021 03e00008 ......p....!....\n 0010 2442fffd 00000000 00000000 00000000 $B..............\nContents of section .options:\n 0000 01200000 00000000 80004074 00000000 . ........@t....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004074 00000000 00000000 00000000 ..@t............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 66326337 65373533 34363739 ef-bf2c7e7534679\n 0130 3964372f 7265662e 63006578 70723100 9d7/ref.c.expr1.\n 0140 65787072 31000000 00000000 00000001 expr1...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 expr1(u32 a0, u32 a1, u32 a2) {\n return a0 * a1 + a2 + -3;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 expr1(s32 arg0, s32 arg1, s32 arg2) {\n return ((arg0 * arg1) + arg2) - 3;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `expr1` — benchmark function synthetic:expr1:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel expr1\n multu\t$a0, $a1\n mflo\t$t6\n addu\t$v0, $t6, $a2\n jr\t$ra\n addiu\t$v0, $v0, -3\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function expr1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `expr1` — benchmark function synthetic:expr1:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:expr1:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmultu\ta0,a1\n 4:\tmflo\tt6\n 8:\taddu\tv0,t6,a2\n c:\tjr\tra\n 10:\taddiu\tv0,v0,-3\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 expr1\n\n\nContents of section .text:\n 0000 00850019 00007012 01c61021 03e00008 ......p....!....\n 0010 2442fffd 00000000 00000000 00000000 $B..............\nContents of section .options:\n 0000 01200000 00000000 80004074 00000000 . ........@t....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004074 00000000 00000000 00000000 ..@t............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 66326337 65373533 34363739 ef-bf2c7e7534679\n 0130 3964372f 7265662e 63006578 70723100 9d7/ref.c.expr1.\n 0140 65787072 31000000 00000000 00000001 expr1...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name expr1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:expr1:mwcc_242_81","sym":"expr1","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","expr"],"loc":1,"refSource":"int expr1(int a,int b,int c){ return a*b + c - 3; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmullw r3,r3,r4\n 4:\taddi r3,r3,-3\n 8:\tadd r3,r5,r3\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 expr1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 expr1\n\n\nContents of section .text:\n 0000 7c6321d6 3863fffd 7c651a14 4e800020 |c!.8c..|e..N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 expr1(u32 a0, u32 a1, u32 a2) {\n return a2 + (a0 * a1 + -3);\n}\n","score":3,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 expr1(s32 arg0, s32 arg1, s32 arg2) {\n return arg2 + ((arg0 * arg1) - 3);\n}\n","score":3,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":3,"maxScore":5,"ratio":0.6,"kinds":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `expr1` — benchmark function synthetic:expr1:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel expr1\n mullw r3,r3,r4\n addi r3,r3,-3\n add r3,r5,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function expr1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `expr1` — benchmark function synthetic:expr1:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:expr1:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmullw r3,r3,r4\n 4:\taddi r3,r3,-3\n 8:\tadd r3,r5,r3\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 expr1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 expr1\n\n\nContents of section .text:\n 0000 7c6321d6 3863fffd 7c651a14 4e800020 |c!.8c..|e..N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name expr1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:extractbits:agbcc","sym":"extractbits","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"unsigned extractbits(unsigned x){ return (x>>4)&0xF; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\textractbits\n\t.type\t extractbits,function\n\t.thumb_func\nextractbits:\n\tlsr\tr0, r0, #0x4\n\tmov\tr1, #0xf\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t extractbits,.Lfe1-extractbits\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 extractbits(u32 a0) {\n return a0 >> 4 & 15;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 extractbits(u32 arg0) {\n return (arg0 >> 4) & 0xF;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `extractbits` — benchmark function synthetic:extractbits:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\textractbits\n\t.type\t extractbits,function\n\t.thumb_func\nextractbits:\n\tlsr\tr0, r0, #0x4\n\tmov\tr1, #0xf\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t extractbits,.Lfe1-extractbits\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function extractbits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `extractbits` — benchmark function synthetic:extractbits:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:extractbits:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\textractbits\n\t.type\t extractbits,function\n\t.thumb_func\nextractbits:\n\tlsr\tr0, r0, #0x4\n\tmov\tr1, #0xf\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t extractbits,.Lfe1-extractbits\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name extractbits # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:extractbits:gcc2.7.2kmc","sym":"extractbits","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"unsigned extractbits(unsigned x){ return (x>>4)&0xF; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x4\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0xf\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4883c477966a0050/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c extractbits\n\n\nContents of section .text:\n 0000 00041102 03e00008 3042000f 00000000 ........0B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 extractbits(u32 a0) {\n return a0 >> 4 & 15;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 extractbits(u32 arg0) {\n return (arg0 >> 4) & 0xF;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `extractbits` — benchmark function synthetic:extractbits:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel extractbits\n srl\t$v0, $a0, 0x4\n jr\t$ra\n andi\t$v0, $v0, 0xf\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function extractbits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `extractbits` — benchmark function synthetic:extractbits:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:extractbits:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x4\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0xf\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4883c477966a0050/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c extractbits\n\n\nContents of section .text:\n 0000 00041102 03e00008 3042000f 00000000 ........0B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name extractbits # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:extractbits:ido7.1","sym":"extractbits","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"unsigned extractbits(unsigned x){ return (x>>4)&0xF; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x4\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0xf\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c extractbits\n\n\nContents of section .text:\n 0000 00041102 03e00008 3042000f 00000000 ........0B......\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000188 p...............\n 0010 00000005 000002d4 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 0000003c 00000234 ...........<...4\n 0040 0000000c 00000270 00000001 0000027c .......p.......|\n 0050 00000000 00000000 00000001 000002c4 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 38383363 34373739 36366130 ef-4883c477966a0\n 0130 3035302f 7265662e 63006578 74726163 050/ref.c.extrac\n 0140 74626974 73000000 65787472 61637462 tbits...extractb\n 0150 69747300 00000000 00000001 00000000 its.............\n 0160 0000003a 00000000 00000004 00000000 ...:............\n 0170 00000003 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000001 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 extractbits(u32 a0) {\n return a0 >> 4 & 15;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 extractbits(u32 arg0) {\n return (arg0 >> 4) & 0xF;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `extractbits` — benchmark function synthetic:extractbits:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel extractbits\n srl\t$v0, $a0, 0x4\n jr\t$ra\n andi\t$v0, $v0, 0xf\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function extractbits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `extractbits` — benchmark function synthetic:extractbits:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:extractbits:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x4\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0xf\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c extractbits\n\n\nContents of section .text:\n 0000 00041102 03e00008 3042000f 00000000 ........0B......\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000188 p...............\n 0010 00000005 000002d4 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 0000003c 00000234 ...........<...4\n 0040 0000000c 00000270 00000001 0000027c .......p.......|\n 0050 00000000 00000000 00000001 000002c4 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 38383363 34373739 36366130 ef-4883c477966a0\n 0130 3035302f 7265662e 63006578 74726163 050/ref.c.extrac\n 0140 74626974 73000000 65787472 61637462 tbits...extractb\n 0150 69747300 00000000 00000001 00000000 its.............\n 0160 0000003a 00000000 00000004 00000000 ...:............\n 0170 00000003 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000001 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name extractbits # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:extractbits:mwcc_242_81","sym":"extractbits","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"unsigned extractbits(unsigned x){ return (x>>4)&0xF; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\trlwinm r3,r3,28,28,31\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 extractbits\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 extractbits\n\n\nContents of section .text:\n 0000 5463e73e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 extractbits(u32 a0) {\n return a0 >> 4 & 15;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 extractbits(u32 arg0) {\n return (arg0 >> 4U) & 0xF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `extractbits` — benchmark function synthetic:extractbits:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel extractbits\n rlwinm r3,r3,28,28,31\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function extractbits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `extractbits` — benchmark function synthetic:extractbits:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:extractbits:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\trlwinm r3,r3,28,28,31\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 extractbits\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 extractbits\n\n\nContents of section .text:\n 0000 5463e73e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name extractbits # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:f2i:agbcc","sym":"f2i","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","cast","float-to-int"],"loc":1,"refSource":"int f2i(float x){ return (int)x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tf2i\n\t.type\t f2i,function\n\t.thumb_func\nf2i:\n\tpush\t{lr}\n\tbl\t__fixsfsi\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t f2i,.Lfe1-f2i\n","ctx":"int f2i(float);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 f2i(void) {\n return __fixsfsi();\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 __fixsfsi(); /* extern */\n\ns32 f2i(f32 arg0) {\n return __fixsfsi();\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `f2i` — benchmark function synthetic:f2i:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tf2i\n\t.type\t f2i,function\n\t.thumb_func\nf2i:\n\tpush\t{lr}\n\tbl\t__fixsfsi\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t f2i,.Lfe1-f2i\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint f2i(float);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function f2i # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `f2i` — benchmark function synthetic:f2i:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:f2i:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tf2i\n\t.type\t f2i,function\n\t.thumb_func\nf2i:\n\tpush\t{lr}\n\tbl\t__fixsfsi\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t f2i,.Lfe1-f2i\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name f2i # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:f2i:gcc2.7.2kmc","sym":"f2i","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","cast","float-to-int"],"loc":1,"refSource":"int f2i(float x){ return (int)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\ttrunc.w.s\t$f0,$f12\n 4:\tmfc1\tv0,$f0\n 8:\tjr\tra\n c:\tnop\n","ctx":"int f2i(float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-de58cb91152c3fb9/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 f2i\n\n\nContents of section .text:\n 0000 4600600d 44020000 03e00008 00000000 F.`.D...........\nContents of section .reginfo:\n 0000 80000004 00000000 00001001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'f2i' — lift: cannot lift 'f2i @0x0': unmodelled effect instruction 'trunc.w.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\ttrunc.w.s\t$f0,$f12 */\n/* 4:\tmfc1\tv0,$f0 */\n/* 8:\tjr\tra */\n/* c:\tnop */\nvoid f2i(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'f2i @0x0': unmodelled effect instruction 'trunc.w.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":12,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'f2i @0x0': unmodelled effect instruction 'trunc.w.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 f2i(f32 arg0) {\n return (s32) arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `f2i` — benchmark function synthetic:f2i:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel f2i\n trunc.w.s\t$f0, $f12\n mfc1\t$v0, $f0\n jr\t$ra\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint f2i(float);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function f2i # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `f2i` — benchmark function synthetic:f2i:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:f2i:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\ttrunc.w.s\t$f0,$f12\n 4:\tmfc1\tv0,$f0\n 8:\tjr\tra\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-de58cb91152c3fb9/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 f2i\n\n\nContents of section .text:\n 0000 4600600d 44020000 03e00008 00000000 F.`.D...........\nContents of section .reginfo:\n 0000 80000004 00000000 00001001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name f2i # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:f2i:ido7.1","sym":"f2i","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","cast","float-to-int"],"loc":1,"refSource":"int f2i(float x){ return (int)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\ttrunc.w.s\t$f4,$f12\n 4:\tmfc1\tv0,$f4\n 8:\tjr\tra\n c:\tnop\n","ctx":"int f2i(float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 f2i\n\n\nContents of section .text:\n 0000 4600610d 44022000 03e00008 00000000 F.a.D. .........\nContents of section .options:\n 0000 01200000 00000000 80000004 00000000 . ..............\n 0010 00001030 00000000 00000000 00007ff0 ...0............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000004 00000000 00001030 00000000 ...........0....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 65353863 62393131 35326333 ef-de58cb91152c3\n 0130 6662392f 7265662e 63006632 69000000 fb9/ref.c.f2i...\n 0140 66326900 00000000 00000001 00000000 f2i.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000004 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'f2i' — lift: cannot lift 'f2i @0x0': unmodelled effect instruction 'trunc.w.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\ttrunc.w.s\t$f4,$f12 */\n/* 4:\tmfc1\tv0,$f4 */\n/* 8:\tjr\tra */\n/* c:\tnop */\nvoid f2i(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'f2i @0x0': unmodelled effect instruction 'trunc.w.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":12,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'f2i @0x0': unmodelled effect instruction 'trunc.w.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 f2i(f32 arg0) {\n return (s32) arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `f2i` — benchmark function synthetic:f2i:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel f2i\n trunc.w.s\t$f4, $f12\n mfc1\t$v0, $f4\n jr\t$ra\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint f2i(float);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function f2i # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `f2i` — benchmark function synthetic:f2i:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:f2i:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\ttrunc.w.s\t$f4,$f12\n 4:\tmfc1\tv0,$f4\n 8:\tjr\tra\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 f2i\n\n\nContents of section .text:\n 0000 4600610d 44022000 03e00008 00000000 F.a.D. .........\nContents of section .options:\n 0000 01200000 00000000 80000004 00000000 . ..............\n 0010 00001030 00000000 00000000 00007ff0 ...0............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000004 00000000 00001030 00000000 ...........0....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 65353863 62393131 35326333 ef-de58cb91152c3\n 0130 6662392f 7265662e 63006632 69000000 fb9/ref.c.f2i...\n 0140 66326900 00000000 00000001 00000000 f2i.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000004 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name f2i # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:f2i:mwcc_242_81","sym":"f2i","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","cast","float-to-int"],"loc":1,"refSource":"int f2i(float x){ return (int)x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfctiwz f0,f1\n 4:\tstwu r1,-16(r1)\n 8:\tstfd f0,8(r1)\n c:\tlwz r3,12(r1)\n 10:\taddi r1,r1,16\n 14:\tblr\n","ctx":"int f2i(float);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 f2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 f2i\n\n\nContents of section .text:\n 0000 fc00081e 9421fff0 d8010008 8061000c .....!.......a..\n 0010 38210010 4e800020 8!..N.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'f2i' — lift: cannot lift 'f2i @0x0': unmodelled effect instruction 'fctiwz' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfctiwz f0,f1 */\n/* 4:\tstwu r1,-16(r1) */\n/* 8:\tstfd f0,8(r1) */\n/* c:\tlwz r3,12(r1) */\n/* 10:\taddi r1,r1,16 */\n/* 14:\tblr */\nvoid f2i(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'f2i @0x0': unmodelled effect instruction 'fctiwz' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":14,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'f2i @0x0': unmodelled effect instruction 'fctiwz' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 f2i(f32 farg0) {\n return (s32) farg0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `f2i` — benchmark function synthetic:f2i:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel f2i\n fctiwz f0,f1\n stwu r1,-16(r1)\n stfd f0,8(r1)\n lwz r3,12(r1)\n addi r1,r1,16\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint f2i(float);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function f2i # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `f2i` — benchmark function synthetic:f2i:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:f2i:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfctiwz f0,f1\n 4:\tstwu r1,-16(r1)\n 8:\tstfd f0,8(r1)\n c:\tlwz r3,12(r1)\n 10:\taddi r1,r1,16\n 14:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 f2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 f2i\n\n\nContents of section .text:\n 0000 fc00081e 9421fff0 d8010008 8061000c .....!.......a..\n 0010 38210010 4e800020 8!..N.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name f2i # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fadd:agbcc","sym":"fadd","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fadd(float a,float b){ return a+b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfadd\n\t.type\t fadd,function\n\t.thumb_func\nfadd:\n\tpush\t{lr}\n\tbl\t__addsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fadd,.Lfe1-fadd\n","ctx":"float fadd(float,float);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 fadd(void) {\n return __addsf3();\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 __addsf3(); /* extern */\n\nf32 fadd(f32 arg0, f32 arg1) {\n return (bitwise f32) __addsf3();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fadd` — benchmark function synthetic:fadd:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfadd\n\t.type\t fadd,function\n\t.thumb_func\nfadd:\n\tpush\t{lr}\n\tbl\t__addsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fadd,.Lfe1-fadd\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fadd(float,float);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fadd # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fadd` — benchmark function synthetic:fadd:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fadd:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfadd\n\t.type\t fadd,function\n\t.thumb_func\nfadd:\n\tpush\t{lr}\n\tbl\t__addsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fadd,.Lfe1-fadd\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fadd # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fadd:gcc2.7.2kmc","sym":"fadd","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fadd(float a,float b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fadd(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ca8bb36fb8485552/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fadd\n\n\nContents of section .text:\n 0000 03e00008 460e6000 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fadd' — lift: cannot lift 'fadd @0x4': unmodelled effect instruction 'add.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tadd.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fadd(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fadd @0x4': unmodelled effect instruction 'add.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fadd @0x4': unmodelled effect instruction 'add.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fadd(f32 arg0, f32 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fadd` — benchmark function synthetic:fadd:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fadd\n jr\t$ra\n add.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fadd(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fadd # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fadd` — benchmark function synthetic:fadd:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fadd:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ca8bb36fb8485552/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fadd\n\n\nContents of section .text:\n 0000 03e00008 460e6000 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fadd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fadd:ido7.1","sym":"fadd","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fadd(float a,float b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fadd(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fadd\n\n\nContents of section .text:\n 0000 03e00008 460e6000 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 61386262 33366662 38343835 ef-ca8bb36fb8485\n 0130 3535322f 7265662e 63006661 64640000 552/ref.c.fadd..\n 0140 66616464 00000000 00000000 00000001 fadd............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fadd' — lift: cannot lift 'fadd @0x4': unmodelled effect instruction 'add.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tadd.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fadd(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fadd @0x4': unmodelled effect instruction 'add.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fadd @0x4': unmodelled effect instruction 'add.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fadd(f32 arg0, f32 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fadd` — benchmark function synthetic:fadd:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fadd\n jr\t$ra\n add.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fadd(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fadd # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fadd` — benchmark function synthetic:fadd:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fadd:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fadd\n\n\nContents of section .text:\n 0000 03e00008 460e6000 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 61386262 33366662 38343835 ef-ca8bb36fb8485\n 0130 3535322f 7265662e 63006661 64640000 552/ref.c.fadd..\n 0140 66616464 00000000 00000000 00000001 fadd............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fadd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fadd:mwcc_242_81","sym":"fadd","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fadd(float a,float b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfadds f1,f1,f2\n 4:\tblr\n","ctx":"float fadd(float,float);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fadd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fadd\n\n\nContents of section .text:\n 0000 ec21102a 4e800020 .!.*N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fadd' — lift: cannot lift 'fadd @0x0': unmodelled effect instruction 'fadds' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfadds f1,f1,f2 */\n/* 4:\tblr */\nvoid fadd(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fadd @0x0': unmodelled effect instruction 'fadds' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":10,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fadd @0x0': unmodelled effect instruction 'fadds' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fadd(f32 farg0, f32 farg1) {\n return farg0 + farg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fadd` — benchmark function synthetic:fadd:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fadd\n fadds f1,f1,f2\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fadd(float,float);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fadd # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fadd` — benchmark function synthetic:fadd:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fadd:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfadds f1,f1,f2\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fadd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fadd\n\n\nContents of section .text:\n 0000 ec21102a 4e800020 .!.*N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fadd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fcmp:agbcc","sym":"fcmp","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","compare"],"loc":1,"refSource":"int fcmp(float a,float b){ return a>b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfcmp\n\t.type\t fcmp,function\n\t.thumb_func\nfcmp:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tbl\t__gtsf2\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr4, #0x1\n.L3:\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fcmp,.Lfe1-fcmp\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 fcmp(void) {\n s32 v0;\n if (__gtsf2() <= 0) {\n v0 = 0;\n } else {\n v0 = 1;\n }\n return v0;\n}\n","score":8,"maxScore":11,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":1,"opMismatch":1,"argMismatch":3},"quality":{"score":100,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 __gtsf2(); /* extern */\n\ns32 fcmp(void) {\n s32 var_r4;\n\n var_r4 = 0;\n if (__gtsf2() > 0) {\n var_r4 = 1;\n }\n return var_r4;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fcmp` — benchmark function synthetic:fcmp:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfcmp\n\t.type\t fcmp,function\n\t.thumb_func\nfcmp:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tbl\t__gtsf2\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr4, #0x1\n.L3:\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fcmp,.Lfe1-fcmp\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fcmp` — benchmark function synthetic:fcmp:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fcmp:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfcmp\n\t.type\t fcmp,function\n\t.thumb_func\nfcmp:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tbl\t__gtsf2\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr4, #0x1\n.L3:\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fcmp,.Lfe1-fcmp\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fcmp # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fcmp:gcc2.7.2kmc","sym":"fcmp","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","compare"],"loc":1,"refSource":"int fcmp(float a,float b){ return a>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tc.lt.s\t$f14,$f12\n\t...\n c:\tbc1t\t18 \n 10:\tli\tv0,1\n 14:\tmove\tv0,zero\n 18:\tjr\tra\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a65615126cbb723e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 fcmp\n\n\nContents of section .text:\n 0000 460c703c 00000000 00000000 45010002 F.p<........E...\n 0010 24020001 00001021 03e00008 00000000 $......!........\nContents of section .reginfo:\n 0000 80000004 00000000 00005000 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fcmp' — lift: cannot lift 'fcmp': unmodelled control transfer 'bc1t' at 0xc — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tc.lt.s\t$f14,$f12 */\n/* \t... */\n/* c:\tbc1t\t18 */\n/* 10:\tli\tv0,1 */\n/* 14:\tmove\tv0,zero */\n/* 18:\tjr\tra */\n/* 1c:\tnop */\nvoid fcmp(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fcmp': unmodelled control transfer 'bc1t' at 0xc — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":15,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fcmp': unmodelled control transfer 'bc1t' at 0xc — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 fcmp(f32 arg0, f32 arg1) {\n s32 var_v0;\n\n var_v0 = 1;\n if (!(arg1 < arg0)) {\n var_v0 = 0;\n }\n return var_v0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fcmp` — benchmark function synthetic:fcmp:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fcmp\n c.lt.s\t$f14, $f12\n bc1t\t.L18\n li\t$v0, 1\n move\t$v0, $zero\n.L18:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fcmp` — benchmark function synthetic:fcmp:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fcmp:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tc.lt.s\t$f14,$f12\n\t...\n c:\tbc1t\t18 \n 10:\tli\tv0,1\n 14:\tmove\tv0,zero\n 18:\tjr\tra\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a65615126cbb723e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 fcmp\n\n\nContents of section .text:\n 0000 460c703c 00000000 00000000 45010002 F.p<........E...\n 0010 24020001 00001021 03e00008 00000000 $......!........\nContents of section .reginfo:\n 0000 80000004 00000000 00005000 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fcmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fcmp:ido7.1","sym":"fcmp","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","compare"],"loc":1,"refSource":"int fcmp(float a,float b){ return a>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tc.lt.s\t$f14,$f12\n 4:\tmove\tv0,zero\n 8:\tbc1f\t14 \n c:\tnop\n 10:\tli\tv0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c fcmp\n\n\nContents of section .text:\n 0000 460c703c 00001025 45000002 00000000 F.p<...%E.......\n 0010 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 80000004 00000000 . ..............\n 0010 00005000 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000004 00000000 00005000 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 36353631 35313236 63626237 ef-a65615126cbb7\n 0130 3233652f 7265662e 63006663 6d700000 23e/ref.c.fcmp..\n 0140 66636d70 00000000 00000000 00000001 fcmp............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fcmp' — lift: cannot lift 'fcmp': unmodelled control transfer 'bc1f' at 0x8 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tc.lt.s\t$f14,$f12 */\n/* 4:\tmove\tv0,zero */\n/* 8:\tbc1f\t14 */\n/* c:\tnop */\n/* 10:\tli\tv0,1 */\n/* 14:\tjr\tra */\n/* 18:\tnop */\n/* 1c:\tnop */\nvoid fcmp(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fcmp': unmodelled control transfer 'bc1f' at 0x8 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fcmp': unmodelled control transfer 'bc1f' at 0x8 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 fcmp(f32 arg0, f32 arg1) {\n s32 var_v0;\n\n var_v0 = 0;\n if (arg1 < arg0) {\n var_v0 = 1;\n }\n return var_v0;\n}\n","score":3,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":7,"ratio":0.42857142857142855,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fcmp` — benchmark function synthetic:fcmp:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fcmp\n c.lt.s\t$f14, $f12\n move\t$v0, $zero\n bc1f\t.L14\n nop\n li\t$v0, 1\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fcmp` — benchmark function synthetic:fcmp:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fcmp:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tc.lt.s\t$f14,$f12\n 4:\tmove\tv0,zero\n 8:\tbc1f\t14 \n c:\tnop\n 10:\tli\tv0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c fcmp\n\n\nContents of section .text:\n 0000 460c703c 00001025 45000002 00000000 F.p<...%E.......\n 0010 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 80000004 00000000 . ..............\n 0010 00005000 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000004 00000000 00005000 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 36353631 35313236 63626237 ef-a65615126cbb7\n 0130 3233652f 7265662e 63006663 6d700000 23e/ref.c.fcmp..\n 0140 66636d70 00000000 00000000 00000001 fcmp............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fcmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fcmp:mwcc_242_81","sym":"fcmp","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","compare"],"loc":1,"refSource":"int fcmp(float a,float b){ return a>b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfcmpo cr0,f1,f2\n 4:\tmfcr r0\n 8:\trlwinm r3,r0,2,31,31\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 fcmp\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fcmp\n\n\nContents of section .text:\n 0000 fc011040 7c000026 540317fe 4e800020 ...@|..&T...N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fcmp' — lift: cannot lift 'fcmp @0x0': unmodelled effect instruction 'fcmpo' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfcmpo cr0,f1,f2 */\n/* 4:\tmfcr r0 */\n/* 8:\trlwinm r3,r0,2,31,31 */\n/* c:\tblr */\nvoid fcmp(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fcmp @0x0': unmodelled effect instruction 'fcmpo' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":12,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fcmp @0x0': unmodelled effect instruction 'fcmpo' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 fcmp(f32 farg0, f32 farg1) {\n return ((u32) M2C_ERROR(/* unknown instruction: mfcr $r0 */) >> 0x1EU) & 1;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":76,"lines":3,"gotos":0,"casts":1,"unkGlue":2,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_ERROR"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fcmp` — benchmark function synthetic:fcmp:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fcmp\n fcmpo cr0,f1,f2\n mfcr r0\n rlwinm r3,r0,2,31,31\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fcmp` — benchmark function synthetic:fcmp:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fcmp:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfcmpo cr0,f1,f2\n 4:\tmfcr r0\n 8:\trlwinm r3,r0,2,31,31\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 fcmp\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fcmp\n\n\nContents of section .text:\n 0000 fc011040 7c000026 540317fe 4e800020 ...@|..&T...N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fcmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fdiv:agbcc","sym":"fdiv","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fdiv(float a,float b){ return a/b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfdiv\n\t.type\t fdiv,function\n\t.thumb_func\nfdiv:\n\tpush\t{lr}\n\tbl\t__divsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fdiv,.Lfe1-fdiv\n","ctx":"float fdiv(float,float);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 fdiv(void) {\n return __divsf3();\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 __divsf3(); /* extern */\n\nf32 fdiv(f32 arg0, f32 arg1) {\n return (bitwise f32) __divsf3();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fdiv` — benchmark function synthetic:fdiv:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfdiv\n\t.type\t fdiv,function\n\t.thumb_func\nfdiv:\n\tpush\t{lr}\n\tbl\t__divsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fdiv,.Lfe1-fdiv\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fdiv(float,float);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fdiv # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fdiv` — benchmark function synthetic:fdiv:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fdiv:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfdiv\n\t.type\t fdiv,function\n\t.thumb_func\nfdiv:\n\tpush\t{lr}\n\tbl\t__divsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fdiv,.Lfe1-fdiv\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fdiv # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fdiv:gcc2.7.2kmc","sym":"fdiv","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fdiv(float a,float b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tdiv.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fdiv(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-241268db67a005de/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fdiv\n\n\nContents of section .text:\n 0000 03e00008 460e6003 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fdiv' — lift: cannot lift 'fdiv @0x4': unmodelled effect instruction 'div.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tdiv.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fdiv(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fdiv @0x4': unmodelled effect instruction 'div.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fdiv @0x4': unmodelled effect instruction 'div.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fdiv(f32 arg0, f32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fdiv` — benchmark function synthetic:fdiv:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fdiv\n jr\t$ra\n div.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fdiv(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fdiv # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fdiv` — benchmark function synthetic:fdiv:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fdiv:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tdiv.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-241268db67a005de/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fdiv\n\n\nContents of section .text:\n 0000 03e00008 460e6003 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fdiv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fdiv:ido7.1","sym":"fdiv","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fdiv(float a,float b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tdiv.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fdiv(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fdiv\n\n\nContents of section .text:\n 0000 03e00008 460e6003 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 34313236 38646236 37613030 ef-241268db67a00\n 0130 3564652f 7265662e 63006664 69760000 5de/ref.c.fdiv..\n 0140 66646976 00000000 00000000 00000001 fdiv............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fdiv' — lift: cannot lift 'fdiv @0x4': unmodelled effect instruction 'div.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tdiv.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fdiv(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fdiv @0x4': unmodelled effect instruction 'div.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fdiv @0x4': unmodelled effect instruction 'div.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fdiv(f32 arg0, f32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fdiv` — benchmark function synthetic:fdiv:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fdiv\n jr\t$ra\n div.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fdiv(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fdiv # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fdiv` — benchmark function synthetic:fdiv:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fdiv:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tdiv.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fdiv\n\n\nContents of section .text:\n 0000 03e00008 460e6003 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 34313236 38646236 37613030 ef-241268db67a00\n 0130 3564652f 7265662e 63006664 69760000 5de/ref.c.fdiv..\n 0140 66646976 00000000 00000000 00000001 fdiv............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fdiv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fdiv:mwcc_242_81","sym":"fdiv","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fdiv(float a,float b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfdivs f1,f1,f2\n 4:\tblr\n","ctx":"float fdiv(float,float);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fdiv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fdiv\n\n\nContents of section .text:\n 0000 ec211024 4e800020 .!.$N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fdiv' — lift: cannot lift 'fdiv @0x0': unmodelled effect instruction 'fdivs' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfdivs f1,f1,f2 */\n/* 4:\tblr */\nvoid fdiv(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fdiv @0x0': unmodelled effect instruction 'fdivs' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":10,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fdiv @0x0': unmodelled effect instruction 'fdivs' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fdiv(f32 farg0, f32 farg1) {\n return farg0 / farg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fdiv` — benchmark function synthetic:fdiv:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fdiv\n fdivs f1,f1,f2\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fdiv(float,float);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fdiv # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fdiv` — benchmark function synthetic:fdiv:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fdiv:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfdivs f1,f1,f2\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fdiv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fdiv\n\n\nContents of section .text:\n 0000 ec211024 4e800020 .!.$N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fdiv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fib:agbcc","sym":"fib","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for"],"loc":1,"refSource":"int fib(int n){ int a=0,b=1,i; for(i=0;i= a0) {\n v0 = 0;\n } else {\n v0 = 1;\n v1 = 0;\n v2 = a0;\n do {\n v2 = v2 - 1;\n t0 = v1;\n v1 = v0;\n v0 = t0 + v0;\n } while (v2 != 0);\n v0 = v1;\n }\n return v0;\n}\n","score":16,"maxScore":19,"compileErrors":null,"breakdown":{"insert":6,"delete":4,"replace":1,"opMismatch":1,"argMismatch":4},"quality":{"score":100,"lines":21,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 fib(s32 arg0) {\n s32 temp_r0;\n s32 var_r1;\n s32 var_r2;\n s32 var_r3;\n\n var_r3 = 0;\n var_r2 = 1;\n if (arg0 > 0) {\n var_r1 = arg0;\n do {\n temp_r0 = var_r3 + var_r2;\n var_r3 = var_r2;\n var_r2 = temp_r0;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n return var_r3;\n}\n","score":2,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":13,"ratio":0.15384615384615385,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fib` — benchmark function synthetic:fib:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfib\n\t.type\t fib,function\n\t.thumb_func\nfib:\n\tmov\tr3, #0x0\n\tmov\tr2, #0x1\n\tcmp\tr3, r0\n\tbge\t.L4\t@cond_branch\n\tadd\tr1, r0, #0\n.L6:\n\tadd\tr0, r3, r2\n\tadd\tr3, r2, #0\n\tadd\tr2, r0, #0\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t fib,.Lfe1-fib\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fib # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fib` — benchmark function synthetic:fib:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fib:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfib\n\t.type\t fib,function\n\t.thumb_func\nfib:\n\tmov\tr3, #0x0\n\tmov\tr2, #0x1\n\tcmp\tr3, r0\n\tbge\t.L4\t@cond_branch\n\tadd\tr1, r0, #0\n.L6:\n\tadd\tr0, r3, r2\n\tadd\tr3, r2, #0\n\tadd\tr2, r0, #0\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t fib,.Lfe1-fib\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fib # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fib:gcc2.7.2kmc","sym":"fib","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for"],"loc":1,"refSource":"int fib(int n){ int a=0,b=1,i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tli\ta2,1\n 8:\tmove\ta1,zero\n c:\tblez\ta0,30 \n 10:\tmove\tv1,zero\n 14:\taddu\tv0,v1,a2\n 18:\tmove\tv1,a2\n 1c:\tmove\ta2,v0\n 20:\taddiu\ta1,a1,1\n 24:\tslt\tv0,a1,a0\n 28:\tbnez\tv0,18 \n 2c:\taddu\tv0,v1,a2\n 30:\tmove\tv0,v1\n 34:\tjr\tra\n 38:\taddiu\tsp,sp,8\n 3c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a2c7f3f5c37567ff/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c fib\n\n\nContents of section .text:\n 0000 27bdfff8 24060001 00002821 18800008 '...$.....(!....\n 0010 00001821 00661021 00c01821 00403021 ...!.f.!...!.@0!\n 0020 24a50001 00a4102a 1440fffb 00661021 $......*.@...f.!\n 0030 00601021 03e00008 27bd0008 00000000 .`.!....'.......\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fib' — structure: cannot structure 'fib': do-while condition or a post-loop value reads a pre-update loop variable */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-8 */\n/* 4:\tli\ta2,1 */\n/* 8:\tmove\ta1,zero */\n/* c:\tblez\ta0,30 */\n/* 10:\tmove\tv1,zero */\n/* 14:\taddu\tv0,v1,a2 */\n/* 18:\tmove\tv1,a2 */\n/* 1c:\tmove\ta2,v0 */\n/* 20:\taddiu\ta1,a1,1 */\n/* 24:\tslt\tv0,a1,a0 */\n/* 28:\tbnez\tv0,18 */\n/* 2c:\taddu\tv0,v1,a2 */\n/* 30:\tmove\tv0,v1 */\n/* 34:\tjr\tra */\n/* 38:\taddiu\tsp,sp,8 */\n/* 3c:\tnop */\nvoid fib(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'fib': do-while condition or a post-loop value reads a pre-update loop variable\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":24,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'fib': do-while condition or a post-loop value reads a pre-update loop variable"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 fib(s32 arg0) {\n s32 var_a1;\n s32 var_a2;\n s32 var_v0;\n s32 var_v1;\n\n var_a2 = 1;\n var_a1 = 0;\n var_v1 = 0;\n if (arg0 > 0) {\n var_v0 = 1;\n do {\n var_v1 = var_a2;\n var_a2 = var_v0;\n var_a1 += 1;\n var_v0 = var_v1 + var_a2;\n } while (var_a1 < arg0);\n }\n return var_v1;\n}\n","score":9,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":2,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":19,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":9,"maxScore":15,"ratio":0.6,"kinds":{"insert":0,"delete":2,"replace":2,"opMismatch":0,"argMismatch":5}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fib` — benchmark function synthetic:fib:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fib\n addiu\t$sp, $sp, -8\n li\t$a2, 1\n move\t$a1, $zero\n blez\t$a0, .L30\n move\t$v1, $zero\n addu\t$v0, $v1, $a2\n.L18:\n move\t$v1, $a2\n move\t$a2, $v0\n addiu\t$a1, $a1, 1\n slt\t$v0, $a1, $a0\n bnez\t$v0, .L18\n addu\t$v0, $v1, $a2\n.L30:\n move\t$v0, $v1\n jr\t$ra\n addiu\t$sp, $sp, 8\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fib # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fib` — benchmark function synthetic:fib:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fib:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tli\ta2,1\n 8:\tmove\ta1,zero\n c:\tblez\ta0,30 \n 10:\tmove\tv1,zero\n 14:\taddu\tv0,v1,a2\n 18:\tmove\tv1,a2\n 1c:\tmove\ta2,v0\n 20:\taddiu\ta1,a1,1\n 24:\tslt\tv0,a1,a0\n 28:\tbnez\tv0,18 \n 2c:\taddu\tv0,v1,a2\n 30:\tmove\tv0,v1\n 34:\tjr\tra\n 38:\taddiu\tsp,sp,8\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a2c7f3f5c37567ff/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c fib\n\n\nContents of section .text:\n 0000 27bdfff8 24060001 00002821 18800008 '...$.....(!....\n 0010 00001821 00661021 00c01821 00403021 ...!.f.!...!.@0!\n 0020 24a50001 00a4102a 1440fffb 00661021 $......*.@...f.!\n 0030 00601021 03e00008 27bd0008 00000000 .`.!....'.......\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fib # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fib:ido7.1","sym":"fib","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for"],"loc":1,"refSource":"int fib(int n){ int a=0,b=1,i; for(i=0;i:\n 0:\tmove\tv1,zero\n 4:\tli\tv0,1\n 8:\tblez\ta0,6c \n c:\tmove\ta1,zero\n 10:\tandi\ta2,a0,0x3\n 14:\tbeqz\ta2,34 \n 18:\tmove\ta3,a2\n 1c:\taddu\ta2,v1,v0\n 20:\tmove\tv1,v0\n 24:\taddiu\ta1,a1,1\n 28:\tbne\ta3,a1,1c \n 2c:\tmove\tv0,a2\n 30:\tbeq\ta1,a0,6c \n 34:\taddu\ta2,v1,v0\n 38:\tmove\tv1,v0\n 3c:\tmove\tv0,a2\n 40:\taddu\ta2,v1,a2\n 44:\tmove\tv1,v0\n 48:\tmove\tv0,a2\n 4c:\taddu\ta2,v1,a2\n 50:\tmove\tv1,v0\n 54:\tmove\tv0,a2\n 58:\taddu\ta2,v1,a2\n 5c:\tmove\tv1,v0\n 60:\taddiu\ta1,a1,4\n 64:\tbne\ta1,a0,34 \n 68:\tmove\tv0,a2\n 6c:\tjr\tra\n 70:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000074 fib\n\n\nContents of section .text:\n 0000 00001825 24020001 18800018 00002825 ...%$.........(%\n 0010 30860003 10c00007 00c03825 00623021 0.........8%.b0!\n 0020 00401825 24a50001 14e5fffc 00c01025 .@.%$..........%\n 0030 10a4000e 00623021 00401825 00c01025 .....b0!.@.%...%\n 0040 00663021 00401825 00c01025 00663021 .f0!.@.%...%.f0!\n 0050 00401825 00c01025 00663021 00401825 .@.%...%.f0!.@.%\n 0060 24a50004 14a4fff3 00c01025 03e00008 $..........%....\n 0070 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 800000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001d 00000004 000001e8 p...............\n 0010 00000005 00000324 00000001 000001ec .......$........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000034 00000294 .......P...4....\n 0040 00000004 000002c8 00000001 000002cc ................\n 0050 00000000 00000000 00000001 00000314 ................\n 0060 08080801 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000074 20200001 00000001 .......t ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 32633766 33663563 33373536 ef-a2c7f3f5c3756\n 0130 3766662f 7265662e 63006669 62000000 7ff/ref.c.fib...\n 0140 66696200 00000000 00000001 00000000 fib.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 0000001d 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000004 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fib' — lift: cannot lift 'fib': branch to 0x34 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tli\tv0,1 */\n/* 8:\tblez\ta0,6c */\n/* c:\tmove\ta1,zero */\n/* 10:\tandi\ta2,a0,0x3 */\n/* 14:\tbeqz\ta2,34 */\n/* 18:\tmove\ta3,a2 */\n/* 1c:\taddu\ta2,v1,v0 */\n/* 20:\tmove\tv1,v0 */\n/* 24:\taddiu\ta1,a1,1 */\n/* 28:\tbne\ta3,a1,1c */\n/* 2c:\tmove\tv0,a2 */\n/* 30:\tbeq\ta1,a0,6c */\n/* 34:\taddu\ta2,v1,v0 */\n/* 38:\tmove\tv1,v0 */\n/* 3c:\tmove\tv0,a2 */\n/* 40:\taddu\ta2,v1,a2 */\n/* 44:\tmove\tv1,v0 */\n/* 48:\tmove\tv0,a2 */\n/* 4c:\taddu\ta2,v1,a2 */\n/* 50:\tmove\tv1,v0 */\n/* 54:\tmove\tv0,a2 */\n/* 58:\taddu\ta2,v1,a2 */\n/* 5c:\tmove\tv1,v0 */\n/* 60:\taddiu\ta1,a1,4 */\n/* 64:\tbne\ta1,a0,34 */\n/* 68:\tmove\tv0,a2 */\n/* 6c:\tjr\tra */\n/* 70:\tmove\tv0,v1 */\n/* \t... */\nvoid fib(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fib': branch to 0x34 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":38,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fib': branch to 0x34 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 fib(s32 arg0) {\n s32 temp_a2;\n s32 temp_a2_2;\n s32 temp_a2_3;\n s32 temp_a2_4;\n s32 temp_a2_5;\n s32 temp_a2_6;\n s32 var_a1;\n s32 var_v0;\n s32 var_v1;\n\n var_v1 = 0;\n var_v0 = 1;\n var_a1 = 0;\n if (arg0 > 0) {\n temp_a2 = arg0 & 3;\n if (temp_a2 != 0) {\n do {\n temp_a2_2 = var_v1 + var_v0;\n var_v1 = var_v0;\n var_a1 += 1;\n var_v0 = temp_a2_2;\n } while (temp_a2 != var_a1);\n if (var_a1 != arg0) {\n goto loop_4;\n }\n } else {\n do {\nloop_4:\n temp_a2_3 = var_v1 + var_v0;\n temp_a2_4 = var_v0 + temp_a2_3;\n temp_a2_5 = temp_a2_3 + temp_a2_4;\n temp_a2_6 = temp_a2_4 + temp_a2_5;\n var_v1 = temp_a2_5;\n var_a1 += 4;\n var_v0 = temp_a2_6;\n } while (var_a1 != arg0);\n }\n }\n return var_v1;\n}\n","score":26,"maxScore":39,"compileErrors":null,"breakdown":{"insert":10,"delete":0,"replace":0,"opMismatch":0,"argMismatch":16},"quality":{"score":88,"lines":40,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":26,"maxScore":39,"ratio":0.6666666666666666,"kinds":{"insert":10,"delete":0,"replace":0,"opMismatch":0,"argMismatch":16}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fib` — benchmark function synthetic:fib:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fib\n move\t$v1, $zero\n li\t$v0, 1\n blez\t$a0, .L6c\n move\t$a1, $zero\n andi\t$a2, $a0, 0x3\n beqz\t$a2, .L34\n move\t$a3, $a2\n.L1c:\n addu\t$a2, $v1, $v0\n move\t$v1, $v0\n addiu\t$a1, $a1, 1\n bne\t$a3, $a1, .L1c\n move\t$v0, $a2\n beq\t$a1, $a0, .L6c\n.L34:\n addu\t$a2, $v1, $v0\n move\t$v1, $v0\n move\t$v0, $a2\n addu\t$a2, $v1, $a2\n move\t$v1, $v0\n move\t$v0, $a2\n addu\t$a2, $v1, $a2\n move\t$v1, $v0\n move\t$v0, $a2\n addu\t$a2, $v1, $a2\n move\t$v1, $v0\n addiu\t$a1, $a1, 4\n bne\t$a1, $a0, .L34\n move\t$v0, $a2\n.L6c:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fib # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fib` — benchmark function synthetic:fib:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fib:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tli\tv0,1\n 8:\tblez\ta0,6c \n c:\tmove\ta1,zero\n 10:\tandi\ta2,a0,0x3\n 14:\tbeqz\ta2,34 \n 18:\tmove\ta3,a2\n 1c:\taddu\ta2,v1,v0\n 20:\tmove\tv1,v0\n 24:\taddiu\ta1,a1,1\n 28:\tbne\ta3,a1,1c \n 2c:\tmove\tv0,a2\n 30:\tbeq\ta1,a0,6c \n 34:\taddu\ta2,v1,v0\n 38:\tmove\tv1,v0\n 3c:\tmove\tv0,a2\n 40:\taddu\ta2,v1,a2\n 44:\tmove\tv1,v0\n 48:\tmove\tv0,a2\n 4c:\taddu\ta2,v1,a2\n 50:\tmove\tv1,v0\n 54:\tmove\tv0,a2\n 58:\taddu\ta2,v1,a2\n 5c:\tmove\tv1,v0\n 60:\taddiu\ta1,a1,4\n 64:\tbne\ta1,a0,34 \n 68:\tmove\tv0,a2\n 6c:\tjr\tra\n 70:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000074 fib\n\n\nContents of section .text:\n 0000 00001825 24020001 18800018 00002825 ...%$.........(%\n 0010 30860003 10c00007 00c03825 00623021 0.........8%.b0!\n 0020 00401825 24a50001 14e5fffc 00c01025 .@.%$..........%\n 0030 10a4000e 00623021 00401825 00c01025 .....b0!.@.%...%\n 0040 00663021 00401825 00c01025 00663021 .f0!.@.%...%.f0!\n 0050 00401825 00c01025 00663021 00401825 .@.%...%.f0!.@.%\n 0060 24a50004 14a4fff3 00c01025 03e00008 $..........%....\n 0070 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 800000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001d 00000004 000001e8 p...............\n 0010 00000005 00000324 00000001 000001ec .......$........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000034 00000294 .......P...4....\n 0040 00000004 000002c8 00000001 000002cc ................\n 0050 00000000 00000000 00000001 00000314 ................\n 0060 08080801 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000074 20200001 00000001 .......t ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 32633766 33663563 33373536 ef-a2c7f3f5c3756\n 0130 3766662f 7265662e 63006669 62000000 7ff/ref.c.fib...\n 0140 66696200 00000000 00000001 00000000 fib.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 0000001d 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000004 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fib # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fib:mwcc_242_81","sym":"fib","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for"],"loc":1,"refSource":"int fib(int n){ int a=0,b=1,i; for(i=0;i:\n 0:\tcmpwi r3,0\n 4:\tli r6,0\n 8:\tli r5,1\n c:\tli r7,0\n 10:\tble 7c \n 14:\tcmpwi r3,8\n 18:\taddi r4,r3,-8\n 1c:\tble 5c \n 20:\taddi r0,r4,7\n 24:\tsrwi r0,r0,3\n 28:\tmtctr r0\n 2c:\tcmpwi r4,0\n 30:\tble 5c \n 34:\tadd r4,r6,r5\n 38:\taddi r7,r7,8\n 3c:\tadd r0,r5,r4\n 40:\tadd r4,r4,r0\n 44:\tadd r0,r0,r4\n 48:\tadd r4,r4,r0\n 4c:\tadd r0,r0,r4\n 50:\tadd r6,r4,r0\n 54:\tadd r5,r0,r6\n 58:\tbdnz 34 \n 5c:\tsubf r0,r7,r3\n 60:\tmtctr r0\n 64:\tcmpw r7,r3\n 68:\tbge 7c \n 6c:\tadd r0,r6,r5\n 70:\tmr r6,r5\n 74:\tmr r5,r0\n 78:\tbdnz 6c \n 7c:\tmr r3,r6\n 80:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000084 fib\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fib\n\n\nContents of section .text:\n 0000 2c030000 38c00000 38a00001 38e00000 ,...8...8...8...\n 0010 4081006c 2c030008 3883fff8 40810040 @..l,...8...@..@\n 0020 38040007 5400e8fe 7c0903a6 2c040000 8...T...|...,...\n 0030 4081002c 7c862a14 38e70008 7c052214 @..,|.*.8...|.\".\n 0040 7c840214 7c002214 7c840214 7c002214 |...|.\".|...|.\".\n 0050 7cc40214 7ca03214 4200ffdc 7c071850 |...|.2.B...|..P\n 0060 7c0903a6 7c071800 40800014 7c062a14 |...|...@...|.*.\n 0070 7ca62b78 7c050378 4200fff4 7cc33378 |.+x|..xB...|.3x\n 0080 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000084 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 fib(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n s32 v6;\n s32 t0;\n s32 t1;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n if (a0 <= 8) {\n v2 = 0;\n v0 = 0;\n v1 = 1;\n } else {\n v0 = 0;\n v1 = 1;\n v2 = 0;\n v3 = a0 + -8 + 7 >> 3;\n while (v3 != 0) {\n v2 = v2 + 8;\n v3 = v3 - 1;\n t0 = v0;\n v0 = v0 + v1 + (v1 + (v0 + v1)) + (v1 + (v0 + v1) + (v0 + v1 + (v1 + (v0 + v1)))) + (v1 + (v0 + v1) + (v0 + v1 + (v1 + (v0 + v1))) + (v0 + v1 + (v1 + (v0 + v1)) + (v1 + (v0 + v1) + (v0 + v1 + (v1 + (v0 + v1))))));\n v1 = v1 + (t0 + v1) + (t0 + v1 + (v1 + (t0 + v1))) + (t0 + v1 + (v1 + (t0 + v1)) + (v1 + (t0 + v1) + (t0 + v1 + (v1 + (t0 + v1))))) + (t0 + v1 + (v1 + (t0 + v1)) + (v1 + (t0 + v1) + (t0 + v1 + (v1 + (t0 + v1)))) + (v1 + (t0 + v1) + (t0 + v1 + (v1 + (t0 + v1))) + (t0 + v1 + (v1 + (t0 + v1)) + (v1 + (t0 + v1) + (t0 + v1 + (v1 + (t0 + v1)))))));\n }\n }\n v4 = v0;\n v5 = v1;\n v6 = a0 - v2;\n while (v6 != 0) {\n v6 = v6 - 1;\n t1 = v4;\n v4 = v5;\n v5 = t1 + v5;\n }\n v0 = v4;\n }\n return v0;\n}\n","score":129,"maxScore":133,"compileErrors":null,"breakdown":{"insert":100,"delete":4,"replace":4,"opMismatch":4,"argMismatch":17},"quality":{"score":100,"lines":43,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 fib(s32 arg0) {\n s32 temp_r0;\n s32 temp_r0_2;\n s32 temp_r0_3;\n s32 temp_r0_4;\n s32 temp_r4;\n s32 temp_r4_2;\n s32 temp_r4_3;\n s32 temp_r4_4;\n s32 var_ctr_2;\n s32 var_r5;\n s32 var_r6;\n s32 var_r7;\n u32 var_ctr;\n\n var_r6 = 0;\n var_r5 = 1;\n var_r7 = 0;\n if (arg0 > 0) {\n temp_r4 = arg0 - 8;\n if (arg0 > 8) {\n var_ctr = (u32) (temp_r4 + 7) >> 3U;\n if (temp_r4 > 0) {\n do {\n temp_r4_2 = var_r6 + var_r5;\n var_r7 += 8;\n temp_r0 = var_r5 + temp_r4_2;\n temp_r4_3 = temp_r4_2 + temp_r0;\n temp_r0_2 = temp_r0 + temp_r4_3;\n temp_r4_4 = temp_r4_3 + temp_r0_2;\n temp_r0_3 = temp_r0_2 + temp_r4_4;\n var_r6 = temp_r4_4 + temp_r0_3;\n var_r5 = temp_r0_3 + var_r6;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_ctr_2 = arg0 - var_r7;\n if (var_r7 < arg0) {\n do {\n temp_r0_4 = var_r6 + var_r5;\n var_r6 = var_r5;\n var_r5 = temp_r0_4;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r6;\n}\n","score":15,"maxScore":38,"compileErrors":null,"breakdown":{"insert":5,"delete":5,"replace":0,"opMismatch":2,"argMismatch":3},"quality":{"score":100,"lines":48,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":15,"maxScore":38,"ratio":0.39473684210526316,"kinds":{"insert":5,"delete":5,"replace":0,"opMismatch":2,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fib` — benchmark function synthetic:fib:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fib\n cmpwi r3,0\n li r6,0\n li r5,1\n li r7,0\n ble .L7c\n cmpwi r3,8\n addi r4,r3,-8\n ble .L5c\n addi r0,r4,7\n srwi r0,r0,3\n mtctr r0\n cmpwi r4,0\n ble .L5c\n.L34:\n add r4,r6,r5\n addi r7,r7,8\n add r0,r5,r4\n add r4,r4,r0\n add r0,r0,r4\n add r4,r4,r0\n add r0,r0,r4\n add r6,r4,r0\n add r5,r0,r6\n bdnz .L34\n.L5c:\n subf r0,r7,r3\n mtctr r0\n cmpw r7,r3\n bge .L7c\n.L6c:\n add r0,r6,r5\n mr r6,r5\n mr r5,r0\n bdnz .L6c\n.L7c:\n mr r3,r6\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fib # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fib` — benchmark function synthetic:fib:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fib:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r6,0\n 8:\tli r5,1\n c:\tli r7,0\n 10:\tble 7c \n 14:\tcmpwi r3,8\n 18:\taddi r4,r3,-8\n 1c:\tble 5c \n 20:\taddi r0,r4,7\n 24:\tsrwi r0,r0,3\n 28:\tmtctr r0\n 2c:\tcmpwi r4,0\n 30:\tble 5c \n 34:\tadd r4,r6,r5\n 38:\taddi r7,r7,8\n 3c:\tadd r0,r5,r4\n 40:\tadd r4,r4,r0\n 44:\tadd r0,r0,r4\n 48:\tadd r4,r4,r0\n 4c:\tadd r0,r0,r4\n 50:\tadd r6,r4,r0\n 54:\tadd r5,r0,r6\n 58:\tbdnz 34 \n 5c:\tsubf r0,r7,r3\n 60:\tmtctr r0\n 64:\tcmpw r7,r3\n 68:\tbge 7c \n 6c:\tadd r0,r6,r5\n 70:\tmr r6,r5\n 74:\tmr r5,r0\n 78:\tbdnz 6c \n 7c:\tmr r3,r6\n 80:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000084 fib\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fib\n\n\nContents of section .text:\n 0000 2c030000 38c00000 38a00001 38e00000 ,...8...8...8...\n 0010 4081006c 2c030008 3883fff8 40810040 @..l,...8...@..@\n 0020 38040007 5400e8fe 7c0903a6 2c040000 8...T...|...,...\n 0030 4081002c 7c862a14 38e70008 7c052214 @..,|.*.8...|.\".\n 0040 7c840214 7c002214 7c840214 7c002214 |...|.\".|...|.\".\n 0050 7cc40214 7ca03214 4200ffdc 7c071850 |...|.2.B...|..P\n 0060 7c0903a6 7c071800 40800014 7c062a14 |...|...@...|.*.\n 0070 7ca62b78 7c050378 4200fff4 7cc33378 |.+x|..xB...|.3x\n 0080 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000084 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fib # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:findfirst:agbcc","sym":"findfirst","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for","branch","memory"],"loc":1,"refSource":"int findfirst(int *a,int n,int t){ int i; for(i=0;i= a1) return -1;\n }\n return v1;\n } else {\n return -1;\n }\n}\n","score":14,"maxScore":26,"compileErrors":null,"breakdown":{"insert":6,"delete":5,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 findfirst(s32 *arg0, s32 arg1, s32 arg2) {\n s32 *var_r3;\n s32 var_r1;\n\n var_r1 = 0;\n if (arg1 > 0) {\n var_r3 = arg0;\nloop_2:\n if (*var_r3 == arg2) {\n return var_r1;\n }\n var_r3 += 4;\n var_r1 += 1;\n if (var_r1 >= arg1) {\n goto block_5;\n }\n goto loop_2;\n }\nblock_5:\n return -1;\n}\n","score":3,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":76,"lines":20,"gotos":2,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":20,"ratio":0.15,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `findfirst` — benchmark function synthetic:findfirst:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfindfirst\n\t.type\t findfirst,function\n\t.thumb_func\nfindfirst:\n\tpush\t{r4, lr}\n\tadd\tr4, r1, #0\n\tmov\tr1, #0x0\n\tcmp\tr1, r4\n\tbge\t.L4\t@cond_branch\n\tadd\tr3, r0, #0\n.L6:\n\tldr\tr0, [r3]\n\tcmp\tr0, r2\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L9\n.L5:\n\tadd\tr3, r3, #0x4\n\tadd\tr1, r1, #0x1\n\tcmp\tr1, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L9:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t findfirst,.Lfe1-findfirst\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function findfirst # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `findfirst` — benchmark function synthetic:findfirst:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:findfirst:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfindfirst\n\t.type\t findfirst,function\n\t.thumb_func\nfindfirst:\n\tpush\t{r4, lr}\n\tadd\tr4, r1, #0\n\tmov\tr1, #0x0\n\tcmp\tr1, r4\n\tbge\t.L4\t@cond_branch\n\tadd\tr3, r0, #0\n.L6:\n\tldr\tr0, [r3]\n\tcmp\tr0, r2\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L9\n.L5:\n\tadd\tr3, r3, #0x4\n\tadd\tr1, r1, #0x1\n\tcmp\tr1, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L9:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t findfirst,.Lfe1-findfirst\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name findfirst # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:findfirst:gcc2.7.2kmc","sym":"findfirst","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for","branch","memory"],"loc":1,"refSource":"int findfirst(int *a,int n,int t){ int i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tblez\ta1,2c \n 8:\tmove\tv1,zero\n c:\tlw\tv0,0(a0)\n 10:\tbnel\tv0,a2,20 \n 14:\taddiu\tv1,v1,1\n 18:\tj\t30 \n 1c:\tmove\tv0,v1\n 20:\tslt\tv0,v1,a1\n 24:\tbnez\tv0,c \n 28:\taddiu\ta0,a0,4\n 2c:\tli\tv0,-1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d8b1ef9fc32f0ac8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 findfirst\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdfff8 18a00009 00001821 8c820000 '..........!....\n 0010 54460003 24630001 0800000c 00601021 TF..$c.......`.!\n 0020 0065102a 1440fff9 24840004 2402ffff .e.*.@..$...$...\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'findfirst' — lift: cannot lift 'findfirst': unmodelled control transfer 'bnel' at 0x10 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-8 */\n/* 4:\tblez\ta1,2c */\n/* 8:\tmove\tv1,zero */\n/* c:\tlw\tv0,0(a0) */\n/* 10:\tbnel\tv0,a2,20 */\n/* 14:\taddiu\tv1,v1,1 */\n/* 18:\tj\t30 */\n/* 1c:\tmove\tv0,v1 */\n/* 20:\tslt\tv0,v1,a1 */\n/* 24:\tbnez\tv0,c */\n/* 28:\taddiu\ta0,a0,4 */\n/* 2c:\tli\tv0,-1 */\n/* 30:\tjr\tra */\n/* 34:\taddiu\tsp,sp,8 */\n/* \t... */\nvoid findfirst(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'findfirst': unmodelled control transfer 'bnel' at 0x10 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'findfirst': unmodelled control transfer 'bnel' at 0x10 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 findfirst(s32 *arg0, s32 arg1, s32 arg2) {\n s32 *var_a0;\n s32 var_v1;\n\n var_a0 = arg0;\n var_v1 = 0;\n if (arg1 > 0) {\nloop_1:\n if (*var_a0 != arg2) {\n var_v1 += 1;\n var_a0 += 4;\n if (var_v1 >= arg1) {\n goto block_6;\n }\n goto loop_1;\n }\n return var_v1;\n }\nblock_6:\n return -1;\n}\n","score":7,"maxScore":15,"compileErrors":null,"breakdown":{"insert":1,"delete":3,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":76,"lines":20,"gotos":2,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":7,"maxScore":15,"ratio":0.4666666666666667,"kinds":{"insert":1,"delete":3,"replace":2,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `findfirst` — benchmark function synthetic:findfirst:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel findfirst\n addiu\t$sp, $sp, -8\n blez\t$a1, .L2c\n move\t$v1, $zero\n.Lc:\n lw\t$v0, 0($a0)\n bnel\t$v0, $a2, .L20\n addiu\t$v1, $v1, 1\n j\t.L30\n move\t$v0, $v1\n.L20:\n slt\t$v0, $v1, $a1\n bnez\t$v0, .Lc\n addiu\t$a0, $a0, 4\n.L2c:\n li\t$v0, -1\n.L30:\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function findfirst # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `findfirst` — benchmark function synthetic:findfirst:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:findfirst:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tblez\ta1,2c \n 8:\tmove\tv1,zero\n c:\tlw\tv0,0(a0)\n 10:\tbnel\tv0,a2,20 \n 14:\taddiu\tv1,v1,1\n 18:\tj\t30 \n 1c:\tmove\tv0,v1\n 20:\tslt\tv0,v1,a1\n 24:\tbnez\tv0,c \n 28:\taddiu\ta0,a0,4\n 2c:\tli\tv0,-1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d8b1ef9fc32f0ac8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 findfirst\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdfff8 18a00009 00001821 8c820000 '..........!....\n 0010 54460003 24630001 0800000c 00601021 TF..$c.......`.!\n 0020 0065102a 1440fff9 24840004 2402ffff .e.*.@..$...$...\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name findfirst # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:findfirst:ido7.1","sym":"findfirst","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for","branch","memory"],"loc":1,"refSource":"int findfirst(int *a,int n,int t){ int i; for(i=0;i:\n 0:\tblez\ta1,a4 \n 4:\tmove\tv1,zero\n 8:\tandi\tt0,a1,0x3\n c:\tbeqz\tt0,40 \n 10:\tmove\ta3,t0\n 14:\tsll\tt6,zero,0x2\n 18:\taddu\tv0,a0,t6\n 1c:\tlw\tt7,0(v0)\n 20:\tbnel\ta2,t7,34 \n 24:\taddiu\tv1,v1,1\n 28:\tjr\tra\n 2c:\tmove\tv0,v1\n 30:\taddiu\tv1,v1,1\n 34:\tbne\ta3,v1,1c \n 38:\taddiu\tv0,v0,4\n 3c:\tbeq\tv1,a1,a4 \n 40:\tsll\tt8,v1,0x2\n 44:\taddu\tv0,a0,t8\n 48:\tlw\tt9,0(v0)\n 4c:\tbnel\ta2,t9,60 \n 50:\tlw\tt1,4(v0)\n 54:\tjr\tra\n 58:\tmove\tv0,v1\n 5c:\tlw\tt1,4(v0)\n 60:\tbnel\ta2,t1,74 \n 64:\tlw\tt2,8(v0)\n 68:\tjr\tra\n 6c:\taddiu\tv0,v1,1\n 70:\tlw\tt2,8(v0)\n 74:\tbnel\ta2,t2,88 \n 78:\tlw\tt3,12(v0)\n 7c:\tjr\tra\n 80:\taddiu\tv0,v1,2\n 84:\tlw\tt3,12(v0)\n 88:\tbnel\ta2,t3,9c \n 8c:\taddiu\tv1,v1,4\n 90:\tjr\tra\n 94:\taddiu\tv0,v1,3\n 98:\taddiu\tv1,v1,4\n 9c:\tbne\tv1,a1,48 \n a0:\taddiu\tv0,v0,16\n a4:\tli\tv0,-1\n a8:\tjr\tra\n ac:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000b0 findfirst\n\n\nContents of section .text:\n 0000 18a00028 00001825 30a80003 1100000c ...(...%0.......\n 0010 01003825 00007080 008e1021 8c4f0000 ..8%..p....!.O..\n 0020 54cf0004 24630001 03e00008 00601025 T...$c.......`.%\n 0030 24630001 14e3fff9 24420004 10650019 $c......$B...e..\n 0040 0003c080 00981021 8c590000 54d90004 .......!.Y..T...\n 0050 8c490004 03e00008 00601025 8c490004 .I.......`.%.I..\n 0060 54c90004 8c4a0008 03e00008 24620001 T....J......$b..\n 0070 8c4a0008 54ca0004 8c4b000c 03e00008 .J..T....K......\n 0080 24620002 8c4b000c 54cb0004 24630004 $b...K..T...$c..\n 0090 03e00008 24620003 24630004 1465ffea ....$b..$c...e..\n 00a0 24420010 2402ffff 03e00008 00000000 $B..$...........\nContents of section .options:\n 0000 01200000 00000000 8300cffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300cffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002c 00000008 00000218 p......,........\n 0010 00000005 00000364 00000001 00000220 .......d....... \n 0020 00000004 00000254 00000000 00000000 .......T........\n 0030 00000011 00000284 00000038 000002c8 ...........8....\n 0040 0000000c 00000300 00000001 0000030c ................\n 0050 00000000 00000000 00000001 00000354 ...............T\n 0060 08080808 07000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000b0 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d64 38623165 66396663 ps-ref-d8b1ef9fc\n 0130 33326630 6163382f 7265662e 63006669 32f0ac8/ref.c.fi\n 0140 6e646669 72737400 66696e64 66697273 ndfirst.findfirs\n 0150 74000000 00000000 00000001 00000000 t...............\n 0160 00000038 00000000 00000004 00000000 ...8............\n 0170 0000002c 00000000 00000000 00000001 ...,............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000005 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'findfirst' — lift: cannot lift 'findfirst': unmodelled control transfer 'bnel' at 0x20 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tblez\ta1,a4 */\n/* 4:\tmove\tv1,zero */\n/* 8:\tandi\tt0,a1,0x3 */\n/* c:\tbeqz\tt0,40 */\n/* 10:\tmove\ta3,t0 */\n/* 14:\tsll\tt6,zero,0x2 */\n/* 18:\taddu\tv0,a0,t6 */\n/* 1c:\tlw\tt7,0(v0) */\n/* 20:\tbnel\ta2,t7,34 */\n/* 24:\taddiu\tv1,v1,1 */\n/* 28:\tjr\tra */\n/* 2c:\tmove\tv0,v1 */\n/* 30:\taddiu\tv1,v1,1 */\n/* 34:\tbne\ta3,v1,1c */\n/* 38:\taddiu\tv0,v0,4 */\n/* 3c:\tbeq\tv1,a1,a4 */\n/* 40:\tsll\tt8,v1,0x2 */\n/* 44:\taddu\tv0,a0,t8 */\n/* 48:\tlw\tt9,0(v0) */\n/* 4c:\tbnel\ta2,t9,60 */\n/* 50:\tlw\tt1,4(v0) */\n/* 54:\tjr\tra */\n/* 58:\tmove\tv0,v1 */\n/* 5c:\tlw\tt1,4(v0) */\n/* 60:\tbnel\ta2,t1,74 */\n/* 64:\tlw\tt2,8(v0) */\n/* 68:\tjr\tra */\n/* 6c:\taddiu\tv0,v1,1 */\n/* 70:\tlw\tt2,8(v0) */\n/* 74:\tbnel\ta2,t2,88 */\n/* 78:\tlw\tt3,12(v0) */\n/* 7c:\tjr\tra */\n/* 80:\taddiu\tv0,v1,2 */\n/* 84:\tlw\tt3,12(v0) */\n/* 88:\tbnel\ta2,t3,9c */\n/* 8c:\taddiu\tv1,v1,4 */\n/* 90:\tjr\tra */\n/* 94:\taddiu\tv0,v1,3 */\n/* 98:\taddiu\tv1,v1,4 */\n/* 9c:\tbne\tv1,a1,48 */\n/* a0:\taddiu\tv0,v0,16 */\n/* a4:\tli\tv0,-1 */\n/* a8:\tjr\tra */\n/* ac:\tnop */\nvoid findfirst(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'findfirst': unmodelled control transfer 'bnel' at 0x20 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":52,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'findfirst': unmodelled control transfer 'bnel' at 0x20 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 findfirst(s32 arg0, s32 arg1, s32 arg2) {\n s32 *var_v0;\n s32 temp_t0;\n s32 var_v1;\n void *var_v0_2;\n\n var_v1 = 0;\n if (arg1 > 0) {\n temp_t0 = arg1 & 3;\n if (temp_t0 != 0) {\n var_v0 = arg0 + (0 * 4);\nloop_3:\n if (arg2 == *var_v0) {\n return var_v1;\n }\n var_v1 += 1;\n var_v0 += 4;\n if (temp_t0 == var_v1) {\n if (var_v1 != arg1) {\n goto block_7;\n }\n /* Duplicate return node #17. Try simplifying control flow for better match */\n return -1;\n }\n goto loop_3;\n }\nblock_7:\n var_v0_2 = arg0 + (var_v1 * 4);\nloop_8:\n if (arg2 == var_v0_2->unk0) {\n return var_v1;\n }\n if (arg2 == var_v0_2->unk4) {\n return var_v1 + 1;\n }\n if (arg2 == var_v0_2->unk8) {\n return var_v1 + 2;\n }\n if (arg2 == var_v0_2->unkC) {\n return var_v1 + 3;\n }\n var_v1 += 4;\n var_v0_2 += 0x10;\n if (var_v1 == arg1) {\n /* Duplicate return node #17. Try simplifying control flow for better match */\n return -1;\n }\n goto loop_8;\n }\n return -1;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":64,"lines":50,"gotos":3,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 31: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 34: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 37: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 40: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 44: Bad operand type for += or -="]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `findfirst` — benchmark function synthetic:findfirst:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel findfirst\n blez\t$a1, .La4\n move\t$v1, $zero\n andi\t$t0, $a1, 0x3\n beqz\t$t0, .L40\n move\t$a3, $t0\n sll\t$t6, $zero, 0x2\n addu\t$v0, $a0, $t6\n.L1c:\n lw\t$t7, 0($v0)\n bnel\t$a2, $t7, .L34\n addiu\t$v1, $v1, 1\n jr\t$ra\n move\t$v0, $v1\n addiu\t$v1, $v1, 1\n.L34:\n bne\t$a3, $v1, .L1c\n addiu\t$v0, $v0, 4\n beq\t$v1, $a1, .La4\n.L40:\n sll\t$t8, $v1, 0x2\n addu\t$v0, $a0, $t8\n.L48:\n lw\t$t9, 0($v0)\n bnel\t$a2, $t9, .L60\n lw\t$t1, 4($v0)\n jr\t$ra\n move\t$v0, $v1\n lw\t$t1, 4($v0)\n.L60:\n bnel\t$a2, $t1, .L74\n lw\t$t2, 8($v0)\n jr\t$ra\n addiu\t$v0, $v1, 1\n lw\t$t2, 8($v0)\n.L74:\n bnel\t$a2, $t2, .L88\n lw\t$t3, 12($v0)\n jr\t$ra\n addiu\t$v0, $v1, 2\n lw\t$t3, 12($v0)\n.L88:\n bnel\t$a2, $t3, .L9c\n addiu\t$v1, $v1, 4\n jr\t$ra\n addiu\t$v0, $v1, 3\n addiu\t$v1, $v1, 4\n.L9c:\n bne\t$v1, $a1, .L48\n addiu\t$v0, $v0, 16\n.La4:\n li\t$v0, -1\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function findfirst # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `findfirst` — benchmark function synthetic:findfirst:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:findfirst:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta1,a4 \n 4:\tmove\tv1,zero\n 8:\tandi\tt0,a1,0x3\n c:\tbeqz\tt0,40 \n 10:\tmove\ta3,t0\n 14:\tsll\tt6,zero,0x2\n 18:\taddu\tv0,a0,t6\n 1c:\tlw\tt7,0(v0)\n 20:\tbnel\ta2,t7,34 \n 24:\taddiu\tv1,v1,1\n 28:\tjr\tra\n 2c:\tmove\tv0,v1\n 30:\taddiu\tv1,v1,1\n 34:\tbne\ta3,v1,1c \n 38:\taddiu\tv0,v0,4\n 3c:\tbeq\tv1,a1,a4 \n 40:\tsll\tt8,v1,0x2\n 44:\taddu\tv0,a0,t8\n 48:\tlw\tt9,0(v0)\n 4c:\tbnel\ta2,t9,60 \n 50:\tlw\tt1,4(v0)\n 54:\tjr\tra\n 58:\tmove\tv0,v1\n 5c:\tlw\tt1,4(v0)\n 60:\tbnel\ta2,t1,74 \n 64:\tlw\tt2,8(v0)\n 68:\tjr\tra\n 6c:\taddiu\tv0,v1,1\n 70:\tlw\tt2,8(v0)\n 74:\tbnel\ta2,t2,88 \n 78:\tlw\tt3,12(v0)\n 7c:\tjr\tra\n 80:\taddiu\tv0,v1,2\n 84:\tlw\tt3,12(v0)\n 88:\tbnel\ta2,t3,9c \n 8c:\taddiu\tv1,v1,4\n 90:\tjr\tra\n 94:\taddiu\tv0,v1,3\n 98:\taddiu\tv1,v1,4\n 9c:\tbne\tv1,a1,48 \n a0:\taddiu\tv0,v0,16\n a4:\tli\tv0,-1\n a8:\tjr\tra\n ac:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000b0 findfirst\n\n\nContents of section .text:\n 0000 18a00028 00001825 30a80003 1100000c ...(...%0.......\n 0010 01003825 00007080 008e1021 8c4f0000 ..8%..p....!.O..\n 0020 54cf0004 24630001 03e00008 00601025 T...$c.......`.%\n 0030 24630001 14e3fff9 24420004 10650019 $c......$B...e..\n 0040 0003c080 00981021 8c590000 54d90004 .......!.Y..T...\n 0050 8c490004 03e00008 00601025 8c490004 .I.......`.%.I..\n 0060 54c90004 8c4a0008 03e00008 24620001 T....J......$b..\n 0070 8c4a0008 54ca0004 8c4b000c 03e00008 .J..T....K......\n 0080 24620002 8c4b000c 54cb0004 24630004 $b...K..T...$c..\n 0090 03e00008 24620003 24630004 1465ffea ....$b..$c...e..\n 00a0 24420010 2402ffff 03e00008 00000000 $B..$...........\nContents of section .options:\n 0000 01200000 00000000 8300cffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300cffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002c 00000008 00000218 p......,........\n 0010 00000005 00000364 00000001 00000220 .......d....... \n 0020 00000004 00000254 00000000 00000000 .......T........\n 0030 00000011 00000284 00000038 000002c8 ...........8....\n 0040 0000000c 00000300 00000001 0000030c ................\n 0050 00000000 00000000 00000001 00000354 ...............T\n 0060 08080808 07000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000b0 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d64 38623165 66396663 ps-ref-d8b1ef9fc\n 0130 33326630 6163382f 7265662e 63006669 32f0ac8/ref.c.fi\n 0140 6e646669 72737400 66696e64 66697273 ndfirst.findfirs\n 0150 74000000 00000000 00000001 00000000 t...............\n 0160 00000038 00000000 00000004 00000000 ...8............\n 0170 0000002c 00000000 00000000 00000001 ...,............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000005 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name findfirst # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:findfirst:mwcc_242_81","sym":"findfirst","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for","branch","memory"],"loc":1,"refSource":"int findfirst(int *a,int n,int t){ int i; for(i=0;i:\n 0:\tli r6,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 30 \n 10:\tlwz r0,0(r3)\n 14:\tcmpw r5,r0\n 18:\tbne 24 \n 1c:\tmr r3,r6\n 20:\tblr\n 24:\taddi r3,r3,4\n 28:\taddi r6,r6,1\n 2c:\tbdnz 10 \n 30:\tli r3,-1\n 34:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000038 findfirst\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 findfirst\n\n\nContents of section .text:\n 0000 38c00000 7c8903a6 2c040000 40810024 8...|...,...@..$\n 0010 80030000 7c050000 4082000c 7cc33378 ....|...@...|.3x\n 0020 4e800020 38630004 38c60001 4200ffe4 N.. 8c..8...B...\n 0030 3860ffff 4e800020 8`..N.. \nContents of section .mwcats.text:\n 0000 02000038 00000000 ...8.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 findfirst(s32 * a0, s32 a1, s32 a2) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 > 0) {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n while (a2 != *v0) {\n v0 = v0 + 1;\n v1 = v1 + 1;\n v2 = v2 - 1;\n if (v2 == 0) return -1;\n }\n return v1;\n } else {\n return -1;\n }\n}\n","score":16,"maxScore":22,"compileErrors":null,"breakdown":{"insert":8,"delete":5,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":19,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 findfirst(s32 *arg0, s32 arg1, s32 arg2) {\n s32 *var_r3;\n s32 var_ctr;\n s32 var_r6;\n\n var_r3 = arg0;\n var_r6 = 0;\n var_ctr = arg1;\n if (arg1 > 0) {\nloop_1:\n if (arg2 == (s32) *var_r3) {\n return var_r6;\n }\n var_r3 += 4;\n var_r6 += 1;\n var_ctr -= 1;\n if (var_ctr == 0) {\n /* Duplicate return node #4. Try simplifying control flow for better match */\n return -1;\n }\n goto loop_1;\n }\n return -1;\n}\n","score":9,"maxScore":18,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":88,"lines":23,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":9,"maxScore":18,"ratio":0.5,"kinds":{"insert":4,"delete":2,"replace":0,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `findfirst` — benchmark function synthetic:findfirst:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel findfirst\n li r6,0\n mtctr r4\n cmpwi r4,0\n ble .L30\n.L10:\n lwz r0,0(r3)\n cmpw r5,r0\n bne .L24\n mr r3,r6\n blr\n.L24:\n addi r3,r3,4\n addi r6,r6,1\n bdnz .L10\n.L30:\n li r3,-1\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function findfirst # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `findfirst` — benchmark function synthetic:findfirst:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:findfirst:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r6,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 30 \n 10:\tlwz r0,0(r3)\n 14:\tcmpw r5,r0\n 18:\tbne 24 \n 1c:\tmr r3,r6\n 20:\tblr\n 24:\taddi r3,r3,4\n 28:\taddi r6,r6,1\n 2c:\tbdnz 10 \n 30:\tli r3,-1\n 34:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000038 findfirst\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 findfirst\n\n\nContents of section .text:\n 0000 38c00000 7c8903a6 2c040000 40810024 8...|...,...@..$\n 0010 80030000 7c050000 4082000c 7cc33378 ....|...@...|.3x\n 0020 4e800020 38630004 38c60001 4200ffe4 N.. 8c..8...B...\n 0030 3860ffff 4e800020 8`..N.. \nContents of section .mwcats.text:\n 0000 02000038 00000000 ...8.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name findfirst # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fma1:agbcc","sym":"fma1","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","arithmetic","expr"],"loc":1,"refSource":"float fma1(float a,float b,float c){ return a*b+c; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfma1\n\t.type\t fma1,function\n\t.thumb_func\nfma1:\n\tpush\t{r4, lr}\n\tadd\tr4, r2, #0\n\tbl\t__mulsf3\n\tadd\tr1, r4, #0\n\tbl\t__addsf3\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fma1,.Lfe1-fma1\n","ctx":"float fma1(float,float,float);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 fma1(u32 a0) {\n return __addsf3(__mulsf3(), a0, a0);\n}\n","score":2,"maxScore":9,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 __addsf3(s32, f32); /* extern */\ns32 __mulsf3(); /* extern */\n\nf32 fma1(f32 arg0, f32 arg1, f32 arg2) {\n return (bitwise f32) __addsf3(__mulsf3(), arg2);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C bitwise cast"]},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":9,"ratio":0.2222222222222222,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fma1` — benchmark function synthetic:fma1:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfma1\n\t.type\t fma1,function\n\t.thumb_func\nfma1:\n\tpush\t{r4, lr}\n\tadd\tr4, r2, #0\n\tbl\t__mulsf3\n\tadd\tr1, r4, #0\n\tbl\t__addsf3\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fma1,.Lfe1-fma1\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fma1(float,float,float);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fma1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fma1` — benchmark function synthetic:fma1:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fma1:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfma1\n\t.type\t fma1,function\n\t.thumb_func\nfma1:\n\tpush\t{r4, lr}\n\tadd\tr4, r2, #0\n\tbl\t__mulsf3\n\tadd\tr1, r4, #0\n\tbl\t__addsf3\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fma1,.Lfe1-fma1\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fma1 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fma1:gcc2.7.2kmc","sym":"fma1","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","arithmetic","expr"],"loc":1,"refSource":"float fma1(float a,float b,float c){ return a*b+c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmul.s\t$f0,$f12,$f14\n 8:\tmtc1\ta2,$f2\n c:\tnop\n 10:\tjr\tra\n 14:\tadd.s\t$f0,$f0,$f2\n\t...\n","ctx":"float fma1(float,float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c53da19510d2f191/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 fma1\n\n\nContents of section .text:\n 0000 00000000 460e6002 44861000 00000000 ....F.`.D.......\n 0010 03e00008 46020000 00000000 00000000 ....F...........\nContents of section .reginfo:\n 0000 80000040 00000000 00005005 00000000 ...@......P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fma1' — lift: cannot lift 'fma1 @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tnop */\n/* 4:\tmul.s\t$f0,$f12,$f14 */\n/* 8:\tmtc1\ta2,$f2 */\n/* c:\tnop */\n/* 10:\tjr\tra */\n/* 14:\tadd.s\t$f0,$f0,$f2 */\n/* \t... */\nvoid fma1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fma1 @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":15,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fma1 @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fma1(f32 arg0, f32 arg1, f32 arg2) {\n return (arg0 * arg1) + arg2;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fma1` — benchmark function synthetic:fma1:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fma1\n nop\n mul.s\t$f0, $f12, $f14\n mtc1\t$a2, $f2\n nop\n jr\t$ra\n add.s\t$f0, $f0, $f2\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fma1(float,float,float);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fma1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fma1` — benchmark function synthetic:fma1:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fma1:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmul.s\t$f0,$f12,$f14\n 8:\tmtc1\ta2,$f2\n c:\tnop\n 10:\tjr\tra\n 14:\tadd.s\t$f0,$f0,$f2\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c53da19510d2f191/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 fma1\n\n\nContents of section .text:\n 0000 00000000 460e6002 44861000 00000000 ....F.`.D.......\n 0010 03e00008 46020000 00000000 00000000 ....F...........\nContents of section .reginfo:\n 0000 80000040 00000000 00005005 00000000 ...@......P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fma1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fma1:ido7.1","sym":"fma1","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","arithmetic","expr"],"loc":1,"refSource":"float fma1(float a,float b,float c){ return a*b+c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmul.s\t$f4,$f12,$f14\n 4:\tsw\ta2,8(sp)\n 8:\tlwc1\t$f6,8(sp)\n c:\tjr\tra\n 10:\tadd.s\t$f0,$f4,$f6\n\t...\n","ctx":"float fma1(float,float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 fma1\n\n\nContents of section .text:\n 0000 460e6102 afa60008 c7a60008 03e00008 F.a.............\n 0010 46062000 00000000 00000000 00000000 F. .............\nContents of section .options:\n 0000 01200000 00000000 a0000040 00000000 . .........@....\n 0010 00005073 00000000 00000000 00007ff0 ..Ps............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000040 00000000 00005073 00000000 ...@......Ps....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 35336461 31393531 30643266 ef-c53da19510d2f\n 0130 3139312f 7265662e 6300666d 61310000 191/ref.c.fma1..\n 0140 666d6131 00000000 00000000 00000001 fma1............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fma1' — lift: cannot lift 'fma1 @0x0': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmul.s\t$f4,$f12,$f14 */\n/* 4:\tsw\ta2,8(sp) */\n/* 8:\tlwc1\t$f6,8(sp) */\n/* c:\tjr\tra */\n/* 10:\tadd.s\t$f0,$f4,$f6 */\n/* \t... */\nvoid fma1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fma1 @0x0': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":14,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fma1 @0x0': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fma1(f32 arg0, f32 arg1, f32 arg2) {\n return (arg0 * arg1) + arg2;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fma1` — benchmark function synthetic:fma1:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fma1\n mul.s\t$f4, $f12, $f14\n sw\t$a2, 8($sp)\n lwc1\t$f6, 8($sp)\n jr\t$ra\n add.s\t$f0, $f4, $f6\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fma1(float,float,float);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fma1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fma1` — benchmark function synthetic:fma1:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fma1:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmul.s\t$f4,$f12,$f14\n 4:\tsw\ta2,8(sp)\n 8:\tlwc1\t$f6,8(sp)\n c:\tjr\tra\n 10:\tadd.s\t$f0,$f4,$f6\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 fma1\n\n\nContents of section .text:\n 0000 460e6102 afa60008 c7a60008 03e00008 F.a.............\n 0010 46062000 00000000 00000000 00000000 F. .............\nContents of section .options:\n 0000 01200000 00000000 a0000040 00000000 . .........@....\n 0010 00005073 00000000 00000000 00007ff0 ..Ps............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000040 00000000 00005073 00000000 ...@......Ps....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 35336461 31393531 30643266 ef-c53da19510d2f\n 0130 3139312f 7265662e 6300666d 61310000 191/ref.c.fma1..\n 0140 666d6131 00000000 00000000 00000001 fma1............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fma1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fma1:mwcc_242_81","sym":"fma1","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","arithmetic","expr"],"loc":1,"refSource":"float fma1(float a,float b,float c){ return a*b+c; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfmuls f0,f1,f2\n 4:\tfadds f1,f3,f0\n 8:\tblr\n","ctx":"float fma1(float,float,float);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c fma1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fma1\n\n\nContents of section .text:\n 0000 ec0100b2 ec23002a 4e800020 .....#.*N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fma1' — lift: cannot lift 'fma1 @0x0': unmodelled effect instruction 'fmuls' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfmuls f0,f1,f2 */\n/* 4:\tfadds f1,f3,f0 */\n/* 8:\tblr */\nvoid fma1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fma1 @0x0': unmodelled effect instruction 'fmuls' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fma1 @0x0': unmodelled effect instruction 'fmuls' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fma1(f32 farg0, f32 farg1, f32 farg2) {\n return farg2 + (farg0 * farg1);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fma1` — benchmark function synthetic:fma1:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fma1\n fmuls f0,f1,f2\n fadds f1,f3,f0\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fma1(float,float,float);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fma1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fma1` — benchmark function synthetic:fma1:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fma1:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfmuls f0,f1,f2\n 4:\tfadds f1,f3,f0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c fma1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fma1\n\n\nContents of section .text:\n 0000 ec0100b2 ec23002a 4e800020 .....#.*N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fma1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fmul:agbcc","sym":"fmul","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fmul(float a,float b){ return a*b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfmul\n\t.type\t fmul,function\n\t.thumb_func\nfmul:\n\tpush\t{lr}\n\tbl\t__mulsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fmul,.Lfe1-fmul\n","ctx":"float fmul(float,float);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 fmul(void) {\n return __mulsf3();\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 __mulsf3(); /* extern */\n\nf32 fmul(f32 arg0, f32 arg1) {\n return (bitwise f32) __mulsf3();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fmul` — benchmark function synthetic:fmul:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfmul\n\t.type\t fmul,function\n\t.thumb_func\nfmul:\n\tpush\t{lr}\n\tbl\t__mulsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fmul,.Lfe1-fmul\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fmul(float,float);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fmul # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fmul` — benchmark function synthetic:fmul:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fmul:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfmul\n\t.type\t fmul,function\n\t.thumb_func\nfmul:\n\tpush\t{lr}\n\tbl\t__mulsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fmul,.Lfe1-fmul\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fmul # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fmul:gcc2.7.2kmc","sym":"fmul","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fmul(float a,float b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tmul.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fmul(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-eeb6517bc3ee945b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fmul\n\n\nContents of section .text:\n 0000 03e00008 460e6002 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fmul' — lift: cannot lift 'fmul @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tmul.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fmul(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fmul @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fmul @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fmul(f32 arg0, f32 arg1) {\n return arg0 * arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fmul` — benchmark function synthetic:fmul:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fmul\n jr\t$ra\n mul.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fmul(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fmul # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fmul` — benchmark function synthetic:fmul:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fmul:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tmul.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-eeb6517bc3ee945b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fmul\n\n\nContents of section .text:\n 0000 03e00008 460e6002 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fmul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fmul:ido7.1","sym":"fmul","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fmul(float a,float b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tmul.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fmul(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fmul\n\n\nContents of section .text:\n 0000 03e00008 460e6002 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 65623635 31376263 33656539 ef-eeb6517bc3ee9\n 0130 3435622f 7265662e 6300666d 756c0000 45b/ref.c.fmul..\n 0140 666d756c 00000000 00000000 00000001 fmul............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fmul' — lift: cannot lift 'fmul @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tmul.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fmul(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fmul @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fmul @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fmul(f32 arg0, f32 arg1) {\n return arg0 * arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fmul` — benchmark function synthetic:fmul:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fmul\n jr\t$ra\n mul.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fmul(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fmul # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fmul` — benchmark function synthetic:fmul:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fmul:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tmul.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fmul\n\n\nContents of section .text:\n 0000 03e00008 460e6002 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 65623635 31376263 33656539 ef-eeb6517bc3ee9\n 0130 3435622f 7265662e 6300666d 756c0000 45b/ref.c.fmul..\n 0140 666d756c 00000000 00000000 00000001 fmul............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fmul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fmul:mwcc_242_81","sym":"fmul","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fmul(float a,float b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfmuls f1,f1,f2\n 4:\tblr\n","ctx":"float fmul(float,float);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fmul\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fmul\n\n\nContents of section .text:\n 0000 ec2100b2 4e800020 .!..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fmul' — lift: cannot lift 'fmul @0x0': unmodelled effect instruction 'fmuls' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfmuls f1,f1,f2 */\n/* 4:\tblr */\nvoid fmul(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fmul @0x0': unmodelled effect instruction 'fmuls' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":10,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fmul @0x0': unmodelled effect instruction 'fmuls' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fmul(f32 farg0, f32 farg1) {\n return farg0 * farg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fmul` — benchmark function synthetic:fmul:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fmul\n fmuls f1,f1,f2\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fmul(float,float);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fmul # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fmul` — benchmark function synthetic:fmul:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fmul:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfmuls f1,f1,f2\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fmul\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fmul\n\n\nContents of section .text:\n 0000 ec2100b2 4e800020 .!..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fmul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fsub:agbcc","sym":"fsub","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fsub(float a,float b){ return a-b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfsub\n\t.type\t fsub,function\n\t.thumb_func\nfsub:\n\tpush\t{lr}\n\tbl\t__subsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fsub,.Lfe1-fsub\n","ctx":"float fsub(float,float);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 fsub(void) {\n return __subsf3();\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 __subsf3(); /* extern */\n\nf32 fsub(f32 arg0, f32 arg1) {\n return (bitwise f32) __subsf3();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fsub` — benchmark function synthetic:fsub:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfsub\n\t.type\t fsub,function\n\t.thumb_func\nfsub:\n\tpush\t{lr}\n\tbl\t__subsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fsub,.Lfe1-fsub\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fsub(float,float);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fsub # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fsub` — benchmark function synthetic:fsub:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fsub:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfsub\n\t.type\t fsub,function\n\t.thumb_func\nfsub:\n\tpush\t{lr}\n\tbl\t__subsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fsub,.Lfe1-fsub\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fsub # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fsub:gcc2.7.2kmc","sym":"fsub","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fsub(float a,float b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsub.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fsub(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c32f6114ade25b45/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fsub\n\n\nContents of section .text:\n 0000 03e00008 460e6001 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fsub' — lift: cannot lift 'fsub @0x4': unmodelled effect instruction 'sub.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tsub.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fsub(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fsub @0x4': unmodelled effect instruction 'sub.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fsub @0x4': unmodelled effect instruction 'sub.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fsub(f32 arg0, f32 arg1) {\n return arg0 - arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fsub` — benchmark function synthetic:fsub:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fsub\n jr\t$ra\n sub.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fsub(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fsub # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fsub` — benchmark function synthetic:fsub:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fsub:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsub.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c32f6114ade25b45/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fsub\n\n\nContents of section .text:\n 0000 03e00008 460e6001 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fsub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fsub:ido7.1","sym":"fsub","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fsub(float a,float b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsub.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fsub(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fsub\n\n\nContents of section .text:\n 0000 03e00008 460e6001 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 33326636 31313461 64653235 ef-c32f6114ade25\n 0130 6234352f 7265662e 63006673 75620000 b45/ref.c.fsub..\n 0140 66737562 00000000 00000000 00000001 fsub............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fsub' — lift: cannot lift 'fsub @0x4': unmodelled effect instruction 'sub.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tsub.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fsub(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fsub @0x4': unmodelled effect instruction 'sub.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fsub @0x4': unmodelled effect instruction 'sub.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fsub(f32 arg0, f32 arg1) {\n return arg0 - arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fsub` — benchmark function synthetic:fsub:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fsub\n jr\t$ra\n sub.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fsub(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fsub # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fsub` — benchmark function synthetic:fsub:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fsub:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsub.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fsub\n\n\nContents of section .text:\n 0000 03e00008 460e6001 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 33326636 31313461 64653235 ef-c32f6114ade25\n 0130 6234352f 7265662e 63006673 75620000 b45/ref.c.fsub..\n 0140 66737562 00000000 00000000 00000001 fsub............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fsub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fsub:mwcc_242_81","sym":"fsub","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fsub(float a,float b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfsubs f1,f1,f2\n 4:\tblr\n","ctx":"float fsub(float,float);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fsub\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fsub\n\n\nContents of section .text:\n 0000 ec211028 4e800020 .!.(N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fsub' — lift: cannot lift 'fsub @0x0': unmodelled effect instruction 'fsubs' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfsubs f1,f1,f2 */\n/* 4:\tblr */\nvoid fsub(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fsub @0x0': unmodelled effect instruction 'fsubs' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":10,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fsub @0x0': unmodelled effect instruction 'fsubs' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fsub(f32 farg0, f32 farg1) {\n return farg0 - farg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fsub` — benchmark function synthetic:fsub:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fsub\n fsubs f1,f1,f2\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fsub(float,float);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fsub # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fsub` — benchmark function synthetic:fsub:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fsub:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfsubs f1,f1,f2\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fsub\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fsub\n\n\nContents of section .text:\n 0000 ec211028 4e800020 .!.(N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fsub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:gcd:agbcc","sym":"gcd","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","while","mod-reg"],"loc":1,"refSource":"int gcd(int a,int b){ while(b){int t=b;b=a%b;a=t;} return a; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tgcd\n\t.type\t gcd,function\n\t.thumb_func\ngcd:\n\tpush\t{r4, lr}\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr4, r0, #0\n\tadd\tr0, r2, #0\n\tadd\tr1, r4, #0\n\tbl\t__modsi3\n\tadd\tr2, r4, #0\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t gcd,.Lfe1-gcd\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 gcd(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 t0;\n v0 = a1;\n v1 = a0;\n while (v0 != 0) {\n t0 = v1;\n v1 = v0;\n v0 = t0 % v0;\n }\n a0 = v1;\n return a0;\n}\n","score":10,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":8},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 gcd(s32 arg0, s32 arg1) {\n s32 temp_r4;\n s32 var_r0;\n s32 var_r2;\n\n var_r2 = arg0;\n var_r0 = arg1;\n if (var_r0 != 0) {\n do {\n temp_r4 = var_r0;\n var_r0 = var_r2 % temp_r4;\n var_r2 = temp_r4;\n } while (var_r0 != 0);\n }\n return var_r2;\n}\n","score":0,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `gcd` — benchmark function synthetic:gcd:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tgcd\n\t.type\t gcd,function\n\t.thumb_func\ngcd:\n\tpush\t{r4, lr}\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr4, r0, #0\n\tadd\tr0, r2, #0\n\tadd\tr1, r4, #0\n\tbl\t__modsi3\n\tadd\tr2, r4, #0\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t gcd,.Lfe1-gcd\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function gcd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `gcd` — benchmark function synthetic:gcd:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:gcd:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tgcd\n\t.type\t gcd,function\n\t.thumb_func\ngcd:\n\tpush\t{r4, lr}\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr4, r0, #0\n\tadd\tr0, r2, #0\n\tadd\tr1, r4, #0\n\tbl\t__modsi3\n\tadd\tr2, r4, #0\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t gcd,.Lfe1-gcd\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name gcd # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:gcd:gcc2.7.2kmc","sym":"gcd","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","while","mod-reg"],"loc":1,"refSource":"int gcd(int a,int b){ while(b){int t=b;b=a%b;a=t;} return a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta1,48 \n 4:\tnop\n 8:\tmove\tv0,a1\n c:\tdiv\tzero,a0,a1\n 10:\tbnez\ta1,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta1,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\ta0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmfhi\ta1\n\t...\n 40:\tbnez\ta1,8 \n 44:\tmove\ta0,v0\n 48:\tjr\tra\n 4c:\tmove\tv0,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3ddd71640c03fc3b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 gcd\n\n\nContents of section .text:\n 0000 10a00011 00000000 00a01021 0085001a ...........!....\n 0010 14a00002 00000000 0007000d 2401ffff ............$...\n 0020 14a10004 3c018000 14810002 00000000 ....<...........\n 0030 0006000d 00002810 00000000 00000000 ......(.........\n 0040 14a0fff1 00402021 03e00008 00801021 .....@ !.......!\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 gcd(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 t0;\n if (a1 != 0) {\n v0 = a1;\n v1 = a0;\n do {\n t0 = v1;\n v1 = v0;\n v0 = t0 % v0;\n } while (v0 != 0);\n a0 = v1;\n }\n return a0;\n}\n","score":10,"maxScore":22,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 gcd(s32 arg0, s32 arg1) {\n s32 temp_v0;\n s32 var_a0;\n s32 var_a1;\n\n var_a0 = arg0;\n var_a1 = arg1;\n if (var_a1 != 0) {\n do {\n temp_v0 = var_a1;\n var_a1 = var_a0 % var_a1;\n var_a0 = temp_v0;\n } while (var_a1 != 0);\n }\n return var_a0;\n}\n","score":0,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `gcd` — benchmark function synthetic:gcd:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel gcd\n beqz\t$a1, .L48\n nop\n.L8:\n move\t$v0, $a1\n div\t$zero, $a0, $a1\n bnez\t$a1, .L1c\n nop\n break\t0x7\n.L1c:\n li\t$at, -1\n bne\t$a1, $at, .L34\n lui\t$at, 0x8000\n bne\t$a0, $at, .L34\n nop\n break\t0x6\n.L34:\n mfhi\t$a1\n bnez\t$a1, .L8\n move\t$a0, $v0\n.L48:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function gcd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `gcd` — benchmark function synthetic:gcd:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:gcd:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta1,48 \n 4:\tnop\n 8:\tmove\tv0,a1\n c:\tdiv\tzero,a0,a1\n 10:\tbnez\ta1,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta1,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\ta0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmfhi\ta1\n\t...\n 40:\tbnez\ta1,8 \n 44:\tmove\ta0,v0\n 48:\tjr\tra\n 4c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3ddd71640c03fc3b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 gcd\n\n\nContents of section .text:\n 0000 10a00011 00000000 00a01021 0085001a ...........!....\n 0010 14a00002 00000000 0007000d 2401ffff ............$...\n 0020 14a10004 3c018000 14810002 00000000 ....<...........\n 0030 0006000d 00002810 00000000 00000000 ......(.........\n 0040 14a0fff1 00402021 03e00008 00801021 .....@ !.......!\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name gcd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:gcd:ido7.1","sym":"gcd","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","while","mod-reg"],"loc":1,"refSource":"int gcd(int a,int b){ while(b){int t=b;b=a%b;a=t;} return a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta1,44 \n 4:\tnop\n 8:\tdiv\tzero,a0,a1\n c:\tmove\tv0,a1\n 10:\tbnez\ta1,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta1,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\ta0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmfhi\ta1\n 38:\tmove\ta0,v0\n 3c:\tbnez\ta1,8 \n 40:\tnop\n 44:\tjr\tra\n 48:\tmove\tv0,a0\n 4c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c gcd\n\n\nContents of section .text:\n 0000 10a00010 00000000 0085001a 00a01025 ...............%\n 0010 14a00002 00000000 0007000d 2401ffff ............$...\n 0020 14a10004 3c018000 14810002 00000000 ....<...........\n 0030 0006000d 00002810 00402025 14a0fff2 ......(..@ %....\n 0040 00000000 03e00008 00801025 00000000 ...........%....\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 00000004 000001b8 p...............\n 0010 00000005 000002f4 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000034 00000264 ....... ...4...d\n 0040 00000004 00000298 00000001 0000029c ................\n 0050 00000000 00000000 00000001 000002e4 ................\n 0060 08080000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000004c 20200001 00000001 .......L ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 64646437 31363430 63303366 ef-3ddd71640c03f\n 0130 6333622f 7265662e 63006763 64000000 c3b/ref.c.gcd...\n 0140 67636400 00000000 00000001 00000000 gcd.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000013 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000003 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 gcd(s32 a0, s32 a1) {\n s32 t0;\n if (a1 != 0) {\n do {\n t0 = a0;\n a0 = a1;\n a1 = t0 % a1;\n } while (a1 != 0);\n }\n return a0;\n}\n","score":8,"maxScore":20,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 gcd(s32 arg0, s32 arg1) {\n s32 temp_v0;\n s32 var_a0;\n s32 var_a1;\n\n var_a0 = arg0;\n var_a1 = arg1;\n if (var_a1 != 0) {\n do {\n temp_v0 = var_a1;\n var_a1 = var_a0 % var_a1;\n var_a0 = temp_v0;\n } while (var_a1 != 0);\n }\n return var_a0;\n}\n","score":11,"maxScore":20,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":1,"opMismatch":0,"argMismatch":9},"quality":{"score":100,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":8,"maxScore":20,"ratio":0.4,"kinds":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `gcd` — benchmark function synthetic:gcd:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel gcd\n beqz\t$a1, .L44\n nop\n.L8:\n div\t$zero, $a0, $a1\n move\t$v0, $a1\n bnez\t$a1, .L1c\n nop\n break\t0x7\n.L1c:\n li\t$at, -1\n bne\t$a1, $at, .L34\n lui\t$at, 0x8000\n bne\t$a0, $at, .L34\n nop\n break\t0x6\n.L34:\n mfhi\t$a1\n move\t$a0, $v0\n bnez\t$a1, .L8\n nop\n.L44:\n jr\t$ra\n move\t$v0, $a0\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function gcd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `gcd` — benchmark function synthetic:gcd:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:gcd:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta1,44 \n 4:\tnop\n 8:\tdiv\tzero,a0,a1\n c:\tmove\tv0,a1\n 10:\tbnez\ta1,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta1,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\ta0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmfhi\ta1\n 38:\tmove\ta0,v0\n 3c:\tbnez\ta1,8 \n 40:\tnop\n 44:\tjr\tra\n 48:\tmove\tv0,a0\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c gcd\n\n\nContents of section .text:\n 0000 10a00010 00000000 0085001a 00a01025 ...............%\n 0010 14a00002 00000000 0007000d 2401ffff ............$...\n 0020 14a10004 3c018000 14810002 00000000 ....<...........\n 0030 0006000d 00002810 00402025 14a0fff2 ......(..@ %....\n 0040 00000000 03e00008 00801025 00000000 ...........%....\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 00000004 000001b8 p...............\n 0010 00000005 000002f4 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000034 00000264 ....... ...4...d\n 0040 00000004 00000298 00000001 0000029c ................\n 0050 00000000 00000000 00000001 000002e4 ................\n 0060 08080000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000004c 20200001 00000001 .......L ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 64646437 31363430 63303366 ef-3ddd71640c03f\n 0130 6333622f 7265662e 63006763 64000000 c3b/ref.c.gcd...\n 0140 67636400 00000000 00000001 00000000 gcd.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000013 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000003 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name gcd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:gcd:mwcc_242_81","sym":"gcd","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","while","mod-reg"],"loc":1,"refSource":"int gcd(int a,int b){ while(b){int t=b;b=a%b;a=t;} return a; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tb 18 \n 4:\tdivw r0,r3,r4\n 8:\tmr r5,r4\n c:\tmullw r0,r0,r4\n 10:\tsubf r4,r0,r3\n 14:\tmr r3,r5\n 18:\tcmpwi r4,0\n 1c:\tbne 4 \n 20:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000024 gcd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 gcd\n\n\nContents of section .text:\n 0000 48000018 7c0323d6 7c852378 7c0021d6 H...|.#.|.#x|.!.\n 0010 7c801850 7ca32b78 2c040000 4082ffe8 |..P|.+x,...@...\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 gcd(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 t0;\n v0 = a1;\n v1 = a0;\n while (v0 != 0) {\n t0 = v1;\n v1 = v0;\n v0 = t0 - t0 / v0 * v0;\n }\n return v1;\n}\n","score":7,"maxScore":11,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void gcd(s32 arg0, s32 arg1) {\n s32 temp_r5;\n s32 var_r3;\n s32 var_r4;\n\n var_r3 = arg0;\n var_r4 = arg1;\nloop_2:\n if (var_r4 != 0) {\n temp_r5 = var_r4;\n var_r4 = var_r3 % var_r4;\n var_r3 = temp_r5;\n goto loop_2;\n }\n}\n","score":4,"maxScore":10,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":2,"opMismatch":0,"argMismatch":0},"quality":{"score":88,"lines":14,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":10,"ratio":0.4,"kinds":{"insert":1,"delete":1,"replace":2,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `gcd` — benchmark function synthetic:gcd:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel gcd\n b .L18\n.L4:\n divw r0,r3,r4\n mr r5,r4\n mullw r0,r0,r4\n subf r4,r0,r3\n mr r3,r5\n.L18:\n cmpwi r4,0\n bne .L4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function gcd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `gcd` — benchmark function synthetic:gcd:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:gcd:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tb 18 \n 4:\tdivw r0,r3,r4\n 8:\tmr r5,r4\n c:\tmullw r0,r0,r4\n 10:\tsubf r4,r0,r3\n 14:\tmr r3,r5\n 18:\tcmpwi r4,0\n 1c:\tbne 4 \n 20:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000024 gcd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 gcd\n\n\nContents of section .text:\n 0000 48000018 7c0323d6 7c852378 7c0021d6 H...|.#.|.#x|.!.\n 0010 7c801850 7ca32b78 2c040000 4082ffe8 |..P|.+x,...@...\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name gcd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hi16:agbcc","sym":"hi16","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned hi16(unsigned x){ return x>>16; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\thi16\n\t.type\t hi16,function\n\t.thumb_func\nhi16:\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t hi16,.Lfe1-hi16\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 hi16(u32 a0) {\n return a0 >> 16;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 hi16(u32 arg0) {\n return arg0 >> 0x10;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hi16` — benchmark function synthetic:hi16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\thi16\n\t.type\t hi16,function\n\t.thumb_func\nhi16:\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t hi16,.Lfe1-hi16\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hi16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hi16` — benchmark function synthetic:hi16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hi16:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\thi16\n\t.type\t hi16,function\n\t.thumb_func\nhi16:\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t hi16,.Lfe1-hi16\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name hi16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hi16:gcc2.7.2kmc","sym":"hi16","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned hi16(unsigned x){ return x>>16; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrl\tv0,a0,0x10\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c869f1e512e43840/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 hi16\n\n\nContents of section .text:\n 0000 03e00008 00041402 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 hi16(u32 a0) {\n return a0 >> 16;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 hi16(u32 arg0) {\n return arg0 >> 0x10;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hi16` — benchmark function synthetic:hi16:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel hi16\n jr\t$ra\n srl\t$v0, $a0, 0x10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hi16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hi16` — benchmark function synthetic:hi16:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hi16:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrl\tv0,a0,0x10\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c869f1e512e43840/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 hi16\n\n\nContents of section .text:\n 0000 03e00008 00041402 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name hi16 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hi16:ido7.1","sym":"hi16","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned hi16(unsigned x){ return x>>16; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrl\tv0,a0,0x10\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 hi16\n\n\nContents of section .text:\n 0000 03e00008 00041402 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 38363966 31653531 32653433 ef-c869f1e512e43\n 0130 3834302f 7265662e 63006869 31360000 840/ref.c.hi16..\n 0140 68693136 00000000 00000000 00000001 hi16............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 hi16(u32 a0) {\n return a0 >> 16;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 hi16(u32 arg0) {\n return arg0 >> 0x10;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hi16` — benchmark function synthetic:hi16:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel hi16\n jr\t$ra\n srl\t$v0, $a0, 0x10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hi16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hi16` — benchmark function synthetic:hi16:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hi16:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrl\tv0,a0,0x10\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 hi16\n\n\nContents of section .text:\n 0000 03e00008 00041402 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 38363966 31653531 32653433 ef-c869f1e512e43\n 0130 3834302f 7265662e 63006869 31360000 840/ref.c.hi16..\n 0140 68693136 00000000 00000000 00000001 hi16............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name hi16 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hi16:mwcc_242_81","sym":"hi16","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned hi16(unsigned x){ return x>>16; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrwi r3,r3,16\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 hi16\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 hi16\n\n\nContents of section .text:\n 0000 5463843e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 hi16(u32 a0) {\n return a0 >> 16;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 hi16(u32 arg0) {\n return arg0 >> 0x10U;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hi16` — benchmark function synthetic:hi16:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel hi16\n srwi r3,r3,16\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hi16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hi16` — benchmark function synthetic:hi16:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hi16:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrwi r3,r3,16\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 hi16\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 hi16\n\n\nContents of section .text:\n 0000 5463843e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name hi16 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hword:agbcc","sym":"hword","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","array","store","narrow"],"loc":1,"refSource":"void hword(u16 *p,int i,int v){ p[i]=(u16)v; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\thword\n\t.type\t hword,function\n\t.thumb_func\nhword:\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r0\n\tstrh\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t hword,.Lfe1-hword\n","ctx":"void hword(u16*,int,int);","proto":{"hword":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void hword(u16 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void hword(u16 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = (u16) arg2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hword` — benchmark function synthetic:hword:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\thword\n\t.type\t hword,function\n\t.thumb_func\nhword:\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r0\n\tstrh\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t hword,.Lfe1-hword\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid hword(u16*,int,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hword # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hword` — benchmark function synthetic:hword:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hword:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\thword\n\t.type\t hword,function\n\t.thumb_func\nhword:\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r0\n\tstrh\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t hword,.Lfe1-hword\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"hword\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name hword # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hword:gcc2.7.2kmc","sym":"hword","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","array","store","narrow"],"loc":1,"refSource":"void hword(u16 *p,int i,int v){ p[i]=(u16)v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta1,a1,0x1\n 4:\taddu\ta1,a1,a0\n 8:\tjr\tra\n c:\tsh\ta2,0(a1)\n","ctx":"void hword(u16*,int,int);","proto":{"hword":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-6f36d8e5292b594f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 hword\n\n\nContents of section .text:\n 0000 00052840 00a42821 03e00008 a4a60000 ..(@..(!........\nContents of section .reginfo:\n 0000 80000070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void hword(u16 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void hword(u16 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = (u16) arg2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hword` — benchmark function synthetic:hword:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel hword\n sll\t$a1, $a1, 0x1\n addu\t$a1, $a1, $a0\n jr\t$ra\n sh\t$a2, 0($a1)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid hword(u16*,int,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hword # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hword` — benchmark function synthetic:hword:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hword:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta1,a1,0x1\n 4:\taddu\ta1,a1,a0\n 8:\tjr\tra\n c:\tsh\ta2,0(a1)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-6f36d8e5292b594f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 hword\n\n\nContents of section .text:\n 0000 00052840 00a42821 03e00008 a4a60000 ..(@..(!........\nContents of section .reginfo:\n 0000 80000070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"hword\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name hword # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hword:ido7.1","sym":"hword","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","array","store","narrow"],"loc":1,"refSource":"void hword(u16 *p,int i,int v){ p[i]=(u16)v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x1\n 4:\taddu\tt7,a0,t6\n 8:\tjr\tra\n c:\tsh\ta2,0(t7)\n","ctx":"void hword(u16*,int,int);","proto":{"hword":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 hword\n\n\nContents of section .text:\n 0000 00057040 008e7821 03e00008 a5e60000 ..p@..x!........\nContents of section .options:\n 0000 01200000 00000000 8000c070 00000000 . .........p....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c070 00000000 00000000 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 66333664 38653532 39326235 ef-6f36d8e5292b5\n 0130 3934662f 7265662e 63006877 6f726400 94f/ref.c.hword.\n 0140 68776f72 64000000 00000000 00000001 hword...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void hword(u16 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void hword(u16 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = (u16) arg2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hword` — benchmark function synthetic:hword:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel hword\n sll\t$t6, $a1, 0x1\n addu\t$t7, $a0, $t6\n jr\t$ra\n sh\t$a2, 0($t7)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid hword(u16*,int,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hword # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hword` — benchmark function synthetic:hword:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hword:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x1\n 4:\taddu\tt7,a0,t6\n 8:\tjr\tra\n c:\tsh\ta2,0(t7)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 hword\n\n\nContents of section .text:\n 0000 00057040 008e7821 03e00008 a5e60000 ..p@..x!........\nContents of section .options:\n 0000 01200000 00000000 8000c070 00000000 . .........p....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c070 00000000 00000000 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 66333664 38653532 39326235 ef-6f36d8e5292b5\n 0130 3934662f 7265662e 63006877 6f726400 94f/ref.c.hword.\n 0140 68776f72 64000000 00000000 00000001 hword...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"hword\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name hword # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hword:mwcc_242_81","sym":"hword","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","array","store","narrow"],"loc":1,"refSource":"void hword(u16 *p,int i,int v){ p[i]=(u16)v; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,1\n 4:\tsthx r5,r3,r0\n 8:\tblr\n","ctx":"void hword(u16*,int,int);","proto":{"hword":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c hword\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 hword\n\n\nContents of section .text:\n 0000 5480083c 7ca3032e 4e800020 T..<|...N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void hword(u16 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void hword(u16 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = (u16) arg2;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hword` — benchmark function synthetic:hword:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel hword\n slwi r0,r4,1\n sthx r5,r3,r0\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid hword(u16*,int,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hword # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hword` — benchmark function synthetic:hword:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hword:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,1\n 4:\tsthx r5,r3,r0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c hword\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 hword\n\n\nContents of section .text:\n 0000 5480083c 7ca3032e 4e800020 T..<|...N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"hword\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name hword # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2f:agbcc","sym":"i2f","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","cast","int-to-float"],"loc":1,"refSource":"float i2f(int x){ return (float)x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ti2f\n\t.type\t i2f,function\n\t.thumb_func\ni2f:\n\tpush\t{lr}\n\tbl\t__floatsisf\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t i2f,.Lfe1-i2f\n","ctx":"float i2f(int);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 i2f(void) {\n return __floatsisf();\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 __floatsisf(); /* extern */\n\nf32 i2f(s32 arg0) {\n return (bitwise f32) __floatsisf();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2f` — benchmark function synthetic:i2f:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ti2f\n\t.type\t i2f,function\n\t.thumb_func\ni2f:\n\tpush\t{lr}\n\tbl\t__floatsisf\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t i2f,.Lfe1-i2f\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat i2f(int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2f # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2f` — benchmark function synthetic:i2f:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2f:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ti2f\n\t.type\t i2f,function\n\t.thumb_func\ni2f:\n\tpush\t{lr}\n\tbl\t__floatsisf\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t i2f,.Lfe1-i2f\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2f # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2f:gcc2.7.2kmc","sym":"i2f","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","cast","int-to-float"],"loc":1,"refSource":"float i2f(int x){ return (float)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta0,$f0\n 4:\tnop\n 8:\tjr\tra\n c:\tcvt.s.w\t$f0,$f0\n","ctx":"float i2f(int);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-07c0c4f3f784c974/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 i2f\n\n\nContents of section .text:\n 0000 44840000 00000000 03e00008 46800020 D...........F.. \nContents of section .reginfo:\n 0000 80000010 00000000 00000001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'i2f' — lift: cannot lift 'i2f @0xc': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta0,$f0 */\n/* 4:\tnop */\n/* 8:\tjr\tra */\n/* c:\tcvt.s.w\t$f0,$f0 */\nvoid i2f(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'i2f @0xc': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":12,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'i2f @0xc': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 i2f(s32 arg0) {\n return (f32) arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2f` — benchmark function synthetic:i2f:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel i2f\n mtc1\t$a0, $f0\n nop\n jr\t$ra\n cvt.s.w\t$f0, $f0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat i2f(int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2f # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2f` — benchmark function synthetic:i2f:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2f:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta0,$f0\n 4:\tnop\n 8:\tjr\tra\n c:\tcvt.s.w\t$f0,$f0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-07c0c4f3f784c974/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 i2f\n\n\nContents of section .text:\n 0000 44840000 00000000 03e00008 46800020 D...........F.. \nContents of section .reginfo:\n 0000 80000010 00000000 00000001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2f # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2f:ido7.1","sym":"i2f","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","cast","int-to-float"],"loc":1,"refSource":"float i2f(int x){ return (float)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta0,$f4\n 4:\tjr\tra\n 8:\tcvt.s.w\t$f0,$f4\n c:\tnop\n","ctx":"float i2f(int);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c i2f\n\n\nContents of section .text:\n 0000 44842000 03e00008 46802020 00000000 D. .....F. ....\nContents of section .options:\n 0000 01200000 00000000 80000010 00000000 . ..............\n 0010 00000013 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000010 00000000 00000013 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 37633063 34663366 37383463 ef-07c0c4f3f784c\n 0130 3937342f 7265662e 63006932 66000000 974/ref.c.i2f...\n 0140 69326600 00000000 00000001 00000000 i2f.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000003 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'i2f' — lift: cannot lift 'i2f @0x8': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta0,$f4 */\n/* 4:\tjr\tra */\n/* 8:\tcvt.s.w\t$f0,$f4 */\n/* c:\tnop */\nvoid i2f(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'i2f @0x8': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":12,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'i2f @0x8': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 i2f(s32 arg0) {\n return (f32) arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2f` — benchmark function synthetic:i2f:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel i2f\n mtc1\t$a0, $f4\n jr\t$ra\n cvt.s.w\t$f0, $f4\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat i2f(int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2f # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2f` — benchmark function synthetic:i2f:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2f:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta0,$f4\n 4:\tjr\tra\n 8:\tcvt.s.w\t$f0,$f4\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c i2f\n\n\nContents of section .text:\n 0000 44842000 03e00008 46802020 00000000 D. .....F. ....\nContents of section .options:\n 0000 01200000 00000000 80000010 00000000 . ..............\n 0010 00000013 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000010 00000000 00000013 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 37633063 34663366 37383463 ef-07c0c4f3f784c\n 0130 3937342f 7265662e 63006932 66000000 974/ref.c.i2f...\n 0140 69326600 00000000 00000001 00000000 i2f.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000003 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2f # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2f:mwcc_242_81","sym":"i2f","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","cast","int-to-float"],"loc":1,"refSource":"float i2f(int x){ return (float)x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\txoris r3,r3,32768\n 8:\tlis r0,17200\n c:\tlfd f1,0(0)\n\t\t\tc: R_PPC_EMB_SDA21\t@6\n 10:\tstw r3,12(r1)\n 14:\tstw r0,8(r1)\n 18:\tlfd f0,8(r1)\n 1c:\tfsubs f1,f0,f1\n 20:\taddi r1,r1,16\n 24:\tblr\n","ctx":"float i2f(int);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .sdata2\t00000000 .sdata2\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 l O .sdata2\t00000008 @6\n00000000 g F .text\t00000028 i2f\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_EMB_SDA21 @6\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 i2f\n\n\nContents of section .text:\n 0000 9421fff0 6c638000 3c004330 c8200000 .!..lc..<.C0. ..\n 0010 9061000c 90010008 c8010008 ec200828 .a........... .(\n 0020 38210010 4e800020 8!..N.. \nContents of section .sdata2:\n 0000 43300000 80000000 C0...... \nContents of section .mwcats.text:\n 0000 02000028 00000000 ...(.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000008 00000000 00000004 ................\n 0050 00000000 00000008 00000000 00000004 ................\n 0060 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'i2f' — lift: cannot lift 'i2f @0xc': unmodelled effect instruction 'lfd' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tstwu r1,-16(r1) */\n/* 4:\txoris r3,r3,32768 */\n/* 8:\tlis r0,17200 */\n/* c:\tlfd f1,0(0) */\n/* \t\t\tc: R_PPC_EMB_SDA21\t@6 */\n/* 10:\tstw r3,12(r1) */\n/* 14:\tstw r0,8(r1) */\n/* 18:\tlfd f0,8(r1) */\n/* 1c:\tfsubs f1,f0,f1 */\n/* 20:\taddi r1,r1,16 */\n/* 24:\tblr */\nvoid i2f(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'i2f @0xc': unmodelled effect instruction 'lfd' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":19,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'i2f @0xc': unmodelled effect instruction 'lfd' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 i2f(s32 arg0) {\n return (f32) arg0;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2f` — benchmark function synthetic:i2f:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel i2f\n stwu r1,-16(r1)\n xoris r3,r3,32768\n lis r0,17200\n lfd f1,data_6@sda21(r2)\n stw r3,12(r1)\n stw r0,8(r1)\n lfd f0,8(r1)\n fsubs f1,f0,f1\n addi r1,r1,16\n blr\n.rodata\nglabel data_6\n.word 0x43300000\n.word 0x80000000\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat i2f(int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2f # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2f` — benchmark function synthetic:i2f:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2f:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\txoris r3,r3,32768\n 8:\tlis r0,17200\n c:\tlfd f1,0(0)\n\t\t\tc: R_PPC_EMB_SDA21\t@6\n 10:\tstw r3,12(r1)\n 14:\tstw r0,8(r1)\n 18:\tlfd f0,8(r1)\n 1c:\tfsubs f1,f0,f1\n 20:\taddi r1,r1,16\n 24:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .sdata2\t00000000 .sdata2\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 l O .sdata2\t00000008 @6\n00000000 g F .text\t00000028 i2f\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_EMB_SDA21 @6\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 i2f\n\n\nContents of section .text:\n 0000 9421fff0 6c638000 3c004330 c8200000 .!..lc..<.C0. ..\n 0010 9061000c 90010008 c8010008 ec200828 .a........... .(\n 0020 38210010 4e800020 8!..N.. \nContents of section .sdata2:\n 0000 43300000 80000000 C0...... \nContents of section .mwcats.text:\n 0000 02000028 00000000 ...(.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000008 00000000 00000004 ................\n 0050 00000000 00000008 00000000 00000004 ................\n 0060 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2f # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2ll:agbcc","sym":"i2ll","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["s64","cast","sign-extend"],"loc":1,"refSource":"long long i2ll(int x){ return x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ti2ll\n\t.type\t i2ll,function\n\t.thumb_func\ni2ll:\n\tasr\tr1, r0, #0x1f\n\tbx\tlr\n.Lfe1:\n\t.size\t i2ll,.Lfe1-i2ll\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"u32 i2ll(u32 a0) {\n return a0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void i2ll(s32 arg0) {\n\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":2,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":2,"ratio":0.5,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2ll` — benchmark function synthetic:i2ll:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ti2ll\n\t.type\t i2ll,function\n\t.thumb_func\ni2ll:\n\tasr\tr1, r0, #0x1f\n\tbx\tlr\n.Lfe1:\n\t.size\t i2ll,.Lfe1-i2ll\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2ll # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2ll` — benchmark function synthetic:i2ll:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2ll:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ti2ll\n\t.type\t i2ll,function\n\t.thumb_func\ni2ll:\n\tasr\tr1, r0, #0x1f\n\tbx\tlr\n.Lfe1:\n\t.size\t i2ll,.Lfe1-i2ll\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2ll # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2ll:gcc2.7.2kmc","sym":"i2ll","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["s64","cast","sign-extend"],"loc":1,"refSource":"long long i2ll(int x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,a0\n 4:\tmove\tv1,v0\n 8:\tjr\tra\n c:\tsra\tv0,v0,0x1f\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-98282641ffdcb40b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 i2ll\n\n\nContents of section .text:\n 0000 00801021 00401821 03e00008 000217c3 ...!.@.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 i2ll(u32 a0) {\n return a0 >> 31;\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 i2ll(s32 arg0) {\n return arg0 >> 0x1F;\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":3,"maxScore":4,"ratio":0.75,"kinds":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2ll` — benchmark function synthetic:i2ll:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel i2ll\n move\t$v0, $a0\n move\t$v1, $v0\n jr\t$ra\n sra\t$v0, $v0, 0x1f\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2ll # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2ll` — benchmark function synthetic:i2ll:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2ll:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,a0\n 4:\tmove\tv1,v0\n 8:\tjr\tra\n c:\tsra\tv0,v0,0x1f\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-98282641ffdcb40b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 i2ll\n\n\nContents of section .text:\n 0000 00801021 00401821 03e00008 000217c3 ...!.@.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2ll # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2ll:ido7.1","sym":"i2ll","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["s64","cast","sign-extend"],"loc":1,"refSource":"long long i2ll(int x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tjr\tra\n 8:\tsra\tv0,a0,0x1f\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c i2ll\n\n\nContents of section .text:\n 0000 00801825 03e00008 000417c3 00000000 ...%............\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 38323832 36343166 66646362 ef-98282641ffdcb\n 0130 3430622f 7265662e 63006932 6c6c0000 40b/ref.c.i2ll..\n 0140 69326c6c 00000000 00000000 00000001 i2ll............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000003 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 i2ll(s32 a0) {\n return a0 >> 31;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 i2ll(s32 arg0) {\n return arg0 >> 0x1F;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":3,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2ll` — benchmark function synthetic:i2ll:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel i2ll\n move\t$v1, $a0\n jr\t$ra\n sra\t$v0, $a0, 0x1f\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2ll # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2ll` — benchmark function synthetic:i2ll:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2ll:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tjr\tra\n 8:\tsra\tv0,a0,0x1f\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c i2ll\n\n\nContents of section .text:\n 0000 00801825 03e00008 000417c3 00000000 ...%............\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 38323832 36343166 66646362 ef-98282641ffdcb\n 0130 3430622f 7265662e 63006932 6c6c0000 40b/ref.c.i2ll..\n 0140 69326c6c 00000000 00000000 00000001 i2ll............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000003 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2ll # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2ll:mwcc_242_81","sym":"i2ll","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["s64","cast","sign-extend"],"loc":1,"refSource":"long long i2ll(int x){ return x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmr r4,r3\n 4:\tsrawi r3,r3,31\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c i2ll\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 i2ll\n\n\nContents of section .text:\n 0000 7c641b78 7c63fe70 4e800020 |d.x|c.pN.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 i2ll(s32 a0) {\n return a0 >> 31;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 i2ll(s32 arg0) {\n return arg0 >> 0x1F;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":3,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2ll` — benchmark function synthetic:i2ll:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel i2ll\n mr r4,r3\n srawi r3,r3,31\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2ll # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2ll` — benchmark function synthetic:i2ll:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2ll:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmr r4,r3\n 4:\tsrawi r3,r3,31\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c i2ll\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 i2ll\n\n\nContents of section .text:\n 0000 7c641b78 7c63fe70 4e800020 |d.x|c.pN.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2ll # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:inrange:agbcc","sym":"inrange","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","logical-and","range"],"loc":1,"refSource":"int inrange(int x,int lo,int hi){ return x>=lo && x<=hi; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tinrange\n\t.type\t inrange,function\n\t.thumb_func\ninrange:\n\tmov\tr3, #0x0\n\tcmp\tr0, r1\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, r2\n\tbgt\t.L3\t@cond_branch\n\tmov\tr3, #0x1\n.L3:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t inrange,.Lfe1-inrange\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 inrange(s32 a0, s32 a1, s32 a2) {\n return a0 >= a1 && a0 <= a2;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 inrange(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r3;\n\n var_r3 = 0;\n if ((arg0 >= arg1) && (arg0 <= arg2)) {\n var_r3 = 1;\n }\n return var_r3;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `inrange` — benchmark function synthetic:inrange:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tinrange\n\t.type\t inrange,function\n\t.thumb_func\ninrange:\n\tmov\tr3, #0x0\n\tcmp\tr0, r1\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, r2\n\tbgt\t.L3\t@cond_branch\n\tmov\tr3, #0x1\n.L3:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t inrange,.Lfe1-inrange\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function inrange # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `inrange` — benchmark function synthetic:inrange:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:inrange:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tinrange\n\t.type\t inrange,function\n\t.thumb_func\ninrange:\n\tmov\tr3, #0x0\n\tcmp\tr0, r1\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, r2\n\tbgt\t.L3\t@cond_branch\n\tmov\tr3, #0x1\n.L3:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t inrange,.Lfe1-inrange\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name inrange # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:inrange:gcc2.7.2kmc","sym":"inrange","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","logical-and","range"],"loc":1,"refSource":"int inrange(int x,int lo,int hi){ return x>=lo && x<=hi; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\ta1,a0,a1\n 4:\txori\ta1,a1,0x1\n 8:\tslt\tv0,a2,a0\n c:\txori\tv0,v0,0x1\n 10:\tjr\tra\n 14:\tand\tv0,a1,v0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b557fcde007fe97c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 inrange\n\n\nContents of section .text:\n 0000 0085282a 38a50001 00c4102a 38420001 ..(*8......*8B..\n 0010 03e00008 00a21024 00000000 00000000 .......$........\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 inrange(s32 a0, s32 a1, s32 a2) {\n return (a0 < a1 ^ 1) & (a2 < a0 ^ 1);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 inrange(s32 arg0, s32 arg1, s32 arg2) {\n return (arg0 >= arg1) & (arg2 >= arg0);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `inrange` — benchmark function synthetic:inrange:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel inrange\n slt\t$a1, $a0, $a1\n xori\t$a1, $a1, 0x1\n slt\t$v0, $a2, $a0\n xori\t$v0, $v0, 0x1\n jr\t$ra\n and\t$v0, $a1, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function inrange # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `inrange` — benchmark function synthetic:inrange:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:inrange:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\ta1,a0,a1\n 4:\txori\ta1,a1,0x1\n 8:\tslt\tv0,a2,a0\n c:\txori\tv0,v0,0x1\n 10:\tjr\tra\n 14:\tand\tv0,a1,v0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b557fcde007fe97c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 inrange\n\n\nContents of section .text:\n 0000 0085282a 38a50001 00c4102a 38420001 ..(*8......*8B..\n 0010 03e00008 00a21024 00000000 00000000 .......$........\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name inrange # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:inrange:ido7.1","sym":"inrange","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","logical-and","range"],"loc":1,"refSource":"int inrange(int x,int lo,int hi){ return x>=lo && x<=hi; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\txori\tv0,v0,0x1\n 8:\tbeqz\tv0,18 \n c:\tnop\n 10:\tslt\tv0,a2,a0\n 14:\txori\tv0,v0,0x1\n 18:\tjr\tra\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 inrange\n\n\nContents of section .text:\n 0000 0085102a 38420001 10400003 00000000 ...*8B...@......\n 0010 00c4102a 38420001 03e00008 00000000 ...*8B..........\nContents of section .options:\n 0000 01200000 00000000 80000074 00000000 . .........t....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 07000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000020 20200001 00000001 ....... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 35353766 63646530 30376665 ef-b557fcde007fe\n 0130 3937632f 7265662e 6300696e 72616e67 97c/ref.c.inrang\n 0140 65000000 696e7261 6e676500 00000000 e...inrange.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000008 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 inrange(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n if (a0 >= a1) {\n v0 = a0 < a1 ^ 1;\n } else {\n v0 = a2 < a0 ^ 1;\n }\n return v0;\n}\n","score":9,"maxScore":10,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":3,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 inrange(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_v0;\n\n var_v0 = arg0 >= arg1;\n if (var_v0 != 0) {\n var_v0 = arg2 >= arg0;\n }\n return var_v0;\n}\n","score":5,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":5,"maxScore":8,"ratio":0.625,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `inrange` — benchmark function synthetic:inrange:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel inrange\n slt\t$v0, $a0, $a1\n xori\t$v0, $v0, 0x1\n beqz\t$v0, .L18\n nop\n slt\t$v0, $a2, $a0\n xori\t$v0, $v0, 0x1\n.L18:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function inrange # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `inrange` — benchmark function synthetic:inrange:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:inrange:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\txori\tv0,v0,0x1\n 8:\tbeqz\tv0,18 \n c:\tnop\n 10:\tslt\tv0,a2,a0\n 14:\txori\tv0,v0,0x1\n 18:\tjr\tra\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 inrange\n\n\nContents of section .text:\n 0000 0085102a 38420001 10400003 00000000 ...*8B...@......\n 0010 00c4102a 38420001 03e00008 00000000 ...*8B..........\nContents of section .options:\n 0000 01200000 00000000 80000074 00000000 . .........t....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 07000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000020 20200001 00000001 ....... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 35353766 63646530 30376665 ef-b557fcde007fe\n 0130 3937632f 7265662e 6300696e 72616e67 97c/ref.c.inrang\n 0140 65000000 696e7261 6e676500 00000000 e...inrange.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000008 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name inrange # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:inrange:mwcc_242_81","sym":"inrange","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","logical-and","range"],"loc":1,"refSource":"int inrange(int x,int lo,int hi){ return x>=lo && x<=hi; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tli r0,0\n 8:\tblt 18 \n c:\tcmpw r3,r5\n 10:\tbgt 18 \n 14:\tli r0,1\n 18:\tmr r3,r0\n 1c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 inrange\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 inrange\n\n\nContents of section .text:\n 0000 7c032000 38000000 41800010 7c032800 |. .8...A...|.(.\n 0010 41810008 38000001 7c030378 4e800020 A...8...|..xN.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 inrange(s32 a0, s32 a1, s32 a2) {\n return a0 >= a1 && a0 <= a2;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 inrange(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r0;\n\n var_r0 = 0;\n if ((arg0 >= arg1) && (arg0 <= arg2)) {\n var_r0 = 1;\n }\n return var_r0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `inrange` — benchmark function synthetic:inrange:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel inrange\n cmpw r3,r4\n li r0,0\n blt .L18\n cmpw r3,r5\n bgt .L18\n li r0,1\n.L18:\n mr r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function inrange # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `inrange` — benchmark function synthetic:inrange:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:inrange:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tli r0,0\n 8:\tblt 18 \n c:\tcmpw r3,r5\n 10:\tbgt 18 \n 14:\tli r0,1\n 18:\tmr r3,r0\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 inrange\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 inrange\n\n\nContents of section .text:\n 0000 7c032000 38000000 41800010 7c032800 |. .8...A...|.(.\n 0010 41810008 38000001 7c030378 4e800020 A...8...|..xN.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name inrange # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:iszero:agbcc","sym":"iszero","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","bool"],"loc":1,"refSource":"int iszero(int x){ return x==0; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tiszero\n\t.type\t iszero,function\n\t.thumb_func\niszero:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t iszero,.Lfe1-iszero\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 iszero(u32 a0) {\n s32 v0;\n if (a0 != 0) {\n v0 = 0;\n } else {\n v0 = 1;\n }\n return v0;\n}\n","score":3,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 iszero(s32 arg0) {\n s32 var_r1;\n\n var_r1 = 0;\n if (arg0 == 0) {\n var_r1 = 1;\n }\n return var_r1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `iszero` — benchmark function synthetic:iszero:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tiszero\n\t.type\t iszero,function\n\t.thumb_func\niszero:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t iszero,.Lfe1-iszero\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function iszero # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `iszero` — benchmark function synthetic:iszero:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:iszero:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tiszero\n\t.type\t iszero,function\n\t.thumb_func\niszero:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t iszero,.Lfe1-iszero\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name iszero # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:iszero:gcc2.7.2kmc","sym":"iszero","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","bool"],"loc":1,"refSource":"int iszero(int x){ return x==0; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-46546decb6675beb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 iszero\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 iszero(u32 a0) {\n return a0 < 1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 iszero(s32 arg0) {\n return arg0 == 0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `iszero` — benchmark function synthetic:iszero:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel iszero\n jr\t$ra\n sltiu\t$v0, $a0, 1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function iszero # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `iszero` — benchmark function synthetic:iszero:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:iszero:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-46546decb6675beb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 iszero\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name iszero # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:iszero:ido7.1","sym":"iszero","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","bool"],"loc":1,"refSource":"int iszero(int x){ return x==0; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 iszero\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 36353436 64656362 36363735 ef-46546decb6675\n 0130 6265622f 7265662e 63006973 7a65726f beb/ref.c.iszero\n 0140 00000000 69737a65 726f0000 00000000 ....iszero......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 iszero(u32 a0) {\n return a0 < 1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 iszero(s32 arg0) {\n return arg0 == 0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `iszero` — benchmark function synthetic:iszero:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel iszero\n jr\t$ra\n sltiu\t$v0, $a0, 1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function iszero # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `iszero` — benchmark function synthetic:iszero:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:iszero:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 iszero\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 36353436 64656362 36363735 ef-46546decb6675\n 0130 6265622f 7265662e 63006973 7a65726f beb/ref.c.iszero\n 0140 00000000 69737a65 726f0000 00000000 ....iszero......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name iszero # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:iszero:mwcc_242_81","sym":"iszero","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","bool"],"loc":1,"refSource":"int iszero(int x){ return x==0; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcntlzw r0,r3\n 4:\tsrwi r3,r0,5\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c iszero\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 iszero\n\n\nContents of section .text:\n 0000 7c600034 5403d97e 4e800020 |`.4T..~N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 iszero(u32 a0) {\n return a0 == 0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 iszero(s32 arg0) {\n return arg0 == 0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `iszero` — benchmark function synthetic:iszero:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel iszero\n cntlzw r0,r3\n srwi r3,r0,5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function iszero # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `iszero` — benchmark function synthetic:iszero:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:iszero:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcntlzw r0,r3\n 4:\tsrwi r3,r0,5\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c iszero\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 iszero\n\n\nContents of section .text:\n 0000 7c600034 5403d97e 4e800020 |`.4T..~N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name iszero # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:land:agbcc","sym":"land","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","logical-and"],"loc":1,"refSource":"int land(int a,int b){ return a && b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tland\n\t.type\t land,function\n\t.thumb_func\nland:\n\tmov\tr2, #0x0\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tlsr\tr2, r0, #0x1f\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t land,.Lfe1-land\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 land(u32 a0, u32 a1) {\n return a0 != 0 && a1 != 0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 land(s32 arg0, s32 arg1) {\n u32 var_r2;\n\n var_r2 = 0;\n if (arg0 != 0) {\n var_r2 = (u32) ((0 - arg1) | arg1) >> 0x1F;\n }\n return var_r2;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `land` — benchmark function synthetic:land:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tland\n\t.type\t land,function\n\t.thumb_func\nland:\n\tmov\tr2, #0x0\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tlsr\tr2, r0, #0x1f\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t land,.Lfe1-land\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function land # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `land` — benchmark function synthetic:land:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:land:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tland\n\t.type\t land,function\n\t.thumb_func\nland:\n\tmov\tr2, #0x0\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tlsr\tr2, r0, #0x1f\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t land,.Lfe1-land\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name land # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:land:gcc2.7.2kmc","sym":"land","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","logical-and"],"loc":1,"refSource":"int land(int a,int b){ return a && b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\ta0,zero,a0\n 4:\tsltu\tv0,zero,a1\n 8:\tjr\tra\n c:\tand\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2322f6506302af62/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 land\n\n\nContents of section .text:\n 0000 0004202b 0005102b 03e00008 00821024 .. +...+.......$\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 land(u32 a0, u32 a1) {\n return 0 < a0 & 0 < a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 land(s32 arg0, s32 arg1) {\n return (arg0 != 0) & (arg1 != 0);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `land` — benchmark function synthetic:land:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel land\n sltu\t$a0, $zero, $a0\n sltu\t$v0, $zero, $a1\n jr\t$ra\n and\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function land # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `land` — benchmark function synthetic:land:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:land:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\ta0,zero,a0\n 4:\tsltu\tv0,zero,a1\n 8:\tjr\tra\n c:\tand\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2322f6506302af62/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 land\n\n\nContents of section .text:\n 0000 0004202b 0005102b 03e00008 00821024 .. +...+.......$\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name land # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:land:ido7.1","sym":"land","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","logical-and"],"loc":1,"refSource":"int land(int a,int b){ return a && b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tv0,zero,a0\n 4:\tbeqz\tv0,10 \n 8:\tnop\n c:\tsltu\tv0,zero,a1\n 10:\tjr\tra\n 14:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 land\n\n\nContents of section .text:\n 0000 0004102b 10400002 00000000 0005102b ...+.@.........+\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 33323266 36353036 33303261 ef-2322f6506302a\n 0130 6636322f 7265662e 63006c61 6e640000 f62/ref.c.land..\n 0140 6c616e64 00000000 00000000 00000001 land............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 land(s32 a0, s32 a1) {\n s32 v0;\n if (0 >= a0) {\n v0 = 0 < a0;\n } else {\n v0 = 0 < a1;\n }\n return v0;\n}\n","score":5,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":5,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 land(s32 arg0, s32 arg1) {\n s32 var_v0;\n\n var_v0 = arg0 != 0;\n if (var_v0 != 0) {\n var_v0 = arg1 != 0;\n }\n return var_v0;\n}\n","score":4,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":6,"ratio":0.6666666666666666,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `land` — benchmark function synthetic:land:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel land\n sltu\t$v0, $zero, $a0\n beqz\t$v0, .L10\n nop\n sltu\t$v0, $zero, $a1\n.L10:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function land # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `land` — benchmark function synthetic:land:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:land:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tv0,zero,a0\n 4:\tbeqz\tv0,10 \n 8:\tnop\n c:\tsltu\tv0,zero,a1\n 10:\tjr\tra\n 14:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 land\n\n\nContents of section .text:\n 0000 0004102b 10400002 00000000 0005102b ...+.@.........+\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 33323266 36353036 33303261 ef-2322f6506302a\n 0130 6636322f 7265662e 63006c61 6e640000 f62/ref.c.land..\n 0140 6c616e64 00000000 00000000 00000001 land............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name land # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:land:mwcc_242_81","sym":"land","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","logical-and"],"loc":1,"refSource":"int land(int a,int b){ return a && b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r3,0\n 8:\tbeqlr\n c:\tcmpwi r4,0\n 10:\tbeqlr\n 14:\tli r3,1\n 18:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c land\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 land\n\n\nContents of section .text:\n 0000 2c030000 38600000 4d820020 2c040000 ,...8`..M.. ,...\n 0010 4d820020 38600001 4e800020 M.. 8`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed/flip-branch","outcome":"nonmatch","source":"s32 land(s32 a0, s32 a1) {\n if (a0 == 0) {\n return 0;\n } else {\n if (a1 == 0) {\n return 0;\n } else {\n return 1;\n }\n }\n}\n","score":5,"maxScore":8,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":3,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 land(s32 arg0, s32 arg1) {\n if ((arg0 != 0) && (arg1 != 0)) {\n return 1;\n }\n return 0;\n}\n","score":6,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":1,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":8,"ratio":0.625,"kinds":{"insert":1,"delete":0,"replace":3,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `land` — benchmark function synthetic:land:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel land\n cmpwi r3,0\n li r3,0\n beqlr\n cmpwi r4,0\n beqlr\n li r3,1\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function land # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `land` — benchmark function synthetic:land:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:land:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r3,0\n 8:\tbeqlr\n c:\tcmpwi r4,0\n 10:\tbeqlr\n 14:\tli r3,1\n 18:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c land\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 land\n\n\nContents of section .text:\n 0000 2c030000 38600000 4d820020 2c040000 ,...8`..M.. ,...\n 0010 4d820020 38600001 4e800020 M.. 8`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name land # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ll2i:agbcc","sym":"ll2i","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["s64","cast","narrow"],"loc":1,"refSource":"int ll2i(long long x){ return (int)x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tll2i\n\t.type\t ll2i,function\n\t.thumb_func\nll2i:\n\tbx\tlr\n.Lfe1:\n\t.size\t ll2i,.Lfe1-ll2i\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 ll2i(u32 a0) {\n return a0;\n}\n","score":0,"maxScore":1,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void ll2i(void) {\n\n}\n","score":0,"maxScore":1,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":2,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ll2i` — benchmark function synthetic:ll2i:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tll2i\n\t.type\t ll2i,function\n\t.thumb_func\nll2i:\n\tbx\tlr\n.Lfe1:\n\t.size\t ll2i,.Lfe1-ll2i\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ll2i # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ll2i` — benchmark function synthetic:ll2i:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ll2i:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tll2i\n\t.type\t ll2i,function\n\t.thumb_func\nll2i:\n\tbx\tlr\n.Lfe1:\n\t.size\t ll2i,.Lfe1-ll2i\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ll2i # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ll2i:gcc2.7.2kmc","sym":"ll2i","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["s64","cast","narrow"],"loc":1,"refSource":"int ll2i(long long x){ return (int)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tmove\tv0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1e47ea258fbd8acf/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 ll2i\n\n\nContents of section .text:\n 0000 03e00008 00a01021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 80000024 00000000 00000000 00000000 ...$............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"u32 ll2i(u32 a0) {\n return a0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 ll2i(s32 arg1) {\n return arg1;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":2,"ratio":0.5,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ll2i` — benchmark function synthetic:ll2i:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ll2i\n jr\t$ra\n move\t$v0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ll2i # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ll2i` — benchmark function synthetic:ll2i:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ll2i:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tmove\tv0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1e47ea258fbd8acf/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 ll2i\n\n\nContents of section .text:\n 0000 03e00008 00a01021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 80000024 00000000 00000000 00000000 ...$............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ll2i # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ll2i:ido7.1","sym":"ll2i","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["s64","cast","narrow"],"loc":1,"refSource":"int ll2i(long long x){ return (int)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tjr\tra\n c:\tmove\tv0,a1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ll2i\n\n\nContents of section .text:\n 0000 afa40000 afa50004 03e00008 00a01025 ...............%\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 65343765 61323538 66626438 ef-1e47ea258fbd8\n 0130 6163662f 7265662e 63006c6c 32690000 acf/ref.c.ll2i..\n 0140 6c6c3269 00000000 00000000 00000001 ll2i............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"u32 ll2i(u32 a0, u32 a1) {\n return a1;\n}\n","score":1,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 ll2i(s32 arg0, s32 arg1) {\n return arg1;\n}\n","score":1,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":4,"ratio":0.25,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ll2i` — benchmark function synthetic:ll2i:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ll2i\n sw\t$a0, 0($sp)\n sw\t$a1, 4($sp)\n jr\t$ra\n move\t$v0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ll2i # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ll2i` — benchmark function synthetic:ll2i:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ll2i:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tjr\tra\n c:\tmove\tv0,a1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ll2i\n\n\nContents of section .text:\n 0000 afa40000 afa50004 03e00008 00a01025 ...............%\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 65343765 61323538 66626438 ef-1e47ea258fbd8\n 0130 6163662f 7265662e 63006c6c 32690000 acf/ref.c.ll2i..\n 0140 6c6c3269 00000000 00000000 00000001 ll2i............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ll2i # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ll2i:mwcc_242_81","sym":"ll2i","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["s64","cast","narrow"],"loc":1,"refSource":"int ll2i(long long x){ return (int)x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmr r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 ll2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ll2i\n\n\nContents of section .text:\n 0000 7c832378 4e800020 |.#xN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"u32 ll2i(u32 a0) {\n return a0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 ll2i(s32 arg1) {\n return arg1;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":2,"ratio":0.5,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ll2i` — benchmark function synthetic:ll2i:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ll2i\n mr r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ll2i # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ll2i` — benchmark function synthetic:ll2i:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ll2i:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmr r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 ll2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ll2i\n\n\nContents of section .text:\n 0000 7c832378 4e800020 |.#xN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ll2i # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lladd:agbcc","sym":"lladd","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long lladd(long long a,long long b){ return a+b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tlladd\n\t.type\t lladd,function\n\t.thumb_func\nlladd:\n\tadd\tr0, r0, r2\n\tadc\tr1, r1, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t lladd,.Lfe1-lladd\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 lladd(u32 a0, u32 a1, u32 a2, u32 a3) {\n return a0 + a2;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 lladd(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {\n return arg0 + arg2;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":3,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lladd` — benchmark function synthetic:lladd:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tlladd\n\t.type\t lladd,function\n\t.thumb_func\nlladd:\n\tadd\tr0, r0, r2\n\tadc\tr1, r1, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t lladd,.Lfe1-lladd\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lladd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lladd` — benchmark function synthetic:lladd:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lladd:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tlladd\n\t.type\t lladd,function\n\t.thumb_func\nlladd:\n\tadd\tr0, r0, r2\n\tadc\tr1, r1, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t lladd,.Lfe1-lladd\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name lladd # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lladd:gcc2.7.2kmc","sym":"lladd","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long lladd(long long a,long long b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv1,a1,a3\n 4:\tsltu\tt0,v1,a3\n 8:\taddu\tv0,a0,a2\n c:\tjr\tra\n 10:\taddu\tv0,v0,t0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-e73bcbddbb9e8885/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 lladd\n\n\nContents of section .text:\n 0000 00a71821 0067402b 00861021 03e00008 ...!.g@+...!....\n 0010 00481021 00000000 00000000 00000000 .H.!............\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 lladd(u32 a0, u32 a1, u32 a2, u32 a3) {\n return a0 + a2 + (a1 + a3 < a3);\n}\n","score":5,"maxScore":6,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 lladd(s32 arg0, s32 arg1, s32 arg2, u32 arg3) {\n return arg0 + arg2 + ((u32) (arg1 + arg3) < arg3);\n}\n","score":5,"maxScore":6,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":6,"ratio":0.8333333333333334,"kinds":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lladd` — benchmark function synthetic:lladd:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lladd\n addu\t$v1, $a1, $a3\n sltu\t$t0, $v1, $a3\n addu\t$v0, $a0, $a2\n jr\t$ra\n addu\t$v0, $v0, $t0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lladd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lladd` — benchmark function synthetic:lladd:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lladd:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv1,a1,a3\n 4:\tsltu\tt0,v1,a3\n 8:\taddu\tv0,a0,a2\n c:\tjr\tra\n 10:\taddu\tv0,v0,t0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-e73bcbddbb9e8885/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 lladd\n\n\nContents of section .text:\n 0000 00a71821 0067402b 00861021 03e00008 ...!.g@+...!....\n 0010 00481021 00000000 00000000 00000000 .H.!............\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name lladd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lladd:ido7.1","sym":"lladd","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long lladd(long long a,long long b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv1,a1,a3\n 4:\tsltu\tat,v1,a3\n 8:\taddu\tv0,at,a0\n c:\taddu\tv0,v0,a2\n 10:\tsw\ta0,0(sp)\n 14:\tsw\ta1,4(sp)\n 18:\tsw\ta2,8(sp)\n 1c:\tjr\tra\n 20:\tsw\ta3,12(sp)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 lladd\n\n\nContents of section .text:\n 0000 00a71821 0067082b 00241021 00461021 ...!.g.+.$.!.F.!\n 0010 afa40000 afa50004 afa60008 03e00008 ................\n 0020 afa7000c 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000024 20200001 00000001 .......$ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 37336263 62646462 62396538 ef-e73bcbddbb9e8\n 0130 3838352f 7265662e 63006c6c 61646400 885/ref.c.lladd.\n 0140 6c6c6164 64000000 00000000 00000001 lladd...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000009 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 lladd(u32 a0, u32 a1, u32 a2, u32 a3) {\n return (a1 + a3 < a3) + a0 + a2;\n}\n","score":8,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 lladd(s32 arg0, s32 arg1, s32 arg2, u32 arg3) {\n return ((u32) (arg1 + arg3) < arg3) + arg0 + arg2;\n}\n","score":8,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":8,"maxScore":9,"ratio":0.8888888888888888,"kinds":{"insert":0,"delete":4,"replace":1,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lladd` — benchmark function synthetic:lladd:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lladd\n addu\t$v1, $a1, $a3\n sltu\t$at, $v1, $a3\n addu\t$v0, $at, $a0\n addu\t$v0, $v0, $a2\n sw\t$a0, 0($sp)\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n jr\t$ra\n sw\t$a3, 12($sp)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lladd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lladd` — benchmark function synthetic:lladd:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lladd:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv1,a1,a3\n 4:\tsltu\tat,v1,a3\n 8:\taddu\tv0,at,a0\n c:\taddu\tv0,v0,a2\n 10:\tsw\ta0,0(sp)\n 14:\tsw\ta1,4(sp)\n 18:\tsw\ta2,8(sp)\n 1c:\tjr\tra\n 20:\tsw\ta3,12(sp)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 lladd\n\n\nContents of section .text:\n 0000 00a71821 0067082b 00241021 00461021 ...!.g.+.$.!.F.!\n 0010 afa40000 afa50004 afa60008 03e00008 ................\n 0020 afa7000c 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000024 20200001 00000001 .......$ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 37336263 62646462 62396538 ef-e73bcbddbb9e8\n 0130 3838352f 7265662e 63006c6c 61646400 885/ref.c.lladd.\n 0140 6c6c6164 64000000 00000000 00000001 lladd...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000009 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lladd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lladd:mwcc_242_81","sym":"lladd","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long lladd(long long a,long long b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddc r4,r4,r6\n 4:\tadde r3,r3,r5\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c lladd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 lladd\n\n\nContents of section .text:\n 0000 7c843014 7c632914 4e800020 |.0.|c).N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"s32 lladd(s32 a0, s32 a1, s32 a2, s32 a3) {\n return ASMLIFT_ERROR(\"unmodelled instruction 'adde'\", a0, a2);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":3,"gotos":0,"casts":0,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: unmodelled instruction 'adde'"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 lladd(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {\n return arg0 + arg2 + M2C_CARRY;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_CARRY"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lladd` — benchmark function synthetic:lladd:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lladd\n addc r4,r4,r6\n adde r3,r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lladd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lladd` — benchmark function synthetic:lladd:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lladd:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddc r4,r4,r6\n 4:\tadde r3,r3,r5\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c lladd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 lladd\n\n\nContents of section .text:\n 0000 7c843014 7c632914 4e800020 |.0.|c).N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lladd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llcmp:agbcc","sym":"llcmp","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["s64","compare"],"loc":1,"refSource":"int llcmp(long long a,long long b){ return a a1) {\n return 1;\n } else {\n if (a3 != a1) {\n v0 = 0;\n return v0;\n } else {\n if (a2 <= a0) {\n v0 = 0;\n return v0;\n } else {\n return 1;\n }\n }\n }\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":1,"delete":4,"replace":0,"opMismatch":1,"argMismatch":3},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 llcmp(u32 arg0, s32 arg1, u32 arg2, s32 arg3) {\n s32 var_r4;\n\n var_r4 = 0;\n if ((arg3 > arg1) || ((arg3 == arg1) && (arg2 > arg0))) {\n var_r4 = 1;\n }\n return var_r4;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llcmp` — benchmark function synthetic:llcmp:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllcmp\n\t.type\t llcmp,function\n\t.thumb_func\nllcmp:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tcmp\tr3, r1\n\tbgt\t.L4\t@cond_branch\n\tcmp\tr3, r1\n\tbne\t.L3\t@cond_branch\n\tcmp\tr2, r0\n\tbls\t.L3\t@cond_branch\n.L4:\n\tmov\tr4, #0x1\n.L3:\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t llcmp,.Lfe1-llcmp\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llcmp` — benchmark function synthetic:llcmp:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llcmp:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllcmp\n\t.type\t llcmp,function\n\t.thumb_func\nllcmp:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tcmp\tr3, r1\n\tbgt\t.L4\t@cond_branch\n\tcmp\tr3, r1\n\tbne\t.L3\t@cond_branch\n\tcmp\tr2, r0\n\tbls\t.L3\t@cond_branch\n.L4:\n\tmov\tr4, #0x1\n.L3:\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t llcmp,.Lfe1-llcmp\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llcmp # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llcmp:gcc2.7.2kmc","sym":"llcmp","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["s64","compare"],"loc":1,"refSource":"int llcmp(long long a,long long b){ return a:\n 0:\tslt\tv0,a0,a2\n 4:\tbnez\tv0,20 \n 8:\tmove\tv1,zero\n c:\tbne\ta2,a0,24 \n 10:\tnop\n 14:\tsltu\tv0,a1,a3\n 18:\tbeqz\tv0,24 \n 1c:\tnop\n 20:\tli\tv1,1\n 24:\tjr\tra\n 28:\tmove\tv0,v1\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-87d3352b1f51be25/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c llcmp\n\n\nContents of section .text:\n 0000 0086102a 14400006 00001821 14c40005 ...*.@.....!....\n 0010 00000000 00a7102b 10400002 00000000 .......+.@......\n 0020 24030001 03e00008 00601021 00000000 $........`.!....\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 llcmp(s32 a0, s32 a1, s32 a2, s32 a3) {\n s32 v1;\n if (a0 >= a2) {\n if (a2 == a0) {\n if (a1 < a3) {\n return 1;\n } else {\n v1 = 0;\n return v1;\n }\n } else {\n v1 = 0;\n return v1;\n }\n } else {\n return 1;\n }\n}\n","score":12,"maxScore":14,"compileErrors":null,"breakdown":{"insert":3,"delete":6,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 llcmp(s32 arg0, u32 arg1, s32 arg2, u32 arg3) {\n s32 var_v1;\n\n var_v1 = 0;\n if ((arg0 < arg2) || ((arg2 == arg0) && (arg1 < arg3))) {\n var_v1 = 1;\n }\n return var_v1;\n}\n","score":7,"maxScore":12,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":2,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":7,"maxScore":12,"ratio":0.5833333333333334,"kinds":{"insert":1,"delete":0,"replace":2,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llcmp` — benchmark function synthetic:llcmp:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llcmp\n slt\t$v0, $a0, $a2\n bnez\t$v0, .L20\n move\t$v1, $zero\n bne\t$a2, $a0, .L24\n nop\n sltu\t$v0, $a1, $a3\n beqz\t$v0, .L24\n nop\n.L20:\n li\t$v1, 1\n.L24:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llcmp` — benchmark function synthetic:llcmp:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llcmp:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a2\n 4:\tbnez\tv0,20 \n 8:\tmove\tv1,zero\n c:\tbne\ta2,a0,24 \n 10:\tnop\n 14:\tsltu\tv0,a1,a3\n 18:\tbeqz\tv0,24 \n 1c:\tnop\n 20:\tli\tv1,1\n 24:\tjr\tra\n 28:\tmove\tv0,v1\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-87d3352b1f51be25/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c llcmp\n\n\nContents of section .text:\n 0000 0086102a 14400006 00001821 14c40005 ...*.@.....!....\n 0010 00000000 00a7102b 10400002 00000000 .......+.@......\n 0020 24030001 03e00008 00601021 00000000 $........`.!....\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llcmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llcmp:ido7.1","sym":"llcmp","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["s64","compare"],"loc":1,"refSource":"int llcmp(long long a,long long b){ return a:\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tsw\ta2,8(sp)\n c:\tsw\ta3,12(sp)\n 10:\tbne\ta0,a2,1c \n 14:\tslt\tv0,a0,a2\n 18:\tsltu\tv0,a1,a3\n 1c:\tjr\tra\n 20:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 llcmp\n\n\nContents of section .text:\n 0000 afa40000 afa50004 afa60008 afa7000c ................\n 0010 14860002 0086102a 00a7102b 03e00008 .......*...+....\n 0020 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000f4 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f4 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000024 20200001 00000001 .......$ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 37643333 35326231 66353162 ef-87d3352b1f51b\n 0130 6532352f 7265662e 63006c6c 636d7000 e25/ref.c.llcmp.\n 0140 6c6c636d 70000000 00000000 00000001 llcmp...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000009 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 llcmp(u32 a0, u32 a1, u32 a2, u32 a3) {\n s32 v0;\n if (a0 != a2) {\n v0 = a0 < a2;\n } else {\n v0 = a1 < a3;\n }\n return v0;\n}\n","score":10,"maxScore":11,"compileErrors":null,"breakdown":{"insert":2,"delete":5,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 llcmp(s32 arg0, u32 arg1, s32 arg2, u32 arg3) {\n s32 var_v0;\n\n var_v0 = arg0 < arg2;\n if (arg0 == arg2) {\n var_v0 = arg1 < arg3;\n }\n return var_v0;\n}\n","score":7,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":7,"maxScore":9,"ratio":0.7777777777777778,"kinds":{"insert":0,"delete":4,"replace":1,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llcmp` — benchmark function synthetic:llcmp:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llcmp\n sw\t$a0, 0($sp)\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n sw\t$a3, 12($sp)\n bne\t$a0, $a2, .L1c\n slt\t$v0, $a0, $a2\n sltu\t$v0, $a1, $a3\n.L1c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llcmp` — benchmark function synthetic:llcmp:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llcmp:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tsw\ta2,8(sp)\n c:\tsw\ta3,12(sp)\n 10:\tbne\ta0,a2,1c \n 14:\tslt\tv0,a0,a2\n 18:\tsltu\tv0,a1,a3\n 1c:\tjr\tra\n 20:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 llcmp\n\n\nContents of section .text:\n 0000 afa40000 afa50004 afa60008 afa7000c ................\n 0010 14860002 0086102a 00a7102b 03e00008 .......*...+....\n 0020 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000f4 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f4 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000024 20200001 00000001 .......$ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 37643333 35326231 66353162 ef-87d3352b1f51b\n 0130 6532352f 7265662e 63006c6c 636d7000 e25/ref.c.llcmp.\n 0140 6c6c636d 70000000 00000000 00000001 llcmp...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000009 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llcmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llcmp:mwcc_242_81","sym":"llcmp","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["s64","compare"],"loc":1,"refSource":"int llcmp(long long a,long long b){ return a:\n 0:\txoris r7,r3,32768\n 4:\txoris r3,r5,32768\n 8:\tsubfc r0,r6,r4\n c:\tsubfe r3,r3,r7\n 10:\tsubfe r3,r7,r7\n 14:\tneg r3,r3\n 18:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c llcmp\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llcmp\n\n\nContents of section .text:\n 0000 6c678000 6ca38000 7c062010 7c633910 lg..l...|. .|c9.\n 0010 7c673910 7c6300d0 4e800020 |g9.|c..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"s32 llcmp(s32 a0, s32 a1, s32 a2, s32 a3) {\n return -ASMLIFT_ERROR(\"unmodelled instruction 'subfe'\", ASMLIFT_ERROR(\"unmodelled instruction 'xoris'\", a0), ASMLIFT_ERROR(\"unmodelled instruction 'xoris'\", a0));\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":3,"gotos":0,"casts":0,"unkGlue":3,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: unmodelled instruction 'subfe'","structure: unmodelled instruction 'xoris'","structure: unmodelled instruction 'xoris'"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 llcmp(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {\n s32 temp_r7;\n\n temp_r7 = arg0 ^ 0x80000000;\n return -((temp_r7 - temp_r7) - !M2C_CARRY);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_CARRY"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llcmp` — benchmark function synthetic:llcmp:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llcmp\n xoris r7,r3,32768\n xoris r3,r5,32768\n subfc r0,r6,r4\n subfe r3,r3,r7\n subfe r3,r7,r7\n neg r3,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llcmp` — benchmark function synthetic:llcmp:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llcmp:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\txoris r7,r3,32768\n 4:\txoris r3,r5,32768\n 8:\tsubfc r0,r6,r4\n c:\tsubfe r3,r3,r7\n 10:\tsubfe r3,r7,r7\n 14:\tneg r3,r3\n 18:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c llcmp\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llcmp\n\n\nContents of section .text:\n 0000 6c678000 6ca38000 7c062010 7c633910 lg..l...|. .|c9.\n 0010 7c673910 7c6300d0 4e800020 |g9.|c..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llcmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshl:agbcc","sym":"llshl","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["s64","shift"],"loc":1,"refSource":"long long llshl(long long a,int b){ return a< in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllshl\n\t.type\t llshl,function\n\t.thumb_func\nllshl:\n\tpush\t{lr}\n\tbl\t__ashldi3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t llshl,.Lfe1-llshl\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshl` — benchmark function synthetic:llshl:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshl:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllshl\n\t.type\t llshl,function\n\t.thumb_func\nllshl:\n\tpush\t{lr}\n\tbl\t__ashldi3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t llshl,.Lfe1-llshl\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshl # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshl:gcc2.7.2kmc","sym":"llshl","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["s64","shift"],"loc":1,"refSource":"long long llshl(long long a,int b){ return a<:\n 0:\tsll\ta3,a2,0x1a\n 4:\tbgez\ta3,18 \n 8:\tnop\n c:\tsllv\tv0,a1,a2\n 10:\tb\t30 \n 14:\tmove\tv1,zero\n 18:\tbeqz\ta3,2c \n 1c:\tsllv\tv0,a0,a2\n 20:\tnegu\ta3,a2\n 24:\tsrlv\ta3,a1,a3\n 28:\tor\tv0,v0,a3\n 2c:\tsllv\tv1,a1,a2\n 30:\tjr\tra\n 34:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4db236487d605d43/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 llshl\n\n\nContents of section .text:\n 0000 00063e80 04e10004 00000000 00c51004 ..>.............\n 0010 10000007 00001821 10e00004 00c41004 .......!........\n 0020 00063823 00e53806 00471025 00c51804 ..8#..8..G.%....\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 llshl(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n if (a2 << 26 < 0) {\n return a1 << a2;\n } else {\n if (a2 << 26 == 0) {\n v0 = a0 << a2;\n } else {\n v0 = a0 << a2 | a1 >> -a2;\n }\n return v0;\n }\n}\n","score":11,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":2,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 llshl(s32 arg0, u32 arg1, s32 arg2) {\n s32 var_v0;\n\n if (arg2 & 0x20) {\n return arg1 << arg2;\n }\n var_v0 = arg0 << arg2;\n if ((arg2 << 0x1A) != 0) {\n var_v0 |= arg1 >> -arg2;\n }\n return var_v0;\n}\n","score":15,"maxScore":17,"compileErrors":null,"breakdown":{"insert":3,"delete":5,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":11,"maxScore":14,"ratio":0.7857142857142857,"kinds":{"insert":0,"delete":4,"replace":2,"opMismatch":0,"argMismatch":5}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llshl` — benchmark function synthetic:llshl:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llshl\n sll\t$a3, $a2, 0x1a\n bgez\t$a3, .L18\n nop\n sllv\t$v0, $a1, $a2\n b\t.L30\n move\t$v1, $zero\n.L18:\n beqz\t$a3, .L2c\n sllv\t$v0, $a0, $a2\n negu\t$a3, $a2\n srlv\t$a3, $a1, $a3\n or\t$v0, $v0, $a3\n.L2c:\n sllv\t$v1, $a1, $a2\n.L30:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshl` — benchmark function synthetic:llshl:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshl:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta3,a2,0x1a\n 4:\tbgez\ta3,18 \n 8:\tnop\n c:\tsllv\tv0,a1,a2\n 10:\tb\t30 \n 14:\tmove\tv1,zero\n 18:\tbeqz\ta3,2c \n 1c:\tsllv\tv0,a0,a2\n 20:\tnegu\ta3,a2\n 24:\tsrlv\ta3,a1,a3\n 28:\tor\tv0,v0,a3\n 2c:\tsllv\tv1,a1,a2\n 30:\tjr\tra\n 34:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4db236487d605d43/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 llshl\n\n\nContents of section .text:\n 0000 00063e80 04e10004 00000000 00c51004 ..>.............\n 0010 10000007 00001821 10e00004 00c41004 .......!........\n 0020 00063823 00e53806 00471025 00c51804 ..8#..8..G.%....\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshl:ido7.1","sym":"llshl","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["s64","shift"],"loc":1,"refSource":"long long llshl(long long a,int b){ return a<:\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tsw\ta2,32(sp)\n c:\tmove\ta3,a2\n 10:\tsra\ta2,a2,0x1f\n 14:\tsw\ta0,24(sp)\n 18:\tjal\t0 \n 1c:\tsw\ta1,28(sp)\n 20:\tlw\tra,20(sp)\n 24:\taddiu\tsp,sp,24\n 28:\tjr\tra\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000030 llshl\n00000000 F *UND*\t00000000 __ll_lshift\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 __ll_lshift\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 afa60020 00c03825 '.......... ..8%\n 0010 000637c3 afa40018 0c000000 afa5001c ..7.............\n 0020 8fbf0014 27bd0018 03e00008 00000000 ....'...........\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000c 00000004 000001d0 p...............\n 0010 00000006 0000032c 00000001 000001d4 .......,........\n 0020 00000004 00000208 00000000 00000000 ................\n 0030 00000011 00000238 00000034 0000027c .......8...4...|\n 0040 00000014 000002b0 00000001 000002c4 ................\n 0050 00000000 00000000 00000002 0000030c ................\n 0060 08020000 00000000 00000001 00000000 ................\n 0070 80000000 fffffffc ffffffff 00000000 ................\n 0080 00000000 00000018 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000030 20200001 00000001 .......0 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 64623233 36343837 64363035 ef-4db236487d605\n 0130 6434332f 7265662e 63006c6c 73686c00 d43/ref.c.llshl.\n 0140 6c6c7368 6c005f5f 6c6c5f6c 73686966 llshl.__ll_lshif\n 0150 74000000 00000000 00000001 00000000 t...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 0000000c 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000002 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000006 00000000 18cfffff 00000000 ................\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 7fffffff 00000000 7fffffff ................\n 01e0 00000001 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'llshl' — lift: cannot lift 'llshl': function call 'jal' at 0x18 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,20(sp) */\n/* 8:\tsw\ta2,32(sp) */\n/* c:\tmove\ta3,a2 */\n/* 10:\tsra\ta2,a2,0x1f */\n/* 14:\tsw\ta0,24(sp) */\n/* 18:\tjal\t0 */\n/* 1c:\tsw\ta1,28(sp) */\n/* 20:\tlw\tra,20(sp) */\n/* 24:\taddiu\tsp,sp,24 */\n/* 28:\tjr\tra */\n/* 2c:\tnop */\nvoid llshl(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'llshl': function call 'jal' at 0x18 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'llshl': function call 'jal' at 0x18 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? __ll_lshift(s32, s32); /* extern */\n\nvoid llshl(s32 arg0, ? arg1, s32 arg2) {\n __ll_lshift(arg2 >> 0x1F, arg2);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llshl` — benchmark function synthetic:llshl:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llshl\n addiu\t$sp, $sp, -24\n sw\t$ra, 20($sp)\n sw\t$a2, 32($sp)\n move\t$a3, $a2\n sra\t$a2, $a2, 0x1f\n sw\t$a0, 24($sp)\n jal\t__ll_lshift\n sw\t$a1, 28($sp)\n lw\t$ra, 20($sp)\n addiu\t$sp, $sp, 24\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshl` — benchmark function synthetic:llshl:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshl:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tsw\ta2,32(sp)\n c:\tmove\ta3,a2\n 10:\tsra\ta2,a2,0x1f\n 14:\tsw\ta0,24(sp)\n 18:\tjal\t0 \n 1c:\tsw\ta1,28(sp)\n 20:\tlw\tra,20(sp)\n 24:\taddiu\tsp,sp,24\n 28:\tjr\tra\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000030 llshl\n00000000 F *UND*\t00000000 __ll_lshift\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 __ll_lshift\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 afa60020 00c03825 '.......... ..8%\n 0010 000637c3 afa40018 0c000000 afa5001c ..7.............\n 0020 8fbf0014 27bd0018 03e00008 00000000 ....'...........\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000c 00000004 000001d0 p...............\n 0010 00000006 0000032c 00000001 000001d4 .......,........\n 0020 00000004 00000208 00000000 00000000 ................\n 0030 00000011 00000238 00000034 0000027c .......8...4...|\n 0040 00000014 000002b0 00000001 000002c4 ................\n 0050 00000000 00000000 00000002 0000030c ................\n 0060 08020000 00000000 00000001 00000000 ................\n 0070 80000000 fffffffc ffffffff 00000000 ................\n 0080 00000000 00000018 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000030 20200001 00000001 .......0 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 64623233 36343837 64363035 ef-4db236487d605\n 0130 6434332f 7265662e 63006c6c 73686c00 d43/ref.c.llshl.\n 0140 6c6c7368 6c005f5f 6c6c5f6c 73686966 llshl.__ll_lshif\n 0150 74000000 00000000 00000001 00000000 t...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 0000000c 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000002 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000006 00000000 18cfffff 00000000 ................\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 7fffffff 00000000 7fffffff ................\n 01e0 00000001 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshl:mwcc_242_81","sym":"llshl","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["s64","shift"],"loc":1,"refSource":"long long llshl(long long a,int b){ return a<:\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\t__shl2i\n 10:\tlwz r0,20(r1)\n 14:\tmtlr r0\n 18:\taddi r1,r1,16\n 1c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 llshl\n00000000 *UND*\t00000000 __shl2i\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 __shl2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llshl\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 7c0803a6 38210010 4e800020 ....|...8!..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 00000000 00000000 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 llshl(void) {\n return __shl2i();\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? __shl2i(); /* extern */\n\nvoid llshl(void) {\n __shl2i();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llshl` — benchmark function synthetic:llshl:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llshl\n stwu r1,-16(r1)\n mflr r0\n stw r0,20(r1)\n bl __shl2i\n lwz r0,20(r1)\n mtlr r0\n addi r1,r1,16\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshl` — benchmark function synthetic:llshl:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshl:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\t__shl2i\n 10:\tlwz r0,20(r1)\n 14:\tmtlr r0\n 18:\taddi r1,r1,16\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 llshl\n00000000 *UND*\t00000000 __shl2i\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 __shl2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llshl\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 7c0803a6 38210010 4e800020 ....|...8!..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 00000000 00000000 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshr:agbcc","sym":"llshr","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["s64","shift","signed"],"loc":1,"refSource":"long long llshr(long long a,int b){ return a>>b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllshr\n\t.type\t llshr,function\n\t.thumb_func\nllshr:\n\tpush\t{lr}\n\tbl\t__ashrdi3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t llshr,.Lfe1-llshr\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 llshr(void) {\n return __ashrdi3();\n}\n","score":2,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? __ashrdi3(); /* extern */\n\nvoid llshr(void) {\n __ashrdi3();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":4,"ratio":0.5,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llshr` — benchmark function synthetic:llshr:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllshr\n\t.type\t llshr,function\n\t.thumb_func\nllshr:\n\tpush\t{lr}\n\tbl\t__ashrdi3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t llshr,.Lfe1-llshr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshr` — benchmark function synthetic:llshr:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshr:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllshr\n\t.type\t llshr,function\n\t.thumb_func\nllshr:\n\tpush\t{lr}\n\tbl\t__ashrdi3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t llshr,.Lfe1-llshr\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshr # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshr:gcc2.7.2kmc","sym":"llshr","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["s64","shift","signed"],"loc":1,"refSource":"long long llshr(long long a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta3,a2,0x1a\n 4:\tbgez\ta3,18 \n 8:\tnop\n c:\tsrav\tv1,a0,a2\n 10:\tb\t30 \n 14:\tsra\tv0,a0,0x1f\n 18:\tbeqz\ta3,2c \n 1c:\tsrlv\tv1,a1,a2\n 20:\tnegu\ta3,a2\n 24:\tsllv\ta3,a0,a3\n 28:\tor\tv1,v1,a3\n 2c:\tsrav\tv0,a0,a2\n 30:\tjr\tra\n 34:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f2ecd48c1bb7c741/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 llshr\n\n\nContents of section .text:\n 0000 00063e80 04e10004 00000000 00c41807 ..>.............\n 0010 10000007 000417c3 10e00004 00c51806 ................\n 0020 00063823 00e43804 00671825 00c41007 ..8#..8..g.%....\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 llshr(s32 a0, s32 a1, s32 a2) {\n if (a2 << 26 < 0) {\n return a0 >> 31;\n } else {\n return a0 >> a2;\n }\n}\n","score":11,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":8,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 llshr(s32 arg0, u32 arg1, s32 arg2) {\n if (arg2 & 0x20) {\n return arg0 >> 0x1F;\n }\n if ((arg2 << 0x1A) != 0) {\n\n }\n return arg0 >> arg2;\n}\n","score":10,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":8,"replace":2,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":10,"maxScore":14,"ratio":0.7142857142857143,"kinds":{"insert":0,"delete":8,"replace":2,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llshr` — benchmark function synthetic:llshr:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llshr\n sll\t$a3, $a2, 0x1a\n bgez\t$a3, .L18\n nop\n srav\t$v1, $a0, $a2\n b\t.L30\n sra\t$v0, $a0, 0x1f\n.L18:\n beqz\t$a3, .L2c\n srlv\t$v1, $a1, $a2\n negu\t$a3, $a2\n sllv\t$a3, $a0, $a3\n or\t$v1, $v1, $a3\n.L2c:\n srav\t$v0, $a0, $a2\n.L30:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshr` — benchmark function synthetic:llshr:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshr:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta3,a2,0x1a\n 4:\tbgez\ta3,18 \n 8:\tnop\n c:\tsrav\tv1,a0,a2\n 10:\tb\t30 \n 14:\tsra\tv0,a0,0x1f\n 18:\tbeqz\ta3,2c \n 1c:\tsrlv\tv1,a1,a2\n 20:\tnegu\ta3,a2\n 24:\tsllv\ta3,a0,a3\n 28:\tor\tv1,v1,a3\n 2c:\tsrav\tv0,a0,a2\n 30:\tjr\tra\n 34:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f2ecd48c1bb7c741/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 llshr\n\n\nContents of section .text:\n 0000 00063e80 04e10004 00000000 00c41807 ..>.............\n 0010 10000007 000417c3 10e00004 00c51806 ................\n 0020 00063823 00e43804 00671825 00c41007 ..8#..8..g.%....\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshr:ido7.1","sym":"llshr","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["s64","shift","signed"],"loc":1,"refSource":"long long llshr(long long a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tsw\ta2,32(sp)\n c:\tmove\ta3,a2\n 10:\tsra\ta2,a2,0x1f\n 14:\tsw\ta0,24(sp)\n 18:\tjal\t0 \n 1c:\tsw\ta1,28(sp)\n 20:\tlw\tra,20(sp)\n 24:\taddiu\tsp,sp,24\n 28:\tjr\tra\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000030 llshr\n00000000 F *UND*\t00000000 __ll_rshift\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 __ll_rshift\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 afa60020 00c03825 '.......... ..8%\n 0010 000637c3 afa40018 0c000000 afa5001c ..7.............\n 0020 8fbf0014 27bd0018 03e00008 00000000 ....'...........\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000c 00000004 000001d0 p...............\n 0010 00000006 0000032c 00000001 000001d4 .......,........\n 0020 00000004 00000208 00000000 00000000 ................\n 0030 00000011 00000238 00000034 0000027c .......8...4...|\n 0040 00000014 000002b0 00000001 000002c4 ................\n 0050 00000000 00000000 00000002 0000030c ................\n 0060 08020000 00000000 00000001 00000000 ................\n 0070 80000000 fffffffc ffffffff 00000000 ................\n 0080 00000000 00000018 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000030 20200001 00000001 .......0 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 32656364 34386331 62623763 ef-f2ecd48c1bb7c\n 0130 3734312f 7265662e 63006c6c 73687200 741/ref.c.llshr.\n 0140 6c6c7368 72005f5f 6c6c5f72 73686966 llshr.__ll_rshif\n 0150 74000000 00000000 00000001 00000000 t...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 0000000c 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000002 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000006 00000000 18cfffff 00000000 ................\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 7fffffff 00000000 7fffffff ................\n 01e0 00000001 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'llshr' — lift: cannot lift 'llshr': function call 'jal' at 0x18 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,20(sp) */\n/* 8:\tsw\ta2,32(sp) */\n/* c:\tmove\ta3,a2 */\n/* 10:\tsra\ta2,a2,0x1f */\n/* 14:\tsw\ta0,24(sp) */\n/* 18:\tjal\t0 */\n/* 1c:\tsw\ta1,28(sp) */\n/* 20:\tlw\tra,20(sp) */\n/* 24:\taddiu\tsp,sp,24 */\n/* 28:\tjr\tra */\n/* 2c:\tnop */\nvoid llshr(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'llshr': function call 'jal' at 0x18 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'llshr': function call 'jal' at 0x18 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? __ll_rshift(s32, s32); /* extern */\n\nvoid llshr(s32 arg0, ? arg1, s32 arg2) {\n __ll_rshift(arg2 >> 0x1F, arg2);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llshr` — benchmark function synthetic:llshr:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llshr\n addiu\t$sp, $sp, -24\n sw\t$ra, 20($sp)\n sw\t$a2, 32($sp)\n move\t$a3, $a2\n sra\t$a2, $a2, 0x1f\n sw\t$a0, 24($sp)\n jal\t__ll_rshift\n sw\t$a1, 28($sp)\n lw\t$ra, 20($sp)\n addiu\t$sp, $sp, 24\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshr` — benchmark function synthetic:llshr:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshr:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tsw\ta2,32(sp)\n c:\tmove\ta3,a2\n 10:\tsra\ta2,a2,0x1f\n 14:\tsw\ta0,24(sp)\n 18:\tjal\t0 \n 1c:\tsw\ta1,28(sp)\n 20:\tlw\tra,20(sp)\n 24:\taddiu\tsp,sp,24\n 28:\tjr\tra\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000030 llshr\n00000000 F *UND*\t00000000 __ll_rshift\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 __ll_rshift\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 afa60020 00c03825 '.......... ..8%\n 0010 000637c3 afa40018 0c000000 afa5001c ..7.............\n 0020 8fbf0014 27bd0018 03e00008 00000000 ....'...........\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000c 00000004 000001d0 p...............\n 0010 00000006 0000032c 00000001 000001d4 .......,........\n 0020 00000004 00000208 00000000 00000000 ................\n 0030 00000011 00000238 00000034 0000027c .......8...4...|\n 0040 00000014 000002b0 00000001 000002c4 ................\n 0050 00000000 00000000 00000002 0000030c ................\n 0060 08020000 00000000 00000001 00000000 ................\n 0070 80000000 fffffffc ffffffff 00000000 ................\n 0080 00000000 00000018 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000030 20200001 00000001 .......0 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 32656364 34386331 62623763 ef-f2ecd48c1bb7c\n 0130 3734312f 7265662e 63006c6c 73687200 741/ref.c.llshr.\n 0140 6c6c7368 72005f5f 6c6c5f72 73686966 llshr.__ll_rshif\n 0150 74000000 00000000 00000001 00000000 t...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 0000000c 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000002 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000006 00000000 18cfffff 00000000 ................\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 7fffffff 00000000 7fffffff ................\n 01e0 00000001 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshr:mwcc_242_81","sym":"llshr","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["s64","shift","signed"],"loc":1,"refSource":"long long llshr(long long a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\t__shr2i\n 10:\tlwz r0,20(r1)\n 14:\tmtlr r0\n 18:\taddi r1,r1,16\n 1c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 llshr\n00000000 *UND*\t00000000 __shr2i\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 __shr2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llshr\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 7c0803a6 38210010 4e800020 ....|...8!..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 00000000 00000000 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 llshr(void) {\n return __shr2i();\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? __shr2i(); /* extern */\n\nvoid llshr(void) {\n __shr2i();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llshr` — benchmark function synthetic:llshr:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llshr\n stwu r1,-16(r1)\n mflr r0\n stw r0,20(r1)\n bl __shr2i\n lwz r0,20(r1)\n mtlr r0\n addi r1,r1,16\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshr` — benchmark function synthetic:llshr:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshr:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\t__shr2i\n 10:\tlwz r0,20(r1)\n 14:\tmtlr r0\n 18:\taddi r1,r1,16\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 llshr\n00000000 *UND*\t00000000 __shr2i\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 __shr2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llshr\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 7c0803a6 38210010 4e800020 ....|...8!..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 00000000 00000000 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llsub:agbcc","sym":"llsub","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long llsub(long long a,long long b){ return a-b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllsub\n\t.type\t llsub,function\n\t.thumb_func\nllsub:\n\tsub\tr0, r0, r2\n\tsbc\tr1, r1, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t llsub,.Lfe1-llsub\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 llsub(u32 a0, u32 a1, u32 a2, u32 a3) {\n return a0 - a2;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 llsub(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {\n return arg0 - arg2;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":3,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llsub` — benchmark function synthetic:llsub:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllsub\n\t.type\t llsub,function\n\t.thumb_func\nllsub:\n\tsub\tr0, r0, r2\n\tsbc\tr1, r1, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t llsub,.Lfe1-llsub\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llsub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llsub` — benchmark function synthetic:llsub:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llsub:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllsub\n\t.type\t llsub,function\n\t.thumb_func\nllsub:\n\tsub\tr0, r0, r2\n\tsbc\tr1, r1, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t llsub,.Lfe1-llsub\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llsub # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llsub:gcc2.7.2kmc","sym":"llsub","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long llsub(long long a,long long b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tt0,a1,a3\n 4:\tsubu\tv1,a1,a3\n 8:\tsubu\tv0,a0,a2\n c:\tjr\tra\n 10:\tsubu\tv0,v0,t0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-632f260ce4a0dc14/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 llsub\n\n\nContents of section .text:\n 0000 00a7402b 00a71823 00861023 03e00008 ..@+...#...#....\n 0010 00481023 00000000 00000000 00000000 .H.#............\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 llsub(u32 a0, u32 a1, u32 a2, u32 a3) {\n return a0 - a2 - (a1 < a3);\n}\n","score":5,"maxScore":6,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 llsub(s32 arg0, u32 arg1, s32 arg2, u32 arg3) {\n return (arg0 - arg2) - (arg1 < arg3);\n}\n","score":5,"maxScore":6,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":6,"ratio":0.8333333333333334,"kinds":{"insert":1,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llsub` — benchmark function synthetic:llsub:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llsub\n sltu\t$t0, $a1, $a3\n subu\t$v1, $a1, $a3\n subu\t$v0, $a0, $a2\n jr\t$ra\n subu\t$v0, $v0, $t0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llsub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llsub` — benchmark function synthetic:llsub:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llsub:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tt0,a1,a3\n 4:\tsubu\tv1,a1,a3\n 8:\tsubu\tv0,a0,a2\n c:\tjr\tra\n 10:\tsubu\tv0,v0,t0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-632f260ce4a0dc14/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 llsub\n\n\nContents of section .text:\n 0000 00a7402b 00a71823 00861023 03e00008 ..@+...#...#....\n 0010 00481023 00000000 00000000 00000000 .H.#............\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llsub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llsub:ido7.1","sym":"llsub","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long llsub(long long a,long long b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tat,a1,a3\n 4:\tsubu\tv0,a0,a2\n 8:\tsubu\tv0,v0,at\n c:\tsw\ta0,0(sp)\n 10:\tsw\ta1,4(sp)\n 14:\tsw\ta2,8(sp)\n 18:\tsw\ta3,12(sp)\n 1c:\tjr\tra\n 20:\tsubu\tv1,a1,a3\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 llsub\n\n\nContents of section .text:\n 0000 00a7082b 00861023 00411023 afa40000 ...+...#.A.#....\n 0010 afa50004 afa60008 afa7000c 03e00008 ................\n 0020 00a71823 00000000 00000000 00000000 ...#............\nContents of section .options:\n 0000 01200000 00000000 a00000fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000024 20200001 00000001 .......$ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 33326632 36306365 34613064 ef-632f260ce4a0d\n 0130 6331342f 7265662e 63006c6c 73756200 c14/ref.c.llsub.\n 0140 6c6c7375 62000000 00000000 00000001 llsub...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000009 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 llsub(s32 a0, s32 a1, s32 a2, s32 a3) {\n return a0 - a2 - (a1 < a3);\n}\n","score":8,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":5,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 llsub(s32 arg0, u32 arg1, s32 arg2, u32 arg3) {\n return (arg0 - arg2) - (arg1 < arg3);\n}\n","score":9,"maxScore":10,"compileErrors":null,"breakdown":{"insert":1,"delete":6,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":8,"maxScore":9,"ratio":0.8888888888888888,"kinds":{"insert":0,"delete":5,"replace":1,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llsub` — benchmark function synthetic:llsub:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llsub\n sltu\t$at, $a1, $a3\n subu\t$v0, $a0, $a2\n subu\t$v0, $v0, $at\n sw\t$a0, 0($sp)\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n sw\t$a3, 12($sp)\n jr\t$ra\n subu\t$v1, $a1, $a3\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llsub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llsub` — benchmark function synthetic:llsub:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llsub:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tat,a1,a3\n 4:\tsubu\tv0,a0,a2\n 8:\tsubu\tv0,v0,at\n c:\tsw\ta0,0(sp)\n 10:\tsw\ta1,4(sp)\n 14:\tsw\ta2,8(sp)\n 18:\tsw\ta3,12(sp)\n 1c:\tjr\tra\n 20:\tsubu\tv1,a1,a3\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 llsub\n\n\nContents of section .text:\n 0000 00a7082b 00861023 00411023 afa40000 ...+...#.A.#....\n 0010 afa50004 afa60008 afa7000c 03e00008 ................\n 0020 00a71823 00000000 00000000 00000000 ...#............\nContents of section .options:\n 0000 01200000 00000000 a00000fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000024 20200001 00000001 .......$ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 33326632 36306365 34613064 ef-632f260ce4a0d\n 0130 6331342f 7265662e 63006c6c 73756200 c14/ref.c.llsub.\n 0140 6c6c7375 62000000 00000000 00000001 llsub...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000009 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llsub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llsub:mwcc_242_81","sym":"llsub","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long llsub(long long a,long long b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsubfc r4,r6,r4\n 4:\tsubfe r3,r5,r3\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c llsub\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llsub\n\n\nContents of section .text:\n 0000 7c862010 7c651910 4e800020 |. .|e..N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"s32 llsub(s32 a0, s32 a1, s32 a2, s32 a3) {\n return ASMLIFT_ERROR(\"unmodelled instruction 'subfe'\", a2, a0);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":3,"gotos":0,"casts":0,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: unmodelled instruction 'subfe'"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 llsub(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {\n return (arg0 - arg2) - !M2C_CARRY;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_CARRY"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llsub` — benchmark function synthetic:llsub:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llsub\n subfc r4,r6,r4\n subfe r3,r5,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llsub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llsub` — benchmark function synthetic:llsub:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llsub:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsubfc r4,r6,r4\n 4:\tsubfe r3,r5,r3\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c llsub\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llsub\n\n\nContents of section .text:\n 0000 7c862010 7c651910 4e800020 |. .|e..N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llsub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loadoff:agbcc","sym":"loadoff","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","load","offset"],"loc":1,"refSource":"int loadoff(int *p){ return p[2]; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tloadoff\n\t.type\t loadoff,function\n\t.thumb_func\nloadoff:\n\tldr\tr0, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t loadoff,.Lfe1-loadoff\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 loadoff(s32 * a0) {\n return a0[2];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 loadoff(void *arg0) {\n return arg0->unk8;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:3: warning: dereferencing `void *' pointer","/cand.c.pp.c:3: request for member `unk8' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loadoff` — benchmark function synthetic:loadoff:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tloadoff\n\t.type\t loadoff,function\n\t.thumb_func\nloadoff:\n\tldr\tr0, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t loadoff,.Lfe1-loadoff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loadoff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loadoff` — benchmark function synthetic:loadoff:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loadoff:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tloadoff\n\t.type\t loadoff,function\n\t.thumb_func\nloadoff:\n\tldr\tr0, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t loadoff,.Lfe1-loadoff\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name loadoff # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loadoff:gcc2.7.2kmc","sym":"loadoff","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","load","offset"],"loc":1,"refSource":"int loadoff(int *p){ return p[2]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,8(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-6a1c213dc2f333f3/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 loadoff\n\n\nContents of section .text:\n 0000 03e00008 8c820008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 loadoff(s32 * a0) {\n return a0[2];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 loadoff(void *arg0) {\n return arg0->unk8;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: request for member `unk8' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loadoff` — benchmark function synthetic:loadoff:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loadoff\n jr\t$ra\n lw\t$v0, 8($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loadoff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loadoff` — benchmark function synthetic:loadoff:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loadoff:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,8(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-6a1c213dc2f333f3/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 loadoff\n\n\nContents of section .text:\n 0000 03e00008 8c820008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name loadoff # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loadoff:ido7.1","sym":"loadoff","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","load","offset"],"loc":1,"refSource":"int loadoff(int *p){ return p[2]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,8(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 loadoff\n\n\nContents of section .text:\n 0000 03e00008 8c820008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 61316332 31336463 32663333 ef-6a1c213dc2f33\n 0130 3366332f 7265662e 63006c6f 61646f66 3f3/ref.c.loadof\n 0140 66000000 6c6f6164 6f666600 00000000 f...loadoff.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 loadoff(s32 * a0) {\n return a0[2];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 loadoff(void *arg0) {\n return arg0->unk8;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loadoff` — benchmark function synthetic:loadoff:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loadoff\n jr\t$ra\n lw\t$v0, 8($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loadoff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loadoff` — benchmark function synthetic:loadoff:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loadoff:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,8(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 loadoff\n\n\nContents of section .text:\n 0000 03e00008 8c820008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 61316332 31336463 32663333 ef-6a1c213dc2f33\n 0130 3366332f 7265662e 63006c6f 61646f66 3f3/ref.c.loadof\n 0140 66000000 6c6f6164 6f666600 00000000 f...loadoff.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name loadoff # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loadoff:mwcc_242_81","sym":"loadoff","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","load","offset"],"loc":1,"refSource":"int loadoff(int *p){ return p[2]; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r3,8(r3)\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 loadoff\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 loadoff\n\n\nContents of section .text:\n 0000 80630008 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 loadoff(s32 * a0) {\n return a0[2];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 loadoff(void *arg0) {\n return arg0->unk8;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loadoff` — benchmark function synthetic:loadoff:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loadoff\n lwz r3,8(r3)\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loadoff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loadoff` — benchmark function synthetic:loadoff:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loadoff:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r3,8(r3)\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 loadoff\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 loadoff\n\n\nContents of section .text:\n 0000 80630008 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name loadoff # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loopif:agbcc","sym":"loopif","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","branch","memory"],"loc":1,"refSource":"int loopif(int *a,int n){ int s=0,i; for(i=0;i0) s+=a[i]; } return s; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tloopif\n\t.type\t loopif,function\n\t.thumb_func\nloopif:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r3, r2\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t loopif,.Lfe1-loopif\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 loopif(s32 * a0, u32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (0 >= a1) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n do {\n if (*v0 > 0) v1 = v1 + *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":5,"maxScore":16,"compileErrors":null,"breakdown":{"insert":3,"delete":1,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 loopif(s32 *arg0, s32 arg1) {\n s32 *var_r0;\n s32 temp_r2;\n s32 var_r1;\n s32 var_r3;\n\n var_r0 = arg0;\n var_r1 = arg1;\n var_r3 = 0;\n if (var_r1 > 0) {\n do {\n temp_r2 = *var_r0;\n if (temp_r2 > 0) {\n var_r3 += temp_r2;\n }\n var_r0 += 4;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n return var_r3;\n}\n","score":3,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":13,"ratio":0.23076923076923078,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loopif` — benchmark function synthetic:loopif:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tloopif\n\t.type\t loopif,function\n\t.thumb_func\nloopif:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r3, r2\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t loopif,.Lfe1-loopif\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loopif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loopif` — benchmark function synthetic:loopif:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loopif:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tloopif\n\t.type\t loopif,function\n\t.thumb_func\nloopif:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r3, r2\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t loopif,.Lfe1-loopif\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name loopif # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loopif:gcc2.7.2kmc","sym":"loopif","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","branch","memory"],"loc":1,"refSource":"int loopif(int *a,int n){ int s=0,i; for(i=0;i0) s+=a[i]; } return s; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,2c \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\tbgtzl\tv0,1c \n 18:\taddu\tv1,v1,v0\n 1c:\taddiu\ta2,a2,1\n 20:\tslt\tv0,a2,a1\n 24:\tbnez\tv0,10 \n 28:\taddiu\ta0,a0,4\n 2c:\tmove\tv0,v1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5e7394a3a37ff814/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 loopif\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00008 00001821 '.....0!.......!\n 0010 8c820000 5c400001 00621821 24c60001 ....\\@...b.!$...\n 0020 00c5102a 1440fffa 24840004 00601021 ...*.@..$....`.!\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'loopif' — lift: cannot lift 'loopif': unmodelled control transfer 'bgtzl' at 0x14 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-8 */\n/* 4:\tmove\ta2,zero */\n/* 8:\tblez\ta1,2c */\n/* c:\tmove\tv1,zero */\n/* 10:\tlw\tv0,0(a0) */\n/* 14:\tbgtzl\tv0,1c */\n/* 18:\taddu\tv1,v1,v0 */\n/* 1c:\taddiu\ta2,a2,1 */\n/* 20:\tslt\tv0,a2,a1 */\n/* 24:\tbnez\tv0,10 */\n/* 28:\taddiu\ta0,a0,4 */\n/* 2c:\tmove\tv0,v1 */\n/* 30:\tjr\tra */\n/* 34:\taddiu\tsp,sp,8 */\n/* \t... */\nvoid loopif(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'loopif': unmodelled control transfer 'bgtzl' at 0x14 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'loopif': unmodelled control transfer 'bgtzl' at 0x14 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 loopif(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 temp_v0;\n s32 var_a2;\n s32 var_v1;\n\n var_a0 = arg0;\n var_a2 = 0;\n var_v1 = 0;\n if (arg1 > 0) {\n do {\n temp_v0 = *var_a0;\n if (temp_v0 > 0) {\n var_v1 += temp_v0;\n }\n var_a2 += 1;\n var_a0 += 4;\n } while (var_a2 < arg1);\n }\n return var_v1;\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":9,"maxScore":14,"ratio":0.6428571428571429,"kinds":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loopif` — benchmark function synthetic:loopif:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loopif\n addiu\t$sp, $sp, -8\n move\t$a2, $zero\n blez\t$a1, .L2c\n move\t$v1, $zero\n.L10:\n lw\t$v0, 0($a0)\n bgtzl\t$v0, .L1c\n addu\t$v1, $v1, $v0\n.L1c:\n addiu\t$a2, $a2, 1\n slt\t$v0, $a2, $a1\n bnez\t$v0, .L10\n addiu\t$a0, $a0, 4\n.L2c:\n move\t$v0, $v1\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loopif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loopif` — benchmark function synthetic:loopif:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loopif:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,2c \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\tbgtzl\tv0,1c \n 18:\taddu\tv1,v1,v0\n 1c:\taddiu\ta2,a2,1\n 20:\tslt\tv0,a2,a1\n 24:\tbnez\tv0,10 \n 28:\taddiu\ta0,a0,4\n 2c:\tmove\tv0,v1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5e7394a3a37ff814/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 loopif\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00008 00001821 '.....0!.......!\n 0010 8c820000 5c400001 00621821 24c60001 ....\\@...b.!$...\n 0020 00c5102a 1440fffa 24840004 00601021 ...*.@..$....`.!\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name loopif # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loopif:ido7.1","sym":"loopif","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","branch","memory"],"loc":1,"refSource":"int loopif(int *a,int n){ int s=0,i; for(i=0;i0) s+=a[i]; } return s; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,9c \n 8:\tmove\tv0,zero\n c:\tandi\ta3,a1,0x3\n 10:\tbeqz\ta3,40 \n 14:\tmove\tt0,a3\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\ta3,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\tblez\ta3,34 \n 2c:\tnop\n 30:\taddu\tv1,v1,a3\n 34:\tbne\tt0,v0,20 \n 38:\taddiu\ta2,a2,4\n 3c:\tbeq\tv0,a1,9c \n 40:\tsll\tt7,v0,0x2\n 44:\tsll\tt8,a1,0x2\n 48:\taddu\tt0,t8,a0\n 4c:\taddu\ta2,a0,t7\n 50:\tlw\ta3,0(a2)\n 54:\tblezl\ta3,64 \n 58:\tlw\tv0,4(a2)\n 5c:\taddu\tv1,v1,a3\n 60:\tlw\tv0,4(a2)\n 64:\tblezl\tv0,74 \n 68:\tlw\tv0,8(a2)\n 6c:\taddu\tv1,v1,v0\n 70:\tlw\tv0,8(a2)\n 74:\tblezl\tv0,84 \n 78:\tlw\tv0,12(a2)\n 7c:\taddu\tv1,v1,v0\n 80:\tlw\tv0,12(a2)\n 84:\taddiu\ta2,a2,16\n 88:\tblez\tv0,94 \n 8c:\tnop\n 90:\taddu\tv1,v1,v0\n 94:\tbnel\ta2,t0,54 \n 98:\tlw\ta3,0(a2)\n 9c:\tjr\tra\n a0:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 loopif\n\n\nContents of section .text:\n 0000 00001825 18a00025 00001025 30a70003 ...%...%...%0...\n 0010 10e0000b 00e04025 00007080 008e3021 ......@%..p...0!\n 0020 8cc70000 24420001 18e00002 00000000 ....$B..........\n 0030 00671821 1502fffa 24c60004 10450017 .g.!....$....E..\n 0040 00027880 0005c080 03044021 008f3021 ..x.......@!..0!\n 0050 8cc70000 58e00003 8cc20004 00671821 ....X........g.!\n 0060 8cc20004 58400003 8cc20008 00621821 ....X@.......b.!\n 0070 8cc20008 58400003 8cc2000c 00621821 ....X@.......b.!\n 0080 8cc2000c 24c60010 18400002 00000000 ....$....@......\n 0090 00621821 54c8ffef 8cc70000 03e00008 .b.!T...........\n 00a0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8100c1fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c1fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000008 00000218 p......)........\n 0010 00000005 00000360 00000001 00000220 .......`....... \n 0020 00000004 00000254 00000000 00000000 .......T........\n 0030 00000011 00000284 00000038 000002c8 ...........8....\n 0040 00000008 00000300 00000001 00000308 ................\n 0050 00000000 00000000 00000001 00000350 ...............P\n 0060 08080808 04000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000a4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d35 65373339 34613361 ps-ref-5e7394a3a\n 0130 33376666 3831342f 7265662e 63006c6f 37ff814/ref.c.lo\n 0140 6f706966 00000000 6c6f6f70 69660000 opif....loopif..\n 0150 00000000 00000001 00000000 00000035 ...............5\n 0160 00000000 00000004 00000000 00000029 ...............)\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'loopif' — lift: cannot lift 'loopif': unmodelled control transfer 'blezl' at 0x54 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tblez\ta1,9c */\n/* 8:\tmove\tv0,zero */\n/* c:\tandi\ta3,a1,0x3 */\n/* 10:\tbeqz\ta3,40 */\n/* 14:\tmove\tt0,a3 */\n/* 18:\tsll\tt6,zero,0x2 */\n/* 1c:\taddu\ta2,a0,t6 */\n/* 20:\tlw\ta3,0(a2) */\n/* 24:\taddiu\tv0,v0,1 */\n/* 28:\tblez\ta3,34 */\n/* 2c:\tnop */\n/* 30:\taddu\tv1,v1,a3 */\n/* 34:\tbne\tt0,v0,20 */\n/* 38:\taddiu\ta2,a2,4 */\n/* 3c:\tbeq\tv0,a1,9c */\n/* 40:\tsll\tt7,v0,0x2 */\n/* 44:\tsll\tt8,a1,0x2 */\n/* 48:\taddu\tt0,t8,a0 */\n/* 4c:\taddu\ta2,a0,t7 */\n/* 50:\tlw\ta3,0(a2) */\n/* 54:\tblezl\ta3,64 */\n/* 58:\tlw\tv0,4(a2) */\n/* 5c:\taddu\tv1,v1,a3 */\n/* 60:\tlw\tv0,4(a2) */\n/* 64:\tblezl\tv0,74 */\n/* 68:\tlw\tv0,8(a2) */\n/* 6c:\taddu\tv1,v1,v0 */\n/* 70:\tlw\tv0,8(a2) */\n/* 74:\tblezl\tv0,84 */\n/* 78:\tlw\tv0,12(a2) */\n/* 7c:\taddu\tv1,v1,v0 */\n/* 80:\tlw\tv0,12(a2) */\n/* 84:\taddiu\ta2,a2,16 */\n/* 88:\tblez\tv0,94 */\n/* 8c:\tnop */\n/* 90:\taddu\tv1,v1,v0 */\n/* 94:\tbnel\ta2,t0,54 */\n/* 98:\tlw\ta3,0(a2) */\n/* 9c:\tjr\tra */\n/* a0:\tmove\tv0,v1 */\n/* \t... */\nvoid loopif(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'loopif': unmodelled control transfer 'blezl' at 0x54 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":50,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'loopif': unmodelled control transfer 'blezl' at 0x54 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 loopif(s32 arg0, s32 arg1) {\n s32 *var_a2;\n s32 temp_a3;\n s32 temp_a3_2;\n s32 temp_a3_3;\n s32 temp_v0;\n s32 temp_v0_2;\n s32 temp_v0_3;\n s32 var_v0;\n s32 var_v1;\n void *var_a2_2;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg1 > 0) {\n temp_a3 = arg1 & 3;\n if (temp_a3 != 0) {\n var_a2 = arg0 + (0 * 4);\n do {\n temp_a3_2 = *var_a2;\n var_v0 += 1;\n if (temp_a3_2 > 0) {\n var_v1 += temp_a3_2;\n }\n var_a2 += 4;\n } while (temp_a3 != var_v0);\n if (var_v0 != arg1) {\n goto block_7;\n }\n } else {\nblock_7:\n var_a2_2 = arg0 + (var_v0 * 4);\n do {\n temp_a3_3 = var_a2_2->unk0;\n if (temp_a3_3 > 0) {\n var_v1 += temp_a3_3;\n }\n temp_v0 = var_a2_2->unk4;\n if (temp_v0 > 0) {\n var_v1 += temp_v0;\n }\n temp_v0_2 = var_a2_2->unk8;\n if (temp_v0_2 > 0) {\n var_v1 += temp_v0_2;\n }\n temp_v0_3 = var_a2_2->unkC;\n var_a2_2 += 0x10;\n if (temp_v0_3 > 0) {\n var_v1 += temp_v0_3;\n }\n } while (var_a2_2 != ((arg1 * 4) + arg0));\n }\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":6,"quality":{"score":88,"lines":54,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 35: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 39: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 43: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 47: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 48: Bad operand type for += or -="]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loopif` — benchmark function synthetic:loopif:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loopif\n move\t$v1, $zero\n blez\t$a1, .L9c\n move\t$v0, $zero\n andi\t$a3, $a1, 0x3\n beqz\t$a3, .L40\n move\t$t0, $a3\n sll\t$t6, $zero, 0x2\n addu\t$a2, $a0, $t6\n.L20:\n lw\t$a3, 0($a2)\n addiu\t$v0, $v0, 1\n blez\t$a3, .L34\n nop\n addu\t$v1, $v1, $a3\n.L34:\n bne\t$t0, $v0, .L20\n addiu\t$a2, $a2, 4\n beq\t$v0, $a1, .L9c\n.L40:\n sll\t$t7, $v0, 0x2\n sll\t$t8, $a1, 0x2\n addu\t$t0, $t8, $a0\n addu\t$a2, $a0, $t7\n lw\t$a3, 0($a2)\n.L54:\n blezl\t$a3, .L64\n lw\t$v0, 4($a2)\n addu\t$v1, $v1, $a3\n lw\t$v0, 4($a2)\n.L64:\n blezl\t$v0, .L74\n lw\t$v0, 8($a2)\n addu\t$v1, $v1, $v0\n lw\t$v0, 8($a2)\n.L74:\n blezl\t$v0, .L84\n lw\t$v0, 12($a2)\n addu\t$v1, $v1, $v0\n lw\t$v0, 12($a2)\n.L84:\n addiu\t$a2, $a2, 16\n blez\t$v0, .L94\n nop\n addu\t$v1, $v1, $v0\n.L94:\n bnel\t$a2, $t0, .L54\n lw\t$a3, 0($a2)\n.L9c:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loopif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loopif` — benchmark function synthetic:loopif:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loopif:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,9c \n 8:\tmove\tv0,zero\n c:\tandi\ta3,a1,0x3\n 10:\tbeqz\ta3,40 \n 14:\tmove\tt0,a3\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\ta3,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\tblez\ta3,34 \n 2c:\tnop\n 30:\taddu\tv1,v1,a3\n 34:\tbne\tt0,v0,20 \n 38:\taddiu\ta2,a2,4\n 3c:\tbeq\tv0,a1,9c \n 40:\tsll\tt7,v0,0x2\n 44:\tsll\tt8,a1,0x2\n 48:\taddu\tt0,t8,a0\n 4c:\taddu\ta2,a0,t7\n 50:\tlw\ta3,0(a2)\n 54:\tblezl\ta3,64 \n 58:\tlw\tv0,4(a2)\n 5c:\taddu\tv1,v1,a3\n 60:\tlw\tv0,4(a2)\n 64:\tblezl\tv0,74 \n 68:\tlw\tv0,8(a2)\n 6c:\taddu\tv1,v1,v0\n 70:\tlw\tv0,8(a2)\n 74:\tblezl\tv0,84 \n 78:\tlw\tv0,12(a2)\n 7c:\taddu\tv1,v1,v0\n 80:\tlw\tv0,12(a2)\n 84:\taddiu\ta2,a2,16\n 88:\tblez\tv0,94 \n 8c:\tnop\n 90:\taddu\tv1,v1,v0\n 94:\tbnel\ta2,t0,54 \n 98:\tlw\ta3,0(a2)\n 9c:\tjr\tra\n a0:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 loopif\n\n\nContents of section .text:\n 0000 00001825 18a00025 00001025 30a70003 ...%...%...%0...\n 0010 10e0000b 00e04025 00007080 008e3021 ......@%..p...0!\n 0020 8cc70000 24420001 18e00002 00000000 ....$B..........\n 0030 00671821 1502fffa 24c60004 10450017 .g.!....$....E..\n 0040 00027880 0005c080 03044021 008f3021 ..x.......@!..0!\n 0050 8cc70000 58e00003 8cc20004 00671821 ....X........g.!\n 0060 8cc20004 58400003 8cc20008 00621821 ....X@.......b.!\n 0070 8cc20008 58400003 8cc2000c 00621821 ....X@.......b.!\n 0080 8cc2000c 24c60010 18400002 00000000 ....$....@......\n 0090 00621821 54c8ffef 8cc70000 03e00008 .b.!T...........\n 00a0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8100c1fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c1fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000008 00000218 p......)........\n 0010 00000005 00000360 00000001 00000220 .......`....... \n 0020 00000004 00000254 00000000 00000000 .......T........\n 0030 00000011 00000284 00000038 000002c8 ...........8....\n 0040 00000008 00000300 00000001 00000308 ................\n 0050 00000000 00000000 00000001 00000350 ...............P\n 0060 08080808 04000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000a4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d35 65373339 34613361 ps-ref-5e7394a3a\n 0130 33376666 3831342f 7265662e 63006c6f 37ff814/ref.c.lo\n 0140 6f706966 00000000 6c6f6f70 69660000 opif....loopif..\n 0150 00000000 00000001 00000000 00000035 ...............5\n 0160 00000000 00000004 00000000 00000029 ...............)\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name loopif # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loopif:mwcc_242_81","sym":"loopif","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","branch","memory"],"loc":1,"refSource":"int loopif(int *a,int n){ int s=0,i; for(i=0;i0) s+=a[i]; } return s; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r0,0(r3)\n 14:\tcmpwi r0,0\n 18:\tble 20 \n 1c:\tadd r5,r5,r0\n 20:\taddi r3,r3,4\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 loopif\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 loopif\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80030000 2c000000 40810008 7ca50214 ....,...@...|...\n 0020 38630004 4200ffec 7ca32b78 4e800020 8c..B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 loopif(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 <= 0) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n do {\n if (*v0 > 0) v1 = v1 + *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":8,"maxScore":16,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":0,"opMismatch":2,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 loopif(s32 *arg0, s32 arg1) {\n s32 *var_r3;\n s32 temp_r0;\n s32 var_ctr;\n s32 var_r5;\n\n var_r3 = arg0;\n var_r5 = 0;\n var_ctr = arg1;\n if (arg1 > 0) {\n do {\n temp_r0 = *var_r3;\n if (temp_r0 > 0) {\n var_r5 += temp_r0;\n }\n var_r3 += 4;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n return var_r5;\n}\n","score":6,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":14,"ratio":0.42857142857142855,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loopif` — benchmark function synthetic:loopif:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loopif\n li r5,0\n mtctr r4\n cmpwi r4,0\n ble .L28\n.L10:\n lwz r0,0(r3)\n cmpwi r0,0\n ble .L20\n add r5,r5,r0\n.L20:\n addi r3,r3,4\n bdnz .L10\n.L28:\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loopif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loopif` — benchmark function synthetic:loopif:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loopif:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r0,0(r3)\n 14:\tcmpwi r0,0\n 18:\tble 20 \n 1c:\tadd r5,r5,r0\n 20:\taddi r3,r3,4\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 loopif\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 loopif\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80030000 2c000000 40810008 7ca50214 ....,...@...|...\n 0020 38630004 4200ffec 7ca32b78 4e800020 8c..B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name loopif # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lor:agbcc","sym":"lor","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","logical-or"],"loc":1,"refSource":"int lor(int a,int b){ return a || b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tlor\n\t.type\t lor,function\n\t.thumb_func\nlor:\n\tmov\tr2, #0x0\n\tcmp\tr0, #0\n\tbne\t.L4\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n.L4:\n\tmov\tr2, #0x1\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t lor,.Lfe1-lor\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned/flip-branch","outcome":"nonmatch","source":"s32 lor(u32 a0, u32 a1) {\n s32 v0;\n if (a0 != 0) {\n return 1;\n } else {\n if (a1 == 0) {\n v0 = 0;\n return v0;\n } else {\n return 1;\n }\n }\n}\n","score":4,"maxScore":9,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 lor(s32 arg0, s32 arg1) {\n s32 var_r2;\n\n var_r2 = 0;\n if ((arg0 != 0) || (arg1 != 0)) {\n var_r2 = 1;\n }\n return var_r2;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lor` — benchmark function synthetic:lor:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tlor\n\t.type\t lor,function\n\t.thumb_func\nlor:\n\tmov\tr2, #0x0\n\tcmp\tr0, #0\n\tbne\t.L4\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n.L4:\n\tmov\tr2, #0x1\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t lor,.Lfe1-lor\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lor` — benchmark function synthetic:lor:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lor:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tlor\n\t.type\t lor,function\n\t.thumb_func\nlor:\n\tmov\tr2, #0x0\n\tcmp\tr0, #0\n\tbne\t.L4\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n.L4:\n\tmov\tr2, #0x1\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t lor,.Lfe1-lor\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name lor # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lor:gcc2.7.2kmc","sym":"lor","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","logical-or"],"loc":1,"refSource":"int lor(int a,int b){ return a || b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\ta0,zero,a0\n 4:\tsltu\tv0,zero,a1\n 8:\tjr\tra\n c:\tor\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-eea8b5544eef90c8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 lor\n\n\nContents of section .text:\n 0000 0004202b 0005102b 03e00008 00821025 .. +...+.......%\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 lor(u32 a0, u32 a1) {\n return 0 < a0 | 0 < a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 lor(s32 arg0, s32 arg1) {\n return (arg0 != 0) | (arg1 != 0);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lor` — benchmark function synthetic:lor:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lor\n sltu\t$a0, $zero, $a0\n sltu\t$v0, $zero, $a1\n jr\t$ra\n or\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lor` — benchmark function synthetic:lor:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lor:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\ta0,zero,a0\n 4:\tsltu\tv0,zero,a1\n 8:\tjr\tra\n c:\tor\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-eea8b5544eef90c8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 lor\n\n\nContents of section .text:\n 0000 0004202b 0005102b 03e00008 00821025 .. +...+.......%\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name lor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lor:ido7.1","sym":"lor","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","logical-or"],"loc":1,"refSource":"int lor(int a,int b){ return a || b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tv0,zero,a0\n 4:\tbnez\tv0,10 \n 8:\tnop\n c:\tsltu\tv0,zero,a1\n 10:\tjr\tra\n 14:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 lor\n\n\nContents of section .text:\n 0000 0004102b 14400002 00000000 0005102b ...+.@.........+\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c4 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000004 00000268 00000001 0000026c .......h.......l\n 0050 00000000 00000000 00000001 000002b4 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 65613862 35353434 65656639 ef-eea8b5544eef9\n 0130 3063382f 7265662e 63006c6f 72000000 0c8/ref.c.lor...\n 0140 6c6f7200 00000000 00000001 00000000 lor.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000006 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 lor(s32 a0, s32 a1) {\n s32 v0;\n if (0 < a0) {\n v0 = 0 < a0;\n } else {\n v0 = 0 < a1;\n }\n return v0;\n}\n","score":6,"maxScore":8,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":3,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 lor(s32 arg0, s32 arg1) {\n s32 var_v0;\n\n var_v0 = arg0 != 0;\n if (var_v0 == 0) {\n var_v0 = arg1 != 0;\n }\n return var_v0;\n}\n","score":4,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":6,"ratio":0.6666666666666666,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lor` — benchmark function synthetic:lor:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lor\n sltu\t$v0, $zero, $a0\n bnez\t$v0, .L10\n nop\n sltu\t$v0, $zero, $a1\n.L10:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lor` — benchmark function synthetic:lor:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lor:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tv0,zero,a0\n 4:\tbnez\tv0,10 \n 8:\tnop\n c:\tsltu\tv0,zero,a1\n 10:\tjr\tra\n 14:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 lor\n\n\nContents of section .text:\n 0000 0004102b 14400002 00000000 0005102b ...+.@.........+\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c4 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000004 00000268 00000001 0000026c .......h.......l\n 0050 00000000 00000000 00000001 000002b4 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 65613862 35353434 65656639 ef-eea8b5544eef9\n 0130 3063382f 7265662e 63006c6f 72000000 0c8/ref.c.lor...\n 0140 6c6f7200 00000000 00000001 00000000 lor.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000006 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lor:mwcc_242_81","sym":"lor","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","logical-or"],"loc":1,"refSource":"int lor(int a,int b){ return a || b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r3,0\n 8:\tbne 14 \n c:\tcmpwi r4,0\n 10:\tbeqlr\n 14:\tli r3,1\n 18:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c lor\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 lor\n\n\nContents of section .text:\n 0000 2c030000 38600000 4082000c 2c040000 ,...8`..@...,...\n 0010 4d820020 38600001 4e800020 M.. 8`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 lor(s32 a0, s32 a1) {\n if (a0 == 0) {\n if (a1 != 0) {\n return 1;\n } else {\n return 0;\n }\n } else {\n return 1;\n }\n}\n","score":5,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":1,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 lor(s32 arg0, s32 arg1) {\n if ((arg0 != 0) || (arg1 != 0)) {\n return 1;\n }\n return 0;\n}\n","score":5,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":9,"ratio":0.5555555555555556,"kinds":{"insert":2,"delete":1,"replace":1,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lor` — benchmark function synthetic:lor:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lor\n cmpwi r3,0\n li r3,0\n bne .L14\n cmpwi r4,0\n beqlr\n.L14:\n li r3,1\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lor` — benchmark function synthetic:lor:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lor:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r3,0\n 8:\tbne 14 \n c:\tcmpwi r4,0\n 10:\tbeqlr\n 14:\tli r3,1\n 18:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c lor\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 lor\n\n\nContents of section .text:\n 0000 2c030000 38600000 4082000c 2c040000 ,...8`..@...,...\n 0010 4d820020 38600001 4e800020 M.. 8`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mask8:agbcc","sym":"mask8","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","mask"],"loc":1,"refSource":"unsigned mask8(unsigned x){ return x & 0xff; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmask8\n\t.type\t mask8,function\n\t.thumb_func\nmask8:\n\tadd\tr1, r0, #0\n\tmov\tr0, #0xff\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t mask8,.Lfe1-mask8\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mask8(u32 a0) {\n return 255 & a0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mask8(s32 arg0) {\n return 0xFF & arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mask8` — benchmark function synthetic:mask8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmask8\n\t.type\t mask8,function\n\t.thumb_func\nmask8:\n\tadd\tr1, r0, #0\n\tmov\tr0, #0xff\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t mask8,.Lfe1-mask8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mask8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mask8` — benchmark function synthetic:mask8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mask8:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmask8\n\t.type\t mask8,function\n\t.thumb_func\nmask8:\n\tadd\tr1, r0, #0\n\tmov\tr0, #0xff\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t mask8,.Lfe1-mask8\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mask8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mask8:gcc2.7.2kmc","sym":"mask8","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","mask"],"loc":1,"refSource":"unsigned mask8(unsigned x){ return x & 0xff; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-077db2d7aa87cba7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 mask8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mask8(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mask8(s32 arg0) {\n return arg0 & 0xFF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mask8` — benchmark function synthetic:mask8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mask8\n jr\t$ra\n andi\t$v0, $a0, 0xff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mask8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mask8` — benchmark function synthetic:mask8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mask8:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-077db2d7aa87cba7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 mask8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mask8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mask8:ido7.1","sym":"mask8","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","mask"],"loc":1,"refSource":"unsigned mask8(unsigned x){ return x & 0xff; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 mask8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 37376462 32643761 61383763 ef-077db2d7aa87c\n 0130 6261372f 7265662e 63006d61 736b3800 ba7/ref.c.mask8.\n 0140 6d61736b 38000000 00000000 00000001 mask8...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mask8(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mask8(s32 arg0) {\n return arg0 & 0xFF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mask8` — benchmark function synthetic:mask8:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mask8\n jr\t$ra\n andi\t$v0, $a0, 0xff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mask8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mask8` — benchmark function synthetic:mask8:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mask8:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 mask8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 37376462 32643761 61383763 ef-077db2d7aa87c\n 0130 6261372f 7265662e 63006d61 736b3800 ba7/ref.c.mask8.\n 0140 6d61736b 38000000 00000000 00000001 mask8...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mask8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mask8:mwcc_242_81","sym":"mask8","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","mask"],"loc":1,"refSource":"unsigned mask8(unsigned x){ return x & 0xff; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,24\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 mask8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mask8\n\n\nContents of section .text:\n 0000 5463063e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mask8(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 mask8(u8 arg0) {\n return arg0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mask8` — benchmark function synthetic:mask8:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mask8\n clrlwi r3,r3,24\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mask8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mask8` — benchmark function synthetic:mask8:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mask8:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,24\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 mask8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mask8\n\n\nContents of section .text:\n 0000 5463063e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mask8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:max3:agbcc","sym":"max3","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int max3(int a,int b,int c){ int m=a>b?a:b; return m>c?m:c; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmax3\n\t.type\t max3,function\n\t.thumb_func\nmax3:\n\tcmp\tr1, r0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r0, #0\n.L3:\n\tadd\tr0, r2, #0\n\tcmp\tr0, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r1, #0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t max3,.Lfe1-max3\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 max3(s32 a0, s32 a1, s32 a2) {\n if (a1 < a0) a1 = a0;\n if (a2 < a1) a2 = a1;\n return a2;\n}\n","score":5,"maxScore":10,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 max3(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r0;\n s32 var_r1;\n\n var_r1 = arg1;\n if (var_r1 < arg0) {\n var_r1 = arg0;\n }\n var_r0 = arg2;\n if (var_r0 < var_r1) {\n var_r0 = var_r1;\n }\n return var_r0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `max3` — benchmark function synthetic:max3:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmax3\n\t.type\t max3,function\n\t.thumb_func\nmax3:\n\tcmp\tr1, r0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r0, #0\n.L3:\n\tadd\tr0, r2, #0\n\tcmp\tr0, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r1, #0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t max3,.Lfe1-max3\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function max3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `max3` — benchmark function synthetic:max3:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:max3:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmax3\n\t.type\t max3,function\n\t.thumb_func\nmax3:\n\tcmp\tr1, r0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r0, #0\n.L3:\n\tadd\tr0, r2, #0\n\tcmp\tr0, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r1, #0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t max3,.Lfe1-max3\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name max3 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:max3:gcc2.7.2kmc","sym":"max3","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int max3(int a,int b,int c){ int m=a>b?a:b; return m>c?m:c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tslt\tv0,a0,a2\n 10:\tbnezl\tv0,18 \n 14:\tmove\ta0,a2\n 18:\tjr\tra\n 1c:\tmove\tv0,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ff3fefc9295fb039/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 max3\n\n\nContents of section .text:\n 0000 0085102a 54400001 00a02021 0086102a ...*T@.... !...*\n 0010 54400001 00c02021 03e00008 00801021 T@.... !.......!\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'max3' — lift: cannot lift 'max3': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tslt\tv0,a0,a1 */\n/* 4:\tbnezl\tv0,c */\n/* 8:\tmove\ta0,a1 */\n/* c:\tslt\tv0,a0,a2 */\n/* 10:\tbnezl\tv0,18 */\n/* 14:\tmove\ta0,a2 */\n/* 18:\tjr\tra */\n/* 1c:\tmove\tv0,a0 */\nvoid max3(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'max3': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'max3': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 max3(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_a0;\n\n var_a0 = arg0;\n if (var_a0 < arg1) {\n var_a0 = arg1;\n }\n if (var_a0 < arg2) {\n var_a0 = arg2;\n }\n return var_a0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `max3` — benchmark function synthetic:max3:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel max3\n slt\t$v0, $a0, $a1\n bnezl\t$v0, .Lc\n move\t$a0, $a1\n.Lc:\n slt\t$v0, $a0, $a2\n bnezl\t$v0, .L18\n move\t$a0, $a2\n.L18:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function max3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `max3` — benchmark function synthetic:max3:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:max3:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tslt\tv0,a0,a2\n 10:\tbnezl\tv0,18 \n 14:\tmove\ta0,a2\n 18:\tjr\tra\n 1c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ff3fefc9295fb039/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 max3\n\n\nContents of section .text:\n 0000 0085102a 54400001 00a02021 0086102a ...*T@.... !...*\n 0010 54400001 00c02021 03e00008 00801021 T@.... !.......!\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name max3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:max3:ido7.1","sym":"max3","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int max3(int a,int b,int c){ int m=a>b?a:b; return m>c?m:c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a1,a0\n 4:\tbeqz\tat,14 \n 8:\tmove\tv0,a1\n c:\tb\t14 \n 10:\tmove\tv0,a0\n 14:\tslt\tat,a2,v0\n 18:\tbeqz\tat,28 \n 1c:\tmove\tv1,a2\n 20:\tjr\tra\n 24:\tnop\n 28:\tjr\tra\n 2c:\tmove\tv0,v1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000030 max3\n\n\nContents of section .text:\n 0000 00a4082a 10200003 00a01025 10000001 ...*. .....%....\n 0010 00801025 00c2082a 10200003 00c01825 ...%...*. .....%\n 0020 03e00008 00000000 03e00008 00601025 .............`.%\nContents of section .options:\n 0000 01200000 00000000 8000007e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000c 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08020000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000030 20200001 00000001 .......0 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 66336665 66633932 39356662 ef-ff3fefc9295fb\n 0130 3033392f 7265662e 63006d61 78330000 039/ref.c.max3..\n 0140 6d617833 00000000 00000000 00000001 max3............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000c 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 max3(s32 a0, s32 a1, s32 a2) {\n if (a1 < a0) a1 = a0;\n if (a2 < a1) {\n return a1;\n } else {\n return a2;\n }\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":3,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 max3(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_v0;\n\n var_v0 = arg1;\n if (arg1 < arg0) {\n var_v0 = arg0;\n }\n if (arg2 < var_v0) {\n return var_v0;\n }\n return arg2;\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":3,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":9,"maxScore":14,"ratio":0.6428571428571429,"kinds":{"insert":2,"delete":3,"replace":0,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `max3` — benchmark function synthetic:max3:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel max3\n slt\t$at, $a1, $a0\n beqz\t$at, .L14\n move\t$v0, $a1\n b\t.L14\n move\t$v0, $a0\n.L14:\n slt\t$at, $a2, $v0\n beqz\t$at, .L28\n move\t$v1, $a2\n jr\t$ra\n nop\n.L28:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function max3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `max3` — benchmark function synthetic:max3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:max3:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a1,a0\n 4:\tbeqz\tat,14 \n 8:\tmove\tv0,a1\n c:\tb\t14 \n 10:\tmove\tv0,a0\n 14:\tslt\tat,a2,v0\n 18:\tbeqz\tat,28 \n 1c:\tmove\tv1,a2\n 20:\tjr\tra\n 24:\tnop\n 28:\tjr\tra\n 2c:\tmove\tv0,v1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000030 max3\n\n\nContents of section .text:\n 0000 00a4082a 10200003 00a01025 10000001 ...*. .....%....\n 0010 00801025 00c2082a 10200003 00c01825 ...%...*. .....%\n 0020 03e00008 00000000 03e00008 00601025 .............`.%\nContents of section .options:\n 0000 01200000 00000000 8000007e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000c 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08020000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000030 20200001 00000001 .......0 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 66336665 66633932 39356662 ef-ff3fefc9295fb\n 0130 3033392f 7265662e 63006d61 78330000 039/ref.c.max3..\n 0140 6d617833 00000000 00000000 00000001 max3............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000c 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name max3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:max3:mwcc_242_81","sym":"max3","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int max3(int a,int b,int c){ int m=a>b?a:b; return m>c?m:c; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tble c \n 8:\tmr r4,r3\n c:\tcmpw r4,r5\n 10:\tble 18 \n 14:\tmr r5,r4\n 18:\tmr r3,r5\n 1c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 max3\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 max3\n\n\nContents of section .text:\n 0000 7c032000 40810008 7c641b78 7c042800 |. .@...|d.x|.(.\n 0010 40810008 7c852378 7ca32b78 4e800020 @...|.#x|.+xN.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 max3(s32 a0, s32 a1, s32 a2) {\n if (a0 > a1) a1 = a0;\n if (a1 > a2) a2 = a1;\n return a2;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 max3(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r4;\n s32 var_r5;\n\n var_r4 = arg1;\n var_r5 = arg2;\n if (arg0 > var_r4) {\n var_r4 = arg0;\n }\n if (var_r4 > var_r5) {\n var_r5 = var_r4;\n }\n return var_r5;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `max3` — benchmark function synthetic:max3:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel max3\n cmpw r3,r4\n ble .Lc\n mr r4,r3\n.Lc:\n cmpw r4,r5\n ble .L18\n mr r5,r4\n.L18:\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function max3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `max3` — benchmark function synthetic:max3:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:max3:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tble c \n 8:\tmr r4,r3\n c:\tcmpw r4,r5\n 10:\tble 18 \n 14:\tmr r5,r4\n 18:\tmr r3,r5\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 max3\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 max3\n\n\nContents of section .text:\n 0000 7c032000 40810008 7c641b78 7c042800 |. .@...|d.x|.(.\n 0010 40810008 7c852378 7ca32b78 4e800020 @...|.#x|.+xN.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name max3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxarr:agbcc","sym":"maxarr","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int maxarr(int *a,int n){ int m=a[0],i; for(i=1;im)m=a[i]; return m; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmaxarr\n\t.type\t maxarr,function\n\t.thumb_func\nmaxarr:\n\tldr\tr3, [r0]\n\tcmp\tr1, #0x1\n\tble\t.L4\t@cond_branch\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, r3\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r2, #0\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t maxarr,.Lfe1-maxarr\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 maxarr(s32 * a0, u32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 <= 1) {\n v1 = *a0;\n } else {\n v1 = *a0;\n v0 = a0 + 1;\n v2 = a1 - 1;\n do {\n if (*v0 > v1) v1 = *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":5,"maxScore":17,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":1,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 maxarr(s32 *arg0, s32 arg1) {\n s32 *var_r0;\n s32 temp_r2;\n s32 var_r1;\n s32 var_r3;\n\n var_r3 = *arg0;\n if (arg1 > 1) {\n var_r0 = arg0 + 4;\n var_r1 = arg1 - 1;\n do {\n temp_r2 = *var_r0;\n if (temp_r2 > var_r3) {\n var_r3 = temp_r2;\n }\n var_r0 += 4;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n return var_r3;\n}\n","score":2,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":15,"ratio":0.13333333333333333,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxarr` — benchmark function synthetic:maxarr:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmaxarr\n\t.type\t maxarr,function\n\t.thumb_func\nmaxarr:\n\tldr\tr3, [r0]\n\tcmp\tr1, #0x1\n\tble\t.L4\t@cond_branch\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, r3\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r2, #0\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t maxarr,.Lfe1-maxarr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxarr` — benchmark function synthetic:maxarr:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxarr:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmaxarr\n\t.type\t maxarr,function\n\t.thumb_func\nmaxarr:\n\tldr\tr3, [r0]\n\tcmp\tr1, #0x1\n\tble\t.L4\t@cond_branch\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, r3\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r2, #0\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t maxarr,.Lfe1-maxarr\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxarr # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxarr:gcc2.7.2kmc","sym":"maxarr","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int maxarr(int *a,int n){ int m=a[0],i; for(i=1;im)m=a[i]; return m; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\ta3,0(a0)\n 4:\tli\ta2,1\n 8:\tslt\tv0,a2,a1\n c:\tbeqz\tv0,38 \n 10:\tnop\n 14:\taddiu\ta0,a0,4\n 18:\tlw\tv1,0(a0)\n 1c:\tslt\tv0,a3,v1\n 20:\tbnezl\tv0,28 \n 24:\tmove\ta3,v1\n 28:\taddiu\ta2,a2,1\n 2c:\tslt\tv0,a2,a1\n 30:\tbnez\tv0,18 \n 34:\taddiu\ta0,a0,4\n 38:\tjr\tra\n 3c:\tmove\tv0,a3\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-653435ff52bb9ff8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 maxarr\n\n\nContents of section .text:\n 0000 8c870000 24060001 00c5102a 1040000a ....$......*.@..\n 0010 00000000 24840004 8c830000 00e3102a ....$..........*\n 0020 54400001 00603821 24c60001 00c5102a T@...`8!$......*\n 0030 1440fff9 24840004 03e00008 00e01021 .@..$..........!\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'maxarr' — lift: cannot lift 'maxarr': unmodelled control transfer 'bnezl' at 0x20 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlw\ta3,0(a0) */\n/* 4:\tli\ta2,1 */\n/* 8:\tslt\tv0,a2,a1 */\n/* c:\tbeqz\tv0,38 */\n/* 10:\tnop */\n/* 14:\taddiu\ta0,a0,4 */\n/* 18:\tlw\tv1,0(a0) */\n/* 1c:\tslt\tv0,a3,v1 */\n/* 20:\tbnezl\tv0,28 */\n/* 24:\tmove\ta3,v1 */\n/* 28:\taddiu\ta2,a2,1 */\n/* 2c:\tslt\tv0,a2,a1 */\n/* 30:\tbnez\tv0,18 */\n/* 34:\taddiu\ta0,a0,4 */\n/* 38:\tjr\tra */\n/* 3c:\tmove\tv0,a3 */\nvoid maxarr(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'maxarr': unmodelled control transfer 'bnezl' at 0x20 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":24,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'maxarr': unmodelled control transfer 'bnezl' at 0x20 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 maxarr(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 temp_v1;\n s32 var_a2;\n s32 var_a3;\n\n var_a3 = *arg0;\n var_a2 = 1;\n if (arg1 > 1) {\n var_a0 = arg0 + 4;\n do {\n temp_v1 = *var_a0;\n if (var_a3 < temp_v1) {\n var_a3 = temp_v1;\n }\n var_a2 += 1;\n var_a0 += 4;\n } while (var_a2 < arg1);\n }\n return var_a3;\n}\n","score":7,"maxScore":18,"compileErrors":null,"breakdown":{"insert":2,"delete":3,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":7,"maxScore":18,"ratio":0.3888888888888889,"kinds":{"insert":2,"delete":3,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxarr` — benchmark function synthetic:maxarr:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel maxarr\n lw\t$a3, 0($a0)\n li\t$a2, 1\n slt\t$v0, $a2, $a1\n beqz\t$v0, .L38\n nop\n addiu\t$a0, $a0, 4\n.L18:\n lw\t$v1, 0($a0)\n slt\t$v0, $a3, $v1\n bnezl\t$v0, .L28\n move\t$a3, $v1\n.L28:\n addiu\t$a2, $a2, 1\n slt\t$v0, $a2, $a1\n bnez\t$v0, .L18\n addiu\t$a0, $a0, 4\n.L38:\n jr\t$ra\n move\t$v0, $a3\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxarr` — benchmark function synthetic:maxarr:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxarr:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\ta3,0(a0)\n 4:\tli\ta2,1\n 8:\tslt\tv0,a2,a1\n c:\tbeqz\tv0,38 \n 10:\tnop\n 14:\taddiu\ta0,a0,4\n 18:\tlw\tv1,0(a0)\n 1c:\tslt\tv0,a3,v1\n 20:\tbnezl\tv0,28 \n 24:\tmove\ta3,v1\n 28:\taddiu\ta2,a2,1\n 2c:\tslt\tv0,a2,a1\n 30:\tbnez\tv0,18 \n 34:\taddiu\ta0,a0,4\n 38:\tjr\tra\n 3c:\tmove\tv0,a3\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-653435ff52bb9ff8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 maxarr\n\n\nContents of section .text:\n 0000 8c870000 24060001 00c5102a 1040000a ....$......*.@..\n 0010 00000000 24840004 8c830000 00e3102a ....$..........*\n 0020 54400001 00603821 24c60001 00c5102a T@...`8!$......*\n 0030 1440fff9 24840004 03e00008 00e01021 .@..$..........!\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxarr:ido7.1","sym":"maxarr","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int maxarr(int *a,int n){ int m=a[0],i; for(i=1;im)m=a[i]; return m; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslti\tat,a1,2\n 4:\tlw\tv1,0(a0)\n 8:\tbnez\tat,b8 \n c:\tli\tv0,1\n 10:\taddiu\ta3,a1,-1\n 14:\tandi\ta3,a3,0x3\n 18:\tbeqz\ta3,4c \n 1c:\taddiu\tt0,a3,1\n 20:\tsll\tt6,v0,0x2\n 24:\taddu\ta2,a0,t6\n 28:\tlw\ta3,0(a2)\n 2c:\taddiu\tv0,v0,1\n 30:\tslt\tat,v1,a3\n 34:\tbeqz\tat,40 \n 38:\tnop\n 3c:\tmove\tv1,a3\n 40:\tbne\tt0,v0,28 \n 44:\taddiu\ta2,a2,4\n 48:\tbeq\tv0,a1,b8 \n 4c:\tsll\tt7,v0,0x2\n 50:\tsll\tt8,a1,0x2\n 54:\taddu\tt0,t8,a0\n 58:\taddu\ta2,a0,t7\n 5c:\tlw\ta3,0(a2)\n 60:\tslt\tat,v1,a3\n 64:\tbeqzl\tat,74 \n 68:\tlw\tv0,4(a2)\n 6c:\tmove\tv1,a3\n 70:\tlw\tv0,4(a2)\n 74:\tslt\tat,v1,v0\n 78:\tbeqzl\tat,88 \n 7c:\tlw\tv0,8(a2)\n 80:\tmove\tv1,v0\n 84:\tlw\tv0,8(a2)\n 88:\tslt\tat,v1,v0\n 8c:\tbeqzl\tat,9c \n 90:\tlw\tv0,12(a2)\n 94:\tmove\tv1,v0\n 98:\tlw\tv0,12(a2)\n 9c:\taddiu\ta2,a2,16\n a0:\tslt\tat,v1,v0\n a4:\tbeqz\tat,b0 \n a8:\tnop\n ac:\tmove\tv1,v0\n b0:\tbnel\ta2,t0,60 \n b4:\tlw\ta3,0(a2)\n b8:\tjr\tra\n bc:\tmove\tv0,v1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000c0 .text\n00000000 g F .text\t000000c0 maxarr\n\n\nContents of section .text:\n 0000 28a10002 8c830000 1420002b 24020001 (........ .+$...\n 0010 24a7ffff 30e70003 10e0000c 24e80001 $...0.......$...\n 0020 00027080 008e3021 8cc70000 24420001 ..p...0!....$B..\n 0030 0067082a 10200002 00000000 00e01825 .g.*. .........%\n 0040 1502fff9 24c60004 1045001b 00027880 ....$....E....x.\n 0050 0005c080 03044021 008f3021 8cc70000 ......@!..0!....\n 0060 0067082a 50200003 8cc20004 00e01825 .g.*P .........%\n 0070 8cc20004 0062082a 50200003 8cc20008 .....b.*P ......\n 0080 00401825 8cc20008 0062082a 50200003 .@.%.....b.*P ..\n 0090 8cc2000c 00401825 8cc2000c 24c60010 .....@.%....$...\n 00a0 0062082a 10200002 00000000 00401825 .b.*. .......@.%\n 00b0 54c8ffeb 8cc70000 03e00008 00601025 T............`.%\nContents of section .options:\n 0000 01200000 00000000 8100c1fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c1fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000030 00000008 00000228 p......0.......(\n 0010 00000005 00000370 00000001 00000230 .......p.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 00000038 000002d8 ...........8....\n 0040 00000008 00000310 00000001 00000318 ................\n 0050 00000000 00000000 00000001 00000360 ...............`\n 0060 08080808 08020000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000c0 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d36 35333433 35666635 ps-ref-653435ff5\n 0130 32626239 6666382f 7265662e 63006d61 2bb9ff8/ref.c.ma\n 0140 78617272 00000000 6d617861 72720000 xarr....maxarr..\n 0150 00000000 00000001 00000000 00000035 ...............5\n 0160 00000000 00000004 00000000 00000030 ...............0\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000006 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'maxarr' — lift: cannot lift 'maxarr': unmodelled control transfer 'beqzl' at 0x64 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tslti\tat,a1,2 */\n/* 4:\tlw\tv1,0(a0) */\n/* 8:\tbnez\tat,b8 */\n/* c:\tli\tv0,1 */\n/* 10:\taddiu\ta3,a1,-1 */\n/* 14:\tandi\ta3,a3,0x3 */\n/* 18:\tbeqz\ta3,4c */\n/* 1c:\taddiu\tt0,a3,1 */\n/* 20:\tsll\tt6,v0,0x2 */\n/* 24:\taddu\ta2,a0,t6 */\n/* 28:\tlw\ta3,0(a2) */\n/* 2c:\taddiu\tv0,v0,1 */\n/* 30:\tslt\tat,v1,a3 */\n/* 34:\tbeqz\tat,40 */\n/* 38:\tnop */\n/* 3c:\tmove\tv1,a3 */\n/* 40:\tbne\tt0,v0,28 */\n/* 44:\taddiu\ta2,a2,4 */\n/* 48:\tbeq\tv0,a1,b8 */\n/* 4c:\tsll\tt7,v0,0x2 */\n/* 50:\tsll\tt8,a1,0x2 */\n/* 54:\taddu\tt0,t8,a0 */\n/* 58:\taddu\ta2,a0,t7 */\n/* 5c:\tlw\ta3,0(a2) */\n/* 60:\tslt\tat,v1,a3 */\n/* 64:\tbeqzl\tat,74 */\n/* 68:\tlw\tv0,4(a2) */\n/* 6c:\tmove\tv1,a3 */\n/* 70:\tlw\tv0,4(a2) */\n/* 74:\tslt\tat,v1,v0 */\n/* 78:\tbeqzl\tat,88 */\n/* 7c:\tlw\tv0,8(a2) */\n/* 80:\tmove\tv1,v0 */\n/* 84:\tlw\tv0,8(a2) */\n/* 88:\tslt\tat,v1,v0 */\n/* 8c:\tbeqzl\tat,9c */\n/* 90:\tlw\tv0,12(a2) */\n/* 94:\tmove\tv1,v0 */\n/* 98:\tlw\tv0,12(a2) */\n/* 9c:\taddiu\ta2,a2,16 */\n/* a0:\tslt\tat,v1,v0 */\n/* a4:\tbeqz\tat,b0 */\n/* a8:\tnop */\n/* ac:\tmove\tv1,v0 */\n/* b0:\tbnel\ta2,t0,60 */\n/* b4:\tlw\ta3,0(a2) */\n/* b8:\tjr\tra */\n/* bc:\tmove\tv0,v1 */\nvoid maxarr(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'maxarr': unmodelled control transfer 'beqzl' at 0x64 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":56,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'maxarr': unmodelled control transfer 'beqzl' at 0x64 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 maxarr(s32 *arg0, s32 arg1) {\n s32 *var_a2;\n s32 temp_a3;\n s32 temp_a3_2;\n s32 temp_a3_3;\n s32 temp_v0;\n s32 temp_v0_2;\n s32 temp_v0_3;\n s32 var_v0;\n s32 var_v1;\n void *var_a2_2;\n\n var_v1 = *arg0;\n var_v0 = 1;\n if (arg1 >= 2) {\n temp_a3 = (arg1 - 1) & 3;\n if (temp_a3 != 0) {\n var_a2 = arg0 + (1 * 4);\n do {\n temp_a3_2 = *var_a2;\n var_v0 += 1;\n if (var_v1 < temp_a3_2) {\n var_v1 = temp_a3_2;\n }\n var_a2 += 4;\n } while ((temp_a3 + 1) != var_v0);\n if (var_v0 != arg1) {\n goto block_7;\n }\n } else {\nblock_7:\n var_a2_2 = arg0 + (var_v0 * 4);\n do {\n temp_a3_3 = var_a2_2->unk0;\n if (var_v1 < temp_a3_3) {\n var_v1 = temp_a3_3;\n }\n temp_v0 = var_a2_2->unk4;\n if (var_v1 < temp_v0) {\n var_v1 = temp_v0;\n }\n temp_v0_2 = var_a2_2->unk8;\n if (var_v1 < temp_v0_2) {\n var_v1 = temp_v0_2;\n }\n temp_v0_3 = var_a2_2->unkC;\n var_a2_2 += 0x10;\n if (var_v1 < temp_v0_3) {\n var_v1 = temp_v0_3;\n }\n } while (var_a2_2 != ((arg1 * 4) + arg0));\n }\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":88,"lines":54,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 35: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 39: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 43: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 47: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 48: Bad operand type for += or -="]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxarr` — benchmark function synthetic:maxarr:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel maxarr\n slti\t$at, $a1, 2\n lw\t$v1, 0($a0)\n bnez\t$at, .Lb8\n li\t$v0, 1\n addiu\t$a3, $a1, -1\n andi\t$a3, $a3, 0x3\n beqz\t$a3, .L4c\n addiu\t$t0, $a3, 1\n sll\t$t6, $v0, 0x2\n addu\t$a2, $a0, $t6\n.L28:\n lw\t$a3, 0($a2)\n addiu\t$v0, $v0, 1\n slt\t$at, $v1, $a3\n beqz\t$at, .L40\n nop\n move\t$v1, $a3\n.L40:\n bne\t$t0, $v0, .L28\n addiu\t$a2, $a2, 4\n beq\t$v0, $a1, .Lb8\n.L4c:\n sll\t$t7, $v0, 0x2\n sll\t$t8, $a1, 0x2\n addu\t$t0, $t8, $a0\n addu\t$a2, $a0, $t7\n lw\t$a3, 0($a2)\n.L60:\n slt\t$at, $v1, $a3\n beqzl\t$at, .L74\n lw\t$v0, 4($a2)\n move\t$v1, $a3\n lw\t$v0, 4($a2)\n.L74:\n slt\t$at, $v1, $v0\n beqzl\t$at, .L88\n lw\t$v0, 8($a2)\n move\t$v1, $v0\n lw\t$v0, 8($a2)\n.L88:\n slt\t$at, $v1, $v0\n beqzl\t$at, .L9c\n lw\t$v0, 12($a2)\n move\t$v1, $v0\n lw\t$v0, 12($a2)\n.L9c:\n addiu\t$a2, $a2, 16\n slt\t$at, $v1, $v0\n beqz\t$at, .Lb0\n nop\n move\t$v1, $v0\n.Lb0:\n bnel\t$a2, $t0, .L60\n lw\t$a3, 0($a2)\n.Lb8:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxarr` — benchmark function synthetic:maxarr:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxarr:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslti\tat,a1,2\n 4:\tlw\tv1,0(a0)\n 8:\tbnez\tat,b8 \n c:\tli\tv0,1\n 10:\taddiu\ta3,a1,-1\n 14:\tandi\ta3,a3,0x3\n 18:\tbeqz\ta3,4c \n 1c:\taddiu\tt0,a3,1\n 20:\tsll\tt6,v0,0x2\n 24:\taddu\ta2,a0,t6\n 28:\tlw\ta3,0(a2)\n 2c:\taddiu\tv0,v0,1\n 30:\tslt\tat,v1,a3\n 34:\tbeqz\tat,40 \n 38:\tnop\n 3c:\tmove\tv1,a3\n 40:\tbne\tt0,v0,28 \n 44:\taddiu\ta2,a2,4\n 48:\tbeq\tv0,a1,b8 \n 4c:\tsll\tt7,v0,0x2\n 50:\tsll\tt8,a1,0x2\n 54:\taddu\tt0,t8,a0\n 58:\taddu\ta2,a0,t7\n 5c:\tlw\ta3,0(a2)\n 60:\tslt\tat,v1,a3\n 64:\tbeqzl\tat,74 \n 68:\tlw\tv0,4(a2)\n 6c:\tmove\tv1,a3\n 70:\tlw\tv0,4(a2)\n 74:\tslt\tat,v1,v0\n 78:\tbeqzl\tat,88 \n 7c:\tlw\tv0,8(a2)\n 80:\tmove\tv1,v0\n 84:\tlw\tv0,8(a2)\n 88:\tslt\tat,v1,v0\n 8c:\tbeqzl\tat,9c \n 90:\tlw\tv0,12(a2)\n 94:\tmove\tv1,v0\n 98:\tlw\tv0,12(a2)\n 9c:\taddiu\ta2,a2,16\n a0:\tslt\tat,v1,v0\n a4:\tbeqz\tat,b0 \n a8:\tnop\n ac:\tmove\tv1,v0\n b0:\tbnel\ta2,t0,60 \n b4:\tlw\ta3,0(a2)\n b8:\tjr\tra\n bc:\tmove\tv0,v1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000c0 .text\n00000000 g F .text\t000000c0 maxarr\n\n\nContents of section .text:\n 0000 28a10002 8c830000 1420002b 24020001 (........ .+$...\n 0010 24a7ffff 30e70003 10e0000c 24e80001 $...0.......$...\n 0020 00027080 008e3021 8cc70000 24420001 ..p...0!....$B..\n 0030 0067082a 10200002 00000000 00e01825 .g.*. .........%\n 0040 1502fff9 24c60004 1045001b 00027880 ....$....E....x.\n 0050 0005c080 03044021 008f3021 8cc70000 ......@!..0!....\n 0060 0067082a 50200003 8cc20004 00e01825 .g.*P .........%\n 0070 8cc20004 0062082a 50200003 8cc20008 .....b.*P ......\n 0080 00401825 8cc20008 0062082a 50200003 .@.%.....b.*P ..\n 0090 8cc2000c 00401825 8cc2000c 24c60010 .....@.%....$...\n 00a0 0062082a 10200002 00000000 00401825 .b.*. .......@.%\n 00b0 54c8ffeb 8cc70000 03e00008 00601025 T............`.%\nContents of section .options:\n 0000 01200000 00000000 8100c1fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c1fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000030 00000008 00000228 p......0.......(\n 0010 00000005 00000370 00000001 00000230 .......p.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 00000038 000002d8 ...........8....\n 0040 00000008 00000310 00000001 00000318 ................\n 0050 00000000 00000000 00000001 00000360 ...............`\n 0060 08080808 08020000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000c0 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d36 35333433 35666635 ps-ref-653435ff5\n 0130 32626239 6666382f 7265662e 63006d61 2bb9ff8/ref.c.ma\n 0140 78617272 00000000 6d617861 72720000 xarr....maxarr..\n 0150 00000000 00000001 00000000 00000035 ...............5\n 0160 00000000 00000004 00000000 00000030 ...............0\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000006 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxarr:mwcc_242_81","sym":"maxarr","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int maxarr(int *a,int n){ int m=a[0],i; for(i=1;im)m=a[i]; return m; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddi r0,r4,-1\n 4:\taddi r5,r3,4\n 8:\tlwz r3,0(r3)\n c:\tmtctr r0\n 10:\tcmpwi r4,1\n 14:\tblelr\n 18:\tlwz r0,0(r5)\n 1c:\tcmpw r0,r3\n 20:\tble 28 \n 24:\tmr r3,r0\n 28:\taddi r5,r5,4\n 2c:\tbdnz 18 \n 30:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000034 maxarr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 maxarr\n\n\nContents of section .text:\n 0000 3804ffff 38a30004 80630000 7c0903a6 8...8....c..|...\n 0010 2c040001 4c810020 80050000 7c001800 ,...L.. ....|...\n 0020 40810008 7c030378 38a50004 4200ffec @...|..x8...B...\n 0030 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000034 00000000 ...4.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned/flip-branch","outcome":"nonmatch","source":"s32 maxarr(s32 * a0, u32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n s32 v3;\n if (a1 <= 1) {\n return *a0;\n } else {\n v2 = a1 + -1;\n v0 = a0 + 1;\n v1 = *a0;\n do {\n if (*v0 <= v1) {\n v3 = v1;\n } else {\n v3 = *v0;\n }\n v1 = v3;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n return v1;\n }\n}\n","score":15,"maxScore":18,"compileErrors":null,"breakdown":{"insert":5,"delete":2,"replace":2,"opMismatch":3,"argMismatch":3},"quality":{"score":100,"lines":24,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void maxarr(s32 *arg0, s32 arg1) {\n s32 *var_r5;\n s32 temp_r0;\n s32 var_ctr;\n s32 var_r3;\n\n var_r5 = arg0 + 4;\n var_r3 = *arg0;\n var_ctr = arg1 - 1;\n if (arg1 > 1) {\n do {\n temp_r0 = *var_r5;\n if (temp_r0 > var_r3) {\n var_r3 = temp_r0;\n }\n var_r5 += 4;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n}\n","score":13,"maxScore":17,"compileErrors":null,"breakdown":{"insert":4,"delete":4,"replace":0,"opMismatch":1,"argMismatch":4},"quality":{"score":100,"lines":19,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":13,"maxScore":17,"ratio":0.7647058823529411,"kinds":{"insert":4,"delete":4,"replace":0,"opMismatch":1,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxarr` — benchmark function synthetic:maxarr:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel maxarr\n addi r0,r4,-1\n addi r5,r3,4\n lwz r3,0(r3)\n mtctr r0\n cmpwi r4,1\n blelr\n.L18:\n lwz r0,0(r5)\n cmpw r0,r3\n ble .L28\n mr r3,r0\n.L28:\n addi r5,r5,4\n bdnz .L18\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxarr` — benchmark function synthetic:maxarr:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxarr:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddi r0,r4,-1\n 4:\taddi r5,r3,4\n 8:\tlwz r3,0(r3)\n c:\tmtctr r0\n 10:\tcmpwi r4,1\n 14:\tblelr\n 18:\tlwz r0,0(r5)\n 1c:\tcmpw r0,r3\n 20:\tble 28 \n 24:\tmr r3,r0\n 28:\taddi r5,r5,4\n 2c:\tbdnz 18 \n 30:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000034 maxarr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 maxarr\n\n\nContents of section .text:\n 0000 3804ffff 38a30004 80630000 7c0903a6 8...8....c..|...\n 0010 2c040001 4c810020 80050000 7c001800 ,...L.. ....|...\n 0020 40810008 7c030378 38a50004 4200ffec @...|..x8...B...\n 0030 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000034 00000000 ...4.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxi:agbcc","sym":"maxi","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int maxi(int a,int b){ return a>b?a:b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmaxi\n\t.type\t maxi,function\n\t.thumb_func\nmaxi:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, r2\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r2, #0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t maxi,.Lfe1-maxi\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 maxi(s32 a0, s32 a1) {\n if (a1 < a0) a1 = a0;\n return a1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 maxi(s32 arg0, s32 arg1) {\n s32 var_r0;\n\n var_r0 = arg1;\n if (var_r0 < arg0) {\n var_r0 = arg0;\n }\n return var_r0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxi` — benchmark function synthetic:maxi:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmaxi\n\t.type\t maxi,function\n\t.thumb_func\nmaxi:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, r2\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r2, #0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t maxi,.Lfe1-maxi\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxi` — benchmark function synthetic:maxi:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxi:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmaxi\n\t.type\t maxi,function\n\t.thumb_func\nmaxi:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, r2\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r2, #0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t maxi,.Lfe1-maxi\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxi # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxi:gcc2.7.2kmc","sym":"maxi","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int maxi(int a,int b){ return a>b?a:b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2d6a658a54f8f1e9/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 maxi\n\n\nContents of section .text:\n 0000 0085102a 54400001 00a02021 03e00008 ...*T@.... !....\n 0010 00801021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'maxi' — lift: cannot lift 'maxi': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tslt\tv0,a0,a1 */\n/* 4:\tbnezl\tv0,c */\n/* 8:\tmove\ta0,a1 */\n/* c:\tjr\tra */\n/* 10:\tmove\tv0,a0 */\n/* \t... */\nvoid maxi(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'maxi': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":14,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'maxi': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 maxi(s32 arg0, s32 arg1) {\n s32 var_a0;\n\n var_a0 = arg0;\n if (var_a0 < arg1) {\n var_a0 = arg1;\n }\n return var_a0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxi` — benchmark function synthetic:maxi:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel maxi\n slt\t$v0, $a0, $a1\n bnezl\t$v0, .Lc\n move\t$a0, $a1\n.Lc:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxi` — benchmark function synthetic:maxi:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxi:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2d6a658a54f8f1e9/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 maxi\n\n\nContents of section .text:\n 0000 0085102a 54400001 00a02021 03e00008 ...*T@.... !....\n 0010 00801021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxi:ido7.1","sym":"maxi","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int maxi(int a,int b){ return a>b?a:b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a1,a0\n 4:\tbeqz\tat,14 \n 8:\tmove\tv1,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c maxi\n\n\nContents of section .text:\n 0000 00a4082a 10200003 00a01825 03e00008 ...*. .....%....\n 0010 00801025 03e00008 00601025 00000000 ...%.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000003e 00000000 . .........>....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003e 00000000 00000000 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 64366136 35386135 34663866 ef-2d6a658a54f8f\n 0130 3165392f 7265662e 63006d61 78690000 1e9/ref.c.maxi..\n 0140 6d617869 00000000 00000000 00000001 maxi............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 maxi(s32 a0, s32 a1) {\n if (a1 < a0) {\n return a0;\n } else {\n return a1;\n }\n}\n","score":2,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 maxi(s32 arg0, s32 arg1) {\n if (arg1 < arg0) {\n return arg0;\n }\n return arg1;\n}\n","score":2,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":7,"ratio":0.2857142857142857,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxi` — benchmark function synthetic:maxi:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel maxi\n slt\t$at, $a1, $a0\n beqz\t$at, .L14\n move\t$v1, $a1\n jr\t$ra\n move\t$v0, $a0\n.L14:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxi` — benchmark function synthetic:maxi:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxi:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a1,a0\n 4:\tbeqz\tat,14 \n 8:\tmove\tv1,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c maxi\n\n\nContents of section .text:\n 0000 00a4082a 10200003 00a01825 03e00008 ...*. .....%....\n 0010 00801025 03e00008 00601025 00000000 ...%.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000003e 00000000 . .........>....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003e 00000000 00000000 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 64366136 35386135 34663866 ef-2d6a658a54f8f\n 0130 3165392f 7265662e 63006d61 78690000 1e9/ref.c.maxi..\n 0140 6d617869 00000000 00000000 00000001 maxi............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxi:mwcc_242_81","sym":"maxi","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int maxi(int a,int b){ return a>b?a:b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tble c \n 8:\tmr r4,r3\n c:\tmr r3,r4\n 10:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 maxi\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 maxi\n\n\nContents of section .text:\n 0000 7c032000 40810008 7c641b78 7c832378 |. .@...|d.x|.#x\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 maxi(s32 a0, s32 a1) {\n if (a0 > a1) a1 = a0;\n return a1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 maxi(s32 arg0, s32 arg1) {\n s32 var_r4;\n\n var_r4 = arg1;\n if (arg0 > var_r4) {\n var_r4 = arg0;\n }\n return var_r4;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxi` — benchmark function synthetic:maxi:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel maxi\n cmpw r3,r4\n ble .Lc\n mr r4,r3\n.Lc:\n mr r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxi` — benchmark function synthetic:maxi:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxi:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tble c \n 8:\tmr r4,r3\n c:\tmr r3,r4\n 10:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 maxi\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 maxi\n\n\nContents of section .text:\n 0000 7c032000 40810008 7c641b78 7c832378 |. .@...|d.x|.#x\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memcpy1:agbcc","sym":"memcpy1","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","memory","store","load"],"loc":1,"refSource":"void memcpy1(u8 *d,u8 *s,int n){ int i; for(i=0;i 0) {\n do {\n arg0[var_r3] = arg1[var_r3];\n var_r3 += 1;\n } while (var_r3 < arg2);\n }\n}\n","score":2,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":10,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":16,"ratio":0.125,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memcpy1` — benchmark function synthetic:memcpy1:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmemcpy1\n\t.type\t memcpy1,function\n\t.thumb_func\nmemcpy1:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tadd\tr4, r1, #0\n\tmov\tr3, #0x0\n\tcmp\tr3, r2\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r5, r3\n\tadd\tr1, r4, r3\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r0]\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r2\n\tblt\t.L6\t@cond_branch\n.L4:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t memcpy1,.Lfe1-memcpy1\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memcpy1(u8*,u8*,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memcpy1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memcpy1` — benchmark function synthetic:memcpy1:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memcpy1:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmemcpy1\n\t.type\t memcpy1,function\n\t.thumb_func\nmemcpy1:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tadd\tr4, r1, #0\n\tmov\tr3, #0x0\n\tcmp\tr3, r2\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r5, r3\n\tadd\tr1, r4, r3\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r0]\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r2\n\tblt\t.L6\t@cond_branch\n.L4:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t memcpy1,.Lfe1-memcpy1\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memcpy1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name memcpy1 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memcpy1:gcc2.7.2kmc","sym":"memcpy1","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","memory","store","load"],"loc":1,"refSource":"void memcpy1(u8 *d,u8 *s,int n){ int i; for(i=0;i:\n 0:\tblez\ta2,24 \n 4:\tnop\n 8:\taddu\ta2,a2,a0\n c:\tlbu\tv0,0(a1)\n 10:\tsb\tv0,0(a0)\n 14:\taddiu\ta0,a0,1\n 18:\tslt\tv0,a0,a2\n 1c:\tbnez\tv0,c \n 20:\taddiu\ta1,a1,1\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\n","ctx":"void memcpy1(u8*,u8*,int);","proto":{"memcpy1":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-820f10aa4bda9e53/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c memcpy1\n\n\nContents of section .text:\n 0000 18c00008 00000000 00c43021 90a20000 ..........0!....\n 0010 a0820000 24840001 0086102a 1440fffb ....$......*.@..\n 0020 24a50001 03e00008 00000000 00000000 $...............\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"void memcpy1(u32 a0, u32 a1, u8 * a2, u32 a3) {\n u8 * v0;\n u8 * v1;\n if (a3 > 0) {\n v0 = a2;\n v1 = (u8 *)a1;\n do {\n *v1 = *v0;\n v1 = v1 + 1;\n v0 = v0 + 1;\n } while (v1 < a3 + a1);\n a0 = v1 < a3 + a1;\n }\n return;\n}\n","score":7,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":2,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":15,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void memcpy1(u8 *arg0, u8 *arg1, s32 arg2) {\n u8 *temp_a2;\n u8 *var_a0;\n u8 *var_a1;\n\n var_a0 = arg0;\n var_a1 = arg1;\n if (arg2 > 0) {\n temp_a2 = &var_a0[arg2];\n do {\n *var_a0 = *var_a1;\n var_a0 += 1;\n var_a1 += 1;\n } while ((s32) var_a0 < (s32) temp_a2);\n }\n}\n","score":1,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":15,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":1,"maxScore":11,"ratio":0.09090909090909091,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memcpy1` — benchmark function synthetic:memcpy1:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel memcpy1\n blez\t$a2, .L24\n nop\n addu\t$a2, $a2, $a0\n.Lc:\n lbu\t$v0, 0($a1)\n sb\t$v0, 0($a0)\n addiu\t$a0, $a0, 1\n slt\t$v0, $a0, $a2\n bnez\t$v0, .Lc\n addiu\t$a1, $a1, 1\n.L24:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memcpy1(u8*,u8*,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memcpy1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memcpy1` — benchmark function synthetic:memcpy1:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memcpy1:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta2,24 \n 4:\tnop\n 8:\taddu\ta2,a2,a0\n c:\tlbu\tv0,0(a1)\n 10:\tsb\tv0,0(a0)\n 14:\taddiu\ta0,a0,1\n 18:\tslt\tv0,a0,a2\n 1c:\tbnez\tv0,c \n 20:\taddiu\ta1,a1,1\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-820f10aa4bda9e53/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c memcpy1\n\n\nContents of section .text:\n 0000 18c00008 00000000 00c43021 90a20000 ..........0!....\n 0010 a0820000 24840001 0086102a 1440fffb ....$......*.@..\n 0020 24a50001 03e00008 00000000 00000000 $...............\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memcpy1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name memcpy1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memcpy1:ido7.1","sym":"memcpy1","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","memory","store","load"],"loc":1,"refSource":"void memcpy1(u8 *d,u8 *s,int n){ int i; for(i=0;i:\n 0:\tblez\ta2,70 \n 4:\tmove\tv0,zero\n 8:\tandi\tt1,a2,0x3\n c:\tbeqz\tt1,38 \n 10:\tmove\tt0,t1\n 14:\tmove\tv1,a0\n 18:\tmove\ta3,a1\n 1c:\tlbu\tt6,0(a3)\n 20:\taddiu\tv0,v0,1\n 24:\taddiu\tv1,v1,1\n 28:\taddiu\ta3,a3,1\n 2c:\tbne\tt0,v0,1c \n 30:\tsb\tt6,-1(v1)\n 34:\tbeq\tv0,a2,70 \n 38:\taddu\tv1,a0,v0\n 3c:\taddu\ta3,a1,v0\n 40:\tlbu\tt7,0(a3)\n 44:\taddiu\tv0,v0,4\n 48:\taddiu\tv1,v1,4\n 4c:\tsb\tt7,-4(v1)\n 50:\tlbu\tt8,1(a3)\n 54:\taddiu\ta3,a3,4\n 58:\tsb\tt8,-3(v1)\n 5c:\tlbu\tt9,-2(a3)\n 60:\tsb\tt9,-2(v1)\n 64:\tlbu\tt2,-1(a3)\n 68:\tbne\tv0,a2,40 \n 6c:\tsb\tt2,-1(v1)\n 70:\tjr\tra\n 74:\tnop\n\t...\n","ctx":"void memcpy1(u8*,u8*,int);","proto":{"memcpy1":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 memcpy1\n\n\nContents of section .text:\n 0000 18c0001b 00001025 30c90003 1120000a .......%0.... ..\n 0010 01204025 00801821 00a03821 90ee0000 . @%...!..8!....\n 0020 24420001 24630001 24e70001 1502fffb $B..$c..$.......\n 0030 a06effff 1046000e 00821821 00a23821 .n...F.....!..8!\n 0040 90ef0000 24420004 24630004 a06ffffc ....$B..$c...o..\n 0050 90f80001 24e70004 a078fffd 90f9fffe ....$....x......\n 0060 a079fffe 90eaffff 1446fff5 a06affff .y.......F...j..\n 0070 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c7fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c7fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000004 000001e8 p...............\n 0010 00000005 0000032c 00000001 000001ec .......,........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000038 00000294 .......P...8....\n 0040 00000008 000002cc 00000001 000002d4 ................\n 0050 00000000 00000000 00000001 0000031c ................\n 0060 08080802 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000078 20200001 00000001 .......x ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 32306631 30616134 62646139 ef-820f10aa4bda9\n 0130 6535332f 7265662e 63006d65 6d637079 e53/ref.c.memcpy\n 0140 31000000 6d656d63 70793100 00000000 1...memcpy1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000001e 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000004 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'memcpy1' — lift: cannot lift 'memcpy1': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tblez\ta2,70 */\n/* 4:\tmove\tv0,zero */\n/* 8:\tandi\tt1,a2,0x3 */\n/* c:\tbeqz\tt1,38 */\n/* 10:\tmove\tt0,t1 */\n/* 14:\tmove\tv1,a0 */\n/* 18:\tmove\ta3,a1 */\n/* 1c:\tlbu\tt6,0(a3) */\n/* 20:\taddiu\tv0,v0,1 */\n/* 24:\taddiu\tv1,v1,1 */\n/* 28:\taddiu\ta3,a3,1 */\n/* 2c:\tbne\tt0,v0,1c */\n/* 30:\tsb\tt6,-1(v1) */\n/* 34:\tbeq\tv0,a2,70 */\n/* 38:\taddu\tv1,a0,v0 */\n/* 3c:\taddu\ta3,a1,v0 */\n/* 40:\tlbu\tt7,0(a3) */\n/* 44:\taddiu\tv0,v0,4 */\n/* 48:\taddiu\tv1,v1,4 */\n/* 4c:\tsb\tt7,-4(v1) */\n/* 50:\tlbu\tt8,1(a3) */\n/* 54:\taddiu\ta3,a3,4 */\n/* 58:\tsb\tt8,-3(v1) */\n/* 5c:\tlbu\tt9,-2(a3) */\n/* 60:\tsb\tt9,-2(v1) */\n/* 64:\tlbu\tt2,-1(a3) */\n/* 68:\tbne\tv0,a2,40 */\n/* 6c:\tsb\tt2,-1(v1) */\n/* 70:\tjr\tra */\n/* 74:\tnop */\n/* \t... */\nvoid memcpy1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'memcpy1': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":39,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'memcpy1': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void memcpy1(u8 *arg0, u8 *arg1, s32 arg2) {\n s32 temp_t1;\n s32 var_v0;\n u8 *var_a3;\n u8 *var_a3_2;\n u8 *var_v1;\n u8 *var_v1_2;\n u8 temp_t6;\n u8 temp_t8;\n\n var_v0 = 0;\n if (arg2 > 0) {\n temp_t1 = arg2 & 3;\n if (temp_t1 != 0) {\n var_v1 = arg0;\n var_a3 = arg1;\n do {\n temp_t6 = *var_a3;\n var_v0 += 1;\n var_v1 += 1;\n var_a3 += 1;\n var_v1->unk-1 = temp_t6;\n } while (temp_t1 != var_v0);\n if (var_v0 != arg2) {\n goto block_5;\n }\n } else {\nblock_5:\n var_v1_2 = &arg0[var_v0];\n var_a3_2 = &arg1[var_v0];\n do {\n var_v0 += 4;\n var_v1_2 += 4;\n var_v1_2->unk-4 = (u8) var_a3_2->unk0;\n temp_t8 = var_a3_2->unk1;\n var_a3_2 += 4;\n var_v1_2->unk-3 = temp_t8;\n var_v1_2->unk-2 = (u8) var_a3_2->unk-2;\n var_v1_2->unk-1 = (u8) var_a3_2->unk-1;\n } while (var_v0 != arg2);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":86,"lines":42,"gotos":1,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 23: Syntax Error","cfe: Error: /cand.c, line 35: Syntax Error","cfe: Error: /cand.c, line 38: Syntax Error","cfe: Error: /cand.c, line 39: Syntax Error","cfe: Error: /cand.c, line 40: Syntax Error"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memcpy1` — benchmark function synthetic:memcpy1:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel memcpy1\n blez\t$a2, .L70\n move\t$v0, $zero\n andi\t$t1, $a2, 0x3\n beqz\t$t1, .L38\n move\t$t0, $t1\n move\t$v1, $a0\n move\t$a3, $a1\n.L1c:\n lbu\t$t6, 0($a3)\n addiu\t$v0, $v0, 1\n addiu\t$v1, $v1, 1\n addiu\t$a3, $a3, 1\n bne\t$t0, $v0, .L1c\n sb\t$t6, -1($v1)\n beq\t$v0, $a2, .L70\n.L38:\n addu\t$v1, $a0, $v0\n addu\t$a3, $a1, $v0\n.L40:\n lbu\t$t7, 0($a3)\n addiu\t$v0, $v0, 4\n addiu\t$v1, $v1, 4\n sb\t$t7, -4($v1)\n lbu\t$t8, 1($a3)\n addiu\t$a3, $a3, 4\n sb\t$t8, -3($v1)\n lbu\t$t9, -2($a3)\n sb\t$t9, -2($v1)\n lbu\t$t2, -1($a3)\n bne\t$v0, $a2, .L40\n sb\t$t2, -1($v1)\n.L70:\n jr\t$ra\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memcpy1(u8*,u8*,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memcpy1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memcpy1` — benchmark function synthetic:memcpy1:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memcpy1:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta2,70 \n 4:\tmove\tv0,zero\n 8:\tandi\tt1,a2,0x3\n c:\tbeqz\tt1,38 \n 10:\tmove\tt0,t1\n 14:\tmove\tv1,a0\n 18:\tmove\ta3,a1\n 1c:\tlbu\tt6,0(a3)\n 20:\taddiu\tv0,v0,1\n 24:\taddiu\tv1,v1,1\n 28:\taddiu\ta3,a3,1\n 2c:\tbne\tt0,v0,1c \n 30:\tsb\tt6,-1(v1)\n 34:\tbeq\tv0,a2,70 \n 38:\taddu\tv1,a0,v0\n 3c:\taddu\ta3,a1,v0\n 40:\tlbu\tt7,0(a3)\n 44:\taddiu\tv0,v0,4\n 48:\taddiu\tv1,v1,4\n 4c:\tsb\tt7,-4(v1)\n 50:\tlbu\tt8,1(a3)\n 54:\taddiu\ta3,a3,4\n 58:\tsb\tt8,-3(v1)\n 5c:\tlbu\tt9,-2(a3)\n 60:\tsb\tt9,-2(v1)\n 64:\tlbu\tt2,-1(a3)\n 68:\tbne\tv0,a2,40 \n 6c:\tsb\tt2,-1(v1)\n 70:\tjr\tra\n 74:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 memcpy1\n\n\nContents of section .text:\n 0000 18c0001b 00001025 30c90003 1120000a .......%0.... ..\n 0010 01204025 00801821 00a03821 90ee0000 . @%...!..8!....\n 0020 24420001 24630001 24e70001 1502fffb $B..$c..$.......\n 0030 a06effff 1046000e 00821821 00a23821 .n...F.....!..8!\n 0040 90ef0000 24420004 24630004 a06ffffc ....$B..$c...o..\n 0050 90f80001 24e70004 a078fffd 90f9fffe ....$....x......\n 0060 a079fffe 90eaffff 1446fff5 a06affff .y.......F...j..\n 0070 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c7fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c7fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000004 000001e8 p...............\n 0010 00000005 0000032c 00000001 000001ec .......,........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000038 00000294 .......P...8....\n 0040 00000008 000002cc 00000001 000002d4 ................\n 0050 00000000 00000000 00000001 0000031c ................\n 0060 08080802 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000078 20200001 00000001 .......x ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 32306631 30616134 62646139 ef-820f10aa4bda9\n 0130 6535332f 7265662e 63006d65 6d637079 e53/ref.c.memcpy\n 0140 31000000 6d656d63 70793100 00000000 1...memcpy1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000001e 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000004 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memcpy1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name memcpy1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memcpy1:mwcc_242_81","sym":"memcpy1","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","memory","store","load"],"loc":1,"refSource":"void memcpy1(u8 *d,u8 *s,int n){ int i; for(i=0;i:\n 0:\tcmpwi r5,0\n 4:\tli r8,0\n 8:\tblelr\n c:\tcmpwi r5,8\n 10:\taddi r6,r5,-8\n 14:\tble 7c \n 18:\taddi r0,r6,7\n 1c:\tsrwi r0,r0,3\n 20:\tmtctr r0\n 24:\tcmpwi r6,0\n 28:\tble 7c \n 2c:\tadd r6,r4,r8\n 30:\tadd r7,r3,r8\n 34:\tlbz r0,0(r6)\n 38:\taddi r8,r8,8\n 3c:\tstb r0,0(r7)\n 40:\tlbz r0,1(r6)\n 44:\tstb r0,1(r7)\n 48:\tlbz r0,2(r6)\n 4c:\tstb r0,2(r7)\n 50:\tlbz r0,3(r6)\n 54:\tstb r0,3(r7)\n 58:\tlbz r0,4(r6)\n 5c:\tstb r0,4(r7)\n 60:\tlbz r0,5(r6)\n 64:\tstb r0,5(r7)\n 68:\tlbz r0,6(r6)\n 6c:\tstb r0,6(r7)\n 70:\tlbz r0,7(r6)\n 74:\tstb r0,7(r7)\n 78:\tbdnz 2c \n 7c:\tsubf r0,r8,r5\n 80:\tadd r4,r4,r8\n 84:\tadd r3,r3,r8\n 88:\tmtctr r0\n 8c:\tcmpw r8,r5\n 90:\tbgelr\n 94:\tlbz r0,0(r4)\n 98:\taddi r4,r4,1\n 9c:\tstb r0,0(r3)\n a0:\taddi r3,r3,1\n a4:\tbdnz 94 \n a8:\tblr\n","ctx":"void memcpy1(u8*,u8*,int);","proto":{"memcpy1":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000ac memcpy1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 memcpy1\n\n\nContents of section .text:\n 0000 2c050000 39000000 4c810020 2c050008 ,...9...L.. ,...\n 0010 38c5fff8 40810068 38060007 5400e8fe 8...@..h8...T...\n 0020 7c0903a6 2c060000 40810054 7cc44214 |...,...@..T|.B.\n 0030 7ce34214 88060000 39080008 98070000 |.B.....9.......\n 0040 88060001 98070001 88060002 98070002 ................\n 0050 88060003 98070003 88060004 98070004 ................\n 0060 88060005 98070005 88060006 98070006 ................\n 0070 88060007 98070007 4200ffb4 7c082850 ........B...|.(P\n 0080 7c844214 7c634214 7c0903a6 7c082800 |.B.|cB.|...|.(.\n 0090 4c800020 88040000 38840001 98030000 L.. ....8.......\n 00a0 38630001 4200fff0 4e800020 8c..B...N.. \nContents of section .mwcats.text:\n 0000 020000ac 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"void memcpy1(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n s32 v1;\n u8 * v2;\n u8 * v3;\n s32 v4;\n if (a2 > 0) {\n if (a2 <= 8) {\n v0 = 0;\n } else {\n v0 = 0;\n for (v1 = a2 + -8 + 7 >> 3; v1 != 0; v1 = v1 - 1) {\n *(u8 *)(a0 + v0) = *(u8 *)(a1 + v0);\n ((u8 *)(a0 + v0))[1] = ((u8 *)(a1 + v0))[1];\n ((u8 *)(a0 + v0))[2] = ((u8 *)(a1 + v0))[2];\n ((u8 *)(a0 + v0))[3] = ((u8 *)(a1 + v0))[3];\n ((u8 *)(a0 + v0))[4] = ((u8 *)(a1 + v0))[4];\n ((u8 *)(a0 + v0))[5] = ((u8 *)(a1 + v0))[5];\n ((u8 *)(a0 + v0))[6] = ((u8 *)(a1 + v0))[6];\n ((u8 *)(a0 + v0))[7] = ((u8 *)(a1 + v0))[7];\n v0 = v0 + 8;\n }\n }\n if (v0 < a2) {\n v4 = a2 - v0;\n v2 = (u8 *)(a1 + v0);\n v3 = (u8 *)(a0 + v0);\n do {\n *v3 = *v2;\n v2 = v2 + 1;\n v3 = v3 + 1;\n v4 = v4 - 1;\n } while (v4 != 0);\n return;\n } else {\n return;\n }\n } else {\n return;\n }\n}\n","score":80,"maxScore":91,"compileErrors":null,"breakdown":{"insert":48,"delete":3,"replace":2,"opMismatch":4,"argMismatch":23},"quality":{"score":80,"lines":41,"gotos":0,"casts":18,"unkGlue":0,"rawMem":2,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void memcpy1(u8 *arg0, u8 *arg1, s32 arg2) {\n s32 temp_r6;\n s32 var_ctr_2;\n s32 var_r8;\n u32 var_ctr;\n u8 *temp_r6_2;\n u8 *temp_r7;\n u8 *var_r3;\n u8 *var_r4;\n u8 temp_r0;\n u8 temp_r0_2;\n\n var_r8 = 0;\n if (arg2 > 0) {\n temp_r6 = arg2 - 8;\n if (arg2 > 8) {\n var_ctr = (u32) (temp_r6 + 7) >> 3U;\n if (temp_r6 > 0) {\n do {\n temp_r6_2 = &arg1[var_r8];\n temp_r7 = &arg0[var_r8];\n temp_r0 = temp_r6_2->unk0;\n var_r8 += 8;\n temp_r7->unk0 = temp_r0;\n temp_r7->unk1 = (u8) temp_r6_2->unk1;\n temp_r7->unk2 = (u8) temp_r6_2->unk2;\n temp_r7->unk3 = (u8) temp_r6_2->unk3;\n temp_r7->unk4 = (u8) temp_r6_2->unk4;\n temp_r7->unk5 = (u8) temp_r6_2->unk5;\n temp_r7->unk6 = (u8) temp_r6_2->unk6;\n temp_r7->unk7 = (u8) temp_r6_2->unk7;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r4 = &arg1[var_r8];\n var_r3 = &arg0[var_r8];\n var_ctr_2 = arg2 - var_r8;\n if (var_r8 < arg2) {\n do {\n temp_r0_2 = *var_r4;\n var_r4 += 1;\n *var_r3 = temp_r0_2;\n var_r3 += 1;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":9,"quality":{"score":88,"lines":48,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class","# Error: ^^"]},"gapSize":{"decompiler":"asmlift","score":80,"maxScore":91,"ratio":0.8791208791208791,"kinds":{"insert":48,"delete":3,"replace":2,"opMismatch":4,"argMismatch":23}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memcpy1` — benchmark function synthetic:memcpy1:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel memcpy1\n cmpwi r5,0\n li r8,0\n blelr\n cmpwi r5,8\n addi r6,r5,-8\n ble .L7c\n addi r0,r6,7\n srwi r0,r0,3\n mtctr r0\n cmpwi r6,0\n ble .L7c\n.L2c:\n add r6,r4,r8\n add r7,r3,r8\n lbz r0,0(r6)\n addi r8,r8,8\n stb r0,0(r7)\n lbz r0,1(r6)\n stb r0,1(r7)\n lbz r0,2(r6)\n stb r0,2(r7)\n lbz r0,3(r6)\n stb r0,3(r7)\n lbz r0,4(r6)\n stb r0,4(r7)\n lbz r0,5(r6)\n stb r0,5(r7)\n lbz r0,6(r6)\n stb r0,6(r7)\n lbz r0,7(r6)\n stb r0,7(r7)\n bdnz .L2c\n.L7c:\n subf r0,r8,r5\n add r4,r4,r8\n add r3,r3,r8\n mtctr r0\n cmpw r8,r5\n bgelr\n.L94:\n lbz r0,0(r4)\n addi r4,r4,1\n stb r0,0(r3)\n addi r3,r3,1\n bdnz .L94\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memcpy1(u8*,u8*,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memcpy1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memcpy1` — benchmark function synthetic:memcpy1:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memcpy1:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r5,0\n 4:\tli r8,0\n 8:\tblelr\n c:\tcmpwi r5,8\n 10:\taddi r6,r5,-8\n 14:\tble 7c \n 18:\taddi r0,r6,7\n 1c:\tsrwi r0,r0,3\n 20:\tmtctr r0\n 24:\tcmpwi r6,0\n 28:\tble 7c \n 2c:\tadd r6,r4,r8\n 30:\tadd r7,r3,r8\n 34:\tlbz r0,0(r6)\n 38:\taddi r8,r8,8\n 3c:\tstb r0,0(r7)\n 40:\tlbz r0,1(r6)\n 44:\tstb r0,1(r7)\n 48:\tlbz r0,2(r6)\n 4c:\tstb r0,2(r7)\n 50:\tlbz r0,3(r6)\n 54:\tstb r0,3(r7)\n 58:\tlbz r0,4(r6)\n 5c:\tstb r0,4(r7)\n 60:\tlbz r0,5(r6)\n 64:\tstb r0,5(r7)\n 68:\tlbz r0,6(r6)\n 6c:\tstb r0,6(r7)\n 70:\tlbz r0,7(r6)\n 74:\tstb r0,7(r7)\n 78:\tbdnz 2c \n 7c:\tsubf r0,r8,r5\n 80:\tadd r4,r4,r8\n 84:\tadd r3,r3,r8\n 88:\tmtctr r0\n 8c:\tcmpw r8,r5\n 90:\tbgelr\n 94:\tlbz r0,0(r4)\n 98:\taddi r4,r4,1\n 9c:\tstb r0,0(r3)\n a0:\taddi r3,r3,1\n a4:\tbdnz 94 \n a8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000ac memcpy1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 memcpy1\n\n\nContents of section .text:\n 0000 2c050000 39000000 4c810020 2c050008 ,...9...L.. ,...\n 0010 38c5fff8 40810068 38060007 5400e8fe 8...@..h8...T...\n 0020 7c0903a6 2c060000 40810054 7cc44214 |...,...@..T|.B.\n 0030 7ce34214 88060000 39080008 98070000 |.B.....9.......\n 0040 88060001 98070001 88060002 98070002 ................\n 0050 88060003 98070003 88060004 98070004 ................\n 0060 88060005 98070005 88060006 98070006 ................\n 0070 88060007 98070007 4200ffb4 7c082850 ........B...|.(P\n 0080 7c844214 7c634214 7c0903a6 7c082800 |.B.|cB.|...|.(.\n 0090 4c800020 88040000 38840001 98030000 L.. ....8.......\n 00a0 38630001 4200fff0 4e800020 8c..B...N.. \nContents of section .mwcats.text:\n 0000 020000ac 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memcpy1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name memcpy1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memset1:agbcc","sym":"memset1","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for","memory","store"],"loc":1,"refSource":"void memset1(u8 *p,int n,u8 v){ int i; for(i=0;i 0) {\n do {\n arg0[var_r3] = arg2;\n var_r3 += 1;\n } while (var_r3 < arg1);\n }\n}\n","score":2,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":10,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":15,"ratio":0.13333333333333333,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memset1` — benchmark function synthetic:memset1:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmemset1\n\t.type\t memset1,function\n\t.thumb_func\nmemset1:\n\tpush\t{r4, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r4, r3\n\tstrb\tr2, [r0]\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r1\n\tblt\t.L6\t@cond_branch\n.L4:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t memset1,.Lfe1-memset1\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memset1(u8*,int,u8);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memset1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memset1` — benchmark function synthetic:memset1:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memset1:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmemset1\n\t.type\t memset1,function\n\t.thumb_func\nmemset1:\n\tpush\t{r4, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r4, r3\n\tstrb\tr2, [r0]\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r1\n\tblt\t.L6\t@cond_branch\n.L4:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t memset1,.Lfe1-memset1\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memset1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name memset1 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memset1:gcc2.7.2kmc","sym":"memset1","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for","memory","store"],"loc":1,"refSource":"void memset1(u8 *p,int n,u8 v){ int i; for(i=0;i:\n 0:\tblez\ta1,20 \n 4:\tnop\n 8:\taddu\ta1,a1,a0\n c:\tsb\ta2,0(a0)\n 10:\taddiu\ta0,a0,1\n 14:\tslt\tv0,a0,a1\n 18:\tbnezl\tv0,10 \n 1c:\tsb\ta2,0(a0)\n 20:\tjr\tra\n 24:\tnop\n\t...\n","ctx":"void memset1(u8*,int,u8);","proto":{"memset1":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-30ed35db3fd63330/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 memset1\n\n\nContents of section .text:\n 0000 18a00007 00000000 00a42821 a0860000 ..........(!....\n 0010 24840001 0085102a 5440fffd a0860000 $......*T@......\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'memset1' — lift: cannot lift 'memset1': unmodelled control transfer 'bnezl' at 0x18 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tblez\ta1,20 */\n/* 4:\tnop */\n/* 8:\taddu\ta1,a1,a0 */\n/* c:\tsb\ta2,0(a0) */\n/* 10:\taddiu\ta0,a0,1 */\n/* 14:\tslt\tv0,a0,a1 */\n/* 18:\tbnezl\tv0,10 */\n/* 1c:\tsb\ta2,0(a0) */\n/* 20:\tjr\tra */\n/* 24:\tnop */\n/* \t... */\nvoid memset1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'memset1': unmodelled control transfer 'bnezl' at 0x18 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":19,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'memset1': unmodelled control transfer 'bnezl' at 0x18 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void memset1(u8 *arg0, s32 arg1, u8 arg2) {\n u8 *temp_a1;\n u8 *var_a0;\n\n var_a0 = arg0;\n if (arg1 > 0) {\n temp_a1 = &var_a0[arg1];\n do {\n *var_a0 = arg2;\n var_a0 += 1;\n } while ((s32) var_a0 < (s32) temp_a1);\n }\n}\n","score":1,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":12,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":1,"maxScore":10,"ratio":0.1,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memset1` — benchmark function synthetic:memset1:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel memset1\n blez\t$a1, .L20\n nop\n addu\t$a1, $a1, $a0\n sb\t$a2, 0($a0)\n.L10:\n addiu\t$a0, $a0, 1\n slt\t$v0, $a0, $a1\n bnezl\t$v0, .L10\n sb\t$a2, 0($a0)\n.L20:\n jr\t$ra\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memset1(u8*,int,u8);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memset1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memset1` — benchmark function synthetic:memset1:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memset1:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta1,20 \n 4:\tnop\n 8:\taddu\ta1,a1,a0\n c:\tsb\ta2,0(a0)\n 10:\taddiu\ta0,a0,1\n 14:\tslt\tv0,a0,a1\n 18:\tbnezl\tv0,10 \n 1c:\tsb\ta2,0(a0)\n 20:\tjr\tra\n 24:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-30ed35db3fd63330/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 memset1\n\n\nContents of section .text:\n 0000 18a00007 00000000 00a42821 a0860000 ..........(!....\n 0010 24840001 0085102a 5440fffd a0860000 $......*T@......\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memset1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name memset1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memset1:ido7.1","sym":"memset1","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for","memory","store"],"loc":1,"refSource":"void memset1(u8 *p,int n,u8 v){ int i; for(i=0;i:\n 0:\tsw\ta2,8(sp)\n 4:\tandi\ta2,a2,0xff\n 8:\tblez\ta1,54 \n c:\tmove\tv0,zero\n 10:\tandi\tt0,a1,0x3\n 14:\tbeqz\tt0,34 \n 18:\tmove\ta3,t0\n 1c:\tmove\tv1,a0\n 20:\taddiu\tv0,v0,1\n 24:\tsb\ta2,0(v1)\n 28:\tbne\ta3,v0,20 \n 2c:\taddiu\tv1,v1,1\n 30:\tbeq\tv0,a1,54 \n 34:\taddu\tv1,a0,v0\n 38:\taddiu\tv0,v0,4\n 3c:\tsb\ta2,0(v1)\n 40:\tsb\ta2,1(v1)\n 44:\tsb\ta2,2(v1)\n 48:\tsb\ta2,3(v1)\n 4c:\tbne\tv0,a1,38 \n 50:\taddiu\tv1,v1,4\n 54:\tjr\tra\n 58:\tnop\n 5c:\tnop\n","ctx":"void memset1(u8*,int,u8);","proto":{"memset1":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t0000005c memset1\n\n\nContents of section .text:\n 0000 afa60008 30c600ff 18a00012 00001025 ....0..........%\n 0010 30a80003 11000007 01003825 00801821 0.........8%...!\n 0020 24420001 a0660000 14e2fffd 24630001 $B...f......$c..\n 0030 10450008 00821821 24420004 a0660000 .E.....!$B...f..\n 0040 a0660001 a0660002 a0660003 1445fffa .f...f...f...E..\n 0050 24630004 03e00008 00000000 00000000 $c..............\nContents of section .options:\n 0000 01200000 00000000 a00001fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000017 00000004 000001c8 p...............\n 0010 00000005 0000030c 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000038 00000274 .......0...8...t\n 0040 00000008 000002ac 00000001 000002b4 ................\n 0050 00000000 00000000 00000001 000002fc ................\n 0060 08080400 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000005c 20200001 00000001 .......\\ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 30656433 35646233 66643633 ef-30ed35db3fd63\n 0130 3333302f 7265662e 63006d65 6d736574 330/ref.c.memset\n 0140 31000000 6d656d73 65743100 00000000 1...memset1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000017 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000003 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'memset1' — lift: cannot lift 'memset1': branch to 0x34 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta2,8(sp) */\n/* 4:\tandi\ta2,a2,0xff */\n/* 8:\tblez\ta1,54 */\n/* c:\tmove\tv0,zero */\n/* 10:\tandi\tt0,a1,0x3 */\n/* 14:\tbeqz\tt0,34 */\n/* 18:\tmove\ta3,t0 */\n/* 1c:\tmove\tv1,a0 */\n/* 20:\taddiu\tv0,v0,1 */\n/* 24:\tsb\ta2,0(v1) */\n/* 28:\tbne\ta3,v0,20 */\n/* 2c:\taddiu\tv1,v1,1 */\n/* 30:\tbeq\tv0,a1,54 */\n/* 34:\taddu\tv1,a0,v0 */\n/* 38:\taddiu\tv0,v0,4 */\n/* 3c:\tsb\ta2,0(v1) */\n/* 40:\tsb\ta2,1(v1) */\n/* 44:\tsb\ta2,2(v1) */\n/* 48:\tsb\ta2,3(v1) */\n/* 4c:\tbne\tv0,a1,38 */\n/* 50:\taddiu\tv1,v1,4 */\n/* 54:\tjr\tra */\n/* 58:\tnop */\n/* 5c:\tnop */\nvoid memset1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'memset1': branch to 0x34 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'memset1': branch to 0x34 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void memset1(u8 *arg0, s32 arg1, u8 arg2) {\n s32 temp_t0;\n s32 var_v0;\n u8 *var_v1;\n u8 *var_v1_2;\n u8 temp_a2;\n\n temp_a2 = arg2 & 0xFF;\n var_v0 = 0;\n if (arg1 > 0) {\n temp_t0 = arg1 & 3;\n if (temp_t0 != 0) {\n var_v1 = arg0;\n do {\n var_v0 += 1;\n *var_v1 = temp_a2;\n var_v1 += 1;\n } while (temp_t0 != var_v0);\n if (var_v0 != arg1) {\n goto block_5;\n }\n } else {\nblock_5:\n var_v1_2 = &arg0[var_v0];\n do {\n var_v0 += 4;\n var_v1_2->unk0 = temp_a2;\n var_v1_2->unk1 = temp_a2;\n var_v1_2->unk2 = temp_a2;\n var_v1_2->unk3 = temp_a2;\n var_v1_2 += 4;\n } while (var_v0 != arg1);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":88,"lines":34,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 28: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 29: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 30: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 31: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memset1` — benchmark function synthetic:memset1:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel memset1\n sw\t$a2, 8($sp)\n andi\t$a2, $a2, 0xff\n blez\t$a1, .L54\n move\t$v0, $zero\n andi\t$t0, $a1, 0x3\n beqz\t$t0, .L34\n move\t$a3, $t0\n move\t$v1, $a0\n.L20:\n addiu\t$v0, $v0, 1\n sb\t$a2, 0($v1)\n bne\t$a3, $v0, .L20\n addiu\t$v1, $v1, 1\n beq\t$v0, $a1, .L54\n.L34:\n addu\t$v1, $a0, $v0\n.L38:\n addiu\t$v0, $v0, 4\n sb\t$a2, 0($v1)\n sb\t$a2, 1($v1)\n sb\t$a2, 2($v1)\n sb\t$a2, 3($v1)\n bne\t$v0, $a1, .L38\n addiu\t$v1, $v1, 4\n.L54:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memset1(u8*,int,u8);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memset1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memset1` — benchmark function synthetic:memset1:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memset1:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tandi\ta2,a2,0xff\n 8:\tblez\ta1,54 \n c:\tmove\tv0,zero\n 10:\tandi\tt0,a1,0x3\n 14:\tbeqz\tt0,34 \n 18:\tmove\ta3,t0\n 1c:\tmove\tv1,a0\n 20:\taddiu\tv0,v0,1\n 24:\tsb\ta2,0(v1)\n 28:\tbne\ta3,v0,20 \n 2c:\taddiu\tv1,v1,1\n 30:\tbeq\tv0,a1,54 \n 34:\taddu\tv1,a0,v0\n 38:\taddiu\tv0,v0,4\n 3c:\tsb\ta2,0(v1)\n 40:\tsb\ta2,1(v1)\n 44:\tsb\ta2,2(v1)\n 48:\tsb\ta2,3(v1)\n 4c:\tbne\tv0,a1,38 \n 50:\taddiu\tv1,v1,4\n 54:\tjr\tra\n 58:\tnop\n 5c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t0000005c memset1\n\n\nContents of section .text:\n 0000 afa60008 30c600ff 18a00012 00001025 ....0..........%\n 0010 30a80003 11000007 01003825 00801821 0.........8%...!\n 0020 24420001 a0660000 14e2fffd 24630001 $B...f......$c..\n 0030 10450008 00821821 24420004 a0660000 .E.....!$B...f..\n 0040 a0660001 a0660002 a0660003 1445fffa .f...f...f...E..\n 0050 24630004 03e00008 00000000 00000000 $c..............\nContents of section .options:\n 0000 01200000 00000000 a00001fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000017 00000004 000001c8 p...............\n 0010 00000005 0000030c 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000038 00000274 .......0...8...t\n 0040 00000008 000002ac 00000001 000002b4 ................\n 0050 00000000 00000000 00000001 000002fc ................\n 0060 08080400 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000005c 20200001 00000001 .......\\ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 30656433 35646233 66643633 ef-30ed35db3fd63\n 0130 3333302f 7265662e 63006d65 6d736574 330/ref.c.memset\n 0140 31000000 6d656d73 65743100 00000000 1...memset1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000017 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000003 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memset1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name memset1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memset1:mwcc_242_81","sym":"memset1","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for","memory","store"],"loc":1,"refSource":"void memset1(u8 *p,int n,u8 v){ int i; for(i=0;i:\n 0:\tcmpwi r4,0\n 4:\tli r7,0\n 8:\tblelr\n c:\tcmpwi r4,8\n 10:\taddi r6,r4,-8\n 14:\tble 58 \n 18:\taddi r0,r6,7\n 1c:\tsrwi r0,r0,3\n 20:\tmtctr r0\n 24:\tcmpwi r6,0\n 28:\tble 58 \n 2c:\tadd r6,r3,r7\n 30:\taddi r7,r7,8\n 34:\tstb r5,0(r6)\n 38:\tstb r5,1(r6)\n 3c:\tstb r5,2(r6)\n 40:\tstb r5,3(r6)\n 44:\tstb r5,4(r6)\n 48:\tstb r5,5(r6)\n 4c:\tstb r5,6(r6)\n 50:\tstb r5,7(r6)\n 54:\tbdnz 2c \n 58:\tsubf r0,r7,r4\n 5c:\tadd r3,r3,r7\n 60:\tmtctr r0\n 64:\tcmpw r7,r4\n 68:\tbgelr\n 6c:\tstb r5,0(r3)\n 70:\taddi r3,r3,1\n 74:\tbdnz 6c \n 78:\tblr\n","ctx":"void memset1(u8*,int,u8);","proto":{"memset1":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000007c memset1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 memset1\n\n\nContents of section .text:\n 0000 2c040000 38e00000 4c810020 2c040008 ,...8...L.. ,...\n 0010 38c4fff8 40810044 38060007 5400e8fe 8...@..D8...T...\n 0020 7c0903a6 2c060000 40810030 7cc33a14 |...,...@..0|.:.\n 0030 38e70008 98a60000 98a60001 98a60002 8...............\n 0040 98a60003 98a60004 98a60005 98a60006 ................\n 0050 98a60007 4200ffd8 7c072050 7c633a14 ....B...|. P|c:.\n 0060 7c0903a6 7c072000 4c800020 98a30000 |...|. .L.. ....\n 0070 38630001 4200fff8 4e800020 8c..B...N.. \nContents of section .mwcats.text:\n 0000 0200007c 00000000 ...|.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"void memset1(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n s32 v1;\n u8 * v2;\n s32 v3;\n if (a1 > 0) {\n if (a1 <= 8) {\n v0 = 0;\n } else {\n v0 = 0;\n for (v1 = a1 + -8 + 7 >> 3; v1 != 0; v1 = v1 - 1) {\n *(u8 *)(a0 + v0) = a2;\n ((u8 *)(a0 + v0))[1] = a2;\n ((u8 *)(a0 + v0))[2] = a2;\n ((u8 *)(a0 + v0))[3] = a2;\n ((u8 *)(a0 + v0))[4] = a2;\n ((u8 *)(a0 + v0))[5] = a2;\n ((u8 *)(a0 + v0))[6] = a2;\n ((u8 *)(a0 + v0))[7] = a2;\n v0 = v0 + 8;\n }\n }\n if (v0 < a1) {\n v3 = a1 - v0;\n v2 = (u8 *)(a0 + v0);\n do {\n *v2 = a2;\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n return;\n } else {\n return;\n }\n } else {\n return;\n }\n}\n","score":75,"maxScore":83,"compileErrors":null,"breakdown":{"insert":52,"delete":5,"replace":0,"opMismatch":5,"argMismatch":13},"quality":{"score":84,"lines":38,"gotos":0,"casts":9,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void memset1(u8 *arg0, s32 arg1, u8 arg2) {\n s32 temp_r6;\n s32 var_ctr_2;\n s32 var_r7;\n u32 var_ctr;\n u8 *temp_r6_2;\n u8 *var_r3;\n\n var_r7 = 0;\n if (arg1 > 0) {\n temp_r6 = arg1 - 8;\n if (arg1 > 8) {\n var_ctr = (u32) (temp_r6 + 7) >> 3U;\n if (temp_r6 > 0) {\n do {\n temp_r6_2 = &arg0[var_r7];\n var_r7 += 8;\n temp_r6_2->unk0 = arg2;\n temp_r6_2->unk1 = arg2;\n temp_r6_2->unk2 = arg2;\n temp_r6_2->unk3 = arg2;\n temp_r6_2->unk4 = arg2;\n temp_r6_2->unk5 = arg2;\n temp_r6_2->unk6 = arg2;\n temp_r6_2->unk7 = arg2;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r3 = &arg0[var_r7];\n var_ctr_2 = arg1 - var_r7;\n if (var_r7 < arg1) {\n do {\n *var_r3 = arg2;\n var_r3 += 1;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":8,"quality":{"score":100,"lines":39,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class"]},"gapSize":{"decompiler":"asmlift","score":75,"maxScore":83,"ratio":0.9036144578313253,"kinds":{"insert":52,"delete":5,"replace":0,"opMismatch":5,"argMismatch":13}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memset1` — benchmark function synthetic:memset1:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel memset1\n cmpwi r4,0\n li r7,0\n blelr\n cmpwi r4,8\n addi r6,r4,-8\n ble .L58\n addi r0,r6,7\n srwi r0,r0,3\n mtctr r0\n cmpwi r6,0\n ble .L58\n.L2c:\n add r6,r3,r7\n addi r7,r7,8\n stb r5,0(r6)\n stb r5,1(r6)\n stb r5,2(r6)\n stb r5,3(r6)\n stb r5,4(r6)\n stb r5,5(r6)\n stb r5,6(r6)\n stb r5,7(r6)\n bdnz .L2c\n.L58:\n subf r0,r7,r4\n add r3,r3,r7\n mtctr r0\n cmpw r7,r4\n bgelr\n.L6c:\n stb r5,0(r3)\n addi r3,r3,1\n bdnz .L6c\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memset1(u8*,int,u8);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memset1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memset1` — benchmark function synthetic:memset1:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memset1:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r4,0\n 4:\tli r7,0\n 8:\tblelr\n c:\tcmpwi r4,8\n 10:\taddi r6,r4,-8\n 14:\tble 58 \n 18:\taddi r0,r6,7\n 1c:\tsrwi r0,r0,3\n 20:\tmtctr r0\n 24:\tcmpwi r6,0\n 28:\tble 58 \n 2c:\tadd r6,r3,r7\n 30:\taddi r7,r7,8\n 34:\tstb r5,0(r6)\n 38:\tstb r5,1(r6)\n 3c:\tstb r5,2(r6)\n 40:\tstb r5,3(r6)\n 44:\tstb r5,4(r6)\n 48:\tstb r5,5(r6)\n 4c:\tstb r5,6(r6)\n 50:\tstb r5,7(r6)\n 54:\tbdnz 2c \n 58:\tsubf r0,r7,r4\n 5c:\tadd r3,r3,r7\n 60:\tmtctr r0\n 64:\tcmpw r7,r4\n 68:\tbgelr\n 6c:\tstb r5,0(r3)\n 70:\taddi r3,r3,1\n 74:\tbdnz 6c \n 78:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000007c memset1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 memset1\n\n\nContents of section .text:\n 0000 2c040000 38e00000 4c810020 2c040008 ,...8...L.. ,...\n 0010 38c4fff8 40810044 38060007 5400e8fe 8...@..D8...T...\n 0020 7c0903a6 2c060000 40810030 7cc33a14 |...,...@..0|.:.\n 0030 38e70008 98a60000 98a60001 98a60002 8...............\n 0040 98a60003 98a60004 98a60005 98a60006 ................\n 0050 98a60007 4200ffd8 7c072050 7c633a14 ....B...|. P|c:.\n 0060 7c0903a6 7c072000 4c800020 98a30000 |...|. .L.. ....\n 0070 38630001 4200fff8 4e800020 8c..B...N.. \nContents of section .mwcats.text:\n 0000 0200007c 00000000 ...|.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memset1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name memset1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mergebits:agbcc","sym":"mergebits","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","mask","shift"],"loc":1,"refSource":"unsigned mergebits(unsigned a,unsigned b){ return (a&0xFFFF)|(b<<16); }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmergebits\n\t.type\t mergebits,function\n\t.thumb_func\nmergebits:\n\tldr\tr2, .L3\n\tand\tr2, r2, r0\n\tlsl\tr1, r1, #0x10\n\torr\tr1, r1, r2\n\tadd\tr0, r1, #0\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t mergebits,.Lfe1-mergebits\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 mergebits(u32 a0, u32 a1) {\n return a1 << 16 | 65535 & a0;\n}\n","score":7,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 mergebits(s32 arg0, s32 arg1) {\n return (arg1 << 0x10) | (0xFFFF & arg0);\n}\n","score":7,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":7,"maxScore":9,"ratio":0.7777777777777778,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mergebits` — benchmark function synthetic:mergebits:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmergebits\n\t.type\t mergebits,function\n\t.thumb_func\nmergebits:\n\tldr\tr2, .L3\n\tand\tr2, r2, r0\n\tlsl\tr1, r1, #0x10\n\torr\tr1, r1, r2\n\tadd\tr0, r1, #0\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t mergebits,.Lfe1-mergebits\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mergebits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mergebits` — benchmark function synthetic:mergebits:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mergebits:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmergebits\n\t.type\t mergebits,function\n\t.thumb_func\nmergebits:\n\tldr\tr2, .L3\n\tand\tr2, r2, r0\n\tlsl\tr1, r1, #0x10\n\torr\tr1, r1, r2\n\tadd\tr0, r1, #0\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t mergebits,.Lfe1-mergebits\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mergebits # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mergebits:gcc2.7.2kmc","sym":"mergebits","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","mask","shift"],"loc":1,"refSource":"unsigned mergebits(unsigned a,unsigned b){ return (a&0xFFFF)|(b<<16); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0xffff\n 4:\tsll\tv0,a1,0x10\n 8:\tjr\tra\n c:\tor\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ac9825ba79f7ba68/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 mergebits\n\n\nContents of section .text:\n 0000 3084ffff 00051400 03e00008 00821025 0..............%\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mergebits(u32 a0, u32 a1) {\n return a0 & 65535 | a1 << 16;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mergebits(s32 arg0, s32 arg1) {\n return (arg0 & 0xFFFF) | (arg1 << 0x10);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mergebits` — benchmark function synthetic:mergebits:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mergebits\n andi\t$a0, $a0, 0xffff\n sll\t$v0, $a1, 0x10\n jr\t$ra\n or\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mergebits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mergebits` — benchmark function synthetic:mergebits:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mergebits:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0xffff\n 4:\tsll\tv0,a1,0x10\n 8:\tjr\tra\n c:\tor\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ac9825ba79f7ba68/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 mergebits\n\n\nContents of section .text:\n 0000 3084ffff 00051400 03e00008 00821025 0..............%\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mergebits # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mergebits:ido7.1","sym":"mergebits","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","mask","shift"],"loc":1,"refSource":"unsigned mergebits(unsigned a,unsigned b){ return (a&0xFFFF)|(b<<16); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\tt6,a0,0xffff\n 4:\tsll\tt7,a1,0x10\n 8:\tjr\tra\n c:\tor\tv0,t6,t7\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 mergebits\n\n\nContents of section .text:\n 0000 308effff 00057c00 03e00008 01cf1025 0.....|........%\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002c0 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 0000000c 0000025c 00000001 00000268 .......\\.......h\n 0050 00000000 00000000 00000001 000002b0 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 63393832 35626137 39663762 ef-ac9825ba79f7b\n 0130 6136382f 7265662e 63006d65 72676562 a68/ref.c.mergeb\n 0140 69747300 6d657267 65626974 73000000 its.mergebits...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000004 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mergebits(u32 a0, u32 a1) {\n return a0 & 65535 | a1 << 16;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mergebits(s32 arg0, s32 arg1) {\n return (arg0 & 0xFFFF) | (arg1 << 0x10);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mergebits` — benchmark function synthetic:mergebits:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mergebits\n andi\t$t6, $a0, 0xffff\n sll\t$t7, $a1, 0x10\n jr\t$ra\n or\t$v0, $t6, $t7\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mergebits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mergebits` — benchmark function synthetic:mergebits:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mergebits:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\tt6,a0,0xffff\n 4:\tsll\tt7,a1,0x10\n 8:\tjr\tra\n c:\tor\tv0,t6,t7\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 mergebits\n\n\nContents of section .text:\n 0000 308effff 00057c00 03e00008 01cf1025 0.....|........%\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002c0 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 0000000c 0000025c 00000001 00000268 .......\\.......h\n 0050 00000000 00000000 00000001 000002b0 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 63393832 35626137 39663762 ef-ac9825ba79f7b\n 0130 6136382f 7265662e 63006d65 72676562 a68/ref.c.mergeb\n 0140 69747300 6d657267 65626974 73000000 its.mergebits...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000004 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mergebits # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mergebits:mwcc_242_81","sym":"mergebits","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","mask","shift"],"loc":1,"refSource":"unsigned mergebits(unsigned a,unsigned b){ return (a&0xFFFF)|(b<<16); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmr r0,r3\n 4:\tslwi r3,r4,16\n 8:\trlwimi r3,r0,0,16,31\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 mergebits\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mergebits\n\n\nContents of section .text:\n 0000 7c601b78 5483801e 5003043e 4e800020 |`.xT...P..>N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"s32 mergebits(s32 a0, s32 a1) {\n return ASMLIFT_ERROR(\"unmodelled instruction 'rlwimi'\", a0);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":3,"gotos":0,"casts":0,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: unmodelled instruction 'rlwimi'"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 mergebits(s32 arg0, s32 arg1) {\n return ((arg1 << 0x10) & ~0xFFFF) | (arg0 & 0xFFFF);\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":4,"ratio":0.75,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mergebits` — benchmark function synthetic:mergebits:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mergebits\n mr r0,r3\n slwi r3,r4,16\n rlwimi r3,r0,0,16,31\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mergebits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mergebits` — benchmark function synthetic:mergebits:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mergebits:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmr r0,r3\n 4:\tslwi r3,r4,16\n 8:\trlwimi r3,r0,0,16,31\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 mergebits\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mergebits\n\n\nContents of section .text:\n 0000 7c601b78 5483801e 5003043e 4e800020 |`.xT...P..>N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mergebits # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mini:agbcc","sym":"mini","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int mini(int a,int b){ return a a0) a1 = a0;\n return a1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mini(s32 arg0, s32 arg1) {\n s32 var_r0;\n\n var_r0 = arg1;\n if (var_r0 > arg0) {\n var_r0 = arg0;\n }\n return var_r0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mini` — benchmark function synthetic:mini:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmini\n\t.type\t mini,function\n\t.thumb_func\nmini:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, r2\n\tble\t.L3\t@cond_branch\n\tadd\tr0, r2, #0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t mini,.Lfe1-mini\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mini # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mini` — benchmark function synthetic:mini:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mini:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmini\n\t.type\t mini,function\n\t.thumb_func\nmini:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, r2\n\tble\t.L3\t@cond_branch\n\tadd\tr0, r2, #0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t mini,.Lfe1-mini\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mini # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mini:gcc2.7.2kmc","sym":"mini","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int mini(int a,int b){ return a:\n 0:\tslt\tv0,a1,a0\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-e7fab7b49afd2fe2/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 mini\n\n\nContents of section .text:\n 0000 00a4102a 54400001 00a02021 03e00008 ...*T@.... !....\n 0010 00801021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'mini' — lift: cannot lift 'mini': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tslt\tv0,a1,a0 */\n/* 4:\tbnezl\tv0,c */\n/* 8:\tmove\ta0,a1 */\n/* c:\tjr\tra */\n/* 10:\tmove\tv0,a0 */\n/* \t... */\nvoid mini(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'mini': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":14,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'mini': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mini(s32 arg0, s32 arg1) {\n s32 var_a0;\n\n var_a0 = arg0;\n if (arg1 < var_a0) {\n var_a0 = arg1;\n }\n return var_a0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mini` — benchmark function synthetic:mini:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mini\n slt\t$v0, $a1, $a0\n bnezl\t$v0, .Lc\n move\t$a0, $a1\n.Lc:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mini # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mini` — benchmark function synthetic:mini:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mini:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a1,a0\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-e7fab7b49afd2fe2/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 mini\n\n\nContents of section .text:\n 0000 00a4102a 54400001 00a02021 03e00008 ...*T@.... !....\n 0010 00801021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mini # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mini:ido7.1","sym":"mini","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int mini(int a,int b){ return a:\n 0:\tslt\tat,a0,a1\n 4:\tbeqz\tat,14 \n 8:\tmove\tv1,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c mini\n\n\nContents of section .text:\n 0000 0085082a 10200003 00a01825 03e00008 ...*. .....%....\n 0010 00801025 03e00008 00601025 00000000 ...%.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000003e 00000000 . .........>....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003e 00000000 00000000 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 37666162 37623439 61666432 ef-e7fab7b49afd2\n 0130 6665322f 7265662e 63006d69 6e690000 fe2/ref.c.mini..\n 0140 6d696e69 00000000 00000000 00000001 mini............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 mini(s32 a0, s32 a1) {\n if (a0 < a1) {\n return a0;\n } else {\n return a1;\n }\n}\n","score":2,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 mini(s32 arg0, s32 arg1) {\n if (arg0 < arg1) {\n return arg0;\n }\n return arg1;\n}\n","score":2,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":7,"ratio":0.2857142857142857,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mini` — benchmark function synthetic:mini:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mini\n slt\t$at, $a0, $a1\n beqz\t$at, .L14\n move\t$v1, $a1\n jr\t$ra\n move\t$v0, $a0\n.L14:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mini # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mini` — benchmark function synthetic:mini:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mini:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a0,a1\n 4:\tbeqz\tat,14 \n 8:\tmove\tv1,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c mini\n\n\nContents of section .text:\n 0000 0085082a 10200003 00a01825 03e00008 ...*. .....%....\n 0010 00801025 03e00008 00601025 00000000 ...%.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000003e 00000000 . .........>....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003e 00000000 00000000 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 37666162 37623439 61666432 ef-e7fab7b49afd2\n 0130 6665322f 7265662e 63006d69 6e690000 fe2/ref.c.mini..\n 0140 6d696e69 00000000 00000000 00000001 mini............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mini # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mini:mwcc_242_81","sym":"mini","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int mini(int a,int b){ return a:\n 0:\tcmpw r3,r4\n 4:\tbge c \n 8:\tmr r4,r3\n c:\tmr r3,r4\n 10:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 mini\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mini\n\n\nContents of section .text:\n 0000 7c032000 40800008 7c641b78 7c832378 |. .@...|d.x|.#x\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 mini(s32 a0, s32 a1) {\n if (a0 < a1) a1 = a0;\n return a1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mini(s32 arg0, s32 arg1) {\n s32 var_r4;\n\n var_r4 = arg1;\n if (arg0 < var_r4) {\n var_r4 = arg0;\n }\n return var_r4;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mini` — benchmark function synthetic:mini:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mini\n cmpw r3,r4\n bge .Lc\n mr r4,r3\n.Lc:\n mr r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mini # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mini` — benchmark function synthetic:mini:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mini:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tbge c \n 8:\tmr r4,r3\n c:\tmr r3,r4\n 10:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 mini\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mini\n\n\nContents of section .text:\n 0000 7c032000 40800008 7c641b78 7c832378 |. .@...|d.x|.#x\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mini # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modc:agbcc","sym":"modc","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","signed-mod-const"],"loc":1,"refSource":"int modc(int a){ return a%10; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodc\n\t.type\t modc,function\n\t.thumb_func\nmodc:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t modc,.Lfe1-modc\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 modc(s32 a0) {\n return a0 % 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modc(s32 arg0) {\n return arg0 % 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modc` — benchmark function synthetic:modc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodc\n\t.type\t modc,function\n\t.thumb_func\nmodc:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t modc,.Lfe1-modc\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modc` — benchmark function synthetic:modc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modc:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodc\n\t.type\t modc,function\n\t.thumb_func\nmodc:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t modc,.Lfe1-modc\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name modc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modc:gcc2.7.2kmc","sym":"modc","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","signed-mod-const"],"loc":1,"refSource":"int modc(int a){ return a%10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x6666\n 4:\tori\tv0,v0,0x6667\n 8:\tmult\ta0,v0\n c:\tsra\tv0,a0,0x1f\n 10:\tmfhi\ta1\n 14:\tsra\tv1,a1,0x2\n 18:\tsubu\tv1,v1,v0\n 1c:\tsll\tv0,v1,0x2\n 20:\taddu\tv0,v0,v1\n 24:\tsll\tv0,v0,0x1\n 28:\tjr\tra\n 2c:\tsubu\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-0e37d40ebdc10604/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 modc\n\n\nContents of section .text:\n 0000 3c026666 34426667 00820018 000417c3 <.ff4Bfg........\n 0010 00002810 00051883 00621823 00031080 ..(......b.#....\n 0020 00431021 00021040 03e00008 00821023 .C.!...@.......#\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 modc(s32 a0) {\n return a0 - a0 / 10 * 10;\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modc(s32 arg0) {\n return arg0 % 10;\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modc` — benchmark function synthetic:modc:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modc\n lui\t$v0, 0x6666\n ori\t$v0, $v0, 0x6667\n mult\t$a0, $v0\n sra\t$v0, $a0, 0x1f\n mfhi\t$a1\n sra\t$v1, $a1, 0x2\n subu\t$v1, $v1, $v0\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x1\n jr\t$ra\n subu\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modc` — benchmark function synthetic:modc:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modc:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x6666\n 4:\tori\tv0,v0,0x6667\n 8:\tmult\ta0,v0\n c:\tsra\tv0,a0,0x1f\n 10:\tmfhi\ta1\n 14:\tsra\tv1,a1,0x2\n 18:\tsubu\tv1,v1,v0\n 1c:\tsll\tv0,v1,0x2\n 20:\taddu\tv0,v0,v1\n 24:\tsll\tv0,v0,0x1\n 28:\tjr\tra\n 2c:\tsubu\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-0e37d40ebdc10604/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 modc\n\n\nContents of section .text:\n 0000 3c026666 34426667 00820018 000417c3 <.ff4Bfg........\n 0010 00002810 00051883 00621823 00031080 ..(......b.#....\n 0020 00431021 00021040 03e00008 00821023 .C.!...@.......#\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name modc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modc:ido7.1","sym":"modc","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","signed-mod-const"],"loc":1,"refSource":"int modc(int a){ return a%10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdiv\tzero,a0,at\n 8:\tmfhi\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 modc\n\n\nContents of section .text:\n 0000 2401000a 0081001a 00001010 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 65333764 34306562 64633130 ef-0e37d40ebdc10\n 0130 3630342f 7265662e 63006d6f 64630000 604/ref.c.modc..\n 0140 6d6f6463 00000000 00000000 00000001 modc............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 modc(s32 a0) {\n return a0 % 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modc(s32 arg0) {\n return arg0 % 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modc` — benchmark function synthetic:modc:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modc\n li\t$at, 10\n div\t$zero, $a0, $at\n mfhi\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modc` — benchmark function synthetic:modc:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modc:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdiv\tzero,a0,at\n 8:\tmfhi\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 modc\n\n\nContents of section .text:\n 0000 2401000a 0081001a 00001010 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 65333764 34306562 64633130 ef-0e37d40ebdc10\n 0130 3630342f 7265662e 63006d6f 64630000 604/ref.c.modc..\n 0140 6d6f6463 00000000 00000000 00000001 modc............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name modc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modc:mwcc_242_81","sym":"modc","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","signed-mod-const"],"loc":1,"refSource":"int modc(int a){ return a%10; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,26214\n 4:\taddi r0,r4,26215\n 8:\tmulhw r0,r0,r3\n c:\tsrawi r0,r0,2\n 10:\tsrwi r4,r0,31\n 14:\tadd r0,r0,r4\n 18:\tmulli r0,r0,10\n 1c:\tsubf r3,r0,r3\n 20:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000024 modc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 modc\n\n\nContents of section .text:\n 0000 3c806666 38046667 7c001896 7c001670 <.ff8.fg|...|..p\n 0010 54040ffe 7c002214 1c00000a 7c601850 T...|.\".....|`.P\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 modc(s32 a0) {\n return a0 - a0 / 10 * 10;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modc(s32 arg0) {\n return arg0 % 10;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modc` — benchmark function synthetic:modc:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modc\n lis r4,26214\n addi r0,r4,26215\n mulhw r0,r0,r3\n srawi r0,r0,2\n srwi r4,r0,31\n add r0,r0,r4\n mulli r0,r0,10\n subf r3,r0,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modc` — benchmark function synthetic:modc:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modc:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,26214\n 4:\taddi r0,r4,26215\n 8:\tmulhw r0,r0,r3\n c:\tsrawi r0,r0,2\n 10:\tsrwi r4,r0,31\n 14:\tadd r0,r0,r4\n 18:\tmulli r0,r0,10\n 1c:\tsubf r3,r0,r3\n 20:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000024 modc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 modc\n\n\nContents of section .text:\n 0000 3c806666 38046667 7c001896 7c001670 <.ff8.fg|...|..p\n 0010 54040ffe 7c002214 1c00000a 7c601850 T...|.\".....|`.P\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name modc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modpow2:agbcc","sym":"modpow2","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","signed-mod-pow2"],"loc":1,"refSource":"int modpow2(int a){ return a%16; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodpow2\n\t.type\t modpow2,function\n\t.thumb_func\nmodpow2:\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xf\n.L3:\n\tasr\tr0, r0, #0x4\n\tlsl\tr0, r0, #0x4\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t modpow2,.Lfe1-modpow2\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed/regcopy","outcome":"match","source":"s32 modpow2(s32 a0) {\n s32 v0;\n s32 w0;\n v0 = a0;\n w0 = v0;\n if (w0 < 0) w0 = w0 + 15;\n return a0 - (w0 >> 4 << 4);\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modpow2(s32 arg0) {\n s32 temp_r1;\n s32 var_r0;\n\n var_r0 = arg0;\n temp_r1 = var_r0;\n if (temp_r1 < 0) {\n var_r0 += 0xF;\n }\n return temp_r1 - ((var_r0 >> 4) * 0x10);\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":10,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modpow2` — benchmark function synthetic:modpow2:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodpow2\n\t.type\t modpow2,function\n\t.thumb_func\nmodpow2:\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xf\n.L3:\n\tasr\tr0, r0, #0x4\n\tlsl\tr0, r0, #0x4\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t modpow2,.Lfe1-modpow2\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modpow2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modpow2` — benchmark function synthetic:modpow2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modpow2:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodpow2\n\t.type\t modpow2,function\n\t.thumb_func\nmodpow2:\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xf\n.L3:\n\tasr\tr0, r0, #0x4\n\tlsl\tr0, r0, #0x4\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t modpow2,.Lfe1-modpow2\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name modpow2 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modpow2:gcc2.7.2kmc","sym":"modpow2","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","signed-mod-pow2"],"loc":1,"refSource":"int modpow2(int a){ return a%16; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,c \n 4:\tmove\tv0,a0\n 8:\taddiu\tv0,a0,15\n c:\tsra\tv0,v0,0x4\n 10:\tsll\tv0,v0,0x4\n 14:\tjr\tra\n 18:\tsubu\tv0,a0,v0\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2b24abd884db7bcb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c modpow2\n\n\nContents of section .text:\n 0000 04810002 00801021 2482000f 00021103 .......!$.......\n 0010 00021100 03e00008 00821023 00000000 ...........#....\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed/regcopy","outcome":"match","source":"s32 modpow2(s32 a0) {\n s32 v0;\n s32 w0;\n v0 = a0;\n w0 = v0;\n if (w0 < 0) w0 = w0 + 15;\n return a0 - (w0 >> 4 << 4);\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modpow2(s32 arg0) {\n s32 var_v0;\n\n var_v0 = arg0;\n if (arg0 < 0) {\n var_v0 = arg0 + 0xF;\n }\n return arg0 - ((var_v0 >> 4) * 0x10);\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modpow2` — benchmark function synthetic:modpow2:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modpow2\n bgez\t$a0, .Lc\n move\t$v0, $a0\n addiu\t$v0, $a0, 15\n.Lc:\n sra\t$v0, $v0, 0x4\n sll\t$v0, $v0, 0x4\n jr\t$ra\n subu\t$v0, $a0, $v0\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modpow2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modpow2` — benchmark function synthetic:modpow2:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modpow2:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,c \n 4:\tmove\tv0,a0\n 8:\taddiu\tv0,a0,15\n c:\tsra\tv0,v0,0x4\n 10:\tsll\tv0,v0,0x4\n 14:\tjr\tra\n 18:\tsubu\tv0,a0,v0\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2b24abd884db7bcb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c modpow2\n\n\nContents of section .text:\n 0000 04810002 00801021 2482000f 00021103 .......!$.......\n 0010 00021100 03e00008 00821023 00000000 ...........#....\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name modpow2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modpow2:ido7.1","sym":"modpow2","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","signed-mod-pow2"],"loc":1,"refSource":"int modpow2(int a){ return a%16; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,14 \n 4:\tandi\tv0,a0,0xf\n 8:\tbeqz\tv0,14 \n c:\tnop\n 10:\taddiu\tv0,v0,-16\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c modpow2\n\n\nContents of section .text:\n 0000 04810004 3082000f 10400002 00000000 ....0....@......\n 0010 2442fff0 03e00008 00000000 00000000 $B..............\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 62323461 62643838 34646237 ef-2b24abd884db7\n 0130 6263622f 7265662e 63006d6f 64706f77 bcb/ref.c.modpow\n 0140 32000000 6d6f6470 6f773200 00000000 2...modpow2.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000007 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 modpow2(u32 a0) {\n s32 v0;\n if (a0 >= 0) {\n v0 = a0 & 15;\n } else {\n if ((a0 & 15) == 0) {\n v0 = a0 & 15;\n } else {\n v0 = (a0 & 15) + -16;\n }\n }\n return v0;\n}\n","score":6,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":5,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modpow2(s32 arg0) {\n return arg0 % 16;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modpow2` — benchmark function synthetic:modpow2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modpow2\n bgez\t$a0, .L14\n andi\t$v0, $a0, 0xf\n beqz\t$v0, .L14\n nop\n addiu\t$v0, $v0, -16\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modpow2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modpow2` — benchmark function synthetic:modpow2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modpow2:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,14 \n 4:\tandi\tv0,a0,0xf\n 8:\tbeqz\tv0,14 \n c:\tnop\n 10:\taddiu\tv0,v0,-16\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c modpow2\n\n\nContents of section .text:\n 0000 04810004 3082000f 10400002 00000000 ....0....@......\n 0010 2442fff0 03e00008 00000000 00000000 $B..............\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 62323461 62643838 34646237 ef-2b24abd884db7\n 0130 6263622f 7265662e 63006d6f 64706f77 bcb/ref.c.modpow\n 0140 32000000 6d6f6470 6f773200 00000000 2...modpow2.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000007 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name modpow2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modpow2:mwcc_242_81","sym":"modpow2","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","signed-mod-pow2"],"loc":1,"refSource":"int modpow2(int a){ return a%16; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r3,28\n 4:\tsrwi r3,r3,31\n 8:\tsubf r0,r3,r0\n c:\trotlwi r0,r0,4\n 10:\tadd r3,r0,r3\n 14:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 modpow2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 modpow2\n\n\nContents of section .text:\n 0000 5460e006 54630ffe 7c030050 5400203e T`..Tc..|..PT. >\n 0010 7c601a14 4e800020 |`..N.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 modpow2(u32 a0) {\n return ((a0 << 28) - (a0 >> 31) << 4 | (a0 << 28) - (a0 >> 31) >> 28) + (a0 >> 31);\n}\n","score":6,"maxScore":7,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":3,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 modpow2(u32 arg0) {\n u32 temp_r0;\n u32 temp_r3;\n\n temp_r3 = arg0 >> 0x1FU;\n temp_r0 = (arg0 << 0x1C) - temp_r3;\n return ((temp_r0 << 4) | (temp_r0 >> 0x1CU)) + temp_r3;\n}\n","score":6,"maxScore":7,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":3,"argMismatch":2},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":7,"ratio":0.8571428571428571,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":3,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modpow2` — benchmark function synthetic:modpow2:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modpow2\n slwi r0,r3,28\n srwi r3,r3,31\n subf r0,r3,r0\n rotlwi r0,r0,4\n add r3,r0,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modpow2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modpow2` — benchmark function synthetic:modpow2:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modpow2:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r3,28\n 4:\tsrwi r3,r3,31\n 8:\tsubf r0,r3,r0\n c:\trotlwi r0,r0,4\n 10:\tadd r3,r0,r3\n 14:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 modpow2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 modpow2\n\n\nContents of section .text:\n 0000 5460e006 54630ffe 7c030050 5400203e T`..Tc..|..PT. >\n 0010 7c601a14 4e800020 |`..N.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name modpow2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modv:agbcc","sym":"modv","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","mod-reg","signed"],"loc":1,"refSource":"int modv(int a,int b){ return a%b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodv\n\t.type\t modv,function\n\t.thumb_func\nmodv:\n\tpush\t{lr}\n\tbl\t__modsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t modv,.Lfe1-modv\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 modv(s32 a0, s32 a1) {\n return a0 % a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modv(s32 arg0, s32 arg1) {\n return arg0 % arg1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modv` — benchmark function synthetic:modv:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodv\n\t.type\t modv,function\n\t.thumb_func\nmodv:\n\tpush\t{lr}\n\tbl\t__modsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t modv,.Lfe1-modv\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modv` — benchmark function synthetic:modv:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modv:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodv\n\t.type\t modv,function\n\t.thumb_func\nmodv:\n\tpush\t{lr}\n\tbl\t__modsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t modv,.Lfe1-modv\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name modv # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modv:gcc2.7.2kmc","sym":"modv","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","mod-reg","signed"],"loc":1,"refSource":"int modv(int a,int b){ return a%b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tbnez\ta1,10 \n 8:\tnop\n c:\tbreak\t0x7\n 10:\tli\tat,-1\n 14:\tbne\ta1,at,28 \n 18:\tlui\tat,0x8000\n 1c:\tbne\ta0,at,28 \n 20:\tnop\n 24:\tbreak\t0x6\n 28:\tmfhi\tv0\n 2c:\tjr\tra\n 30:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-8a3ca826933866f6/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 modv\n\n\nContents of section .text:\n 0000 0085001a 14a00002 00000000 0007000d ................\n 0010 2401ffff 14a10004 3c018000 14810002 $.......<.......\n 0020 00000000 0006000d 00001010 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 modv(s32 a0, s32 a1) {\n return a0 % a1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modv(s32 arg0, s32 arg1) {\n return arg0 % arg1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modv` — benchmark function synthetic:modv:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modv\n div\t$zero, $a0, $a1\n bnez\t$a1, .L10\n nop\n break\t0x7\n.L10:\n li\t$at, -1\n bne\t$a1, $at, .L28\n lui\t$at, 0x8000\n bne\t$a0, $at, .L28\n nop\n break\t0x6\n.L28:\n mfhi\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modv` — benchmark function synthetic:modv:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modv:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tbnez\ta1,10 \n 8:\tnop\n c:\tbreak\t0x7\n 10:\tli\tat,-1\n 14:\tbne\ta1,at,28 \n 18:\tlui\tat,0x8000\n 1c:\tbne\ta0,at,28 \n 20:\tnop\n 24:\tbreak\t0x6\n 28:\tmfhi\tv0\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-8a3ca826933866f6/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 modv\n\n\nContents of section .text:\n 0000 0085001a 14a00002 00000000 0007000d ................\n 0010 2401ffff 14a10004 3c018000 14810002 $.......<.......\n 0020 00000000 0006000d 00001010 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name modv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modv:ido7.1","sym":"modv","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","mod-reg","signed"],"loc":1,"refSource":"int modv(int a,int b){ return a%b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tmfhi\tv0\n 8:\tbnez\ta1,14 \n c:\tnop\n 10:\tbreak\t0x7\n 14:\tli\tat,-1\n 18:\tbne\ta1,at,2c \n 1c:\tlui\tat,0x8000\n 20:\tbne\ta0,at,2c \n 24:\tnop\n 28:\tbreak\t0x6\n 2c:\tjr\tra\n 30:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 modv\n\n\nContents of section .text:\n 0000 0085001a 00001010 14a00002 00000000 ................\n 0010 0007000d 2401ffff 14a10004 3c018000 ....$.......<...\n 0020 14810002 00000000 0006000d 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001a8 p...............\n 0010 00000005 000002e8 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000034 00000254 ...........4...T\n 0040 00000008 00000288 00000001 00000290 ................\n 0050 00000000 00000000 00000001 000002d8 ................\n 0060 08030000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000034 20200001 00000001 .......4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 61336361 38323639 33333836 ef-8a3ca82693386\n 0130 3666362f 7265662e 63006d6f 64760000 6f6/ref.c.modv..\n 0140 6d6f6476 00000000 00000000 00000001 modv............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000d 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 modv(s32 a0, s32 a1) {\n return a0 % a1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modv(s32 arg0, s32 arg1) {\n return arg0 % arg1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modv` — benchmark function synthetic:modv:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modv\n div\t$zero, $a0, $a1\n mfhi\t$v0\n bnez\t$a1, .L14\n nop\n break\t0x7\n.L14:\n li\t$at, -1\n bne\t$a1, $at, .L2c\n lui\t$at, 0x8000\n bne\t$a0, $at, .L2c\n nop\n break\t0x6\n.L2c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modv` — benchmark function synthetic:modv:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modv:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tmfhi\tv0\n 8:\tbnez\ta1,14 \n c:\tnop\n 10:\tbreak\t0x7\n 14:\tli\tat,-1\n 18:\tbne\ta1,at,2c \n 1c:\tlui\tat,0x8000\n 20:\tbne\ta0,at,2c \n 24:\tnop\n 28:\tbreak\t0x6\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 modv\n\n\nContents of section .text:\n 0000 0085001a 00001010 14a00002 00000000 ................\n 0010 0007000d 2401ffff 14a10004 3c018000 ....$.......<...\n 0020 14810002 00000000 0006000d 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001a8 p...............\n 0010 00000005 000002e8 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000034 00000254 ...........4...T\n 0040 00000008 00000288 00000001 00000290 ................\n 0050 00000000 00000000 00000001 000002d8 ................\n 0060 08030000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000034 20200001 00000001 .......4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 61336361 38323639 33333836 ef-8a3ca82693386\n 0130 3666362f 7265662e 63006d6f 64760000 6f6/ref.c.modv..\n 0140 6d6f6476 00000000 00000000 00000001 modv............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000d 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name modv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modv:mwcc_242_81","sym":"modv","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","mod-reg","signed"],"loc":1,"refSource":"int modv(int a,int b){ return a%b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivw r0,r3,r4\n 4:\tmullw r0,r0,r4\n 8:\tsubf r3,r0,r3\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 modv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 modv\n\n\nContents of section .text:\n 0000 7c0323d6 7c0021d6 7c601850 4e800020 |.#.|.!.|`.PN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 modv(s32 a0, s32 a1) {\n return a0 - a0 / a1 * a1;\n}\n","score":1,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modv(s32 arg0, s32 arg1) {\n return arg0 % arg1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modv` — benchmark function synthetic:modv:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modv\n divw r0,r3,r4\n mullw r0,r0,r4\n subf r3,r0,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modv` — benchmark function synthetic:modv:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modv:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivw r0,r3,r4\n 4:\tmullw r0,r0,r4\n 8:\tsubf r3,r0,r3\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 modv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 modv\n\n\nContents of section .text:\n 0000 7c0323d6 7c0021d6 7c601850 4e800020 |.#.|.!.|`.PN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name modv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mul:agbcc","sym":"mul","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int mul(int a,int b){ return a*b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmul\n\t.type\t mul,function\n\t.thumb_func\nmul:\n\tmul\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t mul,.Lfe1-mul\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mul(u32 a0, u32 a1) {\n return a0 * a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mul(s32 arg0, s32 arg1) {\n return arg0 * arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mul` — benchmark function synthetic:mul:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmul\n\t.type\t mul,function\n\t.thumb_func\nmul:\n\tmul\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t mul,.Lfe1-mul\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mul` — benchmark function synthetic:mul:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mul:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmul\n\t.type\t mul,function\n\t.thumb_func\nmul:\n\tmul\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t mul,.Lfe1-mul\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mul # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mul:gcc2.7.2kmc","sym":"mul","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int mul(int a,int b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmult\ta0,a1\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-7ecbf07003575a22/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 mul\n\n\nContents of section .text:\n 0000 00000000 00850018 00001012 03e00008 ................\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mul(u32 a0, u32 a1) {\n return a0 * a1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mul(s32 arg0, s32 arg1) {\n return arg0 * arg1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mul` — benchmark function synthetic:mul:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mul\n nop\n mult\t$a0, $a1\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mul` — benchmark function synthetic:mul:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mul:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmult\ta0,a1\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-7ecbf07003575a22/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 mul\n\n\nContents of section .text:\n 0000 00000000 00850018 00001012 03e00008 ................\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mul:ido7.1","sym":"mul","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic"],"loc":1,"refSource":"int mul(int a,int b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmultu\ta0,a1\n 4:\tmflo\tv0\n 8:\tjr\tra\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 mul\n\n\nContents of section .text:\n 0000 00850019 00001012 03e00008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 65636266 30373030 33353735 ef-7ecbf07003575\n 0130 6132322f 7265662e 63006d75 6c000000 a22/ref.c.mul...\n 0140 6d756c00 00000000 00000001 00000000 mul.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000004 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mul(u32 a0, u32 a1) {\n return a0 * a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mul(s32 arg0, s32 arg1) {\n return arg0 * arg1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mul` — benchmark function synthetic:mul:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mul\n multu\t$a0, $a1\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mul` — benchmark function synthetic:mul:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mul:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmultu\ta0,a1\n 4:\tmflo\tv0\n 8:\tjr\tra\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 mul\n\n\nContents of section .text:\n 0000 00850019 00001012 03e00008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 65636266 30373030 33353735 ef-7ecbf07003575\n 0130 6132322f 7265662e 63006d75 6c000000 a22/ref.c.mul...\n 0140 6d756c00 00000000 00000001 00000000 mul.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000004 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mul:mwcc_242_81","sym":"mul","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int mul(int a,int b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmullw r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 mul\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mul\n\n\nContents of section .text:\n 0000 7c6321d6 4e800020 |c!.N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mul(u32 a0, u32 a1) {\n return a0 * a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mul(s32 arg0, s32 arg1) {\n return arg0 * arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mul` — benchmark function synthetic:mul:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mul\n mullw r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mul` — benchmark function synthetic:mul:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mul:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmullw r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 mul\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mul\n\n\nContents of section .text:\n 0000 7c6321d6 4e800020 |c!.N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mulc:agbcc","sym":"mulc","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","strength-reduce"],"loc":1,"refSource":"int mulc(int a){ return a*10; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmulc\n\t.type\t mulc,function\n\t.thumb_func\nmulc:\n\tadd\tr1, r0, #0\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t mulc,.Lfe1-mulc\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mulc(u32 a0) {\n return a0 * 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mulc(s32 arg0) {\n return arg0 * 0xA;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mulc` — benchmark function synthetic:mulc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmulc\n\t.type\t mulc,function\n\t.thumb_func\nmulc:\n\tadd\tr1, r0, #0\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t mulc,.Lfe1-mulc\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mulc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mulc` — benchmark function synthetic:mulc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mulc:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmulc\n\t.type\t mulc,function\n\t.thumb_func\nmulc:\n\tadd\tr1, r0, #0\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t mulc,.Lfe1-mulc\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mulc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mulc:gcc2.7.2kmc","sym":"mulc","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","strength-reduce"],"loc":1,"refSource":"int mulc(int a){ return a*10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x2\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tsll\tv0,v0,0x1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-554a87e2db088449/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 mulc\n\n\nContents of section .text:\n 0000 00041080 00441021 03e00008 00021040 .....D.!.......@\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mulc(u32 a0) {\n return a0 * 10;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mulc(s32 arg0) {\n return arg0 * 0xA;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mulc` — benchmark function synthetic:mulc:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mulc\n sll\t$v0, $a0, 0x2\n addu\t$v0, $v0, $a0\n jr\t$ra\n sll\t$v0, $v0, 0x1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mulc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mulc` — benchmark function synthetic:mulc:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mulc:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x2\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tsll\tv0,v0,0x1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-554a87e2db088449/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 mulc\n\n\nContents of section .text:\n 0000 00041080 00441021 03e00008 00021040 .....D.!.......@\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mulc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mulc:ido7.1","sym":"mulc","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","strength-reduce"],"loc":1,"refSource":"int mulc(int a){ return a*10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x2\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tsll\tv0,v0,0x1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 mulc\n\n\nContents of section .text:\n 0000 00041080 00441021 03e00008 00021040 .....D.!.......@\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 35346138 37653264 62303838 ef-554a87e2db088\n 0130 3434392f 7265662e 63006d75 6c630000 449/ref.c.mulc..\n 0140 6d756c63 00000000 00000000 00000001 mulc............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mulc(u32 a0) {\n return a0 * 10;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mulc(s32 arg0) {\n return arg0 * 0xA;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mulc` — benchmark function synthetic:mulc:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mulc\n sll\t$v0, $a0, 0x2\n addu\t$v0, $v0, $a0\n jr\t$ra\n sll\t$v0, $v0, 0x1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mulc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mulc` — benchmark function synthetic:mulc:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mulc:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x2\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tsll\tv0,v0,0x1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 mulc\n\n\nContents of section .text:\n 0000 00041080 00441021 03e00008 00021040 .....D.!.......@\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 35346138 37653264 62303838 ef-554a87e2db088\n 0130 3434392f 7265662e 63006d75 6c630000 449/ref.c.mulc..\n 0140 6d756c63 00000000 00000000 00000001 mulc............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mulc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mulc:mwcc_242_81","sym":"mulc","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","strength-reduce"],"loc":1,"refSource":"int mulc(int a){ return a*10; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmulli r3,r3,10\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 mulc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mulc\n\n\nContents of section .text:\n 0000 1c63000a 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mulc(u32 a0) {\n return a0 * 10;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mulc(s32 arg0) {\n return arg0 * 0xA;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mulc` — benchmark function synthetic:mulc:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mulc\n mulli r3,r3,10\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mulc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mulc` — benchmark function synthetic:mulc:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mulc:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmulli r3,r3,10\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 mulc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mulc\n\n\nContents of section .text:\n 0000 1c63000a 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mulc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:narrow:agbcc","sym":"narrow","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","narrow","memory","store"],"loc":1,"refSource":"void narrow(u8 *p,int x){ *p=(u8)x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnarrow\n\t.type\t narrow,function\n\t.thumb_func\nnarrow:\n\tstrb\tr1, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t narrow,.Lfe1-narrow\n","ctx":"void narrow(u8*,int);","proto":{"narrow":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void narrow(u8 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void narrow(u8 *arg0, s32 arg1) {\n *arg0 = (u8) arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `narrow` — benchmark function synthetic:narrow:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnarrow\n\t.type\t narrow,function\n\t.thumb_func\nnarrow:\n\tstrb\tr1, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t narrow,.Lfe1-narrow\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid narrow(u8*,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function narrow # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `narrow` — benchmark function synthetic:narrow:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:narrow:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnarrow\n\t.type\t narrow,function\n\t.thumb_func\nnarrow:\n\tstrb\tr1, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t narrow,.Lfe1-narrow\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"narrow\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name narrow # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:narrow:gcc2.7.2kmc","sym":"narrow","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","narrow","memory","store"],"loc":1,"refSource":"void narrow(u8 *p,int x){ *p=(u8)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsb\ta1,0(a0)\n\t...\n","ctx":"void narrow(u8*,int);","proto":{"narrow":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ba8bd346ce1ed954/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 narrow\n\n\nContents of section .text:\n 0000 03e00008 a0850000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void narrow(u8 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void narrow(u8 *arg0, s32 arg1) {\n *arg0 = (u8) arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `narrow` — benchmark function synthetic:narrow:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel narrow\n jr\t$ra\n sb\t$a1, 0($a0)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid narrow(u8*,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function narrow # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `narrow` — benchmark function synthetic:narrow:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:narrow:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsb\ta1,0(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ba8bd346ce1ed954/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 narrow\n\n\nContents of section .text:\n 0000 03e00008 a0850000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"narrow\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name narrow # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:narrow:ido7.1","sym":"narrow","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","narrow","memory","store"],"loc":1,"refSource":"void narrow(u8 *p,int x){ *p=(u8)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsb\ta1,0(a0)\n\t...\n","ctx":"void narrow(u8*,int);","proto":{"narrow":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 narrow\n\n\nContents of section .text:\n 0000 03e00008 a0850000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 61386264 33343663 65316564 ef-ba8bd346ce1ed\n 0130 3935342f 7265662e 63006e61 72726f77 954/ref.c.narrow\n 0140 00000000 6e617272 6f770000 00000000 ....narrow......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void narrow(u8 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void narrow(u8 *arg0, s32 arg1) {\n *arg0 = (u8) arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `narrow` — benchmark function synthetic:narrow:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel narrow\n jr\t$ra\n sb\t$a1, 0($a0)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid narrow(u8*,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function narrow # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `narrow` — benchmark function synthetic:narrow:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:narrow:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsb\ta1,0(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 narrow\n\n\nContents of section .text:\n 0000 03e00008 a0850000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 61386264 33343663 65316564 ef-ba8bd346ce1ed\n 0130 3935342f 7265662e 63006e61 72726f77 954/ref.c.narrow\n 0140 00000000 6e617272 6f770000 00000000 ....narrow......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"narrow\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name narrow # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:narrow:mwcc_242_81","sym":"narrow","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","narrow","memory","store"],"loc":1,"refSource":"void narrow(u8 *p,int x){ *p=(u8)x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstb r4,0(r3)\n 4:\tblr\n","ctx":"void narrow(u8*,int);","proto":{"narrow":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 narrow\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 narrow\n\n\nContents of section .text:\n 0000 98830000 4e800020 ....N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void narrow(u8 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void narrow(u8 *arg0, s32 arg1) {\n *arg0 = (u8) arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `narrow` — benchmark function synthetic:narrow:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel narrow\n stb r4,0(r3)\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid narrow(u8*,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function narrow # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `narrow` — benchmark function synthetic:narrow:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:narrow:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstb r4,0(r3)\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 narrow\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 narrow\n\n\nContents of section .text:\n 0000 98830000 4e800020 ....N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"narrow\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name narrow # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:neg:agbcc","sym":"neg","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int neg(int a){ return -a; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tneg\n\t.type\t neg,function\n\t.thumb_func\nneg:\n\tneg\tr0, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t neg,.Lfe1-neg\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 neg(u32 a0) {\n return -a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 neg(s32 arg0) {\n return 0 - arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `neg` — benchmark function synthetic:neg:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tneg\n\t.type\t neg,function\n\t.thumb_func\nneg:\n\tneg\tr0, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t neg,.Lfe1-neg\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function neg # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `neg` — benchmark function synthetic:neg:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:neg:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tneg\n\t.type\t neg,function\n\t.thumb_func\nneg:\n\tneg\tr0, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t neg,.Lfe1-neg\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name neg # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:neg:gcc2.7.2kmc","sym":"neg","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int neg(int a){ return -a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnegu\tv0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b64a675c6e2f957e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 neg\n\n\nContents of section .text:\n 0000 03e00008 00041023 00000000 00000000 .......#........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 neg(u32 a0) {\n return -a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 neg(s32 arg0) {\n return -arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `neg` — benchmark function synthetic:neg:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel neg\n jr\t$ra\n negu\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function neg # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `neg` — benchmark function synthetic:neg:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:neg:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnegu\tv0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b64a675c6e2f957e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 neg\n\n\nContents of section .text:\n 0000 03e00008 00041023 00000000 00000000 .......#........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name neg # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:neg:ido7.1","sym":"neg","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic"],"loc":1,"refSource":"int neg(int a){ return -a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnegu\tv0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 neg\n\n\nContents of section .text:\n 0000 03e00008 00041023 00000000 00000000 .......#........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 36346136 37356336 65326639 ef-b64a675c6e2f9\n 0130 3537652f 7265662e 63006e65 67000000 57e/ref.c.neg...\n 0140 6e656700 00000000 00000001 00000000 neg.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 neg(u32 a0) {\n return -a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 neg(s32 arg0) {\n return -arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `neg` — benchmark function synthetic:neg:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel neg\n jr\t$ra\n negu\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function neg # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `neg` — benchmark function synthetic:neg:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:neg:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnegu\tv0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 neg\n\n\nContents of section .text:\n 0000 03e00008 00041023 00000000 00000000 .......#........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 36346136 37356336 65326639 ef-b64a675c6e2f9\n 0130 3537652f 7265662e 63006e65 67000000 57e/ref.c.neg...\n 0140 6e656700 00000000 00000001 00000000 neg.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name neg # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:neg:mwcc_242_81","sym":"neg","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int neg(int a){ return -a; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg r3,r3\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 neg\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 neg\n\n\nContents of section .text:\n 0000 7c6300d0 4e800020 |c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 neg(u32 a0) {\n return -a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 neg(s32 arg0) {\n return -arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `neg` — benchmark function synthetic:neg:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel neg\n neg r3,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function neg # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `neg` — benchmark function synthetic:neg:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:neg:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg r3,r3\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 neg\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 neg\n\n\nContents of section .text:\n 0000 7c6300d0 4e800020 |c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name neg # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedif:agbcc","sym":"nestedif","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["branch","nested-if"],"loc":1,"refSource":"int nestedif(int a,int b){ if(a>0){ if(b>0) return a+b; return a; } return 0; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnestedif\n\t.type\t nestedif,function\n\t.thumb_func\nnestedif:\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tcmp\tr1, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr0, r0, r1\n\tb\t.L5\n.L3:\n\tmov\tr0, #0x0\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t nestedif,.Lfe1-nestedif\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 nestedif(u32 a0, u32 a1) {\n if (a0 <= 0) {\n a0 = 0;\n } else {\n if (a1 > 0) a0 = a0 + a1;\n }\n return a0;\n}\n","score":4,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":2,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 nestedif(s32 arg0, s32 arg1) {\n s32 var_r0;\n\n var_r0 = arg0;\n if (var_r0 > 0) {\n if (arg1 > 0) {\n return var_r0 + arg1;\n }\n /* Duplicate return node #4. Try simplifying control flow for better match */\n return var_r0;\n }\n var_r0 = 0;\n return var_r0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedif` — benchmark function synthetic:nestedif:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnestedif\n\t.type\t nestedif,function\n\t.thumb_func\nnestedif:\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tcmp\tr1, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr0, r0, r1\n\tb\t.L5\n.L3:\n\tmov\tr0, #0x0\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t nestedif,.Lfe1-nestedif\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedif` — benchmark function synthetic:nestedif:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedif:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnestedif\n\t.type\t nestedif,function\n\t.thumb_func\nnestedif:\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tcmp\tr1, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr0, r0, r1\n\tb\t.L5\n.L3:\n\tmov\tr0, #0x0\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t nestedif,.Lfe1-nestedif\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedif # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedif:gcc2.7.2kmc","sym":"nestedif","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","nested-if"],"loc":1,"refSource":"int nestedif(int a,int b){ if(a>0){ if(b>0) return a+b; return a; } return 0; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,a0\n 4:\tblezl\tv0,14 \n 8:\tmove\tv0,zero\n c:\tbgtzl\ta1,14 \n 10:\taddu\tv0,v0,a1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a7c170a6334f6c2a/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c nestedif\n\n\nContents of section .text:\n 0000 00801021 58400003 00001021 5ca00001 ...!X@.....!\\...\n 0010 00451021 03e00008 00000000 00000000 .E.!............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'nestedif' — lift: cannot lift 'nestedif': unmodelled control transfer 'blezl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv0,a0 */\n/* 4:\tblezl\tv0,14 */\n/* 8:\tmove\tv0,zero */\n/* c:\tbgtzl\ta1,14 */\n/* 10:\taddu\tv0,v0,a1 */\n/* 14:\tjr\tra */\n/* 18:\tnop */\n/* 1c:\tnop */\nvoid nestedif(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'nestedif': unmodelled control transfer 'blezl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'nestedif': unmodelled control transfer 'blezl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 nestedif(s32 arg0, s32 arg1) {\n s32 var_v0;\n\n var_v0 = arg0;\n if (var_v0 <= 0) {\n return 0;\n }\n if (arg1 > 0) {\n var_v0 += arg1;\n }\n return var_v0;\n}\n","score":3,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":9,"ratio":0.3333333333333333,"kinds":{"insert":2,"delete":0,"replace":1,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedif` — benchmark function synthetic:nestedif:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel nestedif\n move\t$v0, $a0\n blezl\t$v0, .L14\n move\t$v0, $zero\n bgtzl\t$a1, .L14\n addu\t$v0, $v0, $a1\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedif` — benchmark function synthetic:nestedif:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedif:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,a0\n 4:\tblezl\tv0,14 \n 8:\tmove\tv0,zero\n c:\tbgtzl\ta1,14 \n 10:\taddu\tv0,v0,a1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a7c170a6334f6c2a/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c nestedif\n\n\nContents of section .text:\n 0000 00801021 58400003 00001021 5ca00001 ...!X@.....!\\...\n 0010 00451021 03e00008 00000000 00000000 .E.!............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedif # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedif:ido7.1","sym":"nestedif","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch","nested-if"],"loc":1,"refSource":"int nestedif(int a,int b){ if(a>0){ if(b>0) return a+b; return a; } return 0; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,20 \n 4:\tmove\tv0,zero\n 8:\tblez\ta1,18 \n c:\tnop\n 10:\tjr\tra\n 14:\taddu\tv0,a0,a1\n 18:\tjr\tra\n 1c:\tmove\tv0,a0\n 20:\tjr\tra\n 24:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 nestedif\n\n\nContents of section .text:\n 0000 18800007 00001025 18a00003 00000000 .......%........\n 0010 03e00008 00851021 03e00008 00801025 .......!.......%\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002e0 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 0000000c 0000027c 00000001 00000288 .......|........\n 0050 00000000 00000000 00000001 000002d0 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 37633137 30613633 33346636 ef-a7c170a6334f6\n 0130 6332612f 7265662e 63006e65 73746564 c2a/ref.c.nested\n 0140 69660000 6e657374 65646966 00000000 if..nestedif....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 0000000a ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000002 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 nestedif(s32 a0, s32 a1) {\n if (a0 > 0) {\n if (a1 > 0) {\n return a0 + a1;\n } else {\n return a0;\n }\n } else {\n return 0;\n }\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 nestedif(s32 arg0, s32 arg1) {\n if (arg0 > 0) {\n if (arg1 > 0) {\n return arg0 + arg1;\n }\n return arg0;\n }\n return 0;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedif` — benchmark function synthetic:nestedif:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel nestedif\n blez\t$a0, .L20\n move\t$v0, $zero\n blez\t$a1, .L18\n nop\n jr\t$ra\n addu\t$v0, $a0, $a1\n.L18:\n jr\t$ra\n move\t$v0, $a0\n.L20:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedif` — benchmark function synthetic:nestedif:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedif:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,20 \n 4:\tmove\tv0,zero\n 8:\tblez\ta1,18 \n c:\tnop\n 10:\tjr\tra\n 14:\taddu\tv0,a0,a1\n 18:\tjr\tra\n 1c:\tmove\tv0,a0\n 20:\tjr\tra\n 24:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 nestedif\n\n\nContents of section .text:\n 0000 18800007 00001025 18a00003 00000000 .......%........\n 0010 03e00008 00851021 03e00008 00801025 .......!.......%\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002e0 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 0000000c 0000027c 00000001 00000288 .......|........\n 0050 00000000 00000000 00000001 000002d0 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 37633137 30613633 33346636 ef-a7c170a6334f6\n 0130 6332612f 7265662e 63006e65 73746564 c2a/ref.c.nested\n 0140 69660000 6e657374 65646966 00000000 if..nestedif....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 0000000a ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000002 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedif # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedif:mwcc_242_81","sym":"nestedif","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["branch","nested-if"],"loc":1,"refSource":"int nestedif(int a,int b){ if(a>0){ if(b>0) return a+b; return a; } return 0; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tble 18 \n 8:\tcmpwi r4,0\n c:\tblelr\n 10:\tadd r3,r3,r4\n 14:\tblr\n 18:\tli r3,0\n 1c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 nestedif\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 nestedif\n\n\nContents of section .text:\n 0000 2c030000 40810014 2c040000 4c810020 ,...@...,...L.. \n 0010 7c632214 4e800020 38600000 4e800020 |c\".N.. 8`..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 nestedif(s32 a0, s32 a1) {\n if (a0 > 0) {\n if (a1 > 0) {\n return a0 + a1;\n } else {\n return a0;\n }\n } else {\n return 0;\n }\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 nestedif(s32 arg0, s32 arg1) {\n if (arg0 > 0) {\n if (arg1 > 0) {\n return arg0 + arg1;\n }\n return arg0;\n }\n return 0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedif` — benchmark function synthetic:nestedif:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel nestedif\n cmpwi r3,0\n ble .L18\n cmpwi r4,0\n blelr\n add r3,r3,r4\n blr\n.L18:\n li r3,0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedif` — benchmark function synthetic:nestedif:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedif:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tble 18 \n 8:\tcmpwi r4,0\n c:\tblelr\n 10:\tadd r3,r3,r4\n 14:\tblr\n 18:\tli r3,0\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 nestedif\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 nestedif\n\n\nContents of section .text:\n 0000 2c030000 40810014 2c040000 4c810020 ,...@...,...L.. \n 0010 7c632214 4e800020 38600000 4e800020 |c\".N.. 8`..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedif # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedloop:agbcc","sym":"nestedloop","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","nested-loop","arithmetic"],"loc":1,"refSource":"int nestedloop(int n){ int s=0,i,j; for(i=0;i= a0) {\n v1 = 0;\n } else {\n v1 = 0;\n v0 = 0;\n do {\n if (a0 > 0) {\n v3 = v1;\n v4 = a0;\n v2 = 0;\n do {\n v3 = v3 + v2;\n v2 = v2 + v0;\n v4 = v4 - 1;\n } while (v4 != 0);\n v1 = v3;\n }\n v0 = v0 + 1;\n } while (v0 < a0);\n }\n return v1;\n}\n","score":14,"maxScore":23,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":1,"argMismatch":11},"quality":{"score":100,"lines":28,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 nestedloop(s32 arg0) {\n s32 var_r1;\n s32 var_r2;\n s32 var_r3;\n s32 var_r5;\n\n var_r5 = 0;\n var_r3 = 0;\n if (arg0 > 0) {\n do {\n if (arg0 > 0) {\n var_r2 = 0;\n var_r1 = arg0;\n do {\n var_r5 += var_r2;\n var_r2 += var_r3;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n var_r3 += 1;\n } while (var_r3 < arg0);\n }\n return var_r5;\n}\n","score":2,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":23,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":22,"ratio":0.09090909090909091,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedloop` — benchmark function synthetic:nestedloop:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnestedloop\n\t.type\t nestedloop,function\n\t.thumb_func\nnestedloop:\n\tpush\t{r4, r5, lr}\n\tmov\tr5, #0x0\n\tmov\tr3, #0x0\n\tcmp\tr5, r0\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr4, r3, #0x1\n\tcmp\tr0, #0\n\tble\t.L5\t@cond_branch\n\tmov\tr2, #0x0\n\tadd\tr1, r0, #0\n.L10:\n\tadd\tr5, r5, r2\n\tadd\tr2, r2, r3\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L10\t@cond_branch\n.L5:\n\tadd\tr3, r4, #0\n\tcmp\tr3, r0\n\tblt\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r5, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t nestedloop,.Lfe1-nestedloop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedloop` — benchmark function synthetic:nestedloop:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedloop:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnestedloop\n\t.type\t nestedloop,function\n\t.thumb_func\nnestedloop:\n\tpush\t{r4, r5, lr}\n\tmov\tr5, #0x0\n\tmov\tr3, #0x0\n\tcmp\tr5, r0\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr4, r3, #0x1\n\tcmp\tr0, #0\n\tble\t.L5\t@cond_branch\n\tmov\tr2, #0x0\n\tadd\tr1, r0, #0\n.L10:\n\tadd\tr5, r5, r2\n\tadd\tr2, r2, r3\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L10\t@cond_branch\n.L5:\n\tadd\tr3, r4, #0\n\tcmp\tr3, r0\n\tblt\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r5, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t nestedloop,.Lfe1-nestedloop\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedloop # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedloop:gcc2.7.2kmc","sym":"nestedloop","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","nested-loop","arithmetic"],"loc":1,"refSource":"int nestedloop(int n){ int s=0,i,j; for(i=0;i:\n 0:\taddiu\tsp,sp,-16\n 4:\tmove\ta2,zero\n 8:\tblez\ta0,40 \n c:\tmove\ta3,zero\n 10:\tblez\ta0,30 \n 14:\tmove\ta1,zero\n 18:\tmove\tv1,zero\n 1c:\taddu\ta3,a3,v1\n 20:\taddiu\ta1,a1,1\n 24:\tslt\tv0,a1,a0\n 28:\tbnez\tv0,1c \n 2c:\taddu\tv1,v1,a2\n 30:\taddiu\ta2,a2,1\n 34:\tslt\tv0,a2,a0\n 38:\tbnez\tv0,10 \n 3c:\tnop\n 40:\tmove\tv0,a3\n 44:\tjr\tra\n 48:\taddiu\tsp,sp,16\n 4c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-84c78a1282ec0a36/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c nestedloop\n\n\nContents of section .text:\n 0000 27bdfff0 00003021 1880000d 00003821 '.....0!......8!\n 0010 18800007 00002821 00001821 00e33821 ......(!...!..8!\n 0020 24a50001 00a4102a 1440fffc 00661821 $......*.@...f.!\n 0030 24c60001 00c4102a 1440fff5 00000000 $......*.@......\n 0040 00e01021 03e00008 27bd0010 00000000 ...!....'.......\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 nestedloop(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n v1 = 0;\n v0 = 0;\n do {\n if (a0 > 0) {\n v2 = v0;\n v4 = 0;\n v3 = 0;\n do {\n v2 = v2 + v3;\n v4 = v4 + 1;\n v3 = v3 + v1;\n } while (v4 < a0);\n v0 = v2;\n }\n v1 = v1 + 1;\n } while (v1 < a0);\n }\n return v0;\n}\n","score":16,"maxScore":23,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":5,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":28,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 nestedloop(s32 arg0) {\n s32 var_a1;\n s32 var_a2;\n s32 var_a3;\n s32 var_v1;\n\n var_a2 = 0;\n var_a3 = 0;\n if (arg0 > 0) {\n do {\n var_a1 = 0;\n if (arg0 > 0) {\n var_v1 = 0;\n do {\n var_a3 += var_v1;\n var_a1 += 1;\n var_v1 += var_a2;\n } while (var_a1 < arg0);\n }\n var_a2 += 1;\n } while (var_a2 < arg0);\n }\n return var_a3;\n}\n","score":3,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":23,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":19,"ratio":0.15789473684210525,"kinds":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedloop` — benchmark function synthetic:nestedloop:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel nestedloop\n addiu\t$sp, $sp, -16\n move\t$a2, $zero\n blez\t$a0, .L40\n move\t$a3, $zero\n.L10:\n blez\t$a0, .L30\n move\t$a1, $zero\n move\t$v1, $zero\n.L1c:\n addu\t$a3, $a3, $v1\n addiu\t$a1, $a1, 1\n slt\t$v0, $a1, $a0\n bnez\t$v0, .L1c\n addu\t$v1, $v1, $a2\n.L30:\n addiu\t$a2, $a2, 1\n slt\t$v0, $a2, $a0\n bnez\t$v0, .L10\n nop\n.L40:\n move\t$v0, $a3\n jr\t$ra\n addiu\t$sp, $sp, 16\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedloop` — benchmark function synthetic:nestedloop:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedloop:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-16\n 4:\tmove\ta2,zero\n 8:\tblez\ta0,40 \n c:\tmove\ta3,zero\n 10:\tblez\ta0,30 \n 14:\tmove\ta1,zero\n 18:\tmove\tv1,zero\n 1c:\taddu\ta3,a3,v1\n 20:\taddiu\ta1,a1,1\n 24:\tslt\tv0,a1,a0\n 28:\tbnez\tv0,1c \n 2c:\taddu\tv1,v1,a2\n 30:\taddiu\ta2,a2,1\n 34:\tslt\tv0,a2,a0\n 38:\tbnez\tv0,10 \n 3c:\tnop\n 40:\tmove\tv0,a3\n 44:\tjr\tra\n 48:\taddiu\tsp,sp,16\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-84c78a1282ec0a36/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c nestedloop\n\n\nContents of section .text:\n 0000 27bdfff0 00003021 1880000d 00003821 '.....0!......8!\n 0010 18800007 00002821 00001821 00e33821 ......(!...!..8!\n 0020 24a50001 00a4102a 1440fffc 00661821 $......*.@...f.!\n 0030 24c60001 00c4102a 1440fff5 00000000 $......*.@......\n 0040 00e01021 03e00008 27bd0010 00000000 ...!....'.......\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedloop:ido7.1","sym":"nestedloop","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","nested-loop","arithmetic"],"loc":1,"refSource":"int nestedloop(int n){ int s=0,i,j; for(i=0;i:\n 0:\tmove\tv1,zero\n 4:\tblez\ta0,e4 \n 8:\tmove\tv0,zero\n c:\tblez\ta0,d8 \n 10:\tmove\ta1,zero\n 14:\tandi\tt1,a0,0x3\n 18:\tbeqz\tt1,54 \n 1c:\tnop\n 20:\tmultu\tv0,zero\n 24:\tmove\tt0,t1\n 28:\tli\ta3,1\n 2c:\tmflo\ta2\n\t...\n 38:\tmove\ta1,a3\n 3c:\taddu\tv1,v1,a2\n 40:\taddu\ta2,a2,v0\n 44:\tbne\tt0,a3,38 \n 48:\taddiu\ta3,a3,1\n 4c:\tbeql\ta1,a0,dc \n 50:\taddiu\tv0,v0,1\n 54:\tmultu\tv0,a1\n 58:\taddiu\tt6,a1,1\n 5c:\taddiu\tt7,a1,2\n 60:\taddiu\tt8,a1,3\n 64:\tsll\tt2,v0,0x2\n 68:\tsll\tt3,v0,0x2\n 6c:\tsll\tt4,v0,0x2\n 70:\tsll\tt5,v0,0x2\n 74:\tmflo\ta2\n\t...\n 80:\tmultu\tv0,t6\n 84:\tmflo\ta3\n\t...\n 90:\tmultu\tv0,t7\n 94:\tmflo\tt0\n\t...\n a0:\tmultu\tv0,t8\n a4:\tmflo\tt1\n\t...\n b0:\taddu\tv1,v1,a2\n b4:\taddu\tv1,v1,a3\n b8:\taddu\tv1,v1,t0\n bc:\taddu\tv1,v1,t1\n c0:\taddiu\ta1,a1,4\n c4:\taddu\tt1,t1,t5\n c8:\taddu\tt0,t0,t4\n cc:\taddu\ta3,a3,t3\n d0:\tbne\ta1,a0,b0 \n d4:\taddu\ta2,a2,t2\n d8:\taddiu\tv0,v0,1\n dc:\tbne\tv0,a0,c \n e0:\tnop\n e4:\tjr\tra\n e8:\tmove\tv0,v1\n ec:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000f0 .text\n00000000 g F .text\t000000ec nestedloop\n\n\nContents of section .text:\n 0000 00001825 18800037 00001025 18800032 ...%...7...%...2\n 0010 00002825 30890003 1120000e 00000000 ..(%0.... ......\n 0020 00400019 01204025 24070001 00003012 .@... @%$.....0.\n 0030 00000000 00000000 00e02825 00661821 ..........(%.f.!\n 0040 00c23021 1507fffc 24e70001 50a40023 ..0!....$...P..#\n 0050 24420001 00450019 24ae0001 24af0002 $B...E..$...$...\n 0060 24b80003 00025080 00025880 00026080 $.....P...X...`.\n 0070 00026880 00003012 00000000 00000000 ..h...0.........\n 0080 004e0019 00003812 00000000 00000000 .N....8.........\n 0090 004f0019 00004012 00000000 00000000 .O....@.........\n 00a0 00580019 00004812 00000000 00000000 .X....H.........\n 00b0 00661821 00671821 00681821 00691821 .f.!.g.!.h.!.i.!\n 00c0 24a50004 012d4821 010c4021 00eb3821 $....-H!..@!..8!\n 00d0 14a4fff7 00ca3021 24420001 1444ffcb ......0!$B...D..\n 00e0 00000000 03e00008 00601025 00000000 .........`.%....\nContents of section .options:\n 0000 01200000 00000000 8100fffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100fffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000003b 00000008 00000268 p......;.......h\n 0010 00000005 000003b8 00000001 00000270 ...............p\n 0020 00000004 000002a4 00000000 00000000 ................\n 0030 00000011 000002d4 0000003c 00000318 ...........<....\n 0040 0000000c 00000354 00000001 00000360 .......T.......`\n 0050 00000000 00000000 00000001 000003a8 ................\n 0060 08080808 08080400 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000ec 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d38 34633738 61313238 ps-ref-84c78a128\n 0130 32656330 6133362f 7265662e 63006e65 2ec0a36/ref.c.ne\n 0140 73746564 6c6f6f70 00000000 6e657374 stedloop....nest\n 0150 65646c6f 6f700000 00000000 00000001 edloop..........\n 0160 00000000 00000039 00000000 00000004 .......9........\n 0170 00000000 0000003b 00000000 00000000 .......;........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000007 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'nestedloop' — lift: cannot lift 'nestedloop': unmodelled control transfer 'beql' at 0x4c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tblez\ta0,e4 */\n/* 8:\tmove\tv0,zero */\n/* c:\tblez\ta0,d8 */\n/* 10:\tmove\ta1,zero */\n/* 14:\tandi\tt1,a0,0x3 */\n/* 18:\tbeqz\tt1,54 */\n/* 1c:\tnop */\n/* 20:\tmultu\tv0,zero */\n/* 24:\tmove\tt0,t1 */\n/* 28:\tli\ta3,1 */\n/* 2c:\tmflo\ta2 */\n/* \t... */\n/* 38:\tmove\ta1,a3 */\n/* 3c:\taddu\tv1,v1,a2 */\n/* 40:\taddu\ta2,a2,v0 */\n/* 44:\tbne\tt0,a3,38 */\n/* 48:\taddiu\ta3,a3,1 */\n/* 4c:\tbeql\ta1,a0,dc */\n/* 50:\taddiu\tv0,v0,1 */\n/* 54:\tmultu\tv0,a1 */\n/* 58:\taddiu\tt6,a1,1 */\n/* 5c:\taddiu\tt7,a1,2 */\n/* 60:\taddiu\tt8,a1,3 */\n/* 64:\tsll\tt2,v0,0x2 */\n/* 68:\tsll\tt3,v0,0x2 */\n/* 6c:\tsll\tt4,v0,0x2 */\n/* 70:\tsll\tt5,v0,0x2 */\n/* 74:\tmflo\ta2 */\n/* \t... */\n/* 80:\tmultu\tv0,t6 */\n/* 84:\tmflo\ta3 */\n/* \t... */\n/* 90:\tmultu\tv0,t7 */\n/* 94:\tmflo\tt0 */\n/* \t... */\n/* a0:\tmultu\tv0,t8 */\n/* a4:\tmflo\tt1 */\n/* \t... */\n/* b0:\taddu\tv1,v1,a2 */\n/* b4:\taddu\tv1,v1,a3 */\n/* b8:\taddu\tv1,v1,t0 */\n/* bc:\taddu\tv1,v1,t1 */\n/* c0:\taddiu\ta1,a1,4 */\n/* c4:\taddu\tt1,t1,t5 */\n/* c8:\taddu\tt0,t0,t4 */\n/* cc:\taddu\ta3,a3,t3 */\n/* d0:\tbne\ta1,a0,b0 */\n/* d4:\taddu\ta2,a2,t2 */\n/* d8:\taddiu\tv0,v0,1 */\n/* dc:\tbne\tv0,a0,c */\n/* e0:\tnop */\n/* e4:\tjr\tra */\n/* e8:\tmove\tv0,v1 */\n/* ec:\tnop */\nvoid nestedloop(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'nestedloop': unmodelled control transfer 'beql' at 0x4c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":63,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'nestedloop': unmodelled control transfer 'beql' at 0x4c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 nestedloop(s32 arg0) {\n s32 temp_t1;\n s32 var_a1;\n s32 var_a2;\n s32 var_a2_2;\n s32 var_a3;\n s32 var_a3_2;\n s32 var_t0;\n s32 var_t1;\n s32 var_v0;\n s32 var_v1;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg0 > 0) {\n do {\n var_a1 = 0;\n if (arg0 > 0) {\n temp_t1 = arg0 & 3;\n if (temp_t1 != 0) {\n var_a3 = 1;\n var_a2 = var_v0 * 0;\n do {\n var_a1 = var_a3;\n var_v1 += var_a2;\n var_a2 += var_v0;\n var_a3 += 1;\n } while (temp_t1 != var_a3);\n if (var_a1 != arg0) {\n goto block_6;\n }\n } else {\nblock_6:\n var_a2_2 = var_v0 * var_a1;\n var_a3_2 = var_v0 * (var_a1 + 1);\n var_t0 = var_v0 * (var_a1 + 2);\n var_t1 = var_v0 * (var_a1 + 3);\n do {\n var_v1 = var_v1 + var_a2_2 + var_a3_2 + var_t0 + var_t1;\n var_a1 += 4;\n var_t1 += var_v0 * 4;\n var_t0 += var_v0 * 4;\n var_a3_2 += var_v0 * 4;\n var_a2_2 += var_v0 * 4;\n } while (var_a1 != arg0);\n }\n }\n var_v0 += 1;\n } while (var_v0 != arg0);\n }\n return var_v1;\n}\n","score":84,"maxScore":111,"compileErrors":null,"breakdown":{"insert":52,"delete":3,"replace":9,"opMismatch":0,"argMismatch":20},"quality":{"score":88,"lines":51,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":84,"maxScore":111,"ratio":0.7567567567567568,"kinds":{"insert":52,"delete":3,"replace":9,"opMismatch":0,"argMismatch":20}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedloop` — benchmark function synthetic:nestedloop:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel nestedloop\n move\t$v1, $zero\n blez\t$a0, .Le4\n move\t$v0, $zero\n.Lc:\n blez\t$a0, .Ld8\n move\t$a1, $zero\n andi\t$t1, $a0, 0x3\n beqz\t$t1, .L54\n nop\n multu\t$v0, $zero\n move\t$t0, $t1\n li\t$a3, 1\n mflo\t$a2\n.L38:\n move\t$a1, $a3\n addu\t$v1, $v1, $a2\n addu\t$a2, $a2, $v0\n bne\t$t0, $a3, .L38\n addiu\t$a3, $a3, 1\n beql\t$a1, $a0, .Ldc\n addiu\t$v0, $v0, 1\n.L54:\n multu\t$v0, $a1\n addiu\t$t6, $a1, 1\n addiu\t$t7, $a1, 2\n addiu\t$t8, $a1, 3\n sll\t$t2, $v0, 0x2\n sll\t$t3, $v0, 0x2\n sll\t$t4, $v0, 0x2\n sll\t$t5, $v0, 0x2\n mflo\t$a2\n multu\t$v0, $t6\n mflo\t$a3\n multu\t$v0, $t7\n mflo\t$t0\n multu\t$v0, $t8\n mflo\t$t1\n.Lb0:\n addu\t$v1, $v1, $a2\n addu\t$v1, $v1, $a3\n addu\t$v1, $v1, $t0\n addu\t$v1, $v1, $t1\n addiu\t$a1, $a1, 4\n addu\t$t1, $t1, $t5\n addu\t$t0, $t0, $t4\n addu\t$a3, $a3, $t3\n bne\t$a1, $a0, .Lb0\n addu\t$a2, $a2, $t2\n.Ld8:\n addiu\t$v0, $v0, 1\n.Ldc:\n bne\t$v0, $a0, .Lc\n nop\n.Le4:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedloop` — benchmark function synthetic:nestedloop:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedloop:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta0,e4 \n 8:\tmove\tv0,zero\n c:\tblez\ta0,d8 \n 10:\tmove\ta1,zero\n 14:\tandi\tt1,a0,0x3\n 18:\tbeqz\tt1,54 \n 1c:\tnop\n 20:\tmultu\tv0,zero\n 24:\tmove\tt0,t1\n 28:\tli\ta3,1\n 2c:\tmflo\ta2\n\t...\n 38:\tmove\ta1,a3\n 3c:\taddu\tv1,v1,a2\n 40:\taddu\ta2,a2,v0\n 44:\tbne\tt0,a3,38 \n 48:\taddiu\ta3,a3,1\n 4c:\tbeql\ta1,a0,dc \n 50:\taddiu\tv0,v0,1\n 54:\tmultu\tv0,a1\n 58:\taddiu\tt6,a1,1\n 5c:\taddiu\tt7,a1,2\n 60:\taddiu\tt8,a1,3\n 64:\tsll\tt2,v0,0x2\n 68:\tsll\tt3,v0,0x2\n 6c:\tsll\tt4,v0,0x2\n 70:\tsll\tt5,v0,0x2\n 74:\tmflo\ta2\n\t...\n 80:\tmultu\tv0,t6\n 84:\tmflo\ta3\n\t...\n 90:\tmultu\tv0,t7\n 94:\tmflo\tt0\n\t...\n a0:\tmultu\tv0,t8\n a4:\tmflo\tt1\n\t...\n b0:\taddu\tv1,v1,a2\n b4:\taddu\tv1,v1,a3\n b8:\taddu\tv1,v1,t0\n bc:\taddu\tv1,v1,t1\n c0:\taddiu\ta1,a1,4\n c4:\taddu\tt1,t1,t5\n c8:\taddu\tt0,t0,t4\n cc:\taddu\ta3,a3,t3\n d0:\tbne\ta1,a0,b0 \n d4:\taddu\ta2,a2,t2\n d8:\taddiu\tv0,v0,1\n dc:\tbne\tv0,a0,c \n e0:\tnop\n e4:\tjr\tra\n e8:\tmove\tv0,v1\n ec:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000f0 .text\n00000000 g F .text\t000000ec nestedloop\n\n\nContents of section .text:\n 0000 00001825 18800037 00001025 18800032 ...%...7...%...2\n 0010 00002825 30890003 1120000e 00000000 ..(%0.... ......\n 0020 00400019 01204025 24070001 00003012 .@... @%$.....0.\n 0030 00000000 00000000 00e02825 00661821 ..........(%.f.!\n 0040 00c23021 1507fffc 24e70001 50a40023 ..0!....$...P..#\n 0050 24420001 00450019 24ae0001 24af0002 $B...E..$...$...\n 0060 24b80003 00025080 00025880 00026080 $.....P...X...`.\n 0070 00026880 00003012 00000000 00000000 ..h...0.........\n 0080 004e0019 00003812 00000000 00000000 .N....8.........\n 0090 004f0019 00004012 00000000 00000000 .O....@.........\n 00a0 00580019 00004812 00000000 00000000 .X....H.........\n 00b0 00661821 00671821 00681821 00691821 .f.!.g.!.h.!.i.!\n 00c0 24a50004 012d4821 010c4021 00eb3821 $....-H!..@!..8!\n 00d0 14a4fff7 00ca3021 24420001 1444ffcb ......0!$B...D..\n 00e0 00000000 03e00008 00601025 00000000 .........`.%....\nContents of section .options:\n 0000 01200000 00000000 8100fffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100fffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000003b 00000008 00000268 p......;.......h\n 0010 00000005 000003b8 00000001 00000270 ...............p\n 0020 00000004 000002a4 00000000 00000000 ................\n 0030 00000011 000002d4 0000003c 00000318 ...........<....\n 0040 0000000c 00000354 00000001 00000360 .......T.......`\n 0050 00000000 00000000 00000001 000003a8 ................\n 0060 08080808 08080400 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000ec 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d38 34633738 61313238 ps-ref-84c78a128\n 0130 32656330 6133362f 7265662e 63006e65 2ec0a36/ref.c.ne\n 0140 73746564 6c6f6f70 00000000 6e657374 stedloop....nest\n 0150 65646c6f 6f700000 00000000 00000001 edloop..........\n 0160 00000000 00000039 00000000 00000004 .......9........\n 0170 00000000 0000003b 00000000 00000000 .......;........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000007 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedloop:mwcc_242_81","sym":"nestedloop","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","nested-loop","arithmetic"],"loc":1,"refSource":"int nestedloop(int n){ int s=0,i,j; for(i=0;i:\n 0:\tstwu r1,-16(r1)\n 4:\tli r12,0\n 8:\tli r11,0\n c:\tstw r31,12(r1)\n 10:\tli r31,0\n 14:\tstw r30,8(r1)\n 18:\tb dc \n 1c:\tcmpwi r3,0\n 20:\tli r30,0\n 24:\tble d4 \n 28:\tcmpwi r3,8\n 2c:\taddi r4,r3,-8\n 30:\tble b0 \n 34:\taddi r0,r4,7\n 38:\tli r10,0\n 3c:\tsrwi r0,r0,3\n 40:\tmtctr r0\n 44:\tcmpwi r4,0\n 48:\tble b0 \n 4c:\taddi r0,r30,1\n 50:\taddi r8,r30,2\n 54:\tmullw r9,r31,r0\n 58:\tadd r12,r12,r10\n 5c:\taddi r7,r30,3\n 60:\taddi r6,r30,4\n 64:\taddi r5,r30,5\n 68:\taddi r4,r30,6\n 6c:\taddi r0,r30,7\n 70:\tadd r12,r12,r9\n 74:\tmullw r8,r31,r8\n 78:\tadd r10,r10,r11\n 7c:\taddi r30,r30,8\n 80:\tmullw r7,r31,r7\n 84:\tadd r12,r12,r8\n 88:\tmullw r6,r31,r6\n 8c:\tadd r12,r12,r7\n 90:\tmullw r5,r31,r5\n 94:\tadd r12,r12,r6\n 98:\tmullw r4,r31,r4\n 9c:\tadd r12,r12,r5\n a0:\tmullw r0,r31,r0\n a4:\tadd r12,r12,r4\n a8:\tadd r12,r12,r0\n ac:\tbdnz 4c \n b0:\tmullw r4,r30,r31\n b4:\tsubf r0,r30,r3\n b8:\tmtctr r0\n bc:\tcmpw r30,r3\n c0:\tbge d4 \n c4:\tadd r12,r12,r4\n c8:\tadd r4,r4,r31\n cc:\taddi r30,r30,1\n d0:\tbdnz c4 \n d4:\taddi r11,r11,8\n d8:\taddi r31,r31,1\n dc:\tcmpw r31,r3\n e0:\tblt 1c \n e4:\tlwz r31,12(r1)\n e8:\tmr r3,r12\n ec:\tlwz r30,8(r1)\n f0:\taddi r1,r1,16\n f4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000f8 nestedloop\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 nestedloop\n\n\nContents of section .text:\n 0000 9421fff0 39800000 39600000 93e1000c .!..9...9`......\n 0010 3be00000 93c10008 480000c4 2c030000 ;.......H...,...\n 0020 3bc00000 408100b0 2c030008 3883fff8 ;...@...,...8...\n 0030 40810080 38040007 39400000 5400e8fe @...8...9@..T...\n 0040 7c0903a6 2c040000 40810068 381e0001 |...,...@..h8...\n 0050 391e0002 7d3f01d6 7d8c5214 38fe0003 9...}?..}.R.8...\n 0060 38de0004 38be0005 389e0006 381e0007 8...8...8...8...\n 0070 7d8c4a14 7d1f41d6 7d4a5a14 3bde0008 }.J.}.A.}JZ.;...\n 0080 7cff39d6 7d8c4214 7cdf31d6 7d8c3a14 |.9.}.B.|.1.}.:.\n 0090 7cbf29d6 7d8c3214 7c9f21d6 7d8c2a14 |.).}.2.|.!.}.*.\n 00a0 7c1f01d6 7d8c2214 7d8c0214 4200ffa0 |...}.\".}...B...\n 00b0 7c9ef9d6 7c1e1850 7c0903a6 7c1e1800 |...|..P|...|...\n 00c0 40800014 7d8c2214 7c84fa14 3bde0001 @...}.\".|...;...\n 00d0 4200fff4 396b0008 3bff0001 7c1f1800 B...9k..;...|...\n 00e0 4180ff3c 83e1000c 7d836378 83c10008 A..<....}.cx....\n 00f0 38210010 4e800020 8!..N.. \nContents of section .mwcats.text:\n 0000 020000f8 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 nestedloop(s32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n s32 v6;\n s32 v7;\n s32 v8;\n s32 v9;\n s32 v10;\n v9 = 0;\n v10 = 0;\n for (v8 = 0; v8 < a0; v8 = v8 + 1) {\n if (a0 > 0) {\n if (a0 <= 8) {\n v0 = 0;\n } else {\n v0 = 0;\n v1 = v9;\n v2 = 0;\n for (v3 = a0 + -8 + 7 >> 3; v3 != 0; v3 = v3 - 1) {\n v1 = v1 + v2 + v8 * (v0 + 1) + v8 * (v0 + 2) + v8 * (v0 + 3) + v8 * (v0 + 4) + v8 * (v0 + 5) + v8 * (v0 + 6) + v8 * (v0 + 7);\n v2 = v2 + v10;\n v0 = v0 + 8;\n }\n v9 = v1;\n }\n v4 = v9;\n v6 = v0;\n v5 = v0 * v8;\n for (v7 = a0 - v0; v7 != 0; v7 = v7 - 1) {\n v4 = v4 + v5;\n v5 = v5 + v8;\n v6 = v6 + 1;\n }\n v9 = v4;\n }\n v10 = v10 + 8;\n }\n return v9;\n}\n","score":142,"maxScore":152,"compileErrors":null,"breakdown":{"insert":90,"delete":6,"replace":5,"opMismatch":5,"argMismatch":36},"quality":{"score":100,"lines":43,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 nestedloop(s32 arg0) {\n s32 temp_r0;\n s32 temp_r12;\n s32 temp_r4;\n s32 temp_r4_2;\n s32 temp_r5;\n s32 temp_r6;\n s32 temp_r7;\n s32 temp_r8;\n s32 var_ctr_2;\n s32 var_r10;\n s32 var_r11;\n s32 var_r12;\n s32 var_r30;\n s32 var_r31;\n s32 var_r4;\n u32 var_ctr;\n\n var_r12 = 0;\n var_r11 = 0;\n var_r31 = 0;\nloop_8:\n if (var_r31 < arg0) {\n var_r30 = 0;\n if (arg0 > 0) {\n temp_r4 = arg0 - 8;\n if (arg0 > 8) {\n var_r10 = 0;\n var_ctr = (u32) (temp_r4 + 7) >> 3U;\n if (temp_r4 > 0) {\n do {\n temp_r7 = var_r30 + 3;\n temp_r6 = var_r30 + 4;\n temp_r5 = var_r30 + 5;\n temp_r4_2 = var_r30 + 6;\n temp_r0 = var_r30 + 7;\n temp_r12 = var_r12 + var_r10 + (var_r31 * (var_r30 + 1));\n temp_r8 = var_r31 * (var_r30 + 2);\n var_r10 += var_r11;\n var_r30 += 8;\n var_r12 = temp_r12 + temp_r8 + (var_r31 * temp_r7) + (var_r31 * temp_r6) + (var_r31 * temp_r5) + (var_r31 * temp_r4_2) + (var_r31 * temp_r0);\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r4 = var_r30 * var_r31;\n var_ctr_2 = arg0 - var_r30;\n if (var_r30 < arg0) {\n do {\n var_r12 += var_r4;\n var_r4 += var_r31;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n var_r11 += 8;\n var_r31 += 1;\n goto loop_8;\n }\n return var_r12;\n}\n","score":63,"maxScore":74,"compileErrors":null,"breakdown":{"insert":12,"delete":9,"replace":6,"opMismatch":2,"argMismatch":34},"quality":{"score":88,"lines":60,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":63,"maxScore":74,"ratio":0.8513513513513513,"kinds":{"insert":12,"delete":9,"replace":6,"opMismatch":2,"argMismatch":34}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedloop` — benchmark function synthetic:nestedloop:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel nestedloop\n stwu r1,-16(r1)\n li r12,0\n li r11,0\n stw r31,12(r1)\n li r31,0\n stw r30,8(r1)\n b .Ldc\n.L1c:\n cmpwi r3,0\n li r30,0\n ble .Ld4\n cmpwi r3,8\n addi r4,r3,-8\n ble .Lb0\n addi r0,r4,7\n li r10,0\n srwi r0,r0,3\n mtctr r0\n cmpwi r4,0\n ble .Lb0\n.L4c:\n addi r0,r30,1\n addi r8,r30,2\n mullw r9,r31,r0\n add r12,r12,r10\n addi r7,r30,3\n addi r6,r30,4\n addi r5,r30,5\n addi r4,r30,6\n addi r0,r30,7\n add r12,r12,r9\n mullw r8,r31,r8\n add r10,r10,r11\n addi r30,r30,8\n mullw r7,r31,r7\n add r12,r12,r8\n mullw r6,r31,r6\n add r12,r12,r7\n mullw r5,r31,r5\n add r12,r12,r6\n mullw r4,r31,r4\n add r12,r12,r5\n mullw r0,r31,r0\n add r12,r12,r4\n add r12,r12,r0\n bdnz .L4c\n.Lb0:\n mullw r4,r30,r31\n subf r0,r30,r3\n mtctr r0\n cmpw r30,r3\n bge .Ld4\n.Lc4:\n add r12,r12,r4\n add r4,r4,r31\n addi r30,r30,1\n bdnz .Lc4\n.Ld4:\n addi r11,r11,8\n addi r31,r31,1\n.Ldc:\n cmpw r31,r3\n blt .L1c\n lwz r31,12(r1)\n mr r3,r12\n lwz r30,8(r1)\n addi r1,r1,16\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedloop` — benchmark function synthetic:nestedloop:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedloop:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tli r12,0\n 8:\tli r11,0\n c:\tstw r31,12(r1)\n 10:\tli r31,0\n 14:\tstw r30,8(r1)\n 18:\tb dc \n 1c:\tcmpwi r3,0\n 20:\tli r30,0\n 24:\tble d4 \n 28:\tcmpwi r3,8\n 2c:\taddi r4,r3,-8\n 30:\tble b0 \n 34:\taddi r0,r4,7\n 38:\tli r10,0\n 3c:\tsrwi r0,r0,3\n 40:\tmtctr r0\n 44:\tcmpwi r4,0\n 48:\tble b0 \n 4c:\taddi r0,r30,1\n 50:\taddi r8,r30,2\n 54:\tmullw r9,r31,r0\n 58:\tadd r12,r12,r10\n 5c:\taddi r7,r30,3\n 60:\taddi r6,r30,4\n 64:\taddi r5,r30,5\n 68:\taddi r4,r30,6\n 6c:\taddi r0,r30,7\n 70:\tadd r12,r12,r9\n 74:\tmullw r8,r31,r8\n 78:\tadd r10,r10,r11\n 7c:\taddi r30,r30,8\n 80:\tmullw r7,r31,r7\n 84:\tadd r12,r12,r8\n 88:\tmullw r6,r31,r6\n 8c:\tadd r12,r12,r7\n 90:\tmullw r5,r31,r5\n 94:\tadd r12,r12,r6\n 98:\tmullw r4,r31,r4\n 9c:\tadd r12,r12,r5\n a0:\tmullw r0,r31,r0\n a4:\tadd r12,r12,r4\n a8:\tadd r12,r12,r0\n ac:\tbdnz 4c \n b0:\tmullw r4,r30,r31\n b4:\tsubf r0,r30,r3\n b8:\tmtctr r0\n bc:\tcmpw r30,r3\n c0:\tbge d4 \n c4:\tadd r12,r12,r4\n c8:\tadd r4,r4,r31\n cc:\taddi r30,r30,1\n d0:\tbdnz c4 \n d4:\taddi r11,r11,8\n d8:\taddi r31,r31,1\n dc:\tcmpw r31,r3\n e0:\tblt 1c \n e4:\tlwz r31,12(r1)\n e8:\tmr r3,r12\n ec:\tlwz r30,8(r1)\n f0:\taddi r1,r1,16\n f4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000f8 nestedloop\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 nestedloop\n\n\nContents of section .text:\n 0000 9421fff0 39800000 39600000 93e1000c .!..9...9`......\n 0010 3be00000 93c10008 480000c4 2c030000 ;.......H...,...\n 0020 3bc00000 408100b0 2c030008 3883fff8 ;...@...,...8...\n 0030 40810080 38040007 39400000 5400e8fe @...8...9@..T...\n 0040 7c0903a6 2c040000 40810068 381e0001 |...,...@..h8...\n 0050 391e0002 7d3f01d6 7d8c5214 38fe0003 9...}?..}.R.8...\n 0060 38de0004 38be0005 389e0006 381e0007 8...8...8...8...\n 0070 7d8c4a14 7d1f41d6 7d4a5a14 3bde0008 }.J.}.A.}JZ.;...\n 0080 7cff39d6 7d8c4214 7cdf31d6 7d8c3a14 |.9.}.B.|.1.}.:.\n 0090 7cbf29d6 7d8c3214 7c9f21d6 7d8c2a14 |.).}.2.|.!.}.*.\n 00a0 7c1f01d6 7d8c2214 7d8c0214 4200ffa0 |...}.\".}...B...\n 00b0 7c9ef9d6 7c1e1850 7c0903a6 7c1e1800 |...|..P|...|...\n 00c0 40800014 7d8c2214 7c84fa14 3bde0001 @...}.\".|...;...\n 00d0 4200fff4 396b0008 3bff0001 7c1f1800 B...9k..;...|...\n 00e0 4180ff3c 83e1000c 7d836378 83c10008 A..<....}.cx....\n 00f0 38210010 4e800020 8!..N.. \nContents of section .mwcats.text:\n 0000 020000f8 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:notb:agbcc","sym":"notb","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","bool"],"loc":1,"refSource":"int notb(int x){ return !x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnotb\n\t.type\t notb,function\n\t.thumb_func\nnotb:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t notb,.Lfe1-notb\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 notb(u32 a0) {\n s32 v0;\n if (a0 != 0) {\n v0 = 0;\n } else {\n v0 = 1;\n }\n return v0;\n}\n","score":3,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 notb(s32 arg0) {\n s32 var_r1;\n\n var_r1 = 0;\n if (arg0 == 0) {\n var_r1 = 1;\n }\n return var_r1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `notb` — benchmark function synthetic:notb:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnotb\n\t.type\t notb,function\n\t.thumb_func\nnotb:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t notb,.Lfe1-notb\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function notb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `notb` — benchmark function synthetic:notb:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:notb:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnotb\n\t.type\t notb,function\n\t.thumb_func\nnotb:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t notb,.Lfe1-notb\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name notb # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:notb:gcc2.7.2kmc","sym":"notb","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","bool"],"loc":1,"refSource":"int notb(int x){ return !x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-7e372b1717a302d5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 notb\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 notb(u32 a0) {\n return a0 < 1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 notb(s32 arg0) {\n return arg0 == 0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `notb` — benchmark function synthetic:notb:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel notb\n jr\t$ra\n sltiu\t$v0, $a0, 1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function notb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `notb` — benchmark function synthetic:notb:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:notb:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-7e372b1717a302d5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 notb\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name notb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:notb:ido7.1","sym":"notb","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","bool"],"loc":1,"refSource":"int notb(int x){ return !x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 notb\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 65333732 62313731 37613330 ef-7e372b1717a30\n 0130 3264352f 7265662e 63006e6f 74620000 2d5/ref.c.notb..\n 0140 6e6f7462 00000000 00000000 00000001 notb............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 notb(u32 a0) {\n return a0 < 1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 notb(s32 arg0) {\n return arg0 == 0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `notb` — benchmark function synthetic:notb:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel notb\n jr\t$ra\n sltiu\t$v0, $a0, 1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function notb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `notb` — benchmark function synthetic:notb:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:notb:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 notb\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 65333732 62313731 37613330 ef-7e372b1717a30\n 0130 3264352f 7265662e 63006e6f 74620000 2d5/ref.c.notb..\n 0140 6e6f7462 00000000 00000000 00000001 notb............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name notb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:notb:mwcc_242_81","sym":"notb","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","bool"],"loc":1,"refSource":"int notb(int x){ return !x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcntlzw r0,r3\n 4:\tsrwi r3,r0,5\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c notb\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 notb\n\n\nContents of section .text:\n 0000 7c600034 5403d97e 4e800020 |`.4T..~N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 notb(u32 a0) {\n return a0 == 0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 notb(s32 arg0) {\n return arg0 == 0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `notb` — benchmark function synthetic:notb:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel notb\n cntlzw r0,r3\n srwi r3,r0,5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function notb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `notb` — benchmark function synthetic:notb:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:notb:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcntlzw r0,r3\n 4:\tsrwi r3,r0,5\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c notb\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 notb\n\n\nContents of section .text:\n 0000 7c600034 5403d97e 4e800020 |`.4T..~N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name notb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:powi:agbcc","sym":"powi","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for","arithmetic"],"loc":1,"refSource":"int powi(int base,int e){ int r=1,i; for(i=0;i 0) {\n do {\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n}\n","score":4,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":3,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":9,"ratio":0.1111111111111111,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `powi` — benchmark function synthetic:powi:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tpowi\n\t.type\t powi,function\n\t.thumb_func\npowi:\n\tadd\tr2, r0, #0\n\tmov\tr0, #0x1\n\tcmp\tr1, #0\n\tble\t.L4\t@cond_branch\n.L6:\n\tmul\tr0, r0, r2\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t powi,.Lfe1-powi\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function powi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `powi` — benchmark function synthetic:powi:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:powi:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tpowi\n\t.type\t powi,function\n\t.thumb_func\npowi:\n\tadd\tr2, r0, #0\n\tmov\tr0, #0x1\n\tcmp\tr1, #0\n\tble\t.L4\t@cond_branch\n.L6:\n\tmul\tr0, r0, r2\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t powi,.Lfe1-powi\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name powi # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:powi:gcc2.7.2kmc","sym":"powi","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for","arithmetic"],"loc":1,"refSource":"int powi(int base,int e){ int r=1,i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tli\ta2,1\n 8:\tblez\ta1,30 \n c:\tmove\tv1,zero\n 10:\taddiu\tv1,v1,1\n 14:\tslt\tv0,v1,a1\n 18:\tmult\ta2,a0\n 1c:\tmflo\ta2\n\t...\n 28:\tbnezl\tv0,14 \n 2c:\taddiu\tv1,v1,1\n 30:\tmove\tv0,a2\n 34:\tjr\tra\n 38:\taddiu\tsp,sp,8\n 3c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2911ded927f4f46f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c powi\n\n\nContents of section .text:\n 0000 27bdfff8 24060001 18a00009 00001821 '...$..........!\n 0010 24630001 0065102a 00c40018 00003012 $c...e.*......0.\n 0020 00000000 00000000 5440fffa 24630001 ........T@..$c..\n 0030 00c01021 03e00008 27bd0008 00000000 ...!....'.......\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'powi' — lift: cannot lift 'powi': unmodelled control transfer 'bnezl' at 0x28 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-8 */\n/* 4:\tli\ta2,1 */\n/* 8:\tblez\ta1,30 */\n/* c:\tmove\tv1,zero */\n/* 10:\taddiu\tv1,v1,1 */\n/* 14:\tslt\tv0,v1,a1 */\n/* 18:\tmult\ta2,a0 */\n/* 1c:\tmflo\ta2 */\n/* \t... */\n/* 28:\tbnezl\tv0,14 */\n/* 2c:\taddiu\tv1,v1,1 */\n/* 30:\tmove\tv0,a2 */\n/* 34:\tjr\tra */\n/* 38:\taddiu\tsp,sp,8 */\n/* 3c:\tnop */\nvoid powi(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'powi': unmodelled control transfer 'bnezl' at 0x28 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'powi': unmodelled control transfer 'bnezl' at 0x28 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 powi(s32 arg0, s32 arg1) {\n s32 var_a2;\n s32 var_v1;\n\n var_a2 = 1;\n var_v1 = 0;\n if (arg1 > 0) {\n do {\n var_v1 += 1;\n var_a2 *= arg0;\n } while (var_v1 < arg1);\n }\n return var_a2;\n}\n","score":4,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":15,"ratio":0.26666666666666666,"kinds":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `powi` — benchmark function synthetic:powi:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel powi\n addiu\t$sp, $sp, -8\n li\t$a2, 1\n blez\t$a1, .L30\n move\t$v1, $zero\n addiu\t$v1, $v1, 1\n.L14:\n slt\t$v0, $v1, $a1\n mult\t$a2, $a0\n mflo\t$a2\n bnezl\t$v0, .L14\n addiu\t$v1, $v1, 1\n.L30:\n move\t$v0, $a2\n jr\t$ra\n addiu\t$sp, $sp, 8\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function powi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `powi` — benchmark function synthetic:powi:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:powi:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tli\ta2,1\n 8:\tblez\ta1,30 \n c:\tmove\tv1,zero\n 10:\taddiu\tv1,v1,1\n 14:\tslt\tv0,v1,a1\n 18:\tmult\ta2,a0\n 1c:\tmflo\ta2\n\t...\n 28:\tbnezl\tv0,14 \n 2c:\taddiu\tv1,v1,1\n 30:\tmove\tv0,a2\n 34:\tjr\tra\n 38:\taddiu\tsp,sp,8\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2911ded927f4f46f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c powi\n\n\nContents of section .text:\n 0000 27bdfff8 24060001 18a00009 00001821 '...$..........!\n 0010 24630001 0065102a 00c40018 00003012 $c...e.*......0.\n 0020 00000000 00000000 5440fffa 24630001 ........T@..$c..\n 0030 00c01021 03e00008 27bd0008 00000000 ...!....'.......\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name powi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:powi:ido7.1","sym":"powi","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for","arithmetic"],"loc":1,"refSource":"int powi(int base,int e){ int r=1,i; for(i=0;i:\n 0:\tli\tv1,1\n 4:\tblez\ta1,78 \n 8:\tmove\tv0,zero\n c:\tandi\ta3,a1,0x3\n 10:\tbeqz\ta3,34 \n 14:\tmove\ta2,a3\n 18:\tmultu\tv1,a0\n 1c:\taddiu\tv0,v0,1\n 20:\tmflo\tv1\n 24:\tbne\ta2,v0,18 \n 28:\tnop\n 2c:\tbeq\tv0,a1,78 \n 30:\tnop\n 34:\tmultu\tv1,a0\n 38:\taddiu\tv0,v0,4\n 3c:\tmflo\tv1\n\t...\n 48:\tmultu\tv1,a0\n 4c:\tmflo\tv1\n\t...\n 58:\tmultu\tv1,a0\n 5c:\tmflo\tv1\n\t...\n 68:\tmultu\tv1,a0\n 6c:\tmflo\tv1\n 70:\tbne\tv0,a1,34 \n 74:\tnop\n 78:\tjr\tra\n 7c:\tmove\tv0,v1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000080 powi\n\n\nContents of section .text:\n 0000 24030001 18a0001c 00001025 30a70003 $..........%0...\n 0010 10e00008 00e03025 00640019 24420001 ......0%.d..$B..\n 0020 00001812 14c2fffc 00000000 10450012 .............E..\n 0030 00000000 00640019 24420004 00001812 .....d..$B......\n 0040 00000000 00000000 00640019 00001812 .........d......\n 0050 00000000 00000000 00640019 00001812 .........d......\n 0060 00000000 00000000 00640019 00001812 .........d......\n 0070 1445fff0 00000000 03e00008 00601025 .E...........`.%\nContents of section .options:\n 0000 01200000 00000000 800000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000020 00000004 000001e8 p...... ........\n 0010 00000005 00000328 00000001 000001ec .......(........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000034 00000294 .......P...4....\n 0040 00000008 000002c8 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 08080804 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000080 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 39313164 65643932 37663466 ef-2911ded927f4f\n 0130 3436662f 7265662e 6300706f 77690000 46f/ref.c.powi..\n 0140 706f7769 00000000 00000000 00000001 powi............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000020 00000000 00000000 ....... ........\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000004 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'powi' — structure: cannot structure 'powi': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tli\tv1,1 */\n/* 4:\tblez\ta1,78 */\n/* 8:\tmove\tv0,zero */\n/* c:\tandi\ta3,a1,0x3 */\n/* 10:\tbeqz\ta3,34 */\n/* 14:\tmove\ta2,a3 */\n/* 18:\tmultu\tv1,a0 */\n/* 1c:\taddiu\tv0,v0,1 */\n/* 20:\tmflo\tv1 */\n/* 24:\tbne\ta2,v0,18 */\n/* 28:\tnop */\n/* 2c:\tbeq\tv0,a1,78 */\n/* 30:\tnop */\n/* 34:\tmultu\tv1,a0 */\n/* 38:\taddiu\tv0,v0,4 */\n/* 3c:\tmflo\tv1 */\n/* \t... */\n/* 48:\tmultu\tv1,a0 */\n/* 4c:\tmflo\tv1 */\n/* \t... */\n/* 58:\tmultu\tv1,a0 */\n/* 5c:\tmflo\tv1 */\n/* \t... */\n/* 68:\tmultu\tv1,a0 */\n/* 6c:\tmflo\tv1 */\n/* 70:\tbne\tv0,a1,34 */\n/* 74:\tnop */\n/* 78:\tjr\tra */\n/* 7c:\tmove\tv0,v1 */\nvoid powi(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'powi': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":37,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'powi': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 powi(s32 arg0, s32 arg1) {\n s32 temp_a3;\n s32 var_v0;\n s32 var_v1;\n\n var_v1 = 1;\n var_v0 = 0;\n if (arg1 > 0) {\n temp_a3 = arg1 & 3;\n if (temp_a3 != 0) {\n do {\n var_v0 += 1;\n var_v1 *= arg0;\n } while (temp_a3 != var_v0);\n if (var_v0 != arg1) {\n goto loop_4;\n }\n } else {\n do {\nloop_4:\n var_v0 += 4;\n var_v1 = var_v1 * arg0 * arg0 * arg0 * arg0;\n } while (var_v0 != arg1);\n }\n }\n return var_v1;\n}\n","score":34,"maxScore":55,"compileErrors":null,"breakdown":{"insert":23,"delete":0,"replace":0,"opMismatch":0,"argMismatch":11},"quality":{"score":88,"lines":26,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":34,"maxScore":55,"ratio":0.6181818181818182,"kinds":{"insert":23,"delete":0,"replace":0,"opMismatch":0,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `powi` — benchmark function synthetic:powi:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel powi\n li\t$v1, 1\n blez\t$a1, .L78\n move\t$v0, $zero\n andi\t$a3, $a1, 0x3\n beqz\t$a3, .L34\n move\t$a2, $a3\n.L18:\n multu\t$v1, $a0\n addiu\t$v0, $v0, 1\n mflo\t$v1\n bne\t$a2, $v0, .L18\n nop\n beq\t$v0, $a1, .L78\n nop\n.L34:\n multu\t$v1, $a0\n addiu\t$v0, $v0, 4\n mflo\t$v1\n multu\t$v1, $a0\n mflo\t$v1\n multu\t$v1, $a0\n mflo\t$v1\n multu\t$v1, $a0\n mflo\t$v1\n bne\t$v0, $a1, .L34\n nop\n.L78:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function powi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `powi` — benchmark function synthetic:powi:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:powi:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv1,1\n 4:\tblez\ta1,78 \n 8:\tmove\tv0,zero\n c:\tandi\ta3,a1,0x3\n 10:\tbeqz\ta3,34 \n 14:\tmove\ta2,a3\n 18:\tmultu\tv1,a0\n 1c:\taddiu\tv0,v0,1\n 20:\tmflo\tv1\n 24:\tbne\ta2,v0,18 \n 28:\tnop\n 2c:\tbeq\tv0,a1,78 \n 30:\tnop\n 34:\tmultu\tv1,a0\n 38:\taddiu\tv0,v0,4\n 3c:\tmflo\tv1\n\t...\n 48:\tmultu\tv1,a0\n 4c:\tmflo\tv1\n\t...\n 58:\tmultu\tv1,a0\n 5c:\tmflo\tv1\n\t...\n 68:\tmultu\tv1,a0\n 6c:\tmflo\tv1\n 70:\tbne\tv0,a1,34 \n 74:\tnop\n 78:\tjr\tra\n 7c:\tmove\tv0,v1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000080 powi\n\n\nContents of section .text:\n 0000 24030001 18a0001c 00001025 30a70003 $..........%0...\n 0010 10e00008 00e03025 00640019 24420001 ......0%.d..$B..\n 0020 00001812 14c2fffc 00000000 10450012 .............E..\n 0030 00000000 00640019 24420004 00001812 .....d..$B......\n 0040 00000000 00000000 00640019 00001812 .........d......\n 0050 00000000 00000000 00640019 00001812 .........d......\n 0060 00000000 00000000 00640019 00001812 .........d......\n 0070 1445fff0 00000000 03e00008 00601025 .E...........`.%\nContents of section .options:\n 0000 01200000 00000000 800000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000020 00000004 000001e8 p...... ........\n 0010 00000005 00000328 00000001 000001ec .......(........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000034 00000294 .......P...4....\n 0040 00000008 000002c8 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 08080804 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000080 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 39313164 65643932 37663466 ef-2911ded927f4f\n 0130 3436662f 7265662e 6300706f 77690000 46f/ref.c.powi..\n 0140 706f7769 00000000 00000000 00000001 powi............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000020 00000000 00000000 ....... ........\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000004 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name powi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:powi:mwcc_242_81","sym":"powi","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for","arithmetic"],"loc":1,"refSource":"int powi(int base,int e){ int r=1,i; for(i=0;i:\n 0:\tcmpwi r4,0\n 4:\tli r6,1\n 8:\tli r7,0\n c:\tble 70 \n 10:\tcmpwi r4,8\n 14:\taddi r5,r4,-8\n 18:\tble 58 \n 1c:\taddi r0,r5,7\n 20:\tsrwi r0,r0,3\n 24:\tmtctr r0\n 28:\tcmpwi r5,0\n 2c:\tble 58 \n 30:\tmullw r6,r6,r3\n 34:\taddi r7,r7,8\n 38:\tmullw r6,r6,r3\n 3c:\tmullw r6,r6,r3\n 40:\tmullw r6,r6,r3\n 44:\tmullw r6,r6,r3\n 48:\tmullw r6,r6,r3\n 4c:\tmullw r6,r6,r3\n 50:\tmullw r6,r6,r3\n 54:\tbdnz 30 \n 58:\tsubf r0,r7,r4\n 5c:\tmtctr r0\n 60:\tcmpw r7,r4\n 64:\tbge 70 \n 68:\tmullw r6,r6,r3\n 6c:\tbdnz 68 \n 70:\tmr r3,r6\n 74:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000078 powi\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 powi\n\n\nContents of section .text:\n 0000 2c040000 38c00001 38e00000 40810064 ,...8...8...@..d\n 0010 2c040008 38a4fff8 40810040 38050007 ,...8...@..@8...\n 0020 5400e8fe 7c0903a6 2c050000 4081002c T...|...,...@..,\n 0030 7cc619d6 38e70008 7cc619d6 7cc619d6 |...8...|...|...\n 0040 7cc619d6 7cc619d6 7cc619d6 7cc619d6 |...|...|...|...\n 0050 7cc619d6 4200ffdc 7c072050 7c0903a6 |...B...|. P|...\n 0060 7c072000 4080000c 7cc619d6 4200fffc |. .@...|...B...\n 0070 7cc33378 4e800020 |.3xN.. \nContents of section .mwcats.text:\n 0000 02000078 00000000 ...x.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 powi(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n if (a1 <= 0) {\n v0 = 1;\n } else {\n if (a1 <= 8) {\n v1 = 0;\n v0 = 1;\n } else {\n v0 = 1;\n v1 = 0;\n for (v2 = a1 + -8 + 7 >> 3; v2 != 0; v2 = v2 - 1) {\n v1 = v1 + 8;\n v0 = v0 * a0 * a0 * a0 * a0 * a0 * a0 * a0 * a0;\n }\n }\n v3 = v0;\n for (v4 = a1 - v1; v4 != 0; v4 = v4 - 1) {\n v3 = v3 * a0;\n }\n v0 = v3;\n }\n return v0;\n}\n","score":87,"maxScore":92,"compileErrors":null,"breakdown":{"insert":62,"delete":4,"replace":3,"opMismatch":4,"argMismatch":14},"quality":{"score":100,"lines":28,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 powi(s32 arg0, s32 arg1) {\n s32 temp_r5;\n s32 var_ctr_2;\n s32 var_r6;\n s32 var_r7;\n u32 var_ctr;\n\n var_r6 = 1;\n var_r7 = 0;\n if (arg1 > 0) {\n temp_r5 = arg1 - 8;\n if (arg1 > 8) {\n var_ctr = (u32) (temp_r5 + 7) >> 3U;\n if (temp_r5 > 0) {\n do {\n var_r7 += 8;\n var_r6 = var_r6 * arg0 * arg0 * arg0 * arg0 * arg0 * arg0 * arg0 * arg0;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_ctr_2 = arg1 - var_r7;\n if (var_r7 < arg1) {\n do {\n var_r6 *= arg0;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r6;\n}\n","score":21,"maxScore":34,"compileErrors":null,"breakdown":{"insert":4,"delete":4,"replace":0,"opMismatch":2,"argMismatch":11},"quality":{"score":100,"lines":30,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":21,"maxScore":34,"ratio":0.6176470588235294,"kinds":{"insert":4,"delete":4,"replace":0,"opMismatch":2,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `powi` — benchmark function synthetic:powi:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel powi\n cmpwi r4,0\n li r6,1\n li r7,0\n ble .L70\n cmpwi r4,8\n addi r5,r4,-8\n ble .L58\n addi r0,r5,7\n srwi r0,r0,3\n mtctr r0\n cmpwi r5,0\n ble .L58\n.L30:\n mullw r6,r6,r3\n addi r7,r7,8\n mullw r6,r6,r3\n mullw r6,r6,r3\n mullw r6,r6,r3\n mullw r6,r6,r3\n mullw r6,r6,r3\n mullw r6,r6,r3\n mullw r6,r6,r3\n bdnz .L30\n.L58:\n subf r0,r7,r4\n mtctr r0\n cmpw r7,r4\n bge .L70\n.L68:\n mullw r6,r6,r3\n bdnz .L68\n.L70:\n mr r3,r6\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function powi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `powi` — benchmark function synthetic:powi:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:powi:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r4,0\n 4:\tli r6,1\n 8:\tli r7,0\n c:\tble 70 \n 10:\tcmpwi r4,8\n 14:\taddi r5,r4,-8\n 18:\tble 58 \n 1c:\taddi r0,r5,7\n 20:\tsrwi r0,r0,3\n 24:\tmtctr r0\n 28:\tcmpwi r5,0\n 2c:\tble 58 \n 30:\tmullw r6,r6,r3\n 34:\taddi r7,r7,8\n 38:\tmullw r6,r6,r3\n 3c:\tmullw r6,r6,r3\n 40:\tmullw r6,r6,r3\n 44:\tmullw r6,r6,r3\n 48:\tmullw r6,r6,r3\n 4c:\tmullw r6,r6,r3\n 50:\tmullw r6,r6,r3\n 54:\tbdnz 30 \n 58:\tsubf r0,r7,r4\n 5c:\tmtctr r0\n 60:\tcmpw r7,r4\n 64:\tbge 70 \n 68:\tmullw r6,r6,r3\n 6c:\tbdnz 68 \n 70:\tmr r3,r6\n 74:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000078 powi\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 powi\n\n\nContents of section .text:\n 0000 2c040000 38c00001 38e00000 40810064 ,...8...8...@..d\n 0010 2c040008 38a4fff8 40810040 38050007 ,...8...@..@8...\n 0020 5400e8fe 7c0903a6 2c050000 4081002c T...|...,...@..,\n 0030 7cc619d6 38e70008 7cc619d6 7cc619d6 |...8...|...|...\n 0040 7cc619d6 7cc619d6 7cc619d6 7cc619d6 |...|...|...|...\n 0050 7cc619d6 4200ffdc 7c072050 7c0903a6 |...B...|. P|...\n 0060 7c072000 4080000c 7cc619d6 4200fffc |. .@...|...B...\n 0070 7cc33378 4e800020 |.3xN.. \nContents of section .mwcats.text:\n 0000 02000078 00000000 ...x.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name powi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:promsh:agbcc","sym":"promsh","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","promotion","arithmetic"],"loc":1,"refSource":"int promsh(s16 a,s16 b){ return a+b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tpromsh\n\t.type\t promsh,function\n\t.thumb_func\npromsh:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t promsh,.Lfe1-promsh\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 promsh(u32 a0, u32 a1) {\n return (s16)a0 + (s16)a1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 promsh(s16 arg0, s16 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `promsh` — benchmark function synthetic:promsh:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tpromsh\n\t.type\t promsh,function\n\t.thumb_func\npromsh:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t promsh,.Lfe1-promsh\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function promsh # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `promsh` — benchmark function synthetic:promsh:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:promsh:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tpromsh\n\t.type\t promsh,function\n\t.thumb_func\npromsh:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t promsh,.Lfe1-promsh\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name promsh # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:promsh:gcc2.7.2kmc","sym":"promsh","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","promotion","arithmetic"],"loc":1,"refSource":"int promsh(s16 a,s16 b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a1,0x10\n c:\tsra\tv0,v0,0x10\n 10:\tjr\tra\n 14:\taddu\tv0,a0,v0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5086c31083528287/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 promsh\n\n\nContents of section .text:\n 0000 00042400 00042403 00051400 00021403 ..$...$.........\n 0010 03e00008 00821021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 promsh(s32 a0, s32 a1) {\n return (a0 << 16 >> 16) + (a1 << 16 >> 16);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 promsh(s16 arg0, s16 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `promsh` — benchmark function synthetic:promsh:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel promsh\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$v0, $a1, 0x10\n sra\t$v0, $v0, 0x10\n jr\t$ra\n addu\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function promsh # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `promsh` — benchmark function synthetic:promsh:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:promsh:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a1,0x10\n c:\tsra\tv0,v0,0x10\n 10:\tjr\tra\n 14:\taddu\tv0,a0,v0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5086c31083528287/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 promsh\n\n\nContents of section .text:\n 0000 00042400 00042403 00051400 00021403 ..$...$.........\n 0010 03e00008 00821021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name promsh # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:promsh:ido7.1","sym":"promsh","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","promotion","arithmetic"],"loc":1,"refSource":"int promsh(s16 a,s16 b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tsll\ta1,a1,0x10\n c:\tsll\ta0,a0,0x10\n 10:\tsra\ta0,a0,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tjr\tra\n 1c:\taddu\tv0,a0,a1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 promsh\n\n\nContents of section .text:\n 0000 afa40000 afa50004 00052c00 00042400 ..........,...$.\n 0010 00042403 00052c03 03e00008 00851021 ..$...,........!\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 07000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000020 20200001 00000001 ....... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 30383663 33313038 33353238 ef-5086c31083528\n 0130 3238372f 7265662e 63007072 6f6d7368 287/ref.c.promsh\n 0140 00000000 70726f6d 73680000 00000000 ....promsh......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000008 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 promsh(u32 a0, u32 a1) {\n return (a0 << 16 >> 16) + (a1 << 16 >> 16);\n}\n","score":7,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":2,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 promsh(s16 arg0, s16 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `promsh` — benchmark function synthetic:promsh:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel promsh\n sw\t$a0, 0($sp)\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sra\t$a1, $a1, 0x10\n jr\t$ra\n addu\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function promsh # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `promsh` — benchmark function synthetic:promsh:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:promsh:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tsll\ta1,a1,0x10\n c:\tsll\ta0,a0,0x10\n 10:\tsra\ta0,a0,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tjr\tra\n 1c:\taddu\tv0,a0,a1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 promsh\n\n\nContents of section .text:\n 0000 afa40000 afa50004 00052c00 00042400 ..........,...$.\n 0010 00042403 00052c03 03e00008 00851021 ..$...,........!\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 07000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000020 20200001 00000001 ....... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 30383663 33313038 33353238 ef-5086c31083528\n 0130 3238372f 7265662e 63007072 6f6d7368 287/ref.c.promsh\n 0140 00000000 70726f6d 73680000 00000000 ....promsh......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000008 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name promsh # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:promsh:mwcc_242_81","sym":"promsh","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","promotion","arithmetic"],"loc":1,"refSource":"int promsh(s16 a,s16 b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\textsh r3,r3\n 4:\textsh r0,r4\n 8:\tadd r3,r3,r0\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 promsh\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 promsh\n\n\nContents of section .text:\n 0000 7c630734 7c800734 7c630214 4e800020 |c.4|..4|c..N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 promsh(u32 a0, u32 a1) {\n return (s16)a0 + (s16)a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 promsh(s16 arg0, s16 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `promsh` — benchmark function synthetic:promsh:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel promsh\n extsh r3,r3\n extsh r0,r4\n add r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function promsh # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `promsh` — benchmark function synthetic:promsh:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:promsh:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\textsh r3,r3\n 4:\textsh r0,r4\n 8:\tadd r3,r3,r0\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 promsh\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 promsh\n\n\nContents of section .text:\n 0000 7c630734 7c800734 7c630214 4e800020 |c.4|..4|c..N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name promsh # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ptradd:agbcc","sym":"ptradd","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","pointer-arith"],"loc":1,"refSource":"int *ptradd(int *p,int n){ return p+n; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tptradd\n\t.type\t ptradd,function\n\t.thumb_func\nptradd:\n\tlsl\tr1, r1, #0x2\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ptradd,.Lfe1-ptradd\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 ptradd(u32 a0, u32 a1) {\n return a0 + (a1 << 2);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 ptradd(s32 arg0, s32 arg1) {\n return arg0 + (arg1 * 4);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ptradd` — benchmark function synthetic:ptradd:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tptradd\n\t.type\t ptradd,function\n\t.thumb_func\nptradd:\n\tlsl\tr1, r1, #0x2\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ptradd,.Lfe1-ptradd\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ptradd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ptradd` — benchmark function synthetic:ptradd:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ptradd:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tptradd\n\t.type\t ptradd,function\n\t.thumb_func\nptradd:\n\tlsl\tr1, r1, #0x2\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ptradd,.Lfe1-ptradd\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ptradd # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ptradd:gcc2.7.2kmc","sym":"ptradd","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","pointer-arith"],"loc":1,"refSource":"int *ptradd(int *p,int n){ return p+n; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a1,0x2\n 4:\tjr\tra\n 8:\taddu\tv0,a0,v0\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f4d5bcd911b5ff6b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c ptradd\n\n\nContents of section .text:\n 0000 00051080 03e00008 00821021 00000000 ...........!....\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 ptradd(u32 a0, u32 a1) {\n return a0 + (a1 << 2);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 ptradd(s32 arg0, s32 arg1) {\n return arg0 + (arg1 * 4);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ptradd` — benchmark function synthetic:ptradd:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ptradd\n sll\t$v0, $a1, 0x2\n jr\t$ra\n addu\t$v0, $a0, $v0\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ptradd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ptradd` — benchmark function synthetic:ptradd:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ptradd:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a1,0x2\n 4:\tjr\tra\n 8:\taddu\tv0,a0,v0\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f4d5bcd911b5ff6b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c ptradd\n\n\nContents of section .text:\n 0000 00051080 03e00008 00821021 00000000 ...........!....\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ptradd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ptradd:ido7.1","sym":"ptradd","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","pointer-arith"],"loc":1,"refSource":"int *ptradd(int *p,int n){ return p+n; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x2\n 4:\tjr\tra\n 8:\taddu\tv0,t6,a0\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c ptradd\n\n\nContents of section .text:\n 0000 00057080 03e00008 01c41021 00000000 ..p........!....\nContents of section .options:\n 0000 01200000 00000000 80004034 00000000 . ........@4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004034 00000000 00000000 00000000 ..@4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 34643562 63643931 31623566 ef-f4d5bcd911b5f\n 0130 6636622f 7265662e 63007074 72616464 f6b/ref.c.ptradd\n 0140 00000000 70747261 64640000 00000000 ....ptradd......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000003 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 ptradd(u32 a0, u32 a1) {\n return (a1 << 2) + a0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 ptradd(s32 arg0, s32 arg1) {\n return (arg1 * 4) + arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ptradd` — benchmark function synthetic:ptradd:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ptradd\n sll\t$t6, $a1, 0x2\n jr\t$ra\n addu\t$v0, $t6, $a0\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ptradd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ptradd` — benchmark function synthetic:ptradd:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ptradd:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x2\n 4:\tjr\tra\n 8:\taddu\tv0,t6,a0\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c ptradd\n\n\nContents of section .text:\n 0000 00057080 03e00008 01c41021 00000000 ..p........!....\nContents of section .options:\n 0000 01200000 00000000 80004034 00000000 . ........@4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004034 00000000 00000000 00000000 ..@4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 34643562 63643931 31623566 ef-f4d5bcd911b5f\n 0130 6636622f 7265662e 63007074 72616464 f6b/ref.c.ptradd\n 0140 00000000 70747261 64640000 00000000 ....ptradd......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000003 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ptradd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ptradd:mwcc_242_81","sym":"ptradd","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","pointer-arith"],"loc":1,"refSource":"int *ptradd(int *p,int n){ return p+n; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,2\n 4:\tadd r3,r3,r0\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c ptradd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ptradd\n\n\nContents of section .text:\n 0000 5480103a 7c630214 4e800020 T..:|c..N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 ptradd(u32 a0, u32 a1) {\n return a0 + (a1 << 2);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 ptradd(s32 arg0, s32 arg1) {\n return arg0 + (arg1 * 4);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ptradd` — benchmark function synthetic:ptradd:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ptradd\n slwi r0,r4,2\n add r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ptradd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ptradd` — benchmark function synthetic:ptradd:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ptradd:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,2\n 4:\tadd r3,r3,r0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c ptradd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ptradd\n\n\nContents of section .text:\n 0000 5480103a 7c630214 4e800020 T..:|c..N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ptradd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:revarr:agbcc","sym":"revarr","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","memory","store"],"loc":1,"refSource":"void revarr(int *a,int n){ int i,j,t; for(i=0,j=n-1;i 0) {\n var_r2 = &var_r4[var_r3];\n do {\n temp_r1 = *var_r4;\n *var_r4 = *var_r2;\n var_r4 += 4;\n *var_r2 = temp_r1;\n var_r5 += 1;\n var_r2 -= 4;\n var_r3 -= 1;\n } while (var_r5 < var_r3);\n }\n}\n","score":9,"maxScore":22,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":0,"opMismatch":1,"argMismatch":5},"quality":{"score":100,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":22,"ratio":0.2727272727272727,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `revarr` — benchmark function synthetic:revarr:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trevarr\n\t.type\t revarr,function\n\t.thumb_func\nrevarr:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tmov\tr5, #0x0\n\tsub\tr3, r1, #0x1\n\tcmp\tr5, r3\n\tbge\t.L4\t@cond_branch\n\tlsl\tr0, r3, #0x2\n\tadd\tr2, r0, r4\n.L6:\n\tldr\tr1, [r4]\n\tldr\tr0, [r2]\n\tstmia\tr4!, {r0}\n\tstr\tr1, [r2]\n\tadd\tr5, r5, #0x1\n\tsub\tr2, r2, #0x4\n\tsub\tr3, r3, #0x1\n\tcmp\tr5, r3\n\tblt\t.L6\t@cond_branch\n.L4:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t revarr,.Lfe1-revarr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid revarr(int*,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function revarr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `revarr` — benchmark function synthetic:revarr:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:revarr:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trevarr\n\t.type\t revarr,function\n\t.thumb_func\nrevarr:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tmov\tr5, #0x0\n\tsub\tr3, r1, #0x1\n\tcmp\tr5, r3\n\tbge\t.L4\t@cond_branch\n\tlsl\tr0, r3, #0x2\n\tadd\tr2, r0, r4\n.L6:\n\tldr\tr1, [r4]\n\tldr\tr0, [r2]\n\tstmia\tr4!, {r0}\n\tstr\tr1, [r2]\n\tadd\tr5, r5, #0x1\n\tsub\tr2, r2, #0x4\n\tsub\tr3, r3, #0x1\n\tcmp\tr5, r3\n\tblt\t.L6\t@cond_branch\n.L4:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t revarr,.Lfe1-revarr\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"revarr\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name revarr # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:revarr:gcc2.7.2kmc","sym":"revarr","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","memory","store"],"loc":1,"refSource":"void revarr(int *a,int n){ int i,j,t; for(i=0,j=n-1;i:\n 0:\taddiu\tsp,sp,-8\n 4:\taddiu\ta1,a1,-1\n 8:\tblez\ta1,40 \n c:\tmove\ta3,zero\n 10:\tsll\tv0,a1,0x2\n 14:\taddu\ta2,v0,a0\n 18:\tlw\tv1,0(a0)\n 1c:\tlw\tv0,0(a2)\n 20:\taddiu\ta3,a3,1\n 24:\taddiu\ta1,a1,-1\n 28:\tsw\tv0,0(a0)\n 2c:\taddiu\ta0,a0,4\n 30:\tsw\tv1,0(a2)\n 34:\tslt\tv0,a3,a1\n 38:\tbnez\tv0,18 \n 3c:\taddiu\ta2,a2,-4\n 40:\taddiu\tsp,sp,8\n 44:\tjr\tra\n 48:\tnop\n 4c:\tnop\n","ctx":"void revarr(int*,int);","proto":{"revarr":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4def56147e8e38f9/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c revarr\n\n\nContents of section .text:\n 0000 27bdfff8 24a5ffff 18a0000d 00003821 '...$.........8!\n 0010 00051080 00443021 8c830000 8cc20000 .....D0!........\n 0020 24e70001 24a5ffff ac820000 24840004 $...$.......$...\n 0030 acc30000 00e5102a 1440fff7 24c6fffc .......*.@..$...\n 0040 27bd0008 03e00008 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"void revarr(u32 a0, s32 * a1, u32 a2) {\n s32 v0;\n s32 * v1;\n s32 * v2;\n s32 v3;\n s32 v4;\n if (a2 + -1 > 0) {\n v1 = a1;\n v3 = 0;\n v4 = a2 + -1;\n v2 = (a2 + -1 << 2) + a1;\n do {\n v0 = *v1;\n *v1 = *v2;\n *v2 = v0;\n v3 = v3 + 1;\n v4 = v4 + -1;\n v1 = v1 + 1;\n v2 = v2 + -1;\n } while (v3 < v4);\n a0 = v3 < v4;\n }\n return;\n}\n","score":16,"maxScore":20,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":2,"opMismatch":0,"argMismatch":12},"quality":{"score":100,"lines":24,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void revarr(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 *var_a2;\n s32 temp_v1;\n s32 var_a1;\n s32 var_a3;\n\n var_a0 = arg0;\n var_a1 = arg1 - 1;\n var_a3 = 0;\n if (var_a1 > 0) {\n var_a2 = &var_a0[var_a1];\n do {\n temp_v1 = *var_a0;\n var_a3 += 1;\n var_a1 -= 1;\n *var_a0 = *var_a2;\n var_a0 += 4;\n *var_a2 = temp_v1;\n var_a2 -= 4;\n } while (var_a3 < var_a1);\n }\n}\n","score":6,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":19,"ratio":0.3157894736842105,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `revarr` — benchmark function synthetic:revarr:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel revarr\n addiu\t$sp, $sp, -8\n addiu\t$a1, $a1, -1\n blez\t$a1, .L40\n move\t$a3, $zero\n sll\t$v0, $a1, 0x2\n addu\t$a2, $v0, $a0\n.L18:\n lw\t$v1, 0($a0)\n lw\t$v0, 0($a2)\n addiu\t$a3, $a3, 1\n addiu\t$a1, $a1, -1\n sw\t$v0, 0($a0)\n addiu\t$a0, $a0, 4\n sw\t$v1, 0($a2)\n slt\t$v0, $a3, $a1\n bnez\t$v0, .L18\n addiu\t$a2, $a2, -4\n.L40:\n addiu\t$sp, $sp, 8\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid revarr(int*,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function revarr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `revarr` — benchmark function synthetic:revarr:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:revarr:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\taddiu\ta1,a1,-1\n 8:\tblez\ta1,40 \n c:\tmove\ta3,zero\n 10:\tsll\tv0,a1,0x2\n 14:\taddu\ta2,v0,a0\n 18:\tlw\tv1,0(a0)\n 1c:\tlw\tv0,0(a2)\n 20:\taddiu\ta3,a3,1\n 24:\taddiu\ta1,a1,-1\n 28:\tsw\tv0,0(a0)\n 2c:\taddiu\ta0,a0,4\n 30:\tsw\tv1,0(a2)\n 34:\tslt\tv0,a3,a1\n 38:\tbnez\tv0,18 \n 3c:\taddiu\ta2,a2,-4\n 40:\taddiu\tsp,sp,8\n 44:\tjr\tra\n 48:\tnop\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4def56147e8e38f9/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c revarr\n\n\nContents of section .text:\n 0000 27bdfff8 24a5ffff 18a0000d 00003821 '...$.........8!\n 0010 00051080 00443021 8c830000 8cc20000 .....D0!........\n 0020 24e70001 24a5ffff ac820000 24840004 $...$.......$...\n 0030 acc30000 00e5102a 1440fff7 24c6fffc .......*.@..$...\n 0040 27bd0008 03e00008 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"revarr\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name revarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:revarr:ido7.1","sym":"revarr","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","memory","store"],"loc":1,"refSource":"void revarr(int *a,int n){ int i,j,t; for(i=0,j=n-1;i:\n 0:\taddiu\ta2,a1,-1\n 4:\tmove\tv1,a2\n 8:\tblez\ta2,44 \n c:\tmove\tv0,zero\n 10:\tsll\tt6,a2,0x2\n 14:\taddu\ta2,a0,t6\n 18:\tmove\ta1,a0\n 1c:\tlw\tt7,0(a2)\n 20:\tlw\ta0,0(a1)\n 24:\taddiu\tv0,v0,1\n 28:\taddiu\tv1,v1,-1\n 2c:\tslt\tat,v0,v1\n 30:\tsw\tt7,0(a1)\n 34:\taddiu\ta1,a1,4\n 38:\taddiu\ta2,a2,-4\n 3c:\tbnez\tat,1c \n 40:\tsw\ta0,4(a2)\n 44:\tjr\tra\n 48:\tnop\n 4c:\tnop\n","ctx":"void revarr(int*,int);","proto":{"revarr":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c revarr\n\n\nContents of section .text:\n 0000 24a6ffff 00c01825 18c0000e 00001025 $......%.......%\n 0010 00067080 008e3021 00802825 8ccf0000 ..p...0!..(%....\n 0020 8ca40000 24420001 2463ffff 0043082a ....$B..$c...C.*\n 0030 acaf0000 24a50004 24c6fffc 1420fff7 ....$...$.... ..\n 0040 acc40004 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8000c07e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c07e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 00000004 000001b8 p...............\n 0010 00000005 000002fc 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000038 00000264 ....... ...8...d\n 0040 00000008 0000029c 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 08080000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000004c 20200001 00000001 .......L ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 64656635 36313437 65386533 ef-4def56147e8e3\n 0130 3866392f 7265662e 63007265 76617272 8f9/ref.c.revarr\n 0140 00000000 72657661 72720000 00000000 ....revarr......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000013 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000003 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"void revarr(s32 * a0, u32 a1) {\n s32 v0;\n s32 * v1;\n s32 v2;\n s32 v3;\n if (a1 + -1 > 0) {\n v2 = 0;\n v3 = a1 + -1;\n v1 = a0 + (a1 + -1 << 2);\n do {\n v0 = *a0;\n *a0 = *v1;\n (v1 + -1)[1] = v0;\n v2 = v2 + 1;\n v3 = v3 + -1;\n a0 = a0 + 1;\n v1 = v1 + -1;\n } while (v2 < v3);\n }\n return;\n}\n","score":18,"maxScore":21,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":1,"opMismatch":0,"argMismatch":13},"quality":{"score":100,"lines":21,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void revarr(s32 *arg0, s32 arg1) {\n s32 *var_a1;\n s32 *var_a2;\n s32 temp_a0;\n s32 temp_a2;\n s32 var_v0;\n s32 var_v1;\n\n temp_a2 = arg1 - 1;\n var_v1 = temp_a2;\n var_v0 = 0;\n if (temp_a2 > 0) {\n var_a2 = &arg0[temp_a2];\n var_a1 = arg0;\n do {\n temp_a0 = *var_a1;\n var_v0 += 1;\n var_v1 -= 1;\n *var_a1 = *var_a2;\n var_a1 += 4;\n var_a2 -= 4;\n var_a2->unk4 = temp_a0;\n } while (var_v0 < var_v1);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":24,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 23: Selector requires struct/union pointer as left hand side"]},"gapSize":{"decompiler":"asmlift","score":18,"maxScore":21,"ratio":0.8571428571428571,"kinds":{"insert":2,"delete":2,"replace":1,"opMismatch":0,"argMismatch":13}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `revarr` — benchmark function synthetic:revarr:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel revarr\n addiu\t$a2, $a1, -1\n move\t$v1, $a2\n blez\t$a2, .L44\n move\t$v0, $zero\n sll\t$t6, $a2, 0x2\n addu\t$a2, $a0, $t6\n move\t$a1, $a0\n.L1c:\n lw\t$t7, 0($a2)\n lw\t$a0, 0($a1)\n addiu\t$v0, $v0, 1\n addiu\t$v1, $v1, -1\n slt\t$at, $v0, $v1\n sw\t$t7, 0($a1)\n addiu\t$a1, $a1, 4\n addiu\t$a2, $a2, -4\n bnez\t$at, .L1c\n sw\t$a0, 4($a2)\n.L44:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid revarr(int*,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function revarr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `revarr` — benchmark function synthetic:revarr:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:revarr:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\ta2,a1,-1\n 4:\tmove\tv1,a2\n 8:\tblez\ta2,44 \n c:\tmove\tv0,zero\n 10:\tsll\tt6,a2,0x2\n 14:\taddu\ta2,a0,t6\n 18:\tmove\ta1,a0\n 1c:\tlw\tt7,0(a2)\n 20:\tlw\ta0,0(a1)\n 24:\taddiu\tv0,v0,1\n 28:\taddiu\tv1,v1,-1\n 2c:\tslt\tat,v0,v1\n 30:\tsw\tt7,0(a1)\n 34:\taddiu\ta1,a1,4\n 38:\taddiu\ta2,a2,-4\n 3c:\tbnez\tat,1c \n 40:\tsw\ta0,4(a2)\n 44:\tjr\tra\n 48:\tnop\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c revarr\n\n\nContents of section .text:\n 0000 24a6ffff 00c01825 18c0000e 00001025 $......%.......%\n 0010 00067080 008e3021 00802825 8ccf0000 ..p...0!..(%....\n 0020 8ca40000 24420001 2463ffff 0043082a ....$B..$c...C.*\n 0030 acaf0000 24a50004 24c6fffc 1420fff7 ....$...$.... ..\n 0040 acc40004 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8000c07e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c07e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 00000004 000001b8 p...............\n 0010 00000005 000002fc 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000038 00000264 ....... ...8...d\n 0040 00000008 0000029c 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 08080000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000004c 20200001 00000001 .......L ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 64656635 36313437 65386533 ef-4def56147e8e3\n 0130 3866392f 7265662e 63007265 76617272 8f9/ref.c.revarr\n 0140 00000000 72657661 72720000 00000000 ....revarr......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000013 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000003 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"revarr\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name revarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:revarr:mwcc_242_81","sym":"revarr","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","memory","store"],"loc":1,"refSource":"void revarr(int *a,int n){ int i,j,t; for(i=0,j=n-1;i:\n 0:\taddi r6,r4,-1\n 4:\tli r5,0\n 8:\tslwi r0,r6,2\n c:\tadd r4,r3,r0\n 10:\tb 34 \n 14:\tlwz r7,0(r3)\n 18:\taddi r5,r5,1\n 1c:\tlwz r0,0(r4)\n 20:\taddi r6,r6,-1\n 24:\tstw r0,0(r3)\n 28:\taddi r3,r3,4\n 2c:\tstw r7,0(r4)\n 30:\taddi r4,r4,-4\n 34:\tcmpw r5,r6\n 38:\tblt 14 \n 3c:\tblr\n","ctx":"void revarr(int*,int);","proto":{"revarr":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000040 revarr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 revarr\n\n\nContents of section .text:\n 0000 38c4ffff 38a00000 54c0103a 7c830214 8...8...T..:|...\n 0010 48000024 80e30000 38a50001 80040000 H..$....8.......\n 0020 38c6ffff 90030000 38630004 90e40000 8.......8c......\n 0030 3884fffc 7c053000 4180ffdc 4e800020 8...|.0.A...N.. \nContents of section .mwcats.text:\n 0000 02000040 00000000 ...@.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"void revarr(s32 * a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 * v3;\n s32 * v4;\n v3 = a0;\n v1 = a1 + -1;\n v2 = 0;\n v4 = a0 + (a1 + -1 << 2);\n while (v2 < v1) {\n v0 = *v3;\n *v3 = *v4;\n *v4 = v0;\n v2 = v2 + 1;\n v1 = v1 + -1;\n v3 = v3 + 1;\n v4 = v4 + -1;\n }\n return;\n}\n","score":11,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":11},"quality":{"score":100,"lines":21,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void revarr(s32 *arg0, s32 arg1) {\n s32 *var_r3;\n s32 *var_r4;\n s32 temp_r7;\n s32 var_r5;\n s32 var_r6;\n\n var_r3 = arg0;\n var_r6 = arg1 - 1;\n var_r5 = 0;\n var_r4 = &var_r3[var_r6];\nloop_2:\n if (var_r5 < var_r6) {\n temp_r7 = *var_r3;\n var_r5 += 1;\n var_r6 -= 1;\n *var_r3 = *var_r4;\n var_r3 += 4;\n *var_r4 = temp_r7;\n var_r4 -= 4;\n goto loop_2;\n }\n}\n","score":24,"maxScore":26,"compileErrors":null,"breakdown":{"insert":10,"delete":10,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":88,"lines":22,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":11,"maxScore":16,"ratio":0.6875,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `revarr` — benchmark function synthetic:revarr:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel revarr\n addi r6,r4,-1\n li r5,0\n slwi r0,r6,2\n add r4,r3,r0\n b .L34\n.L14:\n lwz r7,0(r3)\n addi r5,r5,1\n lwz r0,0(r4)\n addi r6,r6,-1\n stw r0,0(r3)\n addi r3,r3,4\n stw r7,0(r4)\n addi r4,r4,-4\n.L34:\n cmpw r5,r6\n blt .L14\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid revarr(int*,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function revarr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `revarr` — benchmark function synthetic:revarr:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:revarr:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddi r6,r4,-1\n 4:\tli r5,0\n 8:\tslwi r0,r6,2\n c:\tadd r4,r3,r0\n 10:\tb 34 \n 14:\tlwz r7,0(r3)\n 18:\taddi r5,r5,1\n 1c:\tlwz r0,0(r4)\n 20:\taddi r6,r6,-1\n 24:\tstw r0,0(r3)\n 28:\taddi r3,r3,4\n 2c:\tstw r7,0(r4)\n 30:\taddi r4,r4,-4\n 34:\tcmpw r5,r6\n 38:\tblt 14 \n 3c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000040 revarr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 revarr\n\n\nContents of section .text:\n 0000 38c4ffff 38a00000 54c0103a 7c830214 8...8...T..:|...\n 0010 48000024 80e30000 38a50001 80040000 H..$....8.......\n 0020 38c6ffff 90030000 38630004 90e40000 8.......8c......\n 0030 3884fffc 7c053000 4180ffdc 4e800020 8...|.0.A...N.. \nContents of section .mwcats.text:\n 0000 02000040 00000000 ...@.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"revarr\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name revarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotl:agbcc","sym":"rotl","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotl(unsigned x,int n){ return (x<>(32-n)); }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trotl\n\t.type\t rotl,function\n\t.thumb_func\nrotl:\n\tadd\tr3, r0, #0\n\tlsl\tr0, r0, r1\n\tmov\tr2, #0x20\n\tsub\tr2, r2, r1\n\tlsr\tr3, r3, r2\n\torr\tr0, r0, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t rotl,.Lfe1-rotl\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 rotl(u32 a0, u32 a1) {\n return a0 << a1 | a0 >> 32 - a1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 rotl(u32 arg0, s32 arg1) {\n return (arg0 << arg1) | (arg0 >> (0x20 - arg1));\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotl` — benchmark function synthetic:rotl:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trotl\n\t.type\t rotl,function\n\t.thumb_func\nrotl:\n\tadd\tr3, r0, #0\n\tlsl\tr0, r0, r1\n\tmov\tr2, #0x20\n\tsub\tr2, r2, r1\n\tlsr\tr3, r3, r2\n\torr\tr0, r0, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t rotl,.Lfe1-rotl\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotl` — benchmark function synthetic:rotl:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotl:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trotl\n\t.type\t rotl,function\n\t.thumb_func\nrotl:\n\tadd\tr3, r0, #0\n\tlsl\tr0, r0, r1\n\tmov\tr2, #0x20\n\tsub\tr2, r2, r1\n\tlsr\tr3, r3, r2\n\torr\tr0, r0, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t rotl,.Lfe1-rotl\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotl # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotl:gcc2.7.2kmc","sym":"rotl","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotl(unsigned x,int n){ return (x<>(32-n)); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsllv\tv0,a0,a1\n 4:\tli\tv1,32\n 8:\tsubu\tv1,v1,a1\n c:\tsrlv\ta0,a0,v1\n 10:\tjr\tra\n 14:\tor\tv0,v0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ce379de8b26be403/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 rotl\n\n\nContents of section .text:\n 0000 00a41004 24030020 00651823 00642006 ....$.. .e.#.d .\n 0010 03e00008 00441025 00000000 00000000 .....D.%........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 rotl(u32 a0, u32 a1) {\n return a0 << a1 | a0 >> 32 - a1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 rotl(u32 arg0, s32 arg1) {\n return (arg0 << arg1) | (arg0 >> (0x20 - arg1));\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotl` — benchmark function synthetic:rotl:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rotl\n sllv\t$v0, $a0, $a1\n li\t$v1, 32\n subu\t$v1, $v1, $a1\n srlv\t$a0, $a0, $v1\n jr\t$ra\n or\t$v0, $v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotl` — benchmark function synthetic:rotl:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotl:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsllv\tv0,a0,a1\n 4:\tli\tv1,32\n 8:\tsubu\tv1,v1,a1\n c:\tsrlv\ta0,a0,v1\n 10:\tjr\tra\n 14:\tor\tv0,v0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ce379de8b26be403/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 rotl\n\n\nContents of section .text:\n 0000 00a41004 24030020 00651823 00642006 ....$.. .e.#.d .\n 0010 03e00008 00441025 00000000 00000000 .....D.%........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotl:ido7.1","sym":"rotl","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotl(unsigned x,int n){ return (x<>(32-n)); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnegu\tt7,a1\n 4:\tsrlv\tt8,a0,t7\n 8:\tsllv\tt6,a0,a1\n c:\tjr\tra\n 10:\tor\tv0,t6,t8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 rotl\n\n\nContents of section .text:\n 0000 00057823 01e4c006 00a47004 03e00008 ..x#......p.....\n 0010 01d81025 00000000 00000000 00000000 ...%............\nContents of section .options:\n 0000 01200000 00000000 8100c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 65333739 64653862 32366265 ef-ce379de8b26be\n 0130 3430332f 7265662e 6300726f 746c0000 403/ref.c.rotl..\n 0140 726f746c 00000000 00000000 00000001 rotl............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 rotl(u32 a0, u32 a1) {\n return a0 << a1 | a0 >> -a1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 rotl(u32 arg0, s32 arg1) {\n return (arg0 << arg1) | (arg0 >> -arg1);\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotl` — benchmark function synthetic:rotl:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rotl\n negu\t$t7, $a1\n srlv\t$t8, $a0, $t7\n sllv\t$t6, $a0, $a1\n jr\t$ra\n or\t$v0, $t6, $t8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotl` — benchmark function synthetic:rotl:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotl:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnegu\tt7,a1\n 4:\tsrlv\tt8,a0,t7\n 8:\tsllv\tt6,a0,a1\n c:\tjr\tra\n 10:\tor\tv0,t6,t8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 rotl\n\n\nContents of section .text:\n 0000 00057823 01e4c006 00a47004 03e00008 ..x#......p.....\n 0010 01d81025 00000000 00000000 00000000 ...%............\nContents of section .options:\n 0000 01200000 00000000 8100c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 65333739 64653862 32366265 ef-ce379de8b26be\n 0130 3430332f 7265662e 6300726f 746c0000 403/ref.c.rotl..\n 0140 726f746c 00000000 00000000 00000001 rotl............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotl:mwcc_242_81","sym":"rotl","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotl(unsigned x,int n){ return (x<>(32-n)); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\trotlw r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 rotl\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 rotl\n\n\nContents of section .text:\n 0000 5c63203e 4e800020 \\c >N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 rotl(u32 a0, u32 a1) {\n return a0 << a1 | a0 >> 32 - a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 rotl(void) {\n return M2C_ERROR(/* unknown instruction: rotlw $r3, $r3, $r4 */);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":76,"lines":3,"gotos":0,"casts":1,"unkGlue":2,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_ERROR"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotl` — benchmark function synthetic:rotl:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rotl\n rotlw r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotl` — benchmark function synthetic:rotl:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotl:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\trotlw r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 rotl\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 rotl\n\n\nContents of section .text:\n 0000 5c63203e 4e800020 \\c >N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotr:agbcc","sym":"rotr","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotr(unsigned x,int n){ return (x>>n)|(x<<(32-n)); }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trotr\n\t.type\t rotr,function\n\t.thumb_func\nrotr:\n\tror\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t rotr,.Lfe1-rotr\n","ctx":"unsigned rotr(unsigned,int);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"u32 rotr(u32 a0, u32 a1) {\n return a0 >> a1 | a0 << 32 - a1;\n}\n","score":6,"maxScore":7,"compileErrors":null,"breakdown":{"insert":5,"delete":0,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u32 rotr(u32 arg0, s32 arg1) {\n return ROTATE_RIGHT(arg0, arg1);\n}\n","score":4,"maxScore":4,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":4,"ratio":1,"kinds":{"insert":2,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotr` — benchmark function synthetic:rotr:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trotr\n\t.type\t rotr,function\n\t.thumb_func\nrotr:\n\tror\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t rotr,.Lfe1-rotr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nunsigned rotr(unsigned,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotr` — benchmark function synthetic:rotr:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotr:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trotr\n\t.type\t rotr,function\n\t.thumb_func\nrotr:\n\tror\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t rotr,.Lfe1-rotr\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotr # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotr:gcc2.7.2kmc","sym":"rotr","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotr(unsigned x,int n){ return (x>>n)|(x<<(32-n)); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrlv\tv0,a0,a1\n 4:\tli\tv1,32\n 8:\tsubu\tv1,v1,a1\n c:\tsllv\ta0,a0,v1\n 10:\tjr\tra\n 14:\tor\tv0,v0,a0\n\t...\n","ctx":"unsigned rotr(unsigned,int);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-9e6aaa54407f049e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 rotr\n\n\nContents of section .text:\n 0000 00a41006 24030020 00651823 00642004 ....$.. .e.#.d .\n 0010 03e00008 00441025 00000000 00000000 .....D.%........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 rotr(u32 a0, u32 a1) {\n return a0 >> a1 | a0 << 32 - a1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 rotr(u32 arg0, s32 arg1) {\n return (arg0 >> arg1) | (arg0 << (0x20 - arg1));\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotr` — benchmark function synthetic:rotr:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rotr\n srlv\t$v0, $a0, $a1\n li\t$v1, 32\n subu\t$v1, $v1, $a1\n sllv\t$a0, $a0, $v1\n jr\t$ra\n or\t$v0, $v0, $a0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nunsigned rotr(unsigned,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotr` — benchmark function synthetic:rotr:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotr:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrlv\tv0,a0,a1\n 4:\tli\tv1,32\n 8:\tsubu\tv1,v1,a1\n c:\tsllv\ta0,a0,v1\n 10:\tjr\tra\n 14:\tor\tv0,v0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-9e6aaa54407f049e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 rotr\n\n\nContents of section .text:\n 0000 00a41006 24030020 00651823 00642004 ....$.. .e.#.d .\n 0010 03e00008 00441025 00000000 00000000 .....D.%........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotr:ido7.1","sym":"rotr","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotr(unsigned x,int n){ return (x>>n)|(x<<(32-n)); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnegu\tt7,a1\n 4:\tsllv\tt8,a0,t7\n 8:\tsrlv\tt6,a0,a1\n c:\tjr\tra\n 10:\tor\tv0,t6,t8\n\t...\n","ctx":"unsigned rotr(unsigned,int);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 rotr\n\n\nContents of section .text:\n 0000 00057823 01e4c004 00a47006 03e00008 ..x#......p.....\n 0010 01d81025 00000000 00000000 00000000 ...%............\nContents of section .options:\n 0000 01200000 00000000 8100c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 65366161 61353434 30376630 ef-9e6aaa54407f0\n 0130 3439652f 7265662e 6300726f 74720000 49e/ref.c.rotr..\n 0140 726f7472 00000000 00000000 00000001 rotr............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 rotr(u32 a0, u32 a1) {\n return a0 >> a1 | a0 << -a1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 rotr(u32 arg0, s32 arg1) {\n return (arg0 >> arg1) | (arg0 << -arg1);\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotr` — benchmark function synthetic:rotr:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rotr\n negu\t$t7, $a1\n sllv\t$t8, $a0, $t7\n srlv\t$t6, $a0, $a1\n jr\t$ra\n or\t$v0, $t6, $t8\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nunsigned rotr(unsigned,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotr` — benchmark function synthetic:rotr:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotr:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnegu\tt7,a1\n 4:\tsllv\tt8,a0,t7\n 8:\tsrlv\tt6,a0,a1\n c:\tjr\tra\n 10:\tor\tv0,t6,t8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 rotr\n\n\nContents of section .text:\n 0000 00057823 01e4c004 00a47006 03e00008 ..x#......p.....\n 0010 01d81025 00000000 00000000 00000000 ...%............\nContents of section .options:\n 0000 01200000 00000000 8100c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 65366161 61353434 30376630 ef-9e6aaa54407f0\n 0130 3439652f 7265662e 6300726f 74720000 49e/ref.c.rotr..\n 0140 726f7472 00000000 00000000 00000001 rotr............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotr:mwcc_242_81","sym":"rotr","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotr(unsigned x,int n){ return (x>>n)|(x<<(32-n)); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsubfic r0,r4,32\n 4:\trotlw r3,r3,r0\n 8:\tblr\n","ctx":"unsigned rotr(unsigned,int);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c rotr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 rotr\n\n\nContents of section .text:\n 0000 20040020 5c63003e 4e800020 .. \\c.>N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 rotr(u32 a0, u32 a1) {\n return a0 >> a1 | a0 << 32 - a1;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u32 rotr(u32 arg0, s32 arg1) {\n return M2C_ERROR(/* unknown instruction: rotlw $r3, $r3, $r0 */);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":76,"lines":3,"gotos":0,"casts":0,"unkGlue":2,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_ERROR"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotr` — benchmark function synthetic:rotr:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rotr\n subfic r0,r4,32\n rotlw r3,r3,r0\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nunsigned rotr(unsigned,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotr` — benchmark function synthetic:rotr:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotr:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsubfic r0,r4,32\n 4:\trotlw r3,r3,r0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c rotr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 rotr\n\n\nContents of section .text:\n 0000 20040020 5c63003e 4e800020 .. \\c.>N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:selnz:agbcc","sym":"selnz","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","ternary","select"],"loc":1,"refSource":"int selnz(int c,int a,int b){ return c?a:b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tselnz\n\t.type\t selnz,function\n\t.thumb_func\nselnz:\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr2, r1, #0\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t selnz,.Lfe1-selnz\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 selnz(u32 a0, u32 a1, u32 a2) {\n if (a0 != 0) a2 = a1;\n return a2;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 selnz(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r2;\n\n var_r2 = arg2;\n if (arg0 != 0) {\n var_r2 = arg1;\n }\n return var_r2;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `selnz` — benchmark function synthetic:selnz:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tselnz\n\t.type\t selnz,function\n\t.thumb_func\nselnz:\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr2, r1, #0\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t selnz,.Lfe1-selnz\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function selnz # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `selnz` — benchmark function synthetic:selnz:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:selnz:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tselnz\n\t.type\t selnz,function\n\t.thumb_func\nselnz:\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr2, r1, #0\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t selnz,.Lfe1-selnz\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name selnz # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:selnz:gcc2.7.2kmc","sym":"selnz","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","ternary","select"],"loc":1,"refSource":"int selnz(int c,int a,int b){ return c?a:b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,c \n 4:\tmove\tv0,a2\n 8:\tmove\tv0,a1\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-38312a0ced0198e5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 selnz\n\n\nContents of section .text:\n 0000 10800002 00c01021 00a01021 03e00008 .......!...!....\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 selnz(u32 a0, u32 a1, u32 a2) {\n if (a0 != 0) a2 = a1;\n return a2;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 selnz(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_v0;\n\n var_v0 = arg2;\n if (arg0 != 0) {\n var_v0 = arg1;\n }\n return var_v0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `selnz` — benchmark function synthetic:selnz:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel selnz\n beqz\t$a0, .Lc\n move\t$v0, $a2\n move\t$v0, $a1\n.Lc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function selnz # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `selnz` — benchmark function synthetic:selnz:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:selnz:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,c \n 4:\tmove\tv0,a2\n 8:\tmove\tv0,a1\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-38312a0ced0198e5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 selnz\n\n\nContents of section .text:\n 0000 10800002 00c01021 00a01021 03e00008 .......!...!....\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name selnz # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:selnz:ido7.1","sym":"selnz","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","ternary","select"],"loc":1,"refSource":"int selnz(int c,int a,int b){ return c?a:b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,10 \n 4:\tmove\tv1,a2\n 8:\tjr\tra\n c:\tmove\tv0,a1\n 10:\tjr\tra\n 14:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 selnz\n\n\nContents of section .text:\n 0000 10800003 00c01825 03e00008 00a01025 .......%.......%\n 0010 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8000007c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 38333132 61306365 64303139 ef-38312a0ced019\n 0130 3865352f 7265662e 63007365 6c6e7a00 8e5/ref.c.selnz.\n 0140 73656c6e 7a000000 00000000 00000001 selnz...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"u32 selnz(u32 a0, u32 a1, u32 a2) {\n if (a0 != 0) {\n return a1;\n } else {\n return a2;\n }\n}\n","score":2,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 selnz(s32 arg0, s32 arg1, s32 arg2) {\n if (arg0 != 0) {\n return arg1;\n }\n return arg2;\n}\n","score":2,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":6,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `selnz` — benchmark function synthetic:selnz:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel selnz\n beqz\t$a0, .L10\n move\t$v1, $a2\n jr\t$ra\n move\t$v0, $a1\n.L10:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function selnz # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `selnz` — benchmark function synthetic:selnz:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:selnz:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,10 \n 4:\tmove\tv1,a2\n 8:\tjr\tra\n c:\tmove\tv0,a1\n 10:\tjr\tra\n 14:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 selnz\n\n\nContents of section .text:\n 0000 10800003 00c01825 03e00008 00a01025 .......%.......%\n 0010 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8000007c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 38333132 61306365 64303139 ef-38312a0ced019\n 0130 3865352f 7265662e 63007365 6c6e7a00 8e5/ref.c.selnz.\n 0140 73656c6e 7a000000 00000000 00000001 selnz...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name selnz # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:selnz:mwcc_242_81","sym":"selnz","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","ternary","select"],"loc":1,"refSource":"int selnz(int c,int a,int b){ return c?a:b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tbeq c \n 8:\tmr r5,r4\n c:\tmr r3,r5\n 10:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 selnz\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 selnz\n\n\nContents of section .text:\n 0000 2c030000 41820008 7c852378 7ca32b78 ,...A...|.#x|.+x\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 selnz(s32 a0, s32 a1, s32 a2) {\n if (a0 != 0) a2 = a1;\n return a2;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 selnz(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r5;\n\n var_r5 = arg2;\n if (arg0 != 0) {\n var_r5 = arg1;\n }\n return var_r5;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `selnz` — benchmark function synthetic:selnz:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel selnz\n cmpwi r3,0\n beq .Lc\n mr r5,r4\n.Lc:\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function selnz # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `selnz` — benchmark function synthetic:selnz:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:selnz:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tbeq c \n 8:\tmr r5,r4\n c:\tmr r3,r5\n 10:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 selnz\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 selnz\n\n\nContents of section .text:\n 0000 2c030000 41820008 7c852378 7ca32b78 ,...A...|.#x|.+x\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name selnz # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setbit:agbcc","sym":"setbit","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int setbit(int x,int n){ return x | (1< in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsetbit\n\t.type\t setbit,function\n\t.thumb_func\nsetbit:\n\tadd\tr2, r0, #0\n\tmov\tr0, #0x1\n\tlsl\tr0, r0, r1\n\torr\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t setbit,.Lfe1-setbit\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setbit` — benchmark function synthetic:setbit:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setbit:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsetbit\n\t.type\t setbit,function\n\t.thumb_func\nsetbit:\n\tadd\tr2, r0, #0\n\tmov\tr0, #0x1\n\tlsl\tr0, r0, r1\n\torr\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t setbit,.Lfe1-setbit\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name setbit # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setbit:gcc2.7.2kmc","sym":"setbit","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int setbit(int x,int n){ return x | (1<:\n 0:\tli\tv0,1\n 4:\tsllv\tv0,v0,a1\n 8:\tjr\tra\n c:\tor\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-20b42231b2c3f921/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 setbit\n\n\nContents of section .text:\n 0000 24020001 00a21004 03e00008 00821025 $..............%\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 setbit(u32 a0, u32 a1) {\n return a0 | 1 << a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 setbit(s32 arg0, s32 arg1) {\n return arg0 | (1 << arg1);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `setbit` — benchmark function synthetic:setbit:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel setbit\n li\t$v0, 1\n sllv\t$v0, $v0, $a1\n jr\t$ra\n or\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setbit` — benchmark function synthetic:setbit:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setbit:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tsllv\tv0,v0,a1\n 8:\tjr\tra\n c:\tor\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-20b42231b2c3f921/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 setbit\n\n\nContents of section .text:\n 0000 24020001 00a21004 03e00008 00821025 $..............%\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name setbit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setbit:ido7.1","sym":"setbit","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int setbit(int x,int n){ return x | (1<:\n 0:\tli\tt6,1\n 4:\tsllv\tt7,t6,a1\n 8:\tjr\tra\n c:\tor\tv0,t7,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 setbit\n\n\nContents of section .text:\n 0000 240e0001 00ae7804 03e00008 01e41025 $.....x........%\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 30623432 32333162 32633366 ef-20b42231b2c3f\n 0130 3932312f 7265662e 63007365 74626974 921/ref.c.setbit\n 0140 00000000 73657462 69740000 00000000 ....setbit......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 setbit(u32 a0, u32 a1) {\n return 1 << a1 | a0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 setbit(s32 arg0, s32 arg1) {\n return (1 << arg1) | arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `setbit` — benchmark function synthetic:setbit:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel setbit\n li\t$t6, 1\n sllv\t$t7, $t6, $a1\n jr\t$ra\n or\t$v0, $t7, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setbit` — benchmark function synthetic:setbit:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setbit:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tt6,1\n 4:\tsllv\tt7,t6,a1\n 8:\tjr\tra\n c:\tor\tv0,t7,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 setbit\n\n\nContents of section .text:\n 0000 240e0001 00ae7804 03e00008 01e41025 $.....x........%\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 30623432 32333162 32633366 ef-20b42231b2c3f\n 0130 3932312f 7265662e 63007365 74626974 921/ref.c.setbit\n 0140 00000000 73657462 69740000 00000000 ....setbit......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name setbit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setbit:mwcc_242_81","sym":"setbit","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int setbit(int x,int n){ return x | (1<:\n 0:\tli r0,1\n 4:\tslw r0,r0,r4\n 8:\tor r3,r3,r0\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 setbit\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 setbit\n\n\nContents of section .text:\n 0000 38000001 7c002030 7c630378 4e800020 8...|. 0|c.xN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 setbit(u32 a0, u32 a1) {\n return a0 | 1 << a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 setbit(s32 arg0, s32 arg1) {\n return arg0 | (1 << arg1);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `setbit` — benchmark function synthetic:setbit:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel setbit\n li r0,1\n slw r0,r0,r4\n or r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setbit` — benchmark function synthetic:setbit:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setbit:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r0,1\n 4:\tslw r0,r0,r4\n 8:\tor r3,r3,r0\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 setbit\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 setbit\n\n\nContents of section .text:\n 0000 38000001 7c002030 7c630378 4e800020 8...|. 0|c.xN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name setbit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setfield:agbcc","sym":"setfield","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nvoid setfield(struct S *s,int v){ s->a=v; s->c=v; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsetfield\n\t.type\t setfield,function\n\t.thumb_func\nsetfield:\n\tstr\tr1, [r0]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t setfield,.Lfe1-setfield\n","ctx":"struct S; void setfield(struct S*,int);","proto":{"setfield":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void setfield(s32 * a0, u32 a1) {\n *a0 = a1;\n a0[2] = a1;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void setfield(struct S *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n arg0->unk8 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:2: warning: `struct S' declared inside parameter list","/cand.c.pp.c:2: warning: its scope is only this definition or declaration,","/cand.c.pp.c:2: warning: which is probably not what you want.","/cand.c.pp.c:3: dereferencing pointer to incomplete type","/cand.c.pp.c:4: dereferencing pointer to incomplete type"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `setfield` — benchmark function synthetic:setfield:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsetfield\n\t.type\t setfield,function\n\t.thumb_func\nsetfield:\n\tstr\tr1, [r0]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t setfield,.Lfe1-setfield\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void setfield(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setfield # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setfield` — benchmark function synthetic:setfield:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setfield:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsetfield\n\t.type\t setfield,function\n\t.thumb_func\nsetfield:\n\tstr\tr1, [r0]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t setfield,.Lfe1-setfield\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"setfield\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name setfield # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setfield:gcc2.7.2kmc","sym":"setfield","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nvoid setfield(struct S *s,int v){ s->a=v; s->c=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\tjr\tra\n 8:\tsw\ta1,8(a0)\n c:\tnop\n","ctx":"struct S; void setfield(struct S*,int);","proto":{"setfield":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-7feb24c1adf349a2/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c setfield\n\n\nContents of section .text:\n 0000 ac850000 03e00008 ac850008 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void setfield(s32 * a0, u32 a1) {\n *a0 = a1;\n a0[2] = a1;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void setfield(struct S *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n arg0->unk8 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: dereferencing pointer to incomplete type","/cand.c:4: dereferencing pointer to incomplete type"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `setfield` — benchmark function synthetic:setfield:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel setfield\n sw\t$a1, 0($a0)\n jr\t$ra\n sw\t$a1, 8($a0)\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void setfield(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setfield # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setfield` — benchmark function synthetic:setfield:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setfield:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\tjr\tra\n 8:\tsw\ta1,8(a0)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-7feb24c1adf349a2/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c setfield\n\n\nContents of section .text:\n 0000 ac850000 03e00008 ac850008 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"setfield\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name setfield # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setfield:ido7.1","sym":"setfield","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nvoid setfield(struct S *s,int v){ s->a=v; s->c=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\tjr\tra\n 8:\tsw\ta1,8(a0)\n c:\tnop\n","ctx":"struct S; void setfield(struct S*,int);","proto":{"setfield":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c setfield\n\n\nContents of section .text:\n 0000 ac850000 03e00008 ac850008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002c0 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 0000000c 0000025c 00000001 00000268 .......\\.......h\n 0050 00000000 00000000 00000001 000002b0 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 66656232 34633161 64663334 ef-7feb24c1adf34\n 0130 3961322f 7265662e 63007365 74666965 9a2/ref.c.setfie\n 0140 6c640000 73657466 69656c64 00000000 ld..setfield....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 00000003 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void setfield(s32 * a0, u32 a1) {\n *a0 = a1;\n a0[2] = a1;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void setfield(struct S *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n arg0->unk8 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: 'unk0' undefined; reoccurrences will not be reported.","cfe: Error: /cand.c, line 3: member of structure or union required","cfe: Error: /cand.c, line 4: 'unk8' undefined; reoccurrences will not be reported.","cfe: Error: /cand.c, line 4: member of structure or union required"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `setfield` — benchmark function synthetic:setfield:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel setfield\n sw\t$a1, 0($a0)\n jr\t$ra\n sw\t$a1, 8($a0)\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void setfield(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setfield # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setfield` — benchmark function synthetic:setfield:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setfield:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\tjr\tra\n 8:\tsw\ta1,8(a0)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c setfield\n\n\nContents of section .text:\n 0000 ac850000 03e00008 ac850008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002c0 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 0000000c 0000025c 00000001 00000268 .......\\.......h\n 0050 00000000 00000000 00000001 000002b0 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 66656232 34633161 64663334 ef-7feb24c1adf34\n 0130 3961322f 7265662e 63007365 74666965 9a2/ref.c.setfie\n 0140 6c640000 73657466 69656c64 00000000 ld..setfield....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 00000003 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"setfield\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name setfield # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setfield:mwcc_242_81","sym":"setfield","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nvoid setfield(struct S *s,int v){ s->a=v; s->c=v; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,0(r3)\n 4:\tstw r4,8(r3)\n 8:\tblr\n","ctx":"struct S; void setfield(struct S*,int);","proto":{"setfield":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c setfield\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 setfield\n\n\nContents of section .text:\n 0000 90830000 90830008 4e800020 ........N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void setfield(s32 * a0, u32 a1) {\n *a0 = a1;\n a0[2] = a1;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void setfield(struct S *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n arg0->unk8 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^^^","# illegal use of incomplete struct/union/class 'struct S'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `setfield` — benchmark function synthetic:setfield:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel setfield\n stw r4,0(r3)\n stw r4,8(r3)\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void setfield(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setfield # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setfield` — benchmark function synthetic:setfield:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setfield:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,0(r3)\n 4:\tstw r4,8(r3)\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c setfield\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 setfield\n\n\nContents of section .text:\n 0000 90830000 90830008 4e800020 ........N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"setfield\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name setfield # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sextb:agbcc","sym":"sextb","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","sign-extend"],"loc":1,"refSource":"int sextb(s8 x){ return x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsextb\n\t.type\t sextb,function\n\t.thumb_func\nsextb:\n\tlsl\tr0, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t sextb,.Lfe1-sextb\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sextb(u32 a0) {\n return (s8)a0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 sextb(s8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sextb` — benchmark function synthetic:sextb:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsextb\n\t.type\t sextb,function\n\t.thumb_func\nsextb:\n\tlsl\tr0, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t sextb,.Lfe1-sextb\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sextb` — benchmark function synthetic:sextb:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sextb:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsextb\n\t.type\t sextb,function\n\t.thumb_func\nsextb:\n\tlsl\tr0, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t sextb,.Lfe1-sextb\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sextb # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sextb:gcc2.7.2kmc","sym":"sextb","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","sign-extend"],"loc":1,"refSource":"int sextb(s8 x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x18\n 4:\tjr\tra\n 8:\tsra\tv0,v0,0x18\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4332b5d6e0776f93/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c sextb\n\n\nContents of section .text:\n 0000 00041600 03e00008 00021603 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 sextb(s32 a0) {\n return a0 << 24 >> 24;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 sextb(s8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sextb` — benchmark function synthetic:sextb:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sextb\n sll\t$v0, $a0, 0x18\n jr\t$ra\n sra\t$v0, $v0, 0x18\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sextb` — benchmark function synthetic:sextb:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sextb:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x18\n 4:\tjr\tra\n 8:\tsra\tv0,v0,0x18\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4332b5d6e0776f93/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c sextb\n\n\nContents of section .text:\n 0000 00041600 03e00008 00021603 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sextb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sextb:ido7.1","sym":"sextb","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","sign-extend"],"loc":1,"refSource":"int sextb(s8 x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsll\ta0,a0,0x18\n 8:\tjr\tra\n c:\tsra\tv0,a0,0x18\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 sextb\n\n\nContents of section .text:\n 0000 afa40000 00042600 03e00008 00041603 ......&.........\nContents of section .options:\n 0000 01200000 00000000 a0000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 33333262 35643665 30373736 ef-4332b5d6e0776\n 0130 6639332f 7265662e 63007365 78746200 f93/ref.c.sextb.\n 0140 73657874 62000000 00000000 00000001 sextb...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 sextb(u32 a0) {\n return a0 << 24 >> 24;\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 sextb(s8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sextb` — benchmark function synthetic:sextb:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sextb\n sw\t$a0, 0($sp)\n sll\t$a0, $a0, 0x18\n jr\t$ra\n sra\t$v0, $a0, 0x18\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sextb` — benchmark function synthetic:sextb:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sextb:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsll\ta0,a0,0x18\n 8:\tjr\tra\n c:\tsra\tv0,a0,0x18\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 sextb\n\n\nContents of section .text:\n 0000 afa40000 00042600 03e00008 00041603 ......&.........\nContents of section .options:\n 0000 01200000 00000000 a0000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 33333262 35643665 30373736 ef-4332b5d6e0776\n 0130 6639332f 7265662e 63007365 78746200 f93/ref.c.sextb.\n 0140 73657874 62000000 00000000 00000001 sextb...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sextb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sextb:mwcc_242_81","sym":"sextb","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","sign-extend"],"loc":1,"refSource":"int sextb(s8 x){ return x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\textsb r3,r3\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sextb\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sextb\n\n\nContents of section .text:\n 0000 7c630774 4e800020 |c.tN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sextb(u32 a0) {\n return (s8)a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s8 sextb(s8 arg0) {\n return arg0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sextb` — benchmark function synthetic:sextb:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sextb\n extsb r3,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sextb` — benchmark function synthetic:sextb:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sextb:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\textsb r3,r3\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sextb\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sextb\n\n\nContents of section .text:\n 0000 7c630774 4e800020 |c.tN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sextb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sfield:agbcc","sym":"sfield","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nint sfield(struct S*s){ return s->b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsfield\n\t.type\t sfield,function\n\t.thumb_func\nsfield:\n\tldr\tr0, [r0, #0x4]\n\tbx\tlr\n.Lfe1:\n\t.size\t sfield,.Lfe1-sfield\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sfield(s32 * a0) {\n return a0[1];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 sfield(void *arg0) {\n return arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:3: warning: dereferencing `void *' pointer","/cand.c.pp.c:3: request for member `unk4' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sfield` — benchmark function synthetic:sfield:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsfield\n\t.type\t sfield,function\n\t.thumb_func\nsfield:\n\tldr\tr0, [r0, #0x4]\n\tbx\tlr\n.Lfe1:\n\t.size\t sfield,.Lfe1-sfield\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sfield # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sfield` — benchmark function synthetic:sfield:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sfield:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsfield\n\t.type\t sfield,function\n\t.thumb_func\nsfield:\n\tldr\tr0, [r0, #0x4]\n\tbx\tlr\n.Lfe1:\n\t.size\t sfield,.Lfe1-sfield\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sfield # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sfield:gcc2.7.2kmc","sym":"sfield","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nint sfield(struct S*s){ return s->b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,4(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-efab4c56c3bcf6d0/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 sfield\n\n\nContents of section .text:\n 0000 03e00008 8c820004 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sfield(s32 * a0) {\n return a0[1];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 sfield(void *arg0) {\n return arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: request for member `unk4' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sfield` — benchmark function synthetic:sfield:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sfield\n jr\t$ra\n lw\t$v0, 4($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sfield # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sfield` — benchmark function synthetic:sfield:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sfield:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,4(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-efab4c56c3bcf6d0/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 sfield\n\n\nContents of section .text:\n 0000 03e00008 8c820004 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sfield # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sfield:ido7.1","sym":"sfield","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","field"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nint sfield(struct S*s){ return s->b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,4(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 sfield\n\n\nContents of section .text:\n 0000 03e00008 8c820004 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 66616234 63353663 33626366 ef-efab4c56c3bcf\n 0130 3664302f 7265662e 63007366 69656c64 6d0/ref.c.sfield\n 0140 00000000 73666965 6c640000 00000000 ....sfield......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sfield(s32 * a0) {\n return a0[1];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 sfield(void *arg0) {\n return arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sfield` — benchmark function synthetic:sfield:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sfield\n jr\t$ra\n lw\t$v0, 4($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sfield # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sfield` — benchmark function synthetic:sfield:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sfield:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,4(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 sfield\n\n\nContents of section .text:\n 0000 03e00008 8c820004 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 66616234 63353663 33626366 ef-efab4c56c3bcf\n 0130 3664302f 7265662e 63007366 69656c64 6d0/ref.c.sfield\n 0140 00000000 73666965 6c640000 00000000 ....sfield......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sfield # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sfield:mwcc_242_81","sym":"sfield","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["struct","field"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nint sfield(struct S*s){ return s->b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r3,4(r3)\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sfield\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sfield\n\n\nContents of section .text:\n 0000 80630004 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sfield(s32 * a0) {\n return a0[1];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 sfield(void *arg0) {\n return arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sfield` — benchmark function synthetic:sfield:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sfield\n lwz r3,4(r3)\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sfield # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sfield` — benchmark function synthetic:sfield:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sfield:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r3,4(r3)\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sfield\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sfield\n\n\nContents of section .text:\n 0000 80630004 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sfield # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shl:agbcc","sym":"shl","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int shl(int a,int b){ return a< in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshl\n\t.type\t shl,function\n\t.thumb_func\nshl:\n\tlsl\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shl,.Lfe1-shl\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shl` — benchmark function synthetic:shl:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shl:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshl\n\t.type\t shl,function\n\t.thumb_func\nshl:\n\tlsl\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shl,.Lfe1-shl\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name shl # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shl:gcc2.7.2kmc","sym":"shl","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int shl(int a,int b){ return a<:\n 0:\tjr\tra\n 4:\tsllv\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-60c219d8b2e26e95/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 shl\n\n\nContents of section .text:\n 0000 03e00008 00a41004 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 shl(u32 a0, u32 a1) {\n return a0 << a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 shl(s32 arg0, s32 arg1) {\n return arg0 << arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shl` — benchmark function synthetic:shl:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shl\n jr\t$ra\n sllv\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shl` — benchmark function synthetic:shl:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shl:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsllv\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-60c219d8b2e26e95/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 shl\n\n\nContents of section .text:\n 0000 03e00008 00a41004 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name shl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shl:ido7.1","sym":"shl","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int shl(int a,int b){ return a<:\n 0:\tjr\tra\n 4:\tsllv\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 shl\n\n\nContents of section .text:\n 0000 03e00008 00a41004 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 30633231 39643862 32653236 ef-60c219d8b2e26\n 0130 6539352f 7265662e 63007368 6c000000 e95/ref.c.shl...\n 0140 73686c00 00000000 00000001 00000000 shl.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 shl(u32 a0, u32 a1) {\n return a0 << a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 shl(s32 arg0, s32 arg1) {\n return arg0 << arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shl` — benchmark function synthetic:shl:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shl\n jr\t$ra\n sllv\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shl` — benchmark function synthetic:shl:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shl:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsllv\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 shl\n\n\nContents of section .text:\n 0000 03e00008 00a41004 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 30633231 39643862 32653236 ef-60c219d8b2e26\n 0130 6539352f 7265662e 63007368 6c000000 e95/ref.c.shl...\n 0140 73686c00 00000000 00000001 00000000 shl.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name shl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shl:mwcc_242_81","sym":"shl","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int shl(int a,int b){ return a<:\n 0:\tslw r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 shl\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 shl\n\n\nContents of section .text:\n 0000 7c632030 4e800020 |c 0N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 shl(u32 a0, u32 a1) {\n return a0 << a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 shl(s32 arg0, s32 arg1) {\n return arg0 << arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shl` — benchmark function synthetic:shl:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shl\n slw r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shl` — benchmark function synthetic:shl:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shl:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslw r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 shl\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 shl\n\n\nContents of section .text:\n 0000 7c632030 4e800020 |c 0N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name shl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shrs:agbcc","sym":"shrs","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift","signed"],"loc":1,"refSource":"int shrs(int a,int b){ return a>>b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshrs\n\t.type\t shrs,function\n\t.thumb_func\nshrs:\n\tasr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shrs,.Lfe1-shrs\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 shrs(s32 a0, s32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 shrs(s32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shrs` — benchmark function synthetic:shrs:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshrs\n\t.type\t shrs,function\n\t.thumb_func\nshrs:\n\tasr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shrs,.Lfe1-shrs\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shrs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shrs` — benchmark function synthetic:shrs:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shrs:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshrs\n\t.type\t shrs,function\n\t.thumb_func\nshrs:\n\tasr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shrs,.Lfe1-shrs\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name shrs # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shrs:gcc2.7.2kmc","sym":"shrs","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift","signed"],"loc":1,"refSource":"int shrs(int a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrav\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1e7087ba08828cba/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 shrs\n\n\nContents of section .text:\n 0000 03e00008 00a41007 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 shrs(s32 a0, s32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 shrs(s32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shrs` — benchmark function synthetic:shrs:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shrs\n jr\t$ra\n srav\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shrs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shrs` — benchmark function synthetic:shrs:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shrs:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrav\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1e7087ba08828cba/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 shrs\n\n\nContents of section .text:\n 0000 03e00008 00a41007 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name shrs # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shrs:ido7.1","sym":"shrs","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift","signed"],"loc":1,"refSource":"int shrs(int a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrav\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 shrs\n\n\nContents of section .text:\n 0000 03e00008 00a41007 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 65373038 37626130 38383238 ef-1e7087ba08828\n 0130 6362612f 7265662e 63007368 72730000 cba/ref.c.shrs..\n 0140 73687273 00000000 00000000 00000001 shrs............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 shrs(s32 a0, s32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 shrs(s32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shrs` — benchmark function synthetic:shrs:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shrs\n jr\t$ra\n srav\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shrs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shrs` — benchmark function synthetic:shrs:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shrs:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrav\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 shrs\n\n\nContents of section .text:\n 0000 03e00008 00a41007 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 65373038 37626130 38383238 ef-1e7087ba08828\n 0130 6362612f 7265662e 63007368 72730000 cba/ref.c.shrs..\n 0140 73687273 00000000 00000000 00000001 shrs............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name shrs # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shrs:mwcc_242_81","sym":"shrs","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift","signed"],"loc":1,"refSource":"int shrs(int a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsraw r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 shrs\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 shrs\n\n\nContents of section .text:\n 0000 7c632630 4e800020 |c&0N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 shrs(s32 a0, s32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 shrs(s32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shrs` — benchmark function synthetic:shrs:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shrs\n sraw r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shrs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shrs` — benchmark function synthetic:shrs:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shrs:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsraw r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 shrs\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 shrs\n\n\nContents of section .text:\n 0000 7c632630 4e800020 |c&0N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name shrs # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shru:agbcc","sym":"shru","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned shru(unsigned a,int b){ return a>>b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshru\n\t.type\t shru,function\n\t.thumb_func\nshru:\n\tlsr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shru,.Lfe1-shru\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 shru(u32 a0, u32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 shru(u32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shru` — benchmark function synthetic:shru:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshru\n\t.type\t shru,function\n\t.thumb_func\nshru:\n\tlsr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shru,.Lfe1-shru\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shru # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shru` — benchmark function synthetic:shru:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shru:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshru\n\t.type\t shru,function\n\t.thumb_func\nshru:\n\tlsr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shru,.Lfe1-shru\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name shru # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shru:gcc2.7.2kmc","sym":"shru","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned shru(unsigned a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrlv\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-cf134ea7cde7356c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 shru\n\n\nContents of section .text:\n 0000 03e00008 00a41006 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 shru(u32 a0, u32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 shru(u32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shru` — benchmark function synthetic:shru:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shru\n jr\t$ra\n srlv\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shru # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shru` — benchmark function synthetic:shru:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shru:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrlv\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-cf134ea7cde7356c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 shru\n\n\nContents of section .text:\n 0000 03e00008 00a41006 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name shru # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shru:ido7.1","sym":"shru","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned shru(unsigned a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrlv\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 shru\n\n\nContents of section .text:\n 0000 03e00008 00a41006 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 66313334 65613763 64653733 ef-cf134ea7cde73\n 0130 3536632f 7265662e 63007368 72750000 56c/ref.c.shru..\n 0140 73687275 00000000 00000000 00000001 shru............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 shru(u32 a0, u32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 shru(u32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shru` — benchmark function synthetic:shru:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shru\n jr\t$ra\n srlv\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shru # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shru` — benchmark function synthetic:shru:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shru:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrlv\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 shru\n\n\nContents of section .text:\n 0000 03e00008 00a41006 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 66313334 65613763 64653733 ef-cf134ea7cde73\n 0130 3536632f 7265662e 63007368 72750000 56c/ref.c.shru..\n 0140 73687275 00000000 00000000 00000001 shru............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name shru # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shru:mwcc_242_81","sym":"shru","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned shru(unsigned a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrw r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 shru\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 shru\n\n\nContents of section .text:\n 0000 7c632430 4e800020 |c$0N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 shru(u32 a0, u32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 shru(u32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shru` — benchmark function synthetic:shru:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shru\n srw r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shru # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shru` — benchmark function synthetic:shru:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shru:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrw r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 shru\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 shru\n\n\nContents of section .text:\n 0000 7c632430 4e800020 |c$0N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name shru # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sign:agbcc","sym":"sign","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int sign(int x){ if(x>0)return 1; if(x<0)return -1; return 0; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsign\n\t.type\t sign,function\n\t.thumb_func\nsign:\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L5\n.L3:\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L5\n.L4:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t sign,.Lfe1-sign\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 sign(s32 a0) {\n s32 v0;\n if (a0 <= 0) {\n if (a0 < 0) {\n v0 = -1;\n } else {\n v0 = 0;\n }\n } else {\n v0 = 1;\n }\n return v0;\n}\n","score":8,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":2,"opMismatch":2,"argMismatch":3},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sign(s32 arg0) {\n if (arg0 > 0) {\n return 1;\n }\n if (arg0 >= 0) {\n return 0;\n }\n return -1;\n}\n","score":6,"maxScore":13,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":13,"ratio":0.46153846153846156,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sign` — benchmark function synthetic:sign:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsign\n\t.type\t sign,function\n\t.thumb_func\nsign:\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L5\n.L3:\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L5\n.L4:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t sign,.Lfe1-sign\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sign # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sign` — benchmark function synthetic:sign:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sign:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsign\n\t.type\t sign,function\n\t.thumb_func\nsign:\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L5\n.L3:\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L5\n.L4:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t sign,.Lfe1-sign\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sign # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sign:gcc2.7.2kmc","sym":"sign","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int sign(int x){ if(x>0)return 1; if(x<0)return -1; return 0; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgtz\ta0,c \n 4:\tli\tv0,1\n 8:\tsra\tv0,a0,0x1f\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-cf4f7ce4ee5f0af0/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 sign\n\n\nContents of section .text:\n 0000 1c800002 24020001 000417c3 03e00008 ....$...........\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 sign(s32 a0) {\n s32 v0;\n if (a0 > 0) {\n v0 = 1;\n } else {\n v0 = a0 >> 31;\n }\n return v0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sign(s32 arg0) {\n s32 var_v0;\n\n var_v0 = 1;\n if (arg0 <= 0) {\n var_v0 = arg0 >> 0x1F;\n }\n return var_v0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sign` — benchmark function synthetic:sign:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sign\n bgtz\t$a0, .Lc\n li\t$v0, 1\n sra\t$v0, $a0, 0x1f\n.Lc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sign # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sign` — benchmark function synthetic:sign:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sign:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgtz\ta0,c \n 4:\tli\tv0,1\n 8:\tsra\tv0,a0,0x1f\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-cf4f7ce4ee5f0af0/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 sign\n\n\nContents of section .text:\n 0000 1c800002 24020001 000417c3 03e00008 ....$...........\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sign # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sign:ido7.1","sym":"sign","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int sign(int x){ if(x>0)return 1; if(x<0)return -1; return 0; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,10 \n 4:\tnop\n 8:\tjr\tra\n c:\tli\tv0,1\n 10:\tbgez\ta0,20 \n 14:\tmove\tv0,zero\n 18:\tjr\tra\n 1c:\tli\tv0,-1\n 20:\tjr\tra\n 24:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 sign\n\n\nContents of section .text:\n 0000 18800003 00000000 03e00008 24020001 ............$...\n 0010 04810003 00001025 03e00008 2402ffff .......%....$...\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 66346637 63653465 65356630 ef-cf4f7ce4ee5f0\n 0130 6166302f 7265662e 63007369 676e0000 af0/ref.c.sign..\n 0140 7369676e 00000000 00000000 00000001 sign............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000a 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 sign(s32 a0) {\n if (a0 > 0) {\n return 1;\n } else {\n if (a0 < 0) {\n return -1;\n } else {\n return 0;\n }\n }\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sign(s32 arg0) {\n if (arg0 > 0) {\n return 1;\n }\n if (arg0 < 0) {\n return -1;\n }\n return 0;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sign` — benchmark function synthetic:sign:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sign\n blez\t$a0, .L10\n nop\n jr\t$ra\n li\t$v0, 1\n.L10:\n bgez\t$a0, .L20\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, -1\n.L20:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sign # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sign` — benchmark function synthetic:sign:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sign:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,10 \n 4:\tnop\n 8:\tjr\tra\n c:\tli\tv0,1\n 10:\tbgez\ta0,20 \n 14:\tmove\tv0,zero\n 18:\tjr\tra\n 1c:\tli\tv0,-1\n 20:\tjr\tra\n 24:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 sign\n\n\nContents of section .text:\n 0000 18800003 00000000 03e00008 24020001 ............$...\n 0010 04810003 00001025 03e00008 2402ffff .......%....$...\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 66346637 63653465 65356630 ef-cf4f7ce4ee5f0\n 0130 6166302f 7265662e 63007369 676e0000 af0/ref.c.sign..\n 0140 7369676e 00000000 00000000 00000001 sign............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000a 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sign # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sign:mwcc_242_81","sym":"sign","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int sign(int x){ if(x>0)return 1; if(x<0)return -1; return 0; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tble 10 \n 8:\tli r3,1\n c:\tblr\n 10:\tsrawi r3,r3,31\n 14:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 sign\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sign\n\n\nContents of section .text:\n 0000 2c030000 4081000c 38600001 4e800020 ,...@...8`..N.. \n 0010 7c63fe70 4e800020 |c.pN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 sign(u32 a0) {\n if (a0 > 0) {\n return 1;\n } else {\n return a0 >> 31;\n }\n}\n","score":6,"maxScore":7,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":3,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sign(s32 arg0) {\n if (arg0 > 0) {\n return 1;\n }\n return arg0 >> 0x1F;\n}\n","score":6,"maxScore":8,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":7,"ratio":0.8571428571428571,"kinds":{"insert":1,"delete":1,"replace":3,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sign` — benchmark function synthetic:sign:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sign\n cmpwi r3,0\n ble .L10\n li r3,1\n blr\n.L10:\n srawi r3,r3,31\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sign # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sign` — benchmark function synthetic:sign:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sign:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tble 10 \n 8:\tli r3,1\n c:\tblr\n 10:\tsrawi r3,r3,31\n 14:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 sign\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sign\n\n\nContents of section .text:\n 0000 2c030000 4081000c 38600001 4e800020 ,...@...8`..N.. \n 0010 7c63fe70 4e800020 |c.pN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sign # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:signum:agbcc","sym":"signum","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","branchless"],"loc":1,"refSource":"int signum(int x){ return (x>0)-(x<0); }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsignum\n\t.type\t signum,function\n\t.thumb_func\nsignum:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tlsr\tr0, r0, #0x1f\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t signum,.Lfe1-signum\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 signum(s32 a0) {\n s32 v0;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n v0 = 1;\n }\n return v0 - (a0 >> 31);\n}\n","score":4,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 signum(s32 arg0) {\n s32 var_r1;\n\n var_r1 = 0;\n if (arg0 > 0) {\n var_r1 = 1;\n }\n return var_r1 - ((u32) arg0 >> 0x1F);\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `signum` — benchmark function synthetic:signum:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsignum\n\t.type\t signum,function\n\t.thumb_func\nsignum:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tlsr\tr0, r0, #0x1f\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t signum,.Lfe1-signum\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function signum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `signum` — benchmark function synthetic:signum:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:signum:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsignum\n\t.type\t signum,function\n\t.thumb_func\nsignum:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tlsr\tr0, r0, #0x1f\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t signum,.Lfe1-signum\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name signum # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:signum:gcc2.7.2kmc","sym":"signum","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","branchless"],"loc":1,"refSource":"int signum(int x){ return (x>0)-(x<0); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x1f\n 4:\tslt\ta0,zero,a0\n 8:\tjr\tra\n c:\tsubu\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3877c64dcddef86b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 signum\n\n\nContents of section .text:\n 0000 000417c2 0004202a 03e00008 00821023 ...... *.......#\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 signum(u32 a0) {\n return (0 < a0) - (a0 >> 31);\n}\n","score":7,"maxScore":8,"compileErrors":null,"breakdown":{"insert":4,"delete":0,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 signum(u32 arg0) {\n return ((s32) arg0 > 0) - (arg0 >> 0x1F);\n}\n","score":7,"maxScore":8,"compileErrors":null,"breakdown":{"insert":4,"delete":0,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":7,"maxScore":8,"ratio":0.875,"kinds":{"insert":4,"delete":0,"replace":2,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `signum` — benchmark function synthetic:signum:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel signum\n srl\t$v0, $a0, 0x1f\n slt\t$a0, $zero, $a0\n jr\t$ra\n subu\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function signum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `signum` — benchmark function synthetic:signum:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:signum:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x1f\n 4:\tslt\ta0,zero,a0\n 8:\tjr\tra\n c:\tsubu\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3877c64dcddef86b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 signum\n\n\nContents of section .text:\n 0000 000417c2 0004202a 03e00008 00821023 ...... *.......#\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name signum # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:signum:ido7.1","sym":"signum","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","branchless"],"loc":1,"refSource":"int signum(int x){ return (x>0)-(x<0); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tt6,zero,a0\n 4:\tslti\tt7,a0,0\n 8:\tjr\tra\n c:\tsubu\tv0,t6,t7\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 signum\n\n\nContents of section .text:\n 0000 0004702a 288f0000 03e00008 01cf1023 ..p*(..........#\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 38373763 36346463 64646566 ef-3877c64dcddef\n 0130 3836622f 7265662e 63007369 676e756d 86b/ref.c.signum\n 0140 00000000 7369676e 756d0000 00000000 ....signum......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 signum(s32 a0) {\n return (0 < a0) - (a0 < 0);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 signum(s32 arg0) {\n return (arg0 > 0) - (arg0 < 0);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `signum` — benchmark function synthetic:signum:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel signum\n slt\t$t6, $zero, $a0\n slti\t$t7, $a0, 0\n jr\t$ra\n subu\t$v0, $t6, $t7\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function signum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `signum` — benchmark function synthetic:signum:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:signum:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tt6,zero,a0\n 4:\tslti\tt7,a0,0\n 8:\tjr\tra\n c:\tsubu\tv0,t6,t7\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 signum\n\n\nContents of section .text:\n 0000 0004702a 288f0000 03e00008 01cf1023 ..p*(..........#\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 38373763 36346463 64646566 ef-3877c64dcddef\n 0130 3836622f 7265662e 63007369 676e756d 86b/ref.c.signum\n 0140 00000000 7369676e 756d0000 00000000 ....signum......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name signum # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:signum:mwcc_242_81","sym":"signum","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","branchless"],"loc":1,"refSource":"int signum(int x){ return (x>0)-(x<0); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg r0,r3\n 4:\tsrwi r4,r3,31\n 8:\tandc r0,r0,r3\n c:\tsrwi r0,r0,31\n 10:\tsubf r3,r4,r0\n 14:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 signum\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 signum\n\n\nContents of section .text:\n 0000 7c0300d0 54640ffe 7c001878 54000ffe |...Td..|..xT...\n 0010 7c640050 4e800020 |d.PN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 signum(u32 a0) {\n return ((-a0 & ~a0) >> 31) - (a0 >> 31);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 signum(u32 arg0) {\n return ((s32) arg0 > 0) - (arg0 >> 0x1FU);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `signum` — benchmark function synthetic:signum:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel signum\n neg r0,r3\n srwi r4,r3,31\n andc r0,r0,r3\n srwi r0,r0,31\n subf r3,r4,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function signum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `signum` — benchmark function synthetic:signum:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:signum:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg r0,r3\n 4:\tsrwi r4,r3,31\n 8:\tandc r0,r0,r3\n c:\tsrwi r0,r0,31\n 10:\tsubf r3,r4,r0\n 14:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 signum\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 signum\n\n\nContents of section .text:\n 0000 7c0300d0 54640ffe 7c001878 54000ffe |...Td..|..xT...\n 0010 7c640050 4e800020 |d.PN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name signum # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:smixed:agbcc","sym":"smixed","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","mixed-width"],"loc":2,"refSource":"struct P{u8 hp;s16 x;int id;};\nint smixed(struct P*p){ return p->x + p->id; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsmixed\n\t.type\t smixed,function\n\t.thumb_func\nsmixed:\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r1, r2]\n\tldr\tr1, [r1, #0x4]\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t smixed,.Lfe1-smixed\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 smixed(s32 * a0) {\n return *(s16 *)(a0 + 2) + a0[1];\n}\n","score":1,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":96,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 smixed(void *arg0) {\n return arg0->unk2 + arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:3: warning: dereferencing `void *' pointer","/cand.c.pp.c:3: request for member `unk2' in something not a structure or union","/cand.c.pp.c:3: request for member `unk4' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":6,"ratio":0.16666666666666666,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `smixed` — benchmark function synthetic:smixed:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsmixed\n\t.type\t smixed,function\n\t.thumb_func\nsmixed:\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r1, r2]\n\tldr\tr1, [r1, #0x4]\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t smixed,.Lfe1-smixed\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function smixed # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `smixed` — benchmark function synthetic:smixed:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:smixed:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsmixed\n\t.type\t smixed,function\n\t.thumb_func\nsmixed:\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r1, r2]\n\tldr\tr1, [r1, #0x4]\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t smixed,.Lfe1-smixed\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name smixed # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:smixed:gcc2.7.2kmc","sym":"smixed","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field","mixed-width"],"loc":2,"refSource":"struct P{u8 hp;s16 x;int id;};\nint smixed(struct P*p){ return p->x + p->id; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tv1,2(a0)\n 4:\tlw\tv0,4(a0)\n 8:\tjr\tra\n c:\taddu\tv0,v1,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f184f70c99f7998a/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 smixed\n\n\nContents of section .text:\n 0000 84830002 8c820004 03e00008 00621021 .............b.!\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"struct Struct0 { u8 _pad0[2]; s16 field_2; s32 field_4; };\ns32 smixed(struct Struct0 * a0) {\n return a0->field_2 + a0->field_4;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 smixed(void *arg0) {\n return arg0->unk2 + arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: request for member `unk2' in something not a structure or union","/cand.c:3: request for member `unk4' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `smixed` — benchmark function synthetic:smixed:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel smixed\n lh\t$v1, 2($a0)\n lw\t$v0, 4($a0)\n jr\t$ra\n addu\t$v0, $v1, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function smixed # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `smixed` — benchmark function synthetic:smixed:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:smixed:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tv1,2(a0)\n 4:\tlw\tv0,4(a0)\n 8:\tjr\tra\n c:\taddu\tv0,v1,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f184f70c99f7998a/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 smixed\n\n\nContents of section .text:\n 0000 84830002 8c820004 03e00008 00621021 .............b.!\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name smixed # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:smixed:ido7.1","sym":"smixed","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","field","mixed-width"],"loc":2,"refSource":"struct P{u8 hp;s16 x;int id;};\nint smixed(struct P*p){ return p->x + p->id; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tt6,2(a0)\n 4:\tlw\tt7,4(a0)\n 8:\tjr\tra\n c:\taddu\tv0,t6,t7\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 smixed\n\n\nContents of section .text:\n 0000 848e0002 8c8f0004 03e00008 01cf1021 ...............!\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 31383466 37306339 39663739 ef-f184f70c99f79\n 0130 3938612f 7265662e 6300736d 69786564 98a/ref.c.smixed\n 0140 00000000 736d6978 65640000 00000000 ....smixed......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"struct Struct0 { u8 _pad0[2]; s16 field_2; s32 field_4; };\ns32 smixed(struct Struct0 * a0) {\n return a0->field_2 + a0->field_4;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 smixed(void *arg0) {\n return arg0->unk2 + arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `smixed` — benchmark function synthetic:smixed:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel smixed\n lh\t$t6, 2($a0)\n lw\t$t7, 4($a0)\n jr\t$ra\n addu\t$v0, $t6, $t7\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function smixed # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `smixed` — benchmark function synthetic:smixed:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:smixed:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tt6,2(a0)\n 4:\tlw\tt7,4(a0)\n 8:\tjr\tra\n c:\taddu\tv0,t6,t7\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 smixed\n\n\nContents of section .text:\n 0000 848e0002 8c8f0004 03e00008 01cf1021 ...............!\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 31383466 37306339 39663739 ef-f184f70c99f79\n 0130 3938612f 7265662e 6300736d 69786564 98a/ref.c.smixed\n 0140 00000000 736d6978 65640000 00000000 ....smixed......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name smixed # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:smixed:mwcc_242_81","sym":"smixed","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["struct","field","mixed-width"],"loc":2,"refSource":"struct P{u8 hp;s16 x;int id;};\nint smixed(struct P*p){ return p->x + p->id; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlha r4,2(r3)\n 4:\tlwz r0,4(r3)\n 8:\tadd r3,r4,r0\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 smixed\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 smixed\n\n\nContents of section .text:\n 0000 a8830002 80030004 7c640214 4e800020 ........|d..N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"struct Struct0 { u8 _pad0[2]; s16 field_2; s32 field_4; };\ns32 smixed(struct Struct0 * a0) {\n return a0->field_2 + a0->field_4;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 smixed(void *arg0) {\n return arg0->unk2 + arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `smixed` — benchmark function synthetic:smixed:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel smixed\n lha r4,2(r3)\n lwz r0,4(r3)\n add r3,r4,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function smixed # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `smixed` — benchmark function synthetic:smixed:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:smixed:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlha r4,2(r3)\n 4:\tlwz r0,4(r3)\n 8:\tadd r3,r4,r0\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 smixed\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 smixed\n\n\nContents of section .text:\n 0000 a8830002 80030004 7c640214 4e800020 ........|d..N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name smixed # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sstore:agbcc","sym":"sstore","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;};\nvoid sstore(struct S*s,int v){ s->b=v; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsstore\n\t.type\t sstore,function\n\t.thumb_func\nsstore:\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.Lfe1:\n\t.size\t sstore,.Lfe1-sstore\n","ctx":"struct S; void sstore(struct S*,int);","proto":{"sstore":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void sstore(s32 * a0, u32 a1) {\n a0[1] = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sstore(struct S *arg0, s32 arg1) {\n arg0->unk4 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:2: warning: `struct S' declared inside parameter list","/cand.c.pp.c:2: warning: its scope is only this definition or declaration,","/cand.c.pp.c:2: warning: which is probably not what you want.","/cand.c.pp.c:3: dereferencing pointer to incomplete type"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sstore` — benchmark function synthetic:sstore:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsstore\n\t.type\t sstore,function\n\t.thumb_func\nsstore:\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.Lfe1:\n\t.size\t sstore,.Lfe1-sstore\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void sstore(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sstore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sstore` — benchmark function synthetic:sstore:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sstore:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsstore\n\t.type\t sstore,function\n\t.thumb_func\nsstore:\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.Lfe1:\n\t.size\t sstore,.Lfe1-sstore\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sstore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sstore # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sstore:gcc2.7.2kmc","sym":"sstore","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;};\nvoid sstore(struct S*s,int v){ s->b=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,4(a0)\n\t...\n","ctx":"struct S; void sstore(struct S*,int);","proto":{"sstore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-57efdacee8dfe43c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 sstore\n\n\nContents of section .text:\n 0000 03e00008 ac850004 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void sstore(s32 * a0, u32 a1) {\n a0[1] = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sstore(struct S *arg0, s32 arg1) {\n arg0->unk4 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: dereferencing pointer to incomplete type"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sstore` — benchmark function synthetic:sstore:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sstore\n jr\t$ra\n sw\t$a1, 4($a0)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void sstore(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sstore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sstore` — benchmark function synthetic:sstore:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sstore:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,4(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-57efdacee8dfe43c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 sstore\n\n\nContents of section .text:\n 0000 03e00008 ac850004 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sstore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sstore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sstore:ido7.1","sym":"sstore","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;};\nvoid sstore(struct S*s,int v){ s->b=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,4(a0)\n\t...\n","ctx":"struct S; void sstore(struct S*,int);","proto":{"sstore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 sstore\n\n\nContents of section .text:\n 0000 03e00008 ac850004 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 37656664 61636565 38646665 ef-57efdacee8dfe\n 0130 3433632f 7265662e 63007373 746f7265 43c/ref.c.sstore\n 0140 00000000 7373746f 72650000 00000000 ....sstore......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void sstore(s32 * a0, u32 a1) {\n a0[1] = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sstore(struct S *arg0, s32 arg1) {\n arg0->unk4 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: 'unk4' undefined; reoccurrences will not be reported.","cfe: Error: /cand.c, line 3: member of structure or union required"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sstore` — benchmark function synthetic:sstore:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sstore\n jr\t$ra\n sw\t$a1, 4($a0)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void sstore(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sstore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sstore` — benchmark function synthetic:sstore:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sstore:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,4(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 sstore\n\n\nContents of section .text:\n 0000 03e00008 ac850004 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 37656664 61636565 38646665 ef-57efdacee8dfe\n 0130 3433632f 7265662e 63007373 746f7265 43c/ref.c.sstore\n 0140 00000000 7373746f 72650000 00000000 ....sstore......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sstore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sstore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sstore:mwcc_242_81","sym":"sstore","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;};\nvoid sstore(struct S*s,int v){ s->b=v; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,4(r3)\n 4:\tblr\n","ctx":"struct S; void sstore(struct S*,int);","proto":{"sstore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sstore\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sstore\n\n\nContents of section .text:\n 0000 90830004 4e800020 ....N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void sstore(s32 * a0, u32 a1) {\n a0[1] = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sstore(struct S *arg0, s32 arg1) {\n arg0->unk4 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^^^","# illegal use of incomplete struct/union/class 'struct S'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sstore` — benchmark function synthetic:sstore:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sstore\n stw r4,4(r3)\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void sstore(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sstore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sstore` — benchmark function synthetic:sstore:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sstore:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,4(r3)\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sstore\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sstore\n\n\nContents of section .text:\n 0000 90830004 4e800020 ....N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sstore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sstore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:storep:agbcc","sym":"storep","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","store"],"loc":1,"refSource":"void storep(int *p,int v){ *p=v; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstorep\n\t.type\t storep,function\n\t.thumb_func\nstorep:\n\tstr\tr1, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t storep,.Lfe1-storep\n","ctx":"void storep(int*,int);","proto":{"storep":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void storep(s32 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void storep(s32 *arg0, s32 arg1) {\n *arg0 = arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `storep` — benchmark function synthetic:storep:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstorep\n\t.type\t storep,function\n\t.thumb_func\nstorep:\n\tstr\tr1, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t storep,.Lfe1-storep\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid storep(int*,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function storep # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `storep` — benchmark function synthetic:storep:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:storep:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstorep\n\t.type\t storep,function\n\t.thumb_func\nstorep:\n\tstr\tr1, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t storep,.Lfe1-storep\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"storep\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name storep # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:storep:gcc2.7.2kmc","sym":"storep","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","store"],"loc":1,"refSource":"void storep(int *p,int v){ *p=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,0(a0)\n\t...\n","ctx":"void storep(int*,int);","proto":{"storep":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1cef70b9422e0dc8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 storep\n\n\nContents of section .text:\n 0000 03e00008 ac850000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void storep(s32 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void storep(s32 *arg0, s32 arg1) {\n *arg0 = arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `storep` — benchmark function synthetic:storep:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel storep\n jr\t$ra\n sw\t$a1, 0($a0)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid storep(int*,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function storep # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `storep` — benchmark function synthetic:storep:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:storep:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,0(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1cef70b9422e0dc8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 storep\n\n\nContents of section .text:\n 0000 03e00008 ac850000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"storep\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name storep # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:storep:ido7.1","sym":"storep","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","store"],"loc":1,"refSource":"void storep(int *p,int v){ *p=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,0(a0)\n\t...\n","ctx":"void storep(int*,int);","proto":{"storep":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 storep\n\n\nContents of section .text:\n 0000 03e00008 ac850000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 63656637 30623934 32326530 ef-1cef70b9422e0\n 0130 6463382f 7265662e 63007374 6f726570 dc8/ref.c.storep\n 0140 00000000 73746f72 65700000 00000000 ....storep......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void storep(s32 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void storep(s32 *arg0, s32 arg1) {\n *arg0 = arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `storep` — benchmark function synthetic:storep:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel storep\n jr\t$ra\n sw\t$a1, 0($a0)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid storep(int*,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function storep # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `storep` — benchmark function synthetic:storep:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:storep:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,0(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 storep\n\n\nContents of section .text:\n 0000 03e00008 ac850000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 63656637 30623934 32326530 ef-1cef70b9422e0\n 0130 6463382f 7265662e 63007374 6f726570 dc8/ref.c.storep\n 0140 00000000 73746f72 65700000 00000000 ....storep......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"storep\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name storep # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:storep:mwcc_242_81","sym":"storep","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","store"],"loc":1,"refSource":"void storep(int *p,int v){ *p=v; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,0(r3)\n 4:\tblr\n","ctx":"void storep(int*,int);","proto":{"storep":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 storep\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 storep\n\n\nContents of section .text:\n 0000 90830000 4e800020 ....N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void storep(s32 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void storep(s32 *arg0, s32 arg1) {\n *arg0 = arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `storep` — benchmark function synthetic:storep:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel storep\n stw r4,0(r3)\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid storep(int*,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function storep # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `storep` — benchmark function synthetic:storep:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:storep:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,0(r3)\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 storep\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 storep\n\n\nContents of section .text:\n 0000 90830000 4e800020 ....N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"storep\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name storep # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strcmp1:agbcc","sym":"strcmp1","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","memory","pointer","compare"],"loc":1,"refSource":"int strcmp1(char *a,char *b){ while(*a && *a==*b){a++;b++;} return *a-*b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstrcmp1\n\t.type\t strcmp1,function\n\t.thumb_func\nstrcmp1:\n\tb\t.L8\n.L5:\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n.L8:\n\tldrb\tr2, [r0]\n\tcmp\tr2, #0\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr3, [r1]\n\tcmp\tr2, r3\n\tbeq\t.L5\t@cond_branch\n.L4:\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t strcmp1,.Lfe1-strcmp1\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'strcmp1' — structure: cannot structure 'strcmp1': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tstrcmp1 */\n/* \t.type\t strcmp1,function */\n/* \t.thumb_func */\n/* strcmp1: */\n/* \tb\t.L8 */\n/* .L5: */\n/* \tadd\tr0, r0, #0x1 */\n/* \tadd\tr1, r1, #0x1 */\n/* .L8: */\n/* \tldrb\tr2, [r0] */\n/* \tcmp\tr2, #0 */\n/* \tbeq\t.L4\t@cond_branch */\n/* \tldrb\tr3, [r1] */\n/* \tcmp\tr2, r3 */\n/* \tbeq\t.L5\t@cond_branch */\n/* .L4: */\n/* \tldrb\tr0, [r0] */\n/* \tldrb\tr1, [r1] */\n/* \tsub\tr0, r0, r1 */\n/* \tbx\tlr */\n/* .Lfe1: */\n/* \t.size\t strcmp1,.Lfe1-strcmp1 */\nvoid strcmp1(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'strcmp1': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'strcmp1': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 strcmp1(u8 *arg0, u8 *arg1) {\n u8 *var_r0;\n u8 *var_r1;\n u8 temp_r2;\n\n var_r0 = arg0;\n var_r1 = arg1;\nloop_2:\n temp_r2 = *var_r0;\n if ((temp_r2 != 0) && (temp_r2 == *var_r1)) {\n var_r0 += 1;\n var_r1 += 1;\n goto loop_2;\n }\n return *var_r0 - *var_r1;\n}\n","score":10,"maxScore":15,"compileErrors":null,"breakdown":{"insert":2,"delete":3,"replace":2,"opMismatch":1,"argMismatch":2},"quality":{"score":88,"lines":15,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":10,"maxScore":15,"ratio":0.6666666666666666,"kinds":{"insert":2,"delete":3,"replace":2,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strcmp1` — benchmark function synthetic:strcmp1:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstrcmp1\n\t.type\t strcmp1,function\n\t.thumb_func\nstrcmp1:\n\tb\t.L8\n.L5:\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n.L8:\n\tldrb\tr2, [r0]\n\tcmp\tr2, #0\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr3, [r1]\n\tcmp\tr2, r3\n\tbeq\t.L5\t@cond_branch\n.L4:\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t strcmp1,.Lfe1-strcmp1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strcmp1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strcmp1` — benchmark function synthetic:strcmp1:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strcmp1:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstrcmp1\n\t.type\t strcmp1,function\n\t.thumb_func\nstrcmp1:\n\tb\t.L8\n.L5:\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n.L8:\n\tldrb\tr2, [r0]\n\tcmp\tr2, #0\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr3, [r1]\n\tcmp\tr2, r3\n\tbeq\t.L5\t@cond_branch\n.L4:\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t strcmp1,.Lfe1-strcmp1\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name strcmp1 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strcmp1:gcc2.7.2kmc","sym":"strcmp1","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","memory","pointer","compare"],"loc":1,"refSource":"int strcmp1(char *a,char *b){ while(*a && *a==*b){a++;b++;} return *a-*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tv1,0(a0)\n 4:\tbeqz\tv1,28 \n 8:\tnop\n c:\tlbu\tv0,0(a1)\n 10:\tbne\tv1,v0,28 \n 14:\tnop\n 18:\taddiu\ta0,a0,1\n 1c:\tlbu\tv1,0(a0)\n 20:\tbnez\tv1,c \n 24:\taddiu\ta1,a1,1\n 28:\tlbu\tv1,0(a0)\n 2c:\tlbu\tv0,0(a1)\n 30:\tjr\tra\n 34:\tsubu\tv0,v1,v0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-76d04718a4a46a8a/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 strcmp1\n\n\nContents of section .text:\n 0000 90830000 10600008 00000000 90a20000 .....`..........\n 0010 14620005 00000000 24840001 90830000 .b......$.......\n 0020 1460fffa 24a50001 90830000 90a20000 .`..$...........\n 0030 03e00008 00621023 00000000 00000000 .....b.#........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'strcmp1' — structure: cannot structure 'strcmp1': unrecovered back-edge into block #1 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlbu\tv1,0(a0) */\n/* 4:\tbeqz\tv1,28 */\n/* 8:\tnop */\n/* c:\tlbu\tv0,0(a1) */\n/* 10:\tbne\tv1,v0,28 */\n/* 14:\tnop */\n/* 18:\taddiu\ta0,a0,1 */\n/* 1c:\tlbu\tv1,0(a0) */\n/* 20:\tbnez\tv1,c */\n/* 24:\taddiu\ta1,a1,1 */\n/* 28:\tlbu\tv1,0(a0) */\n/* 2c:\tlbu\tv0,0(a1) */\n/* 30:\tjr\tra */\n/* 34:\tsubu\tv0,v1,v0 */\n/* \t... */\nvoid strcmp1(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'strcmp1': unrecovered back-edge into block #1 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'strcmp1': unrecovered back-edge into block #1 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 strcmp1(u8 *arg0, u8 *arg1) {\n u8 *var_a0;\n u8 *var_a1;\n u8 var_v1;\n\n var_a0 = arg0;\n var_a1 = arg1;\n var_v1 = *var_a0;\n if (var_v1 != 0) {\nloop_1:\n if (var_v1 == *var_a1) {\n var_a0 += 1;\n var_v1 = *var_a0;\n var_a1 += 1;\n if (var_v1 != 0) {\n goto loop_1;\n }\n }\n }\n return *var_a0 - *var_a1;\n}\n","score":0,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":88,"lines":20,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strcmp1` — benchmark function synthetic:strcmp1:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel strcmp1\n lbu\t$v1, 0($a0)\n beqz\t$v1, .L28\n nop\n.Lc:\n lbu\t$v0, 0($a1)\n bne\t$v1, $v0, .L28\n nop\n addiu\t$a0, $a0, 1\n lbu\t$v1, 0($a0)\n bnez\t$v1, .Lc\n addiu\t$a1, $a1, 1\n.L28:\n lbu\t$v1, 0($a0)\n lbu\t$v0, 0($a1)\n jr\t$ra\n subu\t$v0, $v1, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strcmp1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strcmp1` — benchmark function synthetic:strcmp1:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strcmp1:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tv1,0(a0)\n 4:\tbeqz\tv1,28 \n 8:\tnop\n c:\tlbu\tv0,0(a1)\n 10:\tbne\tv1,v0,28 \n 14:\tnop\n 18:\taddiu\ta0,a0,1\n 1c:\tlbu\tv1,0(a0)\n 20:\tbnez\tv1,c \n 24:\taddiu\ta1,a1,1\n 28:\tlbu\tv1,0(a0)\n 2c:\tlbu\tv0,0(a1)\n 30:\tjr\tra\n 34:\tsubu\tv0,v1,v0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-76d04718a4a46a8a/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 strcmp1\n\n\nContents of section .text:\n 0000 90830000 10600008 00000000 90a20000 .....`..........\n 0010 14620005 00000000 24840001 90830000 .b......$.......\n 0020 1460fffa 24a50001 90830000 90a20000 .`..$...........\n 0030 03e00008 00621023 00000000 00000000 .....b.#........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name strcmp1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strcmp1:ido7.1","sym":"strcmp1","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","memory","pointer","compare"],"loc":1,"refSource":"int strcmp1(char *a,char *b){ while(*a && *a==*b){a++;b++;} return *a-*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tv1,0(a0)\n 4:\tbeqzl\tv1,3c \n 8:\tlbu\tt8,0(a1)\n c:\tlbu\tt6,0(a1)\n 10:\tbnel\tv1,t6,3c \n 14:\tlbu\tt8,0(a1)\n 18:\tlbu\tv1,1(a0)\n 1c:\taddiu\ta0,a0,1\n 20:\taddiu\ta1,a1,1\n 24:\tbeqzl\tv1,3c \n 28:\tlbu\tt8,0(a1)\n 2c:\tlbu\tt7,0(a1)\n 30:\tbeql\tv1,t7,1c \n 34:\tlbu\tv1,1(a0)\n 38:\tlbu\tt8,0(a1)\n 3c:\tjr\tra\n 40:\tsubu\tv0,v1,t8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t00000044 strcmp1\n\n\nContents of section .text:\n 0000 90830000 5060000d 90b80000 90ae0000 ....P`..........\n 0010 546e000a 90b80000 90830001 24840001 Tn..........$...\n 0020 24a50001 50600005 90b80000 90af0000 $...P`..........\n 0030 506ffffa 90830001 90b80000 03e00008 Po..............\n 0040 00781023 00000000 00000000 00000000 .x.#............\nContents of section .options:\n 0000 01200000 00000000 8100c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000011 00000004 000001b8 p...............\n 0010 00000005 000002fc 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000038 00000264 ....... ...8...d\n 0040 00000008 0000029c 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 08070000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000044 20200001 00000001 .......D ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 36643034 37313861 34613436 ef-76d04718a4a46\n 0130 6138612f 7265662e 63007374 72636d70 a8a/ref.c.strcmp\n 0140 31000000 73747263 6d703100 00000000 1...strcmp1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000011 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'strcmp1' — lift: cannot lift 'strcmp1': unmodelled control transfer 'beqzl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlbu\tv1,0(a0) */\n/* 4:\tbeqzl\tv1,3c */\n/* 8:\tlbu\tt8,0(a1) */\n/* c:\tlbu\tt6,0(a1) */\n/* 10:\tbnel\tv1,t6,3c */\n/* 14:\tlbu\tt8,0(a1) */\n/* 18:\tlbu\tv1,1(a0) */\n/* 1c:\taddiu\ta0,a0,1 */\n/* 20:\taddiu\ta1,a1,1 */\n/* 24:\tbeqzl\tv1,3c */\n/* 28:\tlbu\tt8,0(a1) */\n/* 2c:\tlbu\tt7,0(a1) */\n/* 30:\tbeql\tv1,t7,1c */\n/* 34:\tlbu\tv1,1(a0) */\n/* 38:\tlbu\tt8,0(a1) */\n/* 3c:\tjr\tra */\n/* 40:\tsubu\tv0,v1,t8 */\n/* \t... */\nvoid strcmp1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'strcmp1': unmodelled control transfer 'beqzl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":26,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'strcmp1': unmodelled control transfer 'beqzl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 strcmp1(u8 *arg0, u8 *arg1) {\n u8 *var_a0;\n u8 *var_a1;\n u8 var_v1;\n\n var_a0 = arg0;\n var_a1 = arg1;\n var_v1 = *var_a0;\n if ((var_v1 != 0) && (var_v1 == *var_a1)) {\nloop_2:\n var_v1 = var_a0->unk1;\n var_a0 += 1;\n var_a1 += 1;\n if (var_v1 != 0) {\n if (var_v1 == *var_a1) {\n goto loop_2;\n }\n }\n }\n return var_v1 - *var_a1;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":20,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 12: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strcmp1` — benchmark function synthetic:strcmp1:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel strcmp1\n lbu\t$v1, 0($a0)\n beqzl\t$v1, .L3c\n lbu\t$t8, 0($a1)\n lbu\t$t6, 0($a1)\n bnel\t$v1, $t6, .L3c\n lbu\t$t8, 0($a1)\n lbu\t$v1, 1($a0)\n.L1c:\n addiu\t$a0, $a0, 1\n addiu\t$a1, $a1, 1\n beqzl\t$v1, .L3c\n lbu\t$t8, 0($a1)\n lbu\t$t7, 0($a1)\n beql\t$v1, $t7, .L1c\n lbu\t$v1, 1($a0)\n lbu\t$t8, 0($a1)\n.L3c:\n jr\t$ra\n subu\t$v0, $v1, $t8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strcmp1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strcmp1` — benchmark function synthetic:strcmp1:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strcmp1:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tv1,0(a0)\n 4:\tbeqzl\tv1,3c \n 8:\tlbu\tt8,0(a1)\n c:\tlbu\tt6,0(a1)\n 10:\tbnel\tv1,t6,3c \n 14:\tlbu\tt8,0(a1)\n 18:\tlbu\tv1,1(a0)\n 1c:\taddiu\ta0,a0,1\n 20:\taddiu\ta1,a1,1\n 24:\tbeqzl\tv1,3c \n 28:\tlbu\tt8,0(a1)\n 2c:\tlbu\tt7,0(a1)\n 30:\tbeql\tv1,t7,1c \n 34:\tlbu\tv1,1(a0)\n 38:\tlbu\tt8,0(a1)\n 3c:\tjr\tra\n 40:\tsubu\tv0,v1,t8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t00000044 strcmp1\n\n\nContents of section .text:\n 0000 90830000 5060000d 90b80000 90ae0000 ....P`..........\n 0010 546e000a 90b80000 90830001 24840001 Tn..........$...\n 0020 24a50001 50600005 90b80000 90af0000 $...P`..........\n 0030 506ffffa 90830001 90b80000 03e00008 Po..............\n 0040 00781023 00000000 00000000 00000000 .x.#............\nContents of section .options:\n 0000 01200000 00000000 8100c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000011 00000004 000001b8 p...............\n 0010 00000005 000002fc 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000038 00000264 ....... ...8...d\n 0040 00000008 0000029c 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 08070000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000044 20200001 00000001 .......D ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 36643034 37313861 34613436 ef-76d04718a4a46\n 0130 6138612f 7265662e 63007374 72636d70 a8a/ref.c.strcmp\n 0140 31000000 73747263 6d703100 00000000 1...strcmp1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000011 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name strcmp1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strcmp1:mwcc_242_81","sym":"strcmp1","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","memory","pointer","compare"],"loc":1,"refSource":"int strcmp1(char *a,char *b){ while(*a && *a==*b){a++;b++;} return *a-*b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tb c \n 4:\taddi r3,r3,1\n 8:\taddi r4,r4,1\n c:\tlbz r6,0(r3)\n 10:\textsb. r0,r6\n 14:\tbeq 2c \n 18:\tlbz r0,0(r4)\n 1c:\textsb r5,r6\n 20:\textsb r0,r0\n 24:\tcmpw r5,r0\n 28:\tbeq 4 \n 2c:\tlbz r3,0(r4)\n 30:\textsb r0,r6\n 34:\textsb r3,r3\n 38:\tsubf r3,r3,r0\n 3c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000040 strcmp1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 strcmp1\n\n\nContents of section .text:\n 0000 4800000c 38630001 38840001 88c30000 H...8c..8.......\n 0010 7cc00775 41820018 88040000 7cc50774 |..uA.......|..t\n 0020 7c000774 7c050000 4182ffdc 88640000 |..t|...A....d..\n 0030 7cc00774 7c630774 7c630050 4e800020 |..t|c.t|c.PN.. \nContents of section .mwcats.text:\n 0000 02000040 00000000 ...@.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'strcmp1' — structure: cannot structure 'strcmp1': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tb c */\n/* 4:\taddi r3,r3,1 */\n/* 8:\taddi r4,r4,1 */\n/* c:\tlbz r6,0(r3) */\n/* 10:\textsb. r0,r6 */\n/* 14:\tbeq 2c */\n/* 18:\tlbz r0,0(r4) */\n/* 1c:\textsb r5,r6 */\n/* 20:\textsb r0,r0 */\n/* 24:\tcmpw r5,r0 */\n/* 28:\tbeq 4 */\n/* 2c:\tlbz r3,0(r4) */\n/* 30:\textsb r0,r6 */\n/* 34:\textsb r3,r3 */\n/* 38:\tsubf r3,r3,r0 */\n/* 3c:\tblr */\nvoid strcmp1(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'strcmp1': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":24,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'strcmp1': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 strcmp1(u8 *arg0, u8 *arg1) {\n u8 *var_r3;\n u8 *var_r4;\n u8 temp_r6;\n\n var_r3 = arg0;\n var_r4 = arg1;\nloop_2:\n temp_r6 = *var_r3;\n if (((s8) temp_r6 != 0) && ((s8) temp_r6 == (s8) *var_r4)) {\n var_r3 += 1;\n var_r4 += 1;\n goto loop_2;\n }\n return (s8) temp_r6 - (s8) *var_r4;\n}\n","score":23,"maxScore":25,"compileErrors":null,"breakdown":{"insert":9,"delete":11,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":82,"lines":15,"gotos":1,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":23,"maxScore":25,"ratio":0.92,"kinds":{"insert":9,"delete":11,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strcmp1` — benchmark function synthetic:strcmp1:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel strcmp1\n b .Lc\n.L4:\n addi r3,r3,1\n addi r4,r4,1\n.Lc:\n lbz r6,0(r3)\n extsb. r0,r6\n beq .L2c\n lbz r0,0(r4)\n extsb r5,r6\n extsb r0,r0\n cmpw r5,r0\n beq .L4\n.L2c:\n lbz r3,0(r4)\n extsb r0,r6\n extsb r3,r3\n subf r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strcmp1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strcmp1` — benchmark function synthetic:strcmp1:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strcmp1:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tb c \n 4:\taddi r3,r3,1\n 8:\taddi r4,r4,1\n c:\tlbz r6,0(r3)\n 10:\textsb. r0,r6\n 14:\tbeq 2c \n 18:\tlbz r0,0(r4)\n 1c:\textsb r5,r6\n 20:\textsb r0,r0\n 24:\tcmpw r5,r0\n 28:\tbeq 4 \n 2c:\tlbz r3,0(r4)\n 30:\textsb r0,r6\n 34:\textsb r3,r3\n 38:\tsubf r3,r3,r0\n 3c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000040 strcmp1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 strcmp1\n\n\nContents of section .text:\n 0000 4800000c 38630001 38840001 88c30000 H...8c..8.......\n 0010 7cc00775 41820018 88040000 7cc50774 |..uA.......|..t\n 0020 7c000774 7c050000 4182ffdc 88640000 |..t|...A....d..\n 0030 7cc00774 7c630774 7c630050 4e800020 |..t|c.t|c.PN.. \nContents of section .mwcats.text:\n 0000 02000040 00000000 ...@.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name strcmp1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strlen1:agbcc","sym":"strlen1","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","while","memory","pointer"],"loc":1,"refSource":"int strlen1(char *s){ int n=0; while(*s){n++;s++;} return n; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstrlen1\n\t.type\t strlen1,function\n\t.thumb_func\nstrlen1:\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t strlen1,.Lfe1-strlen1\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 strlen1(u8 * a0) {\n u8 * v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n while (*v0 != 0) {\n v1 = v1 + 1;\n v0 = v0 + 1;\n }\n return v1;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 strlen1(u8 *arg0) {\n s32 var_r2;\n u8 *var_r1;\n\n var_r1 = arg0;\n var_r2 = 0;\nloop_2:\n if (*var_r1 != 0) {\n var_r2 += 1;\n var_r1 += 1;\n goto loop_2;\n }\n return var_r2;\n}\n","score":7,"maxScore":13,"compileErrors":null,"breakdown":{"insert":3,"delete":3,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":88,"lines":13,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strlen1` — benchmark function synthetic:strlen1:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstrlen1\n\t.type\t strlen1,function\n\t.thumb_func\nstrlen1:\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t strlen1,.Lfe1-strlen1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strlen1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strlen1` — benchmark function synthetic:strlen1:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strlen1:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstrlen1\n\t.type\t strlen1,function\n\t.thumb_func\nstrlen1:\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t strlen1,.Lfe1-strlen1\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name strlen1 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strlen1:gcc2.7.2kmc","sym":"strlen1","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","while","memory","pointer"],"loc":1,"refSource":"int strlen1(char *s){ int n=0; while(*s){n++;s++;} return n; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tv0,0(a0)\n 4:\tbeqz\tv0,1c \n 8:\tmove\tv1,zero\n c:\taddiu\ta0,a0,1\n 10:\tlbu\tv0,0(a0)\n 14:\tbnez\tv0,c \n 18:\taddiu\tv1,v1,1\n 1c:\tjr\tra\n 20:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-90eaa0315695119d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 strlen1\n\n\nContents of section .text:\n 0000 90820000 10400005 00001821 24840001 .....@.....!$...\n 0010 90820000 1440fffd 24630001 03e00008 .....@..$c......\n 0020 00601021 00000000 00000000 00000000 .`.!............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 strlen1(u8 * a0) {\n u8 * v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n while (*v0 != 0) {\n v0 = v0 + 1;\n v1 = v1 + 1;\n }\n return v1;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 strlen1(u8 *arg0) {\n s32 var_v1;\n u8 *var_a0;\n\n var_a0 = arg0;\n var_v1 = 0;\n if (*var_a0 != 0) {\n do {\n var_a0 += 1;\n var_v1 += 1;\n } while (*var_a0 != 0);\n }\n return var_v1;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strlen1` — benchmark function synthetic:strlen1:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel strlen1\n lbu\t$v0, 0($a0)\n beqz\t$v0, .L1c\n move\t$v1, $zero\n.Lc:\n addiu\t$a0, $a0, 1\n lbu\t$v0, 0($a0)\n bnez\t$v0, .Lc\n addiu\t$v1, $v1, 1\n.L1c:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strlen1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strlen1` — benchmark function synthetic:strlen1:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strlen1:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tv0,0(a0)\n 4:\tbeqz\tv0,1c \n 8:\tmove\tv1,zero\n c:\taddiu\ta0,a0,1\n 10:\tlbu\tv0,0(a0)\n 14:\tbnez\tv0,c \n 18:\taddiu\tv1,v1,1\n 1c:\tjr\tra\n 20:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-90eaa0315695119d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 strlen1\n\n\nContents of section .text:\n 0000 90820000 10400005 00001821 24840001 .....@.....!$...\n 0010 90820000 1440fffd 24630001 03e00008 .....@..$c......\n 0020 00601021 00000000 00000000 00000000 .`.!............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name strlen1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strlen1:ido7.1","sym":"strlen1","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","while","memory","pointer"],"loc":1,"refSource":"int strlen1(char *s){ int n=0; while(*s){n++;s++;} return n; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tt6,0(a0)\n 4:\tmove\tv1,zero\n 8:\tbeqz\tt6,24 \n c:\tnop\n 10:\tlbu\tt7,1(a0)\n 14:\taddiu\tv1,v1,1\n 18:\taddiu\ta0,a0,1\n 1c:\tbnezl\tt7,14 \n 20:\tlbu\tt7,1(a0)\n 24:\tjr\tra\n 28:\tmove\tv0,v1\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c strlen1\n\n\nContents of section .text:\n 0000 908e0000 00001825 11c00006 00000000 .......%........\n 0010 908f0001 24630001 24840001 55e0fffd ....$c..$...U...\n 0020 908f0001 03e00008 00601025 00000000 .........`.%....\nContents of section .options:\n 0000 01200000 00000000 8000c01c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c01c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000004 00000198 p...............\n 0010 00000005 000002dc 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 00000008 0000027c 00000001 00000284 .......|........\n 0050 00000000 00000000 00000001 000002cc ................\n 0060 08010000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000002c 20200001 00000001 ......., ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 30656161 30333135 36393531 ef-90eaa03156951\n 0130 3139642f 7265662e 63007374 726c656e 19d/ref.c.strlen\n 0140 31000000 7374726c 656e3100 00000000 1...strlen1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000b 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'strlen1' — lift: cannot lift 'strlen1': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlbu\tt6,0(a0) */\n/* 4:\tmove\tv1,zero */\n/* 8:\tbeqz\tt6,24 */\n/* c:\tnop */\n/* 10:\tlbu\tt7,1(a0) */\n/* 14:\taddiu\tv1,v1,1 */\n/* 18:\taddiu\ta0,a0,1 */\n/* 1c:\tbnezl\tt7,14 */\n/* 20:\tlbu\tt7,1(a0) */\n/* 24:\tjr\tra */\n/* 28:\tmove\tv0,v1 */\n/* 2c:\tnop */\nvoid strlen1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'strlen1': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'strlen1': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 strlen1(u8 *arg0) {\n s32 var_v1;\n u8 *var_a0;\n u8 temp_t7;\n\n var_a0 = arg0;\n var_v1 = 0;\n if (*var_a0 != 0) {\n do {\n temp_t7 = var_a0->unk1;\n var_v1 += 1;\n var_a0 += 1;\n } while (temp_t7 != 0);\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 11: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strlen1` — benchmark function synthetic:strlen1:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel strlen1\n lbu\t$t6, 0($a0)\n move\t$v1, $zero\n beqz\t$t6, .L24\n nop\n lbu\t$t7, 1($a0)\n.L14:\n addiu\t$v1, $v1, 1\n addiu\t$a0, $a0, 1\n bnezl\t$t7, .L14\n lbu\t$t7, 1($a0)\n.L24:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strlen1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strlen1` — benchmark function synthetic:strlen1:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strlen1:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tt6,0(a0)\n 4:\tmove\tv1,zero\n 8:\tbeqz\tt6,24 \n c:\tnop\n 10:\tlbu\tt7,1(a0)\n 14:\taddiu\tv1,v1,1\n 18:\taddiu\ta0,a0,1\n 1c:\tbnezl\tt7,14 \n 20:\tlbu\tt7,1(a0)\n 24:\tjr\tra\n 28:\tmove\tv0,v1\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c strlen1\n\n\nContents of section .text:\n 0000 908e0000 00001825 11c00006 00000000 .......%........\n 0010 908f0001 24630001 24840001 55e0fffd ....$c..$...U...\n 0020 908f0001 03e00008 00601025 00000000 .........`.%....\nContents of section .options:\n 0000 01200000 00000000 8000c01c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c01c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000004 00000198 p...............\n 0010 00000005 000002dc 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 00000008 0000027c 00000001 00000284 .......|........\n 0050 00000000 00000000 00000001 000002cc ................\n 0060 08010000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000002c 20200001 00000001 ......., ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 30656161 30333135 36393531 ef-90eaa03156951\n 0130 3139642f 7265662e 63007374 726c656e 19d/ref.c.strlen\n 0140 31000000 7374726c 656e3100 00000000 1...strlen1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000b 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name strlen1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strlen1:mwcc_242_81","sym":"strlen1","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","while","memory","pointer"],"loc":1,"refSource":"int strlen1(char *s){ int n=0; while(*s){n++;s++;} return n; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r4,0\n 4:\tb 10 \n 8:\taddi r4,r4,1\n c:\taddi r3,r3,1\n 10:\tlbz r0,0(r3)\n 14:\textsb. r0,r0\n 18:\tbne 8 \n 1c:\tmr r3,r4\n 20:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000024 strlen1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 strlen1\n\n\nContents of section .text:\n 0000 38800000 4800000c 38840001 38630001 8...H...8...8c..\n 0010 88030000 7c000775 4082fff0 7c832378 ....|..u@...|.#x\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 strlen1(u8 * a0) {\n u8 * v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n while ((s8)*v0 != 0) {\n v1 = v1 + 1;\n v0 = v0 + 1;\n }\n return v1;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 strlen1(u8 *arg0) {\n s32 var_r4;\n u8 *var_r3;\n\n var_r3 = arg0;\n var_r4 = 0;\nloop_2:\n if ((s8) *var_r3 != 0) {\n var_r4 += 1;\n var_r3 += 1;\n goto loop_2;\n }\n return var_r4;\n}\n","score":7,"maxScore":12,"compileErrors":null,"breakdown":{"insert":3,"delete":3,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":88,"lines":13,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strlen1` — benchmark function synthetic:strlen1:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel strlen1\n li r4,0\n b .L10\n.L8:\n addi r4,r4,1\n addi r3,r3,1\n.L10:\n lbz r0,0(r3)\n extsb. r0,r0\n bne .L8\n mr r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strlen1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strlen1` — benchmark function synthetic:strlen1:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strlen1:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r4,0\n 4:\tb 10 \n 8:\taddi r4,r4,1\n c:\taddi r3,r3,1\n 10:\tlbz r0,0(r3)\n 14:\textsb. r0,r0\n 18:\tbne 8 \n 1c:\tmr r3,r4\n 20:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000024 strlen1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 strlen1\n\n\nContents of section .text:\n 0000 38800000 4800000c 38840001 38630001 8...H...8...8c..\n 0010 88030000 7c000775 4082fff0 7c832378 ....|..u@...|.#x\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name strlen1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:structarr:agbcc","sym":"structarr","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","struct","memory","array"],"loc":2,"refSource":"struct P{int x;int y;};\nint structarr(struct P *a,int n){ int s=0,i; for(i=0;i= a1) {\n v1 = 0;\n } else {\n v0 = a0;\n v1 = 0;\n v2 = a1;\n do {\n v1 = v1 + *v0;\n v0 = v0 + 2;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":5,"maxScore":15,"compileErrors":null,"breakdown":{"insert":3,"delete":1,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 structarr(s32 *arg0, s32 arg1) {\n s32 *var_r2;\n s32 var_r1;\n s32 var_r3;\n\n var_r1 = arg1;\n var_r3 = 0;\n if (var_r1 > 0) {\n var_r2 = arg0;\n do {\n var_r3 += *var_r2;\n var_r2 += 8;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n return var_r3;\n}\n","score":3,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":12,"ratio":0.25,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `structarr` — benchmark function synthetic:structarr:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstructarr\n\t.type\t structarr,function\n\t.thumb_func\nstructarr:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tldr\tr0, [r2]\n\tadd\tr3, r3, r0\n\tadd\tr2, r2, #0x8\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t structarr,.Lfe1-structarr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function structarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `structarr` — benchmark function synthetic:structarr:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:structarr:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstructarr\n\t.type\t structarr,function\n\t.thumb_func\nstructarr:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tldr\tr0, [r2]\n\tadd\tr3, r3, r0\n\tadd\tr2, r2, #0x8\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t structarr,.Lfe1-structarr\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name structarr # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:structarr:gcc2.7.2kmc","sym":"structarr","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","struct","memory","array"],"loc":2,"refSource":"struct P{int x;int y;};\nint structarr(struct P *a,int n){ int s=0,i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,28 \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\taddiu\ta2,a2,1\n 18:\taddu\tv1,v1,v0\n 1c:\tslt\tv0,a2,a1\n 20:\tbnez\tv0,10 \n 24:\taddiu\ta0,a0,8\n 28:\tmove\tv0,v1\n 2c:\tjr\tra\n 30:\taddiu\tsp,sp,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3fd782bcc0049d41/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 structarr\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00007 00001821 '.....0!.......!\n 0010 8c820000 24c60001 00621821 00c5102a ....$....b.!...*\n 0020 1440fffb 24840008 00601021 03e00008 .@..$....`.!....\n 0030 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 structarr(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n v0 = a0;\n v1 = 0;\n v2 = 0;\n while (v1 < a1) {\n v1 = v1 + 1;\n v2 = v2 + *v0;\n v0 = v0 + 2;\n }\n return v2;\n}\n","score":6,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 structarr(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 var_a2;\n s32 var_v1;\n\n var_a0 = arg0;\n var_a2 = 0;\n var_v1 = 0;\n if (arg1 > 0) {\n do {\n var_a2 += 1;\n var_v1 += *var_a0;\n var_a0 += 8;\n } while (var_a2 < arg1);\n }\n return var_v1;\n}\n","score":9,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":13,"ratio":0.46153846153846156,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `structarr` — benchmark function synthetic:structarr:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel structarr\n addiu\t$sp, $sp, -8\n move\t$a2, $zero\n blez\t$a1, .L28\n move\t$v1, $zero\n.L10:\n lw\t$v0, 0($a0)\n addiu\t$a2, $a2, 1\n addu\t$v1, $v1, $v0\n slt\t$v0, $a2, $a1\n bnez\t$v0, .L10\n addiu\t$a0, $a0, 8\n.L28:\n move\t$v0, $v1\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function structarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `structarr` — benchmark function synthetic:structarr:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:structarr:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,28 \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\taddiu\ta2,a2,1\n 18:\taddu\tv1,v1,v0\n 1c:\tslt\tv0,a2,a1\n 20:\tbnez\tv0,10 \n 24:\taddiu\ta0,a0,8\n 28:\tmove\tv0,v1\n 2c:\tjr\tra\n 30:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3fd782bcc0049d41/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 structarr\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00007 00001821 '.....0!.......!\n 0010 8c820000 24c60001 00621821 00c5102a ....$....b.!...*\n 0020 1440fffb 24840008 00601021 03e00008 .@..$....`.!....\n 0030 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name structarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:structarr:ido7.1","sym":"structarr","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","struct","memory","array"],"loc":2,"refSource":"struct P{int x;int y;};\nint structarr(struct P *a,int n){ int s=0,i; for(i=0;i:\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,70 \n 8:\tmove\tv0,zero\n c:\tandi\tt0,a1,0x3\n 10:\tbeqz\tt0,38 \n 14:\tmove\ta3,t0\n 18:\tsll\tt6,zero,0x3\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\tt7,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\taddiu\ta2,a2,8\n 2c:\tbne\ta3,v0,20 \n 30:\taddu\tv1,v1,t7\n 34:\tbeq\tv0,a1,70 \n 38:\tsll\tt8,v0,0x3\n 3c:\tsll\tt9,a1,0x3\n 40:\taddu\ta3,t9,a0\n 44:\taddu\ta2,a0,t8\n 48:\tlw\tt1,0(a2)\n 4c:\tlw\tt2,8(a2)\n 50:\tlw\tt3,16(a2)\n 54:\taddu\tv1,v1,t1\n 58:\tlw\tt4,24(a2)\n 5c:\taddu\tv1,v1,t2\n 60:\taddiu\ta2,a2,32\n 64:\taddu\tv1,v1,t3\n 68:\tbne\ta2,a3,48 \n 6c:\taddu\tv1,v1,t4\n 70:\tjr\tra\n 74:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 structarr\n\n\nContents of section .text:\n 0000 00001825 18a0001a 00001025 30a80003 ...%.......%0...\n 0010 11000009 01003825 000070c0 008e3021 ......8%..p...0!\n 0020 8ccf0000 24420001 24c60008 14e2fffc ....$B..$.......\n 0030 006f1821 1045000e 0002c0c0 0005c8c0 .o.!.E..........\n 0040 03243821 00983021 8cc90000 8cca0008 .$8!..0!........\n 0050 8ccb0010 00691821 8ccc0018 006a1821 .....i.!.....j.!\n 0060 24c60020 006b1821 14c7fff7 006c1821 $.. .k.!.....l.!\n 0070 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8300dffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300dffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000004 000001e8 p...............\n 0010 00000005 00000330 00000001 000001ec .......0........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000038 00000294 .......P...8....\n 0040 0000000c 000002cc 00000001 000002d8 ................\n 0050 00000000 00000000 00000001 00000320 ............... \n 0060 08080802 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000078 20200001 00000001 .......x ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 66643738 32626363 30303439 ef-3fd782bcc0049\n 0130 6434312f 7265662e 63007374 72756374 d41/ref.c.struct\n 0140 61727200 73747275 63746172 72000000 arr.structarr...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 0000001e ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000004 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'structarr' — lift: cannot lift 'structarr': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tblez\ta1,70 */\n/* 8:\tmove\tv0,zero */\n/* c:\tandi\tt0,a1,0x3 */\n/* 10:\tbeqz\tt0,38 */\n/* 14:\tmove\ta3,t0 */\n/* 18:\tsll\tt6,zero,0x3 */\n/* 1c:\taddu\ta2,a0,t6 */\n/* 20:\tlw\tt7,0(a2) */\n/* 24:\taddiu\tv0,v0,1 */\n/* 28:\taddiu\ta2,a2,8 */\n/* 2c:\tbne\ta3,v0,20 */\n/* 30:\taddu\tv1,v1,t7 */\n/* 34:\tbeq\tv0,a1,70 */\n/* 38:\tsll\tt8,v0,0x3 */\n/* 3c:\tsll\tt9,a1,0x3 */\n/* 40:\taddu\ta3,t9,a0 */\n/* 44:\taddu\ta2,a0,t8 */\n/* 48:\tlw\tt1,0(a2) */\n/* 4c:\tlw\tt2,8(a2) */\n/* 50:\tlw\tt3,16(a2) */\n/* 54:\taddu\tv1,v1,t1 */\n/* 58:\tlw\tt4,24(a2) */\n/* 5c:\taddu\tv1,v1,t2 */\n/* 60:\taddiu\ta2,a2,32 */\n/* 64:\taddu\tv1,v1,t3 */\n/* 68:\tbne\ta2,a3,48 */\n/* 6c:\taddu\tv1,v1,t4 */\n/* 70:\tjr\tra */\n/* 74:\tmove\tv0,v1 */\n/* \t... */\nvoid structarr(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'structarr': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":39,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'structarr': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 structarr(s32 arg0, s32 arg1) {\n s32 *var_a2;\n s32 temp_t0;\n s32 temp_t3;\n s32 temp_t4;\n s32 temp_t7;\n s32 temp_v1;\n s32 var_v0;\n s32 var_v1;\n void *var_a2_2;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg1 > 0) {\n temp_t0 = arg1 & 3;\n if (temp_t0 != 0) {\n var_a2 = arg0 + (0 * 8);\n do {\n temp_t7 = *var_a2;\n var_v0 += 1;\n var_a2 += 8;\n var_v1 += temp_t7;\n } while (temp_t0 != var_v0);\n if (var_v0 != arg1) {\n goto block_5;\n }\n } else {\nblock_5:\n var_a2_2 = arg0 + (var_v0 * 8);\n do {\n temp_t3 = var_a2_2->unk10;\n temp_t4 = var_a2_2->unk18;\n temp_v1 = var_v1 + var_a2_2->unk0 + var_a2_2->unk8;\n var_a2_2 += 0x20;\n var_v1 = temp_v1 + temp_t3 + temp_t4;\n } while (var_a2_2 != ((arg1 * 8) + arg0));\n }\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":88,"lines":39,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 32: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 33: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 34: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 35: Bad operand type for += or -=","cfe: Error: /cand.c, line 37: Unacceptable operand of == or !="]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `structarr` — benchmark function synthetic:structarr:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel structarr\n move\t$v1, $zero\n blez\t$a1, .L70\n move\t$v0, $zero\n andi\t$t0, $a1, 0x3\n beqz\t$t0, .L38\n move\t$a3, $t0\n sll\t$t6, $zero, 0x3\n addu\t$a2, $a0, $t6\n.L20:\n lw\t$t7, 0($a2)\n addiu\t$v0, $v0, 1\n addiu\t$a2, $a2, 8\n bne\t$a3, $v0, .L20\n addu\t$v1, $v1, $t7\n beq\t$v0, $a1, .L70\n.L38:\n sll\t$t8, $v0, 0x3\n sll\t$t9, $a1, 0x3\n addu\t$a3, $t9, $a0\n addu\t$a2, $a0, $t8\n.L48:\n lw\t$t1, 0($a2)\n lw\t$t2, 8($a2)\n lw\t$t3, 16($a2)\n addu\t$v1, $v1, $t1\n lw\t$t4, 24($a2)\n addu\t$v1, $v1, $t2\n addiu\t$a2, $a2, 32\n addu\t$v1, $v1, $t3\n bne\t$a2, $a3, .L48\n addu\t$v1, $v1, $t4\n.L70:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function structarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `structarr` — benchmark function synthetic:structarr:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:structarr:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,70 \n 8:\tmove\tv0,zero\n c:\tandi\tt0,a1,0x3\n 10:\tbeqz\tt0,38 \n 14:\tmove\ta3,t0\n 18:\tsll\tt6,zero,0x3\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\tt7,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\taddiu\ta2,a2,8\n 2c:\tbne\ta3,v0,20 \n 30:\taddu\tv1,v1,t7\n 34:\tbeq\tv0,a1,70 \n 38:\tsll\tt8,v0,0x3\n 3c:\tsll\tt9,a1,0x3\n 40:\taddu\ta3,t9,a0\n 44:\taddu\ta2,a0,t8\n 48:\tlw\tt1,0(a2)\n 4c:\tlw\tt2,8(a2)\n 50:\tlw\tt3,16(a2)\n 54:\taddu\tv1,v1,t1\n 58:\tlw\tt4,24(a2)\n 5c:\taddu\tv1,v1,t2\n 60:\taddiu\ta2,a2,32\n 64:\taddu\tv1,v1,t3\n 68:\tbne\ta2,a3,48 \n 6c:\taddu\tv1,v1,t4\n 70:\tjr\tra\n 74:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 structarr\n\n\nContents of section .text:\n 0000 00001825 18a0001a 00001025 30a80003 ...%.......%0...\n 0010 11000009 01003825 000070c0 008e3021 ......8%..p...0!\n 0020 8ccf0000 24420001 24c60008 14e2fffc ....$B..$.......\n 0030 006f1821 1045000e 0002c0c0 0005c8c0 .o.!.E..........\n 0040 03243821 00983021 8cc90000 8cca0008 .$8!..0!........\n 0050 8ccb0010 00691821 8ccc0018 006a1821 .....i.!.....j.!\n 0060 24c60020 006b1821 14c7fff7 006c1821 $.. .k.!.....l.!\n 0070 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8300dffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300dffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000004 000001e8 p...............\n 0010 00000005 00000330 00000001 000001ec .......0........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000038 00000294 .......P...8....\n 0040 0000000c 000002cc 00000001 000002d8 ................\n 0050 00000000 00000000 00000001 00000320 ............... \n 0060 08080802 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000078 20200001 00000001 .......x ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 66643738 32626363 30303439 ef-3fd782bcc0049\n 0130 6434312f 7265662e 63007374 72756374 d41/ref.c.struct\n 0140 61727200 73747275 63746172 72000000 arr.structarr...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 0000001e ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000004 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name structarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:structarr:mwcc_242_81","sym":"structarr","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","struct","memory","array"],"loc":2,"refSource":"struct P{int x;int y;};\nint structarr(struct P *a,int n){ int s=0,i; for(i=0;i:\n 0:\tcmpwi r4,0\n 4:\tli r7,0\n 8:\tli r8,0\n c:\tble a8 \n 10:\tcmpwi r4,8\n 14:\taddi r5,r4,-8\n 18:\tble 80 \n 1c:\taddi r0,r5,7\n 20:\tmr r6,r3\n 24:\tsrwi r0,r0,3\n 28:\tmtctr r0\n 2c:\tcmpwi r5,0\n 30:\tble 80 \n 34:\tlwz r5,0(r6)\n 38:\taddi r8,r8,8\n 3c:\tlwz r0,8(r6)\n 40:\tadd r7,r7,r5\n 44:\tlwz r5,16(r6)\n 48:\tadd r7,r7,r0\n 4c:\tlwz r0,24(r6)\n 50:\tadd r7,r7,r5\n 54:\tlwz r5,32(r6)\n 58:\tadd r7,r7,r0\n 5c:\tlwz r0,40(r6)\n 60:\tadd r7,r7,r5\n 64:\tlwz r5,48(r6)\n 68:\tadd r7,r7,r0\n 6c:\tlwz r0,56(r6)\n 70:\tadd r7,r7,r5\n 74:\taddi r6,r6,64\n 78:\tadd r7,r7,r0\n 7c:\tbdnz 34 \n 80:\tslwi r5,r8,3\n 84:\tsubf r0,r8,r4\n 88:\tadd r3,r3,r5\n 8c:\tmtctr r0\n 90:\tcmpw r8,r4\n 94:\tbge a8 \n 98:\tlwz r0,0(r3)\n 9c:\taddi r3,r3,8\n a0:\tadd r7,r7,r0\n a4:\tbdnz 98 \n a8:\tmr r3,r7\n ac:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000b0 structarr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 structarr\n\n\nContents of section .text:\n 0000 2c040000 38e00000 39000000 4081009c ,...8...9...@...\n 0010 2c040008 38a4fff8 40810068 38050007 ,...8...@..h8...\n 0020 7c661b78 5400e8fe 7c0903a6 2c050000 |f.xT...|...,...\n 0030 40810050 80a60000 39080008 80060008 @..P....9.......\n 0040 7ce72a14 80a60010 7ce70214 80060018 |.*.....|.......\n 0050 7ce72a14 80a60020 7ce70214 80060028 |.*.... |......(\n 0060 7ce72a14 80a60030 7ce70214 80060038 |.*....0|......8\n 0070 7ce72a14 38c60040 7ce70214 4200ffb8 |.*.8..@|...B...\n 0080 55051838 7c082050 7c632a14 7c0903a6 U..8|. P|c*.|...\n 0090 7c082000 40800014 80030000 38630008 |. .@.......8c..\n 00a0 7ce70214 4200fff4 7ce33b78 4e800020 |...B...|.;xN.. \nContents of section .mwcats.text:\n 0000 020000b0 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 structarr(s32 * a0, u32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 * v4;\n s32 v5;\n s32 v6;\n if (a1 <= 0) {\n v2 = 0;\n } else {\n if (a1 <= 8) {\n v1 = 0;\n v2 = 0;\n } else {\n v0 = a0;\n v1 = 0;\n v2 = 0;\n for (v3 = a1 + -8 + 7 >> 3; v3 != 0; v3 = v3 - 1) {\n v1 = v1 + 8;\n v2 = v2 + *v0 + v0[2] + v0[4] + v0[6] + v0[8] + v0[10] + v0[12] + v0[14];\n v0 = v0 + 16;\n }\n }\n v5 = v2;\n v6 = a1 - v1;\n v4 = a0 + (v1 << 3);\n while (v6 != 0) {\n v5 = v5 + *v4;\n v4 = v4 + 2;\n v6 = v6 - 1;\n }\n v2 = v5;\n }\n return v2;\n}\n","score":113,"maxScore":120,"compileErrors":null,"breakdown":{"insert":76,"delete":3,"replace":6,"opMismatch":6,"argMismatch":22},"quality":{"score":100,"lines":36,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 structarr(void *arg0, s32 arg1) {\n s32 *var_r3;\n s32 temp_r0;\n s32 temp_r0_2;\n s32 temp_r5;\n s32 temp_r7;\n s32 var_ctr_2;\n s32 var_r7;\n s32 var_r8;\n u32 var_ctr;\n void *var_r6;\n\n var_r7 = 0;\n var_r8 = 0;\n if (arg1 > 0) {\n temp_r5 = arg1 - 8;\n if (arg1 > 8) {\n var_r6 = arg0;\n var_ctr = (u32) (temp_r5 + 7) >> 3U;\n if (temp_r5 > 0) {\n do {\n var_r8 += 8;\n temp_r0 = var_r6->unk38;\n temp_r7 = var_r7 + var_r6->unk0 + var_r6->unk8 + var_r6->unk10 + var_r6->unk18 + var_r6->unk20 + var_r6->unk28 + var_r6->unk30;\n var_r6 += 0x40;\n var_r7 = temp_r7 + temp_r0;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r3 = arg0 + (var_r8 * 8);\n var_ctr_2 = arg1 - var_r8;\n if (var_r8 < arg1) {\n do {\n temp_r0_2 = *var_r3;\n var_r3 += 8;\n var_r7 += temp_r0_2;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r7;\n}\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":100,"lines":42,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class","# Error: ^^","# Error: ^","# illegal type"]},"gapSize":{"decompiler":"asmlift","score":113,"maxScore":120,"ratio":0.9416666666666667,"kinds":{"insert":76,"delete":3,"replace":6,"opMismatch":6,"argMismatch":22}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `structarr` — benchmark function synthetic:structarr:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel structarr\n cmpwi r4,0\n li r7,0\n li r8,0\n ble .La8\n cmpwi r4,8\n addi r5,r4,-8\n ble .L80\n addi r0,r5,7\n mr r6,r3\n srwi r0,r0,3\n mtctr r0\n cmpwi r5,0\n ble .L80\n.L34:\n lwz r5,0(r6)\n addi r8,r8,8\n lwz r0,8(r6)\n add r7,r7,r5\n lwz r5,16(r6)\n add r7,r7,r0\n lwz r0,24(r6)\n add r7,r7,r5\n lwz r5,32(r6)\n add r7,r7,r0\n lwz r0,40(r6)\n add r7,r7,r5\n lwz r5,48(r6)\n add r7,r7,r0\n lwz r0,56(r6)\n add r7,r7,r5\n addi r6,r6,64\n add r7,r7,r0\n bdnz .L34\n.L80:\n slwi r5,r8,3\n subf r0,r8,r4\n add r3,r3,r5\n mtctr r0\n cmpw r8,r4\n bge .La8\n.L98:\n lwz r0,0(r3)\n addi r3,r3,8\n add r7,r7,r0\n bdnz .L98\n.La8:\n mr r3,r7\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function structarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `structarr` — benchmark function synthetic:structarr:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:structarr:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r4,0\n 4:\tli r7,0\n 8:\tli r8,0\n c:\tble a8 \n 10:\tcmpwi r4,8\n 14:\taddi r5,r4,-8\n 18:\tble 80 \n 1c:\taddi r0,r5,7\n 20:\tmr r6,r3\n 24:\tsrwi r0,r0,3\n 28:\tmtctr r0\n 2c:\tcmpwi r5,0\n 30:\tble 80 \n 34:\tlwz r5,0(r6)\n 38:\taddi r8,r8,8\n 3c:\tlwz r0,8(r6)\n 40:\tadd r7,r7,r5\n 44:\tlwz r5,16(r6)\n 48:\tadd r7,r7,r0\n 4c:\tlwz r0,24(r6)\n 50:\tadd r7,r7,r5\n 54:\tlwz r5,32(r6)\n 58:\tadd r7,r7,r0\n 5c:\tlwz r0,40(r6)\n 60:\tadd r7,r7,r5\n 64:\tlwz r5,48(r6)\n 68:\tadd r7,r7,r0\n 6c:\tlwz r0,56(r6)\n 70:\tadd r7,r7,r5\n 74:\taddi r6,r6,64\n 78:\tadd r7,r7,r0\n 7c:\tbdnz 34 \n 80:\tslwi r5,r8,3\n 84:\tsubf r0,r8,r4\n 88:\tadd r3,r3,r5\n 8c:\tmtctr r0\n 90:\tcmpw r8,r4\n 94:\tbge a8 \n 98:\tlwz r0,0(r3)\n 9c:\taddi r3,r3,8\n a0:\tadd r7,r7,r0\n a4:\tbdnz 98 \n a8:\tmr r3,r7\n ac:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000b0 structarr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 structarr\n\n\nContents of section .text:\n 0000 2c040000 38e00000 39000000 4081009c ,...8...9...@...\n 0010 2c040008 38a4fff8 40810068 38050007 ,...8...@..h8...\n 0020 7c661b78 5400e8fe 7c0903a6 2c050000 |f.xT...|...,...\n 0030 40810050 80a60000 39080008 80060008 @..P....9.......\n 0040 7ce72a14 80a60010 7ce70214 80060018 |.*.....|.......\n 0050 7ce72a14 80a60020 7ce70214 80060028 |.*.... |......(\n 0060 7ce72a14 80a60030 7ce70214 80060038 |.*....0|......8\n 0070 7ce72a14 38c60040 7ce70214 4200ffb8 |.*.8..@|...B...\n 0080 55051838 7c082050 7c632a14 7c0903a6 U..8|. P|c*.|...\n 0090 7c082000 40800014 80030000 38630008 |. .@.......8c..\n 00a0 7ce70214 4200fff4 7ce33b78 4e800020 |...B...|.;xN.. \nContents of section .mwcats.text:\n 0000 020000b0 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name structarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sub:agbcc","sym":"sub","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int sub(int a,int b){ return a-b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsub\n\t.type\t sub,function\n\t.thumb_func\nsub:\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sub,.Lfe1-sub\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sub(u32 a0, u32 a1) {\n return a0 - a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sub(s32 arg0, s32 arg1) {\n return arg0 - arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub` — benchmark function synthetic:sub:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsub\n\t.type\t sub,function\n\t.thumb_func\nsub:\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sub,.Lfe1-sub\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sub` — benchmark function synthetic:sub:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sub:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsub\n\t.type\t sub,function\n\t.thumb_func\nsub:\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sub,.Lfe1-sub\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sub:gcc2.7.2kmc","sym":"sub","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int sub(int a,int b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsubu\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b50330a37fdfc67d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 sub\n\n\nContents of section .text:\n 0000 03e00008 00851023 00000000 00000000 .......#........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sub(u32 a0, u32 a1) {\n return a0 - a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sub(s32 arg0, s32 arg1) {\n return arg0 - arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub` — benchmark function synthetic:sub:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sub\n jr\t$ra\n subu\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sub` — benchmark function synthetic:sub:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sub:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsubu\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b50330a37fdfc67d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 sub\n\n\nContents of section .text:\n 0000 03e00008 00851023 00000000 00000000 .......#........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sub:ido7.1","sym":"sub","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic"],"loc":1,"refSource":"int sub(int a,int b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsubu\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 sub\n\n\nContents of section .text:\n 0000 03e00008 00851023 00000000 00000000 .......#........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 35303333 30613337 66646663 ef-b50330a37fdfc\n 0130 3637642f 7265662e 63007375 62000000 67d/ref.c.sub...\n 0140 73756200 00000000 00000001 00000000 sub.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sub(u32 a0, u32 a1) {\n return a0 - a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sub(s32 arg0, s32 arg1) {\n return arg0 - arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub` — benchmark function synthetic:sub:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sub\n jr\t$ra\n subu\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sub` — benchmark function synthetic:sub:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sub:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsubu\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 sub\n\n\nContents of section .text:\n 0000 03e00008 00851023 00000000 00000000 .......#........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 35303333 30613337 66646663 ef-b50330a37fdfc\n 0130 3637642f 7265662e 63007375 62000000 67d/ref.c.sub...\n 0140 73756200 00000000 00000001 00000000 sub.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sub:mwcc_242_81","sym":"sub","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int sub(int a,int b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsubf r3,r4,r3\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sub\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sub\n\n\nContents of section .text:\n 0000 7c641850 4e800020 |d.PN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sub(u32 a0, u32 a1) {\n return a0 - a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sub(s32 arg0, s32 arg1) {\n return arg0 - arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub` — benchmark function synthetic:sub:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sub\n subf r3,r4,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sub` — benchmark function synthetic:sub:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sub:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsubf r3,r4,r3\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sub\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sub\n\n\nContents of section .text:\n 0000 7c641850 4e800020 |d.PN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sumto:agbcc","sym":"sumto","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for"],"loc":1,"refSource":"int sumto(int n){ int s=0,i; for(i=0;i 0) {\n do {\n var_r2 += var_r1;\n var_r1 += 1;\n } while (var_r1 < arg0);\n }\n return var_r2;\n}\n","score":2,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sumto` — benchmark function synthetic:sumto:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsumto\n\t.type\t sumto,function\n\t.thumb_func\nsumto:\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tcmp\tr2, r0\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr2, r2, r1\n\tadd\tr1, r1, #0x1\n\tcmp\tr1, r0\n\tblt\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sumto,.Lfe1-sumto\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sumto # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sumto` — benchmark function synthetic:sumto:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sumto:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsumto\n\t.type\t sumto,function\n\t.thumb_func\nsumto:\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tcmp\tr2, r0\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr2, r2, r1\n\tadd\tr1, r1, #0x1\n\tcmp\tr1, r0\n\tblt\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sumto,.Lfe1-sumto\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sumto # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sumto:gcc2.7.2kmc","sym":"sumto","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for"],"loc":1,"refSource":"int sumto(int n){ int s=0,i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\tv1,zero\n 8:\tblez\ta0,24 \n c:\tmove\ta1,zero\n 10:\taddu\ta1,a1,v1\n 14:\taddiu\tv1,v1,1\n 18:\tslt\tv0,v1,a0\n 1c:\tbnezl\tv0,14 \n 20:\taddu\ta1,a1,v1\n 24:\tmove\tv0,a1\n 28:\tjr\tra\n 2c:\taddiu\tsp,sp,8\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a9448674df606c40/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 sumto\n\n\nContents of section .text:\n 0000 27bdfff8 00001821 18800006 00002821 '......!......(!\n 0010 00a32821 24630001 0064102a 5440fffd ..(!$c...d.*T@..\n 0020 00a32821 00a01021 03e00008 27bd0008 ..(!...!....'...\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sumto' — lift: cannot lift 'sumto': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-8 */\n/* 4:\tmove\tv1,zero */\n/* 8:\tblez\ta0,24 */\n/* c:\tmove\ta1,zero */\n/* 10:\taddu\ta1,a1,v1 */\n/* 14:\taddiu\tv1,v1,1 */\n/* 18:\tslt\tv0,v1,a0 */\n/* 1c:\tbnezl\tv0,14 */\n/* 20:\taddu\ta1,a1,v1 */\n/* 24:\tmove\tv0,a1 */\n/* 28:\tjr\tra */\n/* 2c:\taddiu\tsp,sp,8 */\nvoid sumto(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sumto': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sumto': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sumto(s32 arg0) {\n s32 var_a1;\n s32 var_v1;\n\n var_v1 = 0;\n var_a1 = 0;\n if (arg0 > 0) {\n do {\n var_a1 += var_v1;\n var_v1 += 1;\n } while (var_v1 < arg0);\n }\n return var_a1;\n}\n","score":3,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":12,"ratio":0.25,"kinds":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sumto` — benchmark function synthetic:sumto:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sumto\n addiu\t$sp, $sp, -8\n move\t$v1, $zero\n blez\t$a0, .L24\n move\t$a1, $zero\n addu\t$a1, $a1, $v1\n.L14:\n addiu\t$v1, $v1, 1\n slt\t$v0, $v1, $a0\n bnezl\t$v0, .L14\n addu\t$a1, $a1, $v1\n.L24:\n move\t$v0, $a1\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sumto # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sumto` — benchmark function synthetic:sumto:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sumto:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\tv1,zero\n 8:\tblez\ta0,24 \n c:\tmove\ta1,zero\n 10:\taddu\ta1,a1,v1\n 14:\taddiu\tv1,v1,1\n 18:\tslt\tv0,v1,a0\n 1c:\tbnezl\tv0,14 \n 20:\taddu\ta1,a1,v1\n 24:\tmove\tv0,a1\n 28:\tjr\tra\n 2c:\taddiu\tsp,sp,8\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a9448674df606c40/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 sumto\n\n\nContents of section .text:\n 0000 27bdfff8 00001821 18800006 00002821 '......!......(!\n 0010 00a32821 24630001 0064102a 5440fffd ..(!$c...d.*T@..\n 0020 00a32821 00a01021 03e00008 27bd0008 ..(!...!....'...\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sumto # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sumto:ido7.1","sym":"sumto","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for"],"loc":1,"refSource":"int sumto(int n){ int s=0,i; for(i=0;i:\n 0:\tmove\tv1,zero\n 4:\tblez\ta0,54 \n 8:\tmove\tv0,zero\n c:\tandi\ta2,a0,0x3\n 10:\tbeqz\ta2,30 \n 14:\tmove\ta1,a2\n 18:\taddu\tv1,v1,v0\n 1c:\taddiu\tv0,v0,1\n 20:\tbnel\ta1,v0,1c \n 24:\taddu\tv1,v1,v0\n 28:\tbeq\tv0,a0,54 \n 2c:\tnop\n 30:\taddu\tv1,v1,v0\n 34:\taddu\tv1,v1,v0\n 38:\taddiu\tv1,v1,1\n 3c:\taddu\tv1,v1,v0\n 40:\taddiu\tv1,v1,2\n 44:\taddu\tv1,v1,v0\n 48:\taddiu\tv0,v0,4\n 4c:\tbne\tv0,a0,30 \n 50:\taddiu\tv1,v1,3\n 54:\tjr\tra\n 58:\tmove\tv0,v1\n 5c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t0000005c sumto\n\n\nContents of section .text:\n 0000 00001825 18800013 00001025 30860003 ...%.......%0...\n 0010 10c00007 00c02825 00621821 24420001 ......(%.b.!$B..\n 0020 54a2fffe 00621821 1044000a 00000000 T....b.!.D......\n 0030 00621821 00621821 24630001 00621821 .b.!.b.!$c...b.!\n 0040 24630002 00621821 24420004 1444fff8 $c...b.!$B...D..\n 0050 24630003 03e00008 00601025 00000000 $c.......`.%....\nContents of section .options:\n 0000 01200000 00000000 8000007c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000017 00000004 000001c8 p...............\n 0010 00000005 00000308 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 00000008 000002a8 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 08080400 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000005c 20200001 00000001 .......\\ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 39343438 36373464 66363036 ef-a9448674df606\n 0130 6334302f 7265662e 63007375 6d746f00 c40/ref.c.sumto.\n 0140 73756d74 6f000000 00000000 00000001 sumto...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000017 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000003 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sumto' — lift: cannot lift 'sumto': unmodelled control transfer 'bnel' at 0x20 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tblez\ta0,54 */\n/* 8:\tmove\tv0,zero */\n/* c:\tandi\ta2,a0,0x3 */\n/* 10:\tbeqz\ta2,30 */\n/* 14:\tmove\ta1,a2 */\n/* 18:\taddu\tv1,v1,v0 */\n/* 1c:\taddiu\tv0,v0,1 */\n/* 20:\tbnel\ta1,v0,1c */\n/* 24:\taddu\tv1,v1,v0 */\n/* 28:\tbeq\tv0,a0,54 */\n/* 2c:\tnop */\n/* 30:\taddu\tv1,v1,v0 */\n/* 34:\taddu\tv1,v1,v0 */\n/* 38:\taddiu\tv1,v1,1 */\n/* 3c:\taddu\tv1,v1,v0 */\n/* 40:\taddiu\tv1,v1,2 */\n/* 44:\taddu\tv1,v1,v0 */\n/* 48:\taddiu\tv0,v0,4 */\n/* 4c:\tbne\tv0,a0,30 */\n/* 50:\taddiu\tv1,v1,3 */\n/* 54:\tjr\tra */\n/* 58:\tmove\tv0,v1 */\n/* 5c:\tnop */\nvoid sumto(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sumto': unmodelled control transfer 'bnel' at 0x20 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sumto': unmodelled control transfer 'bnel' at 0x20 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sumto(s32 arg0) {\n s32 temp_a2;\n s32 temp_v1;\n s32 var_v0;\n s32 var_v1;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg0 > 0) {\n temp_a2 = arg0 & 3;\n if (temp_a2 != 0) {\n do {\n var_v1 += var_v0;\n var_v0 += 1;\n } while (temp_a2 != var_v0);\n if (var_v0 != arg0) {\n goto loop_4;\n }\n } else {\n do {\nloop_4:\n temp_v1 = var_v1 + var_v0 + var_v0 + 1 + var_v0 + 2 + var_v0;\n var_v0 += 4;\n var_v1 = temp_v1 + 3;\n } while (var_v0 != arg0);\n }\n }\n return var_v1;\n}\n","score":15,"maxScore":34,"compileErrors":null,"breakdown":{"insert":11,"delete":0,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":88,"lines":28,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":15,"maxScore":34,"ratio":0.4411764705882353,"kinds":{"insert":11,"delete":0,"replace":0,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sumto` — benchmark function synthetic:sumto:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sumto\n move\t$v1, $zero\n blez\t$a0, .L54\n move\t$v0, $zero\n andi\t$a2, $a0, 0x3\n beqz\t$a2, .L30\n move\t$a1, $a2\n addu\t$v1, $v1, $v0\n.L1c:\n addiu\t$v0, $v0, 1\n bnel\t$a1, $v0, .L1c\n addu\t$v1, $v1, $v0\n beq\t$v0, $a0, .L54\n nop\n.L30:\n addu\t$v1, $v1, $v0\n addu\t$v1, $v1, $v0\n addiu\t$v1, $v1, 1\n addu\t$v1, $v1, $v0\n addiu\t$v1, $v1, 2\n addu\t$v1, $v1, $v0\n addiu\t$v0, $v0, 4\n bne\t$v0, $a0, .L30\n addiu\t$v1, $v1, 3\n.L54:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sumto # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sumto` — benchmark function synthetic:sumto:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sumto:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta0,54 \n 8:\tmove\tv0,zero\n c:\tandi\ta2,a0,0x3\n 10:\tbeqz\ta2,30 \n 14:\tmove\ta1,a2\n 18:\taddu\tv1,v1,v0\n 1c:\taddiu\tv0,v0,1\n 20:\tbnel\ta1,v0,1c \n 24:\taddu\tv1,v1,v0\n 28:\tbeq\tv0,a0,54 \n 2c:\tnop\n 30:\taddu\tv1,v1,v0\n 34:\taddu\tv1,v1,v0\n 38:\taddiu\tv1,v1,1\n 3c:\taddu\tv1,v1,v0\n 40:\taddiu\tv1,v1,2\n 44:\taddu\tv1,v1,v0\n 48:\taddiu\tv0,v0,4\n 4c:\tbne\tv0,a0,30 \n 50:\taddiu\tv1,v1,3\n 54:\tjr\tra\n 58:\tmove\tv0,v1\n 5c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t0000005c sumto\n\n\nContents of section .text:\n 0000 00001825 18800013 00001025 30860003 ...%.......%0...\n 0010 10c00007 00c02825 00621821 24420001 ......(%.b.!$B..\n 0020 54a2fffe 00621821 1044000a 00000000 T....b.!.D......\n 0030 00621821 00621821 24630001 00621821 .b.!.b.!$c...b.!\n 0040 24630002 00621821 24420004 1444fff8 $c...b.!$B...D..\n 0050 24630003 03e00008 00601025 00000000 $c.......`.%....\nContents of section .options:\n 0000 01200000 00000000 8000007c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000017 00000004 000001c8 p...............\n 0010 00000005 00000308 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 00000008 000002a8 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 08080400 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000005c 20200001 00000001 .......\\ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 39343438 36373464 66363036 ef-a9448674df606\n 0130 6334302f 7265662e 63007375 6d746f00 c40/ref.c.sumto.\n 0140 73756d74 6f000000 00000000 00000001 sumto...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000017 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000003 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sumto # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sumto:mwcc_242_81","sym":"sumto","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for"],"loc":1,"refSource":"int sumto(int n){ int s=0,i; for(i=0;i:\n 0:\tcmpwi r3,0\n 4:\tli r5,0\n 8:\tli r6,0\n c:\tble 90 \n 10:\tcmpwi r3,8\n 14:\taddi r4,r3,-8\n 18:\tble 74 \n 1c:\taddi r0,r4,7\n 20:\tsrwi r0,r0,3\n 24:\tmtctr r0\n 28:\tcmpwi r4,0\n 2c:\tble 74 \n 30:\tadd r5,r5,r6\n 34:\tadd r5,r6,r5\n 38:\taddi r5,r5,1\n 3c:\tadd r5,r6,r5\n 40:\taddi r5,r5,2\n 44:\tadd r5,r6,r5\n 48:\taddi r5,r5,3\n 4c:\tadd r5,r6,r5\n 50:\taddi r5,r5,4\n 54:\tadd r5,r6,r5\n 58:\taddi r5,r5,5\n 5c:\tadd r5,r6,r5\n 60:\taddi r5,r5,6\n 64:\tadd r5,r6,r5\n 68:\taddi r6,r6,8\n 6c:\taddi r5,r5,7\n 70:\tbdnz 30 \n 74:\tsubf r0,r6,r3\n 78:\tmtctr r0\n 7c:\tcmpw r6,r3\n 80:\tbge 90 \n 84:\tadd r5,r5,r6\n 88:\taddi r6,r6,1\n 8c:\tbdnz 84 \n 90:\tmr r3,r5\n 94:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000098 sumto\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sumto\n\n\nContents of section .text:\n 0000 2c030000 38a00000 38c00000 40810084 ,...8...8...@...\n 0010 2c030008 3883fff8 4081005c 38040007 ,...8...@..\\8...\n 0020 5400e8fe 7c0903a6 2c040000 40810048 T...|...,...@..H\n 0030 7ca53214 7ca62a14 38a50001 7ca62a14 |.2.|.*.8...|.*.\n 0040 38a50002 7ca62a14 38a50003 7ca62a14 8...|.*.8...|.*.\n 0050 38a50004 7ca62a14 38a50005 7ca62a14 8...|.*.8...|.*.\n 0060 38a50006 7ca62a14 38c60008 38a50007 8...|.*.8...8...\n 0070 4200ffc0 7c061850 7c0903a6 7c061800 B...|..P|...|...\n 0080 40800010 7ca53214 38c60001 4200fff8 @...|.2.8...B...\n 0090 7ca32b78 4e800020 |.+xN.. \nContents of section .mwcats.text:\n 0000 02000098 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 sumto(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n if (a0 <= 8) {\n v1 = 0;\n v0 = 0;\n } else {\n v0 = 0;\n v1 = 0;\n for (v2 = a0 + -8 + 7 >> 3; v2 != 0; v2 = v2 - 1) {\n v0 = v1 + (v1 + (v1 + (v1 + (v1 + (v1 + (v1 + (v0 + v1) + 1) + 2) + 3) + 4) + 5) + 6) + 7;\n v1 = v1 + 8;\n }\n }\n v3 = v0;\n v4 = v1;\n for (v5 = a0 - v1; v5 != 0; v5 = v5 - 1) {\n v3 = v3 + v4;\n v4 = v4 + 1;\n }\n v0 = v3;\n }\n return v0;\n}\n","score":105,"maxScore":110,"compileErrors":null,"breakdown":{"insert":72,"delete":4,"replace":3,"opMismatch":4,"argMismatch":22},"quality":{"score":100,"lines":31,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sumto(s32 arg0) {\n s32 temp_r4;\n s32 temp_r5;\n s32 var_ctr_2;\n s32 var_r5;\n s32 var_r6;\n u32 var_ctr;\n\n var_r5 = 0;\n var_r6 = 0;\n if (arg0 > 0) {\n temp_r4 = arg0 - 8;\n if (arg0 > 8) {\n var_ctr = (u32) (temp_r4 + 7) >> 3U;\n if (temp_r4 > 0) {\n do {\n temp_r5 = var_r6 + (var_r6 + (var_r6 + (var_r6 + (var_r6 + (var_r6 + (var_r6 + (var_r5 + var_r6) + 1) + 2) + 3) + 4) + 5) + 6);\n var_r6 += 8;\n var_r5 = temp_r5 + 7;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_ctr_2 = arg0 - var_r6;\n if (var_r6 < arg0) {\n do {\n var_r5 += var_r6;\n var_r6 += 1;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r5;\n}\n","score":30,"maxScore":43,"compileErrors":null,"breakdown":{"insert":5,"delete":10,"replace":0,"opMismatch":2,"argMismatch":13},"quality":{"score":100,"lines":33,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":30,"maxScore":43,"ratio":0.6976744186046512,"kinds":{"insert":5,"delete":10,"replace":0,"opMismatch":2,"argMismatch":13}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sumto` — benchmark function synthetic:sumto:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sumto\n cmpwi r3,0\n li r5,0\n li r6,0\n ble .L90\n cmpwi r3,8\n addi r4,r3,-8\n ble .L74\n addi r0,r4,7\n srwi r0,r0,3\n mtctr r0\n cmpwi r4,0\n ble .L74\n.L30:\n add r5,r5,r6\n add r5,r6,r5\n addi r5,r5,1\n add r5,r6,r5\n addi r5,r5,2\n add r5,r6,r5\n addi r5,r5,3\n add r5,r6,r5\n addi r5,r5,4\n add r5,r6,r5\n addi r5,r5,5\n add r5,r6,r5\n addi r5,r5,6\n add r5,r6,r5\n addi r6,r6,8\n addi r5,r5,7\n bdnz .L30\n.L74:\n subf r0,r6,r3\n mtctr r0\n cmpw r6,r3\n bge .L90\n.L84:\n add r5,r5,r6\n addi r6,r6,1\n bdnz .L84\n.L90:\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sumto # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sumto` — benchmark function synthetic:sumto:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sumto:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r5,0\n 8:\tli r6,0\n c:\tble 90 \n 10:\tcmpwi r3,8\n 14:\taddi r4,r3,-8\n 18:\tble 74 \n 1c:\taddi r0,r4,7\n 20:\tsrwi r0,r0,3\n 24:\tmtctr r0\n 28:\tcmpwi r4,0\n 2c:\tble 74 \n 30:\tadd r5,r5,r6\n 34:\tadd r5,r6,r5\n 38:\taddi r5,r5,1\n 3c:\tadd r5,r6,r5\n 40:\taddi r5,r5,2\n 44:\tadd r5,r6,r5\n 48:\taddi r5,r5,3\n 4c:\tadd r5,r6,r5\n 50:\taddi r5,r5,4\n 54:\tadd r5,r6,r5\n 58:\taddi r5,r5,5\n 5c:\tadd r5,r6,r5\n 60:\taddi r5,r5,6\n 64:\tadd r5,r6,r5\n 68:\taddi r6,r6,8\n 6c:\taddi r5,r5,7\n 70:\tbdnz 30 \n 74:\tsubf r0,r6,r3\n 78:\tmtctr r0\n 7c:\tcmpw r6,r3\n 80:\tbge 90 \n 84:\tadd r5,r5,r6\n 88:\taddi r6,r6,1\n 8c:\tbdnz 84 \n 90:\tmr r3,r5\n 94:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000098 sumto\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sumto\n\n\nContents of section .text:\n 0000 2c030000 38a00000 38c00000 40810084 ,...8...8...@...\n 0010 2c030008 3883fff8 4081005c 38040007 ,...8...@..\\8...\n 0020 5400e8fe 7c0903a6 2c040000 40810048 T...|...,...@..H\n 0030 7ca53214 7ca62a14 38a50001 7ca62a14 |.2.|.*.8...|.*.\n 0040 38a50002 7ca62a14 38a50003 7ca62a14 8...|.*.8...|.*.\n 0050 38a50004 7ca62a14 38a50005 7ca62a14 8...|.*.8...|.*.\n 0060 38a50006 7ca62a14 38c60008 38a50007 8...|.*.8...8...\n 0070 4200ffc0 7c061850 7c0903a6 7c061800 B...|..P|...|...\n 0080 40800010 7ca53214 38c60001 4200fff8 @...|.2.8...B...\n 0090 7ca32b78 4e800020 |.+xN.. \nContents of section .mwcats.text:\n 0000 02000098 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sumto # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_fall:agbcc","sym":"sw_fall","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","fallthrough"],"loc":1,"refSource":"int sw_fall(int x){ int r=0; switch(x){case 3:r++;case 2:r++;case 1:r++;} return r; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_fall\n\t.type\t sw_fall,function\n\t.thumb_func\nsw_fall:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0x2\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x2\n\tbgt\t.L9\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L6\t@cond_branch\n\tb\t.L3\n.L9:\n\tcmp\tr0, #0x3\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L5:\n\tadd\tr1, r1, #0x1\n.L6:\n\tadd\tr1, r1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_fall,.Lfe1-sw_fall\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 sw_fall(s32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n if (a0 != 2) {\n if (a0 <= 2) {\n if (a0 != 1) {\n return 0;\n } else {\n v1 = 0;\n return v1 + 1;\n }\n } else {\n if (a0 == 3) {\n v0 = 1;\n v1 = v0 + 1;\n return v1 + 1;\n } else {\n v2 = 0;\n return v2;\n }\n }\n } else {\n v0 = 0;\n v1 = v0 + 1;\n return v1 + 1;\n }\n}\n","score":11,"maxScore":18,"compileErrors":null,"breakdown":{"insert":3,"delete":2,"replace":1,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":28,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_fall(s32 arg0) {\n s32 var_r1;\n\n var_r1 = 0;\n switch (arg0) { /* irregular */\n case 3:\n var_r1 = 1;\n /* fallthrough */\n case 2:\n var_r1 += 1;\n /* fallthrough */\n case 1:\n var_r1 += 1;\n break;\n }\n return var_r1;\n}\n","score":0,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_fall` — benchmark function synthetic:sw_fall:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_fall\n\t.type\t sw_fall,function\n\t.thumb_func\nsw_fall:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0x2\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x2\n\tbgt\t.L9\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L6\t@cond_branch\n\tb\t.L3\n.L9:\n\tcmp\tr0, #0x3\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L5:\n\tadd\tr1, r1, #0x1\n.L6:\n\tadd\tr1, r1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_fall,.Lfe1-sw_fall\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_fall # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_fall` — benchmark function synthetic:sw_fall:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_fall:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_fall\n\t.type\t sw_fall,function\n\t.thumb_func\nsw_fall:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0x2\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x2\n\tbgt\t.L9\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L6\t@cond_branch\n\tb\t.L3\n.L9:\n\tcmp\tr0, #0x3\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L5:\n\tadd\tr1, r1, #0x1\n.L6:\n\tadd\tr1, r1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_fall,.Lfe1-sw_fall\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_fall # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_fall:gcc2.7.2kmc","sym":"sw_fall","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["switch","fallthrough"],"loc":1,"refSource":"int sw_fall(int x){ int r=0; switch(x){case 3:r++;case 2:r++;case 1:r++;} return r; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,2\n 4:\tbeq\ta0,v0,38 \n 8:\tmove\tv1,zero\n c:\tslti\tv0,a0,3\n 10:\tbeqz\tv0,28 \n 14:\tli\tv0,1\n 18:\tbeql\ta0,v0,40 \n 1c:\taddiu\tv1,v1,1\n 20:\tj\t40 \n 24:\tnop\n 28:\tli\tv0,3\n 2c:\tbne\ta0,v0,40 \n 30:\tnop\n 34:\tli\tv1,1\n 38:\taddiu\tv1,v1,1\n 3c:\taddiu\tv1,v1,1\n 40:\tjr\tra\n 44:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a34ccd26bd404b9b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000048 sw_fall\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020002 1082000c 00001821 28820003 $..........!(...\n 0010 10400005 24020001 50820009 24630001 .@..$...P...$c..\n 0020 08000010 00000000 24020003 14820004 ........$.......\n 0030 00000000 24030001 24630001 24630001 ....$...$c..$c..\n 0040 03e00008 00601021 00000000 00000000 .....`.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_fall' — lift: cannot lift 'sw_fall': unmodelled control transfer 'beql' at 0x18 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tli\tv0,2 */\n/* 4:\tbeq\ta0,v0,38 */\n/* 8:\tmove\tv1,zero */\n/* c:\tslti\tv0,a0,3 */\n/* 10:\tbeqz\tv0,28 */\n/* 14:\tli\tv0,1 */\n/* 18:\tbeql\ta0,v0,40 */\n/* 1c:\taddiu\tv1,v1,1 */\n/* 20:\tj\t40 */\n/* 24:\tnop */\n/* 28:\tli\tv0,3 */\n/* 2c:\tbne\ta0,v0,40 */\n/* 30:\tnop */\n/* 34:\tli\tv1,1 */\n/* 38:\taddiu\tv1,v1,1 */\n/* 3c:\taddiu\tv1,v1,1 */\n/* 40:\tjr\tra */\n/* 44:\tmove\tv0,v1 */\n/* \t... */\nvoid sw_fall(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_fall': unmodelled control transfer 'beql' at 0x18 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":27,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_fall': unmodelled control transfer 'beql' at 0x18 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_fall(s32 arg0) {\n s32 var_v1;\n\n var_v1 = 0;\n switch (arg0) { /* irregular */\n case 3:\n var_v1 = 1;\n /* fallthrough */\n case 2:\n var_v1 += 1;\n /* fallthrough */\n case 1:\n var_v1 += 1;\n break;\n }\n return var_v1;\n}\n","score":0,"maxScore":18,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_fall` — benchmark function synthetic:sw_fall:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_fall\n li\t$v0, 2\n beq\t$a0, $v0, .L38\n move\t$v1, $zero\n slti\t$v0, $a0, 3\n beqz\t$v0, .L28\n li\t$v0, 1\n beql\t$a0, $v0, .L40\n addiu\t$v1, $v1, 1\n j\t.L40\n nop\n.L28:\n li\t$v0, 3\n bne\t$a0, $v0, .L40\n nop\n li\t$v1, 1\n.L38:\n addiu\t$v1, $v1, 1\n addiu\t$v1, $v1, 1\n.L40:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_fall # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_fall` — benchmark function synthetic:sw_fall:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_fall:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,2\n 4:\tbeq\ta0,v0,38 \n 8:\tmove\tv1,zero\n c:\tslti\tv0,a0,3\n 10:\tbeqz\tv0,28 \n 14:\tli\tv0,1\n 18:\tbeql\ta0,v0,40 \n 1c:\taddiu\tv1,v1,1\n 20:\tj\t40 \n 24:\tnop\n 28:\tli\tv0,3\n 2c:\tbne\ta0,v0,40 \n 30:\tnop\n 34:\tli\tv1,1\n 38:\taddiu\tv1,v1,1\n 3c:\taddiu\tv1,v1,1\n 40:\tjr\tra\n 44:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a34ccd26bd404b9b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000048 sw_fall\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020002 1082000c 00001821 28820003 $..........!(...\n 0010 10400005 24020001 50820009 24630001 .@..$...P...$c..\n 0020 08000010 00000000 24020003 14820004 ........$.......\n 0030 00000000 24030001 24630001 24630001 ....$...$c..$c..\n 0040 03e00008 00601021 00000000 00000000 .....`.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_fall # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_fall:ido7.1","sym":"sw_fall","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["switch","fallthrough"],"loc":1,"refSource":"int sw_fall(int x){ int r=0; switch(x){case 3:r++;case 2:r++;case 1:r++;} return r; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,1\n 4:\tbeq\ta0,at,28 \n 8:\tmove\tv1,zero\n c:\tli\tat,2\n 10:\tbeq\ta0,at,24 \n 14:\tli\tat,3\n 18:\tbne\ta0,at,2c \n 1c:\tnop\n 20:\tli\tv1,1\n 24:\taddiu\tv1,v1,1\n 28:\taddiu\tv1,v1,1\n 2c:\tjr\tra\n 30:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 sw_fall\n\n\nContents of section .text:\n 0000 24010001 10810008 00001825 24010002 $..........%$...\n 0010 10810004 24010003 14810004 00000000 ....$...........\n 0020 24030001 24630001 24630001 03e00008 $...$c..$c......\n 0030 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8000001e 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001e 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001a8 p...............\n 0010 00000005 000002ec 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000038 00000254 ...........8...T\n 0040 00000008 0000028c 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 08030000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000034 20200001 00000001 .......4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 33346363 64323662 64343034 ef-a34ccd26bd404\n 0130 6239622f 7265662e 63007377 5f66616c b9b/ref.c.sw_fal\n 0140 6c000000 73775f66 616c6c00 00000000 l...sw_fall.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000d 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 sw_fall(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n if (a0 != 1) {\n if (a0 != 2) {\n if (a0 == 3) {\n v0 = 1;\n v1 = v0 + 1;\n return v1 + 1;\n } else {\n v2 = 0;\n return v2;\n }\n } else {\n v0 = 0;\n v1 = v0 + 1;\n return v1 + 1;\n }\n } else {\n v1 = 0;\n return v1 + 1;\n }\n}\n","score":14,"maxScore":19,"compileErrors":null,"breakdown":{"insert":6,"delete":3,"replace":0,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":24,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_fall(s32 arg0) {\n s32 var_v1;\n\n var_v1 = 0;\n if (arg0 != 1) {\n if (arg0 != 2) {\n if (arg0 == 3) {\n var_v1 = 1;\n goto block_4;\n }\n } else {\nblock_4:\n var_v1 += 1;\n goto block_5;\n }\n } else {\nblock_5:\n var_v1 += 1;\n }\n return var_v1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":76,"lines":20,"gotos":2,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_fall` — benchmark function synthetic:sw_fall:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_fall\n li\t$at, 1\n beq\t$a0, $at, .L28\n move\t$v1, $zero\n li\t$at, 2\n beq\t$a0, $at, .L24\n li\t$at, 3\n bne\t$a0, $at, .L2c\n nop\n li\t$v1, 1\n.L24:\n addiu\t$v1, $v1, 1\n.L28:\n addiu\t$v1, $v1, 1\n.L2c:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_fall # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_fall` — benchmark function synthetic:sw_fall:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_fall:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,1\n 4:\tbeq\ta0,at,28 \n 8:\tmove\tv1,zero\n c:\tli\tat,2\n 10:\tbeq\ta0,at,24 \n 14:\tli\tat,3\n 18:\tbne\ta0,at,2c \n 1c:\tnop\n 20:\tli\tv1,1\n 24:\taddiu\tv1,v1,1\n 28:\taddiu\tv1,v1,1\n 2c:\tjr\tra\n 30:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 sw_fall\n\n\nContents of section .text:\n 0000 24010001 10810008 00001825 24010002 $..........%$...\n 0010 10810004 24010003 14810004 00000000 ....$...........\n 0020 24030001 24630001 24630001 03e00008 $...$c..$c......\n 0030 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8000001e 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001e 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001a8 p...............\n 0010 00000005 000002ec 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000038 00000254 ...........8...T\n 0040 00000008 0000028c 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 08030000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000034 20200001 00000001 .......4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 33346363 64323662 64343034 ef-a34ccd26bd404\n 0130 6239622f 7265662e 63007377 5f66616c b9b/ref.c.sw_fal\n 0140 6c000000 73775f66 616c6c00 00000000 l...sw_fall.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000d 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_fall # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_fall:mwcc_242_81","sym":"sw_fall","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["switch","fallthrough"],"loc":1,"refSource":"int sw_fall(int x){ int r=0; switch(x){case 3:r++;case 2:r++;case 1:r++;} return r; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,2\n 4:\tli r4,0\n 8:\tbeq 28 \n c:\tbge 1c \n 10:\tcmpwi r3,1\n 14:\tbge 2c \n 18:\tb 30 \n 1c:\tcmpwi r3,4\n 20:\tbge 30 \n 24:\tli r4,1\n 28:\taddi r4,r4,1\n 2c:\taddi r4,r4,1\n 30:\tmr r3,r4\n 34:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000038 sw_fall\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_fall\n\n\nContents of section .text:\n 0000 2c030002 38800000 41820020 40800010 ,...8...A.. @...\n 0010 2c030001 40800018 48000018 2c030004 ,...@...H...,...\n 0020 40800010 38800001 38840001 38840001 @...8...8...8...\n 0030 7c832378 4e800020 |.#xN.. \nContents of section .mwcats.text:\n 0000 02000038 00000000 ...8.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_fall' — lift: cannot lift 'sw_fall': conditional branch 'bge' has no reaching compare (cr0) in its block */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tcmpwi r3,2 */\n/* 4:\tli r4,0 */\n/* 8:\tbeq 28 */\n/* c:\tbge 1c */\n/* 10:\tcmpwi r3,1 */\n/* 14:\tbge 2c */\n/* 18:\tb 30 */\n/* 1c:\tcmpwi r3,4 */\n/* 20:\tbge 30 */\n/* 24:\tli r4,1 */\n/* 28:\taddi r4,r4,1 */\n/* 2c:\taddi r4,r4,1 */\n/* 30:\tmr r3,r4 */\n/* 34:\tblr */\nvoid sw_fall(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_fall': conditional branch 'bge' has no reaching compare (cr0) in its block\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_fall': conditional branch 'bge' has no reaching compare (cr0) in its block"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_fall(s32 arg0) {\n s32 var_r4;\n\n var_r4 = 0;\n switch (arg0) { /* irregular */\n case 3:\n var_r4 = 1;\n /* fallthrough */\n case 2:\n var_r4 += 1;\n /* fallthrough */\n case 1:\n var_r4 += 1;\n break;\n }\n return var_r4;\n}\n","score":0,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_fall` — benchmark function synthetic:sw_fall:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_fall\n cmpwi r3,2\n li r4,0\n beq .L28\n bge .L1c\n cmpwi r3,1\n bge .L2c\n b .L30\n.L1c:\n cmpwi r3,4\n bge .L30\n li r4,1\n.L28:\n addi r4,r4,1\n.L2c:\n addi r4,r4,1\n.L30:\n mr r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_fall # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_fall` — benchmark function synthetic:sw_fall:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_fall:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,2\n 4:\tli r4,0\n 8:\tbeq 28 \n c:\tbge 1c \n 10:\tcmpwi r3,1\n 14:\tbge 2c \n 18:\tb 30 \n 1c:\tcmpwi r3,4\n 20:\tbge 30 \n 24:\tli r4,1\n 28:\taddi r4,r4,1\n 2c:\taddi r4,r4,1\n 30:\tmr r3,r4\n 34:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000038 sw_fall\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_fall\n\n\nContents of section .text:\n 0000 2c030002 38800000 41820020 40800010 ,...8...A.. @...\n 0010 2c030001 40800018 48000018 2c030004 ,...@...H...,...\n 0020 40800010 38800001 38840001 38840001 @...8...8...8...\n 0030 7c832378 4e800020 |.#xN.. \nContents of section .mwcats.text:\n 0000 02000038 00000000 ...8.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_fall # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_jt:agbcc","sym":"sw_jt","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","jump-table","dense"],"loc":1,"refSource":"int sw_jt(int x){ switch(x){case 0:return 3;case 1:return 5;case 2:return 7;case 3:return 9;case 4:return 11;case 5:return 13;case 6:return 15;case 7:return 17;default:return -1;} }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_jt\n\t.type\t sw_jt,function\n\t.thumb_func\nsw_jt:\n\tcmp\tr0, #0x7\n\tbhi\t.L12\t@cond_branch\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L15\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t.L13\n\t.align\t2, 0\n\t.align\t2, 0\n.L13:\n\t.word\t.L4\n\t.word\t.L5\n\t.word\t.L6\n\t.word\t.L7\n\t.word\t.L8\n\t.word\t.L9\n\t.word\t.L10\n\t.word\t.L11\n.L4:\n\tmov\tr0, #0x3\n\tb\t.L14\n.L5:\n\tmov\tr0, #0x5\n\tb\t.L14\n.L6:\n\tmov\tr0, #0x7\n\tb\t.L14\n.L7:\n\tmov\tr0, #0x9\n\tb\t.L14\n.L8:\n\tmov\tr0, #0xb\n\tb\t.L14\n.L9:\n\tmov\tr0, #0xd\n\tb\t.L14\n.L10:\n\tmov\tr0, #0xf\n\tb\t.L14\n.L11:\n\tmov\tr0, #0x11\n\tb\t.L14\n.L12:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L14:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_jt,.Lfe1-sw_jt\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sw_jt(u32 a0) {\n s32 v0;\n switch (a0) {\n case 0:\n v0 = 3;\n break;\n case 1:\n v0 = 5;\n break;\n case 2:\n v0 = 7;\n break;\n case 3:\n v0 = 9;\n break;\n case 4:\n v0 = 11;\n break;\n case 5:\n v0 = 13;\n break;\n case 6:\n v0 = 15;\n break;\n case 7:\n v0 = 17;\n break;\n default:\n v0 = -1;\n }\n return v0;\n}\n","score":0,"maxScore":36,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":32,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_jt(u32 arg0) {\n switch (arg0) {\n case 0:\n return 3;\n case 1:\n return 5;\n case 2:\n return 7;\n case 3:\n return 9;\n case 4:\n return 0xB;\n case 5:\n return 0xD;\n case 6:\n return 0xF;\n case 7:\n return 0x11;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":36,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_jt` — benchmark function synthetic:sw_jt:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_jt\n\t.type\t sw_jt,function\n\t.thumb_func\nsw_jt:\n\tcmp\tr0, #0x7\n\tbhi\t.L12\t@cond_branch\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L15\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t.L13\n\t.align\t2, 0\n\t.align\t2, 0\n.L13:\n\t.word\t.L4\n\t.word\t.L5\n\t.word\t.L6\n\t.word\t.L7\n\t.word\t.L8\n\t.word\t.L9\n\t.word\t.L10\n\t.word\t.L11\n.L4:\n\tmov\tr0, #0x3\n\tb\t.L14\n.L5:\n\tmov\tr0, #0x5\n\tb\t.L14\n.L6:\n\tmov\tr0, #0x7\n\tb\t.L14\n.L7:\n\tmov\tr0, #0x9\n\tb\t.L14\n.L8:\n\tmov\tr0, #0xb\n\tb\t.L14\n.L9:\n\tmov\tr0, #0xd\n\tb\t.L14\n.L10:\n\tmov\tr0, #0xf\n\tb\t.L14\n.L11:\n\tmov\tr0, #0x11\n\tb\t.L14\n.L12:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L14:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_jt,.Lfe1-sw_jt\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_jt # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_jt` — benchmark function synthetic:sw_jt:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_jt:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_jt\n\t.type\t sw_jt,function\n\t.thumb_func\nsw_jt:\n\tcmp\tr0, #0x7\n\tbhi\t.L12\t@cond_branch\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L15\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t.L13\n\t.align\t2, 0\n\t.align\t2, 0\n.L13:\n\t.word\t.L4\n\t.word\t.L5\n\t.word\t.L6\n\t.word\t.L7\n\t.word\t.L8\n\t.word\t.L9\n\t.word\t.L10\n\t.word\t.L11\n.L4:\n\tmov\tr0, #0x3\n\tb\t.L14\n.L5:\n\tmov\tr0, #0x5\n\tb\t.L14\n.L6:\n\tmov\tr0, #0x7\n\tb\t.L14\n.L7:\n\tmov\tr0, #0x9\n\tb\t.L14\n.L8:\n\tmov\tr0, #0xb\n\tb\t.L14\n.L9:\n\tmov\tr0, #0xd\n\tb\t.L14\n.L10:\n\tmov\tr0, #0xf\n\tb\t.L14\n.L11:\n\tmov\tr0, #0x11\n\tb\t.L14\n.L12:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L14:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_jt,.Lfe1-sw_jt\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_jt # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_jt:gcc2.7.2kmc","sym":"sw_jt","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["switch","jump-table","dense"],"loc":1,"refSource":"int sw_jt(int x){ switch(x){case 0:return 3;case 1:return 5;case 2:return 7;case 3:return 9;case 4:return 11;case 5:return 13;case 6:return 15;case 7:return 17;default:return -1;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltiu\tv0,a0,8\n 4:\tbeqz\tv0,60 \n 8:\tsll\tv0,a0,0x2\n c:\tlui\tat,0x0\n 10:\taddu\tat,at,v0\n 14:\tlw\tv0,0(at)\n 18:\tjr\tv0\n 1c:\tnop\n 20:\tj\t64 \n 24:\tli\tv0,3\n 28:\tj\t64 \n 2c:\tli\tv0,5\n 30:\tj\t64 \n 34:\tli\tv0,7\n 38:\tj\t64 \n 3c:\tli\tv0,9\n 40:\tj\t64 \n 44:\tli\tv0,11\n 48:\tj\t64 \n 4c:\tli\tv0,13\n 50:\tj\t64 \n 54:\tli\tv0,15\n 58:\tj\t64 \n 5c:\tli\tv0,17\n 60:\tli\tv0,-1\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-478c2b4db5ad2fcb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .rodata\t00000000 .rodata\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c sw_jt\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_MIPS_HI16 .rodata\n00000014 R_MIPS_LO16 .rodata\n00000020 R_MIPS_26 .text\n00000028 R_MIPS_26 .text\n00000030 R_MIPS_26 .text\n00000038 R_MIPS_26 .text\n00000040 R_MIPS_26 .text\n00000048 R_MIPS_26 .text\n00000050 R_MIPS_26 .text\n00000058 R_MIPS_26 .text\n\n\nRELOCATION RECORDS FOR [.rodata]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_32 .text\n00000004 R_MIPS_32 .text\n00000008 R_MIPS_32 .text\n0000000c R_MIPS_32 .text\n00000010 R_MIPS_32 .text\n00000014 R_MIPS_32 .text\n00000018 R_MIPS_32 .text\n0000001c R_MIPS_32 .text\n\n\nContents of section .text:\n 0000 2c820008 10400016 00041080 3c010000 ,....@......<...\n 0010 00220821 8c220000 00400008 00000000 .\".!.\"...@......\n 0020 08000019 24020003 08000019 24020005 ....$.......$...\n 0030 08000019 24020007 08000019 24020009 ....$.......$...\n 0040 08000019 2402000b 08000019 2402000d ....$.......$...\n 0050 08000019 2402000f 08000019 24020011 ....$.......$...\n 0060 2402ffff 03e00008 00000000 00000000 $...............\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .rodata:\n 0000 00000020 00000028 00000030 00000038 ... ...(...0...8\n 0010 00000040 00000048 00000050 00000058 ...@...H...P...X\nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sw_jt(u32 a0) {\n s32 v0;\n switch (a0) {\n case 0:\n v0 = 3;\n break;\n case 1:\n v0 = 5;\n break;\n case 2:\n v0 = 7;\n break;\n case 3:\n v0 = 9;\n break;\n case 4:\n v0 = 11;\n break;\n case 5:\n v0 = 13;\n break;\n case 6:\n v0 = 15;\n break;\n case 7:\n v0 = 17;\n break;\n default:\n v0 = -1;\n }\n return v0;\n}\n","score":0,"maxScore":27,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":32,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_jt(u32 arg0) {\n switch (arg0) {\n case 0:\n return 3;\n case 1:\n return 5;\n case 2:\n return 7;\n case 3:\n return 9;\n case 4:\n return 0xB;\n case 5:\n return 0xD;\n case 6:\n return 0xF;\n case 7:\n return 0x11;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":27,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_jt` — benchmark function synthetic:sw_jt:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_jt\n sltiu\t$v0, $a0, 8\n beqz\t$v0, .L60\n sll\t$v0, $a0, 0x2\n lui\t$at, %hi(jtbl_rodata_0)\n addu\t$at, $at, $v0\n lw\t$v0, %lo(jtbl_rodata_0)($at)\n jr\t$v0\n nop\n.L20:\n j\t.L64\n li\t$v0, 3\n.L28:\n j\t.L64\n li\t$v0, 5\n.L30:\n j\t.L64\n li\t$v0, 7\n.L38:\n j\t.L64\n li\t$v0, 9\n.L40:\n j\t.L64\n li\t$v0, 11\n.L48:\n j\t.L64\n li\t$v0, 13\n.L50:\n j\t.L64\n li\t$v0, 15\n.L58:\n j\t.L64\n li\t$v0, 17\n.L60:\n li\t$v0, -1\n.L64:\n jr\t$ra\n nop\n nop\n.rodata\nglabel jtbl_rodata_0\n.word .L20\n.word .L28\n.word .L30\n.word .L38\n.word .L40\n.word .L48\n.word .L50\n.word .L58\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_jt # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_jt` — benchmark function synthetic:sw_jt:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_jt:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltiu\tv0,a0,8\n 4:\tbeqz\tv0,60 \n 8:\tsll\tv0,a0,0x2\n c:\tlui\tat,0x0\n 10:\taddu\tat,at,v0\n 14:\tlw\tv0,0(at)\n 18:\tjr\tv0\n 1c:\tnop\n 20:\tj\t64 \n 24:\tli\tv0,3\n 28:\tj\t64 \n 2c:\tli\tv0,5\n 30:\tj\t64 \n 34:\tli\tv0,7\n 38:\tj\t64 \n 3c:\tli\tv0,9\n 40:\tj\t64 \n 44:\tli\tv0,11\n 48:\tj\t64 \n 4c:\tli\tv0,13\n 50:\tj\t64 \n 54:\tli\tv0,15\n 58:\tj\t64 \n 5c:\tli\tv0,17\n 60:\tli\tv0,-1\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-478c2b4db5ad2fcb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .rodata\t00000000 .rodata\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c sw_jt\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_MIPS_HI16 .rodata\n00000014 R_MIPS_LO16 .rodata\n00000020 R_MIPS_26 .text\n00000028 R_MIPS_26 .text\n00000030 R_MIPS_26 .text\n00000038 R_MIPS_26 .text\n00000040 R_MIPS_26 .text\n00000048 R_MIPS_26 .text\n00000050 R_MIPS_26 .text\n00000058 R_MIPS_26 .text\n\n\nRELOCATION RECORDS FOR [.rodata]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_32 .text\n00000004 R_MIPS_32 .text\n00000008 R_MIPS_32 .text\n0000000c R_MIPS_32 .text\n00000010 R_MIPS_32 .text\n00000014 R_MIPS_32 .text\n00000018 R_MIPS_32 .text\n0000001c R_MIPS_32 .text\n\n\nContents of section .text:\n 0000 2c820008 10400016 00041080 3c010000 ,....@......<...\n 0010 00220821 8c220000 00400008 00000000 .\".!.\"...@......\n 0020 08000019 24020003 08000019 24020005 ....$.......$...\n 0030 08000019 24020007 08000019 24020009 ....$.......$...\n 0040 08000019 2402000b 08000019 2402000d ....$.......$...\n 0050 08000019 2402000f 08000019 24020011 ....$.......$...\n 0060 2402ffff 03e00008 00000000 00000000 $...............\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .rodata:\n 0000 00000020 00000028 00000030 00000038 ... ...(...0...8\n 0010 00000040 00000048 00000050 00000058 ...@...H...P...X\nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_jt # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_jt:ido7.1","sym":"sw_jt","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["switch","jump-table","dense"],"loc":1,"refSource":"int sw_jt(int x){ switch(x){case 0:return 3;case 1:return 5;case 2:return 7;case 3:return 9;case 4:return 11;case 5:return 13;case 6:return 15;case 7:return 17;default:return -1;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltiu\tat,a0,8\n 4:\tbeqz\tat,64 \n 8:\tli\tv0,-1\n c:\tsll\tt6,a0,0x2\n 10:\tlui\tat,0x0\n 14:\taddu\tat,at,t6\n 18:\tlw\tt6,0(at)\n 1c:\tjr\tt6\n 20:\tnop\n 24:\tjr\tra\n 28:\tli\tv0,3\n 2c:\tjr\tra\n 30:\tli\tv0,5\n 34:\tjr\tra\n 38:\tli\tv0,7\n 3c:\tjr\tra\n 40:\tli\tv0,9\n 44:\tjr\tra\n 48:\tli\tv0,11\n 4c:\tjr\tra\n 50:\tli\tv0,13\n 54:\tjr\tra\n 58:\tli\tv0,15\n 5c:\tjr\tra\n 60:\tli\tv0,17\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 l d .rodata\t00000020 .rodata\n00000000 g F .text\t0000006c sw_jt\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 .rodata\n00000018 R_MIPS_LO16 .rodata\n\n\nRELOCATION RECORDS FOR [.rodata]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_32 .text\n00000004 R_MIPS_32 .text\n00000008 R_MIPS_32 .text\n0000000c R_MIPS_32 .text\n00000010 R_MIPS_32 .text\n00000014 R_MIPS_32 .text\n00000018 R_MIPS_32 .text\n0000001c R_MIPS_32 .text\n\n\nContents of section .text:\n 0000 2c810008 10200017 2402ffff 00047080 ,.... ..$.....p.\n 0010 3c010000 002e0821 8c2e0000 01c00008 <......!........\n 0020 00000000 03e00008 24020003 03e00008 ........$.......\n 0030 24020005 03e00008 24020007 03e00008 $.......$.......\n 0040 24020009 03e00008 2402000b 03e00008 $.......$.......\n 0050 2402000d 03e00008 2402000f 03e00008 $.......$.......\n 0060 24020011 03e00008 00000000 00000000 $...............\nContents of section .rodata:\n 0000 00000024 0000002c 00000034 0000003c ...$...,...4...<\n 0010 00000044 0000004c 00000054 0000005c ...D...L...T...\\\nContents of section .options:\n 0000 01200000 00000000 80004016 00000000 . ........@.....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004016 00000000 00000000 00000000 ..@.............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001b 00000004 00000288 p...............\n 0010 00000005 000003c8 00000001 0000028c ................\n 0020 00000004 000002c0 00000000 00000000 ................\n 0030 00000011 000002f0 00000034 00000334 ...........4...4\n 0040 00000008 00000368 00000001 00000370 .......h.......p\n 0050 00000000 00000000 00000001 000003b8 ................\n 0060 08080800 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000006c 20200001 00000001 .......l ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 37386332 62346462 35616432 ef-478c2b4db5ad2\n 0130 6663622f 7265662e 63007377 5f6a7400 fcb/ref.c.sw_jt.\n 0140 73775f6a 74000000 00000000 00000001 sw_jt...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 0000001b 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000003 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sw_jt(u32 a0) {\n switch (a0) {\n case 0:\n return 3;\n case 1:\n return 5;\n case 2:\n return 7;\n case 3:\n return 9;\n case 4:\n return 11;\n case 5:\n return 13;\n case 6:\n return 15;\n case 7:\n return 17;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":27,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_jt(u32 arg0) {\n switch (arg0) {\n case 0:\n return 3;\n case 1:\n return 5;\n case 2:\n return 7;\n case 3:\n return 9;\n case 4:\n return 0xB;\n case 5:\n return 0xD;\n case 6:\n return 0xF;\n case 7:\n return 0x11;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":27,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_jt` — benchmark function synthetic:sw_jt:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_jt\n sltiu\t$at, $a0, 8\n beqz\t$at, .L64\n li\t$v0, -1\n sll\t$t6, $a0, 0x2\n lui\t$at, %hi(jtbl_rodata_0)\n addu\t$at, $at, $t6\n lw\t$t6, %lo(jtbl_rodata_0)($at)\n jr\t$t6\n nop\n.L24:\n jr\t$ra\n li\t$v0, 3\n.L2c:\n jr\t$ra\n li\t$v0, 5\n.L34:\n jr\t$ra\n li\t$v0, 7\n.L3c:\n jr\t$ra\n li\t$v0, 9\n.L44:\n jr\t$ra\n li\t$v0, 11\n.L4c:\n jr\t$ra\n li\t$v0, 13\n.L54:\n jr\t$ra\n li\t$v0, 15\n.L5c:\n jr\t$ra\n li\t$v0, 17\n.L64:\n jr\t$ra\n nop\n nop\n.rodata\nglabel jtbl_rodata_0\n.word .L24\n.word .L2c\n.word .L34\n.word .L3c\n.word .L44\n.word .L4c\n.word .L54\n.word .L5c\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_jt # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_jt` — benchmark function synthetic:sw_jt:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_jt:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltiu\tat,a0,8\n 4:\tbeqz\tat,64 \n 8:\tli\tv0,-1\n c:\tsll\tt6,a0,0x2\n 10:\tlui\tat,0x0\n 14:\taddu\tat,at,t6\n 18:\tlw\tt6,0(at)\n 1c:\tjr\tt6\n 20:\tnop\n 24:\tjr\tra\n 28:\tli\tv0,3\n 2c:\tjr\tra\n 30:\tli\tv0,5\n 34:\tjr\tra\n 38:\tli\tv0,7\n 3c:\tjr\tra\n 40:\tli\tv0,9\n 44:\tjr\tra\n 48:\tli\tv0,11\n 4c:\tjr\tra\n 50:\tli\tv0,13\n 54:\tjr\tra\n 58:\tli\tv0,15\n 5c:\tjr\tra\n 60:\tli\tv0,17\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 l d .rodata\t00000020 .rodata\n00000000 g F .text\t0000006c sw_jt\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 .rodata\n00000018 R_MIPS_LO16 .rodata\n\n\nRELOCATION RECORDS FOR [.rodata]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_32 .text\n00000004 R_MIPS_32 .text\n00000008 R_MIPS_32 .text\n0000000c R_MIPS_32 .text\n00000010 R_MIPS_32 .text\n00000014 R_MIPS_32 .text\n00000018 R_MIPS_32 .text\n0000001c R_MIPS_32 .text\n\n\nContents of section .text:\n 0000 2c810008 10200017 2402ffff 00047080 ,.... ..$.....p.\n 0010 3c010000 002e0821 8c2e0000 01c00008 <......!........\n 0020 00000000 03e00008 24020003 03e00008 ........$.......\n 0030 24020005 03e00008 24020007 03e00008 $.......$.......\n 0040 24020009 03e00008 2402000b 03e00008 $.......$.......\n 0050 2402000d 03e00008 2402000f 03e00008 $.......$.......\n 0060 24020011 03e00008 00000000 00000000 $...............\nContents of section .rodata:\n 0000 00000024 0000002c 00000034 0000003c ...$...,...4...<\n 0010 00000044 0000004c 00000054 0000005c ...D...L...T...\\\nContents of section .options:\n 0000 01200000 00000000 80004016 00000000 . ........@.....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004016 00000000 00000000 00000000 ..@.............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001b 00000004 00000288 p...............\n 0010 00000005 000003c8 00000001 0000028c ................\n 0020 00000004 000002c0 00000000 00000000 ................\n 0030 00000011 000002f0 00000034 00000334 ...........4...4\n 0040 00000008 00000368 00000001 00000370 .......h.......p\n 0050 00000000 00000000 00000001 000003b8 ................\n 0060 08080800 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000006c 20200001 00000001 .......l ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 37386332 62346462 35616432 ef-478c2b4db5ad2\n 0130 6663622f 7265662e 63007377 5f6a7400 fcb/ref.c.sw_jt.\n 0140 73775f6a 74000000 00000000 00000001 sw_jt...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 0000001b 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000003 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_jt # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_jt:mwcc_242_81","sym":"sw_jt","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["switch","jump-table","dense"],"loc":1,"refSource":"int sw_jt(int x){ switch(x){case 0:return 3;case 1:return 5;case 2:return 7;case 3:return 9;case 4:return 11;case 5:return 13;case 6:return 15;case 7:return 17;default:return -1;} }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmplwi r3,7\n 4:\tbgt 60 \n 8:\tlis r4,0\n\t\t\ta: R_PPC_ADDR16_HA\t@15\n c:\tslwi r0,r3,2\n 10:\taddi r3,r4,0\n\t\t\t12: R_PPC_ADDR16_LO\t@15\n 14:\tlwzx r0,r3,r0\n 18:\tmtctr r0\n 1c:\tbctr\n 20:\tli r3,3\n 24:\tblr\n 28:\tli r3,5\n 2c:\tblr\n 30:\tli r3,7\n 34:\tblr\n 38:\tli r3,9\n 3c:\tblr\n 40:\tli r3,11\n 44:\tblr\n 48:\tli r3,13\n 4c:\tblr\n 50:\tli r3,15\n 54:\tblr\n 58:\tli r3,17\n 5c:\tblr\n 60:\tli r3,-1\n 64:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 l O .data\t00000020 @15\n00000000 g F .text\t00000068 sw_jt\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000a R_PPC_ADDR16_HA @15\n00000012 R_PPC_ADDR16_LO @15\n\n\nRELOCATION RECORDS FOR [.data]:\nOFFSET TYPE VALUE\n00000000 R_PPC_ADDR32 sw_jt+0x00000020\n00000004 R_PPC_ADDR32 sw_jt+0x00000028\n00000008 R_PPC_ADDR32 sw_jt+0x00000030\n0000000c R_PPC_ADDR32 sw_jt+0x00000038\n00000010 R_PPC_ADDR32 sw_jt+0x00000040\n00000014 R_PPC_ADDR32 sw_jt+0x00000048\n00000018 R_PPC_ADDR32 sw_jt+0x00000050\n0000001c R_PPC_ADDR32 sw_jt+0x00000058\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_jt\n\n\nContents of section .text:\n 0000 28030007 4181005c 3c800000 5460103a (...A..\\<...T`.:\n 0010 38640000 7c03002e 7c0903a6 4e800420 8d..|...|...N.. \n 0020 38600003 4e800020 38600005 4e800020 8`..N.. 8`..N.. \n 0030 38600007 4e800020 38600009 4e800020 8`..N.. 8`..N.. \n 0040 3860000b 4e800020 3860000d 4e800020 8`..N.. 8`..N.. \n 0050 3860000f 4e800020 38600011 4e800020 8`..N.. 8`..N.. \n 0060 3860ffff 4e800020 8`..N.. \nContents of section .data:\n 0000 00000000 00000000 00000000 00000000 ................\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .mwcats.text:\n 0000 02000068 00000000 ...h.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000008 00000000 00000004 ................\n 0050 00000000 00000004 00000000 00000004 ................\n 0060 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sw_jt(u32 a0) {\n switch (a0) {\n case 0:\n return 3;\n case 1:\n return 5;\n case 2:\n return 7;\n case 3:\n return 9;\n case 4:\n return 11;\n case 5:\n return 13;\n case 6:\n return 15;\n case 7:\n return 17;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":26,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_jt(u32 arg0) {\n switch (arg0) {\n case 0:\n return 3;\n case 1:\n return 5;\n case 2:\n return 7;\n case 3:\n return 9;\n case 4:\n return 0xB;\n case 5:\n return 0xD;\n case 6:\n return 0xF;\n case 7:\n return 0x11;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":26,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_jt` — benchmark function synthetic:sw_jt:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_jt\n cmplwi r3,7\n bgt .L60\n lis r4,jtbl_15@ha\n slwi r0,r3,2\n addi r3,r4,jtbl_15@l\n lwzx r0,r3,r0\n mtctr r0\n bctr\n.L20:\n li r3,3\n blr\n.L28:\n li r3,5\n blr\n.L30:\n li r3,7\n blr\n.L38:\n li r3,9\n blr\n.L40:\n li r3,11\n blr\n.L48:\n li r3,13\n blr\n.L50:\n li r3,15\n blr\n.L58:\n li r3,17\n blr\n.L60:\n li r3,-1\n blr\n.rodata\nglabel jtbl_15\n.word .L20\n.word .L28\n.word .L30\n.word .L38\n.word .L40\n.word .L48\n.word .L50\n.word .L58\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_jt # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_jt` — benchmark function synthetic:sw_jt:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_jt:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmplwi r3,7\n 4:\tbgt 60 \n 8:\tlis r4,0\n\t\t\ta: R_PPC_ADDR16_HA\t@15\n c:\tslwi r0,r3,2\n 10:\taddi r3,r4,0\n\t\t\t12: R_PPC_ADDR16_LO\t@15\n 14:\tlwzx r0,r3,r0\n 18:\tmtctr r0\n 1c:\tbctr\n 20:\tli r3,3\n 24:\tblr\n 28:\tli r3,5\n 2c:\tblr\n 30:\tli r3,7\n 34:\tblr\n 38:\tli r3,9\n 3c:\tblr\n 40:\tli r3,11\n 44:\tblr\n 48:\tli r3,13\n 4c:\tblr\n 50:\tli r3,15\n 54:\tblr\n 58:\tli r3,17\n 5c:\tblr\n 60:\tli r3,-1\n 64:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 l O .data\t00000020 @15\n00000000 g F .text\t00000068 sw_jt\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000a R_PPC_ADDR16_HA @15\n00000012 R_PPC_ADDR16_LO @15\n\n\nRELOCATION RECORDS FOR [.data]:\nOFFSET TYPE VALUE\n00000000 R_PPC_ADDR32 sw_jt+0x00000020\n00000004 R_PPC_ADDR32 sw_jt+0x00000028\n00000008 R_PPC_ADDR32 sw_jt+0x00000030\n0000000c R_PPC_ADDR32 sw_jt+0x00000038\n00000010 R_PPC_ADDR32 sw_jt+0x00000040\n00000014 R_PPC_ADDR32 sw_jt+0x00000048\n00000018 R_PPC_ADDR32 sw_jt+0x00000050\n0000001c R_PPC_ADDR32 sw_jt+0x00000058\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_jt\n\n\nContents of section .text:\n 0000 28030007 4181005c 3c800000 5460103a (...A..\\<...T`.:\n 0010 38640000 7c03002e 7c0903a6 4e800420 8d..|...|...N.. \n 0020 38600003 4e800020 38600005 4e800020 8`..N.. 8`..N.. \n 0030 38600007 4e800020 38600009 4e800020 8`..N.. 8`..N.. \n 0040 3860000b 4e800020 3860000d 4e800020 8`..N.. 8`..N.. \n 0050 3860000f 4e800020 38600011 4e800020 8`..N.. 8`..N.. \n 0060 3860ffff 4e800020 8`..N.. \nContents of section .data:\n 0000 00000000 00000000 00000000 00000000 ................\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .mwcats.text:\n 0000 02000068 00000000 ...h.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000008 00000000 00000004 ................\n 0050 00000000 00000004 00000000 00000004 ................\n 0060 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_jt # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_op:agbcc","sym":"sw_op","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","comparison-tree","arithmetic"],"loc":1,"refSource":"int sw_op(int op,int a,int b){ switch(op){case 0:return a+b;case 1:return a-b;case 2:return a*b;case 3:return a&b;default:return 0;} }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_op\n\t.type\t sw_op,function\n\t.thumb_func\nsw_op:\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x1\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr0, #0x2\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr0, #0x3\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tadd\tr0, r1, r2\n\tb\t.L11\n.L5:\n\tsub\tr0, r1, r2\n\tb\t.L11\n.L6:\n\tmov\tr0, r1\n\tmul\tr0, r0, r2\n\tb\t.L11\n.L7:\n\tand\tr1, r1, r2\n\tadd\tr0, r1, #0\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_op,.Lfe1-sw_op\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 sw_op(s32 a0, s32 a1, s32 a2) {\n switch (a0) {\n case 0:\n return a1 + a2;\n case 1:\n return a1 - a2;\n case 2:\n return a1 * a2;\n case 3:\n return a1 & a2;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_op(s32 arg0, s32 arg1, s32 arg2) {\n switch (arg0) { /* irregular */\n case 0:\n return arg1 + arg2;\n case 1:\n return arg1 - arg2;\n case 2:\n return arg1 * arg2;\n case 3:\n return arg1 & arg2;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_op` — benchmark function synthetic:sw_op:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_op\n\t.type\t sw_op,function\n\t.thumb_func\nsw_op:\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x1\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr0, #0x2\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr0, #0x3\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tadd\tr0, r1, r2\n\tb\t.L11\n.L5:\n\tsub\tr0, r1, r2\n\tb\t.L11\n.L6:\n\tmov\tr0, r1\n\tmul\tr0, r0, r2\n\tb\t.L11\n.L7:\n\tand\tr1, r1, r2\n\tadd\tr0, r1, #0\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_op,.Lfe1-sw_op\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_op # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_op` — benchmark function synthetic:sw_op:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_op:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_op\n\t.type\t sw_op,function\n\t.thumb_func\nsw_op:\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x1\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr0, #0x2\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr0, #0x3\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tadd\tr0, r1, r2\n\tb\t.L11\n.L5:\n\tsub\tr0, r1, r2\n\tb\t.L11\n.L6:\n\tmov\tr0, r1\n\tmul\tr0, r0, r2\n\tb\t.L11\n.L7:\n\tand\tr1, r1, r2\n\tadd\tr0, r1, #0\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_op,.Lfe1-sw_op\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_op # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_op:gcc2.7.2kmc","sym":"sw_op","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["switch","comparison-tree","arithmetic"],"loc":1,"refSource":"int sw_op(int op,int a,int b){ switch(op){case 0:return a+b;case 1:return a-b;case 2:return a*b;case 3:return a&b;default:return 0;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tbeq\ta0,v0,3c \n 8:\tslti\tv0,a0,2\n c:\tbeqzl\tv0,24 \n 10:\tli\tv0,2\n 14:\tbeqz\ta0,50 \n 18:\taddu\tv0,a1,a2\n 1c:\tj\t50 \n 20:\tmove\tv0,zero\n 24:\tbeq\ta0,v0,44 \n 28:\tli\tv0,3\n 2c:\tbeq\ta0,v0,50 \n 30:\tand\tv0,a1,a2\n 34:\tj\t50 \n 38:\tmove\tv0,zero\n 3c:\tj\t50 \n 40:\tsubu\tv0,a1,a2\n 44:\tnop\n 48:\tmult\ta1,a2\n 4c:\tmflo\tv0\n 50:\tjr\tra\n 54:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d6a51790181c9921/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 sw_op\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n00000034 R_MIPS_26 .text\n0000003c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020001 1082000d 28820002 50400005 $.......(...P@..\n 0010 24020002 1080000e 00a61021 08000014 $..........!....\n 0020 00001021 10820007 24020003 10820008 ...!....$.......\n 0030 00a61024 08000014 00001021 08000014 ...$.......!....\n 0040 00a61023 00000000 00a60018 00001012 ...#............\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_op' — lift: cannot lift 'sw_op': unmodelled control transfer 'beqzl' at 0xc — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tli\tv0,1 */\n/* 4:\tbeq\ta0,v0,3c */\n/* 8:\tslti\tv0,a0,2 */\n/* c:\tbeqzl\tv0,24 */\n/* 10:\tli\tv0,2 */\n/* 14:\tbeqz\ta0,50 */\n/* 18:\taddu\tv0,a1,a2 */\n/* 1c:\tj\t50 */\n/* 20:\tmove\tv0,zero */\n/* 24:\tbeq\ta0,v0,44 */\n/* 28:\tli\tv0,3 */\n/* 2c:\tbeq\ta0,v0,50 */\n/* 30:\tand\tv0,a1,a2 */\n/* 34:\tj\t50 */\n/* 38:\tmove\tv0,zero */\n/* 3c:\tj\t50 */\n/* 40:\tsubu\tv0,a1,a2 */\n/* 44:\tnop */\n/* 48:\tmult\ta1,a2 */\n/* 4c:\tmflo\tv0 */\n/* 50:\tjr\tra */\n/* 54:\tnop */\n/* \t... */\nvoid sw_op(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_op': unmodelled control transfer 'beqzl' at 0xc — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":31,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_op': unmodelled control transfer 'beqzl' at 0xc — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sw_op(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_v0;\n\n if (arg0 != 1) {\n if (arg0 >= 2) {\n if (arg0 != 2) {\n var_v0 = arg1 & arg2;\n if (arg0 != 3) {\n return 0;\n }\n /* Duplicate return node #11. Try simplifying control flow for better match */\n return var_v0;\n }\n var_v0 = arg1 * arg2;\n /* Duplicate return node #11. Try simplifying control flow for better match */\n return var_v0;\n }\n var_v0 = arg1 + arg2;\n if (arg0 != 0) {\n return 0;\n }\n return var_v0;\n }\n return arg1 - arg2;\n}\n","score":22,"maxScore":30,"compileErrors":null,"breakdown":{"insert":8,"delete":7,"replace":2,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":24,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":22,"maxScore":30,"ratio":0.7333333333333333,"kinds":{"insert":8,"delete":7,"replace":2,"opMismatch":0,"argMismatch":5}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_op` — benchmark function synthetic:sw_op:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_op\n li\t$v0, 1\n beq\t$a0, $v0, .L3c\n slti\t$v0, $a0, 2\n beqzl\t$v0, .L24\n li\t$v0, 2\n beqz\t$a0, .L50\n addu\t$v0, $a1, $a2\n j\t.L50\n move\t$v0, $zero\n.L24:\n beq\t$a0, $v0, .L44\n li\t$v0, 3\n beq\t$a0, $v0, .L50\n and\t$v0, $a1, $a2\n j\t.L50\n move\t$v0, $zero\n.L3c:\n j\t.L50\n subu\t$v0, $a1, $a2\n.L44:\n nop\n mult\t$a1, $a2\n mflo\t$v0\n.L50:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_op # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_op` — benchmark function synthetic:sw_op:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_op:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tbeq\ta0,v0,3c \n 8:\tslti\tv0,a0,2\n c:\tbeqzl\tv0,24 \n 10:\tli\tv0,2\n 14:\tbeqz\ta0,50 \n 18:\taddu\tv0,a1,a2\n 1c:\tj\t50 \n 20:\tmove\tv0,zero\n 24:\tbeq\ta0,v0,44 \n 28:\tli\tv0,3\n 2c:\tbeq\ta0,v0,50 \n 30:\tand\tv0,a1,a2\n 34:\tj\t50 \n 38:\tmove\tv0,zero\n 3c:\tj\t50 \n 40:\tsubu\tv0,a1,a2\n 44:\tnop\n 48:\tmult\ta1,a2\n 4c:\tmflo\tv0\n 50:\tjr\tra\n 54:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d6a51790181c9921/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 sw_op\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n00000034 R_MIPS_26 .text\n0000003c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020001 1082000d 28820002 50400005 $.......(...P@..\n 0010 24020002 1080000e 00a61021 08000014 $..........!....\n 0020 00001021 10820007 24020003 10820008 ...!....$.......\n 0030 00a61024 08000014 00001021 08000014 ...$.......!....\n 0040 00a61023 00000000 00a60018 00001012 ...#............\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_op # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_op:ido7.1","sym":"sw_op","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["switch","comparison-tree","arithmetic"],"loc":1,"refSource":"int sw_op(int op,int a,int b){ switch(op){case 0:return a+b;case 1:return a-b;case 2:return a*b;case 3:return a&b;default:return 0;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,28 \n 4:\tli\tat,1\n 8:\tbeq\ta0,at,30 \n c:\tli\tat,2\n 10:\tbeq\ta0,at,38 \n 14:\tli\tat,3\n 18:\tbeq\ta0,at,48 \n 1c:\tmove\tv0,zero\n 20:\tb\t50 \n 24:\tnop\n 28:\tjr\tra\n 2c:\taddu\tv0,a1,a2\n 30:\tjr\tra\n 34:\tsubu\tv0,a1,a2\n 38:\tmultu\ta1,a2\n 3c:\tmflo\tv0\n 40:\tjr\tra\n 44:\tnop\n 48:\tjr\tra\n 4c:\tand\tv0,a1,a2\n 50:\tjr\tra\n 54:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000058 sw_op\n\n\nContents of section .text:\n 0000 10800009 24010001 10810009 24010002 ....$.......$...\n 0010 10810009 24010003 1081000b 00001025 ....$..........%\n 0020 1000000b 00000000 03e00008 00a61021 ...............!\n 0030 03e00008 00a61023 00a60019 00001012 .......#........\n 0040 03e00008 00000000 03e00008 00a61024 ...............$\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000076 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000016 00000004 000001c8 p...............\n 0010 00000005 00000308 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 00000008 000002a8 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 08080300 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000058 20200001 00000001 .......X ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 36613531 37393031 38316339 ef-d6a51790181c9\n 0130 3932312f 7265662e 63007377 5f6f7000 921/ref.c.sw_op.\n 0140 73775f6f 70000000 00000000 00000001 sw_op...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000016 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000003 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sw_op(u32 a0, u32 a1, u32 a2) {\n switch (a0) {\n case 0:\n return a1 + a2;\n case 1:\n return a1 - a2;\n case 2:\n return a1 * a2;\n case 3:\n return a1 & a2;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_op(s32 arg0, s32 arg1, s32 arg2) {\n switch (arg0) { /* irregular */\n case 0:\n return arg1 + arg2;\n case 1:\n return arg1 - arg2;\n case 2:\n return arg1 * arg2;\n case 3:\n return arg1 & arg2;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_op` — benchmark function synthetic:sw_op:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_op\n beqz\t$a0, .L28\n li\t$at, 1\n beq\t$a0, $at, .L30\n li\t$at, 2\n beq\t$a0, $at, .L38\n li\t$at, 3\n beq\t$a0, $at, .L48\n move\t$v0, $zero\n b\t.L50\n nop\n.L28:\n jr\t$ra\n addu\t$v0, $a1, $a2\n.L30:\n jr\t$ra\n subu\t$v0, $a1, $a2\n.L38:\n multu\t$a1, $a2\n mflo\t$v0\n jr\t$ra\n nop\n.L48:\n jr\t$ra\n and\t$v0, $a1, $a2\n.L50:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_op # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_op` — benchmark function synthetic:sw_op:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_op:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,28 \n 4:\tli\tat,1\n 8:\tbeq\ta0,at,30 \n c:\tli\tat,2\n 10:\tbeq\ta0,at,38 \n 14:\tli\tat,3\n 18:\tbeq\ta0,at,48 \n 1c:\tmove\tv0,zero\n 20:\tb\t50 \n 24:\tnop\n 28:\tjr\tra\n 2c:\taddu\tv0,a1,a2\n 30:\tjr\tra\n 34:\tsubu\tv0,a1,a2\n 38:\tmultu\ta1,a2\n 3c:\tmflo\tv0\n 40:\tjr\tra\n 44:\tnop\n 48:\tjr\tra\n 4c:\tand\tv0,a1,a2\n 50:\tjr\tra\n 54:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000058 sw_op\n\n\nContents of section .text:\n 0000 10800009 24010001 10810009 24010002 ....$.......$...\n 0010 10810009 24010003 1081000b 00001025 ....$..........%\n 0020 1000000b 00000000 03e00008 00a61021 ...............!\n 0030 03e00008 00a61023 00a60019 00001012 .......#........\n 0040 03e00008 00000000 03e00008 00a61024 ...............$\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000076 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000016 00000004 000001c8 p...............\n 0010 00000005 00000308 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 00000008 000002a8 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 08080300 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000058 20200001 00000001 .......X ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 36613531 37393031 38316339 ef-d6a51790181c9\n 0130 3932312f 7265662e 63007377 5f6f7000 921/ref.c.sw_op.\n 0140 73775f6f 70000000 00000000 00000001 sw_op...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000016 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000003 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_op # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_op:mwcc_242_81","sym":"sw_op","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["switch","comparison-tree","arithmetic"],"loc":1,"refSource":"int sw_op(int op,int a,int b){ switch(op){case 0:return a+b;case 1:return a-b;case 2:return a*b;case 3:return a&b;default:return 0;} }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,2\n 4:\tbeq 38 \n 8:\tbge 1c \n c:\tcmpwi r3,0\n 10:\tbeq 28 \n 14:\tbge 30 \n 18:\tb 48 \n 1c:\tcmpwi r3,4\n 20:\tbge 48 \n 24:\tb 40 \n 28:\tadd r3,r4,r5\n 2c:\tblr\n 30:\tsubf r3,r5,r4\n 34:\tblr\n 38:\tmullw r3,r4,r5\n 3c:\tblr\n 40:\tand r3,r4,r5\n 44:\tblr\n 48:\tli r3,0\n 4c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000050 sw_op\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_op\n\n\nContents of section .text:\n 0000 2c030002 41820034 40800014 2c030000 ,...A..4@...,...\n 0010 41820018 4080001c 48000030 2c030004 A...@...H..0,...\n 0020 40800028 4800001c 7c642a14 4e800020 @..(H...|d*.N.. \n 0030 7c652050 4e800020 7c6429d6 4e800020 |e PN.. |d).N.. \n 0040 7c832838 4e800020 38600000 4e800020 |.(8N.. 8`..N.. \nContents of section .mwcats.text:\n 0000 02000050 00000000 ...P.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_op' — lift: cannot lift 'sw_op': conditional branch 'bge' has no reaching compare (cr0) in its block */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tcmpwi r3,2 */\n/* 4:\tbeq 38 */\n/* 8:\tbge 1c */\n/* c:\tcmpwi r3,0 */\n/* 10:\tbeq 28 */\n/* 14:\tbge 30 */\n/* 18:\tb 48 */\n/* 1c:\tcmpwi r3,4 */\n/* 20:\tbge 48 */\n/* 24:\tb 40 */\n/* 28:\tadd r3,r4,r5 */\n/* 2c:\tblr */\n/* 30:\tsubf r3,r5,r4 */\n/* 34:\tblr */\n/* 38:\tmullw r3,r4,r5 */\n/* 3c:\tblr */\n/* 40:\tand r3,r4,r5 */\n/* 44:\tblr */\n/* 48:\tli r3,0 */\n/* 4c:\tblr */\nvoid sw_op(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_op': conditional branch 'bge' has no reaching compare (cr0) in its block\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":28,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_op': conditional branch 'bge' has no reaching compare (cr0) in its block"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_op(s32 arg0, s32 arg1, s32 arg2) {\n switch (arg0) { /* irregular */\n case 0:\n return arg1 + arg2;\n case 1:\n return arg1 - arg2;\n case 2:\n return arg1 * arg2;\n case 3:\n return arg1 & arg2;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_op` — benchmark function synthetic:sw_op:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_op\n cmpwi r3,2\n beq .L38\n bge .L1c\n cmpwi r3,0\n beq .L28\n bge .L30\n b .L48\n.L1c:\n cmpwi r3,4\n bge .L48\n b .L40\n.L28:\n add r3,r4,r5\n blr\n.L30:\n subf r3,r5,r4\n blr\n.L38:\n mullw r3,r4,r5\n blr\n.L40:\n and r3,r4,r5\n blr\n.L48:\n li r3,0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_op # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_op` — benchmark function synthetic:sw_op:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_op:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,2\n 4:\tbeq 38 \n 8:\tbge 1c \n c:\tcmpwi r3,0\n 10:\tbeq 28 \n 14:\tbge 30 \n 18:\tb 48 \n 1c:\tcmpwi r3,4\n 20:\tbge 48 \n 24:\tb 40 \n 28:\tadd r3,r4,r5\n 2c:\tblr\n 30:\tsubf r3,r5,r4\n 34:\tblr\n 38:\tmullw r3,r4,r5\n 3c:\tblr\n 40:\tand r3,r4,r5\n 44:\tblr\n 48:\tli r3,0\n 4c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000050 sw_op\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_op\n\n\nContents of section .text:\n 0000 2c030002 41820034 40800014 2c030000 ,...A..4@...,...\n 0010 41820018 4080001c 48000030 2c030004 A...@...H..0,...\n 0020 40800028 4800001c 7c642a14 4e800020 @..(H...|d*.N.. \n 0030 7c652050 4e800020 7c6429d6 4e800020 |e PN.. |d).N.. \n 0040 7c832838 4e800020 38600000 4e800020 |.(8N.. 8`..N.. \nContents of section .mwcats.text:\n 0000 02000050 00000000 ...P.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_op # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_ret:agbcc","sym":"sw_ret","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","comparison-tree"],"loc":1,"refSource":"int sw_ret(int x){ switch(x){case 0:return 10;case 1:return 20;case 2:return 30;case 3:return 40;default:return -1;} }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_ret\n\t.type\t sw_ret,function\n\t.thumb_func\nsw_ret:\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x1\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr0, #0x2\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr0, #0x3\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tmov\tr0, #0xa\n\tb\t.L11\n.L5:\n\tmov\tr0, #0x14\n\tb\t.L11\n.L6:\n\tmov\tr0, #0x1e\n\tb\t.L11\n.L7:\n\tmov\tr0, #0x28\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_ret,.Lfe1-sw_ret\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 sw_ret(s32 a0) {\n switch (a0) {\n case 0:\n return 10;\n case 1:\n return 20;\n case 2:\n return 30;\n case 3:\n return 40;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":23,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_ret(s32 arg0) {\n switch (arg0) { /* irregular */\n case 0:\n return 0xA;\n case 1:\n return 0x14;\n case 2:\n return 0x1E;\n case 3:\n return 0x28;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":23,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_ret` — benchmark function synthetic:sw_ret:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_ret\n\t.type\t sw_ret,function\n\t.thumb_func\nsw_ret:\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x1\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr0, #0x2\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr0, #0x3\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tmov\tr0, #0xa\n\tb\t.L11\n.L5:\n\tmov\tr0, #0x14\n\tb\t.L11\n.L6:\n\tmov\tr0, #0x1e\n\tb\t.L11\n.L7:\n\tmov\tr0, #0x28\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_ret,.Lfe1-sw_ret\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_ret # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_ret` — benchmark function synthetic:sw_ret:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_ret:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_ret\n\t.type\t sw_ret,function\n\t.thumb_func\nsw_ret:\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x1\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr0, #0x2\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr0, #0x3\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tmov\tr0, #0xa\n\tb\t.L11\n.L5:\n\tmov\tr0, #0x14\n\tb\t.L11\n.L6:\n\tmov\tr0, #0x1e\n\tb\t.L11\n.L7:\n\tmov\tr0, #0x28\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_ret,.Lfe1-sw_ret\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_ret # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_ret:gcc2.7.2kmc","sym":"sw_ret","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["switch","comparison-tree"],"loc":1,"refSource":"int sw_ret(int x){ switch(x){case 0:return 10;case 1:return 20;case 2:return 30;case 3:return 40;default:return -1;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tbeq\ta0,v0,3c \n 8:\tslti\tv0,a0,2\n c:\tbeqzl\tv0,24 \n 10:\tli\tv0,2\n 14:\tbeqz\ta0,48 \n 18:\tli\tv0,10\n 1c:\tj\t48 \n 20:\tli\tv0,-1\n 24:\tbeq\ta0,v0,44 \n 28:\tli\tv0,3\n 2c:\tbeq\ta0,v0,48 \n 30:\tli\tv0,40\n 34:\tj\t48 \n 38:\tli\tv0,-1\n 3c:\tj\t48 \n 40:\tli\tv0,20\n 44:\tli\tv0,30\n 48:\tjr\tra\n 4c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-63d54cb61a8e4a30/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 sw_ret\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n00000034 R_MIPS_26 .text\n0000003c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020001 1082000d 28820002 50400005 $.......(...P@..\n 0010 24020002 1080000c 2402000a 08000012 $.......$.......\n 0020 2402ffff 10820007 24020003 10820006 $.......$.......\n 0030 24020028 08000012 2402ffff 08000012 $..(....$.......\n 0040 24020014 2402001e 03e00008 00000000 $...$...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_ret' — lift: cannot lift 'sw_ret': unmodelled control transfer 'beqzl' at 0xc — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tli\tv0,1 */\n/* 4:\tbeq\ta0,v0,3c */\n/* 8:\tslti\tv0,a0,2 */\n/* c:\tbeqzl\tv0,24 */\n/* 10:\tli\tv0,2 */\n/* 14:\tbeqz\ta0,48 */\n/* 18:\tli\tv0,10 */\n/* 1c:\tj\t48 */\n/* 20:\tli\tv0,-1 */\n/* 24:\tbeq\ta0,v0,44 */\n/* 28:\tli\tv0,3 */\n/* 2c:\tbeq\ta0,v0,48 */\n/* 30:\tli\tv0,40 */\n/* 34:\tj\t48 */\n/* 38:\tli\tv0,-1 */\n/* 3c:\tj\t48 */\n/* 40:\tli\tv0,20 */\n/* 44:\tli\tv0,30 */\n/* 48:\tjr\tra */\n/* 4c:\tnop */\nvoid sw_ret(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_ret': unmodelled control transfer 'beqzl' at 0xc — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":28,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_ret': unmodelled control transfer 'beqzl' at 0xc — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sw_ret(s32 arg0) {\n s32 var_v0;\n\n if (arg0 != 1) {\n if (arg0 >= 2) {\n if (arg0 != 2) {\n var_v0 = 0x28;\n if (arg0 != 3) {\n return -1;\n }\n /* Duplicate return node #11. Try simplifying control flow for better match */\n return var_v0;\n }\n var_v0 = 0x1E;\n /* Duplicate return node #11. Try simplifying control flow for better match */\n return var_v0;\n }\n var_v0 = 0xA;\n if (arg0 != 0) {\n return -1;\n }\n return var_v0;\n }\n return 0x14;\n}\n","score":18,"maxScore":25,"compileErrors":null,"breakdown":{"insert":5,"delete":5,"replace":4,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":24,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":18,"maxScore":25,"ratio":0.72,"kinds":{"insert":5,"delete":5,"replace":4,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_ret` — benchmark function synthetic:sw_ret:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_ret\n li\t$v0, 1\n beq\t$a0, $v0, .L3c\n slti\t$v0, $a0, 2\n beqzl\t$v0, .L24\n li\t$v0, 2\n beqz\t$a0, .L48\n li\t$v0, 10\n j\t.L48\n li\t$v0, -1\n.L24:\n beq\t$a0, $v0, .L44\n li\t$v0, 3\n beq\t$a0, $v0, .L48\n li\t$v0, 40\n j\t.L48\n li\t$v0, -1\n.L3c:\n j\t.L48\n li\t$v0, 20\n.L44:\n li\t$v0, 30\n.L48:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_ret # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_ret` — benchmark function synthetic:sw_ret:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_ret:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tbeq\ta0,v0,3c \n 8:\tslti\tv0,a0,2\n c:\tbeqzl\tv0,24 \n 10:\tli\tv0,2\n 14:\tbeqz\ta0,48 \n 18:\tli\tv0,10\n 1c:\tj\t48 \n 20:\tli\tv0,-1\n 24:\tbeq\ta0,v0,44 \n 28:\tli\tv0,3\n 2c:\tbeq\ta0,v0,48 \n 30:\tli\tv0,40\n 34:\tj\t48 \n 38:\tli\tv0,-1\n 3c:\tj\t48 \n 40:\tli\tv0,20\n 44:\tli\tv0,30\n 48:\tjr\tra\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-63d54cb61a8e4a30/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 sw_ret\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n00000034 R_MIPS_26 .text\n0000003c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020001 1082000d 28820002 50400005 $.......(...P@..\n 0010 24020002 1080000c 2402000a 08000012 $.......$.......\n 0020 2402ffff 10820007 24020003 10820006 $.......$.......\n 0030 24020028 08000012 2402ffff 08000012 $..(....$.......\n 0040 24020014 2402001e 03e00008 00000000 $...$...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_ret # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_ret:ido7.1","sym":"sw_ret","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["switch","comparison-tree"],"loc":1,"refSource":"int sw_ret(int x){ switch(x){case 0:return 10;case 1:return 20;case 2:return 30;case 3:return 40;default:return -1;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,28 \n 4:\tli\tat,1\n 8:\tbeq\ta0,at,30 \n c:\tli\tat,2\n 10:\tbeq\ta0,at,38 \n 14:\tli\tat,3\n 18:\tbeq\ta0,at,40 \n 1c:\tli\tv0,-1\n 20:\tb\t48 \n 24:\tnop\n 28:\tjr\tra\n 2c:\tli\tv0,10\n 30:\tjr\tra\n 34:\tli\tv0,20\n 38:\tjr\tra\n 3c:\tli\tv0,30\n 40:\tjr\tra\n 44:\tli\tv0,40\n 48:\tjr\tra\n 4c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t00000050 sw_ret\n\n\nContents of section .text:\n 0000 10800009 24010001 10810009 24010002 ....$.......$...\n 0010 10810009 24010003 10810009 2402ffff ....$.......$...\n 0020 10000009 00000000 03e00008 2402000a ............$...\n 0030 03e00008 24020014 03e00008 2402001e ....$.......$...\n 0040 03e00008 24020028 03e00008 00000000 ....$..(........\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000014 00000004 000001b8 p...............\n 0010 00000005 000002fc 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000038 00000264 ....... ...8...d\n 0040 00000008 0000029c 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 08080100 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000050 20200001 00000001 .......P ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 33643534 63623631 61386534 ef-63d54cb61a8e4\n 0130 6133302f 7265662e 63007377 5f726574 a30/ref.c.sw_ret\n 0140 00000000 73775f72 65740000 00000000 ....sw_ret......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000014 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000003 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sw_ret(u32 a0) {\n switch (a0) {\n case 0:\n return 10;\n case 1:\n return 20;\n case 2:\n return 30;\n case 3:\n return 40;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_ret(s32 arg0) {\n switch (arg0) { /* irregular */\n case 0:\n return 0xA;\n case 1:\n return 0x14;\n case 2:\n return 0x1E;\n case 3:\n return 0x28;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_ret` — benchmark function synthetic:sw_ret:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_ret\n beqz\t$a0, .L28\n li\t$at, 1\n beq\t$a0, $at, .L30\n li\t$at, 2\n beq\t$a0, $at, .L38\n li\t$at, 3\n beq\t$a0, $at, .L40\n li\t$v0, -1\n b\t.L48\n nop\n.L28:\n jr\t$ra\n li\t$v0, 10\n.L30:\n jr\t$ra\n li\t$v0, 20\n.L38:\n jr\t$ra\n li\t$v0, 30\n.L40:\n jr\t$ra\n li\t$v0, 40\n.L48:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_ret # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_ret` — benchmark function synthetic:sw_ret:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_ret:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,28 \n 4:\tli\tat,1\n 8:\tbeq\ta0,at,30 \n c:\tli\tat,2\n 10:\tbeq\ta0,at,38 \n 14:\tli\tat,3\n 18:\tbeq\ta0,at,40 \n 1c:\tli\tv0,-1\n 20:\tb\t48 \n 24:\tnop\n 28:\tjr\tra\n 2c:\tli\tv0,10\n 30:\tjr\tra\n 34:\tli\tv0,20\n 38:\tjr\tra\n 3c:\tli\tv0,30\n 40:\tjr\tra\n 44:\tli\tv0,40\n 48:\tjr\tra\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t00000050 sw_ret\n\n\nContents of section .text:\n 0000 10800009 24010001 10810009 24010002 ....$.......$...\n 0010 10810009 24010003 10810009 2402ffff ....$.......$...\n 0020 10000009 00000000 03e00008 2402000a ............$...\n 0030 03e00008 24020014 03e00008 2402001e ....$.......$...\n 0040 03e00008 24020028 03e00008 00000000 ....$..(........\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000014 00000004 000001b8 p...............\n 0010 00000005 000002fc 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000038 00000264 ....... ...8...d\n 0040 00000008 0000029c 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 08080100 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000050 20200001 00000001 .......P ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 33643534 63623631 61386534 ef-63d54cb61a8e4\n 0130 6133302f 7265662e 63007377 5f726574 a30/ref.c.sw_ret\n 0140 00000000 73775f72 65740000 00000000 ....sw_ret......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000014 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000003 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_ret # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_ret:mwcc_242_81","sym":"sw_ret","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["switch","comparison-tree"],"loc":1,"refSource":"int sw_ret(int x){ switch(x){case 0:return 10;case 1:return 20;case 2:return 30;case 3:return 40;default:return -1;} }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,2\n 4:\tbeq 38 \n 8:\tbge 1c \n c:\tcmpwi r3,0\n 10:\tbeq 28 \n 14:\tbge 30 \n 18:\tb 48 \n 1c:\tcmpwi r3,4\n 20:\tbge 48 \n 24:\tb 40 \n 28:\tli r3,10\n 2c:\tblr\n 30:\tli r3,20\n 34:\tblr\n 38:\tli r3,30\n 3c:\tblr\n 40:\tli r3,40\n 44:\tblr\n 48:\tli r3,-1\n 4c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000050 sw_ret\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_ret\n\n\nContents of section .text:\n 0000 2c030002 41820034 40800014 2c030000 ,...A..4@...,...\n 0010 41820018 4080001c 48000030 2c030004 A...@...H..0,...\n 0020 40800028 4800001c 3860000a 4e800020 @..(H...8`..N.. \n 0030 38600014 4e800020 3860001e 4e800020 8`..N.. 8`..N.. \n 0040 38600028 4e800020 3860ffff 4e800020 8`.(N.. 8`..N.. \nContents of section .mwcats.text:\n 0000 02000050 00000000 ...P.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_ret' — lift: cannot lift 'sw_ret': conditional branch 'bge' has no reaching compare (cr0) in its block */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tcmpwi r3,2 */\n/* 4:\tbeq 38 */\n/* 8:\tbge 1c */\n/* c:\tcmpwi r3,0 */\n/* 10:\tbeq 28 */\n/* 14:\tbge 30 */\n/* 18:\tb 48 */\n/* 1c:\tcmpwi r3,4 */\n/* 20:\tbge 48 */\n/* 24:\tb 40 */\n/* 28:\tli r3,10 */\n/* 2c:\tblr */\n/* 30:\tli r3,20 */\n/* 34:\tblr */\n/* 38:\tli r3,30 */\n/* 3c:\tblr */\n/* 40:\tli r3,40 */\n/* 44:\tblr */\n/* 48:\tli r3,-1 */\n/* 4c:\tblr */\nvoid sw_ret(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_ret': conditional branch 'bge' has no reaching compare (cr0) in its block\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":28,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_ret': conditional branch 'bge' has no reaching compare (cr0) in its block"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_ret(s32 arg0) {\n switch (arg0) { /* irregular */\n case 0:\n return 0xA;\n case 1:\n return 0x14;\n case 2:\n return 0x1E;\n case 3:\n return 0x28;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_ret` — benchmark function synthetic:sw_ret:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_ret\n cmpwi r3,2\n beq .L38\n bge .L1c\n cmpwi r3,0\n beq .L28\n bge .L30\n b .L48\n.L1c:\n cmpwi r3,4\n bge .L48\n b .L40\n.L28:\n li r3,10\n blr\n.L30:\n li r3,20\n blr\n.L38:\n li r3,30\n blr\n.L40:\n li r3,40\n blr\n.L48:\n li r3,-1\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_ret # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_ret` — benchmark function synthetic:sw_ret:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_ret:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,2\n 4:\tbeq 38 \n 8:\tbge 1c \n c:\tcmpwi r3,0\n 10:\tbeq 28 \n 14:\tbge 30 \n 18:\tb 48 \n 1c:\tcmpwi r3,4\n 20:\tbge 48 \n 24:\tb 40 \n 28:\tli r3,10\n 2c:\tblr\n 30:\tli r3,20\n 34:\tblr\n 38:\tli r3,30\n 3c:\tblr\n 40:\tli r3,40\n 44:\tblr\n 48:\tli r3,-1\n 4c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000050 sw_ret\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_ret\n\n\nContents of section .text:\n 0000 2c030002 41820034 40800014 2c030000 ,...A..4@...,...\n 0010 41820018 4080001c 48000030 2c030004 A...@...H..0,...\n 0020 40800028 4800001c 3860000a 4e800020 @..(H...8`..N.. \n 0030 38600014 4e800020 3860001e 4e800020 8`..N.. 8`..N.. \n 0040 38600028 4e800020 3860ffff 4e800020 8`.(N.. 8`..N.. \nContents of section .mwcats.text:\n 0000 02000050 00000000 ...P.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_ret # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_sparse:agbcc","sym":"sw_sparse","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","sparse"],"loc":1,"refSource":"int sw_sparse(int x){ switch(x){case 1:return 1;case 10:return 2;case 100:return 3;case 1000:return 4;default:return 0;} }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_sparse\n\t.type\t sw_sparse,function\n\t.thumb_func\nsw_sparse:\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0xa\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr1, #0xa\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr1, #0x64\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0xfa\n\tlsl\tr0, r0, #0x2\n\tcmp\tr1, r0\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tmov\tr0, #0x1\n\tb\t.L11\n.L5:\n\tmov\tr0, #0x2\n\tb\t.L11\n.L6:\n\tmov\tr0, #0x3\n\tb\t.L11\n.L7:\n\tmov\tr0, #0x4\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_sparse,.Lfe1-sw_sparse\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 sw_sparse(s32 a0) {\n switch (a0) {\n case 1:\n return 1;\n case 10:\n return 2;\n case 100:\n return 3;\n case 1000:\n return 4;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":25,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_sparse(s32 arg0) {\n switch (arg0) { /* irregular */\n case 0x1:\n return 1;\n case 0xA:\n return 2;\n case 0x64:\n return 3;\n case 0x3E8:\n return 4;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":25,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_sparse` — benchmark function synthetic:sw_sparse:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_sparse\n\t.type\t sw_sparse,function\n\t.thumb_func\nsw_sparse:\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0xa\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr1, #0xa\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr1, #0x64\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0xfa\n\tlsl\tr0, r0, #0x2\n\tcmp\tr1, r0\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tmov\tr0, #0x1\n\tb\t.L11\n.L5:\n\tmov\tr0, #0x2\n\tb\t.L11\n.L6:\n\tmov\tr0, #0x3\n\tb\t.L11\n.L7:\n\tmov\tr0, #0x4\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_sparse,.Lfe1-sw_sparse\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_sparse # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_sparse` — benchmark function synthetic:sw_sparse:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_sparse:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_sparse\n\t.type\t sw_sparse,function\n\t.thumb_func\nsw_sparse:\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0xa\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr1, #0xa\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr1, #0x64\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0xfa\n\tlsl\tr0, r0, #0x2\n\tcmp\tr1, r0\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tmov\tr0, #0x1\n\tb\t.L11\n.L5:\n\tmov\tr0, #0x2\n\tb\t.L11\n.L6:\n\tmov\tr0, #0x3\n\tb\t.L11\n.L7:\n\tmov\tr0, #0x4\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_sparse,.Lfe1-sw_sparse\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_sparse # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_sparse:gcc2.7.2kmc","sym":"sw_sparse","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["switch","sparse"],"loc":1,"refSource":"int sw_sparse(int x){ switch(x){case 1:return 1;case 10:return 2;case 100:return 3;case 1000:return 4;default:return 0;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,10\n 4:\tbeq\ta0,v0,40 \n 8:\tslti\tv0,a0,11\n c:\tbeqz\tv0,24 \n 10:\tli\tv0,1\n 14:\tbeq\ta0,v0,4c \n 18:\tnop\n 1c:\tj\t4c \n 20:\tmove\tv0,zero\n 24:\tli\tv0,100\n 28:\tbeq\ta0,v0,48 \n 2c:\tli\tv0,1000\n 30:\tbeq\ta0,v0,4c \n 34:\tli\tv0,4\n 38:\tj\t4c \n 3c:\tmove\tv0,zero\n 40:\tj\t4c \n 44:\tli\tv0,2\n 48:\tli\tv0,3\n 4c:\tjr\tra\n 50:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a8faf8a265802921/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 sw_sparse\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n00000038 R_MIPS_26 .text\n00000040 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 2402000a 1082000e 2882000b 10400005 $.......(....@..\n 0010 24020001 1082000d 00000000 08000013 $...............\n 0020 00001021 24020064 10820007 240203e8 ...!$..d....$...\n 0030 10820006 24020004 08000013 00001021 ....$..........!\n 0040 08000013 24020002 24020003 03e00008 ....$...$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 sw_sparse(u32 a0) {\n s32 v0;\n if (a0 == 10) {\n v0 = 2;\n } else {\n if (a0 < 11 == 0) {\n if (a0 == 100) {\n v0 = 3;\n } else {\n if (a0 == 1000) {\n v0 = 4;\n } else {\n v0 = 0;\n }\n }\n } else {\n v0 = a0 == 1;\n }\n }\n return v0;\n}\n","score":19,"maxScore":24,"compileErrors":null,"breakdown":{"insert":3,"delete":6,"replace":7,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":21,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sw_sparse(s32 arg0) {\n s32 var_v0;\n\n if (arg0 != 0xA) {\n var_v0 = 1;\n if (arg0 < 0xB) {\n if (arg0 != 1) {\n return 0;\n }\n /* Duplicate return node #9. Try simplifying control flow for better match */\n return var_v0;\n }\n if (arg0 != 0x64) {\n var_v0 = 4;\n if (arg0 != 0x3E8) {\n return 0;\n }\n /* Duplicate return node #9. Try simplifying control flow for better match */\n return var_v0;\n }\n var_v0 = 3;\n return var_v0;\n }\n return 2;\n}\n","score":15,"maxScore":22,"compileErrors":null,"breakdown":{"insert":1,"delete":4,"replace":4,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":24,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":15,"maxScore":22,"ratio":0.6818181818181818,"kinds":{"insert":1,"delete":4,"replace":4,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_sparse` — benchmark function synthetic:sw_sparse:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_sparse\n li\t$v0, 10\n beq\t$a0, $v0, .L40\n slti\t$v0, $a0, 11\n beqz\t$v0, .L24\n li\t$v0, 1\n beq\t$a0, $v0, .L4c\n nop\n j\t.L4c\n move\t$v0, $zero\n.L24:\n li\t$v0, 100\n beq\t$a0, $v0, .L48\n li\t$v0, 1000\n beq\t$a0, $v0, .L4c\n li\t$v0, 4\n j\t.L4c\n move\t$v0, $zero\n.L40:\n j\t.L4c\n li\t$v0, 2\n.L48:\n li\t$v0, 3\n.L4c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_sparse # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_sparse` — benchmark function synthetic:sw_sparse:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_sparse:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,10\n 4:\tbeq\ta0,v0,40 \n 8:\tslti\tv0,a0,11\n c:\tbeqz\tv0,24 \n 10:\tli\tv0,1\n 14:\tbeq\ta0,v0,4c \n 18:\tnop\n 1c:\tj\t4c \n 20:\tmove\tv0,zero\n 24:\tli\tv0,100\n 28:\tbeq\ta0,v0,48 \n 2c:\tli\tv0,1000\n 30:\tbeq\ta0,v0,4c \n 34:\tli\tv0,4\n 38:\tj\t4c \n 3c:\tmove\tv0,zero\n 40:\tj\t4c \n 44:\tli\tv0,2\n 48:\tli\tv0,3\n 4c:\tjr\tra\n 50:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a8faf8a265802921/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 sw_sparse\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n00000038 R_MIPS_26 .text\n00000040 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 2402000a 1082000e 2882000b 10400005 $.......(....@..\n 0010 24020001 1082000d 00000000 08000013 $...............\n 0020 00001021 24020064 10820007 240203e8 ...!$..d....$...\n 0030 10820006 24020004 08000013 00001021 ....$..........!\n 0040 08000013 24020002 24020003 03e00008 ....$...$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_sparse # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_sparse:ido7.1","sym":"sw_sparse","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["switch","sparse"],"loc":1,"refSource":"int sw_sparse(int x){ switch(x){case 1:return 1;case 10:return 2;case 100:return 3;case 1000:return 4;default:return 0;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,1\n 4:\tbeq\ta0,at,2c \n 8:\tli\tat,10\n c:\tbeq\ta0,at,34 \n 10:\tli\tat,100\n 14:\tbeq\ta0,at,3c \n 18:\tli\tat,1000\n 1c:\tbeq\ta0,at,44 \n 20:\tmove\tv0,zero\n 24:\tb\t4c \n 28:\tnop\n 2c:\tjr\tra\n 30:\tli\tv0,1\n 34:\tjr\tra\n 38:\tli\tv0,2\n 3c:\tjr\tra\n 40:\tli\tv0,3\n 44:\tjr\tra\n 48:\tli\tv0,4\n 4c:\tjr\tra\n 50:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000054 sw_sparse\n\n\nContents of section .text:\n 0000 24010001 10810009 2401000a 10810009 $.......$.......\n 0010 24010064 10810009 240103e8 10810009 $..d....$.......\n 0020 00001025 10000009 00000000 03e00008 ...%............\n 0030 24020001 03e00008 24020002 03e00008 $.......$.......\n 0040 24020003 03e00008 24020004 03e00008 $.......$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000015 00000004 000001c8 p...............\n 0010 00000005 00000310 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000038 00000274 .......0...8...t\n 0040 0000000c 000002ac 00000001 000002b8 ................\n 0050 00000000 00000000 00000001 00000300 ................\n 0060 08080200 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000054 20200001 00000001 .......T ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 38666166 38613236 35383032 ef-a8faf8a265802\n 0130 3932312f 7265662e 63007377 5f737061 921/ref.c.sw_spa\n 0140 72736500 73775f73 70617273 65000000 rse.sw_sparse...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000015 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000003 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sw_sparse(u32 a0) {\n switch (a0) {\n case 1:\n return 1;\n case 10:\n return 2;\n case 100:\n return 3;\n case 1000:\n return 4;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":21,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_sparse(s32 arg0) {\n switch (arg0) { /* irregular */\n case 0x1:\n return 1;\n case 0xA:\n return 2;\n case 0x64:\n return 3;\n case 0x3E8:\n return 4;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":21,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_sparse` — benchmark function synthetic:sw_sparse:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_sparse\n li\t$at, 1\n beq\t$a0, $at, .L2c\n li\t$at, 10\n beq\t$a0, $at, .L34\n li\t$at, 100\n beq\t$a0, $at, .L3c\n li\t$at, 1000\n beq\t$a0, $at, .L44\n move\t$v0, $zero\n b\t.L4c\n nop\n.L2c:\n jr\t$ra\n li\t$v0, 1\n.L34:\n jr\t$ra\n li\t$v0, 2\n.L3c:\n jr\t$ra\n li\t$v0, 3\n.L44:\n jr\t$ra\n li\t$v0, 4\n.L4c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_sparse # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_sparse` — benchmark function synthetic:sw_sparse:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_sparse:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,1\n 4:\tbeq\ta0,at,2c \n 8:\tli\tat,10\n c:\tbeq\ta0,at,34 \n 10:\tli\tat,100\n 14:\tbeq\ta0,at,3c \n 18:\tli\tat,1000\n 1c:\tbeq\ta0,at,44 \n 20:\tmove\tv0,zero\n 24:\tb\t4c \n 28:\tnop\n 2c:\tjr\tra\n 30:\tli\tv0,1\n 34:\tjr\tra\n 38:\tli\tv0,2\n 3c:\tjr\tra\n 40:\tli\tv0,3\n 44:\tjr\tra\n 48:\tli\tv0,4\n 4c:\tjr\tra\n 50:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000054 sw_sparse\n\n\nContents of section .text:\n 0000 24010001 10810009 2401000a 10810009 $.......$.......\n 0010 24010064 10810009 240103e8 10810009 $..d....$.......\n 0020 00001025 10000009 00000000 03e00008 ...%............\n 0030 24020001 03e00008 24020002 03e00008 $.......$.......\n 0040 24020003 03e00008 24020004 03e00008 $.......$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000015 00000004 000001c8 p...............\n 0010 00000005 00000310 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000038 00000274 .......0...8...t\n 0040 0000000c 000002ac 00000001 000002b8 ................\n 0050 00000000 00000000 00000001 00000300 ................\n 0060 08080200 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000054 20200001 00000001 .......T ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 38666166 38613236 35383032 ef-a8faf8a265802\n 0130 3932312f 7265662e 63007377 5f737061 921/ref.c.sw_spa\n 0140 72736500 73775f73 70617273 65000000 rse.sw_sparse...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000015 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000003 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_sparse # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_sparse:mwcc_242_81","sym":"sw_sparse","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["switch","sparse"],"loc":1,"refSource":"int sw_sparse(int x){ switch(x){case 1:return 1;case 10:return 2;case 100:return 3;case 1000:return 4;default:return 0;} }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,100\n 4:\tbeq 40 \n 8:\tbge 24 \n c:\tcmpwi r3,10\n 10:\tbeq 38 \n 14:\tbge 50 \n 18:\tcmpwi r3,1\n 1c:\tbeq 30 \n 20:\tb 50 \n 24:\tcmpwi r3,1000\n 28:\tbeq 48 \n 2c:\tb 50 \n 30:\tli r3,1\n 34:\tblr\n 38:\tli r3,2\n 3c:\tblr\n 40:\tli r3,3\n 44:\tblr\n 48:\tli r3,4\n 4c:\tblr\n 50:\tli r3,0\n 54:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000058 sw_sparse\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_sparse\n\n\nContents of section .text:\n 0000 2c030064 4182003c 4080001c 2c03000a ,..dA..<@...,...\n 0010 41820028 4080003c 2c030001 41820014 A..(@..<,...A...\n 0020 48000030 2c0303e8 41820020 48000024 H..0,...A.. H..$\n 0030 38600001 4e800020 38600002 4e800020 8`..N.. 8`..N.. \n 0040 38600003 4e800020 38600004 4e800020 8`..N.. 8`..N.. \n 0050 38600000 4e800020 8`..N.. \nContents of section .mwcats.text:\n 0000 02000058 00000000 ...X.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_sparse' — lift: cannot lift 'sw_sparse': conditional branch 'bge' has no reaching compare (cr0) in its block */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tcmpwi r3,100 */\n/* 4:\tbeq 40 */\n/* 8:\tbge 24 */\n/* c:\tcmpwi r3,10 */\n/* 10:\tbeq 38 */\n/* 14:\tbge 50 */\n/* 18:\tcmpwi r3,1 */\n/* 1c:\tbeq 30 */\n/* 20:\tb 50 */\n/* 24:\tcmpwi r3,1000 */\n/* 28:\tbeq 48 */\n/* 2c:\tb 50 */\n/* 30:\tli r3,1 */\n/* 34:\tblr */\n/* 38:\tli r3,2 */\n/* 3c:\tblr */\n/* 40:\tli r3,3 */\n/* 44:\tblr */\n/* 48:\tli r3,4 */\n/* 4c:\tblr */\n/* 50:\tli r3,0 */\n/* 54:\tblr */\nvoid sw_sparse(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_sparse': conditional branch 'bge' has no reaching compare (cr0) in its block\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":30,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_sparse': conditional branch 'bge' has no reaching compare (cr0) in its block"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_sparse(s32 arg0) {\n switch (arg0) { /* irregular */\n case 0x1:\n return 1;\n case 0xA:\n return 2;\n case 0x64:\n return 3;\n case 0x3E8:\n return 4;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_sparse` — benchmark function synthetic:sw_sparse:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_sparse\n cmpwi r3,100\n beq .L40\n bge .L24\n cmpwi r3,10\n beq .L38\n bge .L50\n cmpwi r3,1\n beq .L30\n b .L50\n.L24:\n cmpwi r3,1000\n beq .L48\n b .L50\n.L30:\n li r3,1\n blr\n.L38:\n li r3,2\n blr\n.L40:\n li r3,3\n blr\n.L48:\n li r3,4\n blr\n.L50:\n li r3,0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_sparse # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_sparse` — benchmark function synthetic:sw_sparse:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_sparse:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,100\n 4:\tbeq 40 \n 8:\tbge 24 \n c:\tcmpwi r3,10\n 10:\tbeq 38 \n 14:\tbge 50 \n 18:\tcmpwi r3,1\n 1c:\tbeq 30 \n 20:\tb 50 \n 24:\tcmpwi r3,1000\n 28:\tbeq 48 \n 2c:\tb 50 \n 30:\tli r3,1\n 34:\tblr\n 38:\tli r3,2\n 3c:\tblr\n 40:\tli r3,3\n 44:\tblr\n 48:\tli r3,4\n 4c:\tblr\n 50:\tli r3,0\n 54:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000058 sw_sparse\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_sparse\n\n\nContents of section .text:\n 0000 2c030064 4182003c 4080001c 2c03000a ,..dA..<@...,...\n 0010 41820028 4080003c 2c030001 41820014 A..(@..<,...A...\n 0020 48000030 2c0303e8 41820020 48000024 H..0,...A.. H..$\n 0030 38600001 4e800020 38600002 4e800020 8`..N.. 8`..N.. \n 0040 38600003 4e800020 38600004 4e800020 8`..N.. 8`..N.. \n 0050 38600000 4e800020 8`..N.. \nContents of section .mwcats.text:\n 0000 02000058 00000000 ...X.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_sparse # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_void:agbcc","sym":"sw_void","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","void","memory"],"loc":1,"refSource":"void sw_void(int x,int *p){ switch(x){case 0:*p=1;break;case 1:*p=2;break;default:*p=0;} }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_void\n\t.type\t sw_void,function\n\t.thumb_func\nsw_void:\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L4:\n\tmov\tr0, #0x1\n\tb\t.L8\n.L5:\n\tmov\tr0, #0x2\n.L8:\n\tstr\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_void,.Lfe1-sw_void\n","ctx":"void sw_void(int,int*);","proto":{"sw_void":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void sw_void(u32 a0, s32 * a1) {\n s32 v0;\n switch (a0) {\n case 0:\n v0 = 1;\n break;\n case 1:\n v0 = 2;\n break;\n default:\n v0 = 0;\n }\n *a1 = v0;\n return;\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void sw_void(s32 arg0, s32 *arg1) {\n s32 var_r0;\n\n if (arg0 != 0) {\n if (arg0 != 1) {\n var_r0 = 0;\n } else {\n var_r0 = 2;\n }\n } else {\n var_r0 = 1;\n }\n *arg1 = var_r0;\n}\n","score":9,"maxScore":12,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":0,"opMismatch":1,"argMismatch":5},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_void` — benchmark function synthetic:sw_void:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_void\n\t.type\t sw_void,function\n\t.thumb_func\nsw_void:\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L4:\n\tmov\tr0, #0x1\n\tb\t.L8\n.L5:\n\tmov\tr0, #0x2\n.L8:\n\tstr\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_void,.Lfe1-sw_void\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid sw_void(int,int*);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_void # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_void` — benchmark function synthetic:sw_void:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_void:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_void\n\t.type\t sw_void,function\n\t.thumb_func\nsw_void:\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L4:\n\tmov\tr0, #0x1\n\tb\t.L8\n.L5:\n\tmov\tr0, #0x2\n.L8:\n\tstr\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_void,.Lfe1-sw_void\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sw_void\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_void # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_void:gcc2.7.2kmc","sym":"sw_void","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["switch","void","memory"],"loc":1,"refSource":"void sw_void(int x,int *p){ switch(x){case 0:*p=1;break;case 1:*p=2;break;default:*p=0;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,18 \n 4:\tli\tv0,1\n 8:\tbeq\ta0,v0,20 \n c:\tli\tv0,2\n 10:\tj\t24 \n 14:\tsw\tzero,0(a1)\n 18:\tj\t24 \n 1c:\tsw\tv0,0(a1)\n 20:\tsw\tv0,0(a1)\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\n","ctx":"void sw_void(int,int*);","proto":{"sw_void":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d63e783ff13c22bb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c sw_void\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 .text\n00000018 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 10800005 24020001 10820005 24020002 ....$.......$...\n 0010 08000009 aca00000 08000009 aca20000 ................\n 0020 aca20000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void sw_void(u32 a0, s32 * a1) {\n switch (a0) {\n case 0:\n *a1 = 1;\n break;\n case 1:\n *a1 = 2;\n break;\n default:\n *a1 = 0;\n }\n return;\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void sw_void(s32 arg0, s32 *arg1) {\n if (arg0 != 0) {\n if (arg0 != 1) {\n *arg1 = 0;\n return;\n }\n *arg1 = 2;\n return;\n }\n *arg1 = 1;\n}\n","score":2,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_void` — benchmark function synthetic:sw_void:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_void\n beqz\t$a0, .L18\n li\t$v0, 1\n beq\t$a0, $v0, .L20\n li\t$v0, 2\n j\t.L24\n sw\t$zero, 0($a1)\n.L18:\n j\t.L24\n sw\t$v0, 0($a1)\n.L20:\n sw\t$v0, 0($a1)\n.L24:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid sw_void(int,int*);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_void # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_void` — benchmark function synthetic:sw_void:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_void:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,18 \n 4:\tli\tv0,1\n 8:\tbeq\ta0,v0,20 \n c:\tli\tv0,2\n 10:\tj\t24 \n 14:\tsw\tzero,0(a1)\n 18:\tj\t24 \n 1c:\tsw\tv0,0(a1)\n 20:\tsw\tv0,0(a1)\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d63e783ff13c22bb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c sw_void\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 .text\n00000018 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 10800005 24020001 10820005 24020002 ....$.......$...\n 0010 08000009 aca00000 08000009 aca20000 ................\n 0020 aca20000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sw_void\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_void # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_void:ido7.1","sym":"sw_void","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["switch","void","memory"],"loc":1,"refSource":"void sw_void(int x,int *p){ switch(x){case 0:*p=1;break;case 1:*p=2;break;default:*p=0;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,1c \n 4:\tli\tt6,1\n 8:\tli\tat,1\n c:\tbeq\ta0,at,24 \n 10:\tli\tt7,2\n 14:\tb\t30 \n 18:\tsw\tzero,0(a1)\n 1c:\tjr\tra\n 20:\tsw\tt6,0(a1)\n 24:\tjr\tra\n 28:\tsw\tt7,0(a1)\n 2c:\tsw\tzero,0(a1)\n 30:\tjr\tra\n 34:\tnop\n\t...\n","ctx":"void sw_void(int,int*);","proto":{"sw_void":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000038 sw_void\n\n\nContents of section .text:\n 0000 10800006 240e0001 24010001 10810005 ....$...$.......\n 0010 240f0002 10000006 aca00000 03e00008 $...............\n 0020 acae0000 03e00008 acaf0000 aca00000 ................\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8000c032 00000000 . .........2....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c032 00000000 00000000 00000000 ...2............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000e 00000004 000001a8 p...............\n 0010 00000005 000002ec 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000038 00000254 ...........8...T\n 0040 00000008 0000028c 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 08040000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000038 20200001 00000001 .......8 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 36336537 38336666 31336332 ef-d63e783ff13c2\n 0130 3262622f 7265662e 63007377 5f766f69 2bb/ref.c.sw_voi\n 0140 64000000 73775f76 6f696400 00000000 d...sw_void.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000e 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void sw_void(u32 a0, s32 * a1) {\n switch (a0) {\n case 0:\n *a1 = 1;\n return;\n case 1:\n *a1 = 2;\n return;\n default:\n *a1 = 0;\n return;\n }\n}\n","score":0,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void sw_void(s32 arg0, s32 *arg1) {\n switch (arg0) { /* irregular */\n case 0:\n *arg1 = 1;\n return;\n case 1:\n *arg1 = 2;\n return;\n default:\n *arg1 = 0;\n return;\n }\n}\n","score":0,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_void` — benchmark function synthetic:sw_void:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_void\n beqz\t$a0, .L1c\n li\t$t6, 1\n li\t$at, 1\n beq\t$a0, $at, .L24\n li\t$t7, 2\n b\t.L30\n sw\t$zero, 0($a1)\n.L1c:\n jr\t$ra\n sw\t$t6, 0($a1)\n.L24:\n jr\t$ra\n sw\t$t7, 0($a1)\n sw\t$zero, 0($a1)\n.L30:\n jr\t$ra\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid sw_void(int,int*);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_void # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_void` — benchmark function synthetic:sw_void:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_void:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,1c \n 4:\tli\tt6,1\n 8:\tli\tat,1\n c:\tbeq\ta0,at,24 \n 10:\tli\tt7,2\n 14:\tb\t30 \n 18:\tsw\tzero,0(a1)\n 1c:\tjr\tra\n 20:\tsw\tt6,0(a1)\n 24:\tjr\tra\n 28:\tsw\tt7,0(a1)\n 2c:\tsw\tzero,0(a1)\n 30:\tjr\tra\n 34:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000038 sw_void\n\n\nContents of section .text:\n 0000 10800006 240e0001 24010001 10810005 ....$...$.......\n 0010 240f0002 10000006 aca00000 03e00008 $...............\n 0020 acae0000 03e00008 acaf0000 aca00000 ................\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8000c032 00000000 . .........2....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c032 00000000 00000000 00000000 ...2............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000e 00000004 000001a8 p...............\n 0010 00000005 000002ec 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000038 00000254 ...........8...T\n 0040 00000008 0000028c 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 08040000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000038 20200001 00000001 .......8 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 36336537 38336666 31336332 ef-d63e783ff13c2\n 0130 3262622f 7265662e 63007377 5f766f69 2bb/ref.c.sw_voi\n 0140 64000000 73775f76 6f696400 00000000 d...sw_void.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000e 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sw_void\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_void # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_void:mwcc_242_81","sym":"sw_void","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["switch","void","memory"],"loc":1,"refSource":"void sw_void(int x,int *p){ switch(x){case 0:*p=1;break;case 1:*p=2;break;default:*p=0;} }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,1\n 4:\tbeq 24 \n 8:\tbge 30 \n c:\tcmpwi r3,0\n 10:\tbge 18 \n 14:\tb 30 \n 18:\tli r0,1\n 1c:\tstw r0,0(r4)\n 20:\tblr\n 24:\tli r0,2\n 28:\tstw r0,0(r4)\n 2c:\tblr\n 30:\tli r0,0\n 34:\tstw r0,0(r4)\n 38:\tblr\n","ctx":"void sw_void(int,int*);","proto":{"sw_void":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000003c sw_void\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_void\n\n\nContents of section .text:\n 0000 2c030001 41820020 40800028 2c030000 ,...A.. @..(,...\n 0010 40800008 4800001c 38000001 90040000 @...H...8.......\n 0020 4e800020 38000002 90040000 4e800020 N.. 8.......N.. \n 0030 38000000 90040000 4e800020 8.......N.. \nContents of section .mwcats.text:\n 0000 0200003c 00000000 ...<.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_void' — lift: cannot lift 'sw_void': conditional branch 'bge' has no reaching compare (cr0) in its block */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tcmpwi r3,1 */\n/* 4:\tbeq 24 */\n/* 8:\tbge 30 */\n/* c:\tcmpwi r3,0 */\n/* 10:\tbge 18 */\n/* 14:\tb 30 */\n/* 18:\tli r0,1 */\n/* 1c:\tstw r0,0(r4) */\n/* 20:\tblr */\n/* 24:\tli r0,2 */\n/* 28:\tstw r0,0(r4) */\n/* 2c:\tblr */\n/* 30:\tli r0,0 */\n/* 34:\tstw r0,0(r4) */\n/* 38:\tblr */\nvoid sw_void(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_void': conditional branch 'bge' has no reaching compare (cr0) in its block\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_void': conditional branch 'bge' has no reaching compare (cr0) in its block"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void sw_void(s32 arg0, s32 *arg1) {\n switch (arg0) { /* irregular */\n case 0:\n *arg1 = 1;\n return;\n case 1:\n *arg1 = 2;\n return;\n default:\n *arg1 = 0;\n return;\n }\n}\n","score":0,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_void` — benchmark function synthetic:sw_void:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_void\n cmpwi r3,1\n beq .L24\n bge .L30\n cmpwi r3,0\n bge .L18\n b .L30\n.L18:\n li r0,1\n stw r0,0(r4)\n blr\n.L24:\n li r0,2\n stw r0,0(r4)\n blr\n.L30:\n li r0,0\n stw r0,0(r4)\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid sw_void(int,int*);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_void # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_void` — benchmark function synthetic:sw_void:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_void:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,1\n 4:\tbeq 24 \n 8:\tbge 30 \n c:\tcmpwi r3,0\n 10:\tbge 18 \n 14:\tb 30 \n 18:\tli r0,1\n 1c:\tstw r0,0(r4)\n 20:\tblr\n 24:\tli r0,2\n 28:\tstw r0,0(r4)\n 2c:\tblr\n 30:\tli r0,0\n 34:\tstw r0,0(r4)\n 38:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000003c sw_void\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_void\n\n\nContents of section .text:\n 0000 2c030001 41820020 40800028 2c030000 ,...A.. @..(,...\n 0010 40800008 4800001c 38000001 90040000 @...H...8.......\n 0020 4e800020 38000002 90040000 4e800020 N.. 8.......N.. \n 0030 38000000 90040000 4e800020 8.......N.. \nContents of section .mwcats.text:\n 0000 0200003c 00000000 ...<.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sw_void\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_void # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:swapp:agbcc","sym":"swapp","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","store","load"],"loc":1,"refSource":"void swapp(int *a,int *b){ int t=*a;*a=*b;*b=t; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tswapp\n\t.type\t swapp,function\n\t.thumb_func\nswapp:\n\tldr\tr3, [r0]\n\tldr\tr2, [r1]\n\tstr\tr2, [r0]\n\tstr\tr3, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t swapp,.Lfe1-swapp\n","ctx":"void swapp(int*,int*);","proto":{"swapp":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void swapp(s32 * a0, s32 * a1) {\n s32 v0;\n v0 = *a0;\n *a0 = *a1;\n *a1 = v0;\n return;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void swapp(s32 *arg0, s32 *arg1) {\n s32 temp_r3;\n\n temp_r3 = *arg0;\n *arg0 = *arg1;\n *arg1 = temp_r3;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `swapp` — benchmark function synthetic:swapp:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tswapp\n\t.type\t swapp,function\n\t.thumb_func\nswapp:\n\tldr\tr3, [r0]\n\tldr\tr2, [r1]\n\tstr\tr2, [r0]\n\tstr\tr3, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t swapp,.Lfe1-swapp\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid swapp(int*,int*);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function swapp # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `swapp` — benchmark function synthetic:swapp:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:swapp:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tswapp\n\t.type\t swapp,function\n\t.thumb_func\nswapp:\n\tldr\tr3, [r0]\n\tldr\tr2, [r1]\n\tstr\tr2, [r0]\n\tstr\tr3, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t swapp,.Lfe1-swapp\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"swapp\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name swapp # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:swapp:gcc2.7.2kmc","sym":"swapp","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","store","load"],"loc":1,"refSource":"void swapp(int *a,int *b){ int t=*a;*a=*b;*b=t; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a1)\n 4:\tlw\tv1,0(a0)\n 8:\tsw\tv0,0(a0)\n c:\tjr\tra\n 10:\tsw\tv1,0(a1)\n\t...\n","ctx":"void swapp(int*,int*);","proto":{"swapp":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1879e5d42d2f1731/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 swapp\n\n\nContents of section .text:\n 0000 8ca20000 8c830000 ac820000 03e00008 ................\n 0010 aca30000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void swapp(s32 * a0, s32 * a1) {\n s32 v0;\n v0 = *a0;\n *a0 = *a1;\n *a1 = v0;\n return;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void swapp(s32 *arg0, s32 *arg1) {\n s32 temp_v1;\n\n temp_v1 = *arg0;\n *arg0 = *arg1;\n *arg1 = temp_v1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `swapp` — benchmark function synthetic:swapp:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel swapp\n lw\t$v0, 0($a1)\n lw\t$v1, 0($a0)\n sw\t$v0, 0($a0)\n jr\t$ra\n sw\t$v1, 0($a1)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid swapp(int*,int*);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function swapp # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `swapp` — benchmark function synthetic:swapp:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:swapp:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a1)\n 4:\tlw\tv1,0(a0)\n 8:\tsw\tv0,0(a0)\n c:\tjr\tra\n 10:\tsw\tv1,0(a1)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1879e5d42d2f1731/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 swapp\n\n\nContents of section .text:\n 0000 8ca20000 8c830000 ac820000 03e00008 ................\n 0010 aca30000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"swapp\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name swapp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:swapp:ido7.1","sym":"swapp","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","store","load"],"loc":1,"refSource":"void swapp(int *a,int *b){ int t=*a;*a=*b;*b=t; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tt6,0(a1)\n 4:\tlw\tv0,0(a0)\n 8:\tsw\tt6,0(a0)\n c:\tjr\tra\n 10:\tsw\tv0,0(a1)\n\t...\n","ctx":"void swapp(int*,int*);","proto":{"swapp":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 swapp\n\n\nContents of section .text:\n 0000 8cae0000 8c820000 ac8e0000 03e00008 ................\n 0010 aca20000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80004034 00000000 . ........@4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004034 00000000 00000000 00000000 ..@4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 38373965 35643432 64326631 ef-1879e5d42d2f1\n 0130 3733312f 7265662e 63007377 61707000 731/ref.c.swapp.\n 0140 73776170 70000000 00000000 00000001 swapp...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void swapp(s32 * a0, s32 * a1) {\n s32 v0;\n v0 = *a0;\n *a0 = *a1;\n *a1 = v0;\n return;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void swapp(s32 *arg0, s32 *arg1) {\n s32 temp_v0;\n\n temp_v0 = *arg0;\n *arg0 = *arg1;\n *arg1 = temp_v0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `swapp` — benchmark function synthetic:swapp:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel swapp\n lw\t$t6, 0($a1)\n lw\t$v0, 0($a0)\n sw\t$t6, 0($a0)\n jr\t$ra\n sw\t$v0, 0($a1)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid swapp(int*,int*);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function swapp # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `swapp` — benchmark function synthetic:swapp:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:swapp:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tt6,0(a1)\n 4:\tlw\tv0,0(a0)\n 8:\tsw\tt6,0(a0)\n c:\tjr\tra\n 10:\tsw\tv0,0(a1)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 swapp\n\n\nContents of section .text:\n 0000 8cae0000 8c820000 ac8e0000 03e00008 ................\n 0010 aca20000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80004034 00000000 . ........@4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004034 00000000 00000000 00000000 ..@4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 38373965 35643432 64326631 ef-1879e5d42d2f1\n 0130 3733312f 7265662e 63007377 61707000 731/ref.c.swapp.\n 0140 73776170 70000000 00000000 00000001 swapp...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"swapp\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name swapp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:swapp:mwcc_242_81","sym":"swapp","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","store","load"],"loc":1,"refSource":"void swapp(int *a,int *b){ int t=*a;*a=*b;*b=t; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r5,0(r3)\n 4:\tlwz r0,0(r4)\n 8:\tstw r0,0(r3)\n c:\tstw r5,0(r4)\n 10:\tblr\n","ctx":"void swapp(int*,int*);","proto":{"swapp":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 swapp\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 swapp\n\n\nContents of section .text:\n 0000 80a30000 80040000 90030000 90a40000 ................\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void swapp(s32 * a0, s32 * a1) {\n s32 v0;\n v0 = *a0;\n *a0 = *a1;\n *a1 = v0;\n return;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void swapp(s32 *arg0, s32 *arg1) {\n s32 temp_r5;\n\n temp_r5 = *arg0;\n *arg0 = *arg1;\n *arg1 = temp_r5;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `swapp` — benchmark function synthetic:swapp:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel swapp\n lwz r5,0(r3)\n lwz r0,0(r4)\n stw r0,0(r3)\n stw r5,0(r4)\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid swapp(int*,int*);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function swapp # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `swapp` — benchmark function synthetic:swapp:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:swapp:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r5,0(r3)\n 4:\tlwz r0,0(r4)\n 8:\tstw r0,0(r3)\n c:\tstw r5,0(r4)\n 10:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 swapp\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 swapp\n\n\nContents of section .text:\n 0000 80a30000 80040000 90030000 90a40000 ................\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"swapp\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name swapp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:togglebit:agbcc","sym":"togglebit","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int togglebit(int x,int n){ return x ^ (1< in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttogglebit\n\t.type\t togglebit,function\n\t.thumb_func\ntogglebit:\n\tadd\tr2, r0, #0\n\tmov\tr0, #0x1\n\tlsl\tr0, r0, r1\n\teor\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t togglebit,.Lfe1-togglebit\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function togglebit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `togglebit` — benchmark function synthetic:togglebit:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:togglebit:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttogglebit\n\t.type\t togglebit,function\n\t.thumb_func\ntogglebit:\n\tadd\tr2, r0, #0\n\tmov\tr0, #0x1\n\tlsl\tr0, r0, r1\n\teor\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t togglebit,.Lfe1-togglebit\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name togglebit # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:togglebit:gcc2.7.2kmc","sym":"togglebit","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int togglebit(int x,int n){ return x ^ (1<:\n 0:\tli\tv0,1\n 4:\tsllv\tv0,v0,a1\n 8:\tjr\tra\n c:\txor\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5cd94e79888f8fb7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 togglebit\n\n\nContents of section .text:\n 0000 24020001 00a21004 03e00008 00821026 $..............&\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 togglebit(u32 a0, u32 a1) {\n return a0 ^ 1 << a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 togglebit(s32 arg0, s32 arg1) {\n return arg0 ^ (1 << arg1);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `togglebit` — benchmark function synthetic:togglebit:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel togglebit\n li\t$v0, 1\n sllv\t$v0, $v0, $a1\n jr\t$ra\n xor\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function togglebit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `togglebit` — benchmark function synthetic:togglebit:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:togglebit:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tsllv\tv0,v0,a1\n 8:\tjr\tra\n c:\txor\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5cd94e79888f8fb7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 togglebit\n\n\nContents of section .text:\n 0000 24020001 00a21004 03e00008 00821026 $..............&\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name togglebit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:togglebit:ido7.1","sym":"togglebit","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int togglebit(int x,int n){ return x ^ (1<:\n 0:\tli\tt6,1\n 4:\tsllv\tt7,t6,a1\n 8:\tjr\tra\n c:\txor\tv0,t7,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 togglebit\n\n\nContents of section .text:\n 0000 240e0001 00ae7804 03e00008 01e41026 $.....x........&\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002c0 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 0000000c 0000025c 00000001 00000268 .......\\.......h\n 0050 00000000 00000000 00000001 000002b0 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 63643934 65373938 38386638 ef-5cd94e79888f8\n 0130 6662372f 7265662e 6300746f 67676c65 fb7/ref.c.toggle\n 0140 62697400 746f6767 6c656269 74000000 bit.togglebit...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000004 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 togglebit(u32 a0, u32 a1) {\n return 1 << a1 ^ a0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 togglebit(s32 arg0, s32 arg1) {\n return (1 << arg1) ^ arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `togglebit` — benchmark function synthetic:togglebit:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel togglebit\n li\t$t6, 1\n sllv\t$t7, $t6, $a1\n jr\t$ra\n xor\t$v0, $t7, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function togglebit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `togglebit` — benchmark function synthetic:togglebit:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:togglebit:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tt6,1\n 4:\tsllv\tt7,t6,a1\n 8:\tjr\tra\n c:\txor\tv0,t7,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 togglebit\n\n\nContents of section .text:\n 0000 240e0001 00ae7804 03e00008 01e41026 $.....x........&\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002c0 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 0000000c 0000025c 00000001 00000268 .......\\.......h\n 0050 00000000 00000000 00000001 000002b0 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 63643934 65373938 38386638 ef-5cd94e79888f8\n 0130 6662372f 7265662e 6300746f 67676c65 fb7/ref.c.toggle\n 0140 62697400 746f6767 6c656269 74000000 bit.togglebit...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000004 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name togglebit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:togglebit:mwcc_242_81","sym":"togglebit","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int togglebit(int x,int n){ return x ^ (1<:\n 0:\tli r0,1\n 4:\tslw r0,r0,r4\n 8:\txor r3,r3,r0\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 togglebit\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 togglebit\n\n\nContents of section .text:\n 0000 38000001 7c002030 7c630278 4e800020 8...|. 0|c.xN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 togglebit(u32 a0, u32 a1) {\n return a0 ^ 1 << a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 togglebit(s32 arg0, s32 arg1) {\n return arg0 ^ (1 << arg1);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `togglebit` — benchmark function synthetic:togglebit:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel togglebit\n li r0,1\n slw r0,r0,r4\n xor r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function togglebit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `togglebit` — benchmark function synthetic:togglebit:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:togglebit:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r0,1\n 4:\tslw r0,r0,r4\n 8:\txor r3,r3,r0\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 togglebit\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 togglebit\n\n\nContents of section .text:\n 0000 38000001 7c002030 7c630278 4e800020 8...|. 0|c.xN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name togglebit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tos8:agbcc","sym":"tos8","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","narrow","signed"],"loc":1,"refSource":"s8 tos8(int x){ return (s8)x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttos8\n\t.type\t tos8,function\n\t.thumb_func\ntos8:\n\tlsl\tr0, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t tos8,.Lfe1-tos8\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tos8(u32 a0) {\n return (s8)a0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 tos8(s8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tos8` — benchmark function synthetic:tos8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttos8\n\t.type\t tos8,function\n\t.thumb_func\ntos8:\n\tlsl\tr0, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t tos8,.Lfe1-tos8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tos8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tos8` — benchmark function synthetic:tos8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tos8:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttos8\n\t.type\t tos8,function\n\t.thumb_func\ntos8:\n\tlsl\tr0, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t tos8,.Lfe1-tos8\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name tos8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tos8:gcc2.7.2kmc","sym":"tos8","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","narrow","signed"],"loc":1,"refSource":"s8 tos8(int x){ return (s8)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x18\n 4:\tjr\tra\n 8:\tsra\tv0,v0,0x18\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-07dea59d72245370/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c tos8\n\n\nContents of section .text:\n 0000 00041600 03e00008 00021603 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 tos8(s32 a0) {\n return a0 << 24 >> 24;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 tos8(s8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tos8` — benchmark function synthetic:tos8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tos8\n sll\t$v0, $a0, 0x18\n jr\t$ra\n sra\t$v0, $v0, 0x18\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tos8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tos8` — benchmark function synthetic:tos8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tos8:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x18\n 4:\tjr\tra\n 8:\tsra\tv0,v0,0x18\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-07dea59d72245370/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c tos8\n\n\nContents of section .text:\n 0000 00041600 03e00008 00021603 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name tos8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tos8:ido7.1","sym":"tos8","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","narrow","signed"],"loc":1,"refSource":"s8 tos8(int x){ return (s8)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x18\n 4:\tjr\tra\n 8:\tsra\tv0,v0,0x18\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c tos8\n\n\nContents of section .text:\n 0000 00041600 03e00008 00021603 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 37646561 35396437 32323435 ef-07dea59d72245\n 0130 3337302f 7265662e 6300746f 73380000 370/ref.c.tos8..\n 0140 746f7338 00000000 00000000 00000001 tos8............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000003 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 tos8(s32 a0) {\n return a0 << 24 >> 24;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s8 tos8(s8 arg0) {\n return arg0;\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tos8` — benchmark function synthetic:tos8:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tos8\n sll\t$v0, $a0, 0x18\n jr\t$ra\n sra\t$v0, $v0, 0x18\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tos8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tos8` — benchmark function synthetic:tos8:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tos8:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x18\n 4:\tjr\tra\n 8:\tsra\tv0,v0,0x18\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c tos8\n\n\nContents of section .text:\n 0000 00041600 03e00008 00021603 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 37646561 35396437 32323435 ef-07dea59d72245\n 0130 3337302f 7265662e 6300746f 73380000 370/ref.c.tos8..\n 0140 746f7338 00000000 00000000 00000001 tos8............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000003 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name tos8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tos8:mwcc_242_81","sym":"tos8","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","narrow","signed"],"loc":1,"refSource":"s8 tos8(int x){ return (s8)x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\textsb r3,r3\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 tos8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 tos8\n\n\nContents of section .text:\n 0000 7c630774 4e800020 |c.tN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tos8(u32 a0) {\n return (s8)a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s8 tos8(s8 arg0) {\n return arg0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tos8` — benchmark function synthetic:tos8:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tos8\n extsb r3,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tos8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tos8` — benchmark function synthetic:tos8:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tos8:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\textsb r3,r3\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 tos8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 tos8\n\n\nContents of section .text:\n 0000 7c630774 4e800020 |c.tN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name tos8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou16:agbcc","sym":"tou16","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u16 tou16(int x){ return (u16)x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttou16\n\t.type\t tou16,function\n\t.thumb_func\ntou16:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t tou16,.Lfe1-tou16\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou16(u32 a0) {\n return (u16)a0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u16 tou16(u16 arg0) {\n return arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou16` — benchmark function synthetic:tou16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttou16\n\t.type\t tou16,function\n\t.thumb_func\ntou16:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t tou16,.Lfe1-tou16\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou16` — benchmark function synthetic:tou16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou16:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttou16\n\t.type\t tou16,function\n\t.thumb_func\ntou16:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t tou16,.Lfe1-tou16\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou16:gcc2.7.2kmc","sym":"tou16","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u16 tou16(int x){ return (u16)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xffff\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-214af963cce42910/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 tou16\n\n\nContents of section .text:\n 0000 03e00008 3082ffff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou16(u32 a0) {\n return a0 & 65535;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 tou16(s32 arg0) {\n return arg0 & 0xFFFF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou16` — benchmark function synthetic:tou16:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tou16\n jr\t$ra\n andi\t$v0, $a0, 0xffff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou16` — benchmark function synthetic:tou16:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou16:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xffff\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-214af963cce42910/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 tou16\n\n\nContents of section .text:\n 0000 03e00008 3082ffff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou16 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou16:ido7.1","sym":"tou16","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u16 tou16(int x){ return (u16)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xffff\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 tou16\n\n\nContents of section .text:\n 0000 03e00008 3082ffff 00000000 00000000 ....0...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 31346166 39363363 63653432 ef-214af963cce42\n 0130 3931302f 7265662e 6300746f 75313600 910/ref.c.tou16.\n 0140 746f7531 36000000 00000000 00000001 tou16...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou16(u32 a0) {\n return a0 & 65535;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 tou16(s32 arg0) {\n return arg0 & 0xFFFF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou16` — benchmark function synthetic:tou16:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tou16\n jr\t$ra\n andi\t$v0, $a0, 0xffff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou16` — benchmark function synthetic:tou16:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou16:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xffff\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 tou16\n\n\nContents of section .text:\n 0000 03e00008 3082ffff 00000000 00000000 ....0...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 31346166 39363363 63653432 ef-214af963cce42\n 0130 3931302f 7265662e 6300746f 75313600 910/ref.c.tou16.\n 0140 746f7531 36000000 00000000 00000001 tou16...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou16 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou16:mwcc_242_81","sym":"tou16","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u16 tou16(int x){ return (u16)x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,16\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 tou16\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 tou16\n\n\nContents of section .text:\n 0000 5463043e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou16(u32 a0) {\n return a0 & 65535;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u16 tou16(u16 arg0) {\n return arg0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou16` — benchmark function synthetic:tou16:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tou16\n clrlwi r3,r3,16\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou16` — benchmark function synthetic:tou16:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou16:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,16\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 tou16\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 tou16\n\n\nContents of section .text:\n 0000 5463043e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou16 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou8:agbcc","sym":"tou8","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u8 tou8(int x){ return (u8)x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttou8\n\t.type\t tou8,function\n\t.thumb_func\ntou8:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t tou8,.Lfe1-tou8\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou8(u32 a0) {\n return (u8)a0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u8 tou8(u8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou8` — benchmark function synthetic:tou8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttou8\n\t.type\t tou8,function\n\t.thumb_func\ntou8:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t tou8,.Lfe1-tou8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou8` — benchmark function synthetic:tou8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou8:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttou8\n\t.type\t tou8,function\n\t.thumb_func\ntou8:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t tou8,.Lfe1-tou8\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou8:gcc2.7.2kmc","sym":"tou8","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u8 tou8(int x){ return (u8)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b02672a7f125af2b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 tou8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou8(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 tou8(s32 arg0) {\n return arg0 & 0xFF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou8` — benchmark function synthetic:tou8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tou8\n jr\t$ra\n andi\t$v0, $a0, 0xff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou8` — benchmark function synthetic:tou8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou8:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b02672a7f125af2b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 tou8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou8:ido7.1","sym":"tou8","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u8 tou8(int x){ return (u8)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 tou8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 30323637 32613766 31323561 ef-b02672a7f125a\n 0130 6632622f 7265662e 6300746f 75380000 f2b/ref.c.tou8..\n 0140 746f7538 00000000 00000000 00000001 tou8............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou8(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 tou8(s32 arg0) {\n return arg0 & 0xFF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou8` — benchmark function synthetic:tou8:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tou8\n jr\t$ra\n andi\t$v0, $a0, 0xff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou8` — benchmark function synthetic:tou8:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou8:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 tou8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 30323637 32613766 31323561 ef-b02672a7f125a\n 0130 6632622f 7265662e 6300746f 75380000 f2b/ref.c.tou8..\n 0140 746f7538 00000000 00000000 00000001 tou8............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou8:mwcc_242_81","sym":"tou8","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u8 tou8(int x){ return (u8)x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,24\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 tou8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 tou8\n\n\nContents of section .text:\n 0000 5463063e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou8(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 tou8(u8 arg0) {\n return arg0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou8` — benchmark function synthetic:tou8:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tou8\n clrlwi r3,r3,24\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou8` — benchmark function synthetic:tou8:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou8:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,24\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 tou8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 tou8\n\n\nContents of section .text:\n 0000 5463063e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:truncmul:agbcc","sym":"truncmul","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"s16 truncmul(s16 a,s16 b){ return a*b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttruncmul\n\t.type\t truncmul,function\n\t.thumb_func\ntruncmul:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t truncmul,.Lfe1-truncmul\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 truncmul(u32 a0, u32 a1) {\n return (s16)((s16)a0 * (s16)a1);\n}\n","score":4,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":98,"lines":3,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s16 truncmul(s16 arg0, s16 arg1) {\n return (s16) (arg0 * arg1);\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `truncmul` — benchmark function synthetic:truncmul:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttruncmul\n\t.type\t truncmul,function\n\t.thumb_func\ntruncmul:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t truncmul,.Lfe1-truncmul\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function truncmul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `truncmul` — benchmark function synthetic:truncmul:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:truncmul:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttruncmul\n\t.type\t truncmul,function\n\t.thumb_func\ntruncmul:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t truncmul,.Lfe1-truncmul\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name truncmul # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:truncmul:gcc2.7.2kmc","sym":"truncmul","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"s16 truncmul(s16 a,s16 b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmult\ta0,a1\n 8:\tmflo\tv0\n c:\tsll\tv0,v0,0x10\n 10:\tnop\n 14:\tjr\tra\n 18:\tsra\tv0,v0,0x10\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5e885505a19e4205/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c truncmul\n\n\nContents of section .text:\n 0000 00000000 00850018 00001012 00021400 ................\n 0010 00000000 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 truncmul(s32 a0, s32 a1) {\n return a0 * a1 << 16 >> 16;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s16 truncmul(s32 arg0, s32 arg1) {\n return (s16) (arg0 * arg1);\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `truncmul` — benchmark function synthetic:truncmul:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel truncmul\n nop\n mult\t$a0, $a1\n mflo\t$v0\n sll\t$v0, $v0, 0x10\n nop\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function truncmul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `truncmul` — benchmark function synthetic:truncmul:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:truncmul:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmult\ta0,a1\n 8:\tmflo\tv0\n c:\tsll\tv0,v0,0x10\n 10:\tnop\n 14:\tjr\tra\n 18:\tsra\tv0,v0,0x10\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5e885505a19e4205/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c truncmul\n\n\nContents of section .text:\n 0000 00000000 00850018 00001012 00021400 ................\n 0010 00000000 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name truncmul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:truncmul:ido7.1","sym":"truncmul","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"s16 truncmul(s16 a,s16 b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tsll\ta1,a1,0x10\n c:\tsll\ta0,a0,0x10\n 10:\tsra\ta0,a0,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tmultu\ta0,a1\n 1c:\tmflo\tv0\n 20:\tsll\tv0,v0,0x10\n 24:\tjr\tra\n 28:\tsra\tv0,v0,0x10\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c truncmul\n\n\nContents of section .text:\n 0000 afa40000 afa50004 00052c00 00042400 ..........,...$.\n 0010 00042403 00052c03 00850019 00001012 ..$...,.........\n 0020 00021400 03e00008 00021403 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000004 00000198 p...............\n 0010 00000005 000002e0 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 0000000c 0000027c 00000001 00000288 .......|........\n 0050 00000000 00000000 00000001 000002d0 ................\n 0060 08010000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000002c 20200001 00000001 ......., ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 65383835 35303561 31396534 ef-5e885505a19e4\n 0130 3230352f 7265662e 63007472 756e636d 205/ref.c.truncm\n 0140 756c0000 7472756e 636d756c 00000000 ul..truncmul....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 0000000b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000002 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 truncmul(s32 a0, s32 a1) {\n return (a0 << 16 >> 16) * (a1 << 16 >> 16) << 16 >> 16;\n}\n","score":7,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s16 truncmul(s16 arg0, s16 arg1) {\n return (s16) (arg0 * arg1);\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `truncmul` — benchmark function synthetic:truncmul:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel truncmul\n sw\t$a0, 0($sp)\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sra\t$a1, $a1, 0x10\n multu\t$a0, $a1\n mflo\t$v0\n sll\t$v0, $v0, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function truncmul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `truncmul` — benchmark function synthetic:truncmul:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:truncmul:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tsll\ta1,a1,0x10\n c:\tsll\ta0,a0,0x10\n 10:\tsra\ta0,a0,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tmultu\ta0,a1\n 1c:\tmflo\tv0\n 20:\tsll\tv0,v0,0x10\n 24:\tjr\tra\n 28:\tsra\tv0,v0,0x10\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c truncmul\n\n\nContents of section .text:\n 0000 afa40000 afa50004 00052c00 00042400 ..........,...$.\n 0010 00042403 00052c03 00850019 00001012 ..$...,.........\n 0020 00021400 03e00008 00021403 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000004 00000198 p...............\n 0010 00000005 000002e0 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 0000000c 0000027c 00000001 00000288 .......|........\n 0050 00000000 00000000 00000001 000002d0 ................\n 0060 08010000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000002c 20200001 00000001 ......., ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 65383835 35303561 31396534 ef-5e885505a19e4\n 0130 3230352f 7265662e 63007472 756e636d 205/ref.c.truncm\n 0140 756c0000 7472756e 636d756c 00000000 ul..truncmul....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 0000000b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000002 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name truncmul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:truncmul:mwcc_242_81","sym":"truncmul","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"s16 truncmul(s16 a,s16 b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmullw r0,r3,r4\n 4:\textsh r3,r0\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c truncmul\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 truncmul\n\n\nContents of section .text:\n 0000 7c0321d6 7c030734 4e800020 |.!.|..4N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 truncmul(u32 a0, u32 a1) {\n return (s16)(a0 * a1);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s16 truncmul(s32 arg0, s32 arg1) {\n return (s16) (arg0 * arg1);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `truncmul` — benchmark function synthetic:truncmul:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel truncmul\n mullw r0,r3,r4\n extsh r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function truncmul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `truncmul` — benchmark function synthetic:truncmul:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:truncmul:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmullw r0,r3,r4\n 4:\textsh r3,r0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c truncmul\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 truncmul\n\n\nContents of section .text:\n 0000 7c0321d6 7c030734 4e800020 |.!.|..4N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name truncmul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc:agbcc","sym":"udivc","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","unsigned-div-const"],"loc":1,"refSource":"unsigned udivc(unsigned a){ return a/7; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivc\n\t.type\t udivc,function\n\t.thumb_func\nudivc:\n\tpush\t{lr}\n\tmov\tr1, #0x7\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivc,.Lfe1-udivc\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc(u32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivc(u32 arg0) {\n return arg0 / 7U;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc` — benchmark function synthetic:udivc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivc\n\t.type\t udivc,function\n\t.thumb_func\nudivc:\n\tpush\t{lr}\n\tmov\tr1, #0x7\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivc,.Lfe1-udivc\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc` — benchmark function synthetic:udivc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivc\n\t.type\t udivc,function\n\t.thumb_func\nudivc:\n\tpush\t{lr}\n\tmov\tr1, #0x7\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivc,.Lfe1-udivc\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc:gcc2.7.2kmc","sym":"udivc","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","unsigned-div-const"],"loc":1,"refSource":"unsigned udivc(unsigned a){ return a/7; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x2492\n 4:\tori\tv0,v0,0x4925\n 8:\tmultu\ta0,v0\n c:\tmfhi\tv0\n 10:\tsubu\ta0,a0,v0\n 14:\tsrl\ta0,a0,0x1\n 18:\taddu\tv0,v0,a0\n 1c:\tjr\tra\n 20:\tsrl\tv0,v0,0x2\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ff00d74040eb2125/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 udivc\n\n\nContents of section .text:\n 0000 3c022492 34424925 00820019 00001010 <.$.4BI%........\n 0010 00822023 00042042 00441021 03e00008 .. #.. B.D.!....\n 0020 00021082 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc(u32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u32 udivc(s32 arg0) {\n s32 temp_hi;\n\n temp_hi = arg0 / 7;\n return (u32) (temp_hi + ((u32) (arg0 - temp_hi) >> 1)) >> 2;\n}\n","score":8,"maxScore":13,"compileErrors":null,"breakdown":{"insert":4,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":5,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc` — benchmark function synthetic:udivc:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivc\n lui\t$v0, 0x2492\n ori\t$v0, $v0, 0x4925\n multu\t$a0, $v0\n mfhi\t$v0\n subu\t$a0, $a0, $v0\n srl\t$a0, $a0, 0x1\n addu\t$v0, $v0, $a0\n jr\t$ra\n srl\t$v0, $v0, 0x2\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc` — benchmark function synthetic:udivc:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x2492\n 4:\tori\tv0,v0,0x4925\n 8:\tmultu\ta0,v0\n c:\tmfhi\tv0\n 10:\tsubu\ta0,a0,v0\n 14:\tsrl\ta0,a0,0x1\n 18:\taddu\tv0,v0,a0\n 1c:\tjr\tra\n 20:\tsrl\tv0,v0,0x2\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ff00d74040eb2125/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 udivc\n\n\nContents of section .text:\n 0000 3c022492 34424925 00820019 00001010 <.$.4BI%........\n 0010 00822023 00042042 00441021 03e00008 .. #.. B.D.!....\n 0020 00021082 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc:ido7.1","sym":"udivc","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","unsigned-div-const"],"loc":1,"refSource":"unsigned udivc(unsigned a){ return a/7; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,7\n 4:\tdivu\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 udivc\n\n\nContents of section .text:\n 0000 24010007 0081001b 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 66303064 37343034 30656232 ef-ff00d74040eb2\n 0130 3132352f 7265662e 63007564 69766300 125/ref.c.udivc.\n 0140 75646976 63000000 00000000 00000001 udivc...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc(u32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivc(u32 arg0) {\n return arg0 / 7U;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc` — benchmark function synthetic:udivc:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivc\n li\t$at, 7\n divu\t$zero, $a0, $at\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc` — benchmark function synthetic:udivc:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,7\n 4:\tdivu\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 udivc\n\n\nContents of section .text:\n 0000 24010007 0081001b 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 66303064 37343034 30656232 ef-ff00d74040eb2\n 0130 3132352f 7265662e 63007564 69766300 125/ref.c.udivc.\n 0140 75646976 63000000 00000000 00000001 udivc...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc:mwcc_242_81","sym":"udivc","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","unsigned-div-const"],"loc":1,"refSource":"unsigned udivc(unsigned a){ return a/7; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,9362\n 4:\taddi r0,r4,18725\n 8:\tmulhwu r4,r0,r3\n c:\tsubf r0,r4,r3\n 10:\tsrwi r0,r0,1\n 14:\tadd r0,r0,r4\n 18:\tsrwi r3,r0,2\n 1c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 udivc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 udivc\n\n\nContents of section .text:\n 0000 3c802492 38044925 7c801816 7c041850 <.$.8.I%|...|..P\n 0010 5400f87e 7c002214 5403f0be 4e800020 T..~|.\".T...N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc(u32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u32 udivc(s32 arg0) {\n s32 temp_r4;\n\n temp_r4 = arg0 / 7;\n return (u32) (((u32) (arg0 - temp_r4) >> 1U) + temp_r4) >> 2U;\n}\n","score":8,"maxScore":12,"compileErrors":null,"breakdown":{"insert":4,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":5,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc` — benchmark function synthetic:udivc:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivc\n lis r4,9362\n addi r0,r4,18725\n mulhwu r4,r0,r3\n subf r0,r4,r3\n srwi r0,r0,1\n add r0,r0,r4\n srwi r3,r0,2\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc` — benchmark function synthetic:udivc:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,9362\n 4:\taddi r0,r4,18725\n 8:\tmulhwu r4,r0,r3\n c:\tsubf r0,r4,r3\n 10:\tsrwi r0,r0,1\n 14:\tadd r0,r0,r4\n 18:\tsrwi r3,r0,2\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 udivc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 udivc\n\n\nContents of section .text:\n 0000 3c802492 38044925 7c801816 7c041850 <.$.8.I%|...|..P\n 0010 5400f87e 7c002214 5403f0be 4e800020 T..~|.\".T...N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc10:agbcc","sym":"udivc10","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","unsigned-div-const","magic-div"],"loc":1,"refSource":"unsigned udivc10(unsigned a){ return a/10; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivc10\n\t.type\t udivc10,function\n\t.thumb_func\nudivc10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivc10,.Lfe1-udivc10\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc10(u32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivc10(u32 arg0) {\n return arg0 / 10U;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc10` — benchmark function synthetic:udivc10:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivc10\n\t.type\t udivc10,function\n\t.thumb_func\nudivc10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivc10,.Lfe1-udivc10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc10` — benchmark function synthetic:udivc10:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc10:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivc10\n\t.type\t udivc10,function\n\t.thumb_func\nudivc10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivc10,.Lfe1-udivc10\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc10 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc10:gcc2.7.2kmc","sym":"udivc10","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","unsigned-div-const","magic-div"],"loc":1,"refSource":"unsigned udivc10(unsigned a){ return a/10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0xcccc\n 4:\tori\tv0,v0,0xcccd\n 8:\tmultu\ta0,v0\n c:\tmfhi\tv1\n\t...\n 18:\tjr\tra\n 1c:\tsrl\tv0,v1,0x3\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-de2e270188bb4718/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 udivc10\n\n\nContents of section .text:\n 0000 3c02cccc 3442cccd 00820019 00001810 <...4B..........\n 0010 00000000 00000000 03e00008 000310c2 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc10(u32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 udivc10(s32 arg0) {\n return arg0 / 10;\n}\n","score":6,"maxScore":9,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":3,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc10` — benchmark function synthetic:udivc10:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivc10\n lui\t$v0, 0xcccc\n ori\t$v0, $v0, 0xcccd\n multu\t$a0, $v0\n mfhi\t$v1\n jr\t$ra\n srl\t$v0, $v1, 0x3\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc10` — benchmark function synthetic:udivc10:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc10:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0xcccc\n 4:\tori\tv0,v0,0xcccd\n 8:\tmultu\ta0,v0\n c:\tmfhi\tv1\n\t...\n 18:\tjr\tra\n 1c:\tsrl\tv0,v1,0x3\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-de2e270188bb4718/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 udivc10\n\n\nContents of section .text:\n 0000 3c02cccc 3442cccd 00820019 00001810 <...4B..........\n 0010 00000000 00000000 03e00008 000310c2 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc10:ido7.1","sym":"udivc10","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","unsigned-div-const","magic-div"],"loc":1,"refSource":"unsigned udivc10(unsigned a){ return a/10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdivu\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 udivc10\n\n\nContents of section .text:\n 0000 2401000a 0081001b 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 65326532 37303138 38626234 ef-de2e270188bb4\n 0130 3731382f 7265662e 63007564 69766331 718/ref.c.udivc1\n 0140 30000000 75646976 63313000 00000000 0...udivc10.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc10(u32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivc10(u32 arg0) {\n return arg0 / 10U;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc10` — benchmark function synthetic:udivc10:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivc10\n li\t$at, 10\n divu\t$zero, $a0, $at\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc10` — benchmark function synthetic:udivc10:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc10:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdivu\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 udivc10\n\n\nContents of section .text:\n 0000 2401000a 0081001b 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 65326532 37303138 38626234 ef-de2e270188bb4\n 0130 3731382f 7265662e 63007564 69766331 718/ref.c.udivc1\n 0140 30000000 75646976 63313000 00000000 0...udivc10.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc10:mwcc_242_81","sym":"udivc10","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","unsigned-div-const","magic-div"],"loc":1,"refSource":"unsigned udivc10(unsigned a){ return a/10; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,-13107\n 4:\taddi r0,r4,-13107\n 8:\tmulhwu r0,r0,r3\n c:\tsrwi r3,r0,3\n 10:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 udivc10\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 udivc10\n\n\nContents of section .text:\n 0000 3c80cccd 3804cccd 7c001816 5403e8fe <...8...|...T...\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc10(u32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 udivc10(s32 arg0) {\n return arg0 / 10;\n}\n","score":6,"maxScore":7,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":1,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc10` — benchmark function synthetic:udivc10:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivc10\n lis r4,-13107\n addi r0,r4,-13107\n mulhwu r0,r0,r3\n srwi r3,r0,3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc10` — benchmark function synthetic:udivc10:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc10:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,-13107\n 4:\taddi r0,r4,-13107\n 8:\tmulhwu r0,r0,r3\n c:\tsrwi r3,r0,3\n 10:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 udivc10\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 udivc10\n\n\nContents of section .text:\n 0000 3c80cccd 3804cccd 7c001816 5403e8fe <...8...|...T...\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivv:agbcc","sym":"udivv","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","div-reg","unsigned"],"loc":1,"refSource":"unsigned udivv(unsigned a,unsigned b){ return a/b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivv\n\t.type\t udivv,function\n\t.thumb_func\nudivv:\n\tpush\t{lr}\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivv,.Lfe1-udivv\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivv(u32 a0, u32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivv(u32 arg0, u32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivv` — benchmark function synthetic:udivv:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivv\n\t.type\t udivv,function\n\t.thumb_func\nudivv:\n\tpush\t{lr}\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivv,.Lfe1-udivv\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivv` — benchmark function synthetic:udivv:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivv:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivv\n\t.type\t udivv,function\n\t.thumb_func\nudivv:\n\tpush\t{lr}\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivv,.Lfe1-udivv\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivv # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivv:gcc2.7.2kmc","sym":"udivv","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","div-reg","unsigned"],"loc":1,"refSource":"unsigned udivv(unsigned a,unsigned b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivu\tzero,a0,a1\n 4:\tbnez\ta1,10 \n 8:\tnop\n c:\tbreak\t0x7\n 10:\tmflo\tv0\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-e7bcc78fba02c0f5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c udivv\n\n\nContents of section .text:\n 0000 0085001b 14a00002 00000000 0007000d ................\n 0010 00001012 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivv(u32 a0, u32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivv(u32 arg0, u32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivv` — benchmark function synthetic:udivv:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivv\n divu\t$zero, $a0, $a1\n bnez\t$a1, .L10\n nop\n break\t0x7\n.L10:\n mflo\t$v0\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivv` — benchmark function synthetic:udivv:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivv:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivu\tzero,a0,a1\n 4:\tbnez\ta1,10 \n 8:\tnop\n c:\tbreak\t0x7\n 10:\tmflo\tv0\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-e7bcc78fba02c0f5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c udivv\n\n\nContents of section .text:\n 0000 0085001b 14a00002 00000000 0007000d ................\n 0010 00001012 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivv:ido7.1","sym":"udivv","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","div-reg","unsigned"],"loc":1,"refSource":"unsigned udivv(unsigned a,unsigned b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivu\tzero,a0,a1\n 4:\tmflo\tv0\n 8:\tbnez\ta1,14 \n c:\tnop\n 10:\tbreak\t0x7\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c udivv\n\n\nContents of section .text:\n 0000 0085001b 00001012 14a00002 00000000 ................\n 0010 0007000d 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 37626363 37386662 61303263 ef-e7bcc78fba02c\n 0130 3066352f 7265662e 63007564 69767600 0f5/ref.c.udivv.\n 0140 75646976 76000000 00000000 00000001 udivv...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivv(u32 a0, u32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivv(u32 arg0, u32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivv` — benchmark function synthetic:udivv:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivv\n divu\t$zero, $a0, $a1\n mflo\t$v0\n bnez\t$a1, .L14\n nop\n break\t0x7\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivv` — benchmark function synthetic:udivv:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivv:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivu\tzero,a0,a1\n 4:\tmflo\tv0\n 8:\tbnez\ta1,14 \n c:\tnop\n 10:\tbreak\t0x7\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c udivv\n\n\nContents of section .text:\n 0000 0085001b 00001012 14a00002 00000000 ................\n 0010 0007000d 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 37626363 37386662 61303263 ef-e7bcc78fba02c\n 0130 3066352f 7265662e 63007564 69767600 0f5/ref.c.udivv.\n 0140 75646976 76000000 00000000 00000001 udivv...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivv:mwcc_242_81","sym":"udivv","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","div-reg","unsigned"],"loc":1,"refSource":"unsigned udivv(unsigned a,unsigned b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivwu r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 udivv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 udivv\n\n\nContents of section .text:\n 0000 7c632396 4e800020 |c#.N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivv(u32 a0, u32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivv(u32 arg0, u32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivv` — benchmark function synthetic:udivv:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivv\n divwu r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivv` — benchmark function synthetic:udivv:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivv:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivwu r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 udivv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 udivv\n\n\nContents of section .text:\n 0000 7c632396 4e800020 |c#.N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:umod10:agbcc","sym":"umod10","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","unsigned-mod-const","magic-div"],"loc":1,"refSource":"unsigned umod10(unsigned a){ return a%10; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tumod10\n\t.type\t umod10,function\n\t.thumb_func\numod10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__umodsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t umod10,.Lfe1-umod10\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 umod10(u32 a0) {\n return a0 % 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 umod10(u32 arg0) {\n return arg0 % 10U;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `umod10` — benchmark function synthetic:umod10:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tumod10\n\t.type\t umod10,function\n\t.thumb_func\numod10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__umodsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t umod10,.Lfe1-umod10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function umod10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `umod10` — benchmark function synthetic:umod10:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:umod10:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tumod10\n\t.type\t umod10,function\n\t.thumb_func\numod10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__umodsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t umod10,.Lfe1-umod10\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name umod10 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:umod10:gcc2.7.2kmc","sym":"umod10","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","unsigned-mod-const","magic-div"],"loc":1,"refSource":"unsigned umod10(unsigned a){ return a%10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0xcccc\n 4:\tori\tv0,v0,0xcccd\n 8:\tmultu\ta0,v0\n c:\tmfhi\ta1\n 10:\tsrl\tv1,a1,0x3\n 14:\tsll\tv0,v1,0x2\n 18:\taddu\tv0,v0,v1\n 1c:\tsll\tv0,v0,0x1\n 20:\tjr\tra\n 24:\tsubu\tv0,a0,v0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-02d32a69804edd71/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 umod10\n\n\nContents of section .text:\n 0000 3c02cccc 3442cccd 00820019 00002810 <...4B........(.\n 0010 000518c2 00031080 00431021 00021040 .........C.!...@\n 0020 03e00008 00821023 00000000 00000000 .......#........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 umod10(u32 a0) {\n return a0 - a0 / 10 * 10;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 umod10(s32 arg0) {\n return arg0 % 10;\n}\n","score":6,"maxScore":12,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":2,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `umod10` — benchmark function synthetic:umod10:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel umod10\n lui\t$v0, 0xcccc\n ori\t$v0, $v0, 0xcccd\n multu\t$a0, $v0\n mfhi\t$a1\n srl\t$v1, $a1, 0x3\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x1\n jr\t$ra\n subu\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function umod10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `umod10` — benchmark function synthetic:umod10:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:umod10:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0xcccc\n 4:\tori\tv0,v0,0xcccd\n 8:\tmultu\ta0,v0\n c:\tmfhi\ta1\n 10:\tsrl\tv1,a1,0x3\n 14:\tsll\tv0,v1,0x2\n 18:\taddu\tv0,v0,v1\n 1c:\tsll\tv0,v0,0x1\n 20:\tjr\tra\n 24:\tsubu\tv0,a0,v0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-02d32a69804edd71/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 umod10\n\n\nContents of section .text:\n 0000 3c02cccc 3442cccd 00820019 00002810 <...4B........(.\n 0010 000518c2 00031080 00431021 00021040 .........C.!...@\n 0020 03e00008 00821023 00000000 00000000 .......#........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name umod10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:umod10:ido7.1","sym":"umod10","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","unsigned-mod-const","magic-div"],"loc":1,"refSource":"unsigned umod10(unsigned a){ return a%10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdivu\tzero,a0,at\n 8:\tmfhi\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 umod10\n\n\nContents of section .text:\n 0000 2401000a 0081001b 00001010 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 32643332 61363938 30346564 ef-02d32a69804ed\n 0130 6437312f 7265662e 6300756d 6f643130 d71/ref.c.umod10\n 0140 00000000 756d6f64 31300000 00000000 ....umod10......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 umod10(u32 a0) {\n return a0 % 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 umod10(u32 arg0) {\n return arg0 % 10U;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `umod10` — benchmark function synthetic:umod10:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel umod10\n li\t$at, 10\n divu\t$zero, $a0, $at\n mfhi\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function umod10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `umod10` — benchmark function synthetic:umod10:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:umod10:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdivu\tzero,a0,at\n 8:\tmfhi\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 umod10\n\n\nContents of section .text:\n 0000 2401000a 0081001b 00001010 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 32643332 61363938 30346564 ef-02d32a69804ed\n 0130 6437312f 7265662e 6300756d 6f643130 d71/ref.c.umod10\n 0140 00000000 756d6f64 31300000 00000000 ....umod10......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name umod10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:umod10:mwcc_242_81","sym":"umod10","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","unsigned-mod-const","magic-div"],"loc":1,"refSource":"unsigned umod10(unsigned a){ return a%10; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,-13107\n 4:\taddi r0,r4,-13107\n 8:\tmulhwu r0,r0,r3\n c:\tsrwi r0,r0,3\n 10:\tmulli r0,r0,10\n 14:\tsubf r3,r0,r3\n 18:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c umod10\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 umod10\n\n\nContents of section .text:\n 0000 3c80cccd 3804cccd 7c001816 5400e8fe <...8...|...T...\n 0010 1c00000a 7c601850 4e800020 ....|`.PN.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 umod10(u32 a0) {\n return a0 - a0 / 10 * 10;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 umod10(s32 arg0) {\n return arg0 % 10;\n}\n","score":6,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":1,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `umod10` — benchmark function synthetic:umod10:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel umod10\n lis r4,-13107\n addi r0,r4,-13107\n mulhwu r0,r0,r3\n srwi r0,r0,3\n mulli r0,r0,10\n subf r3,r0,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function umod10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `umod10` — benchmark function synthetic:umod10:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:umod10:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,-13107\n 4:\taddi r0,r4,-13107\n 8:\tmulhwu r0,r0,r3\n c:\tsrwi r0,r0,3\n 10:\tmulli r0,r0,10\n 14:\tsubf r3,r0,r3\n 18:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c umod10\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 umod10\n\n\nContents of section .text:\n 0000 3c80cccd 3804cccd 7c001816 5400e8fe <...8...|...T...\n 0010 1c00000a 7c601850 4e800020 ....|`.PN.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name umod10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:Vec__len2:mwcc_242_81","sym":"Vec__len2","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c++","features":["c++","method","this-ptr"],"loc":2,"refSource":"struct Vec{int x;int y;int len2(){ return x*x+y*y; }};\nextern \"C\" int Vec__len2(Vec*v){ return v->len2(); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r4,0(r3)\n 4:\tlwz r0,4(r3)\n 8:\tmullw r3,r4,r4\n c:\tmullw r0,r0,r0\n 10:\tadd r3,r3,r0\n 14:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.cp\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 Vec__len2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 Vec__len2\n\n\nContents of section .text:\n 0000 80830000 80030004 7c6421d6 7c0001d6 ........|d!.|...\n 0010 7c630214 4e800020 |c..N.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 Vec__len2(s32 * a0) {\n return *a0 * *a0 + a0[1] * a0[1];\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 Vec__len2(void *arg0) {\n s32 temp_r0;\n s32 temp_r4;\n\n temp_r4 = arg0->unk0;\n temp_r0 = arg0->unk4;\n return (temp_r4 * temp_r4) + (temp_r0 * temp_r0);\n}\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class"]},"note":"C++ method via this-pointer","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Vec__len2` — benchmark function synthetic:Vec__len2:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel Vec__len2\n lwz r4,0(r3)\n lwz r0,4(r3)\n mullw r3,r4,r4\n mullw r0,r0,r0\n add r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c++ # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Vec__len2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Vec__len2` — benchmark function synthetic:Vec__len2:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:Vec__len2:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r4,0(r3)\n 4:\tlwz r0,4(r3)\n 8:\tmullw r3,r4,r4\n c:\tmullw r0,r0,r0\n 10:\tadd r3,r3,r0\n 14:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.cp\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 Vec__len2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 Vec__len2\n\n\nContents of section .text:\n 0000 80830000 80030004 7c6421d6 7c0001d6 ........|d!.|...\n 0010 7c630214 4e800020 |c..N.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name Vec__len2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:voidcall:agbcc","sym":"voidcall","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["call","void"],"loc":2,"refSource":"void sink(int);\nvoid voidcall(int x){ sink(x); }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tvoidcall\n\t.type\t voidcall,function\n\t.thumb_func\nvoidcall:\n\tpush\t{lr}\n\tbl\tsink\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t voidcall,.Lfe1-voidcall\n","ctx":"void sink(int); void voidcall(int);","proto":{"sink":{"params":1,"returnsVoid":true},"voidcall":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void voidcall(u32 a0) {\n sink(a0);\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void voidcall(s32 arg0) {\n sink(arg0);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `voidcall` — benchmark function synthetic:voidcall:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tvoidcall\n\t.type\t voidcall,function\n\t.thumb_func\nvoidcall:\n\tpush\t{lr}\n\tbl\tsink\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t voidcall,.Lfe1-voidcall\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid sink(int); void voidcall(int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function voidcall # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `voidcall` — benchmark function synthetic:voidcall:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:voidcall:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tvoidcall\n\t.type\t voidcall,function\n\t.thumb_func\nvoidcall:\n\tpush\t{lr}\n\tbl\tsink\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t voidcall,.Lfe1-voidcall\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sink\": {\n \"params\": 1,\n \"returnsVoid\": true\n },\n \"voidcall\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name voidcall # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:voidcall:gcc2.7.2kmc","sym":"voidcall","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["call","void"],"loc":2,"refSource":"void sink(int);\nvoid voidcall(int x){ sink(x); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tlw\tra,16(sp)\n 14:\tjr\tra\n 18:\taddiu\tsp,sp,24\n 1c:\tnop\n","ctx":"void sink(int); void voidcall(int);","proto":{"sink":{"params":1,"returnsVoid":true},"voidcall":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ca1ff746d8e9195e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c voidcall\n00000000 *UND*\t00000000 sink\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 sink\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a0000000 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'voidcall' — lift: cannot lift 'voidcall': function call 'jal' at 0x8 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tjal\t0 */\n/* c:\tnop */\n/* 10:\tlw\tra,16(sp) */\n/* 14:\tjr\tra */\n/* 18:\taddiu\tsp,sp,24 */\n/* 1c:\tnop */\nvoid voidcall(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'voidcall': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'voidcall': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void voidcall(s32 arg0) {\n sink(arg0);\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `voidcall` — benchmark function synthetic:voidcall:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel voidcall\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tsink\n nop\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid sink(int); void voidcall(int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function voidcall # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `voidcall` — benchmark function synthetic:voidcall:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:voidcall:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tlw\tra,16(sp)\n 14:\tjr\tra\n 18:\taddiu\tsp,sp,24\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ca1ff746d8e9195e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c voidcall\n00000000 *UND*\t00000000 sink\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 sink\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a0000000 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sink\": {\n \"params\": 1,\n \"returnsVoid\": true\n },\n \"voidcall\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name voidcall # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:voidcall:mwcc_242_81","sym":"voidcall","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["call","void"],"loc":2,"refSource":"void sink(int);\nvoid voidcall(int x){ sink(x); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\tsink\n 10:\tlwz r0,20(r1)\n 14:\tmtlr r0\n 18:\taddi r1,r1,16\n 1c:\tblr\n","ctx":"void sink(int); void voidcall(int);","proto":{"sink":{"params":1,"returnsVoid":true},"voidcall":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 sink\n00000000 g F .text\t00000020 voidcall\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 sink\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 voidcall\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 7c0803a6 38210010 4e800020 ....|...8!..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000004 00000000 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void voidcall(u32 a0) {\n sink(a0);\n return;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void voidcall(s32 arg0) {\n sink(arg0);\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `voidcall` — benchmark function synthetic:voidcall:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel voidcall\n stwu r1,-16(r1)\n mflr r0\n stw r0,20(r1)\n bl sink\n lwz r0,20(r1)\n mtlr r0\n addi r1,r1,16\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid sink(int); void voidcall(int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function voidcall # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `voidcall` — benchmark function synthetic:voidcall:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:voidcall:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\tsink\n 10:\tlwz r0,20(r1)\n 14:\tmtlr r0\n 18:\taddi r1,r1,16\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 sink\n00000000 g F .text\t00000020 voidcall\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 sink\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 voidcall\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 7c0803a6 38210010 4e800020 ....|...8!..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000004 00000000 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sink\": {\n \"params\": 1,\n \"returnsVoid\": true\n },\n \"voidcall\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name voidcall # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:zextb:agbcc","sym":"zextb","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","zero-extend"],"loc":1,"refSource":"int zextb(u8 x){ return x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tzextb\n\t.type\t zextb,function\n\t.thumb_func\nzextb:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t zextb,.Lfe1-zextb\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 zextb(u32 a0) {\n return (u8)a0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u8 zextb(u8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `zextb` — benchmark function synthetic:zextb:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tzextb\n\t.type\t zextb,function\n\t.thumb_func\nzextb:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t zextb,.Lfe1-zextb\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function zextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `zextb` — benchmark function synthetic:zextb:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:zextb:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tzextb\n\t.type\t zextb,function\n\t.thumb_func\nzextb:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t zextb,.Lfe1-zextb\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name zextb # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:zextb:gcc2.7.2kmc","sym":"zextb","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","zero-extend"],"loc":1,"refSource":"int zextb(u8 x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-8dba1aa4740ff3ce/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 zextb\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 zextb(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 zextb(s32 arg0) {\n return arg0 & 0xFF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `zextb` — benchmark function synthetic:zextb:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel zextb\n jr\t$ra\n andi\t$v0, $a0, 0xff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function zextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `zextb` — benchmark function synthetic:zextb:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:zextb:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-8dba1aa4740ff3ce/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 zextb\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name zextb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:zextb:ido7.1","sym":"zextb","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","zero-extend"],"loc":1,"refSource":"int zextb(u8 x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tjr\tra\n 8:\tandi\tv0,a0,0xff\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c zextb\n\n\nContents of section .text:\n 0000 afa40000 03e00008 308200ff 00000000 ........0.......\nContents of section .options:\n 0000 01200000 00000000 a0000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 64626131 61613437 34306666 ef-8dba1aa4740ff\n 0130 3363652f 7265662e 63007a65 78746200 3ce/ref.c.zextb.\n 0140 7a657874 62000000 00000000 00000001 zextb...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000003 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 zextb(u32 a0) {\n return a0 & 255;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 zextb(s32 arg0) {\n return arg0 & 0xFF;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":3,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `zextb` — benchmark function synthetic:zextb:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel zextb\n sw\t$a0, 0($sp)\n jr\t$ra\n andi\t$v0, $a0, 0xff\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function zextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `zextb` — benchmark function synthetic:zextb:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:zextb:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tjr\tra\n 8:\tandi\tv0,a0,0xff\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c zextb\n\n\nContents of section .text:\n 0000 afa40000 03e00008 308200ff 00000000 ........0.......\nContents of section .options:\n 0000 01200000 00000000 a0000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 64626131 61613437 34306666 ef-8dba1aa4740ff\n 0130 3363652f 7265662e 63007a65 78746200 3ce/ref.c.zextb.\n 0140 7a657874 62000000 00000000 00000001 zextb...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000003 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name zextb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:zextb:mwcc_242_81","sym":"zextb","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","zero-extend"],"loc":1,"refSource":"int zextb(u8 x){ return x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,24\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 zextb\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 zextb\n\n\nContents of section .text:\n 0000 5463063e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 zextb(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 zextb(u8 arg0) {\n return arg0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `zextb` — benchmark function synthetic:zextb:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel zextb\n clrlwi r3,r3,24\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function zextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `zextb` — benchmark function synthetic:zextb:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:zextb:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,24\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 zextb\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 zextb\n\n\nContents of section .text:\n 0000 5463063e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name zextb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}}]} \ No newline at end of file +{"meta":{"generatedAt":"2026-08-02T15:34:03.457Z","toolchains":["ido7.1","agbcc","gcc2.7.2","gcc2.7.2kmc","mwcc_242_81"],"counts":{"total":675,"synthetic":483,"real":192},"asmlift":{"commit":"005cccf2660e8bd7aa845c3eddffcfac7d6f21a7","dirty":false},"m2c":{"commit":"94098d4de68c2fcc13fb8cf1096a1520eb171abe"}},"results":[{"id":"af:add_calc_short_angle3:ido7.1","sym":"add_calc_short_angle3","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","arithmetic","branch"],"loc":31,"refSource":"s16 add_calc_short_angle3(s16* pValue, s16 target, f32 fraction, s16 maxStep, s16 minStep) {\n f32 stepSize;\n s32 uTarget;\n s32 newValue;\n s32 uValue;\n\n if (target != *pValue) {\n uValue = (u16)*pValue;\n uTarget = (u16)target;\n\n if (uValue > uTarget) {\n uTarget += 0x10000;\n }\n\n stepSize = (uTarget - uValue) * fraction;\n\n if (stepSize > maxStep) {\n stepSize = maxStep;\n } else if (stepSize < minStep) {\n stepSize = minStep;\n }\n\n newValue = uValue + (s32)stepSize;\n if (newValue > uTarget) {\n newValue = uTarget;\n }\n *pValue = newValue;\n }\n\n return target - *pValue;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L533-L563","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta3,12(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta1,a1,0x10\n 14:\tmtc1\ta2,$f12\n 18:\tbeq\ta1,v1,bc \n 1c:\tandi\tv0,v1,0xffff\n 20:\tandi\ta3,a1,0xffff\n 24:\tslt\tat,a3,v0\n 28:\tbeqz\tat,38 \n 2c:\tmove\ta2,a3\n 30:\tlui\tat,0x1\n 34:\taddu\ta2,a3,at\n 38:\tsubu\tt6,a2,v0\n 3c:\tmtc1\tt6,$f4\n 40:\tlh\tt7,14(sp)\n 44:\tlh\tt8,18(sp)\n 48:\tcvt.s.w\t$f6,$f4\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f14,$f8\n 58:\tmul.s\t$f2,$f6,$f12\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tmov.s\t$f0,$f2\n 64:\tbc1fl\t78 \n 68:\tmtc1\tt8,$f10\n 6c:\tb\t94 \n 70:\tmov.s\t$f0,$f14\n 74:\tmtc1\tt8,$f10\n 78:\tnop\n 7c:\tcvt.s.w\t$f12,$f10\n 80:\tc.lt.s\t$f2,$f12\n 84:\tnop\n 88:\tbc1fl\t98 \n 8c:\ttrunc.w.s\t$f16,$f0\n 90:\tmov.s\t$f0,$f12\n 94:\ttrunc.w.s\t$f16,$f0\n 98:\tmfc1\tt0,$f16\n 9c:\tnop\n a0:\taddu\ta3,t0,v0\n a4:\tslt\tat,a2,a3\n a8:\tbeqzl\tat,b8 \n ac:\tsh\ta3,0(a0)\n b0:\tmove\ta3,a2\n b4:\tsh\ta3,0(a0)\n b8:\tlh\tv1,0(a0)\n bc:\tsubu\tv0,a1,v1\n c0:\tsll\tv0,v0,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000cc add_calc_short_angle3\n\n\nContents of section .text:\n 0000 afa50004 afa7000c 84830000 00052c00 ..............,.\n 0010 00052c03 44866000 10a30028 3062ffff ..,.D.`....(0b..\n 0020 30a7ffff 00e2082a 10200003 00e03025 0......*. ....0%\n 0030 3c010001 00e13021 00c27023 448e2000 <.....0!..p#D. .\n 0040 87af000e 87b80012 468021a0 448f4000 ........F.!.D.@.\n 0050 00000000 468043a0 460c3082 4602703c ....F.C.F.0.F.p<\n 0060 46001006 45020004 44985000 10000009 F...E...D.P.....\n 0070 46007006 44985000 00000000 46805320 F.p.D.P.....F.S \n 0080 460c103c 00000000 45020003 4600040d F..<....E...F...\n 0090 46006006 4600040d 44088000 00000000 F.`.F...D.......\n 00a0 01023821 00c7082a 50200003 a4870000 ..8!...*P ......\n 00b0 00c03825 a4870000 84830000 00a31023 ..8%...........#\n 00c0 00021400 03e00008 00021403 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a100c1fe 00000000 . ..............\n 0010 0003f5df 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a100c1fe 00000000 0003f5df 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000033 0000001c 00000248 p......3.......H\n 0010 00000005 000003bc 00000001 00000264 ...............d\n 0020 00000004 00000298 00000000 00000000 ................\n 0030 00000011 000002c8 00000040 0000030c ...........@....\n 0040 00000018 0000034c 00000001 00000364 .......L.......d\n 0050 00000000 00000000 00000001 000003ac ................\n 0060 0150b250 101011f0 21211020 d012f010 .P.P....!!. ....\n 0070 f0111116 10231210 21230000 00000000 .....#..!#......\n 0080 00000001 00000000 00000000 00000000 ................\n 0090 ffffffff 00000000 00000000 00000000 ................\n 00a0 001d001f 00000004 0000001b 00000000 ................\n 00b0 00000001 00000000 2c200004 0000002a ........, .....*\n 00c0 00000000 1820000f 0000002a 000000cc ..... .....*....\n 00d0 20200001 00000001 00000000 20200000 .......... ..\n 00e0 02000000 03000000 04000000 05000000 ................\n 00f0 06000000 07000000 08000000 09000000 ................\n 0100 20000000 21000000 0a000000 0b000000 ...!...........\n 0110 0b000000 1a000000 00000000 00000003 ................\n 0120 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0130 7265616c 2d69646f 2d623633 30333139 real-ido-b630319\n 0140 36336333 61656233 662f752e 69006164 63c3aeb3f/u.i.ad\n 0150 645f6361 6c635f73 686f7274 5f616e67 d_calc_short_ang\n 0160 6c653300 6164645f 63616c63 5f73686f le3.add_calc_sho\n 0170 72745f61 6e676c65 33000000 00000000 rt_angle3.......\n 0180 00000001 00000000 00000040 00000000 ...........@....\n 0190 00000004 00000000 00000033 00000000 ...........3....\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 0000001a 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000000 00000000 . ..............\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'add_calc_short_angle3' — lift: cannot lift 'add_calc_short_angle3': unmodelled control transfer 'bc1fl' at 0x64 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta1,4(sp) */\n/* 4:\tsw\ta3,12(sp) */\n/* 8:\tlh\tv1,0(a0) */\n/* c:\tsll\ta1,a1,0x10 */\n/* 10:\tsra\ta1,a1,0x10 */\n/* 14:\tmtc1\ta2,$f12 */\n/* 18:\tbeq\ta1,v1,bc */\n/* 1c:\tandi\tv0,v1,0xffff */\n/* 20:\tandi\ta3,a1,0xffff */\n/* 24:\tslt\tat,a3,v0 */\n/* 28:\tbeqz\tat,38 */\n/* 2c:\tmove\ta2,a3 */\n/* 30:\tlui\tat,0x1 */\n/* 34:\taddu\ta2,a3,at */\n/* 38:\tsubu\tt6,a2,v0 */\n/* 3c:\tmtc1\tt6,$f4 */\n/* 40:\tlh\tt7,14(sp) */\n/* 44:\tlh\tt8,18(sp) */\n/* 48:\tcvt.s.w\t$f6,$f4 */\n/* 4c:\tmtc1\tt7,$f8 */\n/* 50:\tnop */\n/* 54:\tcvt.s.w\t$f14,$f8 */\n/* 58:\tmul.s\t$f2,$f6,$f12 */\n/* 5c:\tc.lt.s\t$f14,$f2 */\n/* 60:\tmov.s\t$f0,$f2 */\n/* 64:\tbc1fl\t78 */\n/* 68:\tmtc1\tt8,$f10 */\n/* 6c:\tb\t94 */\n/* 70:\tmov.s\t$f0,$f14 */\n/* 74:\tmtc1\tt8,$f10 */\n/* 78:\tnop */\n/* 7c:\tcvt.s.w\t$f12,$f10 */\n/* 80:\tc.lt.s\t$f2,$f12 */\n/* 84:\tnop */\n/* 88:\tbc1fl\t98 */\n/* 8c:\ttrunc.w.s\t$f16,$f0 */\n/* 90:\tmov.s\t$f0,$f12 */\n/* 94:\ttrunc.w.s\t$f16,$f0 */\n/* 98:\tmfc1\tt0,$f16 */\n/* 9c:\tnop */\n/* a0:\taddu\ta3,t0,v0 */\n/* a4:\tslt\tat,a2,a3 */\n/* a8:\tbeqzl\tat,b8 */\n/* ac:\tsh\ta3,0(a0) */\n/* b0:\tmove\ta3,a2 */\n/* b4:\tsh\ta3,0(a0) */\n/* b8:\tlh\tv1,0(a0) */\n/* bc:\tsubu\tv0,a1,v1 */\n/* c0:\tsll\tv0,v0,0x10 */\n/* c4:\tjr\tra */\n/* c8:\tsra\tv0,v0,0x10 */\n/* cc:\tnop */\nvoid add_calc_short_angle3(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'add_calc_short_angle3': unmodelled control transfer 'bc1fl' at 0x64 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":60,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'add_calc_short_angle3': unmodelled control transfer 'bc1fl' at 0x64 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 add_calc_short_angle3(s16 *arg0, s16 arg1, f32 arg2, s16 arg3, s16 arg4) {\n f32 temp_f12;\n f32 temp_f14;\n f32 temp_f2;\n f32 var_f0;\n s16 temp_a3;\n s16 temp_v1;\n s16 var_a2;\n s16 var_a3;\n s32 temp_v0;\n\n temp_v1 = *arg0;\n temp_v0 = temp_v1 & 0xFFFF;\n if (arg1 != temp_v1) {\n temp_a3 = arg1 & 0xFFFF;\n var_a2 = temp_a3;\n if (temp_a3 < temp_v0) {\n var_a2 = temp_a3 + 0x10000;\n }\n temp_f14 = (f32) arg3;\n temp_f2 = (f32) (var_a2 - temp_v0) * arg2;\n var_f0 = temp_f2;\n if (temp_f14 < temp_f2) {\n var_f0 = temp_f14;\n } else {\n temp_f12 = (f32) arg4;\n if (temp_f2 < temp_f12) {\n var_f0 = temp_f12;\n }\n }\n var_a3 = (s32) var_f0 + temp_v0;\n if (var_a2 < var_a3) {\n var_a3 = var_a2;\n }\n *arg0 = var_a3;\n }\n return (s16) (arg1 - *arg0);\n}\n","score":35,"maxScore":62,"compileErrors":null,"breakdown":{"insert":11,"delete":1,"replace":4,"opMismatch":0,"argMismatch":19},"quality":{"score":100,"lines":37,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":35,"maxScore":62,"ratio":0.5645161290322581,"kinds":{"insert":11,"delete":1,"replace":4,"opMismatch":0,"argMismatch":19}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add_calc_short_angle3` — benchmark function af:add_calc_short_angle3:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc_short_angle3\n sw\t$a1, 4($sp)\n sw\t$a3, 12($sp)\n lh\t$v1, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n mtc1\t$a2, $f12\n beq\t$a1, $v1, .Lbc\n andi\t$v0, $v1, 0xffff\n andi\t$a3, $a1, 0xffff\n slt\t$at, $a3, $v0\n beqz\t$at, .L38\n move\t$a2, $a3\n lui\t$at, 0x1\n addu\t$a2, $a3, $at\n.L38:\n subu\t$t6, $a2, $v0\n mtc1\t$t6, $f4\n lh\t$t7, 14($sp)\n lh\t$t8, 18($sp)\n cvt.s.w\t$f6, $f4\n mtc1\t$t7, $f8\n nop\n cvt.s.w\t$f14, $f8\n mul.s\t$f2, $f6, $f12\n c.lt.s\t$f14, $f2\n mov.s\t$f0, $f2\n bc1fl\t.L78\n mtc1\t$t8, $f10\n b\t.L94\n mov.s\t$f0, $f14\n mtc1\t$t8, $f10\n.L78:\n nop\n cvt.s.w\t$f12, $f10\n c.lt.s\t$f2, $f12\n nop\n bc1fl\t.L98\n trunc.w.s\t$f16, $f0\n mov.s\t$f0, $f12\n.L94:\n trunc.w.s\t$f16, $f0\n.L98:\n mfc1\t$t0, $f16\n nop\n addu\t$a3, $t0, $v0\n slt\t$at, $a2, $a3\n beqzl\t$at, .Lb8\n sh\t$a3, 0($a0)\n move\t$a3, $a2\n sh\t$a3, 0($a0)\n.Lb8:\n lh\t$v1, 0($a0)\n.Lbc:\n subu\t$v0, $a1, $v1\n sll\t$v0, $v0, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc_short_angle3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc_short_angle3` — benchmark function af:add_calc_short_angle3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc_short_angle3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta3,12(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta1,a1,0x10\n 14:\tmtc1\ta2,$f12\n 18:\tbeq\ta1,v1,bc \n 1c:\tandi\tv0,v1,0xffff\n 20:\tandi\ta3,a1,0xffff\n 24:\tslt\tat,a3,v0\n 28:\tbeqz\tat,38 \n 2c:\tmove\ta2,a3\n 30:\tlui\tat,0x1\n 34:\taddu\ta2,a3,at\n 38:\tsubu\tt6,a2,v0\n 3c:\tmtc1\tt6,$f4\n 40:\tlh\tt7,14(sp)\n 44:\tlh\tt8,18(sp)\n 48:\tcvt.s.w\t$f6,$f4\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f14,$f8\n 58:\tmul.s\t$f2,$f6,$f12\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tmov.s\t$f0,$f2\n 64:\tbc1fl\t78 \n 68:\tmtc1\tt8,$f10\n 6c:\tb\t94 \n 70:\tmov.s\t$f0,$f14\n 74:\tmtc1\tt8,$f10\n 78:\tnop\n 7c:\tcvt.s.w\t$f12,$f10\n 80:\tc.lt.s\t$f2,$f12\n 84:\tnop\n 88:\tbc1fl\t98 \n 8c:\ttrunc.w.s\t$f16,$f0\n 90:\tmov.s\t$f0,$f12\n 94:\ttrunc.w.s\t$f16,$f0\n 98:\tmfc1\tt0,$f16\n 9c:\tnop\n a0:\taddu\ta3,t0,v0\n a4:\tslt\tat,a2,a3\n a8:\tbeqzl\tat,b8 \n ac:\tsh\ta3,0(a0)\n b0:\tmove\ta3,a2\n b4:\tsh\ta3,0(a0)\n b8:\tlh\tv1,0(a0)\n bc:\tsubu\tv0,a1,v1\n c0:\tsll\tv0,v0,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000cc add_calc_short_angle3\n\n\nContents of section .text:\n 0000 afa50004 afa7000c 84830000 00052c00 ..............,.\n 0010 00052c03 44866000 10a30028 3062ffff ..,.D.`....(0b..\n 0020 30a7ffff 00e2082a 10200003 00e03025 0......*. ....0%\n 0030 3c010001 00e13021 00c27023 448e2000 <.....0!..p#D. .\n 0040 87af000e 87b80012 468021a0 448f4000 ........F.!.D.@.\n 0050 00000000 468043a0 460c3082 4602703c ....F.C.F.0.F.p<\n 0060 46001006 45020004 44985000 10000009 F...E...D.P.....\n 0070 46007006 44985000 00000000 46805320 F.p.D.P.....F.S \n 0080 460c103c 00000000 45020003 4600040d F..<....E...F...\n 0090 46006006 4600040d 44088000 00000000 F.`.F...D.......\n 00a0 01023821 00c7082a 50200003 a4870000 ..8!...*P ......\n 00b0 00c03825 a4870000 84830000 00a31023 ..8%...........#\n 00c0 00021400 03e00008 00021403 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a100c1fe 00000000 . ..............\n 0010 0003f5df 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a100c1fe 00000000 0003f5df 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000033 0000001c 00000248 p......3.......H\n 0010 00000005 000003bc 00000001 00000264 ...............d\n 0020 00000004 00000298 00000000 00000000 ................\n 0030 00000011 000002c8 00000040 0000030c ...........@....\n 0040 00000018 0000034c 00000001 00000364 .......L.......d\n 0050 00000000 00000000 00000001 000003ac ................\n 0060 0150b250 101011f0 21211020 d012f010 .P.P....!!. ....\n 0070 f0111116 10231210 21230000 00000000 .....#..!#......\n 0080 00000001 00000000 00000000 00000000 ................\n 0090 ffffffff 00000000 00000000 00000000 ................\n 00a0 001d001f 00000004 0000001b 00000000 ................\n 00b0 00000001 00000000 2c200004 0000002a ........, .....*\n 00c0 00000000 1820000f 0000002a 000000cc ..... .....*....\n 00d0 20200001 00000001 00000000 20200000 .......... ..\n 00e0 02000000 03000000 04000000 05000000 ................\n 00f0 06000000 07000000 08000000 09000000 ................\n 0100 20000000 21000000 0a000000 0b000000 ...!...........\n 0110 0b000000 1a000000 00000000 00000003 ................\n 0120 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0130 7265616c 2d69646f 2d623633 30333139 real-ido-b630319\n 0140 36336333 61656233 662f752e 69006164 63c3aeb3f/u.i.ad\n 0150 645f6361 6c635f73 686f7274 5f616e67 d_calc_short_ang\n 0160 6c653300 6164645f 63616c63 5f73686f le3.add_calc_sho\n 0170 72745f61 6e676c65 33000000 00000000 rt_angle3.......\n 0180 00000001 00000000 00000040 00000000 ...........@....\n 0190 00000004 00000000 00000033 00000000 ...........3....\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 0000001a 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000000 00000000 . ..............\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc_short_angle3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:add_calc0:ido7.1","sym":"add_calc0","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","pointer"],"loc":11,"refSource":"void add_calc0(f32* pValue, f32 fraction, f32 step) {\n f32 stepSize = *pValue * fraction;\n\n if (stepSize > step) {\n stepSize = step;\n } else if (stepSize < -step) {\n stepSize = -step;\n }\n\n *pValue -= stepSize;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L425-L435","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f2,0(a0)\n 8:\tmtc1\ta2,$f14\n c:\tmul.s\t$f0,$f2,$f12\n 10:\tc.lt.s\t$f14,$f0\n 14:\tnop\n 18:\tbc1fl\t2c \n 1c:\tneg.s\t$f12,$f14\n 20:\tb\t40 \n 24:\tmov.s\t$f0,$f14\n 28:\tneg.s\t$f12,$f14\n 2c:\tc.lt.s\t$f0,$f12\n 30:\tnop\n 34:\tbc1fl\t44 \n 38:\tsub.s\t$f4,$f2,$f0\n 3c:\tmov.s\t$f0,$f12\n 40:\tsub.s\t$f4,$f2,$f0\n 44:\tjr\tra\n 48:\tswc1\t$f4,0(a0)\n 4c:\tnop\n","proto":{"add_calc0":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c add_calc0\n\n\nContents of section .text:\n 0000 44856000 c4820000 44867000 460c1002 D.`.....D.p.F...\n 0010 4600703c 00000000 45020004 46007307 F.p<....E...F.s.\n 0020 10000007 46007006 46007307 460c003c ....F.p.F.s.F..<\n 0030 00000000 45020003 46001101 46006006 ....E...F...F.`.\n 0040 46001101 03e00008 e4840000 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00007037 00000000 00000000 00007ff0 ..p7............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00007037 00000000 ...p......p7....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 0000000c 000001b8 p...............\n 0010 00000005 00000304 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000034 0000026c .......(...4...l\n 0040 0000000c 000002a0 00000001 000002ac ................\n 0050 00000000 00000000 00000001 000002f4 ................\n 0060 0010f010 13111410 2010f000 00000000 ........ .......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000001 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000004c ..... .....*...L\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d626438 32373063 real-ido-bd8270c\n 0130 37326164 64626664 642f752e 69006164 72addbfdd/u.i.ad\n 0140 645f6361 6c633000 6164645f 63616c63 d_calc0.add_calc\n 0150 30000000 00000000 00000001 00000000 0...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 00000013 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000b 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'add_calc0' — lift: cannot lift 'add_calc0': unmodelled control transfer 'bc1fl' at 0x18 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta1,$f12 */\n/* 4:\tlwc1\t$f2,0(a0) */\n/* 8:\tmtc1\ta2,$f14 */\n/* c:\tmul.s\t$f0,$f2,$f12 */\n/* 10:\tc.lt.s\t$f14,$f0 */\n/* 14:\tnop */\n/* 18:\tbc1fl\t2c */\n/* 1c:\tneg.s\t$f12,$f14 */\n/* 20:\tb\t40 */\n/* 24:\tmov.s\t$f0,$f14 */\n/* 28:\tneg.s\t$f12,$f14 */\n/* 2c:\tc.lt.s\t$f0,$f12 */\n/* 30:\tnop */\n/* 34:\tbc1fl\t44 */\n/* 38:\tsub.s\t$f4,$f2,$f0 */\n/* 3c:\tmov.s\t$f0,$f12 */\n/* 40:\tsub.s\t$f4,$f2,$f0 */\n/* 44:\tjr\tra */\n/* 48:\tswc1\t$f4,0(a0) */\n/* 4c:\tnop */\nvoid add_calc0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'add_calc0': unmodelled control transfer 'bc1fl' at 0x18 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":28,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'add_calc0': unmodelled control transfer 'bc1fl' at 0x18 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void add_calc0(f32 *arg0, f32 arg1, f32 arg2) {\n f32 temp_f12;\n f32 temp_f2;\n f32 var_f0;\n\n temp_f2 = *arg0;\n var_f0 = temp_f2 * arg1;\n if (arg2 < var_f0) {\n var_f0 = arg2;\n } else {\n temp_f12 = -arg2;\n if (var_f0 < temp_f12) {\n var_f0 = temp_f12;\n }\n }\n *arg0 = temp_f2 - var_f0;\n}\n","score":15,"maxScore":21,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":2,"opMismatch":0,"argMismatch":11},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":15,"maxScore":21,"ratio":0.7142857142857143,"kinds":{"insert":2,"delete":0,"replace":2,"opMismatch":0,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add_calc0` — benchmark function af:add_calc0:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc0\n mtc1\t$a1, $f12\n lwc1\t$f2, 0($a0)\n mtc1\t$a2, $f14\n mul.s\t$f0, $f2, $f12\n c.lt.s\t$f14, $f0\n nop\n bc1fl\t.L2c\n neg.s\t$f12, $f14\n b\t.L40\n mov.s\t$f0, $f14\n neg.s\t$f12, $f14\n.L2c:\n c.lt.s\t$f0, $f12\n nop\n bc1fl\t.L44\n sub.s\t$f4, $f2, $f0\n mov.s\t$f0, $f12\n.L40:\n sub.s\t$f4, $f2, $f0\n.L44:\n jr\t$ra\n swc1\t$f4, 0($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc0` — benchmark function af:add_calc0:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc0:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f2,0(a0)\n 8:\tmtc1\ta2,$f14\n c:\tmul.s\t$f0,$f2,$f12\n 10:\tc.lt.s\t$f14,$f0\n 14:\tnop\n 18:\tbc1fl\t2c \n 1c:\tneg.s\t$f12,$f14\n 20:\tb\t40 \n 24:\tmov.s\t$f0,$f14\n 28:\tneg.s\t$f12,$f14\n 2c:\tc.lt.s\t$f0,$f12\n 30:\tnop\n 34:\tbc1fl\t44 \n 38:\tsub.s\t$f4,$f2,$f0\n 3c:\tmov.s\t$f0,$f12\n 40:\tsub.s\t$f4,$f2,$f0\n 44:\tjr\tra\n 48:\tswc1\t$f4,0(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c add_calc0\n\n\nContents of section .text:\n 0000 44856000 c4820000 44867000 460c1002 D.`.....D.p.F...\n 0010 4600703c 00000000 45020004 46007307 F.p<....E...F.s.\n 0020 10000007 46007006 46007307 460c003c ....F.p.F.s.F..<\n 0030 00000000 45020003 46001101 46006006 ....E...F...F.`.\n 0040 46001101 03e00008 e4840000 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00007037 00000000 00000000 00007ff0 ..p7............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00007037 00000000 ...p......p7....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 0000000c 000001b8 p...............\n 0010 00000005 00000304 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000034 0000026c .......(...4...l\n 0040 0000000c 000002a0 00000001 000002ac ................\n 0050 00000000 00000000 00000001 000002f4 ................\n 0060 0010f010 13111410 2010f000 00000000 ........ .......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000001 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000004c ..... .....*...L\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d626438 32373063 real-ido-bd8270c\n 0130 37326164 64626664 642f752e 69006164 72addbfdd/u.i.ad\n 0140 645f6361 6c633000 6164645f 63616c63 d_calc0.add_calc\n 0150 30000000 00000000 00000001 00000000 0...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 00000013 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000b 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add_calc0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:add_calc2:ido7.1","sym":"add_calc2","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","pointer"],"loc":14,"refSource":"void add_calc2(f32* pValue, f32 target, f32 fraction, f32 step) {\n f32 stepSize;\n if (*pValue != target) {\n stepSize = fraction * (target - *pValue);\n\n if (stepSize > step) {\n stepSize = step;\n } else if (stepSize < -step) {\n stepSize = -step;\n }\n\n *pValue += stepSize;\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L410-L423","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tc.eq.s\t$f12,$f0\n 14:\tnop\n 18:\tbc1t\t68 \n 1c:\tnop\n 20:\tsub.s\t$f4,$f12,$f0\n 24:\tlwc1\t$f6,12(sp)\n 28:\tlwc1\t$f12,12(sp)\n 2c:\tmul.s\t$f2,$f4,$f14\n 30:\tc.lt.s\t$f6,$f2\n 34:\tnop\n 38:\tbc1fl\t4c \n 3c:\tneg.s\t$f12,$f12\n 40:\tb\t60 \n 44:\tmov.s\t$f2,$f6\n 48:\tneg.s\t$f12,$f12\n 4c:\tc.lt.s\t$f2,$f12\n 50:\tnop\n 54:\tbc1fl\t64 \n 58:\tadd.s\t$f8,$f0,$f2\n 5c:\tmov.s\t$f2,$f12\n 60:\tadd.s\t$f8,$f0,$f2\n 64:\tswc1\t$f8,0(a0)\n 68:\tjr\tra\n 6c:\tnop\n","proto":{"add_calc2":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000070 add_calc2\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 46006032 00000000 45010013 00000000 F.`2....E.......\n 0020 46006101 c7a6000c c7ac000c 460e2082 F.a.........F. .\n 0030 4602303c 00000000 45020004 46006307 F.0<....E...F.c.\n 0040 10000007 46003086 46006307 460c103c ....F.0.F.c.F..<\n 0050 00000000 45020003 46020200 46006086 ....E...F...F.`.\n 0060 46020200 e4880000 03e00008 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 0000737d 00000000 00000000 00007ff0 ..s}............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 0000737d 00000000 ..........s}....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001c 00000010 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e8 .......(........\n 0020 00000004 0000021c 00000000 00000000 ................\n 0030 00000011 0000024c 00000034 00000290 .......L...4....\n 0040 0000000c 000002c4 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 0120e023 101020d0 13111410 21210000 . .#.. .....!!..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000001 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000070 20200001 00000001 00000000 ...p ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d356161 nch-real-ido-5aa\n 0130 63353333 32623061 63613537 642f752e c5332b0aca57d/u.\n 0140 69006164 645f6361 6c633200 6164645f i.add_calc2.add_\n 0150 63616c63 32000000 00000000 00000001 calc2...........\n 0160 00000000 00000034 00000000 00000004 .......4........\n 0170 00000000 0000001c 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000e ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'add_calc2' — lift: cannot lift 'add_calc2': unmodelled control transfer 'bc1t' at 0x18 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta3,12(sp) */\n/* 4:\tmtc1\ta1,$f12 */\n/* 8:\tlwc1\t$f0,0(a0) */\n/* c:\tmtc1\ta2,$f14 */\n/* 10:\tc.eq.s\t$f12,$f0 */\n/* 14:\tnop */\n/* 18:\tbc1t\t68 */\n/* 1c:\tnop */\n/* 20:\tsub.s\t$f4,$f12,$f0 */\n/* 24:\tlwc1\t$f6,12(sp) */\n/* 28:\tlwc1\t$f12,12(sp) */\n/* 2c:\tmul.s\t$f2,$f4,$f14 */\n/* 30:\tc.lt.s\t$f6,$f2 */\n/* 34:\tnop */\n/* 38:\tbc1fl\t4c */\n/* 3c:\tneg.s\t$f12,$f12 */\n/* 40:\tb\t60 */\n/* 44:\tmov.s\t$f2,$f6 */\n/* 48:\tneg.s\t$f12,$f12 */\n/* 4c:\tc.lt.s\t$f2,$f12 */\n/* 50:\tnop */\n/* 54:\tbc1fl\t64 */\n/* 58:\tadd.s\t$f8,$f0,$f2 */\n/* 5c:\tmov.s\t$f2,$f12 */\n/* 60:\tadd.s\t$f8,$f0,$f2 */\n/* 64:\tswc1\t$f8,0(a0) */\n/* 68:\tjr\tra */\n/* 6c:\tnop */\nvoid add_calc2(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'add_calc2': unmodelled control transfer 'bc1t' at 0x18 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":36,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'add_calc2': unmodelled control transfer 'bc1t' at 0x18 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void add_calc2(f32 *arg0, f32 arg1, f32 arg2, f32 arg3) {\n f32 temp_f0;\n f32 temp_f12;\n f32 var_f2;\n\n temp_f0 = *arg0;\n if (arg1 != temp_f0) {\n var_f2 = (arg1 - temp_f0) * arg2;\n if (arg3 < var_f2) {\n var_f2 = arg3;\n } else {\n temp_f12 = -arg3;\n if (var_f2 < temp_f12) {\n var_f2 = temp_f12;\n }\n }\n *arg0 = temp_f0 + var_f2;\n }\n}\n","score":4,"maxScore":28,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":28,"ratio":0.14285714285714285,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add_calc2` — benchmark function af:add_calc2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add_calc2\n sw\t$a3, 12($sp)\n mtc1\t$a1, $f12\n lwc1\t$f0, 0($a0)\n mtc1\t$a2, $f14\n c.eq.s\t$f12, $f0\n nop\n bc1t\t.L68\n nop\n sub.s\t$f4, $f12, $f0\n lwc1\t$f6, 12($sp)\n lwc1\t$f12, 12($sp)\n mul.s\t$f2, $f4, $f14\n c.lt.s\t$f6, $f2\n nop\n bc1fl\t.L4c\n neg.s\t$f12, $f12\n b\t.L60\n mov.s\t$f2, $f6\n neg.s\t$f12, $f12\n.L4c:\n c.lt.s\t$f2, $f12\n nop\n bc1fl\t.L64\n add.s\t$f8, $f0, $f2\n mov.s\t$f2, $f12\n.L60:\n add.s\t$f8, $f0, $f2\n.L64:\n swc1\t$f8, 0($a0)\n.L68:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add_calc2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add_calc2` — benchmark function af:add_calc2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:add_calc2:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tc.eq.s\t$f12,$f0\n 14:\tnop\n 18:\tbc1t\t68 \n 1c:\tnop\n 20:\tsub.s\t$f4,$f12,$f0\n 24:\tlwc1\t$f6,12(sp)\n 28:\tlwc1\t$f12,12(sp)\n 2c:\tmul.s\t$f2,$f4,$f14\n 30:\tc.lt.s\t$f6,$f2\n 34:\tnop\n 38:\tbc1fl\t4c \n 3c:\tneg.s\t$f12,$f12\n 40:\tb\t60 \n 44:\tmov.s\t$f2,$f6\n 48:\tneg.s\t$f12,$f12\n 4c:\tc.lt.s\t$f2,$f12\n 50:\tnop\n 54:\tbc1fl\t64 \n 58:\tadd.s\t$f8,$f0,$f2\n 5c:\tmov.s\t$f2,$f12\n 60:\tadd.s\t$f8,$f0,$f2\n 64:\tswc1\t$f8,0(a0)\n 68:\tjr\tra\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000070 add_calc2\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 46006032 00000000 45010013 00000000 F.`2....E.......\n 0020 46006101 c7a6000c c7ac000c 460e2082 F.a.........F. .\n 0030 4602303c 00000000 45020004 46006307 F.0<....E...F.c.\n 0040 10000007 46003086 46006307 460c103c ....F.0.F.c.F..<\n 0050 00000000 45020003 46020200 46006086 ....E...F...F.`.\n 0060 46020200 e4880000 03e00008 00000000 F...............\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 0000737d 00000000 00000000 00007ff0 ..s}............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 0000737d 00000000 ..........s}....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001c 00000010 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e8 .......(........\n 0020 00000004 0000021c 00000000 00000000 ................\n 0030 00000011 0000024c 00000034 00000290 .......L...4....\n 0040 0000000c 000002c4 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 0120e023 101020d0 13111410 21210000 . .#.. .....!!..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000001 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000070 20200001 00000001 00000000 ...p ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d356161 nch-real-ido-5aa\n 0130 63353333 32623061 63613537 642f752e c5332b0aca57d/u.\n 0140 69006164 645f6361 6c633200 6164645f i.add_calc2.add_\n 0150 63616c63 32000000 00000000 00000001 calc2...........\n 0160 00000000 00000034 00000000 00000004 .......4........\n 0170 00000000 0000001c 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000e ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add_calc2\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add_calc2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:adds:ido7.1","sym":"adds","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","branch","pointer"],"loc":16,"refSource":"void adds(s16* pValue, s16 target, s16 scale, s16 maxStep) {\n s16 diff = target - *pValue;\n diff /= scale;\n\n if (diff > maxStep) {\n *pValue += maxStep;\n return;\n }\n\n if (diff < -maxStep) {\n *pValue -= maxStep;\n return;\n }\n\n *pValue += diff;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L565-L580","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tsw\ta3,12(sp)\n c:\tlh\tv1,0(a0)\n 10:\tsll\ta1,a1,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tsubu\tv0,a1,v1\n 1c:\tsll\tv0,v0,0x10\n 20:\tsra\tv0,v0,0x10\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0x10\n 2c:\tdiv\tzero,v0,a2\n 30:\tsll\ta3,a3,0x10\n 34:\tsra\ta3,a3,0x10\n 38:\tbnez\ta2,44 \n 3c:\tnop\n 40:\tbreak\t0x7\n 44:\tli\tat,-1\n 48:\tbne\ta2,at,5c \n 4c:\tlui\tat,0x8000\n 50:\tbne\tv0,at,5c \n 54:\tnop\n 58:\tbreak\t0x6\n 5c:\tmflo\tv0\n 60:\tsll\tv0,v0,0x10\n 64:\tsra\tv0,v0,0x10\n 68:\tslt\tat,a3,v0\n 6c:\tbeqz\tat,80 \n 70:\tnegu\tt7,a3\n 74:\taddu\tt6,v1,a3\n 78:\tjr\tra\n 7c:\tsh\tt6,0(a0)\n 80:\tslt\tat,v0,t7\n 84:\tbeqz\tat,98 \n 88:\taddu\tt9,v1,v0\n 8c:\tsubu\tt8,v1,a3\n 90:\tjr\tra\n 94:\tsh\tt8,0(a0)\n 98:\tsh\tt9,0(a0)\n 9c:\tjr\tra\n a0:\tnop\n\t...\n","proto":{"adds":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 adds\n\n\nContents of section .text:\n 0000 afa50004 afa60008 afa7000c 84830000 ................\n 0010 00052c00 00052c03 00a31023 00021400 ..,...,....#....\n 0020 00021403 00063400 00063403 0046001a ......4...4..F..\n 0030 00073c00 00073c03 14c00002 00000000 ..<...<.........\n 0040 0007000d 2401ffff 14c10004 3c018000 ....$.......<...\n 0050 14410002 00000000 0006000d 00001012 .A..............\n 0060 00021400 00021403 00e2082a 10200004 ...........*. ..\n 0070 00077823 00677021 03e00008 a48e0000 ..x#.gp!........\n 0080 004f082a 10200004 0062c821 0067c023 .O.*. ...b.!.g.#\n 0090 03e00008 a4980000 a4990000 03e00008 ................\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c0fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c0fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000018 00000218 p......)........\n 0010 00000005 00000368 00000001 00000230 .......h.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 00000030 000002d8 ...........0....\n 0040 00000008 00000308 00000001 00000310 ................\n 0050 00000000 00000000 00000001 00000358 ...............X\n 0060 0210f112 f120e128 021140d0 10f03140 ..... .(..@...1@\n 0070 d010f030 11000000 00000000 00000001 ...0............\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000001 0000000d 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000a4 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d316135 32303738 66643466 -ido-1a52078fd4f\n 0140 39646139 332f752e 69006164 64730000 9da93/u.i.adds..\n 0150 61646473 00000000 00000000 00000001 adds............\n 0160 00000000 0000002f 00000000 00000004 ......./........\n 0170 00000000 00000029 00000000 00000000 .......)........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000015 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"nonmatch","source":"void adds(s16 * a0, s32 a1, s32 a2, s32 a3) {\n s32 v0;\n v0 = *a0;\n if (a3 << 16 >> 16 < ((a1 << 16 >> 16) - v0 << 16 >> 16) / (a2 << 16 >> 16) << 16 >> 16) {\n *a0 = v0 + (a3 << 16 >> 16);\n return;\n } else {\n if (((a1 << 16 >> 16) - v0 << 16 >> 16) / (a2 << 16 >> 16) << 16 >> 16 < -(a3 << 16 >> 16)) {\n *a0 = v0 - (a3 << 16 >> 16);\n return;\n } else {\n *a0 = v0 + (((a1 << 16 >> 16) - v0 << 16 >> 16) / (a2 << 16 >> 16) << 16 >> 16);\n return;\n }\n }\n}\n","score":32,"maxScore":44,"compileErrors":null,"breakdown":{"insert":3,"delete":6,"replace":0,"opMismatch":0,"argMismatch":23},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void adds(s16 *arg0, s16 arg1, s16 arg2, s16 arg3) {\n s16 temp_v1;\n s32 temp_lo;\n\n temp_v1 = *arg0;\n temp_lo = (s16) (arg1 - temp_v1) / arg2;\n if (arg3 < (s16) temp_lo) {\n *arg0 = temp_v1 + arg3;\n return;\n }\n if ((s16) temp_lo < -arg3) {\n *arg0 = temp_v1 - arg3;\n return;\n }\n *arg0 = temp_v1 + (s16) temp_lo;\n}\n","score":24,"maxScore":44,"compileErrors":null,"breakdown":{"insert":3,"delete":3,"replace":0,"opMismatch":0,"argMismatch":18},"quality":{"score":96,"lines":15,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":24,"maxScore":44,"ratio":0.5454545454545454,"kinds":{"insert":3,"delete":3,"replace":0,"opMismatch":0,"argMismatch":18}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `adds` — benchmark function af:adds:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel adds\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n sw\t$a3, 12($sp)\n lh\t$v1, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n subu\t$v0, $a1, $v1\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n div\t$zero, $v0, $a2\n sll\t$a3, $a3, 0x10\n sra\t$a3, $a3, 0x10\n bnez\t$a2, .L44\n nop\n break\t0x7\n.L44:\n li\t$at, -1\n bne\t$a2, $at, .L5c\n lui\t$at, 0x8000\n bne\t$v0, $at, .L5c\n nop\n break\t0x6\n.L5c:\n mflo\t$v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slt\t$at, $a3, $v0\n beqz\t$at, .L80\n negu\t$t7, $a3\n addu\t$t6, $v1, $a3\n jr\t$ra\n sh\t$t6, 0($a0)\n.L80:\n slt\t$at, $v0, $t7\n beqz\t$at, .L98\n addu\t$t9, $v1, $v0\n subu\t$t8, $v1, $a3\n jr\t$ra\n sh\t$t8, 0($a0)\n.L98:\n sh\t$t9, 0($a0)\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function adds # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `adds` — benchmark function af:adds:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:adds:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tsw\ta3,12(sp)\n c:\tlh\tv1,0(a0)\n 10:\tsll\ta1,a1,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tsubu\tv0,a1,v1\n 1c:\tsll\tv0,v0,0x10\n 20:\tsra\tv0,v0,0x10\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0x10\n 2c:\tdiv\tzero,v0,a2\n 30:\tsll\ta3,a3,0x10\n 34:\tsra\ta3,a3,0x10\n 38:\tbnez\ta2,44 \n 3c:\tnop\n 40:\tbreak\t0x7\n 44:\tli\tat,-1\n 48:\tbne\ta2,at,5c \n 4c:\tlui\tat,0x8000\n 50:\tbne\tv0,at,5c \n 54:\tnop\n 58:\tbreak\t0x6\n 5c:\tmflo\tv0\n 60:\tsll\tv0,v0,0x10\n 64:\tsra\tv0,v0,0x10\n 68:\tslt\tat,a3,v0\n 6c:\tbeqz\tat,80 \n 70:\tnegu\tt7,a3\n 74:\taddu\tt6,v1,a3\n 78:\tjr\tra\n 7c:\tsh\tt6,0(a0)\n 80:\tslt\tat,v0,t7\n 84:\tbeqz\tat,98 \n 88:\taddu\tt9,v1,v0\n 8c:\tsubu\tt8,v1,a3\n 90:\tjr\tra\n 94:\tsh\tt8,0(a0)\n 98:\tsh\tt9,0(a0)\n 9c:\tjr\tra\n a0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 adds\n\n\nContents of section .text:\n 0000 afa50004 afa60008 afa7000c 84830000 ................\n 0010 00052c00 00052c03 00a31023 00021400 ..,...,....#....\n 0020 00021403 00063400 00063403 0046001a ......4...4..F..\n 0030 00073c00 00073c03 14c00002 00000000 ..<...<.........\n 0040 0007000d 2401ffff 14c10004 3c018000 ....$.......<...\n 0050 14410002 00000000 0006000d 00001012 .A..............\n 0060 00021400 00021403 00e2082a 10200004 ...........*. ..\n 0070 00077823 00677021 03e00008 a48e0000 ..x#.gp!........\n 0080 004f082a 10200004 0062c821 0067c023 .O.*. ...b.!.g.#\n 0090 03e00008 a4980000 a4990000 03e00008 ................\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c0fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c0fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000018 00000218 p......)........\n 0010 00000005 00000368 00000001 00000230 .......h.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 00000030 000002d8 ...........0....\n 0040 00000008 00000308 00000001 00000310 ................\n 0050 00000000 00000000 00000001 00000358 ...............X\n 0060 0210f112 f120e128 021140d0 10f03140 ..... .(..@...1@\n 0070 d010f030 11000000 00000000 00000001 ...0............\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000001 0000000d 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000a4 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d316135 32303738 66643466 -ido-1a52078fd4f\n 0140 39646139 332f752e 69006164 64730000 9da93/u.i.adds..\n 0150 61646473 00000000 00000000 00000001 adds............\n 0160 00000000 0000002f 00000000 00000004 ......./........\n 0170 00000000 00000029 00000000 00000000 .......)........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000015 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"adds\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name adds # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_angle:ido7.1","sym":"chase_angle","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","call","global"],"loc":20,"refSource":"s32 chase_angle(s16* pValue, s16 target, s16 step) {\n if (step != 0) {\n f32 updateScale = game_GameFrame_2F;\n\n if ((s16)(*pValue - target) > 0) {\n step = -step;\n }\n\n *pValue += (s16)(step * updateScale);\n\n if (((s16)(*pValue - target) * step) >= 0) {\n *pValue = target;\n return TRUE;\n }\n } else if (*pValue == target) {\n return TRUE;\n }\n\n return FALSE;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L51-L70","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,98 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tlui\tat,0x0\n 24:\tlwc1\t$f0,0(at)\n 28:\tsubu\tt6,v0,a1\n 2c:\tsll\tt7,t6,0x10\n 30:\tsra\tt8,t7,0x10\n 34:\tblezl\tt8,4c \n 38:\tmtc1\ta2,$f4\n 3c:\tnegu\ta2,a2\n 40:\tsll\ta2,a2,0x10\n 44:\tsra\ta2,a2,0x10\n 48:\tmtc1\ta2,$f4\n 4c:\tnop\n 50:\tcvt.s.w\t$f6,$f4\n 54:\tmul.s\t$f8,$f6,$f0\n 58:\ttrunc.w.s\t$f10,$f8\n 5c:\tmfc1\tt2,$f10\n 60:\tnop\n 64:\taddu\tt3,v0,t2\n 68:\tsh\tt3,0(a0)\n 6c:\tlh\tt4,0(a0)\n 70:\tli\tv0,1\n 74:\tsubu\tt5,t4,a1\n 78:\tsll\tt6,t5,0x10\n 7c:\tsra\tt7,t6,0x10\n 80:\tmultu\tt7,a2\n 84:\tmflo\tt8\n 88:\tbltzl\tt8,b0 \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tsh\ta1,0(a0)\n 98:\tlh\tt9,0(a0)\n 9c:\tbnel\ta1,t9,b0 \n a0:\tmove\tv0,zero\n a4:\tjr\tra\n a8:\tli\tv0,1\n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000c0 .text\n00000000 g F .text\t000000b8 chase_angle\n00000000 O *UND*\t00000004 game_GameFrame_2F\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_HI16 game_GameFrame_2F\n00000024 R_MIPS_LO16 game_GameFrame_2F\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00020 00052c03 84820000 ..4.... ..,.....\n 0020 3c010000 c4200000 00457023 000e7c00 <.... ...Ep#..|.\n 0030 000fc403 5b000005 44862000 00063023 ....[...D. ...0#\n 0040 00063400 00063403 44862000 00000000 ..4...4.D. .....\n 0050 468021a0 46003202 4600428d 440a5000 F.!.F.2.F.B.D.P.\n 0060 00000000 004a5821 a48b0000 848c0000 .....JX!........\n 0070 24020001 01856823 000d7400 000e7c03 $.....h#..t...|.\n 0080 01e60019 0000c012 07020009 00001025 ...............%\n 0090 03e00008 a4850000 84990000 54b90004 ............T...\n 00a0 00001025 03e00008 24020001 00001025 ...%....$......%\n 00b0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300fc76 00000000 . .........v....\n 0010 00000fd1 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300fc76 00000000 00000fd1 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002e 00000010 00000268 p..............h\n 0010 00000006 000003e0 00000001 00000278 ...............x\n 0020 00000004 000002ac 00000000 00000000 ................\n 0030 00000011 000002dc 00000038 00000320 ...........8... \n 0040 00000020 00000358 00000001 00000378 ... ...X.......x\n 0050 00000000 00000000 00000002 000003c0 ................\n 0060 0410f030 f1141228 1020e620 f0321122 ...0...(. . .2.\"\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000004 00000012 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000b8 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d616634 nch-real-ido-af4\n 0130 61653161 35363662 62633664 312f752e ae1a566bbc6d1/u.\n 0140 69006368 6173655f 616e676c 65000000 i.chase_angle...\n 0150 63686173 655f616e 676c6500 67616d65 chase_angle.game\n 0160 5f47616d 65467261 6d655f32 46000000 _GameFrame_2F...\n 0170 00000000 00000001 00000000 00000036 ...............6\n 0180 00000000 00000004 00000000 0000002e ................\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000010 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000c ..... ..........\n 01d0 00000000 04cfffff 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 7fffffff 00000000 7fffffff 00000001 ................\n 0200 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'chase_angle' — lift: cannot lift 'chase_angle': unmodelled control transfer 'blezl' at 0x34 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta2,8(sp) */\n/* 4:\tsll\ta2,a2,0x10 */\n/* 8:\tsw\ta1,4(sp) */\n/* c:\tsll\ta1,a1,0x10 */\n/* 10:\tsra\ta2,a2,0x10 */\n/* 14:\tbeqz\ta2,98 */\n/* 18:\tsra\ta1,a1,0x10 */\n/* 1c:\tlh\tv0,0(a0) */\n/* 20:\tlui\tat,0x0 */\n/* 24:\tlwc1\t$f0,0(at) */\n/* 28:\tsubu\tt6,v0,a1 */\n/* 2c:\tsll\tt7,t6,0x10 */\n/* 30:\tsra\tt8,t7,0x10 */\n/* 34:\tblezl\tt8,4c */\n/* 38:\tmtc1\ta2,$f4 */\n/* 3c:\tnegu\ta2,a2 */\n/* 40:\tsll\ta2,a2,0x10 */\n/* 44:\tsra\ta2,a2,0x10 */\n/* 48:\tmtc1\ta2,$f4 */\n/* 4c:\tnop */\n/* 50:\tcvt.s.w\t$f6,$f4 */\n/* 54:\tmul.s\t$f8,$f6,$f0 */\n/* 58:\ttrunc.w.s\t$f10,$f8 */\n/* 5c:\tmfc1\tt2,$f10 */\n/* 60:\tnop */\n/* 64:\taddu\tt3,v0,t2 */\n/* 68:\tsh\tt3,0(a0) */\n/* 6c:\tlh\tt4,0(a0) */\n/* 70:\tli\tv0,1 */\n/* 74:\tsubu\tt5,t4,a1 */\n/* 78:\tsll\tt6,t5,0x10 */\n/* 7c:\tsra\tt7,t6,0x10 */\n/* 80:\tmultu\tt7,a2 */\n/* 84:\tmflo\tt8 */\n/* 88:\tbltzl\tt8,b0 */\n/* 8c:\tmove\tv0,zero */\n/* 90:\tjr\tra */\n/* 94:\tsh\ta1,0(a0) */\n/* 98:\tlh\tt9,0(a0) */\n/* 9c:\tbnel\ta1,t9,b0 */\n/* a0:\tmove\tv0,zero */\n/* a4:\tjr\tra */\n/* a8:\tli\tv0,1 */\n/* ac:\tmove\tv0,zero */\n/* b0:\tjr\tra */\n/* b4:\tnop */\n/* \t... */\nvoid chase_angle(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'chase_angle': unmodelled control transfer 'blezl' at 0x34 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":55,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'chase_angle': unmodelled control transfer 'blezl' at 0x34 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern f32 game_GameFrame_2F;\n\ns32 chase_angle(s16 *arg0, s16 arg1, s16 arg2) {\n s16 temp_v0;\n s16 var_a2;\n\n var_a2 = arg2;\n if (var_a2 != 0) {\n temp_v0 = *arg0;\n if ((s16) (temp_v0 - arg1) > 0) {\n var_a2 *= -1;\n }\n *arg0 = temp_v0 + (s32) ((f32) var_a2 * game_GameFrame_2F);\n if (((s16) (*arg0 - arg1) * var_a2) >= 0) {\n *arg0 = arg1;\n return 1;\n }\n /* Duplicate return node #7. Try simplifying control flow for better match */\n return 0;\n }\n if (arg1 == *arg0) {\n return 1;\n }\n return 0;\n}\n","score":47,"maxScore":62,"compileErrors":null,"breakdown":{"insert":16,"delete":13,"replace":2,"opMismatch":0,"argMismatch":16},"quality":{"score":98,"lines":23,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":47,"maxScore":62,"ratio":0.7580645161290323,"kinds":{"insert":16,"delete":13,"replace":2,"opMismatch":0,"argMismatch":16}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_angle` — benchmark function af:chase_angle:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_angle\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .L98\n sra\t$a1, $a1, 0x10\n lh\t$v0, 0($a0)\n lui\t$at, %hi(game_GameFrame_2F)\n lwc1\t$f0, %lo(game_GameFrame_2F)($at)\n subu\t$t6, $v0, $a1\n sll\t$t7, $t6, 0x10\n sra\t$t8, $t7, 0x10\n blezl\t$t8, .L4c\n mtc1\t$a2, $f4\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n mtc1\t$a2, $f4\n.L4c:\n nop\n cvt.s.w\t$f6, $f4\n mul.s\t$f8, $f6, $f0\n trunc.w.s\t$f10, $f8\n mfc1\t$t2, $f10\n nop\n addu\t$t3, $v0, $t2\n sh\t$t3, 0($a0)\n lh\t$t4, 0($a0)\n li\t$v0, 1\n subu\t$t5, $t4, $a1\n sll\t$t6, $t5, 0x10\n sra\t$t7, $t6, 0x10\n multu\t$t7, $a2\n mflo\t$t8\n bltzl\t$t8, .Lb0\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.L98:\n lh\t$t9, 0($a0)\n bnel\t$a1, $t9, .Lb0\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.Lb0:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_angle # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_angle` — benchmark function af:chase_angle:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_angle:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,98 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tlui\tat,0x0\n 24:\tlwc1\t$f0,0(at)\n 28:\tsubu\tt6,v0,a1\n 2c:\tsll\tt7,t6,0x10\n 30:\tsra\tt8,t7,0x10\n 34:\tblezl\tt8,4c \n 38:\tmtc1\ta2,$f4\n 3c:\tnegu\ta2,a2\n 40:\tsll\ta2,a2,0x10\n 44:\tsra\ta2,a2,0x10\n 48:\tmtc1\ta2,$f4\n 4c:\tnop\n 50:\tcvt.s.w\t$f6,$f4\n 54:\tmul.s\t$f8,$f6,$f0\n 58:\ttrunc.w.s\t$f10,$f8\n 5c:\tmfc1\tt2,$f10\n 60:\tnop\n 64:\taddu\tt3,v0,t2\n 68:\tsh\tt3,0(a0)\n 6c:\tlh\tt4,0(a0)\n 70:\tli\tv0,1\n 74:\tsubu\tt5,t4,a1\n 78:\tsll\tt6,t5,0x10\n 7c:\tsra\tt7,t6,0x10\n 80:\tmultu\tt7,a2\n 84:\tmflo\tt8\n 88:\tbltzl\tt8,b0 \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tsh\ta1,0(a0)\n 98:\tlh\tt9,0(a0)\n 9c:\tbnel\ta1,t9,b0 \n a0:\tmove\tv0,zero\n a4:\tjr\tra\n a8:\tli\tv0,1\n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000c0 .text\n00000000 g F .text\t000000b8 chase_angle\n00000000 O *UND*\t00000004 game_GameFrame_2F\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_HI16 game_GameFrame_2F\n00000024 R_MIPS_LO16 game_GameFrame_2F\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00020 00052c03 84820000 ..4.... ..,.....\n 0020 3c010000 c4200000 00457023 000e7c00 <.... ...Ep#..|.\n 0030 000fc403 5b000005 44862000 00063023 ....[...D. ...0#\n 0040 00063400 00063403 44862000 00000000 ..4...4.D. .....\n 0050 468021a0 46003202 4600428d 440a5000 F.!.F.2.F.B.D.P.\n 0060 00000000 004a5821 a48b0000 848c0000 .....JX!........\n 0070 24020001 01856823 000d7400 000e7c03 $.....h#..t...|.\n 0080 01e60019 0000c012 07020009 00001025 ...............%\n 0090 03e00008 a4850000 84990000 54b90004 ............T...\n 00a0 00001025 03e00008 24020001 00001025 ...%....$......%\n 00b0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300fc76 00000000 . .........v....\n 0010 00000fd1 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300fc76 00000000 00000fd1 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002e 00000010 00000268 p..............h\n 0010 00000006 000003e0 00000001 00000278 ...............x\n 0020 00000004 000002ac 00000000 00000000 ................\n 0030 00000011 000002dc 00000038 00000320 ...........8... \n 0040 00000020 00000358 00000001 00000378 ... ...X.......x\n 0050 00000000 00000000 00000002 000003c0 ................\n 0060 0410f030 f1141228 1020e620 f0321122 ...0...(. . .2.\"\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000004 00000012 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000b8 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d616634 nch-real-ido-af4\n 0130 61653161 35363662 62633664 312f752e ae1a566bbc6d1/u.\n 0140 69006368 6173655f 616e676c 65000000 i.chase_angle...\n 0150 63686173 655f616e 676c6500 67616d65 chase_angle.game\n 0160 5f47616d 65467261 6d655f32 46000000 _GameFrame_2F...\n 0170 00000000 00000001 00000000 00000036 ...............6\n 0180 00000000 00000004 00000000 0000002e ................\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000010 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000c ..... ..........\n 01d0 00000000 04cfffff 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 7fffffff 00000000 7fffffff 00000001 ................\n 0200 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_angle # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_f:ido7.1","sym":"chase_f","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","call"],"loc":19,"refSource":"s32 chase_f(f32* pValue, f32 target, f32 step) {\n if (step) {\n if (*pValue > target) {\n step = -step;\n }\n\n *pValue += step;\n\n if ((step * (*pValue - target)) >= 0.0f) {\n *pValue = target;\n return TRUE;\n }\n } else {\n if (*pValue == target) {\n return TRUE;\n }\n }\n return FALSE;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L92-L110","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta2,$f12\n 4:\tmtc1\tzero,$f4\n 8:\tmtc1\ta1,$f14\n c:\tc.eq.s\t$f12,$f4\n 10:\tnop\n 14:\tbc1tl\t6c \n 18:\tlwc1\t$f4,0(a0)\n 1c:\tlwc1\t$f0,0(a0)\n 20:\tli\tv0,1\n 24:\tc.lt.s\t$f14,$f0\n 28:\tnop\n 2c:\tbc1fl\t3c \n 30:\tadd.s\t$f6,$f0,$f12\n 34:\tneg.s\t$f12,$f12\n 38:\tadd.s\t$f6,$f0,$f12\n 3c:\tmtc1\tzero,$f18\n 40:\tswc1\t$f6,0(a0)\n 44:\tlwc1\t$f8,0(a0)\n 48:\tsub.s\t$f10,$f8,$f14\n 4c:\tmul.s\t$f16,$f10,$f12\n 50:\tc.le.s\t$f18,$f16\n 54:\tnop\n 58:\tbc1fl\t88 \n 5c:\tmove\tv0,zero\n 60:\tjr\tra\n 64:\tswc1\t$f14,0(a0)\n 68:\tlwc1\t$f4,0(a0)\n 6c:\tc.eq.s\t$f14,$f4\n 70:\tnop\n 74:\tbc1fl\t88 \n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tli\tv0,1\n 84:\tmove\tv0,zero\n 88:\tjr\tra\n 8c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000090 chase_f\n\n\nContents of section .text:\n 0000 44866000 44802000 44857000 46046032 D.`.D. .D.p.F.`2\n 0010 00000000 45030015 c4840000 c4800000 ....E...........\n 0020 24020001 4600703c 00000000 45020003 $...F.p<....E...\n 0030 460c0180 46006307 460c0180 44809000 F...F.c.F...D...\n 0040 e4860000 c4880000 460e4281 460c5402 ........F.B.F.T.\n 0050 4610903e 00000000 4502000b 00001025 F..>....E......%\n 0060 03e00008 e48e0000 c4840000 46047032 ............F.p2\n 0070 00000000 45020004 00001025 03e00008 ....E......%....\n 0080 24020001 00001025 03e00008 00000000 $......%........\nContents of section .options:\n 0000 01200000 00000000 80000074 00000000 . .........t....\n 0010 00077dd1 00000000 00000000 00007ff0 ..}.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00077dd1 00000000 ...t......}.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000024 00000014 000001f8 p......$........\n 0010 00000005 00000348 00000001 0000020c .......H........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000034 000002b4 .......p...4....\n 0040 00000008 000002e8 00000001 000002f0 ................\n 0050 00000000 00000000 00000001 00000338 ...............8\n 0060 0010f013 1060a310 2010f016 20f04411 .....`.. ... .D.\n 0070 32000000 00000000 00000001 00000000 2...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000090 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d383936 32613031 66623762 32616536 -8962a01fb7b2ae6\n 0140 312f752e 69006368 6173655f 66000000 1/u.i.chase_f...\n 0150 63686173 655f6600 00000000 00000001 chase_f.........\n 0160 00000000 00000032 00000000 00000004 .......2........\n 0170 00000000 00000024 00000000 00000000 .......$........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000011 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'chase_f' — lift: cannot lift 'chase_f': unmodelled control transfer 'bc1tl' at 0x14 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta2,$f12 */\n/* 4:\tmtc1\tzero,$f4 */\n/* 8:\tmtc1\ta1,$f14 */\n/* c:\tc.eq.s\t$f12,$f4 */\n/* 10:\tnop */\n/* 14:\tbc1tl\t6c */\n/* 18:\tlwc1\t$f4,0(a0) */\n/* 1c:\tlwc1\t$f0,0(a0) */\n/* 20:\tli\tv0,1 */\n/* 24:\tc.lt.s\t$f14,$f0 */\n/* 28:\tnop */\n/* 2c:\tbc1fl\t3c */\n/* 30:\tadd.s\t$f6,$f0,$f12 */\n/* 34:\tneg.s\t$f12,$f12 */\n/* 38:\tadd.s\t$f6,$f0,$f12 */\n/* 3c:\tmtc1\tzero,$f18 */\n/* 40:\tswc1\t$f6,0(a0) */\n/* 44:\tlwc1\t$f8,0(a0) */\n/* 48:\tsub.s\t$f10,$f8,$f14 */\n/* 4c:\tmul.s\t$f16,$f10,$f12 */\n/* 50:\tc.le.s\t$f18,$f16 */\n/* 54:\tnop */\n/* 58:\tbc1fl\t88 */\n/* 5c:\tmove\tv0,zero */\n/* 60:\tjr\tra */\n/* 64:\tswc1\t$f14,0(a0) */\n/* 68:\tlwc1\t$f4,0(a0) */\n/* 6c:\tc.eq.s\t$f14,$f4 */\n/* 70:\tnop */\n/* 74:\tbc1fl\t88 */\n/* 78:\tmove\tv0,zero */\n/* 7c:\tjr\tra */\n/* 80:\tli\tv0,1 */\n/* 84:\tmove\tv0,zero */\n/* 88:\tjr\tra */\n/* 8c:\tnop */\nvoid chase_f(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'chase_f': unmodelled control transfer 'bc1tl' at 0x14 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":44,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'chase_f': unmodelled control transfer 'bc1tl' at 0x14 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 chase_f(f32 *arg0, f32 arg1, f32 arg2) {\n f32 temp_f0;\n f32 var_f12;\n\n var_f12 = arg2;\n if (var_f12 != 0.0f) {\n temp_f0 = *arg0;\n if (arg1 < temp_f0) {\n var_f12 = -var_f12;\n }\n *arg0 = temp_f0 + var_f12;\n if (((*arg0 - arg1) * var_f12) >= 0.0f) {\n *arg0 = arg1;\n return 1;\n }\n /* Duplicate return node #7. Try simplifying control flow for better match */\n return 0;\n }\n if (arg1 == *arg0) {\n return 1;\n }\n return 0;\n}\n","score":26,"maxScore":41,"compileErrors":null,"breakdown":{"insert":5,"delete":4,"replace":4,"opMismatch":0,"argMismatch":13},"quality":{"score":100,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":26,"maxScore":41,"ratio":0.6341463414634146,"kinds":{"insert":5,"delete":4,"replace":4,"opMismatch":0,"argMismatch":13}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_f` — benchmark function af:chase_f:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_f\n mtc1\t$a2, $f12\n mtc1\t$zero, $f4\n mtc1\t$a1, $f14\n c.eq.s\t$f12, $f4\n nop\n bc1tl\t.L6c\n lwc1\t$f4, 0($a0)\n lwc1\t$f0, 0($a0)\n li\t$v0, 1\n c.lt.s\t$f14, $f0\n nop\n bc1fl\t.L3c\n add.s\t$f6, $f0, $f12\n neg.s\t$f12, $f12\n add.s\t$f6, $f0, $f12\n.L3c:\n mtc1\t$zero, $f18\n swc1\t$f6, 0($a0)\n lwc1\t$f8, 0($a0)\n sub.s\t$f10, $f8, $f14\n mul.s\t$f16, $f10, $f12\n c.le.s\t$f18, $f16\n nop\n bc1fl\t.L88\n move\t$v0, $zero\n jr\t$ra\n swc1\t$f14, 0($a0)\n lwc1\t$f4, 0($a0)\n.L6c:\n c.eq.s\t$f14, $f4\n nop\n bc1fl\t.L88\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L88:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_f # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_f` — benchmark function af:chase_f:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_f:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta2,$f12\n 4:\tmtc1\tzero,$f4\n 8:\tmtc1\ta1,$f14\n c:\tc.eq.s\t$f12,$f4\n 10:\tnop\n 14:\tbc1tl\t6c \n 18:\tlwc1\t$f4,0(a0)\n 1c:\tlwc1\t$f0,0(a0)\n 20:\tli\tv0,1\n 24:\tc.lt.s\t$f14,$f0\n 28:\tnop\n 2c:\tbc1fl\t3c \n 30:\tadd.s\t$f6,$f0,$f12\n 34:\tneg.s\t$f12,$f12\n 38:\tadd.s\t$f6,$f0,$f12\n 3c:\tmtc1\tzero,$f18\n 40:\tswc1\t$f6,0(a0)\n 44:\tlwc1\t$f8,0(a0)\n 48:\tsub.s\t$f10,$f8,$f14\n 4c:\tmul.s\t$f16,$f10,$f12\n 50:\tc.le.s\t$f18,$f16\n 54:\tnop\n 58:\tbc1fl\t88 \n 5c:\tmove\tv0,zero\n 60:\tjr\tra\n 64:\tswc1\t$f14,0(a0)\n 68:\tlwc1\t$f4,0(a0)\n 6c:\tc.eq.s\t$f14,$f4\n 70:\tnop\n 74:\tbc1fl\t88 \n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tli\tv0,1\n 84:\tmove\tv0,zero\n 88:\tjr\tra\n 8c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000090 chase_f\n\n\nContents of section .text:\n 0000 44866000 44802000 44857000 46046032 D.`.D. .D.p.F.`2\n 0010 00000000 45030015 c4840000 c4800000 ....E...........\n 0020 24020001 4600703c 00000000 45020003 $...F.p<....E...\n 0030 460c0180 46006307 460c0180 44809000 F...F.c.F...D...\n 0040 e4860000 c4880000 460e4281 460c5402 ........F.B.F.T.\n 0050 4610903e 00000000 4502000b 00001025 F..>....E......%\n 0060 03e00008 e48e0000 c4840000 46047032 ............F.p2\n 0070 00000000 45020004 00001025 03e00008 ....E......%....\n 0080 24020001 00001025 03e00008 00000000 $......%........\nContents of section .options:\n 0000 01200000 00000000 80000074 00000000 . .........t....\n 0010 00077dd1 00000000 00000000 00007ff0 ..}.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00077dd1 00000000 ...t......}.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000024 00000014 000001f8 p......$........\n 0010 00000005 00000348 00000001 0000020c .......H........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000034 000002b4 .......p...4....\n 0040 00000008 000002e8 00000001 000002f0 ................\n 0050 00000000 00000000 00000001 00000338 ...............8\n 0060 0010f013 1060a310 2010f016 20f04411 .....`.. ... .D.\n 0070 32000000 00000000 00000001 00000000 2...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000090 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d383936 32613031 66623762 32616536 -8962a01fb7b2ae6\n 0140 312f752e 69006368 6173655f 66000000 1/u.i.chase_f...\n 0150 63686173 655f6600 00000000 00000001 chase_f.........\n 0160 00000000 00000032 00000000 00000004 .......2........\n 0170 00000000 00000024 00000000 00000000 .......$........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000011 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_f # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_f3:ido7.1","sym":"chase_f3","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","call"],"loc":20,"refSource":"s32 chase_f3(f32* pValue, f32 target, f32 incrStep, f32 decrStep) {\n f32 step = (target >= *pValue) ? incrStep : decrStep;\n\n if (step != 0.0f) {\n if (target < *pValue) {\n step = -step;\n }\n\n *pValue += step;\n\n if (((*pValue - target) * step) >= 0) {\n *pValue = target;\n return 1;\n }\n } else if (target == *pValue) {\n return 1;\n }\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L175-L194","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tmtc1\tzero,$f4\n 14:\tc.le.s\t$f0,$f12\n 18:\tlwc1\t$f2,12(sp)\n 1c:\tbc1f\t2c \n 20:\tnop\n 24:\tb\t2c \n 28:\tmov.s\t$f2,$f14\n 2c:\tc.eq.s\t$f2,$f4\n 30:\tnop\n 34:\tbc1tl\t84 \n 38:\tc.eq.s\t$f12,$f0\n 3c:\tc.lt.s\t$f12,$f0\n 40:\tli\tv0,1\n 44:\tbc1fl\t54 \n 48:\tadd.s\t$f6,$f0,$f2\n 4c:\tneg.s\t$f2,$f2\n 50:\tadd.s\t$f6,$f0,$f2\n 54:\tmtc1\tzero,$f18\n 58:\tswc1\t$f6,0(a0)\n 5c:\tlwc1\t$f8,0(a0)\n 60:\tsub.s\t$f10,$f8,$f12\n 64:\tmul.s\t$f16,$f10,$f2\n 68:\tc.le.s\t$f18,$f16\n 6c:\tnop\n 70:\tbc1fl\t9c \n 74:\tmove\tv0,zero\n 78:\tjr\tra\n 7c:\tswc1\t$f12,0(a0)\n 80:\tc.eq.s\t$f12,$f0\n 84:\tnop\n 88:\tbc1fl\t9c \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 chase_f3\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 44802000 460c003e c7a2000c 45000003 D. .F..>....E...\n 0020 00000000 10000001 46007086 46041032 ........F.p.F..2\n 0030 00000000 45030013 46006032 4600603c ....E...F.`2F.`<\n 0040 24020001 45020003 46020180 46001087 $...E...F...F...\n 0050 46020180 44809000 e4860000 c4880000 F...D...........\n 0060 460c4281 46025402 4610903e 00000000 F.B.F.T.F..>....\n 0070 4502000a 00001025 03e00008 e48c0000 E......%........\n 0080 46006032 00000000 45020004 00001025 F.`2....E......%\n 0090 03e00008 24020001 00001025 03e00008 ....$......%....\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000f4 00000000 . ..............\n 0010 00075ddd 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f4 00000000 00075ddd 00000000 ..........].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000014 00000218 p......)........\n 0010 00000005 0000036c 00000001 0000022c .......l.......,\n 0020 00000004 00000260 00000000 00000000 .......`........\n 0030 00000011 00000290 00000034 000002d4 ...........4....\n 0040 0000000c 00000308 00000001 00000314 ................\n 0050 00000000 00000000 00000001 0000035c ...............\\\n 0060 0110f020 f5131060 a1102010 f01620f0 ... ...`.. ... .\n 0070 33112200 00000000 00000001 00000000 3.\".............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000010 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000a4 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d626264 61656530 30653961 31393062 -bbdaee00e9a190b\n 0140 382f752e 69006368 6173655f 66330000 8/u.i.chase_f3..\n 0150 63686173 655f6633 00000000 00000000 chase_f3........\n 0160 00000001 00000000 00000033 00000000 ...........3....\n 0170 00000004 00000000 00000029 00000000 ...........)....\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000013 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'chase_f3' — lift: cannot lift 'chase_f3': unmodelled control transfer 'bc1f' at 0x1c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta3,12(sp) */\n/* 4:\tmtc1\ta1,$f12 */\n/* 8:\tlwc1\t$f0,0(a0) */\n/* c:\tmtc1\ta2,$f14 */\n/* 10:\tmtc1\tzero,$f4 */\n/* 14:\tc.le.s\t$f0,$f12 */\n/* 18:\tlwc1\t$f2,12(sp) */\n/* 1c:\tbc1f\t2c */\n/* 20:\tnop */\n/* 24:\tb\t2c */\n/* 28:\tmov.s\t$f2,$f14 */\n/* 2c:\tc.eq.s\t$f2,$f4 */\n/* 30:\tnop */\n/* 34:\tbc1tl\t84 */\n/* 38:\tc.eq.s\t$f12,$f0 */\n/* 3c:\tc.lt.s\t$f12,$f0 */\n/* 40:\tli\tv0,1 */\n/* 44:\tbc1fl\t54 */\n/* 48:\tadd.s\t$f6,$f0,$f2 */\n/* 4c:\tneg.s\t$f2,$f2 */\n/* 50:\tadd.s\t$f6,$f0,$f2 */\n/* 54:\tmtc1\tzero,$f18 */\n/* 58:\tswc1\t$f6,0(a0) */\n/* 5c:\tlwc1\t$f8,0(a0) */\n/* 60:\tsub.s\t$f10,$f8,$f12 */\n/* 64:\tmul.s\t$f16,$f10,$f2 */\n/* 68:\tc.le.s\t$f18,$f16 */\n/* 6c:\tnop */\n/* 70:\tbc1fl\t9c */\n/* 74:\tmove\tv0,zero */\n/* 78:\tjr\tra */\n/* 7c:\tswc1\t$f12,0(a0) */\n/* 80:\tc.eq.s\t$f12,$f0 */\n/* 84:\tnop */\n/* 88:\tbc1fl\t9c */\n/* 8c:\tmove\tv0,zero */\n/* 90:\tjr\tra */\n/* 94:\tli\tv0,1 */\n/* 98:\tmove\tv0,zero */\n/* 9c:\tjr\tra */\n/* a0:\tnop */\n/* \t... */\nvoid chase_f3(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'chase_f3': unmodelled control transfer 'bc1f' at 0x1c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":50,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'chase_f3': unmodelled control transfer 'bc1f' at 0x1c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 chase_f3(f32 *arg0, f32 arg1, f32 arg2, f32 arg3) {\n f32 temp_f0;\n f32 var_f2;\n\n temp_f0 = *arg0;\n var_f2 = arg3;\n if (temp_f0 <= arg1) {\n var_f2 = arg2;\n }\n if (var_f2 != 0.0f) {\n if (arg1 < temp_f0) {\n var_f2 = -var_f2;\n }\n *arg0 = temp_f0 + var_f2;\n if (((*arg0 - arg1) * var_f2) >= 0.0f) {\n *arg0 = arg1;\n return 1;\n }\n /* Duplicate return node #9. Try simplifying control flow for better match */\n return 0;\n }\n if (arg1 == temp_f0) {\n return 1;\n }\n return 0;\n}\n","score":33,"maxScore":47,"compileErrors":null,"breakdown":{"insert":6,"delete":8,"replace":4,"opMismatch":0,"argMismatch":15},"quality":{"score":100,"lines":25,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":33,"maxScore":47,"ratio":0.7021276595744681,"kinds":{"insert":6,"delete":8,"replace":4,"opMismatch":0,"argMismatch":15}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_f3` — benchmark function af:chase_f3:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_f3\n sw\t$a3, 12($sp)\n mtc1\t$a1, $f12\n lwc1\t$f0, 0($a0)\n mtc1\t$a2, $f14\n mtc1\t$zero, $f4\n c.le.s\t$f0, $f12\n lwc1\t$f2, 12($sp)\n bc1f\t.L2c\n nop\n b\t.L2c\n mov.s\t$f2, $f14\n.L2c:\n c.eq.s\t$f2, $f4\n nop\n bc1tl\t.L84\n c.eq.s\t$f12, $f0\n c.lt.s\t$f12, $f0\n li\t$v0, 1\n bc1fl\t.L54\n add.s\t$f6, $f0, $f2\n neg.s\t$f2, $f2\n add.s\t$f6, $f0, $f2\n.L54:\n mtc1\t$zero, $f18\n swc1\t$f6, 0($a0)\n lwc1\t$f8, 0($a0)\n sub.s\t$f10, $f8, $f12\n mul.s\t$f16, $f10, $f2\n c.le.s\t$f18, $f16\n nop\n bc1fl\t.L9c\n move\t$v0, $zero\n jr\t$ra\n swc1\t$f12, 0($a0)\n c.eq.s\t$f12, $f0\n.L84:\n nop\n bc1fl\t.L9c\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L9c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_f3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_f3` — benchmark function af:chase_f3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_f3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta3,12(sp)\n 4:\tmtc1\ta1,$f12\n 8:\tlwc1\t$f0,0(a0)\n c:\tmtc1\ta2,$f14\n 10:\tmtc1\tzero,$f4\n 14:\tc.le.s\t$f0,$f12\n 18:\tlwc1\t$f2,12(sp)\n 1c:\tbc1f\t2c \n 20:\tnop\n 24:\tb\t2c \n 28:\tmov.s\t$f2,$f14\n 2c:\tc.eq.s\t$f2,$f4\n 30:\tnop\n 34:\tbc1tl\t84 \n 38:\tc.eq.s\t$f12,$f0\n 3c:\tc.lt.s\t$f12,$f0\n 40:\tli\tv0,1\n 44:\tbc1fl\t54 \n 48:\tadd.s\t$f6,$f0,$f2\n 4c:\tneg.s\t$f2,$f2\n 50:\tadd.s\t$f6,$f0,$f2\n 54:\tmtc1\tzero,$f18\n 58:\tswc1\t$f6,0(a0)\n 5c:\tlwc1\t$f8,0(a0)\n 60:\tsub.s\t$f10,$f8,$f12\n 64:\tmul.s\t$f16,$f10,$f2\n 68:\tc.le.s\t$f18,$f16\n 6c:\tnop\n 70:\tbc1fl\t9c \n 74:\tmove\tv0,zero\n 78:\tjr\tra\n 7c:\tswc1\t$f12,0(a0)\n 80:\tc.eq.s\t$f12,$f0\n 84:\tnop\n 88:\tbc1fl\t9c \n 8c:\tmove\tv0,zero\n 90:\tjr\tra\n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 chase_f3\n\n\nContents of section .text:\n 0000 afa7000c 44856000 c4800000 44867000 ....D.`.....D.p.\n 0010 44802000 460c003e c7a2000c 45000003 D. .F..>....E...\n 0020 00000000 10000001 46007086 46041032 ........F.p.F..2\n 0030 00000000 45030013 46006032 4600603c ....E...F.`2F.`<\n 0040 24020001 45020003 46020180 46001087 $...E...F...F...\n 0050 46020180 44809000 e4860000 c4880000 F...D...........\n 0060 460c4281 46025402 4610903e 00000000 F.B.F.T.F..>....\n 0070 4502000a 00001025 03e00008 e48c0000 E......%........\n 0080 46006032 00000000 45020004 00001025 F.`2....E......%\n 0090 03e00008 24020001 00001025 03e00008 ....$......%....\n 00a0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000f4 00000000 . ..............\n 0010 00075ddd 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f4 00000000 00075ddd 00000000 ..........].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000014 00000218 p......)........\n 0010 00000005 0000036c 00000001 0000022c .......l.......,\n 0020 00000004 00000260 00000000 00000000 .......`........\n 0030 00000011 00000290 00000034 000002d4 ...........4....\n 0040 0000000c 00000308 00000001 00000314 ................\n 0050 00000000 00000000 00000001 0000035c ...............\\\n 0060 0110f020 f5131060 a1102010 f01620f0 ... ...`.. ... .\n 0070 33112200 00000000 00000001 00000000 3.\".............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000010 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000a4 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d626264 61656530 30653961 31393062 -bbdaee00e9a190b\n 0140 382f752e 69006368 6173655f 66330000 8/u.i.chase_f3..\n 0150 63686173 655f6633 00000000 00000000 chase_f3........\n 0160 00000001 00000000 00000033 00000000 ...........3....\n 0170 00000004 00000000 00000029 00000000 ...........)....\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000013 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_f3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_s:ido7.1","sym":"chase_s","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch","arithmetic","pointer"],"loc":19,"refSource":"s32 chase_s(s16* pValue, s16 target, s16 step) {\n if (step) {\n if (*pValue > target) {\n step = -step;\n }\n\n *pValue += step;\n\n if ((step * (*pValue - target)) >= 0) {\n *pValue = target;\n return TRUE;\n }\n } else {\n if (*pValue == target) {\n return TRUE;\n }\n }\n return FALSE;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L72-L90","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,64 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tslt\tat,a1,v0\n 24:\tbeqzl\tat,3c \n 28:\taddu\tt6,v0,a2\n 2c:\tnegu\ta2,a2\n 30:\tsll\ta2,a2,0x10\n 34:\tsra\ta2,a2,0x10\n 38:\taddu\tt6,v0,a2\n 3c:\tsh\tt6,0(a0)\n 40:\tlh\tt7,0(a0)\n 44:\tli\tv0,1\n 48:\tsubu\tt8,t7,a1\n 4c:\tmultu\tt8,a2\n 50:\tmflo\tt9\n 54:\tbltzl\tt9,7c \n 58:\tmove\tv0,zero\n 5c:\tjr\tra\n 60:\tsh\ta1,0(a0)\n 64:\tlh\tt0,0(a0)\n 68:\tbnel\ta1,t0,7c \n 6c:\tmove\tv0,zero\n 70:\tjr\tra\n 74:\tli\tv0,1\n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000084 chase_s\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00013 00052c03 84820000 ..4.......,.....\n 0020 00a2082a 50200005 00467021 00063023 ...*P ...Fp!..0#\n 0030 00063400 00063403 00467021 a48e0000 ..4...4..Fp!....\n 0040 848f0000 24020001 01e5c023 03060019 ....$......#....\n 0050 0000c812 07220009 00001025 03e00008 .....\".....%....\n 0060 a4850000 84880000 54a80004 00001025 ........T......%\n 0070 03e00008 24020001 00001025 03e00008 ....$......%....\n 0080 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c176 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c176 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000021 00000010 000001f8 p......!........\n 0010 00000005 00000344 00000001 00000208 .......D........\n 0020 00000004 0000023c 00000000 00000000 .......<........\n 0030 00000011 0000026c 00000034 000002b0 .......l...4....\n 0040 00000008 000002e4 00000001 000002ec ................\n 0050 00000000 00000000 00000001 00000334 ...............4\n 0060 0410f023 12211020 e420f042 11320000 ...#.!. . .B.2..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000011 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000084 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d663334 nch-real-ido-f34\n 0130 37633865 38353533 31393935 392f752e 7c8e855319959/u.\n 0140 69006368 6173655f 73000000 63686173 i.chase_s...chas\n 0150 655f7300 00000000 00000001 00000000 e_s.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000021 00000000 00000000 00000001 ...!............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000e 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'chase_s' — lift: cannot lift 'chase_s': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta2,8(sp) */\n/* 4:\tsll\ta2,a2,0x10 */\n/* 8:\tsw\ta1,4(sp) */\n/* c:\tsll\ta1,a1,0x10 */\n/* 10:\tsra\ta2,a2,0x10 */\n/* 14:\tbeqz\ta2,64 */\n/* 18:\tsra\ta1,a1,0x10 */\n/* 1c:\tlh\tv0,0(a0) */\n/* 20:\tslt\tat,a1,v0 */\n/* 24:\tbeqzl\tat,3c */\n/* 28:\taddu\tt6,v0,a2 */\n/* 2c:\tnegu\ta2,a2 */\n/* 30:\tsll\ta2,a2,0x10 */\n/* 34:\tsra\ta2,a2,0x10 */\n/* 38:\taddu\tt6,v0,a2 */\n/* 3c:\tsh\tt6,0(a0) */\n/* 40:\tlh\tt7,0(a0) */\n/* 44:\tli\tv0,1 */\n/* 48:\tsubu\tt8,t7,a1 */\n/* 4c:\tmultu\tt8,a2 */\n/* 50:\tmflo\tt9 */\n/* 54:\tbltzl\tt9,7c */\n/* 58:\tmove\tv0,zero */\n/* 5c:\tjr\tra */\n/* 60:\tsh\ta1,0(a0) */\n/* 64:\tlh\tt0,0(a0) */\n/* 68:\tbnel\ta1,t0,7c */\n/* 6c:\tmove\tv0,zero */\n/* 70:\tjr\tra */\n/* 74:\tli\tv0,1 */\n/* 78:\tmove\tv0,zero */\n/* 7c:\tjr\tra */\n/* 80:\tnop */\n/* \t... */\nvoid chase_s(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'chase_s': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":42,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'chase_s': unmodelled control transfer 'beqzl' at 0x24 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 chase_s(s16 *arg0, s16 arg1, s16 arg2) {\n s16 temp_v0;\n s16 var_a2;\n\n var_a2 = arg2;\n if (var_a2 != 0) {\n temp_v0 = *arg0;\n if (arg1 < temp_v0) {\n var_a2 *= -1;\n }\n *arg0 = temp_v0 + var_a2;\n if (((*arg0 - arg1) * var_a2) >= 0) {\n *arg0 = arg1;\n return 1;\n }\n /* Duplicate return node #7. Try simplifying control flow for better match */\n return 0;\n }\n if (arg1 == *arg0) {\n return 1;\n }\n return 0;\n}\n","score":22,"maxScore":40,"compileErrors":null,"breakdown":{"insert":7,"delete":3,"replace":2,"opMismatch":0,"argMismatch":10},"quality":{"score":100,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":22,"maxScore":40,"ratio":0.55,"kinds":{"insert":7,"delete":3,"replace":2,"opMismatch":0,"argMismatch":10}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_s` — benchmark function af:chase_s:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .L64\n sra\t$a1, $a1, 0x10\n lh\t$v0, 0($a0)\n slt\t$at, $a1, $v0\n beqzl\t$at, .L3c\n addu\t$t6, $v0, $a2\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n addu\t$t6, $v0, $a2\n.L3c:\n sh\t$t6, 0($a0)\n lh\t$t7, 0($a0)\n li\t$v0, 1\n subu\t$t8, $t7, $a1\n multu\t$t8, $a2\n mflo\t$t9\n bltzl\t$t9, .L7c\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.L64:\n lh\t$t0, 0($a0)\n bnel\t$a1, $t0, .L7c\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.L7c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s` — benchmark function af:chase_s:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,64 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv0,0(a0)\n 20:\tslt\tat,a1,v0\n 24:\tbeqzl\tat,3c \n 28:\taddu\tt6,v0,a2\n 2c:\tnegu\ta2,a2\n 30:\tsll\ta2,a2,0x10\n 34:\tsra\ta2,a2,0x10\n 38:\taddu\tt6,v0,a2\n 3c:\tsh\tt6,0(a0)\n 40:\tlh\tt7,0(a0)\n 44:\tli\tv0,1\n 48:\tsubu\tt8,t7,a1\n 4c:\tmultu\tt8,a2\n 50:\tmflo\tt9\n 54:\tbltzl\tt9,7c \n 58:\tmove\tv0,zero\n 5c:\tjr\tra\n 60:\tsh\ta1,0(a0)\n 64:\tlh\tt0,0(a0)\n 68:\tbnel\ta1,t0,7c \n 6c:\tmove\tv0,zero\n 70:\tjr\tra\n 74:\tli\tv0,1\n 78:\tmove\tv0,zero\n 7c:\tjr\tra\n 80:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000090 .text\n00000000 g F .text\t00000084 chase_s\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00013 00052c03 84820000 ..4.......,.....\n 0020 00a2082a 50200005 00467021 00063023 ...*P ...Fp!..0#\n 0030 00063400 00063403 00467021 a48e0000 ..4...4..Fp!....\n 0040 848f0000 24020001 01e5c023 03060019 ....$......#....\n 0050 0000c812 07220009 00001025 03e00008 .....\".....%....\n 0060 a4850000 84880000 54a80004 00001025 ........T......%\n 0070 03e00008 24020001 00001025 03e00008 ....$......%....\n 0080 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c176 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c176 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000021 00000010 000001f8 p......!........\n 0010 00000005 00000344 00000001 00000208 .......D........\n 0020 00000004 0000023c 00000000 00000000 .......<........\n 0030 00000011 0000026c 00000034 000002b0 .......l...4....\n 0040 00000008 000002e4 00000001 000002ec ................\n 0050 00000000 00000000 00000001 00000334 ...............4\n 0060 0410f023 12211020 e420f042 11320000 ...#.!. . .B.2..\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000011 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000084 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d663334 nch-real-ido-f34\n 0130 37633865 38353533 31393935 392f752e 7c8e855319959/u.\n 0140 69006368 6173655f 73000000 63686173 i.chase_s...chas\n 0150 655f7300 00000000 00000001 00000000 e_s.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000021 00000000 00000000 00000001 ...!............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000e 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_s2:ido7.1","sym":"chase_s2","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","pointer","branch"],"loc":10,"refSource":"s32 chase_s2(s16* pValue, s16 limit, s16 step) {\n s16 prev = *pValue;\n\n *pValue += step;\n if ((*pValue - limit) * (prev - limit) <= 0) {\n *pValue = limit;\n return 1;\n }\n return 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L124-L133","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta2,a2,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\taddu\tt6,v1,a2\n 18:\tsh\tt6,0(a0)\n 1c:\tlh\tt7,0(a0)\n 20:\tsll\ta1,a1,0x10\n 24:\tsra\ta1,a1,0x10\n 28:\tsll\tv0,v1,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tsubu\tt9,v0,a1\n 34:\tsubu\tt8,t7,a1\n 38:\tmultu\tt8,t9\n 3c:\tmove\tv0,zero\n 40:\tmflo\tt0\n 44:\tbgtz\tt0,58 \n 48:\tnop\n 4c:\tsh\ta1,0(a0)\n 50:\tjr\tra\n 54:\tli\tv0,1\n 58:\tjr\tra\n 5c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000060 chase_s2\n\n\nContents of section .text:\n 0000 afa50004 afa60008 84830000 00063400 ..............4.\n 0010 00063403 00667021 a48e0000 848f0000 ..4..fp!........\n 0020 00052c00 00052c03 00031400 00021403 ..,...,.........\n 0030 0045c823 01e5c023 03190019 00001025 .E.#...#.......%\n 0040 00004012 1d000004 00000000 a4850000 ..@.............\n 0050 03e00008 24020001 03e00008 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 a300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000018 00000010 000001c8 p...............\n 0010 00000005 00000318 00000001 000001d8 ................\n 0020 00000004 0000020c 00000000 00000000 ................\n 0030 00000011 0000023c 00000034 00000280 .......<...4....\n 0040 0000000c 000002b4 00000001 000002c0 ................\n 0050 00000000 00000000 00000001 00000308 ................\n 0060 0110f121 10d11122 40c21011 21000000 ...!...\"@...!...\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000009 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000060 20200001 00000001 00000000 ...` ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d643230 nch-real-ido-d20\n 0130 63333538 62353263 32376664 632f752e c358b52c27fdc/u.\n 0140 69006368 6173655f 73320000 63686173 i.chase_s2..chas\n 0150 655f7332 00000000 00000000 00000001 e_s2............\n 0160 00000000 00000033 00000000 00000004 .......3........\n 0170 00000000 00000018 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000d ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"nonmatch","source":"s32 chase_s2(s16 * a0, s32 a1, s32 a2) {\n s32 v0;\n v0 = *a0;\n *a0 = v0 + (a2 << 16 >> 16);\n if ((*a0 - (a1 << 16 >> 16)) * ((v0 << 16 >> 16) - (a1 << 16 >> 16)) <= 0) {\n *a0 = a1 << 16 >> 16;\n return 1;\n } else {\n return 0;\n }\n}\n","score":18,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":0,"opMismatch":0,"argMismatch":14},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 chase_s2(s16 *arg0, s16 arg1, s16 arg2) {\n s16 temp_v1;\n\n temp_v1 = *arg0;\n *arg0 = temp_v1 + arg2;\n if (((*arg0 - arg1) * (temp_v1 - arg1)) <= 0) {\n *arg0 = arg1;\n return 1;\n }\n return 0;\n}\n","score":4,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":10,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":24,"ratio":0.16666666666666666,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_s2` — benchmark function af:chase_s2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s2\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n lh\t$v1, 0($a0)\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n addu\t$t6, $v1, $a2\n sh\t$t6, 0($a0)\n lh\t$t7, 0($a0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$v0, $v1, 0x10\n sra\t$v0, $v0, 0x10\n subu\t$t9, $v0, $a1\n subu\t$t8, $t7, $a1\n multu\t$t8, $t9\n move\t$v0, $zero\n mflo\t$t0\n bgtz\t$t0, .L58\n nop\n sh\t$a1, 0($a0)\n jr\t$ra\n li\t$v0, 1\n.L58:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s2` — benchmark function af:chase_s2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s2:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tsw\ta2,8(sp)\n 8:\tlh\tv1,0(a0)\n c:\tsll\ta2,a2,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\taddu\tt6,v1,a2\n 18:\tsh\tt6,0(a0)\n 1c:\tlh\tt7,0(a0)\n 20:\tsll\ta1,a1,0x10\n 24:\tsra\ta1,a1,0x10\n 28:\tsll\tv0,v1,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tsubu\tt9,v0,a1\n 34:\tsubu\tt8,t7,a1\n 38:\tmultu\tt8,t9\n 3c:\tmove\tv0,zero\n 40:\tmflo\tt0\n 44:\tbgtz\tt0,58 \n 48:\tnop\n 4c:\tsh\ta1,0(a0)\n 50:\tjr\tra\n 54:\tli\tv0,1\n 58:\tjr\tra\n 5c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000060 chase_s2\n\n\nContents of section .text:\n 0000 afa50004 afa60008 84830000 00063400 ..............4.\n 0010 00063403 00667021 a48e0000 848f0000 ..4..fp!........\n 0020 00052c00 00052c03 00031400 00021403 ..,...,.........\n 0030 0045c823 01e5c023 03190019 00001025 .E.#...#.......%\n 0040 00004012 1d000004 00000000 a4850000 ..@.............\n 0050 03e00008 24020001 03e00008 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 a300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000018 00000010 000001c8 p...............\n 0010 00000005 00000318 00000001 000001d8 ................\n 0020 00000004 0000020c 00000000 00000000 ................\n 0030 00000011 0000023c 00000034 00000280 .......<...4....\n 0040 0000000c 000002b4 00000001 000002c0 ................\n 0050 00000000 00000000 00000001 00000308 ................\n 0060 0110f121 10d11122 40c21011 21000000 ...!...\"@...!...\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000002 00000009 ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 00000060 20200001 00000001 00000000 ...` ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d643230 nch-real-ido-d20\n 0130 63333538 62353263 32376664 632f752e c358b52c27fdc/u.\n 0140 69006368 6173655f 73320000 63686173 i.chase_s2..chas\n 0150 655f7332 00000000 00000000 00000001 e_s2............\n 0160 00000000 00000033 00000000 00000004 .......3........\n 0170 00000000 00000018 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 0000000d ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:chase_s3:ido7.1","sym":"chase_s3","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch","arithmetic","pointer","nested"],"loc":28,"refSource":"s32 chase_s3(s16* pValue, s16 target, s16 step) {\n if (step) {\n s32 diff = target - *pValue;\n\n if (diff < 0) {\n step = -step;\n }\n\n if (diff >= 0x8000) {\n step = -step;\n diff = -0xFFFF - -diff;\n } else if (diff <= -0x8000) {\n step = -step;\n diff += 0xFFFF;\n }\n\n *pValue += step;\n\n if ((diff * step) <= 0) {\n *pValue = target;\n return TRUE;\n }\n\n } else if (target == *pValue) {\n return TRUE;\n }\n return FALSE;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L135-L162","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,a4 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv1,0(a0)\n 20:\tli\tat,0x8000\n 24:\tlui\tt7,0xffff\n 28:\tsubu\tv0,a1,v1\n 2c:\tbgez\tv0,40 \n 30:\tslt\tat,v0,at\n 34:\tnegu\ta2,a2\n 38:\tsll\ta2,a2,0x10\n 3c:\tsra\ta2,a2,0x10\n 40:\tbnez\tat,60 \n 44:\tnegu\tt6,v0\n 48:\tnegu\ta2,a2\n 4c:\tsll\ta2,a2,0x10\n 50:\tori\tt7,t7,0x1\n 54:\tsra\ta2,a2,0x10\n 58:\tb\t80 \n 5c:\tsubu\tv0,t7,t6\n 60:\tslti\tat,v0,-32767\n 64:\tbeqz\tat,80 \n 68:\tnop\n 6c:\tnegu\ta2,a2\n 70:\tsll\ta2,a2,0x10\n 74:\tli\tat,0xffff\n 78:\tsra\ta2,a2,0x10\n 7c:\taddu\tv0,v0,at\n 80:\tmultu\ta2,v0\n 84:\taddu\tt8,v1,a2\n 88:\tsh\tt8,0(a0)\n 8c:\tli\tv0,1\n 90:\tmflo\tt9\n 94:\tbgtzl\tt9,bc \n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tsh\ta1,0(a0)\n a4:\tlh\tt0,0(a0)\n a8:\tbnel\ta1,t0,bc \n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tli\tv0,1\n b8:\tmove\tv0,zero\n bc:\tjr\tra\n c0:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c4 chase_s3\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00023 00052c03 84830000 ..4....#..,.....\n 0020 34018000 3c0fffff 00a31023 04410004 4...<......#.A..\n 0030 0041082a 00063023 00063400 00063403 .A.*..0#..4...4.\n 0040 14200007 00027023 00063023 00063400 . ....p#..0#..4.\n 0050 35ef0001 00063403 10000009 01ee1023 5.....4........#\n 0060 28418001 10200006 00000000 00063023 (A... ........0#\n 0070 00063400 3401ffff 00063403 00411021 ..4.4.....4..A.!\n 0080 00c20019 0066c021 a4980000 24020001 .....f.!....$...\n 0090 0000c812 5f200009 00001025 03e00008 ...._ .....%....\n 00a0 a4850000 84880000 54a80004 00001025 ........T......%\n 00b0 03e00008 24020001 00001025 03e00008 ....$......%....\n 00c0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c17e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000031 00000020 00000238 p......1... ...8\n 0010 00000005 00000398 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 0000000c 00000334 00000001 00000340 .......4.......@\n 0050 00000000 00000000 00000001 00000388 ................\n 0060 0410f020 4020a010 30e22020 f110f011 ... @ ..0. ....\n 0070 121110f0 1030f130 e220f032 11220000 .....0.0. .2.\"..\n 0080 00000000 00000001 00000000 00000000 ................\n 0090 00000000 ffffffff 00000000 00000000 ................\n 00a0 00000000 001d001f 00000002 00000017 ................\n 00b0 00000000 00000001 00000000 2c200004 ............, ..\n 00c0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00d0 000000c4 20200001 00000001 00000000 .... ..........\n 00e0 20200000 02000000 03000000 04000000 ..............\n 00f0 05000000 06000000 07000000 08000000 ................\n 0100 09000000 20000000 21000000 0a000000 .... ...!.......\n 0110 0b000000 0b000000 1a000000 00000000 ................\n 0120 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0130 6e63682d 7265616c 2d69646f 2d383035 nch-real-ido-805\n 0140 36623232 64303864 62646363 662f752e 6b22d08dbdccf/u.\n 0150 69006368 6173655f 73330000 63686173 i.chase_s3..chas\n 0160 655f7333 00000000 00000000 00000001 e_s3............\n 0170 00000000 00000033 00000000 00000004 .......3........\n 0180 00000000 00000031 00000000 00000000 .......1........\n 0190 00000001 00000000 00000011 00000000 ................\n 01a0 00000000 01800000 00000000 0000001e ................\n 01b0 00000000 00000000 00000000 18200001 ............. ..\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 00000000 7fffffff 00000000 ................\n 01e0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'chase_s3' — lift: cannot lift 'chase_s3': unmodelled control transfer 'bgtzl' at 0x94 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta2,8(sp) */\n/* 4:\tsll\ta2,a2,0x10 */\n/* 8:\tsw\ta1,4(sp) */\n/* c:\tsll\ta1,a1,0x10 */\n/* 10:\tsra\ta2,a2,0x10 */\n/* 14:\tbeqz\ta2,a4 */\n/* 18:\tsra\ta1,a1,0x10 */\n/* 1c:\tlh\tv1,0(a0) */\n/* 20:\tli\tat,0x8000 */\n/* 24:\tlui\tt7,0xffff */\n/* 28:\tsubu\tv0,a1,v1 */\n/* 2c:\tbgez\tv0,40 */\n/* 30:\tslt\tat,v0,at */\n/* 34:\tnegu\ta2,a2 */\n/* 38:\tsll\ta2,a2,0x10 */\n/* 3c:\tsra\ta2,a2,0x10 */\n/* 40:\tbnez\tat,60 */\n/* 44:\tnegu\tt6,v0 */\n/* 48:\tnegu\ta2,a2 */\n/* 4c:\tsll\ta2,a2,0x10 */\n/* 50:\tori\tt7,t7,0x1 */\n/* 54:\tsra\ta2,a2,0x10 */\n/* 58:\tb\t80 */\n/* 5c:\tsubu\tv0,t7,t6 */\n/* 60:\tslti\tat,v0,-32767 */\n/* 64:\tbeqz\tat,80 */\n/* 68:\tnop */\n/* 6c:\tnegu\ta2,a2 */\n/* 70:\tsll\ta2,a2,0x10 */\n/* 74:\tli\tat,0xffff */\n/* 78:\tsra\ta2,a2,0x10 */\n/* 7c:\taddu\tv0,v0,at */\n/* 80:\tmultu\ta2,v0 */\n/* 84:\taddu\tt8,v1,a2 */\n/* 88:\tsh\tt8,0(a0) */\n/* 8c:\tli\tv0,1 */\n/* 90:\tmflo\tt9 */\n/* 94:\tbgtzl\tt9,bc */\n/* 98:\tmove\tv0,zero */\n/* 9c:\tjr\tra */\n/* a0:\tsh\ta1,0(a0) */\n/* a4:\tlh\tt0,0(a0) */\n/* a8:\tbnel\ta1,t0,bc */\n/* ac:\tmove\tv0,zero */\n/* b0:\tjr\tra */\n/* b4:\tli\tv0,1 */\n/* b8:\tmove\tv0,zero */\n/* bc:\tjr\tra */\n/* c0:\tnop */\n/* \t... */\nvoid chase_s3(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'chase_s3': unmodelled control transfer 'bgtzl' at 0x94 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":58,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'chase_s3': unmodelled control transfer 'bgtzl' at 0x94 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 chase_s3(s16 *arg0, s16 arg1, s16 arg2) {\n s16 temp_v1;\n s16 var_a2;\n s32 var_v0;\n\n var_a2 = arg2;\n if (var_a2 != 0) {\n temp_v1 = *arg0;\n var_v0 = arg1 - temp_v1;\n if (var_v0 < 0) {\n var_a2 *= -1;\n }\n if (var_v0 >= 0x8000) {\n var_a2 *= -1;\n var_v0 = 0xFFFF0001 - -var_v0;\n } else if (var_v0 < -0x7FFF) {\n var_a2 *= -1;\n var_v0 += 0xFFFF;\n }\n *arg0 = temp_v1 + var_a2;\n if ((var_a2 * var_v0) <= 0) {\n *arg0 = arg1;\n return 1;\n }\n /* Duplicate return node #11. Try simplifying control flow for better match */\n return 0;\n }\n if (arg1 == *arg0) {\n return 1;\n }\n return 0;\n}\n","score":50,"maxScore":69,"compileErrors":null,"breakdown":{"insert":20,"delete":10,"replace":6,"opMismatch":0,"argMismatch":14},"quality":{"score":100,"lines":31,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":50,"maxScore":69,"ratio":0.7246376811594203,"kinds":{"insert":20,"delete":10,"replace":6,"opMismatch":0,"argMismatch":14}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `chase_s3` — benchmark function af:chase_s3:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel chase_s3\n sw\t$a2, 8($sp)\n sll\t$a2, $a2, 0x10\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sra\t$a2, $a2, 0x10\n beqz\t$a2, .La4\n sra\t$a1, $a1, 0x10\n lh\t$v1, 0($a0)\n li\t$at, 0x8000\n lui\t$t7, 0xffff\n subu\t$v0, $a1, $v1\n bgez\t$v0, .L40\n slt\t$at, $v0, $at\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n.L40:\n bnez\t$at, .L60\n negu\t$t6, $v0\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n ori\t$t7, $t7, 0x1\n sra\t$a2, $a2, 0x10\n b\t.L80\n subu\t$v0, $t7, $t6\n.L60:\n slti\t$at, $v0, -32767\n beqz\t$at, .L80\n nop\n negu\t$a2, $a2\n sll\t$a2, $a2, 0x10\n li\t$at, 0xffff\n sra\t$a2, $a2, 0x10\n addu\t$v0, $v0, $at\n.L80:\n multu\t$a2, $v0\n addu\t$t8, $v1, $a2\n sh\t$t8, 0($a0)\n li\t$v0, 1\n mflo\t$t9\n bgtzl\t$t9, .Lbc\n move\t$v0, $zero\n jr\t$ra\n sh\t$a1, 0($a0)\n.La4:\n lh\t$t0, 0($a0)\n bnel\t$a1, $t0, .Lbc\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n move\t$v0, $zero\n.Lbc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function chase_s3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `chase_s3` — benchmark function af:chase_s3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:chase_s3:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tsll\ta2,a2,0x10\n 8:\tsw\ta1,4(sp)\n c:\tsll\ta1,a1,0x10\n 10:\tsra\ta2,a2,0x10\n 14:\tbeqz\ta2,a4 \n 18:\tsra\ta1,a1,0x10\n 1c:\tlh\tv1,0(a0)\n 20:\tli\tat,0x8000\n 24:\tlui\tt7,0xffff\n 28:\tsubu\tv0,a1,v1\n 2c:\tbgez\tv0,40 \n 30:\tslt\tat,v0,at\n 34:\tnegu\ta2,a2\n 38:\tsll\ta2,a2,0x10\n 3c:\tsra\ta2,a2,0x10\n 40:\tbnez\tat,60 \n 44:\tnegu\tt6,v0\n 48:\tnegu\ta2,a2\n 4c:\tsll\ta2,a2,0x10\n 50:\tori\tt7,t7,0x1\n 54:\tsra\ta2,a2,0x10\n 58:\tb\t80 \n 5c:\tsubu\tv0,t7,t6\n 60:\tslti\tat,v0,-32767\n 64:\tbeqz\tat,80 \n 68:\tnop\n 6c:\tnegu\ta2,a2\n 70:\tsll\ta2,a2,0x10\n 74:\tli\tat,0xffff\n 78:\tsra\ta2,a2,0x10\n 7c:\taddu\tv0,v0,at\n 80:\tmultu\ta2,v0\n 84:\taddu\tt8,v1,a2\n 88:\tsh\tt8,0(a0)\n 8c:\tli\tv0,1\n 90:\tmflo\tt9\n 94:\tbgtzl\tt9,bc \n 98:\tmove\tv0,zero\n 9c:\tjr\tra\n a0:\tsh\ta1,0(a0)\n a4:\tlh\tt0,0(a0)\n a8:\tbnel\ta1,t0,bc \n ac:\tmove\tv0,zero\n b0:\tjr\tra\n b4:\tli\tv0,1\n b8:\tmove\tv0,zero\n bc:\tjr\tra\n c0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c4 chase_s3\n\n\nContents of section .text:\n 0000 afa60008 00063400 afa50004 00052c00 ......4.......,.\n 0010 00063403 10c00023 00052c03 84830000 ..4....#..,.....\n 0020 34018000 3c0fffff 00a31023 04410004 4...<......#.A..\n 0030 0041082a 00063023 00063400 00063403 .A.*..0#..4...4.\n 0040 14200007 00027023 00063023 00063400 . ....p#..0#..4.\n 0050 35ef0001 00063403 10000009 01ee1023 5.....4........#\n 0060 28418001 10200006 00000000 00063023 (A... ........0#\n 0070 00063400 3401ffff 00063403 00411021 ..4.4.....4..A.!\n 0080 00c20019 0066c021 a4980000 24020001 .....f.!....$...\n 0090 0000c812 5f200009 00001025 03e00008 ...._ .....%....\n 00a0 a4850000 84880000 54a80004 00001025 ........T......%\n 00b0 03e00008 24020001 00001025 03e00008 ....$......%....\n 00c0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a300c17e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300c17e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000031 00000020 00000238 p......1... ...8\n 0010 00000005 00000398 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 0000000c 00000334 00000001 00000340 .......4.......@\n 0050 00000000 00000000 00000001 00000388 ................\n 0060 0410f020 4020a010 30e22020 f110f011 ... @ ..0. ....\n 0070 121110f0 1030f130 e220f032 11220000 .....0.0. .2.\"..\n 0080 00000000 00000001 00000000 00000000 ................\n 0090 00000000 ffffffff 00000000 00000000 ................\n 00a0 00000000 001d001f 00000002 00000017 ................\n 00b0 00000000 00000001 00000000 2c200004 ............, ..\n 00c0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00d0 000000c4 20200001 00000001 00000000 .... ..........\n 00e0 20200000 02000000 03000000 04000000 ..............\n 00f0 05000000 06000000 07000000 08000000 ................\n 0100 09000000 20000000 21000000 0a000000 .... ...!.......\n 0110 0b000000 0b000000 1a000000 00000000 ................\n 0120 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0130 6e63682d 7265616c 2d69646f 2d383035 nch-real-ido-805\n 0140 36623232 64303864 62646363 662f752e 6b22d08dbdccf/u.\n 0150 69006368 6173655f 73330000 63686173 i.chase_s3..chas\n 0160 655f7333 00000000 00000000 00000001 e_s3............\n 0170 00000000 00000033 00000000 00000004 .......3........\n 0180 00000000 00000031 00000000 00000000 .......1........\n 0190 00000001 00000000 00000011 00000000 ................\n 01a0 00000000 01800000 00000000 0000001e ................\n 01b0 00000000 00000000 00000000 18200001 ............. ..\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 00000000 7fffffff 00000000 ................\n 01e0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name chase_s3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:check_percent_abs:ido7.1","sym":"check_percent_abs","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","nested"],"loc":20,"refSource":"f32 check_percent_abs(f32 x, f32 min, f32 max, f32 scale, s32 shiftMin) {\n if ((-min <= x) && (x <= min)) {\n return 0.0f;\n }\n if (x >= max) {\n return 1.0f;\n }\n if (x <= -max) {\n return -1.0f;\n }\n if (shiftMin) {\n if (x > 0.0f) {\n return (x - min) * scale;\n } else {\n return (x + min) * scale;\n }\n } else {\n return x * scale;\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L652-L671","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg.s\t$f4,$f14\n 4:\tsw\ta2,8(sp)\n 8:\tc.le.s\t$f4,$f12\n c:\tsw\ta3,12(sp)\n 10:\tlwc1\t$f6,8(sp)\n 14:\tbc1fl\t3c \n 18:\tc.le.s\t$f6,$f12\n 1c:\tc.le.s\t$f12,$f14\n 20:\tnop\n 24:\tbc1fl\t3c \n 28:\tc.le.s\t$f6,$f12\n 2c:\tmtc1\tzero,$f0\n 30:\tjr\tra\n 34:\tnop\n 38:\tc.le.s\t$f6,$f12\n 3c:\tlui\tat,0x3f80\n 40:\tlwc1\t$f8,8(sp)\n 44:\tbc1fl\t5c \n 48:\tneg.s\t$f10,$f8\n 4c:\tmtc1\tat,$f0\n 50:\tjr\tra\n 54:\tnop\n 58:\tneg.s\t$f10,$f8\n 5c:\tlui\tat,0xbf80\n 60:\tc.le.s\t$f12,$f10\n 64:\tlw\tt6,16(sp)\n 68:\tbc1f\t7c \n 6c:\tnop\n 70:\tmtc1\tat,$f0\n 74:\tjr\tra\n 78:\tnop\n 7c:\tbeqz\tt6,bc \n 80:\tlwc1\t$f10,12(sp)\n 84:\tmtc1\tzero,$f16\n 88:\tnop\n 8c:\tc.lt.s\t$f16,$f12\n 90:\tnop\n 94:\tbc1fl\tb0 \n 98:\tadd.s\t$f6,$f12,$f14\n 9c:\tsub.s\t$f18,$f12,$f14\n a0:\tlwc1\t$f4,12(sp)\n a4:\tjr\tra\n a8:\tmul.s\t$f0,$f18,$f4\n ac:\tadd.s\t$f6,$f12,$f14\n b0:\tlwc1\t$f8,12(sp)\n b4:\tjr\tra\n b8:\tmul.s\t$f0,$f6,$f8\n bc:\tmul.s\t$f0,$f12,$f10\n c0:\tjr\tra\n c4:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c8 check_percent_abs\n\n\nContents of section .text:\n 0000 46007107 afa60008 460c203e afa7000c F.q.....F. >....\n 0010 c7a60008 45020009 460c303e 460e603e ....E...F.0>F.`>\n 0020 00000000 45020005 460c303e 44800000 ....E...F.0>D...\n 0030 03e00008 00000000 460c303e 3c013f80 ........F.0><.?.\n 0040 c7a80008 45020005 46004287 44810000 ....E...F.B.D...\n 0050 03e00008 00000000 46004287 3c01bf80 ........F.B.<...\n 0060 460a603e 8fae0010 45000004 00000000 F.`>....E.......\n 0070 44810000 03e00008 00000000 11c0000f D...............\n 0080 c7aa000c 44808000 00000000 460c803c ....D.......F..<\n 0090 00000000 45020006 460e6180 460e6481 ....E...F.a.F.d.\n 00a0 c7a4000c 03e00008 46049002 460e6180 ........F...F.a.\n 00b0 c7a8000c 03e00008 46083002 460a6002 ........F.0.F.`.\n 00c0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00040c2 00000000 . ........@.....\n 0010 000d5df3 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00040c2 00000000 000d5df3 00000000 ..@.......].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000032 00000018 00000248 p......2.......H\n 0010 00000005 000003b0 00000001 00000260 ...............`\n 0020 00000004 00000294 00000000 00000000 ................\n 0030 00000011 000002c4 0000003c 00000308 ...........<....\n 0040 00000014 00000344 00000001 00000358 .......D.......X\n 0050 00000000 00000000 00000001 000003a0 ................\n 0060 10f010f0 40d51220 1020d112 2010f030 ....@.. . .. ..0\n 0070 d1122070 a5132332 00000000 00000001 .. p..#2........\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000002 00000013 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000c8 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d636665 33636534 65663339 -ido-cfe3ce4ef39\n 0140 37396662 342f752e 69006368 65636b5f 79fb4/u.i.check_\n 0150 70657263 656e745f 61627300 63686563 percent_abs.chec\n 0160 6b5f7065 7263656e 745f6162 73000000 k_percent_abs...\n 0170 00000000 00000001 00000000 0000003c ...............<\n 0180 00000000 00000004 00000000 00000032 ...............2\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000018 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 00000000 ..... ..........\n 01d0 00000000 00000000 00000000 00000000 ................\n 01e0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'check_percent_abs' — lift: cannot lift 'check_percent_abs': unmodelled control transfer 'bc1fl' at 0x14 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tneg.s\t$f4,$f14 */\n/* 4:\tsw\ta2,8(sp) */\n/* 8:\tc.le.s\t$f4,$f12 */\n/* c:\tsw\ta3,12(sp) */\n/* 10:\tlwc1\t$f6,8(sp) */\n/* 14:\tbc1fl\t3c */\n/* 18:\tc.le.s\t$f6,$f12 */\n/* 1c:\tc.le.s\t$f12,$f14 */\n/* 20:\tnop */\n/* 24:\tbc1fl\t3c */\n/* 28:\tc.le.s\t$f6,$f12 */\n/* 2c:\tmtc1\tzero,$f0 */\n/* 30:\tjr\tra */\n/* 34:\tnop */\n/* 38:\tc.le.s\t$f6,$f12 */\n/* 3c:\tlui\tat,0x3f80 */\n/* 40:\tlwc1\t$f8,8(sp) */\n/* 44:\tbc1fl\t5c */\n/* 48:\tneg.s\t$f10,$f8 */\n/* 4c:\tmtc1\tat,$f0 */\n/* 50:\tjr\tra */\n/* 54:\tnop */\n/* 58:\tneg.s\t$f10,$f8 */\n/* 5c:\tlui\tat,0xbf80 */\n/* 60:\tc.le.s\t$f12,$f10 */\n/* 64:\tlw\tt6,16(sp) */\n/* 68:\tbc1f\t7c */\n/* 6c:\tnop */\n/* 70:\tmtc1\tat,$f0 */\n/* 74:\tjr\tra */\n/* 78:\tnop */\n/* 7c:\tbeqz\tt6,bc */\n/* 80:\tlwc1\t$f10,12(sp) */\n/* 84:\tmtc1\tzero,$f16 */\n/* 88:\tnop */\n/* 8c:\tc.lt.s\t$f16,$f12 */\n/* 90:\tnop */\n/* 94:\tbc1fl\tb0 */\n/* 98:\tadd.s\t$f6,$f12,$f14 */\n/* 9c:\tsub.s\t$f18,$f12,$f14 */\n/* a0:\tlwc1\t$f4,12(sp) */\n/* a4:\tjr\tra */\n/* a8:\tmul.s\t$f0,$f18,$f4 */\n/* ac:\tadd.s\t$f6,$f12,$f14 */\n/* b0:\tlwc1\t$f8,12(sp) */\n/* b4:\tjr\tra */\n/* b8:\tmul.s\t$f0,$f6,$f8 */\n/* bc:\tmul.s\t$f0,$f12,$f10 */\n/* c0:\tjr\tra */\n/* c4:\tnop */\n/* \t... */\nvoid check_percent_abs(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'check_percent_abs': unmodelled control transfer 'bc1fl' at 0x14 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":59,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'check_percent_abs': unmodelled control transfer 'bc1fl' at 0x14 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 check_percent_abs(f32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4) {\n if ((-arg1 <= arg0) && (arg0 <= arg1)) {\n return 0.0f;\n }\n if (arg2 <= arg0) {\n return 1.0f;\n }\n if (arg0 <= -arg2) {\n return -1.0f;\n }\n if (arg4 != 0) {\n if (arg0 > 0.0f) {\n return (arg0 - arg1) * arg3;\n }\n return (arg0 + arg1) * arg3;\n }\n return arg0 * arg3;\n}\n","score":0,"maxScore":50,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `check_percent_abs` — benchmark function af:check_percent_abs:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel check_percent_abs\n neg.s\t$f4, $f14\n sw\t$a2, 8($sp)\n c.le.s\t$f4, $f12\n sw\t$a3, 12($sp)\n lwc1\t$f6, 8($sp)\n bc1fl\t.L3c\n c.le.s\t$f6, $f12\n c.le.s\t$f12, $f14\n nop\n bc1fl\t.L3c\n c.le.s\t$f6, $f12\n mtc1\t$zero, $f0\n jr\t$ra\n nop\n c.le.s\t$f6, $f12\n.L3c:\n lui\t$at, 0x3f80\n lwc1\t$f8, 8($sp)\n bc1fl\t.L5c\n neg.s\t$f10, $f8\n mtc1\t$at, $f0\n jr\t$ra\n nop\n neg.s\t$f10, $f8\n.L5c:\n lui\t$at, 0xbf80\n c.le.s\t$f12, $f10\n lw\t$t6, 16($sp)\n bc1f\t.L7c\n nop\n mtc1\t$at, $f0\n jr\t$ra\n nop\n.L7c:\n beqz\t$t6, .Lbc\n lwc1\t$f10, 12($sp)\n mtc1\t$zero, $f16\n nop\n c.lt.s\t$f16, $f12\n nop\n bc1fl\t.Lb0\n add.s\t$f6, $f12, $f14\n sub.s\t$f18, $f12, $f14\n lwc1\t$f4, 12($sp)\n jr\t$ra\n mul.s\t$f0, $f18, $f4\n add.s\t$f6, $f12, $f14\n.Lb0:\n lwc1\t$f8, 12($sp)\n jr\t$ra\n mul.s\t$f0, $f6, $f8\n.Lbc:\n mul.s\t$f0, $f12, $f10\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function check_percent_abs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `check_percent_abs` — benchmark function af:check_percent_abs:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:check_percent_abs:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg.s\t$f4,$f14\n 4:\tsw\ta2,8(sp)\n 8:\tc.le.s\t$f4,$f12\n c:\tsw\ta3,12(sp)\n 10:\tlwc1\t$f6,8(sp)\n 14:\tbc1fl\t3c \n 18:\tc.le.s\t$f6,$f12\n 1c:\tc.le.s\t$f12,$f14\n 20:\tnop\n 24:\tbc1fl\t3c \n 28:\tc.le.s\t$f6,$f12\n 2c:\tmtc1\tzero,$f0\n 30:\tjr\tra\n 34:\tnop\n 38:\tc.le.s\t$f6,$f12\n 3c:\tlui\tat,0x3f80\n 40:\tlwc1\t$f8,8(sp)\n 44:\tbc1fl\t5c \n 48:\tneg.s\t$f10,$f8\n 4c:\tmtc1\tat,$f0\n 50:\tjr\tra\n 54:\tnop\n 58:\tneg.s\t$f10,$f8\n 5c:\tlui\tat,0xbf80\n 60:\tc.le.s\t$f12,$f10\n 64:\tlw\tt6,16(sp)\n 68:\tbc1f\t7c \n 6c:\tnop\n 70:\tmtc1\tat,$f0\n 74:\tjr\tra\n 78:\tnop\n 7c:\tbeqz\tt6,bc \n 80:\tlwc1\t$f10,12(sp)\n 84:\tmtc1\tzero,$f16\n 88:\tnop\n 8c:\tc.lt.s\t$f16,$f12\n 90:\tnop\n 94:\tbc1fl\tb0 \n 98:\tadd.s\t$f6,$f12,$f14\n 9c:\tsub.s\t$f18,$f12,$f14\n a0:\tlwc1\t$f4,12(sp)\n a4:\tjr\tra\n a8:\tmul.s\t$f0,$f18,$f4\n ac:\tadd.s\t$f6,$f12,$f14\n b0:\tlwc1\t$f8,12(sp)\n b4:\tjr\tra\n b8:\tmul.s\t$f0,$f6,$f8\n bc:\tmul.s\t$f0,$f12,$f10\n c0:\tjr\tra\n c4:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000d0 .text\n00000000 g F .text\t000000c8 check_percent_abs\n\n\nContents of section .text:\n 0000 46007107 afa60008 460c203e afa7000c F.q.....F. >....\n 0010 c7a60008 45020009 460c303e 460e603e ....E...F.0>F.`>\n 0020 00000000 45020005 460c303e 44800000 ....E...F.0>D...\n 0030 03e00008 00000000 460c303e 3c013f80 ........F.0><.?.\n 0040 c7a80008 45020005 46004287 44810000 ....E...F.B.D...\n 0050 03e00008 00000000 46004287 3c01bf80 ........F.B.<...\n 0060 460a603e 8fae0010 45000004 00000000 F.`>....E.......\n 0070 44810000 03e00008 00000000 11c0000f D...............\n 0080 c7aa000c 44808000 00000000 460c803c ....D.......F..<\n 0090 00000000 45020006 460e6180 460e6481 ....E...F.a.F.d.\n 00a0 c7a4000c 03e00008 46049002 460e6180 ........F...F.a.\n 00b0 c7a8000c 03e00008 46083002 460a6002 ........F.0.F.`.\n 00c0 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00040c2 00000000 . ........@.....\n 0010 000d5df3 00000000 00000000 00007ff0 ..].............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00040c2 00000000 000d5df3 00000000 ..@.......].....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000032 00000018 00000248 p......2.......H\n 0010 00000005 000003b0 00000001 00000260 ...............`\n 0020 00000004 00000294 00000000 00000000 ................\n 0030 00000011 000002c4 0000003c 00000308 ...........<....\n 0040 00000014 00000344 00000001 00000358 .......D.......X\n 0050 00000000 00000000 00000001 000003a0 ................\n 0060 10f010f0 40d51220 1020d112 2010f030 ....@.. . .. ..0\n 0070 d1122070 a5132332 00000000 00000001 .. p..#2........\n 0080 00000000 00000000 00000000 ffffffff ................\n 0090 00000000 00000000 00000000 001d001f ................\n 00a0 00000002 00000013 00000000 00000001 ................\n 00b0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00c0 1820000f 0000002a 000000c8 20200001 . .....*.... ..\n 00d0 00000001 00000000 20200000 02000000 ........ ......\n 00e0 03000000 04000000 05000000 06000000 ................\n 00f0 07000000 08000000 09000000 20000000 ............ ...\n 0100 21000000 0a000000 0b000000 0b000000 !...............\n 0110 1a000000 00000000 00000003 06000000 ................\n 0120 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0130 2d69646f 2d636665 33636534 65663339 -ido-cfe3ce4ef39\n 0140 37396662 342f752e 69006368 65636b5f 79fb4/u.i.check_\n 0150 70657263 656e745f 61627300 63686563 percent_abs.chec\n 0160 6b5f7065 7263656e 745f6162 73000000 k_percent_abs...\n 0170 00000000 00000001 00000000 0000003c ...............<\n 0180 00000000 00000004 00000000 00000032 ...............2\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000018 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 00000000 ..... ..........\n 01d0 00000000 00000000 00000000 00000000 ................\n 01e0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name check_percent_abs # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:get_percent:ido7.1","sym":"get_percent","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","branch","float"],"loc":18,"refSource":"f32 get_percent(s32 max, s32 min, s32 x) {\n f32 denom;\n f32 percent;\n\n percent = 1.0f;\n if (x < min) {\n percent = 0.0f;\n } else if (x < max) {\n denom = (f32)(max - min);\n if (denom != 0.0f) {\n percent = (f32)(x - min) / denom;\n if (percent > 1.0f) {\n percent = 1.0f;\n }\n }\n }\n return percent;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L737-L754","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x3f80\n 4:\tmtc1\tat,$f14\n 8:\tslt\tat,a2,a1\n c:\tbeqz\tat,20 \n 10:\tmov.s\t$f2,$f14\n 14:\tmtc1\tzero,$f2\n 18:\tjr\tra\n 1c:\tmov.s\t$f0,$f2\n 20:\tslt\tat,a2,a0\n 24:\tbeqz\tat,70 \n 28:\tsubu\tt6,a0,a1\n 2c:\tmtc1\tt6,$f4\n 30:\tmtc1\tzero,$f6\n 34:\tsubu\tt7,a2,a1\n 38:\tcvt.s.w\t$f0,$f4\n 3c:\tc.eq.s\t$f6,$f0\n 40:\tnop\n 44:\tbc1t\t70 \n 48:\tnop\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f10,$f8\n 58:\tdiv.s\t$f2,$f10,$f0\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tnop\n 64:\tbc1f\t70 \n 68:\tnop\n 6c:\tmov.s\t$f2,$f14\n 70:\tjr\tra\n 74:\tmov.s\t$f0,$f2\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 get_percent\n\n\nContents of section .text:\n 0000 3c013f80 44817000 00c5082a 10200004 <.?.D.p....*. ..\n 0010 46007086 44801000 03e00008 46001006 F.p.D.......F...\n 0020 00c4082a 10200012 00857023 448e2000 ...*. ....p#D. .\n 0030 44803000 00c57823 46802020 46003032 D.0...x#F. F.02\n 0040 00000000 4501000a 00000000 448f4000 ....E.......D.@.\n 0050 00000000 468042a0 46005083 4602703c ....F.B.F.P.F.p<\n 0060 00000000 45000002 00000000 46007086 ....E.......F.p.\n 0070 03e00008 46001006 00000000 00000000 ....F...........\nContents of section .options:\n 0000 01200000 00000000 8000c072 00000000 . .........r....\n 0010 00004d5f 00000000 00000000 00007ff0 ..M_............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c072 00000000 00004d5f 00000000 ...r......M_....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000014 000001f8 p...............\n 0010 00000005 00000350 00000001 0000020c .......P........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000038 000002b4 .......p...8....\n 0040 0000000c 000002ec 00000001 000002f8 ................\n 0050 00000000 00000000 00000001 00000340 ...............@\n 0060 0141f020 81000a81 fff72210 f4131310 .A. ......\".....\n 0070 41000000 00000000 00000001 00000000 A...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000078 20200001 00000001 ...*...x ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d336439 33326462 34353639 64613436 -3d932db4569da46\n 0140 662f752e 69006765 745f7065 7263656e f/u.i.get_percen\n 0150 74000000 6765745f 70657263 656e7400 t...get_percent.\n 0160 00000000 00000001 00000000 00000036 ...............6\n 0170 00000000 00000004 00000000 0000001e ................\n 0180 00000000 00000000 00000001 00000000 ................\n 0190 00000011 00000000 00000000 01800000 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 00000000 18200001 00000000 00000000 ..... ..........\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'get_percent' — lift: cannot lift 'get_percent': unmodelled control transfer 'bc1t' at 0x44 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlui\tat,0x3f80 */\n/* 4:\tmtc1\tat,$f14 */\n/* 8:\tslt\tat,a2,a1 */\n/* c:\tbeqz\tat,20 */\n/* 10:\tmov.s\t$f2,$f14 */\n/* 14:\tmtc1\tzero,$f2 */\n/* 18:\tjr\tra */\n/* 1c:\tmov.s\t$f0,$f2 */\n/* 20:\tslt\tat,a2,a0 */\n/* 24:\tbeqz\tat,70 */\n/* 28:\tsubu\tt6,a0,a1 */\n/* 2c:\tmtc1\tt6,$f4 */\n/* 30:\tmtc1\tzero,$f6 */\n/* 34:\tsubu\tt7,a2,a1 */\n/* 38:\tcvt.s.w\t$f0,$f4 */\n/* 3c:\tc.eq.s\t$f6,$f0 */\n/* 40:\tnop */\n/* 44:\tbc1t\t70 */\n/* 48:\tnop */\n/* 4c:\tmtc1\tt7,$f8 */\n/* 50:\tnop */\n/* 54:\tcvt.s.w\t$f10,$f8 */\n/* 58:\tdiv.s\t$f2,$f10,$f0 */\n/* 5c:\tc.lt.s\t$f14,$f2 */\n/* 60:\tnop */\n/* 64:\tbc1f\t70 */\n/* 68:\tnop */\n/* 6c:\tmov.s\t$f2,$f14 */\n/* 70:\tjr\tra */\n/* 74:\tmov.s\t$f0,$f2 */\n/* \t... */\nvoid get_percent(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'get_percent': unmodelled control transfer 'bc1t' at 0x44 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":39,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'get_percent': unmodelled control transfer 'bc1t' at 0x44 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"f32 get_percent(s32 arg0, s32 arg1, s32 arg2) {\n f32 temp_f0;\n f32 var_f2;\n\n var_f2 = 1.0f;\n if (arg2 < arg1) {\n return 0.0f;\n }\n if (arg2 < arg0) {\n temp_f0 = (f32) (arg0 - arg1);\n if (temp_f0 != 0.0f) {\n var_f2 = (f32) (arg2 - arg1) / temp_f0;\n if (var_f2 > 1.0f) {\n var_f2 = 1.0f;\n }\n }\n }\n return var_f2;\n}\n","score":12,"maxScore":33,"compileErrors":null,"breakdown":{"insert":3,"delete":2,"replace":4,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":12,"maxScore":33,"ratio":0.36363636363636365,"kinds":{"insert":3,"delete":2,"replace":4,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `get_percent` — benchmark function af:get_percent:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel get_percent\n lui\t$at, 0x3f80\n mtc1\t$at, $f14\n slt\t$at, $a2, $a1\n beqz\t$at, .L20\n mov.s\t$f2, $f14\n mtc1\t$zero, $f2\n jr\t$ra\n mov.s\t$f0, $f2\n.L20:\n slt\t$at, $a2, $a0\n beqz\t$at, .L70\n subu\t$t6, $a0, $a1\n mtc1\t$t6, $f4\n mtc1\t$zero, $f6\n subu\t$t7, $a2, $a1\n cvt.s.w\t$f0, $f4\n c.eq.s\t$f6, $f0\n nop\n bc1t\t.L70\n nop\n mtc1\t$t7, $f8\n nop\n cvt.s.w\t$f10, $f8\n div.s\t$f2, $f10, $f0\n c.lt.s\t$f14, $f2\n nop\n bc1f\t.L70\n nop\n mov.s\t$f2, $f14\n.L70:\n jr\t$ra\n mov.s\t$f0, $f2\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function get_percent # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `get_percent` — benchmark function af:get_percent:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:get_percent:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x3f80\n 4:\tmtc1\tat,$f14\n 8:\tslt\tat,a2,a1\n c:\tbeqz\tat,20 \n 10:\tmov.s\t$f2,$f14\n 14:\tmtc1\tzero,$f2\n 18:\tjr\tra\n 1c:\tmov.s\t$f0,$f2\n 20:\tslt\tat,a2,a0\n 24:\tbeqz\tat,70 \n 28:\tsubu\tt6,a0,a1\n 2c:\tmtc1\tt6,$f4\n 30:\tmtc1\tzero,$f6\n 34:\tsubu\tt7,a2,a1\n 38:\tcvt.s.w\t$f0,$f4\n 3c:\tc.eq.s\t$f6,$f0\n 40:\tnop\n 44:\tbc1t\t70 \n 48:\tnop\n 4c:\tmtc1\tt7,$f8\n 50:\tnop\n 54:\tcvt.s.w\t$f10,$f8\n 58:\tdiv.s\t$f2,$f10,$f0\n 5c:\tc.lt.s\t$f14,$f2\n 60:\tnop\n 64:\tbc1f\t70 \n 68:\tnop\n 6c:\tmov.s\t$f2,$f14\n 70:\tjr\tra\n 74:\tmov.s\t$f0,$f2\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 get_percent\n\n\nContents of section .text:\n 0000 3c013f80 44817000 00c5082a 10200004 <.?.D.p....*. ..\n 0010 46007086 44801000 03e00008 46001006 F.p.D.......F...\n 0020 00c4082a 10200012 00857023 448e2000 ...*. ....p#D. .\n 0030 44803000 00c57823 46802020 46003032 D.0...x#F. F.02\n 0040 00000000 4501000a 00000000 448f4000 ....E.......D.@.\n 0050 00000000 468042a0 46005083 4602703c ....F.B.F.P.F.p<\n 0060 00000000 45000002 00000000 46007086 ....E.......F.p.\n 0070 03e00008 46001006 00000000 00000000 ....F...........\nContents of section .options:\n 0000 01200000 00000000 8000c072 00000000 . .........r....\n 0010 00004d5f 00000000 00000000 00007ff0 ..M_............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c072 00000000 00004d5f 00000000 ...r......M_....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000014 000001f8 p...............\n 0010 00000005 00000350 00000001 0000020c .......P........\n 0020 00000004 00000240 00000000 00000000 .......@........\n 0030 00000011 00000270 00000038 000002b4 .......p...8....\n 0040 0000000c 000002ec 00000001 000002f8 ................\n 0050 00000000 00000000 00000001 00000340 ...............@\n 0060 0141f020 81000a81 fff72210 f4131310 .A. ......\".....\n 0070 41000000 00000000 00000001 00000000 A...............\n 0080 00000000 00000000 ffffffff 00000000 ................\n 0090 00000000 00000000 001d001f 00000002 ................\n 00a0 00000011 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 00000078 20200001 00000001 ...*...x ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d336439 33326462 34353639 64613436 -3d932db4569da46\n 0140 662f752e 69006765 745f7065 7263656e f/u.i.get_percen\n 0150 74000000 6765745f 70657263 656e7400 t...get_percent.\n 0160 00000000 00000001 00000000 00000036 ...............6\n 0170 00000000 00000004 00000000 0000001e ................\n 0180 00000000 00000000 00000001 00000000 ................\n 0190 00000011 00000000 00000000 01800000 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 00000000 18200001 00000000 00000000 ..... ..........\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name get_percent # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:gfxopen:ido7.1","sym":"gfxopen","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["pointer","arithmetic"],"loc":3,"refSource":"Gfx* gfxopen(Gfx* gfxHead) {\n return gfxHead + 1;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/gfxalloc.c#L4-L6","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddiu\tv0,a0,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 gfxopen\n\n\nContents of section .text:\n 0000 03e00008 24820008 00000000 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 11000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000008 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d636633 31393232 62396531 63623137 -cf31922b9e1cb17\n 0130 652f752e 69006766 786f7065 6e000000 e/u.i.gfxopen...\n 0140 6766786f 70656e00 00000000 00000001 gfxopen.........\n 0150 00000000 00000032 00000000 00000004 .......2........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 gfxopen(u32 a0) {\n return a0 + 8;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 gfxopen(s32 arg0) {\n return arg0 + 8;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `gfxopen` — benchmark function af:gfxopen:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel gfxopen\n jr\t$ra\n addiu\t$v0, $a0, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function gfxopen # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `gfxopen` — benchmark function af:gfxopen:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:gfxopen:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddiu\tv0,a0,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 gfxopen\n\n\nContents of section .text:\n 0000 03e00008 24820008 00000000 00000000 ....$...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 11000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000008 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d636633 31393232 62396531 63623137 -cf31922b9e1cb17\n 0130 652f752e 69006766 786f7065 6e000000 e/u.i.gfxopen...\n 0140 6766786f 70656e00 00000000 00000001 gfxopen.........\n 0150 00000000 00000032 00000000 00000004 .......2........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name gfxopen # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:inter_float:ido7.1","sym":"inter_float","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","call"],"loc":9,"refSource":"void inter_float(f32* pValue, f32 arg1, s32 stepCount) {\n if (stepCount <= 0) {\n *pValue = arg1;\n } else {\n f32 diff = arg1 - *pValue;\n\n *pValue += diff / stepCount;\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L196-L204","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tbgtzl\ta2,18 \n 8:\tmtc1\ta2,$f4\n c:\tjr\tra\n 10:\tswc1\t$f12,0(a0)\n 14:\tmtc1\ta2,$f4\n 18:\tlwc1\t$f2,0(a0)\n 1c:\tcvt.s.w\t$f6,$f4\n 20:\tsub.s\t$f0,$f12,$f2\n 24:\tdiv.s\t$f8,$f0,$f6\n 28:\tadd.s\t$f10,$f2,$f8\n 2c:\tswc1\t$f10,0(a0)\n 30:\tjr\tra\n 34:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000038 inter_float\n\n\nContents of section .text:\n 0000 44856000 5cc00004 44862000 03e00008 D.`.\\...D. .....\n 0010 e48c0000 44862000 c4820000 468021a0 ....D. .....F.!.\n 0020 46026001 46060203 46081280 e48a0000 F.`.F...F.......\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00001fd7 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00001fd7 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000e 0000000c 000001b8 p...............\n 0010 00000005 00000308 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000038 0000026c .......(...8...l\n 0040 0000000c 000002a4 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 00111130 f010f012 21000000 00000000 ...0....!.......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 00000038 ..... .....*...8\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d646434 38643136 real-ido-dd48d16\n 0130 36626162 37663466 362f752e 6900696e 6bab7f4f6/u.i.in\n 0140 7465725f 666c6f61 74000000 696e7465 ter_float...inte\n 0150 725f666c 6f617400 00000000 00000001 r_float.........\n 0160 00000000 00000036 00000000 00000004 .......6........\n 0170 00000000 0000000e 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000009 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'inter_float' — lift: cannot lift 'inter_float': unmodelled control transfer 'bgtzl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta1,$f12 */\n/* 4:\tbgtzl\ta2,18 */\n/* 8:\tmtc1\ta2,$f4 */\n/* c:\tjr\tra */\n/* 10:\tswc1\t$f12,0(a0) */\n/* 14:\tmtc1\ta2,$f4 */\n/* 18:\tlwc1\t$f2,0(a0) */\n/* 1c:\tcvt.s.w\t$f6,$f4 */\n/* 20:\tsub.s\t$f0,$f12,$f2 */\n/* 24:\tdiv.s\t$f8,$f0,$f6 */\n/* 28:\tadd.s\t$f10,$f2,$f8 */\n/* 2c:\tswc1\t$f10,0(a0) */\n/* 30:\tjr\tra */\n/* 34:\tnop */\n/* \t... */\nvoid inter_float(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'inter_float': unmodelled control transfer 'bgtzl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'inter_float': unmodelled control transfer 'bgtzl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void inter_float(f32 *arg0, f32 arg1, s32 arg2) {\n f32 temp_f2;\n\n if (arg2 <= 0) {\n *arg0 = arg1;\n return;\n }\n temp_f2 = *arg0;\n *arg0 = temp_f2 + ((arg1 - temp_f2) / (f32) arg2);\n}\n","score":8,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":8},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":8,"maxScore":14,"ratio":0.5714285714285714,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":8}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `inter_float` — benchmark function af:inter_float:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel inter_float\n mtc1\t$a1, $f12\n bgtzl\t$a2, .L18\n mtc1\t$a2, $f4\n jr\t$ra\n swc1\t$f12, 0($a0)\n mtc1\t$a2, $f4\n.L18:\n lwc1\t$f2, 0($a0)\n cvt.s.w\t$f6, $f4\n sub.s\t$f0, $f12, $f2\n div.s\t$f8, $f0, $f6\n add.s\t$f10, $f2, $f8\n swc1\t$f10, 0($a0)\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function inter_float # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `inter_float` — benchmark function af:inter_float:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:inter_float:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tbgtzl\ta2,18 \n 8:\tmtc1\ta2,$f4\n c:\tjr\tra\n 10:\tswc1\t$f12,0(a0)\n 14:\tmtc1\ta2,$f4\n 18:\tlwc1\t$f2,0(a0)\n 1c:\tcvt.s.w\t$f6,$f4\n 20:\tsub.s\t$f0,$f12,$f2\n 24:\tdiv.s\t$f8,$f0,$f6\n 28:\tadd.s\t$f10,$f2,$f8\n 2c:\tswc1\t$f10,0(a0)\n 30:\tjr\tra\n 34:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000038 inter_float\n\n\nContents of section .text:\n 0000 44856000 5cc00004 44862000 03e00008 D.`.\\...D. .....\n 0010 e48c0000 44862000 c4820000 468021a0 ....D. .....F.!.\n 0020 46026001 46060203 46081280 e48a0000 F.`.F...F.......\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 00001fd7 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 00001fd7 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000e 0000000c 000001b8 p...............\n 0010 00000005 00000308 00000001 000001c4 ................\n 0020 00000004 000001f8 00000000 00000000 ................\n 0030 00000011 00000228 00000038 0000026c .......(...8...l\n 0040 0000000c 000002a4 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 00111130 f010f012 21000000 00000000 ...0....!.......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000009 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 00000038 ..... .....*...8\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d646434 38643136 real-ido-dd48d16\n 0130 36626162 37663466 362f752e 6900696e 6bab7f4f6/u.i.in\n 0140 7465725f 666c6f61 74000000 696e7465 ter_float...inte\n 0150 725f666c 6f617400 00000000 00000001 r_float.........\n 0160 00000000 00000036 00000000 00000004 .......6........\n 0170 00000000 0000000e 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000009 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name inter_float # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:lbRk_IsKyuurekiLeapYear:ido7.1","sym":"lbRk_IsKyuurekiLeapYear","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["array","branch","arithmetic"],"loc":7,"refSource":"s32 lbRk_IsKyuurekiLeapYear(s32 year) {\n if (l_lbRk_leapdays[year - lbRk_YEAR_MIN] != 0) {\n return 1;\n };\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L69-L75","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a0,0x2\n 4:\tlui\tt7,0x0\n 8:\taddu\tt7,t7,t6\n c:\tlw\tt7,-8000(t7)\n 10:\tmove\tv0,zero\n 14:\tbeqz\tt7,24 \n 18:\tnop\n 1c:\tjr\tra\n 20:\tli\tv0,1\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/af/ctx-a9b48a7c4c9b.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c lbRk_IsKyuurekiLeapYear\n00000000 O *UND*\t00000084 l_lbRk_leapdays\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 l_lbRk_leapdays\n0000000c R_MIPS_LO16 l_lbRk_leapdays\n\n\nContents of section .text:\n 0000 00047080 3c0f0000 01ee7821 8defe0c0 ..p.<.....x!....\n 0010 00001025 11e00003 00000000 03e00008 ...%............\n 0020 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000008 000001e8 p...............\n 0010 00000006 0000036c 00000001 000001f0 .......l........\n 0020 00000004 00000224 00000000 00000000 .......$........\n 0030 00000011 00000254 00000044 00000298 .......T...D....\n 0040 00000028 000002dc 00000001 00000304 ...(............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 1330d111 21000000 00000000 00000001 .0..!...........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000002c 20200001 . .....*..., ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d356135 31643436 34373565 -ido-5a51d46475e\n 0130 33623231 342f752e 69006c62 526b5f49 3b214/u.i.lbRk_I\n 0140 734b7975 7572656b 694c6561 70596561 sKyuurekiLeapYea\n 0150 72000000 6c62526b 5f49734b 79757572 r...lbRk_IsKyuur\n 0160 656b694c 65617059 65617200 6c5f6c62 ekiLeapYear.l_lb\n 0170 526b5f6c 65617064 61797300 00000000 Rk_leapdays.....\n 0180 00000001 00000000 00000042 00000000 ...........B....\n 0190 00000004 00000000 0000000b 00000000 ................\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 00000005 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000018 00000000 . ..............\n 01e0 04cfffff 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 7fffffff ................\n 0200 00000000 7fffffff 00000001 00000000 ................\n 0210 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 lbRk_IsKyuurekiLeapYear(u32 a0) {\n if (((s32 *)(0 + (a0 << 2)))[-2000] != 0) {\n return 1;\n } else {\n return 0;\n }\n}\n","score":3,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 lbRk_IsKyuurekiLeapYear(s32 year) {\n if (l_lbRk_leapdays[year] != 0) {\n return 1;\n }\n return 0;\n}\n","score":2,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":11,"ratio":0.18181818181818182,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lbRk_IsKyuurekiLeapYear` — benchmark function af:lbRk_IsKyuurekiLeapYear:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_IsKyuurekiLeapYear\n sll\t$t6, $a0, 0x2\n lui\t$t7, %hi(l_lbRk_leapdays)\n addu\t$t7, $t7, $t6\n lw\t$t7, %lo(l_lbRk_leapdays)($t7)\n move\t$v0, $zero\n beqz\t$t7, .L24\n nop\n jr\t$ra\n li\t$v0, 1\n.L24:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-a9b48a7c4c9b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 lbRk_IsKyuurekiLeapYear(s32 year);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_IsKyuurekiLeapYear # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_IsKyuurekiLeapYear` — benchmark function af:lbRk_IsKyuurekiLeapYear:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_IsKyuurekiLeapYear:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a0,0x2\n 4:\tlui\tt7,0x0\n 8:\taddu\tt7,t7,t6\n c:\tlw\tt7,-8000(t7)\n 10:\tmove\tv0,zero\n 14:\tbeqz\tt7,24 \n 18:\tnop\n 1c:\tjr\tra\n 20:\tli\tv0,1\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c lbRk_IsKyuurekiLeapYear\n00000000 O *UND*\t00000084 l_lbRk_leapdays\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 l_lbRk_leapdays\n0000000c R_MIPS_LO16 l_lbRk_leapdays\n\n\nContents of section .text:\n 0000 00047080 3c0f0000 01ee7821 8defe0c0 ..p.<.....x!....\n 0010 00001025 11e00003 00000000 03e00008 ...%............\n 0020 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000008 000001e8 p...............\n 0010 00000006 0000036c 00000001 000001f0 .......l........\n 0020 00000004 00000224 00000000 00000000 .......$........\n 0030 00000011 00000254 00000044 00000298 .......T...D....\n 0040 00000028 000002dc 00000001 00000304 ...(............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 1330d111 21000000 00000000 00000001 .0..!...........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000002c 20200001 . .....*..., ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d356135 31643436 34373565 -ido-5a51d46475e\n 0130 33623231 342f752e 69006c62 526b5f49 3b214/u.i.lbRk_I\n 0140 734b7975 7572656b 694c6561 70596561 sKyuurekiLeapYea\n 0150 72000000 6c62526b 5f49734b 79757572 r...lbRk_IsKyuur\n 0160 656b694c 65617059 65617200 6c5f6c62 ekiLeapYear.l_lb\n 0170 526b5f6c 65617064 61797300 00000000 Rk_leapdays.....\n 0180 00000001 00000000 00000042 00000000 ...........B....\n 0190 00000004 00000000 0000000b 00000000 ................\n 01a0 00000000 00000001 00000000 00000011 ................\n 01b0 00000000 00000000 01800000 00000000 ................\n 01c0 00000005 00000000 00000000 00000000 ................\n 01d0 18200001 00000000 00000018 00000000 . ..............\n 01e0 04cfffff 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 7fffffff ................\n 0200 00000000 7fffffff 00000001 00000000 ................\n 0210 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_IsKyuurekiLeapYear # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:lbRk_IsLeapMonth:ido7.1","sym":"lbRk_IsLeapMonth","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch","arithmetic"],"loc":7,"refSource":"s32 lbRk_IsLeapMonth(s32 month) {\n if (month == lbRk_KYUU_LEAP_MONTH) {\n return 1;\n }\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L77-L83","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,13\n 4:\tbne\ta0,at,14 \n 8:\tmove\tv0,zero\n c:\tjr\tra\n 10:\tli\tv0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c lbRk_IsLeapMonth\n\n\nContents of section .text:\n 0000 2401000d 14810003 00001025 03e00008 $..........%....\n 0010 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000198 p...............\n 0010 00000005 000002ec 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 0000003c 00000244 ...........<...D\n 0040 00000014 00000280 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1130e121 00000000 00000001 00000000 .0.!............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 0000001c 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d626639 33623861 30623438 66396139 -bf93b8a0b48f9a9\n 0130 612f752e 69006c62 526b5f49 734c6561 a/u.i.lbRk_IsLea\n 0140 704d6f6e 74680000 6c62526b 5f49734c pMonth..lbRk_IsL\n 0150 6561704d 6f6e7468 00000000 00000000 eapMonth........\n 0160 00000001 00000000 0000003b 00000000 ...........;....\n 0170 00000004 00000000 00000007 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000004 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 lbRk_IsLeapMonth(u32 a0) {\n if (a0 == 13) {\n return 1;\n } else {\n return 0;\n }\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 lbRk_IsLeapMonth(s32 arg0) {\n if (arg0 == 0xD) {\n return 1;\n }\n return 0;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lbRk_IsLeapMonth` — benchmark function af:lbRk_IsLeapMonth:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_IsLeapMonth\n li\t$at, 13\n bne\t$a0, $at, .L14\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, 1\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_IsLeapMonth # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_IsLeapMonth` — benchmark function af:lbRk_IsLeapMonth:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_IsLeapMonth:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,13\n 4:\tbne\ta0,at,14 \n 8:\tmove\tv0,zero\n c:\tjr\tra\n 10:\tli\tv0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c lbRk_IsLeapMonth\n\n\nContents of section .text:\n 0000 2401000d 14810003 00001025 03e00008 $..........%....\n 0010 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000198 p...............\n 0010 00000005 000002ec 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 0000003c 00000244 ...........<...D\n 0040 00000014 00000280 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1130e121 00000000 00000001 00000000 .0.!............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000001 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 0000001c 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d626639 33623861 30623438 66396139 -bf93b8a0b48f9a9\n 0130 612f752e 69006c62 526b5f49 734c6561 a/u.i.lbRk_IsLea\n 0140 704d6f6e 74680000 6c62526b 5f49734c pMonth..lbRk_IsL\n 0150 6561704d 6f6e7468 00000000 00000000 eapMonth........\n 0160 00000001 00000000 0000003b 00000000 ...........;....\n 0170 00000004 00000000 00000007 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000004 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_IsLeapMonth # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:lbRk_SeirekiDays:ido7.1","sym":"lbRk_SeirekiDays","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["array","arithmetic","branch"],"loc":9,"refSource":"s32 lbRk_SeirekiDays(s32 year, s32 month) {\n s32 idx = 0;\n\n if ((year % 4) == 0) {\n idx = 1;\n }\n\n return t_seiyo_days_tbl[idx][month];\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/lb_reki.c#L51-L59","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\tt6,a0,0x3\n 4:\tbnez\tt6,10 \n 8:\tmove\tv1,zero\n c:\tli\tv1,1\n 10:\tsll\tt7,v1,0x2\n 14:\tsubu\tt7,t7,v1\n 18:\tsll\tt7,t7,0x2\n 1c:\taddu\tt7,t7,v1\n 20:\taddu\tt8,t7,a1\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t8\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/af/ctx-8aa31dab04e4.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 lbRk_SeirekiDays\n00000000 O *UND*\t0000001a t_seiyo_days_tbl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 t_seiyo_days_tbl\n00000030 R_MIPS_LO16 t_seiyo_days_tbl\n\n\nContents of section .text:\n 0000 308e0003 15c00002 00001825 24030001 0..........%$...\n 0010 00037880 01e37823 000f7880 01e37821 ..x...x#..x...x!\n 0020 01e5c021 3c020000 00581021 03e00008 ...!<....X.!....\n 0030 90420000 00000000 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 8100c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001f8 p...............\n 0010 00000006 0000036c 00000001 000001fc .......l........\n 0020 00000004 00000230 00000000 00000000 .......0........\n 0030 00000011 00000260 0000003c 000002a4 .......`...<....\n 0040 00000024 000002e0 00000001 00000304 ...$............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 21f02028 00000000 00000001 00000000 !. (............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000009 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000034 20200001 00000001 ...*...4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363334 39303562 35613031 64633739 -634905b5a01dc79\n 0130 652f752e 69006c62 526b5f53 65697265 e/u.i.lbRk_Seire\n 0140 6b694461 79730000 6c62526b 5f536569 kiDays..lbRk_Sei\n 0150 72656b69 44617973 00745f73 6569796f rekiDays.t_seiyo\n 0160 5f646179 735f7462 6c000000 00000000 _days_tbl.......\n 0170 00000001 00000000 0000003b 00000000 ...........;....\n 0180 00000004 00000000 0000000d 00000000 ................\n 0190 00000000 00000001 00000000 00000011 ................\n 01a0 00000000 00000000 01800000 00000000 ................\n 01b0 00000004 00000000 00000000 00000000 ................\n 01c0 18200001 00000000 00000011 00000000 . ..............\n 01d0 04cfffff 00000000 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 7fffffff 00000001 00000000 ................\n 0200 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'lbRk_SeirekiDays' — lift: cannot lift 'lbRk_SeirekiDays': %hi(t_seiyo_days_tbl) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tandi\tt6,a0,0x3 */\n/* 4:\tbnez\tt6,10 */\n/* 8:\tmove\tv1,zero */\n/* c:\tli\tv1,1 */\n/* 10:\tsll\tt7,v1,0x2 */\n/* 14:\tsubu\tt7,t7,v1 */\n/* 18:\tsll\tt7,t7,0x2 */\n/* 1c:\taddu\tt7,t7,v1 */\n/* 20:\taddu\tt8,t7,a1 */\n/* 24:\tlui\tv0,0x0 */\n/* 28:\taddu\tv0,v0,t8 */\n/* 2c:\tjr\tra */\n/* 30:\tlbu\tv0,0(v0) */\n/* \t... */\nvoid lbRk_SeirekiDays(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'lbRk_SeirekiDays': %hi(t_seiyo_days_tbl) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'lbRk_SeirekiDays': %hi(t_seiyo_days_tbl) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 lbRk_SeirekiDays(s32 year, s32 month) {\n s32 var_v1;\n\n var_v1 = 0;\n if (!(year & 3)) {\n var_v1 = 1;\n }\n return (s32) (*t_seiyo_days_tbl)[(var_v1 * 0xD) + month];\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lbRk_SeirekiDays` — benchmark function af:lbRk_SeirekiDays:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lbRk_SeirekiDays\n andi\t$t6, $a0, 0x3\n bnez\t$t6, .L10\n move\t$v1, $zero\n li\t$v1, 1\n.L10:\n sll\t$t7, $v1, 0x2\n subu\t$t7, $t7, $v1\n sll\t$t7, $t7, 0x2\n addu\t$t7, $t7, $v1\n addu\t$t8, $t7, $a1\n lui\t$v0, %hi(t_seiyo_days_tbl)\n addu\t$v0, $v0, $t8\n jr\t$ra\n lbu\t$v0, %lo(t_seiyo_days_tbl)($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-8aa31dab04e4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 lbRk_SeirekiDays(s32 year, s32 month);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lbRk_SeirekiDays # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lbRk_SeirekiDays` — benchmark function af:lbRk_SeirekiDays:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:lbRk_SeirekiDays:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\tt6,a0,0x3\n 4:\tbnez\tt6,10 \n 8:\tmove\tv1,zero\n c:\tli\tv1,1\n 10:\tsll\tt7,v1,0x2\n 14:\tsubu\tt7,t7,v1\n 18:\tsll\tt7,t7,0x2\n 1c:\taddu\tt7,t7,v1\n 20:\taddu\tt8,t7,a1\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t8\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 lbRk_SeirekiDays\n00000000 O *UND*\t0000001a t_seiyo_days_tbl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 t_seiyo_days_tbl\n00000030 R_MIPS_LO16 t_seiyo_days_tbl\n\n\nContents of section .text:\n 0000 308e0003 15c00002 00001825 24030001 0..........%$...\n 0010 00037880 01e37823 000f7880 01e37821 ..x...x#..x...x!\n 0020 01e5c021 3c020000 00581021 03e00008 ...!<....X.!....\n 0030 90420000 00000000 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 8100c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001f8 p...............\n 0010 00000006 0000036c 00000001 000001fc .......l........\n 0020 00000004 00000230 00000000 00000000 .......0........\n 0030 00000011 00000260 0000003c 000002a4 .......`...<....\n 0040 00000024 000002e0 00000001 00000304 ...$............\n 0050 00000000 00000000 00000002 0000034c ...............L\n 0060 21f02028 00000000 00000001 00000000 !. (............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000009 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000034 20200001 00000001 ...*...4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363334 39303562 35613031 64633739 -634905b5a01dc79\n 0130 652f752e 69006c62 526b5f53 65697265 e/u.i.lbRk_Seire\n 0140 6b694461 79730000 6c62526b 5f536569 kiDays..lbRk_Sei\n 0150 72656b69 44617973 00745f73 6569796f rekiDays.t_seiyo\n 0160 5f646179 735f7462 6c000000 00000000 _days_tbl.......\n 0170 00000001 00000000 0000003b 00000000 ...........;....\n 0180 00000004 00000000 0000000d 00000000 ................\n 0190 00000000 00000001 00000000 00000011 ................\n 01a0 00000000 00000000 01800000 00000000 ................\n 01b0 00000004 00000000 00000000 00000000 ................\n 01c0 18200001 00000000 00000011 00000000 . ..............\n 01d0 04cfffff 00000000 00000000 00000000 ................\n 01e0 00000000 00000000 00000000 7fffffff ................\n 01f0 00000000 7fffffff 00000001 00000000 ................\n 0200 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lbRk_SeirekiDays # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:limiter:ido7.1","sym":"limiter","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","macro"],"loc":7,"refSource":"f32 limiter(f32 val, f32 max) {\n if (val < 0.0f) {\n return CLAMP_MIN(val, -max);\n } else {\n return CLAMP_MAX(val, max);\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L50-L56","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f14,$f12\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f12,$f0\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f14,$f12\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 limiter\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460c703c 46007007 4600603c E...F.p: */\n/* 0:\tmtc1\tzero,$f4 */\n/* 4:\tnop */\n/* 8:\tc.lt.s\t$f12,$f4 */\n/* c:\tnop */\n/* 10:\tbc1fl\t44 */\n/* 14:\tc.lt.s\t$f14,$f12 */\n/* 18:\tneg.s\t$f0,$f14 */\n/* 1c:\tc.lt.s\t$f12,$f0 */\n/* 20:\tnop */\n/* 24:\tbc1fl\t38 */\n/* 28:\tmov.s\t$f2,$f12 */\n/* 2c:\tjr\tra */\n/* 30:\tnop */\n/* 34:\tmov.s\t$f2,$f12 */\n/* 38:\tjr\tra */\n/* 3c:\tmov.s\t$f0,$f2 */\n/* 40:\tc.lt.s\t$f14,$f12 */\n/* 44:\tnop */\n/* 48:\tbc1fl\t5c */\n/* 4c:\tmov.s\t$f2,$f12 */\n/* 50:\tb\t5c */\n/* 54:\tmov.s\t$f2,$f14 */\n/* 58:\tmov.s\t$f2,$f12 */\n/* 5c:\tmov.s\t$f0,$f2 */\n/* 60:\tjr\tra */\n/* 64:\tnop */\n/* \t... */\nvoid limiter(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'limiter': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":35,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'limiter': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"f32 limiter(f32 arg0, f32 arg1) {\n f32 temp_f0;\n f32 var_f2;\n\n if (arg0 < 0.0f) {\n temp_f0 = -arg1;\n if (arg0 < temp_f0) {\n return temp_f0;\n }\n return arg0;\n }\n if (arg1 < arg0) {\n var_f2 = arg1;\n } else {\n var_f2 = arg0;\n }\n return var_f2;\n}\n","score":8,"maxScore":27,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":8,"maxScore":27,"ratio":0.2962962962962963,"kinds":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `limiter` — benchmark function af:limiter:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel limiter\n mtc1\t$zero, $f4\n nop\n c.lt.s\t$f12, $f4\n nop\n bc1fl\t.L44\n c.lt.s\t$f14, $f12\n neg.s\t$f0, $f14\n c.lt.s\t$f12, $f0\n nop\n bc1fl\t.L38\n mov.s\t$f2, $f12\n jr\t$ra\n nop\n mov.s\t$f2, $f12\n.L38:\n jr\t$ra\n mov.s\t$f0, $f2\n c.lt.s\t$f14, $f12\n.L44:\n nop\n bc1fl\t.L5c\n mov.s\t$f2, $f12\n b\t.L5c\n mov.s\t$f2, $f14\n mov.s\t$f2, $f12\n.L5c:\n mov.s\t$f0, $f2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function limiter # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `limiter` — benchmark function af:limiter:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:limiter:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f14,$f12\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f12,$f0\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f14,$f12\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 limiter\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460c703c 46007007 4600603c E...F.pprev = NULL;\n this->next = NULL;\n return this;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/listalloc.c#L4-L8","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,0(a0)\n 4:\tsw\tzero,4(a0)\n 8:\tjr\tra\n c:\tmove\tv0,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ListAlloc_Init\n\n\nContents of section .text:\n 0000 ac800000 ac800004 03e00008 00801025 ...............%\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000188 p...............\n 0010 00000005 000002d8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 0000003c 00000234 ...........<...4\n 0040 00000010 00000270 00000001 00000280 .......p........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 10101100 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000007 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000010 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d613563 33653965 64653539 61393439 -a5c3e9ede59a949\n 0130 382f752e 69004c69 7374416c 6c6f635f 8/u.i.ListAlloc_\n 0140 496e6974 00000000 4c697374 416c6c6f Init....ListAllo\n 0150 635f496e 69740000 00000000 00000001 c_Init..........\n 0160 00000000 00000039 00000000 00000004 .......9........\n 0170 00000000 00000004 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000003 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 * ListAlloc_Init(s32 * a0) {\n *a0 = 0;\n a0[1] = 0;\n return a0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *ListAlloc_Init(void *arg0) {\n arg0->unk0 = 0;\n arg0->unk4 = 0;\n return arg0;\n}\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 5: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 6: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ListAlloc_Init` — benchmark function af:ListAlloc_Init:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ListAlloc_Init\n sw\t$zero, 0($a0)\n sw\t$zero, 4($a0)\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ListAlloc_Init # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ListAlloc_Init` — benchmark function af:ListAlloc_Init:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:ListAlloc_Init:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,0(a0)\n 4:\tsw\tzero,4(a0)\n 8:\tjr\tra\n c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ListAlloc_Init\n\n\nContents of section .text:\n 0000 ac800000 ac800004 03e00008 00801025 ...............%\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000188 p...............\n 0010 00000005 000002d8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 0000003c 00000234 ...........<...4\n 0040 00000010 00000270 00000001 00000280 .......p........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 10101100 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000004 ................\n 0090 00000007 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000010 20200001 00000001 ...*.... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d613563 33653965 64653539 61393439 -a5c3e9ede59a949\n 0130 382f752e 69004c69 7374416c 6c6f635f 8/u.i.ListAlloc_\n 0140 496e6974 00000000 4c697374 416c6c6f Init....ListAllo\n 0150 635f496e 69740000 00000000 00000001 c_Init..........\n 0160 00000000 00000039 00000000 00000004 .......9........\n 0170 00000000 00000004 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000003 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ListAlloc_Init # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mem_clear:ido7.1","sym":"mem_clear","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","pointer","memory"],"loc":5,"refSource":"void mem_clear(u8* ptr, size_t len, u8 value) {\n size_t i;\n\n for (i = 0; i < len; i++) {*ptr++ = value;}\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L23-L29","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tandi\ta2,a2,0xff\n 8:\tbeqz\ta1,4c \n c:\tmove\tv0,zero\n 10:\tandi\ta3,a1,0x3\n 14:\tbeqz\ta3,30 \n 18:\tmove\tv1,a3\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\ta2,0(a0)\n 24:\tbne\tv1,v0,1c \n 28:\taddiu\ta0,a0,1\n 2c:\tbeq\tv0,a1,4c \n 30:\taddiu\tv0,v0,4\n 34:\tsb\ta2,0(a0)\n 38:\tsb\ta2,1(a0)\n 3c:\tsb\ta2,2(a0)\n 40:\tsb\ta2,3(a0)\n 44:\tbne\tv0,a1,30 \n 48:\taddiu\ta0,a0,4\n 4c:\tjr\tra\n 50:\tnop\n\t...\n","proto":{"mem_clear":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000054 mem_clear\n\n\nContents of section .text:\n 0000 afa60008 30c600ff 10a00010 00001025 ....0..........%\n 0010 30a70003 10e00006 00e01825 24420001 0..........%$B..\n 0020 a0860000 1462fffd 24840001 10450007 .....b..$....E..\n 0030 24420004 a0860000 a0860001 a0860002 $B..............\n 0040 a0860003 1445fffa 24840004 03e00008 .....E..$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000015 00000004 000001c8 p...............\n 0010 00000005 0000030c 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 0000000c 000002a8 00000001 000002b4 ................\n 0050 00000000 00000000 00000001 000002fc ................\n 0060 01280711 00000000 00000001 00000000 .(..............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000054 20200001 00000001 ...*...T ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363563 30383663 32383062 37393133 -65c086c280b7913\n 0130 312f752e 69006d65 6d5f636c 65617200 1/u.i.mem_clear.\n 0140 6d656d5f 636c6561 72000000 00000000 mem_clear.......\n 0150 00000001 00000000 00000034 00000000 ...........4....\n 0160 00000004 00000000 00000015 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000004 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'mem_clear' — lift: cannot lift 'mem_clear': branch to 0x30 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta2,8(sp) */\n/* 4:\tandi\ta2,a2,0xff */\n/* 8:\tbeqz\ta1,4c */\n/* c:\tmove\tv0,zero */\n/* 10:\tandi\ta3,a1,0x3 */\n/* 14:\tbeqz\ta3,30 */\n/* 18:\tmove\tv1,a3 */\n/* 1c:\taddiu\tv0,v0,1 */\n/* 20:\tsb\ta2,0(a0) */\n/* 24:\tbne\tv1,v0,1c */\n/* 28:\taddiu\ta0,a0,1 */\n/* 2c:\tbeq\tv0,a1,4c */\n/* 30:\taddiu\tv0,v0,4 */\n/* 34:\tsb\ta2,0(a0) */\n/* 38:\tsb\ta2,1(a0) */\n/* 3c:\tsb\ta2,2(a0) */\n/* 40:\tsb\ta2,3(a0) */\n/* 44:\tbne\tv0,a1,30 */\n/* 48:\taddiu\ta0,a0,4 */\n/* 4c:\tjr\tra */\n/* 50:\tnop */\n/* \t... */\nvoid mem_clear(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'mem_clear': branch to 0x30 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":30,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'mem_clear': branch to 0x30 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 mem_clear(s8 *arg0, s32 arg1, s32 arg2) {\n s32 temp_a3;\n s32 var_v0;\n s8 *var_a0;\n s8 temp_a2;\n\n var_a0 = arg0;\n temp_a2 = arg2 & 0xFF;\n var_v0 = 0;\n if (arg1 != 0) {\n temp_a3 = arg1 & 3;\n if (temp_a3 != 0) {\n do {\n var_v0 += 1;\n *var_a0 = temp_a2;\n var_a0 += 1;\n } while (temp_a3 != var_v0);\n if (var_v0 != arg1) {\n goto loop_6;\n }\n return var_v0 + 4;\n }\n do {\nloop_6:\n var_v0 += 4;\n var_a0->unk0 = temp_a2;\n var_a0->unk1 = temp_a2;\n var_a0->unk2 = temp_a2;\n var_a0->unk3 = temp_a2;\n var_a0 += 4;\n } while (var_v0 != arg1);\n /* Duplicate return node #7. Try simplifying control flow for better match */\n return var_v0;\n }\n return var_v0;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":88,"lines":35,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 2: Syntax Error","cfe: Error: /c.i, line 3: Empty declaration specifiers","cfe: Error: /c.i, line 4: Syntax Error","cfe: Error: /c.i, line 4: Empty declaration specifiers","cfe: Error: /c.i, line 5: Syntax Error"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mem_clear` — benchmark function af:mem_clear:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_clear\n sw\t$a2, 8($sp)\n andi\t$a2, $a2, 0xff\n beqz\t$a1, .L4c\n move\t$v0, $zero\n andi\t$a3, $a1, 0x3\n beqz\t$a3, .L30\n move\t$v1, $a3\n.L1c:\n addiu\t$v0, $v0, 1\n sb\t$a2, 0($a0)\n bne\t$v1, $v0, .L1c\n addiu\t$a0, $a0, 1\n beq\t$v0, $a1, .L4c\n.L30:\n addiu\t$v0, $v0, 4\n sb\t$a2, 0($a0)\n sb\t$a2, 1($a0)\n sb\t$a2, 2($a0)\n sb\t$a2, 3($a0)\n bne\t$v0, $a1, .L30\n addiu\t$a0, $a0, 4\n.L4c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_clear # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mem_clear` — benchmark function af:mem_clear:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_clear:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tandi\ta2,a2,0xff\n 8:\tbeqz\ta1,4c \n c:\tmove\tv0,zero\n 10:\tandi\ta3,a1,0x3\n 14:\tbeqz\ta3,30 \n 18:\tmove\tv1,a3\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\ta2,0(a0)\n 24:\tbne\tv1,v0,1c \n 28:\taddiu\ta0,a0,1\n 2c:\tbeq\tv0,a1,4c \n 30:\taddiu\tv0,v0,4\n 34:\tsb\ta2,0(a0)\n 38:\tsb\ta2,1(a0)\n 3c:\tsb\ta2,2(a0)\n 40:\tsb\ta2,3(a0)\n 44:\tbne\tv0,a1,30 \n 48:\taddiu\ta0,a0,4\n 4c:\tjr\tra\n 50:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000054 mem_clear\n\n\nContents of section .text:\n 0000 afa60008 30c600ff 10a00010 00001025 ....0..........%\n 0010 30a70003 10e00006 00e01825 24420001 0..........%$B..\n 0020 a0860000 1462fffd 24840001 10450007 .....b..$....E..\n 0030 24420004 a0860000 a0860001 a0860002 $B..............\n 0040 a0860003 1445fffa 24840004 03e00008 .....E..$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000015 00000004 000001c8 p...............\n 0010 00000005 0000030c 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 0000000c 000002a8 00000001 000002b4 ................\n 0050 00000000 00000000 00000001 000002fc ................\n 0060 01280711 00000000 00000001 00000000 .(..............\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000005 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00b0 0000002a 00000054 20200001 00000001 ...*...T ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0120 2d363563 30383663 32383062 37393133 -65c086c280b7913\n 0130 312f752e 69006d65 6d5f636c 65617200 1/u.i.mem_clear.\n 0140 6d656d5f 636c6561 72000000 00000000 mem_clear.......\n 0150 00000001 00000000 00000034 00000000 ...........4....\n 0160 00000004 00000000 00000015 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000004 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"mem_clear\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_clear # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mem_cmp:ido7.1","sym":"mem_cmp","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","pointer","branch"],"loc":11,"refSource":"s32 mem_cmp(u8* ptr1, u8* ptr2, size_t len) {\n while (len != 0) {\n if (*ptr1 != *ptr2) {\n return 0;\n }\n ptr1++;\n ptr2++;\n len--;\n }\n return 1;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L31-L41","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,c8 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,44 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a0)\n 18:\tlbu\tt7,0(a1)\n 1c:\taddiu\ta0,a0,1\n 20:\taddiu\ta2,a2,-1\n 24:\tbeq\tt6,t7,34 \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,zero\n 34:\tbne\tv0,a2,14 \n 38:\taddiu\ta1,a1,1\n 3c:\tbeqzl\ta2,cc \n 40:\tli\tv0,1\n 44:\tlbu\tt8,0(a0)\n 48:\tlbu\tt9,0(a1)\n 4c:\taddiu\ta2,a2,-4\n 50:\tbeql\tt8,t9,64 \n 54:\tlbu\tt0,1(a0)\n 58:\tjr\tra\n 5c:\tmove\tv0,zero\n 60:\tlbu\tt0,1(a0)\n 64:\tlbu\tt1,1(a1)\n 68:\taddiu\ta0,a0,1\n 6c:\taddiu\ta1,a1,1\n 70:\tbeql\tt0,t1,84 \n 74:\tlbu\tt2,1(a0)\n 78:\tjr\tra\n 7c:\tmove\tv0,zero\n 80:\tlbu\tt2,1(a0)\n 84:\tlbu\tt3,1(a1)\n 88:\taddiu\ta0,a0,1\n 8c:\taddiu\ta1,a1,1\n 90:\tbeql\tt2,t3,a4 \n 94:\tlbu\tt4,1(a0)\n 98:\tjr\tra\n 9c:\tmove\tv0,zero\n a0:\tlbu\tt4,1(a0)\n a4:\tlbu\tt5,1(a1)\n a8:\taddiu\ta0,a0,1\n ac:\taddiu\ta0,a0,1\n b0:\tbeq\tt4,t5,c0 \n b4:\taddiu\ta1,a1,1\n b8:\tjr\tra\n bc:\tmove\tv0,zero\n c0:\tbnez\ta2,44 \n c4:\taddiu\ta1,a1,1\n c8:\tli\tv0,1\n cc:\tjr\tra\n d0:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000e0 .text\n00000000 g F .text\t000000d4 mem_cmp\n\n\nContents of section .text:\n 0000 10c00031 30c30003 00031823 1060000d ...10......#.`..\n 0010 00661021 908e0000 90af0000 24840001 .f.!........$...\n 0020 24c6ffff 11cf0003 00000000 03e00008 $...............\n 0030 00001025 1446fff7 24a50001 50c00023 ...%.F..$...P..#\n 0040 24020001 90980000 90b90000 24c6fffc $...........$...\n 0050 53190004 90880001 03e00008 00001025 S..............%\n 0060 90880001 90a90001 24840001 24a50001 ........$...$...\n 0070 51090004 908a0001 03e00008 00001025 Q..............%\n 0080 908a0001 90ab0001 24840001 24a50001 ........$...$...\n 0090 514b0004 908c0001 03e00008 00001025 QK.............%\n 00a0 908c0001 90ad0001 24840001 24840001 ........$...$...\n 00b0 118d0003 24a50001 03e00008 00001025 ....$..........%\n 00c0 14c0ffe0 24a50001 24020001 03e00008 ....$...$.......\n 00d0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300ff7c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300ff7c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000035 00000010 00000248 p......5.......H\n 0010 00000005 00000394 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 00000008 00000334 00000001 0000033c .......4.......<\n 0050 00000000 00000000 00000001 00000384 ................\n 0060 180711f0 1111e140 10b80803 82000800 .......@........\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000003 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000d4 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d343330 nch-real-ido-430\n 0130 33663032 61306666 39666434 302f752e 3f02a0ff9fd40/u.\n 0140 69006d65 6d5f636d 70000000 6d656d5f i.mem_cmp...mem_\n 0150 636d7000 00000000 00000001 00000000 cmp.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000035 00000000 00000000 00000001 ...5............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000f 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'mem_cmp' — lift: cannot lift 'mem_cmp': unmodelled control transfer 'beqzl' at 0x3c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tbeqz\ta2,c8 */\n/* 4:\tandi\tv1,a2,0x3 */\n/* 8:\tnegu\tv1,v1 */\n/* c:\tbeqz\tv1,44 */\n/* 10:\taddu\tv0,v1,a2 */\n/* 14:\tlbu\tt6,0(a0) */\n/* 18:\tlbu\tt7,0(a1) */\n/* 1c:\taddiu\ta0,a0,1 */\n/* 20:\taddiu\ta2,a2,-1 */\n/* 24:\tbeq\tt6,t7,34 */\n/* 28:\tnop */\n/* 2c:\tjr\tra */\n/* 30:\tmove\tv0,zero */\n/* 34:\tbne\tv0,a2,14 */\n/* 38:\taddiu\ta1,a1,1 */\n/* 3c:\tbeqzl\ta2,cc */\n/* 40:\tli\tv0,1 */\n/* 44:\tlbu\tt8,0(a0) */\n/* 48:\tlbu\tt9,0(a1) */\n/* 4c:\taddiu\ta2,a2,-4 */\n/* 50:\tbeql\tt8,t9,64 */\n/* 54:\tlbu\tt0,1(a0) */\n/* 58:\tjr\tra */\n/* 5c:\tmove\tv0,zero */\n/* 60:\tlbu\tt0,1(a0) */\n/* 64:\tlbu\tt1,1(a1) */\n/* 68:\taddiu\ta0,a0,1 */\n/* 6c:\taddiu\ta1,a1,1 */\n/* 70:\tbeql\tt0,t1,84 */\n/* 74:\tlbu\tt2,1(a0) */\n/* 78:\tjr\tra */\n/* 7c:\tmove\tv0,zero */\n/* 80:\tlbu\tt2,1(a0) */\n/* 84:\tlbu\tt3,1(a1) */\n/* 88:\taddiu\ta0,a0,1 */\n/* 8c:\taddiu\ta1,a1,1 */\n/* 90:\tbeql\tt2,t3,a4 */\n/* 94:\tlbu\tt4,1(a0) */\n/* 98:\tjr\tra */\n/* 9c:\tmove\tv0,zero */\n/* a0:\tlbu\tt4,1(a0) */\n/* a4:\tlbu\tt5,1(a1) */\n/* a8:\taddiu\ta0,a0,1 */\n/* ac:\taddiu\ta0,a0,1 */\n/* b0:\tbeq\tt4,t5,c0 */\n/* b4:\taddiu\ta1,a1,1 */\n/* b8:\tjr\tra */\n/* bc:\tmove\tv0,zero */\n/* c0:\tbnez\ta2,44 */\n/* c4:\taddiu\ta1,a1,1 */\n/* c8:\tli\tv0,1 */\n/* cc:\tjr\tra */\n/* d0:\tnop */\n/* \t... */\nvoid mem_cmp(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'mem_cmp': unmodelled control transfer 'beqzl' at 0x3c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":62,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'mem_cmp': unmodelled control transfer 'beqzl' at 0x3c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 mem_cmp(u8 *arg0, u8 *arg1, s32 arg2) {\n s32 temp_v0;\n s32 temp_v1;\n s32 var_a2;\n u8 *var_a0;\n u8 *var_a1;\n u8 temp_t6;\n void *temp_a0;\n void *temp_a0_2;\n void *temp_a1;\n void *temp_a1_2;\n\n var_a0 = arg0;\n var_a1 = arg1;\n var_a2 = arg2;\n if (var_a2 != 0) {\n temp_v1 = -(var_a2 & 3);\n temp_v0 = temp_v1 + var_a2;\n if (temp_v1 != 0) {\nloop_2:\n temp_t6 = *var_a0;\n var_a0 += 1;\n var_a2 -= 1;\n if (temp_t6 != *var_a1) {\n return 0;\n }\n var_a1 += 1;\n if (temp_v0 == var_a2) {\n if (var_a2 != 0) {\n goto loop_6;\n }\n /* Duplicate return node #15. Try simplifying control flow for better match */\n return 1;\n }\n goto loop_2;\n }\nloop_6:\n var_a2 -= 4;\n if (var_a0->unk0 != var_a1->unk0) {\n return 0;\n }\n temp_a0 = var_a0 + 1;\n temp_a1 = var_a1 + 1;\n if (var_a0->unk1 != var_a1->unk1) {\n return 0;\n }\n temp_a0_2 = temp_a0 + 1;\n temp_a1_2 = temp_a1 + 1;\n if (temp_a0->unk1 != temp_a1->unk1) {\n return 0;\n }\n var_a0 = temp_a0_2 + 1 + 1;\n if (temp_a0_2->unk1 != temp_a1_2->unk1) {\n return 0;\n }\n var_a1 = temp_a1_2 + 1 + 1;\n if (var_a2 == 0) {\n /* Duplicate return node #15. Try simplifying control flow for better match */\n return 1;\n }\n goto loop_6;\n }\n return 1;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":68,"lines":63,"gotos":3,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 39: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 44: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 47: Unacceptable operand of '+'.","cfe: Error: /c.i, line 48: Unacceptable operand of '+'.","cfe: Error: /c.i, line 49: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mem_cmp` — benchmark function af:mem_cmp:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_cmp\n beqz\t$a2, .Lc8\n andi\t$v1, $a2, 0x3\n negu\t$v1, $v1\n beqz\t$v1, .L44\n addu\t$v0, $v1, $a2\n.L14:\n lbu\t$t6, 0($a0)\n lbu\t$t7, 0($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a2, $a2, -1\n beq\t$t6, $t7, .L34\n nop\n jr\t$ra\n move\t$v0, $zero\n.L34:\n bne\t$v0, $a2, .L14\n addiu\t$a1, $a1, 1\n beqzl\t$a2, .Lcc\n li\t$v0, 1\n.L44:\n lbu\t$t8, 0($a0)\n lbu\t$t9, 0($a1)\n addiu\t$a2, $a2, -4\n beql\t$t8, $t9, .L64\n lbu\t$t0, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t0, 1($a0)\n.L64:\n lbu\t$t1, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a1, $a1, 1\n beql\t$t0, $t1, .L84\n lbu\t$t2, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t2, 1($a0)\n.L84:\n lbu\t$t3, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a1, $a1, 1\n beql\t$t2, $t3, .La4\n lbu\t$t4, 1($a0)\n jr\t$ra\n move\t$v0, $zero\n lbu\t$t4, 1($a0)\n.La4:\n lbu\t$t5, 1($a1)\n addiu\t$a0, $a0, 1\n addiu\t$a0, $a0, 1\n beq\t$t4, $t5, .Lc0\n addiu\t$a1, $a1, 1\n jr\t$ra\n move\t$v0, $zero\n.Lc0:\n bnez\t$a2, .L44\n addiu\t$a1, $a1, 1\n.Lc8:\n li\t$v0, 1\n.Lcc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_cmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mem_cmp` — benchmark function af:mem_cmp:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_cmp:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,c8 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,44 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a0)\n 18:\tlbu\tt7,0(a1)\n 1c:\taddiu\ta0,a0,1\n 20:\taddiu\ta2,a2,-1\n 24:\tbeq\tt6,t7,34 \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,zero\n 34:\tbne\tv0,a2,14 \n 38:\taddiu\ta1,a1,1\n 3c:\tbeqzl\ta2,cc \n 40:\tli\tv0,1\n 44:\tlbu\tt8,0(a0)\n 48:\tlbu\tt9,0(a1)\n 4c:\taddiu\ta2,a2,-4\n 50:\tbeql\tt8,t9,64 \n 54:\tlbu\tt0,1(a0)\n 58:\tjr\tra\n 5c:\tmove\tv0,zero\n 60:\tlbu\tt0,1(a0)\n 64:\tlbu\tt1,1(a1)\n 68:\taddiu\ta0,a0,1\n 6c:\taddiu\ta1,a1,1\n 70:\tbeql\tt0,t1,84 \n 74:\tlbu\tt2,1(a0)\n 78:\tjr\tra\n 7c:\tmove\tv0,zero\n 80:\tlbu\tt2,1(a0)\n 84:\tlbu\tt3,1(a1)\n 88:\taddiu\ta0,a0,1\n 8c:\taddiu\ta1,a1,1\n 90:\tbeql\tt2,t3,a4 \n 94:\tlbu\tt4,1(a0)\n 98:\tjr\tra\n 9c:\tmove\tv0,zero\n a0:\tlbu\tt4,1(a0)\n a4:\tlbu\tt5,1(a1)\n a8:\taddiu\ta0,a0,1\n ac:\taddiu\ta0,a0,1\n b0:\tbeq\tt4,t5,c0 \n b4:\taddiu\ta1,a1,1\n b8:\tjr\tra\n bc:\tmove\tv0,zero\n c0:\tbnez\ta2,44 \n c4:\taddiu\ta1,a1,1\n c8:\tli\tv0,1\n cc:\tjr\tra\n d0:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000e0 .text\n00000000 g F .text\t000000d4 mem_cmp\n\n\nContents of section .text:\n 0000 10c00031 30c30003 00031823 1060000d ...10......#.`..\n 0010 00661021 908e0000 90af0000 24840001 .f.!........$...\n 0020 24c6ffff 11cf0003 00000000 03e00008 $...............\n 0030 00001025 1446fff7 24a50001 50c00023 ...%.F..$...P..#\n 0040 24020001 90980000 90b90000 24c6fffc $...........$...\n 0050 53190004 90880001 03e00008 00001025 S..............%\n 0060 90880001 90a90001 24840001 24a50001 ........$...$...\n 0070 51090004 908a0001 03e00008 00001025 Q..............%\n 0080 908a0001 90ab0001 24840001 24a50001 ........$...$...\n 0090 514b0004 908c0001 03e00008 00001025 QK.............%\n 00a0 908c0001 90ad0001 24840001 24840001 ........$...$...\n 00b0 118d0003 24a50001 03e00008 00001025 ....$..........%\n 00c0 14c0ffe0 24a50001 24020001 03e00008 ....$...$.......\n 00d0 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300ff7c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300ff7c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000035 00000010 00000248 p......5.......H\n 0010 00000005 00000394 00000001 00000258 ...............X\n 0020 00000004 0000028c 00000000 00000000 ................\n 0030 00000011 000002bc 00000034 00000300 ...........4....\n 0040 00000008 00000334 00000001 0000033c .......4.......<\n 0050 00000000 00000000 00000001 00000384 ................\n 0060 180711f0 1111e140 10b80803 82000800 .......@........\n 0070 00000000 00000001 00000000 00000000 ................\n 0080 00000000 ffffffff 00000000 00000000 ................\n 0090 00000000 001d001f 00000003 0000000c ................\n 00a0 00000000 00000001 00000000 2c200004 ............, ..\n 00b0 0000002a 00000000 1820000f 0000002a ...*..... .....*\n 00c0 000000d4 20200001 00000001 00000000 .... ..........\n 00d0 20200000 02000000 03000000 04000000 ..............\n 00e0 05000000 06000000 07000000 08000000 ................\n 00f0 09000000 20000000 21000000 0a000000 .... ...!.......\n 0100 0b000000 0b000000 1a000000 00000000 ................\n 0110 00000003 06000000 002f746d 702f6265 ........./tmp/be\n 0120 6e63682d 7265616c 2d69646f 2d343330 nch-real-ido-430\n 0130 33663032 61306666 39666434 302f752e 3f02a0ff9fd40/u.\n 0140 69006d65 6d5f636d 70000000 6d656d5f i.mem_cmp...mem_\n 0150 636d7000 00000000 00000001 00000000 cmp.............\n 0160 00000032 00000000 00000004 00000000 ...2............\n 0170 00000035 00000000 00000000 00000001 ...5............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 0000000f 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_cmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mem_copy:ido7.1","sym":"mem_copy","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","pointer","memory"],"loc":8,"refSource":"void mem_copy(u8* dest, u8* src, size_t len) {\n while (len != 0) {\n *dest = *src;\n src++;\n dest++;\n len--;\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L14-L21","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,64 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,34 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a1)\n 18:\taddiu\ta2,a2,-1\n 1c:\taddiu\ta1,a1,1\n 20:\taddiu\ta0,a0,1\n 24:\tbne\tv0,a2,14 \n 28:\tsb\tt6,-1(a0)\n 2c:\tbeqz\ta2,64 \n 30:\tnop\n 34:\tlbu\tt7,0(a1)\n 38:\taddiu\ta2,a2,-4\n 3c:\taddiu\ta1,a1,4\n 40:\tsb\tt7,0(a0)\n 44:\tlbu\tt8,-3(a1)\n 48:\taddiu\ta0,a0,4\n 4c:\tsb\tt8,-3(a0)\n 50:\tlbu\tt9,-2(a1)\n 54:\tsb\tt9,-2(a0)\n 58:\tlbu\tt0,-1(a1)\n 5c:\tbnez\ta2,34 \n 60:\tsb\tt0,-1(a0)\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\n","proto":{"mem_copy":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t0000006c mem_copy\n\n\nContents of section .text:\n 0000 10c00018 30c30003 00031823 10600009 ....0......#.`..\n 0010 00661021 90ae0000 24c6ffff 24a50001 .f.!....$...$...\n 0020 24840001 1446fffb a08effff 10c0000d $....F..........\n 0030 00000000 90af0000 24c6fffc 24a50004 ........$...$...\n 0040 a08f0000 90b8fffd 24840004 a098fffd ........$.......\n 0050 90b9fffe a099fffe 90a8ffff 14c0fff5 ................\n 0060 a088ffff 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001b 00000008 000001d8 p...............\n 0010 00000005 00000320 00000001 000001e0 ....... ........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000034 00000288 .......D...4....\n 0040 0000000c 000002bc 00000001 000002c8 ................\n 0050 00000000 00000000 00000001 00000310 ................\n 0060 180310f1 10f76100 00000000 00000001 ......a.........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000006c 20200001 . .....*...l ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d323863 66653965 30643932 -ido-28cfe9e0d92\n 0130 39393438 322f752e 69006d65 6d5f636f 99482/u.i.mem_co\n 0140 70790000 6d656d5f 636f7079 00000000 py..mem_copy....\n 0150 00000000 00000001 00000000 00000033 ...............3\n 0160 00000000 00000004 00000000 0000001b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000007 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'mem_copy' — structure: cannot structure 'mem_copy': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tbeqz\ta2,64 */\n/* 4:\tandi\tv1,a2,0x3 */\n/* 8:\tnegu\tv1,v1 */\n/* c:\tbeqz\tv1,34 */\n/* 10:\taddu\tv0,v1,a2 */\n/* 14:\tlbu\tt6,0(a1) */\n/* 18:\taddiu\ta2,a2,-1 */\n/* 1c:\taddiu\ta1,a1,1 */\n/* 20:\taddiu\ta0,a0,1 */\n/* 24:\tbne\tv0,a2,14 */\n/* 28:\tsb\tt6,-1(a0) */\n/* 2c:\tbeqz\ta2,64 */\n/* 30:\tnop */\n/* 34:\tlbu\tt7,0(a1) */\n/* 38:\taddiu\ta2,a2,-4 */\n/* 3c:\taddiu\ta1,a1,4 */\n/* 40:\tsb\tt7,0(a0) */\n/* 44:\tlbu\tt8,-3(a1) */\n/* 48:\taddiu\ta0,a0,4 */\n/* 4c:\tsb\tt8,-3(a0) */\n/* 50:\tlbu\tt9,-2(a1) */\n/* 54:\tsb\tt9,-2(a0) */\n/* 58:\tlbu\tt0,-1(a1) */\n/* 5c:\tbnez\ta2,34 */\n/* 60:\tsb\tt0,-1(a0) */\n/* 64:\tjr\tra */\n/* 68:\tnop */\n/* 6c:\tnop */\nvoid mem_copy(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'mem_copy': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":36,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'mem_copy': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void mem_copy(u8 *arg0, u8 *arg1, s32 arg2) {\n s32 temp_v0;\n s32 temp_v1;\n s32 var_a2;\n u8 *var_a0;\n u8 *var_a1;\n u8 temp_t6;\n u8 temp_t7;\n\n var_a0 = arg0;\n var_a1 = arg1;\n var_a2 = arg2;\n if (var_a2 != 0) {\n temp_v1 = -(var_a2 & 3);\n temp_v0 = temp_v1 + var_a2;\n if (temp_v1 != 0) {\n do {\n temp_t6 = *var_a1;\n var_a2 -= 1;\n var_a1 += 1;\n var_a0 += 1;\n var_a0->unk-1 = temp_t6;\n } while (temp_v0 != var_a2);\n if (var_a2 != 0) {\n goto loop_4;\n }\n } else {\n do {\nloop_4:\n temp_t7 = *var_a1;\n var_a2 -= 4;\n var_a1 += 4;\n *var_a0 = temp_t7;\n var_a0 += 4;\n var_a0->unk-3 = (u8) var_a1->unk-3;\n var_a0->unk-2 = (u8) var_a1->unk-2;\n var_a0->unk-1 = (u8) var_a1->unk-1;\n } while (var_a2 != 0);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":86,"lines":40,"gotos":1,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 2: Syntax Error","cfe: Error: /c.i, line 3: Empty declaration specifiers","cfe: Error: /c.i, line 4: Syntax Error","cfe: Error: /c.i, line 4: Empty declaration specifiers","cfe: Error: /c.i, line 5: Syntax Error"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mem_copy` — benchmark function af:mem_copy:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mem_copy\n beqz\t$a2, .L64\n andi\t$v1, $a2, 0x3\n negu\t$v1, $v1\n beqz\t$v1, .L34\n addu\t$v0, $v1, $a2\n.L14:\n lbu\t$t6, 0($a1)\n addiu\t$a2, $a2, -1\n addiu\t$a1, $a1, 1\n addiu\t$a0, $a0, 1\n bne\t$v0, $a2, .L14\n sb\t$t6, -1($a0)\n beqz\t$a2, .L64\n nop\n.L34:\n lbu\t$t7, 0($a1)\n addiu\t$a2, $a2, -4\n addiu\t$a1, $a1, 4\n sb\t$t7, 0($a0)\n lbu\t$t8, -3($a1)\n addiu\t$a0, $a0, 4\n sb\t$t8, -3($a0)\n lbu\t$t9, -2($a1)\n sb\t$t9, -2($a0)\n lbu\t$t0, -1($a1)\n bnez\t$a2, .L34\n sb\t$t0, -1($a0)\n.L64:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mem_copy # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mem_copy` — benchmark function af:mem_copy:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mem_copy:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta2,64 \n 4:\tandi\tv1,a2,0x3\n 8:\tnegu\tv1,v1\n c:\tbeqz\tv1,34 \n 10:\taddu\tv0,v1,a2\n 14:\tlbu\tt6,0(a1)\n 18:\taddiu\ta2,a2,-1\n 1c:\taddiu\ta1,a1,1\n 20:\taddiu\ta0,a0,1\n 24:\tbne\tv0,a2,14 \n 28:\tsb\tt6,-1(a0)\n 2c:\tbeqz\ta2,64 \n 30:\tnop\n 34:\tlbu\tt7,0(a1)\n 38:\taddiu\ta2,a2,-4\n 3c:\taddiu\ta1,a1,4\n 40:\tsb\tt7,0(a0)\n 44:\tlbu\tt8,-3(a1)\n 48:\taddiu\ta0,a0,4\n 4c:\tsb\tt8,-3(a0)\n 50:\tlbu\tt9,-2(a1)\n 54:\tsb\tt9,-2(a0)\n 58:\tlbu\tt0,-1(a1)\n 5c:\tbnez\ta2,34 \n 60:\tsb\tt0,-1(a0)\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t0000006c mem_copy\n\n\nContents of section .text:\n 0000 10c00018 30c30003 00031823 10600009 ....0......#.`..\n 0010 00661021 90ae0000 24c6ffff 24a50001 .f.!....$...$...\n 0020 24840001 1446fffb a08effff 10c0000d $....F..........\n 0030 00000000 90af0000 24c6fffc 24a50004 ........$...$...\n 0040 a08f0000 90b8fffd 24840004 a098fffd ........$.......\n 0050 90b9fffe a099fffe 90a8ffff 14c0fff5 ................\n 0060 a088ffff 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c17c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c17c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001b 00000008 000001d8 p...............\n 0010 00000005 00000320 00000001 000001e0 ....... ........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000034 00000288 .......D...4....\n 0040 0000000c 000002bc 00000001 000002c8 ................\n 0050 00000000 00000000 00000001 00000310 ................\n 0060 180310f1 10f76100 00000000 00000001 ......a.........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000006c 20200001 . .....*...l ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d323863 66653965 30643932 -ido-28cfe9e0d92\n 0130 39393438 322f752e 69006d65 6d5f636f 99482/u.i.mem_co\n 0140 70790000 6d656d5f 636f7079 00000000 py..mem_copy....\n 0150 00000000 00000001 00000000 00000033 ...............3\n 0160 00000000 00000004 00000000 0000001b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000007 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"mem_copy\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mem_copy # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:mRmTp_ItemNo2FtrSize:ido7.1","sym":"mRmTp_ItemNo2FtrSize","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["array","arithmetic","branch"],"loc":7,"refSource":"s32 mRmTp_ItemNo2FtrSize(u16 name) {\n if (name >= 0x1000 && name < 0x1ECD) {\n UNUSED s32 scoped;\n return mRmTp_ftr_size[(name - 0x1000) >> 2];\n }\n return 0;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_room_type.c#L455-L461","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tandi\ta0,a0,0xffff\n 8:\tslti\tat,a0,4096\n c:\tbnez\tat,34 \n 10:\tmove\tv0,zero\n 14:\tslti\tat,a0,7885\n 18:\tbeqz\tat,34 \n 1c:\taddiu\tt6,a0,-4096\n 20:\tsra\tt7,t6,0x2\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t7\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/af/ctx-2e2cc0cb59b4.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t0000003c mRmTp_ItemNo2FtrSize\n00000000 O *UND*\t00000000 mRmTp_ftr_size\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 mRmTp_ftr_size\n00000030 R_MIPS_LO16 mRmTp_ftr_size\n\n\nContents of section .text:\n 0000 afa40000 3084ffff 28811000 14200009 ....0...(.... ..\n 0010 00001025 28811ecd 10200006 248ef000 ...%(.... ..$...\n 0020 000e7883 3c020000 004f1021 03e00008 ..x.<....O.!....\n 0030 90420000 03e00008 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 a000c016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a000c016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000f 00000008 000001f8 p...............\n 0010 00000006 00000374 00000001 00000200 .......t........\n 0020 00000004 00000234 00000000 00000000 .......4........\n 0030 00000011 00000264 00000040 000002a8 .......d...@....\n 0040 00000024 000002e8 00000001 0000030c ...$............\n 0050 00000000 00000000 00000002 00000354 ...............T\n 0060 011140c1 25210000 00000000 00000001 ..@.%!..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000003c 20200001 . .....*...< ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d386261 63613133 35653337 -ido-8baca135e37\n 0130 66323333 332f752e 69006d52 6d54705f f2333/u.i.mRmTp_\n 0140 4974656d 4e6f3246 74725369 7a650000 ItemNo2FtrSize..\n 0150 6d526d54 705f4974 656d4e6f 32467472 mRmTp_ItemNo2Ftr\n 0160 53697a65 006d526d 54705f66 74725f73 Size.mRmTp_ftr_s\n 0170 697a6500 00000000 00000001 00000000 ize.............\n 0180 0000003f 00000000 00000004 00000000 ...?............\n 0190 0000000f 00000000 00000000 00000001 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 01800000 00000000 00000006 00000000 ................\n 01c0 00000000 00000000 18200001 00000000 ......... ......\n 01d0 00000015 00000000 04cfffff 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 7fffffff 00000000 7fffffff ................\n 0200 00000001 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'mRmTp_ItemNo2FtrSize' — lift: cannot lift 'mRmTp_ItemNo2FtrSize': %hi(mRmTp_ftr_size) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta0,0(sp) */\n/* 4:\tandi\ta0,a0,0xffff */\n/* 8:\tslti\tat,a0,4096 */\n/* c:\tbnez\tat,34 */\n/* 10:\tmove\tv0,zero */\n/* 14:\tslti\tat,a0,7885 */\n/* 18:\tbeqz\tat,34 */\n/* 1c:\taddiu\tt6,a0,-4096 */\n/* 20:\tsra\tt7,t6,0x2 */\n/* 24:\tlui\tv0,0x0 */\n/* 28:\taddu\tv0,v0,t7 */\n/* 2c:\tjr\tra */\n/* 30:\tlbu\tv0,0(v0) */\n/* 34:\tjr\tra */\n/* 38:\tnop */\n/* 3c:\tnop */\nvoid mRmTp_ItemNo2FtrSize(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'mRmTp_ItemNo2FtrSize': %hi(mRmTp_ftr_size) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":24,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'mRmTp_ItemNo2FtrSize': %hi(mRmTp_ftr_size) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 mRmTp_ItemNo2FtrSize(u16 name) {\n s32 temp_a0;\n\n temp_a0 = name & 0xFFFF;\n if ((temp_a0 >= 0x1000) && (temp_a0 < 0x1ECD)) {\n return (s32) mRmTp_ftr_size[(s32) (temp_a0 - 0x1000) >> 2];\n }\n return 0;\n}\n","score":7,"maxScore":16,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":8,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":7,"maxScore":16,"ratio":0.4375,"kinds":{"insert":1,"delete":1,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mRmTp_ItemNo2FtrSize` — benchmark function af:mRmTp_ItemNo2FtrSize:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mRmTp_ItemNo2FtrSize\n sw\t$a0, 0($sp)\n andi\t$a0, $a0, 0xffff\n slti\t$at, $a0, 4096\n bnez\t$at, .L34\n move\t$v0, $zero\n slti\t$at, $a0, 7885\n beqz\t$at, .L34\n addiu\t$t6, $a0, -4096\n sra\t$t7, $t6, 0x2\n lui\t$v0, %hi(mRmTp_ftr_size)\n addu\t$v0, $v0, $t7\n jr\t$ra\n lbu\t$v0, %lo(mRmTp_ftr_size)($v0)\n.L34:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-2e2cc0cb59b4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 mRmTp_ItemNo2FtrSize(u16 name);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mRmTp_ItemNo2FtrSize # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mRmTp_ItemNo2FtrSize` — benchmark function af:mRmTp_ItemNo2FtrSize:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:mRmTp_ItemNo2FtrSize:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tandi\ta0,a0,0xffff\n 8:\tslti\tat,a0,4096\n c:\tbnez\tat,34 \n 10:\tmove\tv0,zero\n 14:\tslti\tat,a0,7885\n 18:\tbeqz\tat,34 \n 1c:\taddiu\tt6,a0,-4096\n 20:\tsra\tt7,t6,0x2\n 24:\tlui\tv0,0x0\n 28:\taddu\tv0,v0,t7\n 2c:\tjr\tra\n 30:\tlbu\tv0,0(v0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t0000003c mRmTp_ItemNo2FtrSize\n00000000 O *UND*\t00000000 mRmTp_ftr_size\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_HI16 mRmTp_ftr_size\n00000030 R_MIPS_LO16 mRmTp_ftr_size\n\n\nContents of section .text:\n 0000 afa40000 3084ffff 28811000 14200009 ....0...(.... ..\n 0010 00001025 28811ecd 10200006 248ef000 ...%(.... ..$...\n 0020 000e7883 3c020000 004f1021 03e00008 ..x.<....O.!....\n 0030 90420000 03e00008 00000000 00000000 .B..............\nContents of section .options:\n 0000 01200000 00000000 a000c016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a000c016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000f 00000008 000001f8 p...............\n 0010 00000006 00000374 00000001 00000200 .......t........\n 0020 00000004 00000234 00000000 00000000 .......4........\n 0030 00000011 00000264 00000040 000002a8 .......d...@....\n 0040 00000024 000002e8 00000001 0000030c ...$............\n 0050 00000000 00000000 00000002 00000354 ...............T\n 0060 011140c1 25210000 00000000 00000001 ..@.%!..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000009 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 0000003c 20200001 . .....*...< ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d386261 63613133 35653337 -ido-8baca135e37\n 0130 66323333 332f752e 69006d52 6d54705f f2333/u.i.mRmTp_\n 0140 4974656d 4e6f3246 74725369 7a650000 ItemNo2FtrSize..\n 0150 6d526d54 705f4974 656d4e6f 32467472 mRmTp_ItemNo2Ftr\n 0160 53697a65 006d526d 54705f66 74725f73 Size.mRmTp_ftr_s\n 0170 697a6500 00000000 00000001 00000000 ize.............\n 0180 0000003f 00000000 00000004 00000000 ...?............\n 0190 0000000f 00000000 00000000 00000001 ................\n 01a0 00000000 00000011 00000000 00000000 ................\n 01b0 01800000 00000000 00000006 00000000 ................\n 01c0 00000000 00000000 18200001 00000000 ......... ......\n 01d0 00000015 00000000 04cfffff 00000000 ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 7fffffff 00000000 7fffffff ................\n 0200 00000001 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mRmTp_ItemNo2FtrSize # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:never_zero:ido7.1","sym":"never_zero","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","branch","macro"],"loc":7,"refSource":"f32 never_zero(f32 val, f32 min) {\n if (val < 0.0f) {\n return CLAMP_MAX(val, -min);\n } else {\n return CLAMP_MIN(val, min);\n }\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L38-L44","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f12,$f14\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f0,$f12\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f12,$f14\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 never_zero\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460e603c 46007007 460c003c E...F.`: */\n/* 0:\tmtc1\tzero,$f4 */\n/* 4:\tnop */\n/* 8:\tc.lt.s\t$f12,$f4 */\n/* c:\tnop */\n/* 10:\tbc1fl\t44 */\n/* 14:\tc.lt.s\t$f12,$f14 */\n/* 18:\tneg.s\t$f0,$f14 */\n/* 1c:\tc.lt.s\t$f0,$f12 */\n/* 20:\tnop */\n/* 24:\tbc1fl\t38 */\n/* 28:\tmov.s\t$f2,$f12 */\n/* 2c:\tjr\tra */\n/* 30:\tnop */\n/* 34:\tmov.s\t$f2,$f12 */\n/* 38:\tjr\tra */\n/* 3c:\tmov.s\t$f0,$f2 */\n/* 40:\tc.lt.s\t$f12,$f14 */\n/* 44:\tnop */\n/* 48:\tbc1fl\t5c */\n/* 4c:\tmov.s\t$f2,$f12 */\n/* 50:\tb\t5c */\n/* 54:\tmov.s\t$f2,$f14 */\n/* 58:\tmov.s\t$f2,$f12 */\n/* 5c:\tmov.s\t$f0,$f2 */\n/* 60:\tjr\tra */\n/* 64:\tnop */\n/* \t... */\nvoid never_zero(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'never_zero': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":35,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'never_zero': unmodelled control transfer 'bc1fl' at 0x10 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"f32 never_zero(f32 arg0, f32 arg1) {\n f32 temp_f0;\n f32 var_f2;\n\n if (arg0 < 0.0f) {\n temp_f0 = -arg1;\n if (temp_f0 < arg0) {\n return temp_f0;\n }\n return arg0;\n }\n if (arg0 < arg1) {\n var_f2 = arg1;\n } else {\n var_f2 = arg0;\n }\n return var_f2;\n}\n","score":8,"maxScore":27,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":8,"maxScore":27,"ratio":0.2962962962962963,"kinds":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `never_zero` — benchmark function af:never_zero:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel never_zero\n mtc1\t$zero, $f4\n nop\n c.lt.s\t$f12, $f4\n nop\n bc1fl\t.L44\n c.lt.s\t$f12, $f14\n neg.s\t$f0, $f14\n c.lt.s\t$f0, $f12\n nop\n bc1fl\t.L38\n mov.s\t$f2, $f12\n jr\t$ra\n nop\n mov.s\t$f2, $f12\n.L38:\n jr\t$ra\n mov.s\t$f0, $f2\n c.lt.s\t$f12, $f14\n.L44:\n nop\n bc1fl\t.L5c\n mov.s\t$f2, $f12\n b\t.L5c\n mov.s\t$f2, $f14\n mov.s\t$f2, $f12\n.L5c:\n mov.s\t$f0, $f2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function never_zero # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `never_zero` — benchmark function af:never_zero:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:never_zero:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\tzero,$f4\n 4:\tnop\n 8:\tc.lt.s\t$f12,$f4\n c:\tnop\n 10:\tbc1fl\t44 \n 14:\tc.lt.s\t$f12,$f14\n 18:\tneg.s\t$f0,$f14\n 1c:\tc.lt.s\t$f0,$f12\n 20:\tnop\n 24:\tbc1fl\t38 \n 28:\tmov.s\t$f2,$f12\n 2c:\tjr\tra\n 30:\tnop\n 34:\tmov.s\t$f2,$f12\n 38:\tjr\tra\n 3c:\tmov.s\t$f0,$f2\n 40:\tc.lt.s\t$f12,$f14\n 44:\tnop\n 48:\tbc1fl\t5c \n 4c:\tmov.s\t$f2,$f12\n 50:\tb\t5c \n 54:\tmov.s\t$f2,$f14\n 58:\tmov.s\t$f2,$f12\n 5c:\tmov.s\t$f0,$f2\n 60:\tjr\tra\n 64:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 g F .text\t00000068 never_zero\n\n\nContents of section .text:\n 0000 44802000 00000000 4604603c 00000000 D. .....F.`<....\n 0010 4502000c 460e603c 46007007 460c003c E...F.`r = src->r;\n dest->g = src->g;\n dest->b = src->b;\n dest->a = src->a;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L582-L587","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tt6,0(a1)\n 4:\tsb\tt6,0(a0)\n 8:\tlbu\tt7,1(a1)\n c:\tsb\tt7,1(a0)\n 10:\tlbu\tt8,2(a1)\n 14:\tsb\tt8,2(a0)\n 18:\tlbu\tt9,3(a1)\n 1c:\tjr\tra\n 20:\tsb\tt9,3(a0)\n\t...\n","proto":{"rgba_t_move":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 rgba_t_move\n\n\nContents of section .text:\n 0000 90ae0000 a08e0000 90af0001 a08f0001 ................\n 0010 90b80002 a0980002 90b90003 03e00008 ................\n 0020 a0990003 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000008 000001a8 p...............\n 0010 00000005 000002f4 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000038 00000258 ...........8...X\n 0040 0000000c 00000290 00000001 0000029c ................\n 0050 00000000 00000000 00000001 000002e4 ................\n 0060 11111110 10f00000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000024 20200001 . .....*...$ ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d633834 30663132 30663065 -ido-c840f120f0e\n 0130 37363932 372f752e 69007267 62615f74 76927/u.i.rgba_t\n 0140 5f6d6f76 65000000 72676261 5f745f6d _move...rgba_t_m\n 0150 6f766500 00000000 00000001 00000000 ove.............\n 0160 00000036 00000000 00000004 00000000 ...6............\n 0170 00000009 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000006 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void rgba_t_move(u8 * a0, u8 * a1) {\n *a0 = *a1;\n a0[1] = a1[1];\n a0[2] = a1[2];\n a0[3] = a1[3];\n return;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void rgba_t_move(void *arg0, void *arg1) {\n arg0->unk0 = (u8) arg1->unk0;\n arg0->unk1 = (u8) arg1->unk1;\n arg0->unk2 = (u8) arg1->unk2;\n arg0->unk3 = (u8) arg1->unk3;\n}\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":96,"lines":6,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 3: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 4: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 5: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 6: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rgba_t_move` — benchmark function af:rgba_t_move:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rgba_t_move\n lbu\t$t6, 0($a1)\n sb\t$t6, 0($a0)\n lbu\t$t7, 1($a1)\n sb\t$t7, 1($a0)\n lbu\t$t8, 2($a1)\n sb\t$t8, 2($a0)\n lbu\t$t9, 3($a1)\n jr\t$ra\n sb\t$t9, 3($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rgba_t_move # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rgba_t_move` — benchmark function af:rgba_t_move:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:rgba_t_move:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tt6,0(a1)\n 4:\tsb\tt6,0(a0)\n 8:\tlbu\tt7,1(a1)\n c:\tsb\tt7,1(a0)\n 10:\tlbu\tt8,2(a1)\n 14:\tsb\tt8,2(a0)\n 18:\tlbu\tt9,3(a1)\n 1c:\tjr\tra\n 20:\tsb\tt9,3(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 rgba_t_move\n\n\nContents of section .text:\n 0000 90ae0000 a08e0000 90af0001 a08f0001 ................\n 0010 90b80002 a0980002 90b90003 03e00008 ................\n 0020 a0990003 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000008 000001a8 p...............\n 0010 00000005 000002f4 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000038 00000258 ...........8...X\n 0040 0000000c 00000290 00000001 0000029c ................\n 0050 00000000 00000000 00000001 000002e4 ................\n 0060 11111110 10f00000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000024 20200001 . .....*...$ ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d633834 30663132 30663065 -ido-c840f120f0e\n 0130 37363932 372f752e 69007267 62615f74 76927/u.i.rgba_t\n 0140 5f6d6f76 65000000 72676261 5f745f6d _move...rgba_t_m\n 0150 6f766500 00000000 00000001 00000000 ove.............\n 0160 00000036 00000000 00000004 00000000 ...6............\n 0170 00000009 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000006 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"rgba_t_move\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name rgba_t_move # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:search_position_angleY:ido7.1","sym":"search_position_angleY","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","float","call"],"loc":6,"refSource":"s16 search_position_angleY(xyz_t* subtrahend, xyz_t* minuend) {\n f32 diffX = minuend->x - subtrahend->x;\n f32 diffZ = minuend->z - subtrahend->z;\n\n return atans_table(diffZ, diffX);\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L287-L292","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tlwc1\t$f6,0(a0)\n c:\tlwc1\t$f4,0(a1)\n 10:\tlwc1\t$f10,8(a0)\n 14:\tlwc1\t$f8,8(a1)\n 18:\tsub.s\t$f14,$f4,$f6\n 1c:\tjal\t0 \n 20:\tsub.s\t$f12,$f8,$f10\n 24:\tlw\tra,20(sp)\n 28:\taddiu\tsp,sp,24\n 2c:\tjr\tra\n 30:\tnop\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/af/ctx-d8e5c4388b36.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 search_position_angleY\n00000000 F *UND*\t00000000 atans_table\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 atans_table\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 c4860000 c4a40000 '...............\n 0010 c48a0008 c4a80008 46062381 0c000000 ........F.#.....\n 0020 460a4301 8fbf0014 27bd0018 03e00008 F.C.....'.......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000030 00000000 . .........0....\n 0010 0000f550 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000030 00000000 0000f550 00000000 ...0.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001f0 p...............\n 0010 00000006 00000370 00000001 000001f8 .......p........\n 0020 00000004 0000022c 00000000 00000000 .......,........\n 0030 00000011 0000025c 00000044 000002a0 .......\\...D....\n 0040 00000024 000002e4 00000001 00000308 ...$............\n 0050 00000000 00000000 00000002 00000350 ...............P\n 0060 011111f0 20f01300 00000000 00000001 .... ...........\n 0070 00000000 80000000 fffffffc ffffffff ................\n 0080 00000000 00000000 00000018 001d001f ................\n 0090 00000004 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d623762 34646365 32343233 -ido-b7b4dce2423\n 0130 38363332 352f752e 69007365 61726368 86325/u.i.search\n 0140 5f706f73 6974696f 6e5f616e 676c6559 _position_angleY\n 0150 00000000 73656172 63685f70 6f736974 ....search_posit\n 0160 696f6e5f 616e676c 65590061 74616e73 ion_angleY.atans\n 0170 5f746162 6c650000 00000000 00000001 _table..........\n 0180 00000000 00000041 00000000 00000004 .......A........\n 0190 00000000 0000000d 00000000 00000000 ................\n 01a0 00000001 00000000 00000011 00000000 ................\n 01b0 00000000 01800000 00000000 00000007 ................\n 01c0 00000000 00000000 00000000 18200001 ............. ..\n 01d0 00000000 00000017 00000000 18cfffff ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 7fffffff 00000000 ................\n 0200 7fffffff 00000001 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'search_position_angleY' — lift: cannot lift 'search_position_angleY': function call 'jal' at 0x1c — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,20(sp) */\n/* 8:\tlwc1\t$f6,0(a0) */\n/* c:\tlwc1\t$f4,0(a1) */\n/* 10:\tlwc1\t$f10,8(a0) */\n/* 14:\tlwc1\t$f8,8(a1) */\n/* 18:\tsub.s\t$f14,$f4,$f6 */\n/* 1c:\tjal\t0 */\n/* 20:\tsub.s\t$f12,$f8,$f10 */\n/* 24:\tlw\tra,20(sp) */\n/* 28:\taddiu\tsp,sp,24 */\n/* 2c:\tjr\tra */\n/* 30:\tnop */\n/* \t... */\nvoid search_position_angleY(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'search_position_angleY': function call 'jal' at 0x1c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'search_position_angleY': function call 'jal' at 0x1c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 search_position_angleY(xyz_t *subtrahend, xyz_t *minuend) {\n return atans_table(minuend->z - subtrahend->z, minuend->x - subtrahend->x);\n}\n","score":6,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":13,"ratio":0.46153846153846156,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `search_position_angleY` — benchmark function af:search_position_angleY:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel search_position_angleY\n addiu\t$sp, $sp, -24\n sw\t$ra, 20($sp)\n lwc1\t$f6, 0($a0)\n lwc1\t$f4, 0($a1)\n lwc1\t$f10, 8($a0)\n lwc1\t$f8, 8($a1)\n sub.s\t$f14, $f4, $f6\n jal\tatans_table\n sub.s\t$f12, $f8, $f10\n lw\t$ra, 20($sp)\n addiu\t$sp, $sp, 24\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/af/ctx-d8e5c4388b36.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns16 search_position_angleY(xyz_t* subtrahend, xyz_t* minuend);\nCTX_PROTO\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function search_position_angleY # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `search_position_angleY` — benchmark function af:search_position_angleY:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:search_position_angleY:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tlwc1\t$f6,0(a0)\n c:\tlwc1\t$f4,0(a1)\n 10:\tlwc1\t$f10,8(a0)\n 14:\tlwc1\t$f8,8(a1)\n 18:\tsub.s\t$f14,$f4,$f6\n 1c:\tjal\t0 \n 20:\tsub.s\t$f12,$f8,$f10\n 24:\tlw\tra,20(sp)\n 28:\taddiu\tsp,sp,24\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 search_position_angleY\n00000000 F *UND*\t00000000 atans_table\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 atans_table\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 c4860000 c4a40000 '...............\n 0010 c48a0008 c4a80008 46062381 0c000000 ........F.#.....\n 0020 460a4301 8fbf0014 27bd0018 03e00008 F.C.....'.......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000030 00000000 . .........0....\n 0010 0000f550 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000030 00000000 0000f550 00000000 ...0.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001f0 p...............\n 0010 00000006 00000370 00000001 000001f8 .......p........\n 0020 00000004 0000022c 00000000 00000000 .......,........\n 0030 00000011 0000025c 00000044 000002a0 .......\\...D....\n 0040 00000024 000002e4 00000001 00000308 ...$............\n 0050 00000000 00000000 00000002 00000350 ...............P\n 0060 011111f0 20f01300 00000000 00000001 .... ...........\n 0070 00000000 80000000 fffffffc ffffffff ................\n 0080 00000000 00000000 00000018 001d001f ................\n 0090 00000004 00000007 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d623762 34646365 32343233 -ido-b7b4dce2423\n 0130 38363332 352f752e 69007365 61726368 86325/u.i.search\n 0140 5f706f73 6974696f 6e5f616e 676c6559 _position_angleY\n 0150 00000000 73656172 63685f70 6f736974 ....search_posit\n 0160 696f6e5f 616e676c 65590061 74616e73 ion_angleY.atans\n 0170 5f746162 6c650000 00000000 00000001 _table..........\n 0180 00000000 00000041 00000000 00000004 .......A........\n 0190 00000000 0000000d 00000000 00000000 ................\n 01a0 00000001 00000000 00000011 00000000 ................\n 01b0 00000000 01800000 00000000 00000007 ................\n 01c0 00000000 00000000 00000000 18200001 ............. ..\n 01d0 00000000 00000017 00000000 18cfffff ................\n 01e0 00000000 00000000 00000000 00000000 ................\n 01f0 00000000 00000000 7fffffff 00000000 ................\n 0200 7fffffff 00000001 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name search_position_angleY # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:spolar2world:ido7.1","sym":"spolar2world","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","float","call"],"loc":16,"refSource":"xyz_t spolar2world(VecSph* sph) {\n xyz_t v;\n f32 sinPitch;\n f32 cosPitch = cos_s(sph->pitch);\n f32 sinYaw;\n f32 cosYaw = cos_s(sph->yaw);\n\n sinPitch = sin_s(sph->pitch);\n sinYaw = sin_s(sph->yaw);\n\n v.x = sph->r * sinPitch * sinYaw;\n v.y = sph->r * cosPitch;\n v.z = sph->r * sinPitch * cosYaw;\n\n return v;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_olib.c#L82-L97","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\tra,28(sp)\n 8:\tsw\ts0,24(sp)\n c:\tsw\ta0,64(sp)\n 10:\tmove\ts0,a1\n 14:\tjal\t0 \n 18:\tlh\ta0,4(a1)\n 1c:\tswc1\t$f0,44(sp)\n 20:\tjal\t0 \n 24:\tlh\ta0,6(s0)\n 28:\tswc1\t$f0,36(sp)\n 2c:\tjal\t0 \n 30:\tlh\ta0,4(s0)\n 34:\tlh\ta0,6(s0)\n 38:\tjal\t0 \n 3c:\tswc1\t$f0,48(sp)\n 40:\tlwc1\t$f2,48(sp)\n 44:\tlwc1\t$f4,0(s0)\n 48:\tlwc1\t$f16,44(sp)\n 4c:\taddiu\tt6,sp,52\n 50:\tmul.s\t$f6,$f4,$f2\n 54:\tlw\tv0,64(sp)\n 58:\tmul.s\t$f8,$f6,$f0\n 5c:\tswc1\t$f8,52(sp)\n 60:\tlwc1\t$f10,0(s0)\n 64:\tlwc1\t$f8,36(sp)\n 68:\tmul.s\t$f18,$f10,$f16\n 6c:\tswc1\t$f18,56(sp)\n 70:\tlwc1\t$f4,0(s0)\n 74:\tmul.s\t$f6,$f4,$f2\n 78:\tmul.s\t$f10,$f6,$f8\n 7c:\tswc1\t$f10,60(sp)\n 80:\tlw\tt8,0(t6)\n 84:\tsw\tt8,0(v0)\n 88:\tlw\tt7,4(t6)\n 8c:\tsw\tt7,4(v0)\n 90:\tlw\tt8,8(t6)\n 94:\tsw\tt8,8(v0)\n 98:\tlw\tra,28(sp)\n 9c:\tlw\ts0,24(sp)\n a0:\taddiu\tsp,sp,64\n a4:\tjr\tra\n a8:\tnop\n ac:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000ac spolar2world\n00000000 F *UND*\t00000000 cos_s\n00000000 F *UND*\t00000000 sin_s\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 cos_s\n00000020 R_MIPS_26 cos_s\n0000002c R_MIPS_26 sin_s\n00000038 R_MIPS_26 sin_s\n\n\nContents of section .text:\n 0000 27bdffc0 afbf001c afb00018 afa40040 '..............@\n 0010 00a08025 0c000000 84a40004 e7a0002c ...%...........,\n 0020 0c000000 86040006 e7a00024 0c000000 ...........$....\n 0030 86040004 86040006 0c000000 e7a00030 ...............0\n 0040 c7a20030 c6040000 c7b0002c 27ae0034 ...0.......,'..4\n 0050 46022182 8fa20040 46003202 e7a80034 F.!....@F.2....4\n 0060 c60a0000 c7a80024 46105482 e7b20038 .......$F.T....8\n 0070 c6040000 46022182 46083282 e7aa003c ....F.!.F.2....<\n 0080 8dd80000 ac580000 8dcf0004 ac4f0004 .....X.......O..\n 0090 8dd80008 ac580008 8fbf001c 8fb00018 .....X..........\n 00a0 27bd0040 03e00008 00000000 00000000 '..@............\nContents of section .options:\n 0000 01200000 00000000 a101c034 00000000 . .........4....\n 0010 000d0fd5 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a101c034 00000000 000d0fd5 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002b 00000014 00000278 p......+.......x\n 0010 00000007 00000400 00000001 0000028c ................\n 0020 00000004 000002c0 00000000 00000000 ................\n 0030 00000011 000002f0 00000038 00000334 ...........8...4\n 0040 0000001c 0000036c 00000001 00000388 .......l........\n 0050 00000000 00000000 00000003 000003d0 ................\n 0060 04322211 13101020 d0f01110 10f11318 .2\".... ........\n 0070 01000000 00000000 00000001 00000000 ................\n 0080 80010000 ffffffdc ffffffff 00000000 ................\n 0090 00000000 00000040 001d001f 00000007 .......@........\n 00a0 00000012 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000ac 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d326130 31346637 32346334 37373737 -2a014f724c47777\n 0140 622f752e 69007370 6f6c6172 32776f72 b/u.i.spolar2wor\n 0150 6c640000 73706f6c 61723277 6f726c64 ld..spolar2world\n 0160 00636f73 5f730073 696e5f73 00000000 .cos_s.sin_s....\n 0170 00000000 00000001 00000000 00000037 ...............7\n 0180 00000000 00000004 00000000 0000002b ...............+\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000011 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000d ..... ..........\n 01d0 00000000 18cfffff 00000000 00000013 ................\n 01e0 00000000 18cfffff 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 7fffffff 00000000 7fffffff 00000001 ................\n 0210 7fffffff 00000002 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'spolar2world' — lift: cannot lift 'spolar2world': function call 'jal' at 0x14 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-64 */\n/* 4:\tsw\tra,28(sp) */\n/* 8:\tsw\ts0,24(sp) */\n/* c:\tsw\ta0,64(sp) */\n/* 10:\tmove\ts0,a1 */\n/* 14:\tjal\t0 */\n/* 18:\tlh\ta0,4(a1) */\n/* 1c:\tswc1\t$f0,44(sp) */\n/* 20:\tjal\t0 */\n/* 24:\tlh\ta0,6(s0) */\n/* 28:\tswc1\t$f0,36(sp) */\n/* 2c:\tjal\t0 */\n/* 30:\tlh\ta0,4(s0) */\n/* 34:\tlh\ta0,6(s0) */\n/* 38:\tjal\t0 */\n/* 3c:\tswc1\t$f0,48(sp) */\n/* 40:\tlwc1\t$f2,48(sp) */\n/* 44:\tlwc1\t$f4,0(s0) */\n/* 48:\tlwc1\t$f16,44(sp) */\n/* 4c:\taddiu\tt6,sp,52 */\n/* 50:\tmul.s\t$f6,$f4,$f2 */\n/* 54:\tlw\tv0,64(sp) */\n/* 58:\tmul.s\t$f8,$f6,$f0 */\n/* 5c:\tswc1\t$f8,52(sp) */\n/* 60:\tlwc1\t$f10,0(s0) */\n/* 64:\tlwc1\t$f8,36(sp) */\n/* 68:\tmul.s\t$f18,$f10,$f16 */\n/* 6c:\tswc1\t$f18,56(sp) */\n/* 70:\tlwc1\t$f4,0(s0) */\n/* 74:\tmul.s\t$f6,$f4,$f2 */\n/* 78:\tmul.s\t$f10,$f6,$f8 */\n/* 7c:\tswc1\t$f10,60(sp) */\n/* 80:\tlw\tt8,0(t6) */\n/* 84:\tsw\tt8,0(v0) */\n/* 88:\tlw\tt7,4(t6) */\n/* 8c:\tsw\tt7,4(v0) */\n/* 90:\tlw\tt8,8(t6) */\n/* 94:\tsw\tt8,8(v0) */\n/* 98:\tlw\tra,28(sp) */\n/* 9c:\tlw\ts0,24(sp) */\n/* a0:\taddiu\tsp,sp,64 */\n/* a4:\tjr\tra */\n/* a8:\tnop */\n/* ac:\tnop */\nvoid spolar2world(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'spolar2world': function call 'jal' at 0x14 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":52,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'spolar2world': function call 'jal' at 0x14 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"f32 cos_s(s16); /* extern */\nf32 sin_s(s16); /* extern */\n\nvoid spolar2world(void *arg0, void *arg1) {\n f32 sp3C;\n f32 sp38;\n f32 sp34;\n f32 sp30;\n f32 sp2C;\n f32 sp24;\n\n sp2C = cos_s(arg1->unk4);\n sp24 = cos_s(arg1->unk6);\n sp30 = sin_s(arg1->unk4);\n sp34 = arg1->unk0 * sp30 * sin_s(arg1->unk6);\n sp38 = arg1->unk0 * sp2C;\n sp3C = arg1->unk0 * sp30 * sp24;\n arg0->unk0 = (f32) sp34.unk0;\n arg0->unk4 = (s32) sp34.unk4;\n arg0->unk8 = (s32) sp34.unk8;\n}\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":96,"lines":19,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 23: Syntax Error","cfe: Error: /c.i, line 24: Syntax Error"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `spolar2world` — benchmark function af:spolar2world:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel spolar2world\n addiu\t$sp, $sp, -64\n sw\t$ra, 28($sp)\n sw\t$s0, 24($sp)\n sw\t$a0, 64($sp)\n move\t$s0, $a1\n jal\tcos_s\n lh\t$a0, 4($a1)\n swc1\t$f0, 44($sp)\n jal\tcos_s\n lh\t$a0, 6($s0)\n swc1\t$f0, 36($sp)\n jal\tsin_s\n lh\t$a0, 4($s0)\n lh\t$a0, 6($s0)\n jal\tsin_s\n swc1\t$f0, 48($sp)\n lwc1\t$f2, 48($sp)\n lwc1\t$f4, 0($s0)\n lwc1\t$f16, 44($sp)\n addiu\t$t6, $sp, 52\n mul.s\t$f6, $f4, $f2\n lw\t$v0, 64($sp)\n mul.s\t$f8, $f6, $f0\n swc1\t$f8, 52($sp)\n lwc1\t$f10, 0($s0)\n lwc1\t$f8, 36($sp)\n mul.s\t$f18, $f10, $f16\n swc1\t$f18, 56($sp)\n lwc1\t$f4, 0($s0)\n mul.s\t$f6, $f4, $f2\n mul.s\t$f10, $f6, $f8\n swc1\t$f10, 60($sp)\n lw\t$t8, 0($t6)\n sw\t$t8, 0($v0)\n lw\t$t7, 4($t6)\n sw\t$t7, 4($v0)\n lw\t$t8, 8($t6)\n sw\t$t8, 8($v0)\n lw\t$ra, 28($sp)\n lw\t$s0, 24($sp)\n addiu\t$sp, $sp, 64\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function spolar2world # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `spolar2world` — benchmark function af:spolar2world:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:spolar2world:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\tra,28(sp)\n 8:\tsw\ts0,24(sp)\n c:\tsw\ta0,64(sp)\n 10:\tmove\ts0,a1\n 14:\tjal\t0 \n 18:\tlh\ta0,4(a1)\n 1c:\tswc1\t$f0,44(sp)\n 20:\tjal\t0 \n 24:\tlh\ta0,6(s0)\n 28:\tswc1\t$f0,36(sp)\n 2c:\tjal\t0 \n 30:\tlh\ta0,4(s0)\n 34:\tlh\ta0,6(s0)\n 38:\tjal\t0 \n 3c:\tswc1\t$f0,48(sp)\n 40:\tlwc1\t$f2,48(sp)\n 44:\tlwc1\t$f4,0(s0)\n 48:\tlwc1\t$f16,44(sp)\n 4c:\taddiu\tt6,sp,52\n 50:\tmul.s\t$f6,$f4,$f2\n 54:\tlw\tv0,64(sp)\n 58:\tmul.s\t$f8,$f6,$f0\n 5c:\tswc1\t$f8,52(sp)\n 60:\tlwc1\t$f10,0(s0)\n 64:\tlwc1\t$f8,36(sp)\n 68:\tmul.s\t$f18,$f10,$f16\n 6c:\tswc1\t$f18,56(sp)\n 70:\tlwc1\t$f4,0(s0)\n 74:\tmul.s\t$f6,$f4,$f2\n 78:\tmul.s\t$f10,$f6,$f8\n 7c:\tswc1\t$f10,60(sp)\n 80:\tlw\tt8,0(t6)\n 84:\tsw\tt8,0(v0)\n 88:\tlw\tt7,4(t6)\n 8c:\tsw\tt7,4(v0)\n 90:\tlw\tt8,8(t6)\n 94:\tsw\tt8,8(v0)\n 98:\tlw\tra,28(sp)\n 9c:\tlw\ts0,24(sp)\n a0:\taddiu\tsp,sp,64\n a4:\tjr\tra\n a8:\tnop\n ac:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000ac spolar2world\n00000000 F *UND*\t00000000 cos_s\n00000000 F *UND*\t00000000 sin_s\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 cos_s\n00000020 R_MIPS_26 cos_s\n0000002c R_MIPS_26 sin_s\n00000038 R_MIPS_26 sin_s\n\n\nContents of section .text:\n 0000 27bdffc0 afbf001c afb00018 afa40040 '..............@\n 0010 00a08025 0c000000 84a40004 e7a0002c ...%...........,\n 0020 0c000000 86040006 e7a00024 0c000000 ...........$....\n 0030 86040004 86040006 0c000000 e7a00030 ...............0\n 0040 c7a20030 c6040000 c7b0002c 27ae0034 ...0.......,'..4\n 0050 46022182 8fa20040 46003202 e7a80034 F.!....@F.2....4\n 0060 c60a0000 c7a80024 46105482 e7b20038 .......$F.T....8\n 0070 c6040000 46022182 46083282 e7aa003c ....F.!.F.2....<\n 0080 8dd80000 ac580000 8dcf0004 ac4f0004 .....X.......O..\n 0090 8dd80008 ac580008 8fbf001c 8fb00018 .....X..........\n 00a0 27bd0040 03e00008 00000000 00000000 '..@............\nContents of section .options:\n 0000 01200000 00000000 a101c034 00000000 . .........4....\n 0010 000d0fd5 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a101c034 00000000 000d0fd5 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002b 00000014 00000278 p......+.......x\n 0010 00000007 00000400 00000001 0000028c ................\n 0020 00000004 000002c0 00000000 00000000 ................\n 0030 00000011 000002f0 00000038 00000334 ...........8...4\n 0040 0000001c 0000036c 00000001 00000388 .......l........\n 0050 00000000 00000000 00000003 000003d0 ................\n 0060 04322211 13101020 d0f01110 10f11318 .2\".... ........\n 0070 01000000 00000000 00000001 00000000 ................\n 0080 80010000 ffffffdc ffffffff 00000000 ................\n 0090 00000000 00000040 001d001f 00000007 .......@........\n 00a0 00000012 00000000 00000001 00000000 ................\n 00b0 2c200004 0000002a 00000000 1820000f , .....*..... ..\n 00c0 0000002a 000000ac 20200001 00000001 ...*.... ......\n 00d0 00000000 20200000 02000000 03000000 .... ..........\n 00e0 04000000 05000000 06000000 07000000 ................\n 00f0 08000000 09000000 20000000 21000000 ........ ...!...\n 0100 0a000000 0b000000 0b000000 1a000000 ................\n 0110 00000000 00000003 06000000 002f746d ............./tm\n 0120 702f6265 6e63682d 7265616c 2d69646f p/bench-real-ido\n 0130 2d326130 31346637 32346334 37373737 -2a014f724c47777\n 0140 622f752e 69007370 6f6c6172 32776f72 b/u.i.spolar2wor\n 0150 6c640000 73706f6c 61723277 6f726c64 ld..spolar2world\n 0160 00636f73 5f730073 696e5f73 00000000 .cos_s.sin_s....\n 0170 00000000 00000001 00000000 00000037 ...............7\n 0180 00000000 00000004 00000000 0000002b ...............+\n 0190 00000000 00000000 00000001 00000000 ................\n 01a0 00000011 00000000 00000000 01800000 ................\n 01b0 00000000 00000011 00000000 00000000 ................\n 01c0 00000000 18200001 00000000 0000000d ..... ..........\n 01d0 00000000 18cfffff 00000000 00000013 ................\n 01e0 00000000 18cfffff 00000000 00000000 ................\n 01f0 00000000 00000000 00000000 00000000 ................\n 0200 7fffffff 00000000 7fffffff 00000001 ................\n 0210 7fffffff 00000002 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name spolar2world # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:ValueSet__s_xyz:ido7.1","sym":"ValueSet__s_xyz","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","bitfield","cast"],"loc":8,"refSource":"void ValueSet__s_xyz(u8* ptr, ValueSet* value_set) {\n s_xyz* vec = (s_xyz*)(ptr + value_set->offset);\n s16 val = value_set->value;\n\n vec->z = val;\n vec->y = val;\n vec->x = val;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L357-L364","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlhu\tt6,0(a1)\n 4:\tlh\tv1,2(a1)\n 8:\tandi\tt7,t6,0x7ff\n c:\taddu\tv0,t7,a0\n 10:\tsh\tv1,4(v0)\n 14:\tsh\tv1,2(v0)\n 18:\tjr\tra\n 1c:\tsh\tv1,0(v0)\n","proto":{"ValueSet__s_xyz":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 ValueSet__s_xyz\n\n\nContents of section .text:\n 0000 94ae0000 84a30002 31cf07ff 01e41021 ........1......!\n 0010 a4430004 a4430002 03e00008 a4430000 .C...C.......C..\nContents of section .options:\n 0000 01200000 00000000 8000c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000008 00000198 p...............\n 0010 00000005 000002ec 00000001 000001a0 ................\n 0020 00000004 000001d4 00000000 00000000 ................\n 0030 00000011 00000204 0000003c 00000248 ...........<...H\n 0040 00000010 00000284 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1010f120 1020f000 00000000 00000001 ... . ..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000006 0000000c 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000020 20200001 . .....*... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d363432 39343636 64386465 -ido-6429466d8de\n 0130 30653065 362f752e 69005661 6c756553 0e0e6/u.i.ValueS\n 0140 65745f5f 735f7879 7a000000 56616c75 et__s_xyz...Valu\n 0150 65536574 5f5f735f 78797a00 00000000 eSet__s_xyz.....\n 0160 00000001 00000000 0000003a 00000000 ...........:....\n 0170 00000004 00000000 00000008 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000007 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void ValueSet__s_xyz(u32 a0, u16 * a1) {\n s32 v0;\n s32 v1;\n v0 = *a1;\n v1 = a1[1];\n ((u16 *)((v0 & 2047) + a0))[2] = v1;\n ((u16 *)((v0 & 2047) + a0))[1] = v1;\n *(u16 *)((v0 & 2047) + a0) = v1;\n return;\n}\n","score":7,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":94,"lines":10,"gotos":0,"casts":3,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void ValueSet__s_xyz(s32 arg0, void *arg1) {\n s16 temp_v1;\n void *temp_v0;\n\n temp_v1 = arg1->unk2;\n temp_v0 = (arg1->unk0 & 0x7FF) + arg0;\n temp_v0->unk4 = temp_v1;\n temp_v0->unk2 = temp_v1;\n temp_v0->unk0 = temp_v1;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 9: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 10: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 11: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 12: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 13: Selector requires struct/union pointer as left hand side"]},"gapSize":{"decompiler":"asmlift","score":7,"maxScore":8,"ratio":0.875,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ValueSet__s_xyz` — benchmark function af:ValueSet__s_xyz:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ValueSet__s_xyz\n lhu\t$t6, 0($a1)\n lh\t$v1, 2($a1)\n andi\t$t7, $t6, 0x7ff\n addu\t$v0, $t7, $a0\n sh\t$v1, 4($v0)\n sh\t$v1, 2($v0)\n jr\t$ra\n sh\t$v1, 0($v0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ValueSet__s_xyz # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ValueSet__s_xyz` — benchmark function af:ValueSet__s_xyz:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:ValueSet__s_xyz:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlhu\tt6,0(a1)\n 4:\tlh\tv1,2(a1)\n 8:\tandi\tt7,t6,0x7ff\n c:\taddu\tv0,t7,a0\n 10:\tsh\tv1,4(v0)\n 14:\tsh\tv1,2(v0)\n 18:\tjr\tra\n 1c:\tsh\tv1,0(v0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 ValueSet__s_xyz\n\n\nContents of section .text:\n 0000 94ae0000 84a30002 31cf07ff 01e41021 ........1......!\n 0010 a4430004 a4430002 03e00008 a4430000 .C...C.......C..\nContents of section .options:\n 0000 01200000 00000000 8000c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000008 00000198 p...............\n 0010 00000005 000002ec 00000001 000001a0 ................\n 0020 00000004 000001d4 00000000 00000000 ................\n 0030 00000011 00000204 0000003c 00000248 ...........<...H\n 0040 00000010 00000284 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 1010f120 1020f000 00000000 00000001 ... . ..........\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000006 0000000c 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000020 20200001 . .....*... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d363432 39343636 64386465 -ido-6429466d8de\n 0130 30653065 362f752e 69005661 6c756553 0e0e6/u.i.ValueS\n 0140 65745f5f 735f7879 7a000000 56616c75 et__s_xyz...Valu\n 0150 65536574 5f5f735f 78797a00 00000000 eSet__s_xyz.....\n 0160 00000001 00000000 0000003a 00000000 ...........:....\n 0170 00000004 00000000 00000008 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000007 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ValueSet__s_xyz\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ValueSet__s_xyz # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_add:ido7.1","sym":"xyz_t_add","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct"],"loc":5,"refSource":"void xyz_t_add(xyz_t* augend, xyz_t* addend, xyz_t* total) {\n total->x = augend->x + addend->x;\n total->y = augend->y + addend->y;\n total->z = augend->z + addend->z;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L236-L240","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tadd.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tadd.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tadd.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_add\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062200 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105480 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062200 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d656339 66643861 32343532 -ido-ec9fd8a2452\n 0130 38613731 392f752e 69007879 7a5f745f 8a719/u.i.xyz_t_\n 0140 61646400 78797a5f 745f6164 64000000 add.xyz_t_add...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_add' — lift: cannot lift 'xyz_t_add @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlwc1\t$f4,0(a0) */\n/* 4:\tlwc1\t$f6,0(a1) */\n/* 8:\tadd.s\t$f8,$f4,$f6 */\n/* c:\tswc1\t$f8,0(a2) */\n/* 10:\tlwc1\t$f16,4(a1) */\n/* 14:\tlwc1\t$f10,4(a0) */\n/* 18:\tadd.s\t$f18,$f10,$f16 */\n/* 1c:\tswc1\t$f18,4(a2) */\n/* 20:\tlwc1\t$f6,8(a1) */\n/* 24:\tlwc1\t$f4,8(a0) */\n/* 28:\tadd.s\t$f8,$f4,$f6 */\n/* 2c:\tjr\tra */\n/* 30:\tswc1\t$f8,8(a2) */\n/* \t... */\nvoid xyz_t_add(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_add @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_add @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_add(void *arg0, void *arg1, void *arg2) {\n arg2->unk0 = (f32) (arg0->unk0 + arg1->unk0);\n arg2->unk4 = (f32) (arg0->unk4 + arg1->unk4);\n arg2->unk8 = (f32) (arg0->unk8 + arg1->unk8);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 3: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 4: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 5: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `xyz_t_add` — benchmark function af:xyz_t_add:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_add\n lwc1\t$f4, 0($a0)\n lwc1\t$f6, 0($a1)\n add.s\t$f8, $f4, $f6\n swc1\t$f8, 0($a2)\n lwc1\t$f16, 4($a1)\n lwc1\t$f10, 4($a0)\n add.s\t$f18, $f10, $f16\n swc1\t$f18, 4($a2)\n lwc1\t$f6, 8($a1)\n lwc1\t$f4, 8($a0)\n add.s\t$f8, $f4, $f6\n jr\t$ra\n swc1\t$f8, 8($a2)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_add # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_add` — benchmark function af:xyz_t_add:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_add:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tadd.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tadd.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tadd.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_add\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062200 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105480 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062200 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d656339 66643861 32343532 -ido-ec9fd8a2452\n 0130 38613731 392f752e 69007879 7a5f745f 8a719/u.i.xyz_t_\n 0140 61646400 78797a5f 745f6164 64000000 add.xyz_t_add...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_add # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_mult_v:ido7.1","sym":"xyz_t_mult_v","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","float"],"loc":5,"refSource":"void xyz_t_mult_v(xyz_t* multiplicand, f32 multiplier) {\n multiplicand->x *= multiplier;\n multiplicand->y *= multiplier;\n multiplicand->z *= multiplier;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L254-L258","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f4,0(a0)\n 8:\tlwc1\t$f8,4(a0)\n c:\tlwc1\t$f16,8(a0)\n 10:\tmul.s\t$f6,$f4,$f12\n 14:\tmul.s\t$f10,$f8,$f12\n 18:\tmul.s\t$f18,$f16,$f12\n 1c:\tswc1\t$f6,0(a0)\n 20:\tswc1\t$f10,4(a0)\n 24:\tjr\tra\n 28:\tswc1\t$f18,8(a0)\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c xyz_t_mult_v\n\n\nContents of section .text:\n 0000 44856000 c4840000 c4880004 c4900008 D.`.............\n 0010 460c2182 460c4282 460c8482 e4860000 F.!.F.B.F.......\n 0020 e48a0004 03e00008 e4920008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 000d1dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 000d1dd0 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 0000000c 000001a8 p...............\n 0010 00000005 000002fc 00000001 000001b4 ................\n 0020 00000004 000001e8 00000000 00000000 ................\n 0030 00000011 00000218 00000038 0000025c ...........8...\\\n 0040 00000010 00000294 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 00101010 e01010e0 1020f000 00000000 ......... ......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000006 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000002c ..... .....*...,\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d356562 61356236 real-ido-5eba5b6\n 0130 39663537 39666461 632f752e 69007879 9f579fdac/u.i.xy\n 0140 7a5f745f 6d756c74 5f760000 78797a5f z_t_mult_v..xyz_\n 0150 745f6d75 6c745f76 00000000 00000000 t_mult_v........\n 0160 00000001 00000000 00000037 00000000 ...........7....\n 0170 00000004 00000000 0000000b 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 0000000b 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_mult_v' — lift: cannot lift 'xyz_t_mult_v @0x4': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta1,$f12 */\n/* 4:\tlwc1\t$f4,0(a0) */\n/* 8:\tlwc1\t$f8,4(a0) */\n/* c:\tlwc1\t$f16,8(a0) */\n/* 10:\tmul.s\t$f6,$f4,$f12 */\n/* 14:\tmul.s\t$f10,$f8,$f12 */\n/* 18:\tmul.s\t$f18,$f16,$f12 */\n/* 1c:\tswc1\t$f6,0(a0) */\n/* 20:\tswc1\t$f10,4(a0) */\n/* 24:\tjr\tra */\n/* 28:\tswc1\t$f18,8(a0) */\n/* 2c:\tnop */\nvoid xyz_t_mult_v(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_mult_v @0x4': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_mult_v @0x4': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_mult_v(void *arg0, f32 arg1) {\n arg0->unk0 = (f32) (arg0->unk0 * arg1);\n arg0->unk4 = (f32) (arg0->unk4 * arg1);\n arg0->unk8 = (f32) (arg0->unk8 * arg1);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 3: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 4: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 5: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `xyz_t_mult_v` — benchmark function af:xyz_t_mult_v:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_mult_v\n mtc1\t$a1, $f12\n lwc1\t$f4, 0($a0)\n lwc1\t$f8, 4($a0)\n lwc1\t$f16, 8($a0)\n mul.s\t$f6, $f4, $f12\n mul.s\t$f10, $f8, $f12\n mul.s\t$f18, $f16, $f12\n swc1\t$f6, 0($a0)\n swc1\t$f10, 4($a0)\n jr\t$ra\n swc1\t$f18, 8($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_mult_v # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_mult_v` — benchmark function af:xyz_t_mult_v:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_mult_v:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta1,$f12\n 4:\tlwc1\t$f4,0(a0)\n 8:\tlwc1\t$f8,4(a0)\n c:\tlwc1\t$f16,8(a0)\n 10:\tmul.s\t$f6,$f4,$f12\n 14:\tmul.s\t$f10,$f8,$f12\n 18:\tmul.s\t$f18,$f16,$f12\n 1c:\tswc1\t$f6,0(a0)\n 20:\tswc1\t$f10,4(a0)\n 24:\tjr\tra\n 28:\tswc1\t$f18,8(a0)\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c xyz_t_mult_v\n\n\nContents of section .text:\n 0000 44856000 c4840000 c4880004 c4900008 D.`.............\n 0010 460c2182 460c4282 460c8482 e4860000 F.!.F.B.F.......\n 0020 e48a0004 03e00008 e4920008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 000d1dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 000d1dd0 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 0000000c 000001a8 p...............\n 0010 00000005 000002fc 00000001 000001b4 ................\n 0020 00000004 000001e8 00000000 00000000 ................\n 0030 00000011 00000218 00000038 0000025c ...........8...\\\n 0040 00000010 00000294 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 00101010 e01010e0 1020f000 00000000 ......... ......\n 0070 00000001 00000000 00000000 00000000 ................\n 0080 ffffffff 00000000 00000000 00000000 ................\n 0090 001d001f 00000002 00000006 00000000 ................\n 00a0 00000001 00000000 2c200004 0000002a ........, .....*\n 00b0 00000000 1820000f 0000002a 0000002c ..... .....*...,\n 00c0 20200001 00000001 00000000 20200000 .......... ..\n 00d0 02000000 03000000 04000000 05000000 ................\n 00e0 06000000 07000000 08000000 09000000 ................\n 00f0 20000000 21000000 0a000000 0b000000 ...!...........\n 0100 0b000000 1a000000 00000000 00000003 ................\n 0110 06000000 002f746d 702f6265 6e63682d ...../tmp/bench-\n 0120 7265616c 2d69646f 2d356562 61356236 real-ido-5eba5b6\n 0130 39663537 39666461 632f752e 69007879 9f579fdac/u.i.xy\n 0140 7a5f745f 6d756c74 5f760000 78797a5f z_t_mult_v..xyz_\n 0150 745f6d75 6c745f76 00000000 00000000 t_mult_v........\n 0160 00000001 00000000 00000037 00000000 ...........7....\n 0170 00000004 00000000 0000000b 00000000 ................\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 0000000b 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_mult_v # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_sub_ss:ido7.1","sym":"xyz_t_sub_ss","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct"],"loc":5,"refSource":"void xyz_t_sub_ss(xyz_t* dest, s_xyz* minuend, s_xyz* subtrahend) {\n dest->x = minuend->x - subtrahend->x;\n dest->y = minuend->y - subtrahend->y;\n dest->z = minuend->z - subtrahend->z;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L248-L252","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tt6,0(a1)\n 4:\tlh\tt7,0(a2)\n 8:\tsubu\tt8,t6,t7\n c:\tmtc1\tt8,$f4\n 10:\tnop\n 14:\tcvt.s.w\t$f6,$f4\n 18:\tswc1\t$f6,0(a0)\n 1c:\tlh\tt0,2(a2)\n 20:\tlh\tt9,2(a1)\n 24:\tsubu\tt1,t9,t0\n 28:\tmtc1\tt1,$f8\n 2c:\tnop\n 30:\tcvt.s.w\t$f10,$f8\n 34:\tswc1\t$f10,4(a0)\n 38:\tlh\tt3,4(a2)\n 3c:\tlh\tt2,4(a1)\n 40:\tsubu\tt4,t2,t3\n 44:\tmtc1\tt4,$f16\n 48:\tnop\n 4c:\tcvt.s.w\t$f18,$f16\n 50:\tjr\tra\n 54:\tswc1\t$f18,8(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000058 xyz_t_sub_ss\n\n\nContents of section .text:\n 0000 84ae0000 84cf0000 01cfc023 44982000 ...........#D. .\n 0010 00000000 468021a0 e4860000 84c80002 ....F.!.........\n 0020 84b90002 03284823 44894000 00000000 .....(H#D.@.....\n 0030 468042a0 e48a0004 84cb0004 84aa0004 F.B.............\n 0040 014b6023 448c8000 00000000 468084a0 .K`#D.......F...\n 0050 03e00008 e4920008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300df70 00000000 . .........p....\n 0010 000d0dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300df70 00000000 000d0dd0 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000016 00000008 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e0 .......(........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000038 00000288 .......D...8....\n 0040 00000010 000002c0 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 16161510 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000008 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000058 20200001 . .....*...X ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d643433 35353733 66633865 -ido-d435573fc8e\n 0130 32643164 662f752e 69007879 7a5f745f 2d1df/u.i.xyz_t_\n 0140 7375625f 73730000 78797a5f 745f7375 sub_ss..xyz_t_su\n 0150 625f7373 00000000 00000000 00000001 b_ss............\n 0160 00000000 00000037 00000000 00000004 .......7........\n 0170 00000000 00000016 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000005 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_sub_ss' — lift: cannot lift 'xyz_t_sub_ss @0x14': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlh\tt6,0(a1) */\n/* 4:\tlh\tt7,0(a2) */\n/* 8:\tsubu\tt8,t6,t7 */\n/* c:\tmtc1\tt8,$f4 */\n/* 10:\tnop */\n/* 14:\tcvt.s.w\t$f6,$f4 */\n/* 18:\tswc1\t$f6,0(a0) */\n/* 1c:\tlh\tt0,2(a2) */\n/* 20:\tlh\tt9,2(a1) */\n/* 24:\tsubu\tt1,t9,t0 */\n/* 28:\tmtc1\tt1,$f8 */\n/* 2c:\tnop */\n/* 30:\tcvt.s.w\t$f10,$f8 */\n/* 34:\tswc1\t$f10,4(a0) */\n/* 38:\tlh\tt3,4(a2) */\n/* 3c:\tlh\tt2,4(a1) */\n/* 40:\tsubu\tt4,t2,t3 */\n/* 44:\tmtc1\tt4,$f16 */\n/* 48:\tnop */\n/* 4c:\tcvt.s.w\t$f18,$f16 */\n/* 50:\tjr\tra */\n/* 54:\tswc1\t$f18,8(a0) */\n/* \t... */\nvoid xyz_t_sub_ss(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_sub_ss @0x14': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":31,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_sub_ss @0x14': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_sub_ss(void *arg0, void *arg1, void *arg2) {\n arg0->unk0 = (f32) (arg1->unk0 - arg2->unk0);\n arg0->unk4 = (f32) (arg1->unk2 - arg2->unk2);\n arg0->unk8 = (f32) (arg1->unk4 - arg2->unk4);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 5: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 6: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 7: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `xyz_t_sub_ss` — benchmark function af:xyz_t_sub_ss:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_sub_ss\n lh\t$t6, 0($a1)\n lh\t$t7, 0($a2)\n subu\t$t8, $t6, $t7\n mtc1\t$t8, $f4\n nop\n cvt.s.w\t$f6, $f4\n swc1\t$f6, 0($a0)\n lh\t$t0, 2($a2)\n lh\t$t9, 2($a1)\n subu\t$t1, $t9, $t0\n mtc1\t$t1, $f8\n nop\n cvt.s.w\t$f10, $f8\n swc1\t$f10, 4($a0)\n lh\t$t3, 4($a2)\n lh\t$t2, 4($a1)\n subu\t$t4, $t2, $t3\n mtc1\t$t4, $f16\n nop\n cvt.s.w\t$f18, $f16\n jr\t$ra\n swc1\t$f18, 8($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_sub_ss # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_sub_ss` — benchmark function af:xyz_t_sub_ss:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_sub_ss:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tt6,0(a1)\n 4:\tlh\tt7,0(a2)\n 8:\tsubu\tt8,t6,t7\n c:\tmtc1\tt8,$f4\n 10:\tnop\n 14:\tcvt.s.w\t$f6,$f4\n 18:\tswc1\t$f6,0(a0)\n 1c:\tlh\tt0,2(a2)\n 20:\tlh\tt9,2(a1)\n 24:\tsubu\tt1,t9,t0\n 28:\tmtc1\tt1,$f8\n 2c:\tnop\n 30:\tcvt.s.w\t$f10,$f8\n 34:\tswc1\t$f10,4(a0)\n 38:\tlh\tt3,4(a2)\n 3c:\tlh\tt2,4(a1)\n 40:\tsubu\tt4,t2,t3\n 44:\tmtc1\tt4,$f16\n 48:\tnop\n 4c:\tcvt.s.w\t$f18,$f16\n 50:\tjr\tra\n 54:\tswc1\t$f18,8(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000058 xyz_t_sub_ss\n\n\nContents of section .text:\n 0000 84ae0000 84cf0000 01cfc023 44982000 ...........#D. .\n 0010 00000000 468021a0 e4860000 84c80002 ....F.!.........\n 0020 84b90002 03284823 44894000 00000000 .....(H#D.@.....\n 0030 468042a0 e48a0004 84cb0004 84aa0004 F.B.............\n 0040 014b6023 448c8000 00000000 468084a0 .K`#D.......F...\n 0050 03e00008 e4920008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300df70 00000000 . .........p....\n 0010 000d0dd0 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300df70 00000000 000d0dd0 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000016 00000008 000001d8 p...............\n 0010 00000005 00000328 00000001 000001e0 .......(........\n 0020 00000004 00000214 00000000 00000000 ................\n 0030 00000011 00000244 00000038 00000288 .......D...8....\n 0040 00000010 000002c0 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 16161510 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000004 00000008 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000058 20200001 . .....*...X ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d643433 35353733 66633865 -ido-d435573fc8e\n 0130 32643164 662f752e 69007879 7a5f745f 2d1df/u.i.xyz_t_\n 0140 7375625f 73730000 78797a5f 745f7375 sub_ss..xyz_t_su\n 0150 625f7373 00000000 00000000 00000001 b_ss............\n 0160 00000000 00000037 00000000 00000004 .......7........\n 0170 00000000 00000016 00000000 00000000 ................\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000005 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_sub_ss # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"af:xyz_t_sub:ido7.1","sym":"xyz_t_sub","project":"af","tier":"real","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","field","float"],"loc":5,"refSource":"void xyz_t_sub(xyz_t* minuend, xyz_t* subtrahend, xyz_t* diff) {\n diff->x = minuend->x - subtrahend->x;\n diff->y = minuend->y - subtrahend->y;\n diff->z = minuend->z - subtrahend->z;\n}","sourceUrl":"https://github.com/macabeus/af/blob/ff5f68aacc7aab10d5b281277447f1b805c0a5a2/src/code/m_lib.c#L242-L246","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tsub.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tsub.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tsub.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\n","proto":{"xyz_t_sub":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_sub\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062201 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105481 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062201 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d383532 37346662 37623236 -ido-85274fb7b26\n 0130 63633439 392f752e 69007879 7a5f745f cc499/u.i.xyz_t_\n 0140 73756200 78797a5f 745f7375 62000000 sub.xyz_t_sub...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'xyz_t_sub' — lift: cannot lift 'xyz_t_sub @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlwc1\t$f4,0(a0) */\n/* 4:\tlwc1\t$f6,0(a1) */\n/* 8:\tsub.s\t$f8,$f4,$f6 */\n/* c:\tswc1\t$f8,0(a2) */\n/* 10:\tlwc1\t$f16,4(a1) */\n/* 14:\tlwc1\t$f10,4(a0) */\n/* 18:\tsub.s\t$f18,$f10,$f16 */\n/* 1c:\tswc1\t$f18,4(a2) */\n/* 20:\tlwc1\t$f6,8(a1) */\n/* 24:\tlwc1\t$f4,8(a0) */\n/* 28:\tsub.s\t$f8,$f4,$f6 */\n/* 2c:\tjr\tra */\n/* 30:\tswc1\t$f8,8(a2) */\n/* \t... */\nvoid xyz_t_sub(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'xyz_t_sub @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'xyz_t_sub @0x0': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void xyz_t_sub(void *arg0, void *arg1, void *arg2) {\n arg2->unk0 = (f32) (arg0->unk0 - arg1->unk0);\n arg2->unk4 = (f32) (arg0->unk4 - arg1->unk4);\n arg2->unk8 = (f32) (arg0->unk8 - arg1->unk8);\n}\n","score":null,"maxScore":null,"compileErrors":3,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["ido cc failed: cfe: Error: /c.i, line 3: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 4: Selector requires struct/union pointer as left hand side","cfe: Error: /c.i, line 5: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `xyz_t_sub` — benchmark function af:xyz_t_sub:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel xyz_t_sub\n lwc1\t$f4, 0($a0)\n lwc1\t$f6, 0($a1)\n sub.s\t$f8, $f4, $f6\n swc1\t$f8, 0($a2)\n lwc1\t$f16, 4($a1)\n lwc1\t$f10, 4($a0)\n sub.s\t$f18, $f10, $f16\n swc1\t$f18, 4($a2)\n lwc1\t$f6, 8($a1)\n lwc1\t$f4, 8($a0)\n sub.s\t$f8, $f4, $f6\n jr\t$ra\n swc1\t$f8, 8($a2)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function xyz_t_sub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `xyz_t_sub` — benchmark function af:xyz_t_sub:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/af.git af\n# make -C af\n# make -C af asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/af/symbols.json.gz\n# sha256 of the decompressed map JSON: 1c10afb05850b76cba9adbe53c6515245f0e8b5a27e0fd4c0f718a25a99f9dfb\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/af'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target af:xyz_t_sub:ido7.1 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwc1\t$f4,0(a0)\n 4:\tlwc1\t$f6,0(a1)\n 8:\tsub.s\t$f8,$f4,$f6\n c:\tswc1\t$f8,0(a2)\n 10:\tlwc1\t$f16,4(a1)\n 14:\tlwc1\t$f10,4(a0)\n 18:\tsub.s\t$f18,$f10,$f16\n 1c:\tswc1\t$f18,4(a2)\n 20:\tlwc1\t$f6,8(a1)\n 24:\tlwc1\t$f4,8(a0)\n 28:\tsub.s\t$f8,$f4,$f6\n 2c:\tjr\tra\n 30:\tswc1\t$f8,8(a2)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 xyz_t_sub\n\n\nContents of section .text:\n 0000 c4840000 c4a60000 46062201 e4c80000 ........F.\".....\n 0010 c4b00004 c48a0004 46105481 e4d20004 ........F.T.....\n 0020 c4a60008 c4840008 46062201 03e00008 ........F.\".....\n 0030 e4c80008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000070 00000000 . .........p....\n 0010 000d0750 00000000 00000000 00007ff0 ...P............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000070 00000000 000d0750 00000000 ...p.......P....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000008 000001a8 p...............\n 0010 00000005 000002f0 00000001 000001b0 ................\n 0020 00000004 000001e4 00000000 00000000 ................\n 0030 00000011 00000214 00000034 00000258 ...........4...X\n 0040 0000000c 0000028c 00000001 00000298 ................\n 0050 00000000 00000000 00000001 000002e0 ................\n 0060 13131210 f0000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000006 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002a 00000000 ...., .....*....\n 00b0 1820000f 0000002a 00000034 20200001 . .....*...4 ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6265 6e63682d 7265616c ./tmp/bench-real\n 0120 2d69646f 2d383532 37346662 37623236 -ido-85274fb7b26\n 0130 63633439 392f752e 69007879 7a5f745f cc499/u.i.xyz_t_\n 0140 73756200 78797a5f 745f7375 62000000 sub.xyz_t_sub...\n 0150 00000000 00000001 00000000 00000034 ...............4\n 0160 00000000 00000004 00000000 0000000d ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"xyz_t_sub\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name xyz_t_sub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:CheckTileCollisionVertical:agbcc","sym":"CheckTileCollisionVertical","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","struct","branch","pointer","memory"],"loc":20,"refSource":"struct Unk_08014184 *CheckTileCollisionVertical(struct Unk_08014184 *arg0, u16 arg1, u16 arg2, u8 arg3) {\n u32 var_r3;\n struct Unk_08014184 var_r4;\n\n for (var_r3 = gUnk_03004D80->unk2; var_r3 < gUnk_03004D80->unk0; var_r3++) {\n if ((arg2 >= gUnk_03004D80->unk4[var_r3].unk2) && (gUnk_03004D80->unk4[var_r3].unk6 >= (arg2 - arg3))\n && (arg1 < (gUnk_03004D80->unk4[var_r3].unk0 + 3)) && ((gUnk_03004D80->unk4[var_r3].unk0 - 3) < arg1)) {\n var_r4.unk0 = gUnk_03004D80->unk4[var_r3].unk0 - 3;\n var_r4.unk2 = gUnk_03004D80->unk4[var_r3].unk8;\n *arg0 = var_r4;\n goto exit;\n return arg0;\n }\n }\n\n var_r4.unk0 = -1;\n *arg0 = var_r4;\nexit:\n return arg0;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_1.c#L43-L62","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckTileCollisionVertical\n\t.type\t CheckTileCollisionVertical,function\n\t.thumb_func\nCheckTileCollisionVertical:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x4\n\tmov\tip, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr1, r1, #0x10\n\tstr\tr1, [sp]\n\tlsl\tr2, r2, #0x10\n\tlsr\tr6, r2, #0x10\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr9, r3\n\tldr\tr0, .L10\n\tmov\tsl, r0\n\tldr\tr0, [r0]\n\tldrh\tr3, [r0, #0x2]\n\tldrh\tr1, [r0]\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n\tmov\tr8, r0\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r3\n\tlsl\tr5, r0, #0x2\n.L6:\n\tmov\tr7, r8\n\tldr\tr0, [r7, #0x4]\n\tadd\tr2, r5, r0\n\tldrh\tr0, [r2, #0x2]\n\tcmp\tr6, r0\n\tbcc\t.L5\t@cond_branch\n\tldrh\tr1, [r2, #0x6]\n\tmov\tr7, r9\n\tsub\tr0, r6, r7\n\tcmp\tr1, r0\n\tblt\t.L5\t@cond_branch\n\tldrh\tr1, [r2]\n\tadd\tr0, r1, #0x3\n\tldr\tr7, [sp]\n\tcmp\tr7, r0\n\tbge\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x3\n\tcmp\tr0, r7\n\tbge\t.L5\t@cond_branch\n\tlsl\tr1, r0, #0x10\n\tlsr\tr1, r1, #0x10\n\tldr\tr0, .L10+0x4\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tldrb\tr1, [r2, #0x8]\n\tlsl\tr1, r1, #0x10\n\tldr\tr0, .L10+0x8\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tmov\tr0, ip\n\tstr\tr4, [r0]\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03004D80\n\t.word\t-0x10000\n\t.word\t-0xff0001\n.L5:\n\tadd\tr5, r5, #0xc\n\tadd\tr3, r3, #0x1\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tldrh\tr0, [r0]\n\tcmp\tr3, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L12\n\torr\tr4, r4, r0\n\tmov\tr7, ip\n\tstr\tr4, [r7]\n.L8:\n\tmov\tr0, ip\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t CheckTileCollisionVertical,.Lfe1-CheckTileCollisionVertical\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'CheckTileCollisionVertical' — lift: cannot lift 'CheckTileCollisionVertical': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tCheckTileCollisionVertical */\n/* \t.type\t CheckTileCollisionVertical,function */\n/* \t.thumb_func */\n/* CheckTileCollisionVertical: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, sl */\n/* \tmov\tr6, r9 */\n/* \tmov\tr5, r8 */\n/* \tpush\t{r5, r6, r7} */\n/* \tadd\tsp, sp, #-0x4 */\n/* \tmov\tip, r0 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr1, r1, #0x10 */\n/* \tstr\tr1, [sp] */\n/* \tlsl\tr2, r2, #0x10 */\n/* \tlsr\tr6, r2, #0x10 */\n/* \tlsl\tr3, r3, #0x18 */\n/* \tlsr\tr3, r3, #0x18 */\n/* \tmov\tr9, r3 */\n/* \tldr\tr0, .L10 */\n/* \tmov\tsl, r0 */\n/* \tldr\tr0, [r0] */\n/* \tldrh\tr3, [r0, #0x2] */\n/* \tldrh\tr1, [r0] */\n/* \tcmp\tr3, r1 */\n/* \tbcs\t.L4\t@cond_branch */\n/* \tmov\tr8, r0 */\n/* \tlsl\tr0, r3, #0x1 */\n/* \tadd\tr0, r0, r3 */\n/* \tlsl\tr5, r0, #0x2 */\n/* .L6: */\n/* \tmov\tr7, r8 */\n/* \tldr\tr0, [r7, #0x4] */\n/* \tadd\tr2, r5, r0 */\n/* \tldrh\tr0, [r2, #0x2] */\n/* \tcmp\tr6, r0 */\n/* \tbcc\t.L5\t@cond_branch */\n/* \tldrh\tr1, [r2, #0x6] */\n/* \tmov\tr7, r9 */\n/* \tsub\tr0, r6, r7 */\n/* \tcmp\tr1, r0 */\n/* \tblt\t.L5\t@cond_branch */\n/* \tldrh\tr1, [r2] */\n/* \tadd\tr0, r1, #0x3 */\n/* \tldr\tr7, [sp] */\n/* \tcmp\tr7, r0 */\n/* \tbge\t.L5\t@cond_branch */\n/* \tsub\tr0, r1, #0x3 */\n/* \tcmp\tr0, r7 */\n/* \tbge\t.L5\t@cond_branch */\n/* \tlsl\tr1, r0, #0x10 */\n/* \tlsr\tr1, r1, #0x10 */\n/* \tldr\tr0, .L10+0x4 */\n/* \tand\tr4, r4, r0 */\n/* \torr\tr4, r4, r1 */\n/* \tldrb\tr1, [r2, #0x8] */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tldr\tr0, .L10+0x8 */\n/* \tand\tr4, r4, r0 */\n/* \torr\tr4, r4, r1 */\n/* \tmov\tr0, ip */\n/* \tstr\tr4, [r0] */\n/* \tb\t.L8 */\n/* .L11: */\n/* \t.align\t2, 0 */\n/* .L10: */\n/* \t.word\tgUnk_03004D80 */\n/* \t.word\t-0x10000 */\n/* \t.word\t-0xff0001 */\n/* .L5: */\n/* \tadd\tr5, r5, #0xc */\n/* \tadd\tr3, r3, #0x1 */\n/* \tmov\tr1, sl */\n/* \tldr\tr0, [r1] */\n/* \tldrh\tr0, [r0] */\n/* \tcmp\tr3, r0 */\n/* \tbcc\t.L6\t@cond_branch */\n/* .L4: */\n/* \tldr\tr0, .L12 */\n/* \torr\tr4, r4, r0 */\n/* \tmov\tr7, ip */\n/* \tstr\tr4, [r7] */\n/* .L8: */\n/* \tmov\tr0, ip */\n/* \tadd\tsp, sp, #0x4 */\n/* \tpop\t{r3, r4, r5} */\n/* \tmov\tr8, r3 */\n/* \tmov\tr9, r4 */\n/* \tmov\tsl, r5 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .L13: */\n/* \t.align\t2, 0 */\n/* .L12: */\n/* \t.word\t0xffff */\n/* .Lfe1: */\n/* \t.size\t CheckTileCollisionVertical,.Lfe1-CheckTileCollisionVertical */\n/* .text */\n/* \t.align\t2, 0 */\nvoid CheckTileCollisionVertical(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'CheckTileCollisionVertical': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":110,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'CheckTileCollisionVertical': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern void *gUnk_03004D80;\n\ns32 *CheckTileCollisionVertical(s32 *arg0, u16 arg1, u16 arg2, u8 arg3) {\n s32 temp_r0;\n s32 var_r5;\n u16 temp_r1;\n u16 temp_r6;\n u16 var_r3;\n void *temp_r2;\n\n unksp0 = (s32) arg1;\n temp_r6 = arg2;\n var_r3 = gUnk_03004D80->unk2;\n if ((u32) var_r3 < (u32) gUnk_03004D80->unk0) {\n var_r5 = var_r3 * 0xC;\nloop_2:\n temp_r2 = var_r5 + gUnk_03004D80->unk4;\n if (((u32) temp_r6 >= (u32) temp_r2->unk2) && ((s32) temp_r2->unk6 >= (s32) (temp_r6 - arg3)) && (temp_r1 = temp_r2->unk0, (unksp0 < (s32) (temp_r1 + 3))) && (temp_r0 = temp_r1 - 3, (temp_r0 < unksp0))) {\n *arg0 = (((saved_reg_r4 & 0xFFFF0000) | (u16) temp_r0) & 0xFF00FFFF) | (temp_r2->unk8 << 0x10);\n } else {\n var_r5 += 0xC;\n var_r3 += 1;\n if ((u32) var_r3 >= (u32) gUnk_03004D80->unk0) {\n goto block_8;\n }\n goto loop_2;\n }\n } else {\nblock_8:\n *arg0 = saved_reg_r4 | 0xFFFF;\n }\n return arg0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":64,"lines":31,"gotos":2,"casts":9,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1077: conflicting types for `gUnk_03004D80'","/c.c:563: previous declaration of `gUnk_03004D80'","/c.c:1087: `unksp0' undeclared (first use in this function)","/c.c:1087: (Each undeclared identifier is reported only once","/c.c:1087: for each function it appears in.)"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CheckTileCollisionVertical` — benchmark function kleod:CheckTileCollisionVertical:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckTileCollisionVertical\n\t.type\t CheckTileCollisionVertical,function\n\t.thumb_func\nCheckTileCollisionVertical:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x4\n\tmov\tip, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr1, r1, #0x10\n\tstr\tr1, [sp]\n\tlsl\tr2, r2, #0x10\n\tlsr\tr6, r2, #0x10\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr9, r3\n\tldr\tr0, .L10\n\tmov\tsl, r0\n\tldr\tr0, [r0]\n\tldrh\tr3, [r0, #0x2]\n\tldrh\tr1, [r0]\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n\tmov\tr8, r0\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r3\n\tlsl\tr5, r0, #0x2\n.L6:\n\tmov\tr7, r8\n\tldr\tr0, [r7, #0x4]\n\tadd\tr2, r5, r0\n\tldrh\tr0, [r2, #0x2]\n\tcmp\tr6, r0\n\tbcc\t.L5\t@cond_branch\n\tldrh\tr1, [r2, #0x6]\n\tmov\tr7, r9\n\tsub\tr0, r6, r7\n\tcmp\tr1, r0\n\tblt\t.L5\t@cond_branch\n\tldrh\tr1, [r2]\n\tadd\tr0, r1, #0x3\n\tldr\tr7, [sp]\n\tcmp\tr7, r0\n\tbge\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x3\n\tcmp\tr0, r7\n\tbge\t.L5\t@cond_branch\n\tlsl\tr1, r0, #0x10\n\tlsr\tr1, r1, #0x10\n\tldr\tr0, .L10+0x4\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tldrb\tr1, [r2, #0x8]\n\tlsl\tr1, r1, #0x10\n\tldr\tr0, .L10+0x8\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tmov\tr0, ip\n\tstr\tr4, [r0]\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03004D80\n\t.word\t-0x10000\n\t.word\t-0xff0001\n.L5:\n\tadd\tr5, r5, #0xc\n\tadd\tr3, r3, #0x1\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tldrh\tr0, [r0]\n\tcmp\tr3, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L12\n\torr\tr4, r4, r0\n\tmov\tr7, ip\n\tstr\tr4, [r7]\n.L8:\n\tmov\tr0, ip\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t CheckTileCollisionVertical,.Lfe1-CheckTileCollisionVertical\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CheckTileCollisionVertical # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CheckTileCollisionVertical` — benchmark function kleod:CheckTileCollisionVertical:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:CheckTileCollisionVertical:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckTileCollisionVertical\n\t.type\t CheckTileCollisionVertical,function\n\t.thumb_func\nCheckTileCollisionVertical:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x4\n\tmov\tip, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr1, r1, #0x10\n\tstr\tr1, [sp]\n\tlsl\tr2, r2, #0x10\n\tlsr\tr6, r2, #0x10\n\tlsl\tr3, r3, #0x18\n\tlsr\tr3, r3, #0x18\n\tmov\tr9, r3\n\tldr\tr0, .L10\n\tmov\tsl, r0\n\tldr\tr0, [r0]\n\tldrh\tr3, [r0, #0x2]\n\tldrh\tr1, [r0]\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n\tmov\tr8, r0\n\tlsl\tr0, r3, #0x1\n\tadd\tr0, r0, r3\n\tlsl\tr5, r0, #0x2\n.L6:\n\tmov\tr7, r8\n\tldr\tr0, [r7, #0x4]\n\tadd\tr2, r5, r0\n\tldrh\tr0, [r2, #0x2]\n\tcmp\tr6, r0\n\tbcc\t.L5\t@cond_branch\n\tldrh\tr1, [r2, #0x6]\n\tmov\tr7, r9\n\tsub\tr0, r6, r7\n\tcmp\tr1, r0\n\tblt\t.L5\t@cond_branch\n\tldrh\tr1, [r2]\n\tadd\tr0, r1, #0x3\n\tldr\tr7, [sp]\n\tcmp\tr7, r0\n\tbge\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x3\n\tcmp\tr0, r7\n\tbge\t.L5\t@cond_branch\n\tlsl\tr1, r0, #0x10\n\tlsr\tr1, r1, #0x10\n\tldr\tr0, .L10+0x4\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tldrb\tr1, [r2, #0x8]\n\tlsl\tr1, r1, #0x10\n\tldr\tr0, .L10+0x8\n\tand\tr4, r4, r0\n\torr\tr4, r4, r1\n\tmov\tr0, ip\n\tstr\tr4, [r0]\n\tb\t.L8\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03004D80\n\t.word\t-0x10000\n\t.word\t-0xff0001\n.L5:\n\tadd\tr5, r5, #0xc\n\tadd\tr3, r3, #0x1\n\tmov\tr1, sl\n\tldr\tr0, [r1]\n\tldrh\tr0, [r0]\n\tcmp\tr3, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L12\n\torr\tr4, r4, r0\n\tmov\tr7, ip\n\tstr\tr4, [r7]\n.L8:\n\tmov\tr0, ip\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t CheckTileCollisionVertical,.Lfe1-CheckTileCollisionVertical\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CheckTileCollisionVertical # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:CheckWorldCompletion:agbcc","sym":"CheckWorldCompletion","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","struct","nested-loop","bitwise","branch"],"loc":40,"refSource":"u8 CheckWorldCompletion(u8 arg0) {\n u32 var_r0;\n u32 var_r2;\n u8 var_sl;\n u8 var_ip;\n u8 var_r6;\n u8 var_r8;\n u8 v50;\n if (arg0 < 4) {\n if (((gUnk_03004670->unk8[arg0][7] & 0x80) != 0) && ((gUnk_03004670->unk8[arg0 + 1][0] & 0x7F) != 0x7F))\n return 1;\n } else if ((gUnk_03004670->unk8[5][7] & 0x80) != 0) {\n var_r8 = 0;\n var_ip = 0;\n var_r6 = 0;\n var_sl = 0;\n for (var_r0 = 0; var_r0 < 5; var_r0++) {\n for (var_r2 = 0; var_r2 < 7; var_r2++) {\n if ((var_r2 == 3 || var_r2 == 5) && (gUnk_03004670->unk8[var_r0][var_r2] & 0x7F) == 0x64)\n var_r8 += 1;\n else if ((var_r2 != 7) && ((gUnk_03004670->unk8[var_r0][var_r2] & 0x7F) == 0x1E))\n var_ip += 1;\n if (gUnk_03004670->unk8[var_r0][var_r2] & 0x80)\n var_r6 += 1;\n }\n }\n v50 = gUnk_03004670->unk8[5][0] & 0x7F;\n if (v50 == 0x1E)\n var_sl += 1;\n if ((gUnk_03004670->unk8[5][1] & 0x7F) == 0x1E)\n var_sl += 1;\n if ((arg0 == 4) && (v50 != 0x7F) && (var_r6 == 0x23))\n return 1;\n if ((arg0 == 5) && ((gUnk_03004670->unk8[5][1] & 0x7F) != 0x7F) && ((var_ip + var_r8) > 0x18))\n return 1;\n if ((arg0 == 6) && ((gUnk_03004670->unk8[5][2] & 0x7F) != 0x7F) && ((var_ip + var_r8 + var_sl) == 0x25))\n return 1;\n }\n return 0;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_3.c#L1752-L1791","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckWorldCompletion\n\t.type\t CheckWorldCompletion,function\n\t.thumb_func\nCheckWorldCompletion:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tcmp\tr0, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr0, .L30\n\tldr\tr2, [r0]\n\tmov\tr0, r9\n\tlsl\tr1, r0, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xf\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB26\n\tb\t.L5\t@long jump\n.LCB26:\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.LCB39\n\tb\t.L5\t@long jump\n.LCB39:\n.L29:\n\tmov\tr0, #0x1\n\tb\t.L27\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgUnk_03004670\n.L3:\n\tldr\tr2, .L32\n\tldr\tr0, [r2]\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB61\n\tb\t.L5\t@long jump\n.LCB61:\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tip, r1\n\tmov\tr6, #0x0\n\tmov\tsl, r6\n\tmov\tr0, #0x0\n\tadd\tr4, r2, #0\n\tmov\tr7, #0x7f\n.L10:\n\tmov\tr2, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr3, r0, #0x3\n.L14:\n\tcmp\tr2, #0x3\n\tbeq\t.L16\t@cond_branch\n\tcmp\tr2, #0x5\n\tbne\t.L15\t@cond_branch\n.L16:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L15\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr8, r0\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgUnk_03004670\n.L15:\n\tcmp\tr2, #0x7\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tip, r0\n.L17:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L13:\n\tadd\tr3, r3, #0x1\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, #0x6\n\tbls\t.L14\t@cond_branch\n\tadd\tr0, r5, #0\n\tcmp\tr0, #0x4\n\tbls\t.L10\t@cond_branch\n\tldr\tr0, .L34\n\tldr\tr1, [r0]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x30\n\tldrb\tr0, [r0]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L22\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L22:\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L23\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L23:\n\tmov\tr1, r9\n\tcmp\tr1, #0x4\n\tbne\t.L24\t@cond_branch\n\tcmp\tr3, #0x7f\n\tbeq\t.L24\t@cond_branch\n\tcmp\tr6, #0x23\n\tbeq\t.L29\t@cond_branch\n.L24:\n\tmov\tr0, r9\n\tcmp\tr0, #0x5\n\tbne\t.L25\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x18\n\tble\t.LCB220\n\tb\t.L29\t@long jump\n.LCB220:\n.L25:\n\tmov\tr0, r9\n\tcmp\tr0, #0x6\n\tbne\t.L5\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x32\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tcmp\tr0, #0x25\n\tbne\t.LCB240\n\tb\t.L29\t@long jump\n.LCB240:\n.L5:\n\tmov\tr0, #0x0\n.L27:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgUnk_03004670\n.Lfe1:\n\t.size\t CheckWorldCompletion,.Lfe1-CheckWorldCompletion\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'CheckWorldCompletion' — lift: cannot lift 'CheckWorldCompletion': branch target '.LCB39' is not a code block in this function (a data label, or outside the sliced function) */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tCheckWorldCompletion */\n/* \t.type\t CheckWorldCompletion,function */\n/* \t.thumb_func */\n/* CheckWorldCompletion: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, sl */\n/* \tmov\tr6, r9 */\n/* \tmov\tr5, r8 */\n/* \tpush\t{r5, r6, r7} */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tmov\tr9, r0 */\n/* \tcmp\tr0, #0x3 */\n/* \tbhi\t.L3\t@cond_branch */\n/* \tldr\tr0, .L30 */\n/* \tldr\tr2, [r0] */\n/* \tmov\tr0, r9 */\n/* \tlsl\tr1, r0, #0x3 */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0xf */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, #0x80 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.LCB26 */\n/* \tb\t.L5\t@long jump */\n/* .LCB26: */\n/* \tmov\tr1, r9 */\n/* \tadd\tr1, r1, #0x1 */\n/* \tlsl\tr1, r1, #0x3 */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x8 */\n/* \tadd\tr0, r0, r1 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbne\t.LCB39 */\n/* \tb\t.L5\t@long jump */\n/* .LCB39: */\n/* .L29: */\n/* \tmov\tr0, #0x1 */\n/* \tb\t.L27 */\n/* .L31: */\n/* \t.align\t2, 0 */\n/* .L30: */\n/* \t.word\tgUnk_03004670 */\n/* .L3: */\n/* \tldr\tr2, .L32 */\n/* \tldr\tr0, [r2] */\n/* \tadd\tr0, r0, #0x37 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, #0x80 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.LCB61 */\n/* \tb\t.L5\t@long jump */\n/* .LCB61: */\n/* \tmov\tr1, #0x0 */\n/* \tmov\tr8, r1 */\n/* \tmov\tip, r1 */\n/* \tmov\tr6, #0x0 */\n/* \tmov\tsl, r6 */\n/* \tmov\tr0, #0x0 */\n/* \tadd\tr4, r2, #0 */\n/* \tmov\tr7, #0x7f */\n/* .L10: */\n/* \tmov\tr2, #0x0 */\n/* \tadd\tr5, r0, #0x1 */\n/* \tlsl\tr3, r0, #0x3 */\n/* .L14: */\n/* \tcmp\tr2, #0x3 */\n/* \tbeq\t.L16\t@cond_branch */\n/* \tcmp\tr2, #0x5 */\n/* \tbne\t.L15\t@cond_branch */\n/* .L16: */\n/* \tldr\tr0, [r4] */\n/* \tadd\tr0, r0, #0x8 */\n/* \tadd\tr0, r0, r3 */\n/* \tldrb\tr1, [r0] */\n/* \tadd\tr0, r7, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x64 */\n/* \tbne\t.L15\t@cond_branch */\n/* \tmov\tr0, r8 */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tmov\tr8, r0 */\n/* \tb\t.L17 */\n/* .L33: */\n/* \t.align\t2, 0 */\n/* .L32: */\n/* \t.word\tgUnk_03004670 */\n/* .L15: */\n/* \tcmp\tr2, #0x7 */\n/* \tbeq\t.L17\t@cond_branch */\n/* \tldr\tr0, [r4] */\n/* \tadd\tr0, r0, #0x8 */\n/* \tadd\tr0, r0, r3 */\n/* \tldrb\tr1, [r0] */\n/* \tadd\tr0, r7, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x1e */\n/* \tbne\t.L17\t@cond_branch */\n/* \tmov\tr0, ip */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tmov\tip, r0 */\n/* .L17: */\n/* \tldr\tr0, [r4] */\n/* \tadd\tr0, r0, #0x8 */\n/* \tadd\tr0, r0, r3 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, #0x80 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L13\t@cond_branch */\n/* \tadd\tr0, r6, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr6, r0, #0x18 */\n/* .L13: */\n/* \tadd\tr3, r3, #0x1 */\n/* \tadd\tr2, r2, #0x1 */\n/* \tcmp\tr2, #0x6 */\n/* \tbls\t.L14\t@cond_branch */\n/* \tadd\tr0, r5, #0 */\n/* \tcmp\tr0, #0x4 */\n/* \tbls\t.L10\t@cond_branch */\n/* \tldr\tr0, .L34 */\n/* \tldr\tr1, [r0] */\n/* \tadd\tr0, r1, #0 */\n/* \tadd\tr0, r0, #0x30 */\n/* \tldrb\tr0, [r0] */\n/* \tmov\tr4, #0x7f */\n/* \tadd\tr3, r4, #0 */\n/* \tand\tr3, r3, r0 */\n/* \tcmp\tr3, #0x1e */\n/* \tbne\t.L22\t@cond_branch */\n/* \tmov\tr0, sl */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tmov\tsl, r0 */\n/* .L22: */\n/* \tadd\tr0, r1, #0 */\n/* \tadd\tr0, r0, #0x31 */\n/* \tldrb\tr1, [r0] */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x1e */\n/* \tbne\t.L23\t@cond_branch */\n/* \tmov\tr0, sl */\n/* \tadd\tr0, r0, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tmov\tsl, r0 */\n/* .L23: */\n/* \tmov\tr1, r9 */\n/* \tcmp\tr1, #0x4 */\n/* \tbne\t.L24\t@cond_branch */\n/* \tcmp\tr3, #0x7f */\n/* \tbeq\t.L24\t@cond_branch */\n/* \tcmp\tr6, #0x23 */\n/* \tbeq\t.L29\t@cond_branch */\n/* .L24: */\n/* \tmov\tr0, r9 */\n/* \tcmp\tr0, #0x5 */\n/* \tbne\t.L25\t@cond_branch */\n/* \tldr\tr1, .L34 */\n/* \tldr\tr0, [r1] */\n/* \tadd\tr0, r0, #0x31 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbeq\t.L25\t@cond_branch */\n/* \tmov\tr0, ip */\n/* \tadd\tr0, r0, r8 */\n/* \tcmp\tr0, #0x18 */\n/* \tble\t.LCB220 */\n/* \tb\t.L29\t@long jump */\n/* .LCB220: */\n/* .L25: */\n/* \tmov\tr0, r9 */\n/* \tcmp\tr0, #0x6 */\n/* \tbne\t.L5\t@cond_branch */\n/* \tldr\tr1, .L34 */\n/* \tldr\tr0, [r1] */\n/* \tadd\tr0, r0, #0x32 */\n/* \tldrb\tr1, [r0] */\n/* \tmov\tr0, #0x7f */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0x7f */\n/* \tbeq\t.L5\t@cond_branch */\n/* \tmov\tr0, ip */\n/* \tadd\tr0, r0, r8 */\n/* \tadd\tr0, r0, sl */\n/* \tcmp\tr0, #0x25 */\n/* \tbne\t.LCB240 */\n/* \tb\t.L29\t@long jump */\n/* .LCB240: */\n/* .L5: */\n/* \tmov\tr0, #0x0 */\n/* .L27: */\n/* \tpop\t{r3, r4, r5} */\n/* \tmov\tr8, r3 */\n/* \tmov\tr9, r4 */\n/* \tmov\tsl, r5 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .L35: */\n/* \t.align\t2, 0 */\n/* .L34: */\n/* \t.word\tgUnk_03004670 */\n/* .Lfe1: */\n/* \t.size\t CheckWorldCompletion,.Lfe1-CheckWorldCompletion */\n/* .text */\n/* \t.align\t2, 0 */\nvoid CheckWorldCompletion(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'CheckWorldCompletion': branch target '.LCB39' is not a code block in this function (a data label, or outside the sliced function)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":232,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'CheckWorldCompletion': branch target '.LCB39' is not a code block in this function (a data label, or outside the sliced function)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern void *gUnk_03004670;\n\ns32 CheckWorldCompletion(u8 arg0) {\n s32 temp_r3;\n s32 var_r3;\n u32 var_r0;\n u32 var_r2;\n u32 var_sl;\n u8 temp_r0;\n u8 var_ip;\n u8 var_r6;\n u8 var_r8;\n\n temp_r0 = arg0;\n if ((u32) temp_r0 <= 3U) {\n if (!(0x80 & *(gUnk_03004670 + 0xF + (temp_r0 * 8)))) {\n goto block_36;\n }\n if ((0x7F & *(gUnk_03004670 + 8 + ((temp_r0 + 1) * 8))) == 0x7F) {\n goto block_36;\n }\n goto block_5;\n }\n if (!(0x80 & gUnk_03004670->unk37)) {\n goto block_36;\n }\n var_r8 = 0;\n var_ip = 0;\n var_r6 = 0;\n var_sl = 0;\n var_r0 = 0;\n do {\n var_r2 = 0;\n var_r3 = var_r0 * 8;\nloop_10:\n switch (var_r2) { /* switch 1; irregular */\n case 7: /* switch 1 */\n break;\n case 3: /* switch 1 */\n case 5: /* switch 1 */\n if ((0x7F & *(gUnk_03004670 + 8 + var_r3)) == 0x64) {\n var_r8 += 1;\n } else if ((var_r2 != 7) && ((0x7F & *(gUnk_03004670 + 8 + var_r3)) == 0x1E)) {\n var_ip += 1;\n }\n break;\n }\n if (0x80 & *(gUnk_03004670 + 8 + var_r3)) {\n var_r6 += 1;\n }\n var_r3 += 1;\n var_r2 += 1;\n if (var_r2 <= 6U) {\n goto loop_10;\n }\n var_r0 += 1;\n } while (var_r0 <= 4U);\n temp_r3 = 0x7F & gUnk_03004670->unk30;\n if (temp_r3 == 0x1E) {\n var_sl = 0x01000000U >> 0x18;\n }\n if ((0x7F & gUnk_03004670->unk31) == 0x1E) {\n var_sl = (u32) (u8) (var_sl + 1);\n }\n switch (temp_r0) { /* switch 2; irregular */\n case 4: /* switch 2 */\n if ((temp_r3 == 0x7F) || (var_r6 != 0x23)) {\n if ((temp_r0 == 5) && ((0x7F & gUnk_03004670->unk31) != 0x7F) && ((s32) (var_ip + var_r8) > 0x18)) {\n goto block_5;\n }\n if ((temp_r0 == 6) && ((0x7F & gUnk_03004670->unk32) != 0x7F) && ((var_ip + var_r8 + var_sl) == 0x25)) {\n goto block_5;\n }\nblock_36:\n return 0;\n }\nblock_5:\n return 1;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":60,"lines":78,"gotos":7,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1072: conflicting types for `gUnk_03004670'","/c.c:312: previous declaration of `gUnk_03004670'","/c.c:1087: warning: dereferencing `void *' pointer","/c.c:1087: void value not ignored as it ought to be","/c.c:1090: warning: dereferencing `void *' pointer"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CheckWorldCompletion` — benchmark function kleod:CheckWorldCompletion:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckWorldCompletion\n\t.type\t CheckWorldCompletion,function\n\t.thumb_func\nCheckWorldCompletion:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tcmp\tr0, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr0, .L30\n\tldr\tr2, [r0]\n\tmov\tr0, r9\n\tlsl\tr1, r0, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xf\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB26\n\tb\t.L5\t@long jump\n.LCB26:\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.LCB39\n\tb\t.L5\t@long jump\n.LCB39:\n.L29:\n\tmov\tr0, #0x1\n\tb\t.L27\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgUnk_03004670\n.L3:\n\tldr\tr2, .L32\n\tldr\tr0, [r2]\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB61\n\tb\t.L5\t@long jump\n.LCB61:\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tip, r1\n\tmov\tr6, #0x0\n\tmov\tsl, r6\n\tmov\tr0, #0x0\n\tadd\tr4, r2, #0\n\tmov\tr7, #0x7f\n.L10:\n\tmov\tr2, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr3, r0, #0x3\n.L14:\n\tcmp\tr2, #0x3\n\tbeq\t.L16\t@cond_branch\n\tcmp\tr2, #0x5\n\tbne\t.L15\t@cond_branch\n.L16:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L15\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr8, r0\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgUnk_03004670\n.L15:\n\tcmp\tr2, #0x7\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tip, r0\n.L17:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L13:\n\tadd\tr3, r3, #0x1\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, #0x6\n\tbls\t.L14\t@cond_branch\n\tadd\tr0, r5, #0\n\tcmp\tr0, #0x4\n\tbls\t.L10\t@cond_branch\n\tldr\tr0, .L34\n\tldr\tr1, [r0]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x30\n\tldrb\tr0, [r0]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L22\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L22:\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L23\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L23:\n\tmov\tr1, r9\n\tcmp\tr1, #0x4\n\tbne\t.L24\t@cond_branch\n\tcmp\tr3, #0x7f\n\tbeq\t.L24\t@cond_branch\n\tcmp\tr6, #0x23\n\tbeq\t.L29\t@cond_branch\n.L24:\n\tmov\tr0, r9\n\tcmp\tr0, #0x5\n\tbne\t.L25\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x18\n\tble\t.LCB220\n\tb\t.L29\t@long jump\n.LCB220:\n.L25:\n\tmov\tr0, r9\n\tcmp\tr0, #0x6\n\tbne\t.L5\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x32\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tcmp\tr0, #0x25\n\tbne\t.LCB240\n\tb\t.L29\t@long jump\n.LCB240:\n.L5:\n\tmov\tr0, #0x0\n.L27:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgUnk_03004670\n.Lfe1:\n\t.size\t CheckWorldCompletion,.Lfe1-CheckWorldCompletion\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CheckWorldCompletion # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CheckWorldCompletion` — benchmark function kleod:CheckWorldCompletion:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:CheckWorldCompletion:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCheckWorldCompletion\n\t.type\t CheckWorldCompletion,function\n\t.thumb_func\nCheckWorldCompletion:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tcmp\tr0, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr0, .L30\n\tldr\tr2, [r0]\n\tmov\tr0, r9\n\tlsl\tr1, r0, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0xf\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB26\n\tb\t.L5\t@long jump\n.LCB26:\n\tmov\tr1, r9\n\tadd\tr1, r1, #0x1\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbne\t.LCB39\n\tb\t.L5\t@long jump\n.LCB39:\n.L29:\n\tmov\tr0, #0x1\n\tb\t.L27\n.L31:\n\t.align\t2, 0\n.L30:\n\t.word\tgUnk_03004670\n.L3:\n\tldr\tr2, .L32\n\tldr\tr0, [r2]\n\tadd\tr0, r0, #0x37\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbne\t.LCB61\n\tb\t.L5\t@long jump\n.LCB61:\n\tmov\tr1, #0x0\n\tmov\tr8, r1\n\tmov\tip, r1\n\tmov\tr6, #0x0\n\tmov\tsl, r6\n\tmov\tr0, #0x0\n\tadd\tr4, r2, #0\n\tmov\tr7, #0x7f\n.L10:\n\tmov\tr2, #0x0\n\tadd\tr5, r0, #0x1\n\tlsl\tr3, r0, #0x3\n.L14:\n\tcmp\tr2, #0x3\n\tbeq\t.L16\t@cond_branch\n\tcmp\tr2, #0x5\n\tbne\t.L15\t@cond_branch\n.L16:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x64\n\tbne\t.L15\t@cond_branch\n\tmov\tr0, r8\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr8, r0\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgUnk_03004670\n.L15:\n\tcmp\tr2, #0x7\n\tbeq\t.L17\t@cond_branch\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tadd\tr0, r7, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L17\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tip, r0\n.L17:\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x8\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x80\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L13:\n\tadd\tr3, r3, #0x1\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, #0x6\n\tbls\t.L14\t@cond_branch\n\tadd\tr0, r5, #0\n\tcmp\tr0, #0x4\n\tbls\t.L10\t@cond_branch\n\tldr\tr0, .L34\n\tldr\tr1, [r0]\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x30\n\tldrb\tr0, [r0]\n\tmov\tr4, #0x7f\n\tadd\tr3, r4, #0\n\tand\tr3, r3, r0\n\tcmp\tr3, #0x1e\n\tbne\t.L22\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L22:\n\tadd\tr0, r1, #0\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x1e\n\tbne\t.L23\t@cond_branch\n\tmov\tr0, sl\n\tadd\tr0, r0, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tsl, r0\n.L23:\n\tmov\tr1, r9\n\tcmp\tr1, #0x4\n\tbne\t.L24\t@cond_branch\n\tcmp\tr3, #0x7f\n\tbeq\t.L24\t@cond_branch\n\tcmp\tr6, #0x23\n\tbeq\t.L29\t@cond_branch\n.L24:\n\tmov\tr0, r9\n\tcmp\tr0, #0x5\n\tbne\t.L25\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x31\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L25\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tcmp\tr0, #0x18\n\tble\t.LCB220\n\tb\t.L29\t@long jump\n.LCB220:\n.L25:\n\tmov\tr0, r9\n\tcmp\tr0, #0x6\n\tbne\t.L5\t@cond_branch\n\tldr\tr1, .L34\n\tldr\tr0, [r1]\n\tadd\tr0, r0, #0x32\n\tldrb\tr1, [r0]\n\tmov\tr0, #0x7f\n\tand\tr0, r0, r1\n\tcmp\tr0, #0x7f\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, ip\n\tadd\tr0, r0, r8\n\tadd\tr0, r0, sl\n\tcmp\tr0, #0x25\n\tbne\t.LCB240\n\tb\t.L29\t@long jump\n.LCB240:\n.L5:\n\tmov\tr0, #0x0\n.L27:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgUnk_03004670\n.Lfe1:\n\t.size\t CheckWorldCompletion,.Lfe1-CheckWorldCompletion\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CheckWorldCompletion # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:CopyBGScrollTiles:agbcc","sym":"CopyBGScrollTiles","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","array","loop","branch"],"loc":16,"refSource":"void CopyBGScrollTiles(void) {\n u32 var_r5;\n u32 var_r6;\n\n for (var_r6 = 0; var_r6 < 3; var_r6++) {\n if (var_r6 < gUnk_03005220.hearts) {\n var_r5 = 0;\n } else {\n var_r5 = 2;\n }\n gBgTilemapBufs[0][(var_r6 * 2) + 0x241] = gBgTilemapBufs[0][(var_r6 * 2) + ((var_r5 + 0x14) << 5)];\n gBgTilemapBufs[0][(var_r6 * 2) + 0x242] = gBgTilemapBufs[0][(var_r6 * 2 + 1) + ((var_r5 + 0x14) << 5)];\n gBgTilemapBufs[0][(var_r6 * 2) + 0x261] = gBgTilemapBufs[0][(var_r6 * 2) + ((var_r5 + 0x15) << 5)];\n gBgTilemapBufs[0][(var_r6 * 2) + 0x262] = gBgTilemapBufs[0][(var_r6 * 2 + 1) + ((var_r5 + 0x15) << 5)];\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_1.c#L1165-L1180","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCopyBGScrollTiles\n\t.type\t CopyBGScrollTiles,function\n\t.thumb_func\nCopyBGScrollTiles:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr6, #0x0\n\tldr\tr7, .L10\n\tldr\tr4, .L10+0x4\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x1e\n\tlsr\tr0, r0, #0x1e\n\tmov\tr5, #0x2\n\tcmp\tr6, r0\n\tbcs\t.L7\t@cond_branch\n\tmov\tr5, #0x0\n.L7:\n\tlsl\tr3, r6, #0x1\n\tldr\tr0, .L10+0x8\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r5, #0\n\tadd\tr1, r1, #0x14\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0xc\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r1, #0x1\n\tadd\tr1, r3, r1\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tldrh\tr0, [r1]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0x10\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r5, #0\n\tadd\tr2, r2, #0x15\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r3, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L10+0x14\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r4\n\tldrh\tr0, [r3]\n\tstrh\tr0, [r1]\n\tadd\tr6, r6, #0x1\n\tcmp\tr6, #0x2\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x241\n\t.word\t0x242\n\t.word\t0x261\n\t.word\t0x262\n.Lfe1:\n\t.size\t CopyBGScrollTiles,.Lfe1-CopyBGScrollTiles\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","droppedCandidates":[{"label":"unsigned/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-GigbUY/c.c:1078: invalid operands to binary <<"}],"symbolsUsed":[{"name":"gBgTilemapBufs","shape":"u16[]"},{"name":"gUnk_03005220","shape":"struct Unk_03005220 (100 B)"}],"outcome":"nonmatch","source":"s32 CopyBGScrollTiles(void) {\n s32 v0;\n u32 v1;\n s32 v2;\n v1 = 0;\n do {\n if (v1 >= (u32)(*(u8 *)&gUnk_03005220 << 30) >> 30) {\n v2 = 2;\n } else {\n v2 = 0;\n }\n gBgTilemapBufs[0][(v1 << 1) + 577] = gBgTilemapBufs[0][(v1 << 1) + (v2 + 20 << 5)];\n gBgTilemapBufs[0][(v1 << 1) + 578] = gBgTilemapBufs[0][(v1 << 1) + ((v2 + 20 << 5) + 1)];\n gBgTilemapBufs[0][(v1 << 1) + 609] = gBgTilemapBufs[0][(v1 << 1) + (v2 + 21 << 5)];\n v0 = gBgTilemapBufs[0][(v1 << 1) + ((v2 + 21 << 5) + 1)];\n gBgTilemapBufs[0][(v1 << 1) + 610] = v0;\n v1 = v1 + 1;\n } while (v1 <= 2);\n return v0;\n}\n","score":32,"maxScore":74,"compileErrors":null,"breakdown":{"insert":6,"delete":4,"replace":1,"opMismatch":1,"argMismatch":20},"quality":{"score":98,"lines":20,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void CopyBGScrollTiles(void) {\n s32 temp_r1;\n s32 temp_r2;\n s32 temp_r3;\n s32 var_r5;\n u32 var_r6;\n\n var_r6 = 0;\n do {\n var_r5 = 2;\n if (var_r6 < (u32) ((u32) (gUnk_03005220 << 0x1E) >> 0x1E)) {\n var_r5 = 0;\n }\n temp_r3 = var_r6 * 2;\n temp_r1 = (var_r5 + 0x14) << 5;\n (*gBgTilemapBufs)[temp_r3 + 0x241] = (*gBgTilemapBufs)[temp_r3 + temp_r1];\n (*gBgTilemapBufs)[temp_r3 + 0x242] = (*gBgTilemapBufs)[temp_r3 + (temp_r1 + 1)];\n temp_r2 = (var_r5 + 0x15) << 5;\n (*gBgTilemapBufs)[temp_r3 + 0x261] = (*gBgTilemapBufs)[temp_r3 + temp_r2];\n (*gBgTilemapBufs)[temp_r3 + 0x262] = (*gBgTilemapBufs)[temp_r3 + (temp_r2 + 1)];\n var_r6 += 1;\n } while (var_r6 <= 2U);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":98,"lines":22,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1082: invalid operands to binary <<"]},"gapSize":{"decompiler":"asmlift","score":32,"maxScore":74,"ratio":0.43243243243243246,"kinds":{"insert":6,"delete":4,"replace":1,"opMismatch":1,"argMismatch":20}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CopyBGScrollTiles` — benchmark function kleod:CopyBGScrollTiles:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCopyBGScrollTiles\n\t.type\t CopyBGScrollTiles,function\n\t.thumb_func\nCopyBGScrollTiles:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr6, #0x0\n\tldr\tr7, .L10\n\tldr\tr4, .L10+0x4\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x1e\n\tlsr\tr0, r0, #0x1e\n\tmov\tr5, #0x2\n\tcmp\tr6, r0\n\tbcs\t.L7\t@cond_branch\n\tmov\tr5, #0x0\n.L7:\n\tlsl\tr3, r6, #0x1\n\tldr\tr0, .L10+0x8\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r5, #0\n\tadd\tr1, r1, #0x14\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0xc\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r1, #0x1\n\tadd\tr1, r3, r1\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tldrh\tr0, [r1]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0x10\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r5, #0\n\tadd\tr2, r2, #0x15\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r3, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L10+0x14\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r4\n\tldrh\tr0, [r3]\n\tstrh\tr0, [r1]\n\tadd\tr6, r6, #0x1\n\tcmp\tr6, #0x2\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x241\n\t.word\t0x242\n\t.word\t0x261\n\t.word\t0x262\n.Lfe1:\n\t.size\t CopyBGScrollTiles,.Lfe1-CopyBGScrollTiles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid CopyBGScrollTiles(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CopyBGScrollTiles # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CopyBGScrollTiles` — benchmark function kleod:CopyBGScrollTiles:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:CopyBGScrollTiles:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCopyBGScrollTiles\n\t.type\t CopyBGScrollTiles,function\n\t.thumb_func\nCopyBGScrollTiles:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr6, #0x0\n\tldr\tr7, .L10\n\tldr\tr4, .L10+0x4\n.L6:\n\tldrb\tr0, [r7]\n\tlsl\tr0, r0, #0x1e\n\tlsr\tr0, r0, #0x1e\n\tmov\tr5, #0x2\n\tcmp\tr6, r0\n\tbcs\t.L7\t@cond_branch\n\tmov\tr5, #0x0\n.L7:\n\tlsl\tr3, r6, #0x1\n\tldr\tr0, .L10+0x8\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r5, #0\n\tadd\tr1, r1, #0x14\n\tlsl\tr1, r1, #0x5\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0xc\n\tadd\tr2, r3, r0\n\tlsl\tr2, r2, #0x1\n\tadd\tr2, r2, r4\n\tadd\tr1, r1, #0x1\n\tadd\tr1, r3, r1\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tldrh\tr0, [r1]\n\tstrh\tr0, [r2]\n\tldr\tr0, .L10+0x10\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r5, #0\n\tadd\tr2, r2, #0x15\n\tlsl\tr2, r2, #0x5\n\tadd\tr0, r3, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r4\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L10+0x14\n\tadd\tr1, r3, r0\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r4\n\tadd\tr2, r2, #0x1\n\tadd\tr3, r3, r2\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r4\n\tldrh\tr0, [r3]\n\tstrh\tr0, [r1]\n\tadd\tr6, r6, #0x1\n\tcmp\tr6, #0x2\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x241\n\t.word\t0x242\n\t.word\t0x261\n\t.word\t0x262\n.Lfe1:\n\t.size\t CopyBGScrollTiles,.Lfe1-CopyBGScrollTiles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CopyBGScrollTiles # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:Decompress:agbcc","sym":"Decompress","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["branch","bitwise","cast","call","memory"],"loc":12,"refSource":"void Decompress(void *dest, void *src) {\n void *heapPtr;\n\n if (((u32 *)src)[0] & 0x80000000) {\n heapPtr = thunk_HeapAlloc(((u32 *)src)[1] >> 8, 0);\n HuffUnComp((u8 *)src + 4, heapPtr);\n LZ77UnCompWram(heapPtr, dest);\n thunk_HeapFree(heapPtr);\n } else {\n LZ77UnCompWram((u8 *)src + 4, dest);\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L110-L121","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompress\n\t.type\t Decompress,function\n\t.thumb_func\nDecompress:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tldr\tr0, [r5]\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tldr\tr0, [r5, #0x4]\n\tlsr\tr0, r0, #0x8\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r4, #0\n\tbl\tHuffUnComp\n\tadd\tr0, r4, #0\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n\tadd\tr0, r4, #0\n\tbl\tthunk_HeapFree\n\tb\t.L4\n.L3:\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n.L4:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t Decompress,.Lfe1-Decompress\n\n.text\n\t.align\t2, 0\n","ctx":"void *thunk_HeapAlloc(u32, u32);\nvoid thunk_HeapFree(void *);\nvoid HuffUnComp(void *, void *);\nvoid LZ77UnCompWram(void *, void *);","proto":{"Decompress":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void Decompress(u32 a0, s32 * a1) {\n s32 v0;\n s32 v1;\n if (*a1 >= 0) {\n v1 = LZ77UnCompWram(a1 + 1, a0);\n } else {\n v0 = thunk_HeapAlloc((u32)a1[1] >> 8, 0);\n HuffUnComp(a1 + 1, v0);\n LZ77UnCompWram(v0, a0);\n v1 = thunk_HeapFree(v0, a0);\n }\n return;\n}\n","score":9,"maxScore":30,"compileErrors":null,"breakdown":{"insert":4,"delete":3,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":13,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Decompress(void *arg0, void *arg1) {\n void *temp_r0;\n\n if ((s32) arg1->unk0 < 0) {\n temp_r0 = thunk_HeapAlloc((u32) arg1->unk4 >> 8, 0U);\n HuffUnComp(arg1 + 4, temp_r0);\n LZ77UnCompWram(temp_r0, arg0);\n thunk_HeapFree(temp_r0);\n return;\n }\n LZ77UnCompWram(arg1 + 4, arg0);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":11,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1075: warning: dereferencing `void *' pointer","/c.c:1075: request for member `unk0' in something not a structure or union","/c.c:1076: warning: implicit declaration of function `thunk_HeapAlloc'","/c.c:1076: warning: dereferencing `void *' pointer","/c.c:1076: request for member `unk4' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":9,"maxScore":30,"ratio":0.3,"kinds":{"insert":4,"delete":3,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Decompress` — benchmark function kleod:Decompress:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompress\n\t.type\t Decompress,function\n\t.thumb_func\nDecompress:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tldr\tr0, [r5]\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tldr\tr0, [r5, #0x4]\n\tlsr\tr0, r0, #0x8\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r4, #0\n\tbl\tHuffUnComp\n\tadd\tr0, r4, #0\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n\tadd\tr0, r4, #0\n\tbl\tthunk_HeapFree\n\tb\t.L4\n.L3:\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n.L4:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t Decompress,.Lfe1-Decompress\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid *thunk_HeapAlloc(u32, u32);\nvoid thunk_HeapFree(void *);\nvoid HuffUnComp(void *, void *);\nvoid LZ77UnCompWram(void *, void *);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Decompress # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Decompress` — benchmark function kleod:Decompress:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:Decompress:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompress\n\t.type\t Decompress,function\n\t.thumb_func\nDecompress:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tldr\tr0, [r5]\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tldr\tr0, [r5, #0x4]\n\tlsr\tr0, r0, #0x8\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r4, #0\n\tbl\tHuffUnComp\n\tadd\tr0, r4, #0\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n\tadd\tr0, r4, #0\n\tbl\tthunk_HeapFree\n\tb\t.L4\n.L3:\n\tadd\tr0, r5, #0x4\n\tadd\tr1, r6, #0\n\tbl\tLZ77UnCompWram\n.L4:\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t Decompress,.Lfe1-Decompress\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"Decompress\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Decompress # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:DecompressAlloc:agbcc","sym":"DecompressAlloc","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["call","cast","bitwise","memory","pointer"],"loc":7,"refSource":"void *DecompressAlloc(void *src) {\n void *heapPtr;\n\n heapPtr = thunk_HeapAlloc(((u32 *)src)[0] & 0x7FFFFFFF, 0);\n Decompress(heapPtr, src);\n return heapPtr;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L142-L148","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressAlloc\n\t.type\t DecompressAlloc,function\n\t.thumb_func\nDecompressAlloc:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tldr\tr0, [r5]\n\tldr\tr1, .L3\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x7fffffff\n.Lfe1:\n\t.size\t DecompressAlloc,.Lfe1-DecompressAlloc\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-bbb0f9d88b2b.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 DecompressAlloc(s32 * a0) {\n s32 v0;\n v0 = thunk_HeapAlloc(*a0 & 2147483647, 0);\n Decompress(v0, a0);\n return v0;\n}\n","score":0,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *DecompressAlloc(void *src) {\n void *temp_r0;\n\n temp_r0 = thunk_HeapAlloc(*src & 0x7FFFFFFF, 0U);\n Decompress(temp_r0, src);\n return temp_r0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1077: warning: dereferencing `void *' pointer","/c.c:1077: void value not ignored as it ought to be"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `DecompressAlloc` — benchmark function kleod:DecompressAlloc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressAlloc\n\t.type\t DecompressAlloc,function\n\t.thumb_func\nDecompressAlloc:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tldr\tr0, [r5]\n\tldr\tr1, .L3\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x7fffffff\n.Lfe1:\n\t.size\t DecompressAlloc,.Lfe1-DecompressAlloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-bbb0f9d88b2b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *DecompressAlloc(void *src);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DecompressAlloc # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `DecompressAlloc` — benchmark function kleod:DecompressAlloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DecompressAlloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressAlloc\n\t.type\t DecompressAlloc,function\n\t.thumb_func\nDecompressAlloc:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tldr\tr0, [r5]\n\tldr\tr1, .L3\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr4, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x7fffffff\n.Lfe1:\n\t.size\t DecompressAlloc,.Lfe1-DecompressAlloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DecompressAlloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:DecompressDma:agbcc","sym":"DecompressDma","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["call","bitwise","cast","memory","dma"],"loc":8,"refSource":"void DecompressDma(void *src, void *dest, u16 size) {\n void *heapPtr;\n\n heapPtr = thunk_HeapAlloc(((u32 *)src)[0] & 0x7FFFFFFF, 0);\n Decompress(heapPtr, src);\n DmaCopy16Wait(3, (u8 *)heapPtr + 4, dest, size);\n thunk_HeapFree(heapPtr);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L129-L136","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressDma\n\t.type\t DecompressDma,function\n\t.thumb_func\nDecompressDma:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr5, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr4, r2, #0x10\n\tldr\tr0, [r5]\n\tldr\tr1, .L7\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr7, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tldr\tr1, .L7+0x4\n\tadd\tr0, r7, #0x4\n\tstr\tr0, [r1]\n\tstr\tr6, [r1, #0x4]\n\tlsr\tr4, r4, #0x11\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\torr\tr4, r4, r2\n\tstr\tr4, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n.L3:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r7, #0\n\tbl\tthunk_HeapFree\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x7fffffff\n\t.word\t0x40000d4\n.Lfe1:\n\t.size\t DecompressDma,.Lfe1-DecompressDma\n\n.text\n\t.align\t2, 0\n","ctx":"void *thunk_HeapAlloc(u32, u32);\nvoid thunk_HeapFree(void *);\nvoid Decompress(void *, void *);","proto":{"DecompressDma":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void DecompressDma(s32 * a0, u32 a1, u32 a2) {\n s32 v0;\n v0 = thunk_HeapAlloc(*a0 & 2147483647, 0, a2);\n Decompress(v0, a0);\n *(s32 *)67109076 = v0 + 4;\n ((s32 *)67109076)[1] = a1;\n ((s32 *)67109076)[2] = a2 << 16 >> 17 | 128 << 24;\n do {\n } while ((((s32 *)67109076)[2] & 128 << 24) != 0);\n thunk_HeapFree(v0, 67109076, 128 << 24);\n return;\n}\n","score":19,"maxScore":40,"compileErrors":null,"breakdown":{"insert":7,"delete":2,"replace":1,"opMismatch":0,"argMismatch":9},"quality":{"score":96,"lines":12,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void DecompressDma(s32 *arg0, s32 arg1, s32 arg2) {\n void *temp_r0;\n\n temp_r0 = thunk_HeapAlloc(*arg0 & 0x7FFFFFFF, 0U);\n Decompress(temp_r0, arg0);\n (void *)0x040000D4->unk0 = (void *) (temp_r0 + 4);\n (void *)0x040000D4->unk4 = arg1;\n (void *)0x040000D4->unk8 = (s32) (((u32) (arg2 << 0x10) >> 0x11) | 0x80000000);\n do {\n\n } while ((void *)0x040000D4->unk8 & 0x80000000);\n thunk_HeapFree(temp_r0);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":90,"lines":11,"gotos":0,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1075: warning: implicit declaration of function `thunk_HeapAlloc'","/c.c:1075: warning: assignment makes pointer from integer without a cast","/c.c:1076: warning: implicit declaration of function `Decompress'","/c.c:1077: invalid type argument of `->'","/c.c:1078: invalid type argument of `->'"]},"gapSize":{"decompiler":"asmlift","score":19,"maxScore":40,"ratio":0.475,"kinds":{"insert":7,"delete":2,"replace":1,"opMismatch":0,"argMismatch":9}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `DecompressDma` — benchmark function kleod:DecompressDma:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressDma\n\t.type\t DecompressDma,function\n\t.thumb_func\nDecompressDma:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr5, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr4, r2, #0x10\n\tldr\tr0, [r5]\n\tldr\tr1, .L7\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr7, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tldr\tr1, .L7+0x4\n\tadd\tr0, r7, #0x4\n\tstr\tr0, [r1]\n\tstr\tr6, [r1, #0x4]\n\tlsr\tr4, r4, #0x11\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\torr\tr4, r4, r2\n\tstr\tr4, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n.L3:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r7, #0\n\tbl\tthunk_HeapFree\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x7fffffff\n\t.word\t0x40000d4\n.Lfe1:\n\t.size\t DecompressDma,.Lfe1-DecompressDma\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid *thunk_HeapAlloc(u32, u32);\nvoid thunk_HeapFree(void *);\nvoid Decompress(void *, void *);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DecompressDma # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `DecompressDma` — benchmark function kleod:DecompressDma:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DecompressDma:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDecompressDma\n\t.type\t DecompressDma,function\n\t.thumb_func\nDecompressDma:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr5, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr4, r2, #0x10\n\tldr\tr0, [r5]\n\tldr\tr1, .L7\n\tand\tr0, r0, r1\n\tmov\tr1, #0x0\n\tbl\tthunk_HeapAlloc\n\tadd\tr7, r0, #0\n\tadd\tr1, r5, #0\n\tbl\tDecompress\n\tldr\tr1, .L7+0x4\n\tadd\tr0, r7, #0x4\n\tstr\tr0, [r1]\n\tstr\tr6, [r1, #0x4]\n\tlsr\tr4, r4, #0x11\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x18\n\torr\tr4, r4, r2\n\tstr\tr4, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n.L3:\n\tldr\tr0, [r1, #0x8]\n\tand\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r7, #0\n\tbl\tthunk_HeapFree\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x7fffffff\n\t.word\t0x40000d4\n.Lfe1:\n\t.size\t DecompressDma,.Lfe1-DecompressDma\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"DecompressDma\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DecompressDma # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:DivideQ4:agbcc","sym":"DivideQ4","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div","shift"],"loc":3,"refSource":"s16 DivideQ4(s16 num1, s16 num2) {\n return ((num1 << 4) / num2);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L42-L44","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ4\n\t.type\t DivideQ4,function\n\t.thumb_func\nDivideQ4:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0xc\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ4,.Lfe1-DivideQ4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 DivideQ4(s32 a0, s32 a1) {\n return (s16)((a0 << 16 >> 12) / (s16)a1);\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s16 DivideQ4(s32 arg0, s16 arg1) {\n return (s16) ((s32) ((s32) (arg0 << 0x10) >> 0xC) / arg1);\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":98,"lines":3,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `DivideQ4` — benchmark function kleod:DivideQ4:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ4\n\t.type\t DivideQ4,function\n\t.thumb_func\nDivideQ4:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0xc\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ4,.Lfe1-DivideQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DivideQ4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `DivideQ4` — benchmark function kleod:DivideQ4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DivideQ4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ4\n\t.type\t DivideQ4,function\n\t.thumb_func\nDivideQ4:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0xc\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ4,.Lfe1-DivideQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DivideQ4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:DivideQ8:agbcc","sym":"DivideQ8","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div","shift"],"loc":3,"refSource":"s16 DivideQ8(s16 num1, s16 num2) {\n return (num1 << 8) / num2;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L11-L13","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ8\n\t.type\t DivideQ8,function\n\t.thumb_func\nDivideQ8:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ8,.Lfe1-DivideQ8\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 DivideQ8(s32 a0, s32 a1) {\n return (s16)((a0 << 16 >> 8) / (s16)a1);\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s16 DivideQ8(s32 arg0, s16 arg1) {\n return (s16) ((s32) ((s32) (arg0 << 0x10) >> 8) / arg1);\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":98,"lines":3,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `DivideQ8` — benchmark function kleod:DivideQ8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ8\n\t.type\t DivideQ8,function\n\t.thumb_func\nDivideQ8:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ8,.Lfe1-DivideQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DivideQ8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `DivideQ8` — benchmark function kleod:DivideQ8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DivideQ8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDivideQ8\n\t.type\t DivideQ8,function\n\t.thumb_func\nDivideQ8:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t DivideQ8,.Lfe1-DivideQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DivideQ8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:DmaSpriteToObjVram:agbcc","sym":"DmaSpriteToObjVram","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["pointer","mmio","dma","cast","memory"],"loc":12,"refSource":"void DmaSpriteToObjVram(u32 entryIdx, u32 frameIdx) {\n vu32 *dma3 = ®_DMA3SAD;\n u32 base = *(vu32 *)&gGfxStreamBuffer;\n u8 *entry = (u8 *)(entryIdx * 8 + base);\n u16 tileCount = *(u16 *)(entry + 6);\n dma3[0] = *(u32 *)entry + tileCount * (frameIdx << 5);\n\n dma3[1] = (u32) * (u16 *)(entry + 4) * 32 + OBJ_VRAM;\n\n dma3[2] = (*(u16 *)(entry + 6) << 4) | (0x80 << 24);\n dma3[2];\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L349-L360","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDmaSpriteToObjVram\n\t.type\t DmaSpriteToObjVram,function\n\t.thumb_func\nDmaSpriteToObjVram:\n\tldr\tr3, .L3\n\tldr\tr2, .L3+0x4\n\tldr\tr2, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r2\n\tldrh\tr2, [r0, #0x6]\n\tlsl\tr1, r1, #0x5\n\tmul\tr2, r2, r1\n\tldr\tr1, [r0]\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3]\n\tldrh\tr1, [r0, #0x4]\n\tlsl\tr1, r1, #0x5\n\tldr\tr2, .L3+0x8\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3, #0x4]\n\tldrh\tr0, [r0, #0x6]\n\tlsl\tr0, r0, #0x4\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r3, #0x8]\n\tldr\tr0, [r3, #0x8]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x40000d4\n\t.word\t0x30007c8\n\t.word\t0x6010000\n.Lfe1:\n\t.size\t DmaSpriteToObjVram,.Lfe1-DmaSpriteToObjVram\n\n.text\n\t.align\t2, 0\n","proto":{"DmaSpriteToObjVram":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gGfxStreamBuffer","shape":"scalar u32"}],"outcome":"nonmatch","source":"struct Elem0 { s32 field_0; u16 field_4; u16 field_6; };\nvoid DmaSpriteToObjVram(u32 a0, u32 a1) {\n struct Elem0 * v0;\n s32 * p0;\n p0 = (s32 *)67109076;\n v0 = gGfxStreamBuffer;\n *p0 = v0[a0].field_0 + v0[a0].field_6 * (a1 << 5);\n p0[1] = (v0[a0].field_4 << 5) + 100728832;\n p0[2] = v0[a0].field_6 << 4 | 128 << 24;\n return;\n}\n","score":5,"maxScore":28,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":11,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 DmaSpriteToObjVram(s32 arg0, s32 arg1) {\n void *temp_r0;\n\n temp_r0 = (arg0 * 8) + *(s32 *)0x030007C8;\n (void *)0x040000D4->unk0 = (s32) (temp_r0->unk0 + (temp_r0->unk6 * (arg1 << 5)));\n (void *)0x040000D4->unk4 = (s32) ((temp_r0->unk4 << 5) + 0x06010000);\n (void *)0x040000D4->unk8 = (s32) ((temp_r0->unk6 * 0x10) | 0x80000000);\n return (void *)0x040000D4->unk8;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":8,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":1},"errorMarkers":["agbcc failed: /c.c:1075: warning: assignment makes pointer from integer without a cast","/c.c:1076: invalid type argument of `->'","/c.c:1076: warning: dereferencing `void *' pointer","/c.c:1076: request for member `unk0' in something not a structure or union","/c.c:1076: request for member `unk6' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":28,"ratio":0.17857142857142858,"kinds":{"insert":1,"delete":1,"replace":0,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `DmaSpriteToObjVram` — benchmark function kleod:DmaSpriteToObjVram:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDmaSpriteToObjVram\n\t.type\t DmaSpriteToObjVram,function\n\t.thumb_func\nDmaSpriteToObjVram:\n\tldr\tr3, .L3\n\tldr\tr2, .L3+0x4\n\tldr\tr2, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r2\n\tldrh\tr2, [r0, #0x6]\n\tlsl\tr1, r1, #0x5\n\tmul\tr2, r2, r1\n\tldr\tr1, [r0]\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3]\n\tldrh\tr1, [r0, #0x4]\n\tlsl\tr1, r1, #0x5\n\tldr\tr2, .L3+0x8\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3, #0x4]\n\tldrh\tr0, [r0, #0x6]\n\tlsl\tr0, r0, #0x4\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r3, #0x8]\n\tldr\tr0, [r3, #0x8]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x40000d4\n\t.word\t0x30007c8\n\t.word\t0x6010000\n.Lfe1:\n\t.size\t DmaSpriteToObjVram,.Lfe1-DmaSpriteToObjVram\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function DmaSpriteToObjVram # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `DmaSpriteToObjVram` — benchmark function kleod:DmaSpriteToObjVram:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:DmaSpriteToObjVram:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tDmaSpriteToObjVram\n\t.type\t DmaSpriteToObjVram,function\n\t.thumb_func\nDmaSpriteToObjVram:\n\tldr\tr3, .L3\n\tldr\tr2, .L3+0x4\n\tldr\tr2, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r2\n\tldrh\tr2, [r0, #0x6]\n\tlsl\tr1, r1, #0x5\n\tmul\tr2, r2, r1\n\tldr\tr1, [r0]\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3]\n\tldrh\tr1, [r0, #0x4]\n\tlsl\tr1, r1, #0x5\n\tldr\tr2, .L3+0x8\n\tadd\tr1, r1, r2\n\tstr\tr1, [r3, #0x4]\n\tldrh\tr0, [r0, #0x6]\n\tlsl\tr0, r0, #0x4\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r3, #0x8]\n\tldr\tr0, [r3, #0x8]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x40000d4\n\t.word\t0x30007c8\n\t.word\t0x6010000\n.Lfe1:\n\t.size\t DmaSpriteToObjVram,.Lfe1-DmaSpriteToObjVram\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"DmaSpriteToObjVram\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name DmaSpriteToObjVram # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:FreeAllDecompBuffers:agbcc","sym":"FreeAllDecompBuffers","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","call","pointer","branch"],"loc":20,"refSource":"void FreeAllDecompBuffers(void) {\n u32 *decompBuffers = (u32 *)gDecompBufferCtrl;\n\n thunk_HeapFree(decompBuffers[1] - 4);\n thunk_HeapFree(decompBuffers[0] - 4);\n thunk_HeapFree(decompBuffers[3] - 4);\n thunk_HeapFree(decompBuffers[2] - 4);\n thunk_HeapFree(decompBuffers[5] - 4);\n thunk_HeapFree(decompBuffers[4] - 4);\n\n if (gCollisionMapPtr != 0) {\n thunk_HeapFree(gCollisionMapPtr - 4);\n gCollisionMapPtr = 0;\n }\n\n m4aSongNumStart(0x8D);\n m4aSongNumStart(0x8E);\n m4aSongNumStart(0x8F);\n m4aSongNumStart(0x90);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L91-L110","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tFreeAllDecompBuffers\n\t.type\t FreeAllDecompBuffers,function\n\t.thumb_func\nFreeAllDecompBuffers:\n\tpush\t{r4, lr}\n\tldr\tr4, .L4\n\tldr\tr0, [r4, #0x4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x8]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x14]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x10]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr4, .L4+0x4\n\tldr\tr0, [r4]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tmov\tr0, #0x0\n\tstr\tr0, [r4]\n.L3:\n\tmov\tr0, #0x8d\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8e\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8f\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x90\n\tbl\tm4aSongNumStart\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x3004790\n\t.word\t0x3005290\n.Lfe1:\n\t.size\t FreeAllDecompBuffers,.Lfe1-FreeAllDecompBuffers\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-f808d4b2fde6.i.gz","proto":{"FreeAllDecompBuffers":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","droppedCandidates":[{"label":"unsigned","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-X3ad9I/c.c:1076: `gBgDataPtrs' undeclared (first use in this function)"}],"symbolsUsed":[],"outcome":"match","source":"void FreeAllDecompBuffers(void) {\n s32 * v0;\n s32 * v1;\n v0 = (s32 *)50349968;\n thunk_HeapFree(v0[1] - 4);\n thunk_HeapFree(*v0 - 4);\n thunk_HeapFree(v0[3] - 4);\n thunk_HeapFree(v0[2] - 4);\n thunk_HeapFree(v0[5] - 4);\n thunk_HeapFree(v0[4] - 4);\n v1 = (s32 *)50352784;\n if (*v1 != 0) {\n thunk_HeapFree(*v1 - 4);\n *v1 = 0;\n }\n m4aSongNumStart(141);\n m4aSongNumStart(142);\n m4aSongNumStart(143);\n m4aSongNumStart(144);\n return;\n}\n","score":0,"maxScore":41,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":98,"lines":21,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void FreeAllDecompBuffers(void) {\n s32 temp_r0;\n\n thunk_HeapFree((void *)0x03004790->unk4 - 4);\n thunk_HeapFree((void *)0x03004790->unk0 - 4);\n thunk_HeapFree((void *)0x03004790->unkC - 4);\n thunk_HeapFree((void *)0x03004790->unk8 - 4);\n thunk_HeapFree((void *)0x03004790->unk14 - 4);\n thunk_HeapFree((void *)0x03004790->unk10 - 4);\n temp_r0 = *(s32 *)0x03005290;\n if (temp_r0 != 0) {\n thunk_HeapFree(temp_r0 - 4);\n *(s32 *)0x03005290 = 0;\n }\n m4aSongNumStart(0x8DU);\n m4aSongNumStart(0x8EU);\n m4aSongNumStart(0x8FU);\n m4aSongNumStart(0x90U);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":18,"gotos":0,"casts":9,"unkGlue":0,"rawMem":0,"addrDeref":2},"errorMarkers":["agbcc failed: /c.c:1077: invalid type argument of `->'","/c.c:1078: invalid type argument of `->'","/c.c:1079: invalid type argument of `->'","/c.c:1080: invalid type argument of `->'","/c.c:1081: invalid type argument of `->'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `FreeAllDecompBuffers` — benchmark function kleod:FreeAllDecompBuffers:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tFreeAllDecompBuffers\n\t.type\t FreeAllDecompBuffers,function\n\t.thumb_func\nFreeAllDecompBuffers:\n\tpush\t{r4, lr}\n\tldr\tr4, .L4\n\tldr\tr0, [r4, #0x4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x8]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x14]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x10]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr4, .L4+0x4\n\tldr\tr0, [r4]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tmov\tr0, #0x0\n\tstr\tr0, [r4]\n.L3:\n\tmov\tr0, #0x8d\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8e\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8f\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x90\n\tbl\tm4aSongNumStart\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x3004790\n\t.word\t0x3005290\n.Lfe1:\n\t.size\t FreeAllDecompBuffers,.Lfe1-FreeAllDecompBuffers\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-f808d4b2fde6.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid FreeAllDecompBuffers(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function FreeAllDecompBuffers # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `FreeAllDecompBuffers` — benchmark function kleod:FreeAllDecompBuffers:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:FreeAllDecompBuffers:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tFreeAllDecompBuffers\n\t.type\t FreeAllDecompBuffers,function\n\t.thumb_func\nFreeAllDecompBuffers:\n\tpush\t{r4, lr}\n\tldr\tr4, .L4\n\tldr\tr0, [r4, #0x4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0xc]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x8]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x14]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr0, [r4, #0x10]\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tldr\tr4, .L4+0x4\n\tldr\tr0, [r4]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r0, #0x4\n\tbl\tthunk_HeapFree\n\tmov\tr0, #0x0\n\tstr\tr0, [r4]\n.L3:\n\tmov\tr0, #0x8d\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8e\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x8f\n\tbl\tm4aSongNumStart\n\tmov\tr0, #0x90\n\tbl\tm4aSongNumStart\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x3004790\n\t.word\t0x3005290\n.Lfe1:\n\t.size\t FreeAllDecompBuffers,.Lfe1-FreeAllDecompBuffers\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"FreeAllDecompBuffers\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name FreeAllDecompBuffers # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:GameUpdate:agbcc","sym":"GameUpdate","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["branch","global","call"],"loc":9,"refSource":"void GameUpdate(void) {\n if (gPauseFlag == 0) {\n UpdateWorldMapNodeState();\n UpdatePlayerInput();\n InitPlayerCollision();\n UpdateWorldMapCursor();\n }\n UpdatePaletteAnimations();\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L165-L173","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGameUpdate\n\t.type\t GameUpdate,function\n\t.thumb_func\nGameUpdate:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tbl\tUpdateWorldMapNodeState\n\tbl\tUpdatePlayerInput\n\tbl\tInitPlayerCollision\n\tbl\tUpdateWorldMapCursor\n.L3:\n\tbl\tUpdatePaletteAnimations\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x30034e4\n.Lfe1:\n\t.size\t GameUpdate,.Lfe1-GameUpdate\n\n.text\n\t.align\t2, 0\n","ctx":"void UpdateWorldMapNodeState(void);\nvoid UpdatePlayerInput(void);\nvoid InitPlayerCollision(void);\nvoid UpdateWorldMapCursor(void);\nvoid UpdatePaletteAnimations(void);","proto":{"GameUpdate":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gUnk_030034E4","shape":"scalar u8"}],"outcome":"nonmatch","source":"void GameUpdate(void) {\n s32 v0;\n v0 = gUnk_030034E4;\n if (v0 == 0) UpdateWorldMapCursor(InitPlayerCollision(UpdatePlayerInput(UpdateWorldMapNodeState(v0))));\n UpdatePaletteAnimations();\n return;\n}\n","score":3,"maxScore":15,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void GameUpdate(void) {\n if (*(u8 *)0x030034E4 == 0) {\n UpdateWorldMapNodeState();\n UpdatePlayerInput();\n InitPlayerCollision();\n UpdateWorldMapCursor();\n }\n UpdatePaletteAnimations();\n}\n","score":0,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":1}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GameUpdate` — benchmark function kleod:GameUpdate:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGameUpdate\n\t.type\t GameUpdate,function\n\t.thumb_func\nGameUpdate:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tbl\tUpdateWorldMapNodeState\n\tbl\tUpdatePlayerInput\n\tbl\tInitPlayerCollision\n\tbl\tUpdateWorldMapCursor\n.L3:\n\tbl\tUpdatePaletteAnimations\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x30034e4\n.Lfe1:\n\t.size\t GameUpdate,.Lfe1-GameUpdate\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid UpdateWorldMapNodeState(void);\nvoid UpdatePlayerInput(void);\nvoid InitPlayerCollision(void);\nvoid UpdateWorldMapCursor(void);\nvoid UpdatePaletteAnimations(void);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GameUpdate # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GameUpdate` — benchmark function kleod:GameUpdate:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:GameUpdate:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGameUpdate\n\t.type\t GameUpdate,function\n\t.thumb_func\nGameUpdate:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tbl\tUpdateWorldMapNodeState\n\tbl\tUpdatePlayerInput\n\tbl\tInitPlayerCollision\n\tbl\tUpdateWorldMapCursor\n.L3:\n\tbl\tUpdatePaletteAnimations\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x30034e4\n.Lfe1:\n\t.size\t GameUpdate,.Lfe1-GameUpdate\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GameUpdate\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GameUpdate # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:GetEntityLookupData:agbcc","sym":"GetEntityLookupData","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["array","pointer","cast","global","memory"],"loc":7,"refSource":"void GetEntityLookupData(u8 idx) {\n u8 *flags = gGameFlagsPtr;\n const u8 *table = gEntityDataTable;\n const u8 *entry = &table[(u32)idx * 8];\n flags[0x11] = entry[5];\n flags[0x12] = entry[6];\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L63-L69","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetEntityLookupData\n\t.type\t GetEntityLookupData,function\n\t.thumb_func\nGetEntityLookupData:\n\tlsl\tr0, r0, #0x18\n\tldr\tr2, .L3\n\tldr\tr1, .L3+0x4\n\tlsr\tr0, r0, #0x15\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x5]\n\tstrb\tr1, [r2, #0x11]\n\tldrb\tr0, [r0, #0x6]\n\tstrb\tr0, [r2, #0x12]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntityDataTable\n.Lfe1:\n\t.size\t GetEntityLookupData,.Lfe1-GetEntityLookupData\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz","proto":{"GetEntityLookupData":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","symbolsUsed":[{"name":"gEntityDataTable","shape":"u8[]"},{"name":"gGameFlagsPtr","shape":"u8[]"}],"outcome":"nonmatch","source":"void GetEntityLookupData(u32 a0) {\n u8 * p0;\n u8 * p1;\n p0 = (u8 *)&gGameFlagsPtr;\n p1 = (u8 *)&gEntityDataTable;\n p0[17] = p1[(a0 << 24 >> 21) + 5];\n p0[18] = p1[(a0 << 24 >> 21) + 6];\n return;\n}\n","score":4,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void GetEntityLookupData(u8 idx) {\n u8 *temp_r0;\n\n temp_r0 = &gEntityDataTable[(u32) (idx << 0x18) >> 0x15];\n gGameFlagsPtr->unk11 = (u8) temp_r0->unk5;\n gGameFlagsPtr->unk12 = (u8) temp_r0->unk6;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":98,"lines":6,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1075: warning: assignment discards qualifiers from pointer target type","/c.c:1076: request for member `unk11' in something not a structure or union","/c.c:1076: request for member `unk5' in something not a structure or union","/c.c:1077: request for member `unk12' in something not a structure or union","/c.c:1077: request for member `unk6' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":4,"maxScore":14,"ratio":0.2857142857142857,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GetEntityLookupData` — benchmark function kleod:GetEntityLookupData:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetEntityLookupData\n\t.type\t GetEntityLookupData,function\n\t.thumb_func\nGetEntityLookupData:\n\tlsl\tr0, r0, #0x18\n\tldr\tr2, .L3\n\tldr\tr1, .L3+0x4\n\tlsr\tr0, r0, #0x15\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x5]\n\tstrb\tr1, [r2, #0x11]\n\tldrb\tr0, [r0, #0x6]\n\tstrb\tr0, [r2, #0x12]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntityDataTable\n.Lfe1:\n\t.size\t GetEntityLookupData,.Lfe1-GetEntityLookupData\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid GetEntityLookupData(u8 idx);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GetEntityLookupData # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GetEntityLookupData` — benchmark function kleod:GetEntityLookupData:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:GetEntityLookupData:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetEntityLookupData\n\t.type\t GetEntityLookupData,function\n\t.thumb_func\nGetEntityLookupData:\n\tlsl\tr0, r0, #0x18\n\tldr\tr2, .L3\n\tldr\tr1, .L3+0x4\n\tlsr\tr0, r0, #0x15\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x5]\n\tstrb\tr1, [r2, #0x11]\n\tldrb\tr0, [r0, #0x6]\n\tstrb\tr0, [r2, #0x12]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgGameFlagsPtr\n\t.word\tgEntityDataTable\n.Lfe1:\n\t.size\t GetEntityLookupData,.Lfe1-GetEntityLookupData\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GetEntityLookupData\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetEntityLookupData # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:MultiplyQ4:agbcc","sym":"MultiplyQ4","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","fixed-point","branch"],"loc":12,"refSource":"s16 MultiplyQ4(s16 num1, s16 num2) {\n s32 product;\n s32 rounded;\n\n product = num1 * num2;\n rounded = product;\n if (rounded < 0) {\n rounded += 0xF;\n }\n product = rounded >> 4;\n return product;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L25-L36","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ4\n\t.type\t MultiplyQ4,function\n\t.thumb_func\nMultiplyQ4:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xf\n.L3:\n\tlsl\tr0, r1, #0xc\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ4,.Lfe1-MultiplyQ4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/regcopy-ret","symbolsUsed":[],"outcome":"match","source":"s32 MultiplyQ4(u32 a0, u32 a1) {\n s32 v0;\n s32 w0;\n v0 = (s16)a0 * (s16)a1;\n w0 = v0;\n if (w0 < 0) w0 = w0 + 15;\n v0 = w0 << 12 >> 16;\n return v0;\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 MultiplyQ4(s16 arg0, s16 arg1) {\n s32 temp_r0;\n s32 var_r1;\n\n temp_r0 = arg0 * arg1;\n var_r1 = temp_r0;\n if (temp_r0 < 0) {\n var_r1 += 0xF;\n }\n return (s32) (var_r1 << 0xC) >> 0x10;\n}\n","score":3,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":10,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MultiplyQ4` — benchmark function kleod:MultiplyQ4:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ4\n\t.type\t MultiplyQ4,function\n\t.thumb_func\nMultiplyQ4:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xf\n.L3:\n\tlsl\tr0, r1, #0xc\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ4,.Lfe1-MultiplyQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MultiplyQ4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MultiplyQ4` — benchmark function kleod:MultiplyQ4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:MultiplyQ4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ4\n\t.type\t MultiplyQ4,function\n\t.thumb_func\nMultiplyQ4:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xf\n.L3:\n\tlsl\tr0, r1, #0xc\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ4,.Lfe1-MultiplyQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MultiplyQ4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:MultiplyQ8:agbcc","sym":"MultiplyQ8","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","fixed-point","branch"],"loc":12,"refSource":"s16 MultiplyQ8(s16 num1, s16 num2) {\n s32 product;\n s32 rounded;\n\n product = num1 * num2;\n rounded = product;\n if (rounded < 0) {\n rounded += 0xFF;\n }\n product = rounded >> 8;\n return product;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L116-L127","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ8\n\t.type\t MultiplyQ8,function\n\t.thumb_func\nMultiplyQ8:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ8,.Lfe1-MultiplyQ8\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/regcopy-ret","symbolsUsed":[],"outcome":"match","source":"s32 MultiplyQ8(u32 a0, u32 a1) {\n s32 v0;\n s32 w0;\n v0 = (s16)a0 * (s16)a1;\n w0 = v0;\n if (w0 < 0) w0 = w0 + 255;\n v0 = w0 << 8 >> 16;\n return v0;\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 MultiplyQ8(s16 arg0, s16 arg1) {\n s32 temp_r0;\n s32 var_r1;\n\n temp_r0 = arg0 * arg1;\n var_r1 = temp_r0;\n if (temp_r0 < 0) {\n var_r1 += 0xFF;\n }\n return (s32) (var_r1 << 8) >> 0x10;\n}\n","score":3,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":10,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MultiplyQ8` — benchmark function kleod:MultiplyQ8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ8\n\t.type\t MultiplyQ8,function\n\t.thumb_func\nMultiplyQ8:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ8,.Lfe1-MultiplyQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MultiplyQ8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MultiplyQ8` — benchmark function kleod:MultiplyQ8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:MultiplyQ8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMultiplyQ8\n\t.type\t MultiplyQ8,function\n\t.thumb_func\nMultiplyQ8:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MultiplyQ8,.Lfe1-MultiplyQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MultiplyQ8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:ProcessHBlankWait:agbcc","sym":"ProcessHBlankWait","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["mmio","branch","memory","pointer","shift"],"loc":31,"refSource":"u32 ProcessHBlankWait(u32 idx) {\n volatile u16 *ie;\n volatile u16 *dispstat;\n u8 *buf;\n u32 off;\n u8 *entry;\n u32 timer;\n\n ie = ®_IE;\n *ie |= 2;\n dispstat = ®_DISPSTAT;\n *dispstat |= 0x10;\n\n buf = gBuffer_52A4;\n off = idx * 9;\n off <<= 2;\n off += (u32)buf;\n entry = (u8 *)off;\n\n if (entry[3] >> 7) {\n return 1;\n }\n timer = *(u16 *)(entry + 0x14) - 1;\n *(u16 *)(entry + 0x14) = timer;\n if ((s32)(timer << 16) < 0) {\n *ie &= 0xFFFD;\n *dispstat &= 0xFFEF;\n return 0;\n }\n return 1;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L536-L566","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessHBlankWait\n\t.type\t ProcessHBlankWait,function\n\t.thumb_func\nProcessHBlankWait:\n\tpush\t{r4, lr}\n\tldr\tr3, .L7\n\tldrh\tr1, [r3]\n\tmov\tr2, #0x2\n\torr\tr1, r1, r2\n\tstrh\tr1, [r3]\n\tldr\tr4, .L7+0x4\n\tldrh\tr1, [r4]\n\tmov\tr2, #0x10\n\torr\tr1, r1, r2\n\tstrh\tr1, [r4]\n\tldr\tr1, .L7+0x8\n\tldr\tr2, [r1]\n\tlsl\tr1, r0, #0x3\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r2\n\tldrb\tr0, [r1, #0x3]\n\tlsr\tr0, r0, #0x7\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldrh\tr0, [r1, #0x14]\n\tsub\tr0, r0, #0x1\n\tstrh\tr0, [r1, #0x14]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n.L6:\n\tmov\tr0, #0x1\n\tb\t.L5\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\t0x30052a4\n.L4:\n\tldrh\tr1, [r3]\n\tldr\tr0, .L9\n\tand\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrh\tr1, [r4]\n\tldr\tr0, .L9+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\t0xfffd\n\t.word\t0xffef\n.Lfe1:\n\t.size\t ProcessHBlankWait,.Lfe1-ProcessHBlankWait\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/flip-branch","symbolsUsed":[{"name":"gBuffer_52A4","shape":"scalar u32"}],"outcome":"match","source":"struct Elem0 { u8 _pad0[3]; u8 field_3; u8 _pad1[16]; u16 field_20; u8 _pad2[14]; };\ns32 ProcessHBlankWait(u32 a0) {\n s32 v0;\n *(u16 *)67109376 = *(u16 *)67109376 | 2;\n *(u16 *)67108868 = *(u16 *)67108868 | 16;\n if ((u32)((struct Elem0 *)gBuffer_52A4)[a0].field_3 >> 7 != 0) {\n return 1;\n } else {\n v0 = ((struct Elem0 *)gBuffer_52A4)[a0].field_20;\n ((struct Elem0 *)gBuffer_52A4)[a0].field_20 = v0 - 1;\n if (v0 - 1 << 16 < 0) {\n *(u16 *)67109376 = 65533 & *(u16 *)67109376;\n *(u16 *)67108868 = 65519 & *(u16 *)67108868;\n return 0;\n } else {\n return 1;\n }\n }\n}\n","score":0,"maxScore":47,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":88,"lines":19,"gotos":0,"casts":9,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 ProcessHBlankWait(s32 arg0) {\n u16 temp_r0;\n void *temp_r1;\n\n *(u16 *)0x04000200 |= 2;\n *(u16 *)0x04000004 |= 0x10;\n temp_r1 = (arg0 * 0x24) + *(s32 *)0x030052A4;\n if ((((u8) temp_r1->unk3 >> 7) != 0) || (temp_r0 = temp_r1->unk14 - 1, temp_r1->unk14 = temp_r0, ((s32) (temp_r0 << 0x10) >= 0))) {\n return 1;\n }\n *(u16 *)0x04000200 &= 0xFFFD;\n *(u16 *)0x04000004 &= 0xFFEF;\n return 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":90,"lines":13,"gotos":0,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":5},"errorMarkers":["agbcc failed: /c.c:1078: warning: assignment makes pointer from integer without a cast","/c.c:1079: warning: dereferencing `void *' pointer","/c.c:1079: request for member `unk3' in something not a structure or union","/c.c:1079: request for member `unk14' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ProcessHBlankWait` — benchmark function kleod:ProcessHBlankWait:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessHBlankWait\n\t.type\t ProcessHBlankWait,function\n\t.thumb_func\nProcessHBlankWait:\n\tpush\t{r4, lr}\n\tldr\tr3, .L7\n\tldrh\tr1, [r3]\n\tmov\tr2, #0x2\n\torr\tr1, r1, r2\n\tstrh\tr1, [r3]\n\tldr\tr4, .L7+0x4\n\tldrh\tr1, [r4]\n\tmov\tr2, #0x10\n\torr\tr1, r1, r2\n\tstrh\tr1, [r4]\n\tldr\tr1, .L7+0x8\n\tldr\tr2, [r1]\n\tlsl\tr1, r0, #0x3\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r2\n\tldrb\tr0, [r1, #0x3]\n\tlsr\tr0, r0, #0x7\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldrh\tr0, [r1, #0x14]\n\tsub\tr0, r0, #0x1\n\tstrh\tr0, [r1, #0x14]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n.L6:\n\tmov\tr0, #0x1\n\tb\t.L5\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\t0x30052a4\n.L4:\n\tldrh\tr1, [r3]\n\tldr\tr0, .L9\n\tand\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrh\tr1, [r4]\n\tldr\tr0, .L9+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\t0xfffd\n\t.word\t0xffef\n.Lfe1:\n\t.size\t ProcessHBlankWait,.Lfe1-ProcessHBlankWait\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ProcessHBlankWait # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ProcessHBlankWait` — benchmark function kleod:ProcessHBlankWait:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ProcessHBlankWait:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessHBlankWait\n\t.type\t ProcessHBlankWait,function\n\t.thumb_func\nProcessHBlankWait:\n\tpush\t{r4, lr}\n\tldr\tr3, .L7\n\tldrh\tr1, [r3]\n\tmov\tr2, #0x2\n\torr\tr1, r1, r2\n\tstrh\tr1, [r3]\n\tldr\tr4, .L7+0x4\n\tldrh\tr1, [r4]\n\tmov\tr2, #0x10\n\torr\tr1, r1, r2\n\tstrh\tr1, [r4]\n\tldr\tr1, .L7+0x8\n\tldr\tr2, [r1]\n\tlsl\tr1, r0, #0x3\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r2\n\tldrb\tr0, [r1, #0x3]\n\tlsr\tr0, r0, #0x7\n\tcmp\tr0, #0\n\tbne\t.L6\t@cond_branch\n\tldrh\tr0, [r1, #0x14]\n\tsub\tr0, r0, #0x1\n\tstrh\tr0, [r1, #0x14]\n\tlsl\tr0, r0, #0x10\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n.L6:\n\tmov\tr0, #0x1\n\tb\t.L5\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\t0x4000200\n\t.word\t0x4000004\n\t.word\t0x30052a4\n.L4:\n\tldrh\tr1, [r3]\n\tldr\tr0, .L9\n\tand\tr0, r0, r1\n\tstrh\tr0, [r3]\n\tldrh\tr1, [r4]\n\tldr\tr0, .L9+0x4\n\tand\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\t0xfffd\n\t.word\t0xffef\n.Lfe1:\n\t.size\t ProcessHBlankWait,.Lfe1-ProcessHBlankWait\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ProcessHBlankWait # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:ReadKeyInput:agbcc","sym":"ReadKeyInput","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["mmio","global","bitwise","branch","call"],"loc":14,"refSource":"void ReadKeyInput(void) {\n u16 pressed = REG_KEYINPUT ^ 0x3FF;\n\n gKeysPressed = pressed & ~gKeysPrevious;\n gKeysPrevious = pressed;\n if ((pressed & 0x0F) == 0x0F) {\n SoftResetRom(0xFF);\n }\n if (gKeysPrevious & 1) {\n gAButtonHold++;\n } else {\n gAButtonHold = 0;\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L44-L57","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadKeyInput\n\t.type\t ReadKeyInput,function\n\t.thumb_func\nReadKeyInput:\n\tpush\t{r4, lr}\n\tldr\tr0, .L6\n\tldrh\tr0, [r0]\n\tldr\tr2, .L6+0x4\n\tadd\tr1, r2, #0\n\teor\tr1, r1, r0\n\tldr\tr3, .L6+0x8\n\tldr\tr4, .L6+0xc\n\tldrh\tr2, [r4]\n\tadd\tr0, r1, #0\n\tbic\tr0, r0, r2\n\tstrh\tr0, [r3]\n\tstrh\tr1, [r4]\n\tmov\tr0, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xf\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0xff\n\tbl\tSoftResetRom\n.L3:\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x1\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L6+0x10\n\tldrh\tr0, [r1]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r1]\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgKeysPressed\n\t.word\tgKeysPrevious\n\t.word\tgAButtonHold\n.L4:\n\tldr\tr0, .L8\n\tstrh\tr1, [r0]\n.L5:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgAButtonHold\n.Lfe1:\n\t.size\t ReadKeyInput,.Lfe1-ReadKeyInput\n\n.text\n\t.align\t2, 0\n","ctx":"void SoftResetRom(u8);","proto":{"ReadKeyInput":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gAButtonHold","shape":"scalar u16"},{"name":"gKeysPressed","shape":"scalar u16"},{"name":"gKeysPrevious","shape":"scalar u16"}],"outcome":"nonmatch","source":"void ReadKeyInput(void) {\n s32 v0;\n s32 v1;\n s32 v2;\n u16 * v3;\n v0 = *(u16 *)67109168;\n v1 = gKeysPrevious;\n gKeysPressed = (1023 ^ v0) & ~v1;\n gKeysPrevious = 1023 ^ v0;\n if (((1023 ^ v0) & 15) == 15) SoftResetRom(255, (1023 ^ v0) & 15, v1, &gKeysPressed);\n v2 = gKeysPrevious;\n if ((1 & v2) == 0) {\n gAButtonHold = 1 & v2;\n } else {\n v3 = gAButtonHold;\n gAButtonHold = v3 + 1;\n }\n return;\n}\n","score":43,"maxScore":58,"compileErrors":null,"breakdown":{"insert":17,"delete":11,"replace":3,"opMismatch":1,"argMismatch":11},"quality":{"score":100,"lines":19,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"extern u16 gAButtonHold;\nextern s16 gKeysPressed;\nextern u16 gKeysPrevious;\n\nvoid ReadKeyInput(void) {\n u16 temp_r1;\n u16 temp_r1_2;\n\n temp_r1 = 0x3FF ^ *(u16 *)0x04000130;\n gKeysPressed = temp_r1 & ~gKeysPrevious;\n gKeysPrevious = temp_r1;\n if ((temp_r1 & 0xF) == 0xF) {\n SoftResetRom(0xFFU);\n }\n temp_r1_2 = 1 & gKeysPrevious;\n if (temp_r1_2 != 0) {\n gAButtonHold += 1;\n return;\n }\n gAButtonHold = temp_r1_2;\n}\n","score":0,"maxScore":41,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":19,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":1}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ReadKeyInput` — benchmark function kleod:ReadKeyInput:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadKeyInput\n\t.type\t ReadKeyInput,function\n\t.thumb_func\nReadKeyInput:\n\tpush\t{r4, lr}\n\tldr\tr0, .L6\n\tldrh\tr0, [r0]\n\tldr\tr2, .L6+0x4\n\tadd\tr1, r2, #0\n\teor\tr1, r1, r0\n\tldr\tr3, .L6+0x8\n\tldr\tr4, .L6+0xc\n\tldrh\tr2, [r4]\n\tadd\tr0, r1, #0\n\tbic\tr0, r0, r2\n\tstrh\tr0, [r3]\n\tstrh\tr1, [r4]\n\tmov\tr0, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xf\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0xff\n\tbl\tSoftResetRom\n.L3:\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x1\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L6+0x10\n\tldrh\tr0, [r1]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r1]\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgKeysPressed\n\t.word\tgKeysPrevious\n\t.word\tgAButtonHold\n.L4:\n\tldr\tr0, .L8\n\tstrh\tr1, [r0]\n.L5:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgAButtonHold\n.Lfe1:\n\t.size\t ReadKeyInput,.Lfe1-ReadKeyInput\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid SoftResetRom(u8);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReadKeyInput # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ReadKeyInput` — benchmark function kleod:ReadKeyInput:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReadKeyInput:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadKeyInput\n\t.type\t ReadKeyInput,function\n\t.thumb_func\nReadKeyInput:\n\tpush\t{r4, lr}\n\tldr\tr0, .L6\n\tldrh\tr0, [r0]\n\tldr\tr2, .L6+0x4\n\tadd\tr1, r2, #0\n\teor\tr1, r1, r0\n\tldr\tr3, .L6+0x8\n\tldr\tr4, .L6+0xc\n\tldrh\tr2, [r4]\n\tadd\tr0, r1, #0\n\tbic\tr0, r0, r2\n\tstrh\tr0, [r3]\n\tstrh\tr1, [r4]\n\tmov\tr0, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xf\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0xff\n\tbl\tSoftResetRom\n.L3:\n\tldrh\tr0, [r4]\n\tmov\tr1, #0x1\n\tand\tr1, r1, r0\n\tcmp\tr1, #0\n\tbeq\t.L4\t@cond_branch\n\tldr\tr1, .L6+0x10\n\tldrh\tr0, [r1]\n\tadd\tr0, r0, #0x1\n\tstrh\tr0, [r1]\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgKeysPressed\n\t.word\tgKeysPrevious\n\t.word\tgAButtonHold\n.L4:\n\tldr\tr0, .L8\n\tstrh\tr1, [r0]\n.L5:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgAButtonHold\n.Lfe1:\n\t.size\t ReadKeyInput,.Lfe1-ReadKeyInput\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"ReadKeyInput\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReadKeyInput # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:ReadUnalignedU16:agbcc","sym":"ReadUnalignedU16","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","pointer","memory"],"loc":3,"refSource":"u32 ReadUnalignedU16(u8 *ptr) {\n return ptr[0] | (ptr[1] << 8);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L54-L56","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU16\n\t.type\t ReadUnalignedU16,function\n\t.thumb_func\nReadUnalignedU16:\n\tadd\tr1, r0, #0\n\tldrb\tr0, [r1]\n\tldrb\tr1, [r1, #0x1]\n\tlsl\tr1, r1, #0x8\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU16,.Lfe1-ReadUnalignedU16\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 ReadUnalignedU16(u8 * a0) {\n return *a0 | a0[1] << 8;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 ReadUnalignedU16(void *arg0) {\n return arg0->unk0 | (arg0->unk1 << 8);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1073: warning: dereferencing `void *' pointer","/c.c:1073: request for member `unk0' in something not a structure or union","/c.c:1073: request for member `unk1' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ReadUnalignedU16` — benchmark function kleod:ReadUnalignedU16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU16\n\t.type\t ReadUnalignedU16,function\n\t.thumb_func\nReadUnalignedU16:\n\tadd\tr1, r0, #0\n\tldrb\tr0, [r1]\n\tldrb\tr1, [r1, #0x1]\n\tlsl\tr1, r1, #0x8\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU16,.Lfe1-ReadUnalignedU16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReadUnalignedU16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ReadUnalignedU16` — benchmark function kleod:ReadUnalignedU16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReadUnalignedU16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU16\n\t.type\t ReadUnalignedU16,function\n\t.thumb_func\nReadUnalignedU16:\n\tadd\tr1, r0, #0\n\tldrb\tr0, [r1]\n\tldrb\tr1, [r1, #0x1]\n\tlsl\tr1, r1, #0x8\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU16,.Lfe1-ReadUnalignedU16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReadUnalignedU16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:ReadUnalignedU32:agbcc","sym":"ReadUnalignedU32","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","pointer","cast","memory"],"loc":3,"refSource":"u32 ReadUnalignedU32(u8 *ptr) {\n return ptr[0] + (ptr[1] << 8) + (ptr[2] << 16) + (ptr[3] << 24);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L70-L72","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU32\n\t.type\t ReadUnalignedU32,function\n\t.thumb_func\nReadUnalignedU32:\n\tadd\tr2, r0, #0\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r2, #0x1]\n\tlsl\tr1, r1, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x2]\n\tlsl\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x3]\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU32,.Lfe1-ReadUnalignedU32\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 ReadUnalignedU32(u8 * a0) {\n return *a0 + (a0[1] << 8) + (a0[2] << 16) + (a0[3] << 24);\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 ReadUnalignedU32(void *arg0) {\n return arg0->unk0 + (arg0->unk1 << 8) + (arg0->unk2 << 0x10) + (arg0->unk3 << 0x18);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1073: warning: dereferencing `void *' pointer","/c.c:1073: request for member `unk0' in something not a structure or union","/c.c:1073: request for member `unk1' in something not a structure or union","/c.c:1073: request for member `unk2' in something not a structure or union","/c.c:1073: request for member `unk3' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ReadUnalignedU32` — benchmark function kleod:ReadUnalignedU32:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU32\n\t.type\t ReadUnalignedU32,function\n\t.thumb_func\nReadUnalignedU32:\n\tadd\tr2, r0, #0\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r2, #0x1]\n\tlsl\tr1, r1, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x2]\n\tlsl\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x3]\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU32,.Lfe1-ReadUnalignedU32\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReadUnalignedU32 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ReadUnalignedU32` — benchmark function kleod:ReadUnalignedU32:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReadUnalignedU32:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReadUnalignedU32\n\t.type\t ReadUnalignedU32,function\n\t.thumb_func\nReadUnalignedU32:\n\tadd\tr2, r0, #0\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r2, #0x1]\n\tlsl\tr1, r1, #0x8\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x2]\n\tlsl\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r2, #0x3]\n\tlsl\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReadUnalignedU32,.Lfe1-ReadUnalignedU32\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReadUnalignedU32 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:ReciprocalQ4:agbcc","sym":"ReciprocalQ4","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div"],"loc":4,"refSource":"s16 ReciprocalQ4(s16 num1) {\n s32 numerator = 0x100;\n return (numerator / num1);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L50-L53","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ4\n\t.type\t ReciprocalQ4,function\n\t.thumb_func\nReciprocalQ4:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ4,.Lfe1-ReciprocalQ4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/regcopy","symbolsUsed":[],"outcome":"match","source":"s32 ReciprocalQ4(u32 a0) {\n s32 w0;\n w0 = 128 << 1;\n return (s16)(w0 / (s16)a0);\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 ReciprocalQ4(s16 arg0) {\n return (s16) (0x100 / arg0);\n}\n","score":4,"maxScore":13,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ReciprocalQ4` — benchmark function kleod:ReciprocalQ4:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ4\n\t.type\t ReciprocalQ4,function\n\t.thumb_func\nReciprocalQ4:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ4,.Lfe1-ReciprocalQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReciprocalQ4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ReciprocalQ4` — benchmark function kleod:ReciprocalQ4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReciprocalQ4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ4\n\t.type\t ReciprocalQ4,function\n\t.thumb_func\nReciprocalQ4:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ4,.Lfe1-ReciprocalQ4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReciprocalQ4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:ReciprocalQ8:agbcc","sym":"ReciprocalQ8","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div"],"loc":4,"refSource":"s16 ReciprocalQ8(s16 num1) {\n s32 numerator = 0x10000;\n return (numerator / num1);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L19-L22","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ8\n\t.type\t ReciprocalQ8,function\n\t.thumb_func\nReciprocalQ8:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ8,.Lfe1-ReciprocalQ8\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/regcopy","symbolsUsed":[],"outcome":"match","source":"s32 ReciprocalQ8(u32 a0) {\n s32 w0;\n w0 = 128 << 9;\n return (s16)(w0 / (s16)a0);\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 ReciprocalQ8(s16 arg0) {\n return (s16) (0x10000 / arg0);\n}\n","score":4,"maxScore":13,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ReciprocalQ8` — benchmark function kleod:ReciprocalQ8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ8\n\t.type\t ReciprocalQ8,function\n\t.thumb_func\nReciprocalQ8:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ8,.Lfe1-ReciprocalQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReciprocalQ8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ReciprocalQ8` — benchmark function kleod:ReciprocalQ8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReciprocalQ8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReciprocalQ8\n\t.type\t ReciprocalQ8,function\n\t.thumb_func\nReciprocalQ8:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ReciprocalQ8,.Lfe1-ReciprocalQ8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReciprocalQ8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:ReturnOne:agbcc","sym":"ReturnOne","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["baseline"],"loc":3,"refSource":"s32 ReturnOne(void) {\n return 1;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L12-L14","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReturnOne\n\t.type\t ReturnOne,function\n\t.thumb_func\nReturnOne:\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReturnOne,.Lfe1-ReturnOne\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 ReturnOne(void) {\n return 1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 ReturnOne(void) {\n return 1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ReturnOne` — benchmark function kleod:ReturnOne:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReturnOne\n\t.type\t ReturnOne,function\n\t.thumb_func\nReturnOne:\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReturnOne,.Lfe1-ReturnOne\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ReturnOne # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ReturnOne` — benchmark function kleod:ReturnOne:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:ReturnOne:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tReturnOne\n\t.type\t ReturnOne,function\n\t.thumb_func\nReturnOne:\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t ReturnOne,.Lfe1-ReturnOne\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ReturnOne # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:RollRandomLevelVariant:agbcc","sym":"RollRandomLevelVariant","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","call","global","bitwise"],"loc":10,"refSource":"void RollRandomLevelVariant(void) {\n u8 *state = gGameFlags;\n u8 difficulty = state[0x0C];\n u32 difficultyIndex = (u8)(difficulty - 1);\n u32 rng = thunk_sub_080002A0();\n u8 *levelState = gControlBlock;\n u32 parity = difficultyIndex & 1;\n u32 variant = sub_0805193C((u8)rng, 5 - difficultyIndex);\n levelState[0x0E] = parity + variant + 1;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L80-L89","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRollRandomLevelVariant\n\t.type\t RollRandomLevelVariant,function\n\t.thumb_func\nRollRandomLevelVariant:\n\tpush\t{r4, r5, r6, lr}\n\tldr\tr0, .L3\n\tldrb\tr4, [r0, #0xc]\n\tsub\tr4, r4, #0x1\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tbl\tthunk_sub_080002A0\n\tldr\tr6, .L3+0x4\n\tmov\tr5, #0x1\n\tand\tr5, r5, r4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr1, #0x5\n\tsub\tr1, r1, r4\n\tbl\tsub_0805193C\n\tadd\tr5, r5, r0\n\tadd\tr5, r5, #0x1\n\tstrb\tr5, [r6, #0xe]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3005400\n\t.word\t0x3004c20\n.Lfe1:\n\t.size\t RollRandomLevelVariant,.Lfe1-RollRandomLevelVariant\n\n.text\n\t.align\t2, 0\n","proto":{"RollRandomLevelVariant":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","droppedCandidates":[{"label":"unsigned","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-pkBp3G/c.c:1077: too many arguments to function `thunk_sub_080002A0'"}],"symbolsUsed":[],"outcome":"nonmatch","source":"void RollRandomLevelVariant(void) {\n s32 v0;\n v0 = ((u8 *)50353152)[12];\n ((u8 *)50351136)[14] = (1 & (u8)(v0 - 1)) + sub_0805193C((u8)thunk_sub_080002A0(50353152), 5 - (u8)(v0 - 1)) + 1;\n return;\n}\n","score":27,"maxScore":30,"compileErrors":null,"breakdown":{"insert":6,"delete":6,"replace":3,"opMismatch":1,"argMismatch":11},"quality":{"score":92,"lines":6,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 sub_0805193C(u8, s32); /* extern */\nu8 thunk_sub_080002A0(); /* extern */\n\nvoid RollRandomLevelVariant(void) {\n u8 temp_r4;\n\n temp_r4 = (void *)0x03005400->unkC - 1;\n (void *)0x03004C20->unkE = (s8) ((1 & temp_r4) + sub_0805193C(thunk_sub_080002A0(), 5 - temp_r4) + 1);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":96,"lines":7,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1074: conflicting types for `sub_0805193C'","/c.c:1072: previous declaration of `sub_0805193C'","/c.c:1075: conflicting types for `thunk_sub_080002A0'","/c.c:1071: previous declaration of `thunk_sub_080002A0'","/c.c:1080: invalid type argument of `->'"]},"gapSize":{"decompiler":"asmlift","score":27,"maxScore":30,"ratio":0.9,"kinds":{"insert":6,"delete":6,"replace":3,"opMismatch":1,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `RollRandomLevelVariant` — benchmark function kleod:RollRandomLevelVariant:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRollRandomLevelVariant\n\t.type\t RollRandomLevelVariant,function\n\t.thumb_func\nRollRandomLevelVariant:\n\tpush\t{r4, r5, r6, lr}\n\tldr\tr0, .L3\n\tldrb\tr4, [r0, #0xc]\n\tsub\tr4, r4, #0x1\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tbl\tthunk_sub_080002A0\n\tldr\tr6, .L3+0x4\n\tmov\tr5, #0x1\n\tand\tr5, r5, r4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr1, #0x5\n\tsub\tr1, r1, r4\n\tbl\tsub_0805193C\n\tadd\tr5, r5, r0\n\tadd\tr5, r5, #0x1\n\tstrb\tr5, [r6, #0xe]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3005400\n\t.word\t0x3004c20\n.Lfe1:\n\t.size\t RollRandomLevelVariant,.Lfe1-RollRandomLevelVariant\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function RollRandomLevelVariant # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `RollRandomLevelVariant` — benchmark function kleod:RollRandomLevelVariant:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:RollRandomLevelVariant:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRollRandomLevelVariant\n\t.type\t RollRandomLevelVariant,function\n\t.thumb_func\nRollRandomLevelVariant:\n\tpush\t{r4, r5, r6, lr}\n\tldr\tr0, .L3\n\tldrb\tr4, [r0, #0xc]\n\tsub\tr4, r4, #0x1\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tbl\tthunk_sub_080002A0\n\tldr\tr6, .L3+0x4\n\tmov\tr5, #0x1\n\tand\tr5, r5, r4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr1, #0x5\n\tsub\tr1, r1, r4\n\tbl\tsub_0805193C\n\tadd\tr5, r5, r0\n\tadd\tr5, r5, #0x1\n\tstrb\tr5, [r6, #0xe]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3005400\n\t.word\t0x3004c20\n.Lfe1:\n\t.size\t RollRandomLevelVariant,.Lfe1-RollRandomLevelVariant\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"RollRandomLevelVariant\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name RollRandomLevelVariant # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:StrCpy:agbcc","sym":"StrCpy","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","loop","pointer"],"loc":10,"refSource":"void StrCpy(u8 *dst, u8 *src) {\n u32 c;\n do {\n c = *src;\n *dst = c;\n c = *src;\n dst++;\n src++;\n } while (c != 0);\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/system.c#L16-L25","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStrCpy\n\t.type\t StrCpy,function\n\t.thumb_func\nStrCpy:\n.L3:\n\tldrb\tr2, [r1]\n\tstrb\tr2, [r0]\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tbx\tlr\n.Lfe1:\n\t.size\t StrCpy,.Lfe1-StrCpy\n\n.text\n\t.align\t2, 0\n","proto":{"StrCpy":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void StrCpy(u8 * a0, u8 * a1) {\n s32 v0;\n u8 * v1;\n u8 * v2;\n v1 = a1;\n v2 = a0;\n do {\n v0 = *v1;\n *v2 = v0;\n v2 = v2 + 1;\n v1 = v1 + 1;\n } while (v0 != 0);\n return;\n}\n","score":5,"maxScore":8,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void *StrCpy(u8 *arg0, u8 *arg1) {\n u8 temp_r2;\n\n do {\n temp_r2 = *arg1;\n *arg0 = temp_r2;\n } while (temp_r2 != 0);\n return arg0 + 1;\n}\n","score":7,"maxScore":8,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":8,"ratio":0.625,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StrCpy` — benchmark function kleod:StrCpy:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStrCpy\n\t.type\t StrCpy,function\n\t.thumb_func\nStrCpy:\n.L3:\n\tldrb\tr2, [r1]\n\tstrb\tr2, [r0]\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tbx\tlr\n.Lfe1:\n\t.size\t StrCpy,.Lfe1-StrCpy\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StrCpy # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StrCpy` — benchmark function kleod:StrCpy:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:StrCpy:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStrCpy\n\t.type\t StrCpy,function\n\t.thumb_func\nStrCpy:\n.L3:\n\tldrb\tr2, [r1]\n\tstrb\tr2, [r0]\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n\tbx\tlr\n.Lfe1:\n\t.size\t StrCpy,.Lfe1-StrCpy\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StrCpy\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StrCpy # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:StreamCmd_SetBGScroll:agbcc","sym":"StreamCmd_SetBGScroll","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","struct","pointer","call"],"loc":12,"refSource":"void StreamCmd_SetBGScroll(void) {\n u16 scrollX = ReadUnalignedU16(gStreamPtr + 3);\n struct BGLayerState *tbl = gBGLayerState;\n u8 *p = gStreamPtr;\n u16 scrollY;\n u8 *p2;\n tbl[p[2]].scrollX = scrollX << 4;\n scrollY = ReadUnalignedU16(p + 5);\n p2 = gStreamPtr;\n tbl[p2[2]].scrollY = scrollY << 4;\n gStreamPtr = p2 + 7;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L429-L440","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetBGScroll\n\t.type\t StreamCmd_SetBGScroll,function\n\t.thumb_func\nStreamCmd_SetBGScroll:\n\tpush\t{r4, r5, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tadd\tr3, r0, #0\n\tldr\tr5, .L3+0x4\n\tldr\tr0, [r4]\n\tldrb\tr2, [r0, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr3, r3, #0x4\n\tstrh\tr3, [r1, #0x8]\n\tadd\tr0, r0, #0x5\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr2, [r3, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr0, r0, #0x4\n\tstrh\tr0, [r1, #0xa]\n\tadd\tr3, r3, #0x7\n\tstr\tr3, [r4]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n\t.word\t0x3003430\n.Lfe1:\n\t.size\t StreamCmd_SetBGScroll,.Lfe1-StreamCmd_SetBGScroll\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","symbolsUsed":[],"outcome":"nonmatch","source":"struct Elem0 { u8 _pad0[8]; u16 field_8; u16 field_10; u8 _pad1[16]; };\ns32 StreamCmd_SetBGScroll(void) {\n s32 * v0;\n s32 v1;\n struct Elem0 * v2;\n u8 * v3;\n s32 v4;\n u8 * v5;\n v0 = (s32 *)50351492;\n v1 = ReadUnalignedU16(*v0 + 3);\n v2 = (struct Elem0 *)50345008;\n v3 = (u8 *)*v0;\n v2[v3[2]].field_8 = v1 << 4;\n v4 = ReadUnalignedU16(v3 + 5);\n v5 = (u8 *)*v0;\n v2[v5[2]].field_10 = v4 << 4;\n *v0 = v5 + 7;\n return v4 << 4;\n}\n","score":2,"maxScore":32,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":96,"lines":19,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 ReadUnalignedU16(void *); /* extern */\n\nvoid StreamCmd_SetBGScroll(void) {\n void *temp_r0;\n void *temp_r3;\n\n temp_r0 = *(void **)0x03004D84;\n ((temp_r0->unk2 * 0x1C) + 0x03003430)->unk8 = (s16) (ReadUnalignedU16(*(void **)0x03004D84 + 3) * 0x10);\n temp_r3 = *(void **)0x03004D84;\n ((temp_r3->unk2 * 0x1C) + 0x03003430)->unkA = (s16) (ReadUnalignedU16(temp_r0 + 5) * 0x10);\n *(void **)0x03004D84 = temp_r3 + 7;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":10,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":4},"errorMarkers":["agbcc failed: /c.c:1079: warning: dereferencing `void *' pointer","/c.c:1079: request for member `unk2' in something not a structure or union","/c.c:1081: warning: dereferencing `void *' pointer","/c.c:1081: request for member `unk2' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":32,"ratio":0.0625,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StreamCmd_SetBGScroll` — benchmark function kleod:StreamCmd_SetBGScroll:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetBGScroll\n\t.type\t StreamCmd_SetBGScroll,function\n\t.thumb_func\nStreamCmd_SetBGScroll:\n\tpush\t{r4, r5, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tadd\tr3, r0, #0\n\tldr\tr5, .L3+0x4\n\tldr\tr0, [r4]\n\tldrb\tr2, [r0, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr3, r3, #0x4\n\tstrh\tr3, [r1, #0x8]\n\tadd\tr0, r0, #0x5\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr2, [r3, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr0, r0, #0x4\n\tstrh\tr0, [r1, #0xa]\n\tadd\tr3, r3, #0x7\n\tstr\tr3, [r4]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n\t.word\t0x3003430\n.Lfe1:\n\t.size\t StreamCmd_SetBGScroll,.Lfe1-StreamCmd_SetBGScroll\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StreamCmd_SetBGScroll # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StreamCmd_SetBGScroll` — benchmark function kleod:StreamCmd_SetBGScroll:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:StreamCmd_SetBGScroll:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetBGScroll\n\t.type\t StreamCmd_SetBGScroll,function\n\t.thumb_func\nStreamCmd_SetBGScroll:\n\tpush\t{r4, r5, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tadd\tr3, r0, #0\n\tldr\tr5, .L3+0x4\n\tldr\tr0, [r4]\n\tldrb\tr2, [r0, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr3, r3, #0x4\n\tstrh\tr3, [r1, #0x8]\n\tadd\tr0, r0, #0x5\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr2, [r3, #0x2]\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r5\n\tlsl\tr0, r0, #0x4\n\tstrh\tr0, [r1, #0xa]\n\tadd\tr3, r3, #0x7\n\tstr\tr3, [r4]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n\t.word\t0x3003430\n.Lfe1:\n\t.size\t StreamCmd_SetBGScroll,.Lfe1-StreamCmd_SetBGScroll\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StreamCmd_SetBGScroll # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:StreamCmd_SetWindowRegs:agbcc","sym":"StreamCmd_SetWindowRegs","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["mmio","pointer","bitwise","global"],"loc":10,"refSource":"void StreamCmd_SetWindowRegs(void) {\n vu16 *reg = ®_WININ;\n u8 **streamPtrAddr = &gStreamPtr;\n u8 *stream = *streamPtrAddr;\n\n *reg = stream[2] | (stream[3] << 8);\n reg++;\n *reg = stream[4] | (stream[5] << 8);\n *streamPtrAddr = stream + 6;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L667-L676","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetWindowRegs\n\t.type\t StreamCmd_SetWindowRegs,function\n\t.thumb_func\nStreamCmd_SetWindowRegs:\n\tpush\t{r4, lr}\n\tldr\tr3, .L3\n\tldr\tr4, .L3+0x4\n\tldr\tr2, [r4]\n\tldrb\tr1, [r2, #0x2]\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr3, r3, #0x2\n\tldrb\tr1, [r2, #0x4]\n\tldrb\tr0, [r2, #0x5]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr2, r2, #0x6\n\tstr\tr2, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x4000048\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t StreamCmd_SetWindowRegs,.Lfe1-StreamCmd_SetWindowRegs\n\n.text\n\t.align\t2, 0\n","proto":{"StreamCmd_SetWindowRegs":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void StreamCmd_SetWindowRegs(void) {\n u8 * v0;\n v0 = (u8 *)*(s32 *)50351492;\n *(u16 *)67108936 = v0[2] | v0[3] << 8;\n *(u16 *)67108938 = v0[4] | v0[5] << 8;\n *(s32 *)50351492 = v0 + 6;\n return;\n}\n","score":5,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":2,"opMismatch":0,"argMismatch":3},"quality":{"score":92,"lines":8,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void StreamCmd_SetWindowRegs(void) {\n void *temp_r2;\n\n temp_r2 = *(void **)0x03004D84;\n (void *)0x04000048->unk0 = (s16) (temp_r2->unk2 | (temp_r2->unk3 << 8));\n (void *)0x04000048->unk2 = (s16) (temp_r2->unk4 | (temp_r2->unk5 << 8));\n *(void **)0x03004D84 = temp_r2 + 6;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":90,"lines":7,"gotos":0,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":2},"errorMarkers":["agbcc failed: /c.c:1076: invalid type argument of `->'","/c.c:1076: warning: dereferencing `void *' pointer","/c.c:1076: request for member `unk2' in something not a structure or union","/c.c:1076: request for member `unk3' in something not a structure or union","/c.c:1077: invalid type argument of `->'"]},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":22,"ratio":0.22727272727272727,"kinds":{"insert":0,"delete":0,"replace":2,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StreamCmd_SetWindowRegs` — benchmark function kleod:StreamCmd_SetWindowRegs:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetWindowRegs\n\t.type\t StreamCmd_SetWindowRegs,function\n\t.thumb_func\nStreamCmd_SetWindowRegs:\n\tpush\t{r4, lr}\n\tldr\tr3, .L3\n\tldr\tr4, .L3+0x4\n\tldr\tr2, [r4]\n\tldrb\tr1, [r2, #0x2]\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr3, r3, #0x2\n\tldrb\tr1, [r2, #0x4]\n\tldrb\tr0, [r2, #0x5]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr2, r2, #0x6\n\tstr\tr2, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x4000048\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t StreamCmd_SetWindowRegs,.Lfe1-StreamCmd_SetWindowRegs\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StreamCmd_SetWindowRegs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StreamCmd_SetWindowRegs` — benchmark function kleod:StreamCmd_SetWindowRegs:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:StreamCmd_SetWindowRegs:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStreamCmd_SetWindowRegs\n\t.type\t StreamCmd_SetWindowRegs,function\n\t.thumb_func\nStreamCmd_SetWindowRegs:\n\tpush\t{r4, lr}\n\tldr\tr3, .L3\n\tldr\tr4, .L3+0x4\n\tldr\tr2, [r4]\n\tldrb\tr1, [r2, #0x2]\n\tldrb\tr0, [r2, #0x3]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr3, r3, #0x2\n\tldrb\tr1, [r2, #0x4]\n\tldrb\tr0, [r2, #0x5]\n\tlsl\tr0, r0, #0x8\n\torr\tr1, r1, r0\n\tstrh\tr1, [r3]\n\tadd\tr2, r2, #0x6\n\tstr\tr2, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x4000048\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t StreamCmd_SetWindowRegs,.Lfe1-StreamCmd_SetWindowRegs\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StreamCmd_SetWindowRegs\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StreamCmd_SetWindowRegs # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:TransformSingleEntityToScreen:agbcc","sym":"TransformSingleEntityToScreen","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","struct","array","switch","arithmetic"],"loc":58,"refSource":"void TransformSingleEntityToScreen(u8 arg0, s8 arg1, s8 arg2) {\n s32 temp_r0;\n s32 temp_r0_2;\n s16 temp_r1;\n s16 temp_r2;\n s32 var_r2;\n s32 var_r4;\n struct Unk_0300466C_4 *var_r0;\n\n arg1++, arg1--; /* fake */\n gUnk_03002920[arg0].xPosScreen = gUnk_03002920[arg0].xPosBg2 - arg1 - gUnk_03003430.bg2HOfs;\n gUnk_03002920[arg0].yPosScreen = gUnk_03002920[arg0].yPosBg2 - arg2 - gUnk_03003430.bg2VOfs;\n\n temp_r1 = gUnk_03003430.bg2HOfs - gUnk_03002920[arg0].xPosScreen;\n temp_r2 = gUnk_03003430.bg2VOfs - gUnk_03002920[arg0].yPosScreen;\n\n temp_r0 = temp_r1 * gBg2XMag;\n if (temp_r0 < 0) {\n temp_r0 += 0xFF;\n }\n var_r4 = temp_r0 >> 8;\n\n temp_r0_2 = temp_r2 * gBg2YMag;\n if (temp_r0_2 < 0) {\n temp_r0_2 += 0xFF;\n }\n var_r2 = temp_r0_2 >> 8;\n\n var_r4 = gUnk_03003430.bg2HOfs - var_r4;\n if (arg0 > 0xC) {\n var_r0 = (void *)gUnk_030051DC[arg0 - 0xD].unk4;\n } else {\n var_r0 = gUnk_08078FC8[arg0].unk4;\n }\n\n switch (var_r0->shape_size & 0xF) {\n case 3:\n case 11:\n var_r2 = gUnk_03003430.bg2VOfs - var_r2 + ((0x100 - gBg2YMag) >> 3);\n break;\n case 1:\n case 6:\n case 8:\n var_r2 = gUnk_03003430.bg2VOfs - var_r2 + ((0x100 - gBg2YMag) >> 5);\n break;\n case 0:\n case 4:\n case 5:\n var_r2 = gUnk_03003430.bg2VOfs - var_r2 + ((0x100 - gBg2YMag) >> 6);\n break;\n default:\n var_r2 = gUnk_03003430.bg2VOfs - var_r2 + ((0x100 - gBg2YMag) >> 4);\n break;\n }\n\n gUnk_03002920[arg0].xPosScreen = var_r4;\n gUnk_03002920[arg0].yPosScreen = var_r2;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/9400132178f58db2d8b2638349ffa86155ed2e53/src/code_0.c#L1407-L1464","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tTransformSingleEntityToScreen\n\t.type\t TransformSingleEntityToScreen,function\n\t.thumb_func\nTransformSingleEntityToScreen:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tldr\tr0, .L19\n\tmov\tr8, r0\n\tmov\tr0, r9\n\tlsl\tr7, r0, #0x3\n\tsub\tr4, r7, r0\n\tlsl\tr4, r4, #0x2\n\tadd\tr4, r4, r8\n\tlsl\tr1, r1, #0x18\n\tasr\tr1, r1, #0x18\n\tldrh\tr5, [r4]\n\tsub\tr5, r5, r1\n\tldr\tr6, .L19+0x4\n\tmov\tr1, #0x40\n\tadd\tr1, r1, r6\n\tmov\tip, r1\n\tldrh\tr0, [r1]\n\tsub\tr5, r5, r0\n\tstrh\tr5, [r4, #0x4]\n\tlsl\tr2, r2, #0x18\n\tasr\tr2, r2, #0x18\n\tldrh\tr3, [r4, #0x2]\n\tsub\tr3, r3, r2\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x42\n\tldrh\tr0, [r2]\n\tsub\tr3, r3, r0\n\tstrh\tr3, [r4, #0x6]\n\tldrh\tr1, [r1]\n\tsub\tr1, r1, r5\n\tldrh\tr0, [r2]\n\tsub\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tldr\tr0, .L19+0x8\n\tldrh\tr0, [r0]\n\tmul\tr0, r0, r1\n\tmov\tr5, r8\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L3:\n\tasr\tr4, r0, #0x8\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tldr\tr2, .L19+0xc\n\tldrh\tr1, [r2]\n\tmul\tr0, r0, r1\n\tadd\tr3, r2, #0\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L4:\n\tasr\tr2, r0, #0x8\n\tmov\tr1, ip\n\tldrh\tr0, [r1]\n\tsub\tr4, r0, r4\n\tmov\tr0, r9\n\tcmp\tr0, #0xc\n\tbls\t.L5\t@cond_branch\n\tldr\tr0, .L19+0x10\n\tldr\tr0, [r0]\n\tadd\tr0, r7, r0\n\tsub\tr0, r0, #0x68\n\tldr\tr0, [r0, #0x4]\n\tb\t.L6\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n\t.word\tgBg2XMag\n\t.word\tgBg2YMag\n\t.word\tgUnk_030051DC\n.L5:\n\tldr\tr0, .L21\n\tadd\tr0, r0, #0x4\n\tadd\tr0, r7, r0\n\tldr\tr0, [r0]\n.L6:\n\tldrb\tr0, [r0, #0x5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xb\n\tbhi\t.L16\t@cond_branch\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L21+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\tgUnk_08078FC8\n\t.word\t.L17\n\t.align\t2, 0\n\t.align\t2, 0\n.L17:\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L9\n\t.word\t.L15\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L16\n\t.word\t.L9\n.L9:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tb\t.L18\n.L12:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x5\n\tb\t.L18\n.L15:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x6\n\tb\t.L18\n.L16:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x4\n.L18:\n\tadd\tr2, r1, r0\n\tmov\tr1, r9\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r5\n\tstrh\tr4, [r0, #0x4]\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t TransformSingleEntityToScreen,.Lfe1-TransformSingleEntityToScreen\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'TransformSingleEntityToScreen' — lift: cannot lift 'TransformSingleEntityToScreen': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tTransformSingleEntityToScreen */\n/* \t.type\t TransformSingleEntityToScreen,function */\n/* \t.thumb_func */\n/* TransformSingleEntityToScreen: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, r9 */\n/* \tmov\tr6, r8 */\n/* \tpush\t{r6, r7} */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tmov\tr9, r0 */\n/* \tldr\tr0, .L19 */\n/* \tmov\tr8, r0 */\n/* \tmov\tr0, r9 */\n/* \tlsl\tr7, r0, #0x3 */\n/* \tsub\tr4, r7, r0 */\n/* \tlsl\tr4, r4, #0x2 */\n/* \tadd\tr4, r4, r8 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tasr\tr1, r1, #0x18 */\n/* \tldrh\tr5, [r4] */\n/* \tsub\tr5, r5, r1 */\n/* \tldr\tr6, .L19+0x4 */\n/* \tmov\tr1, #0x40 */\n/* \tadd\tr1, r1, r6 */\n/* \tmov\tip, r1 */\n/* \tldrh\tr0, [r1] */\n/* \tsub\tr5, r5, r0 */\n/* \tstrh\tr5, [r4, #0x4] */\n/* \tlsl\tr2, r2, #0x18 */\n/* \tasr\tr2, r2, #0x18 */\n/* \tldrh\tr3, [r4, #0x2] */\n/* \tsub\tr3, r3, r2 */\n/* \tadd\tr2, r6, #0 */\n/* \tadd\tr2, r2, #0x42 */\n/* \tldrh\tr0, [r2] */\n/* \tsub\tr3, r3, r0 */\n/* \tstrh\tr3, [r4, #0x6] */\n/* \tldrh\tr1, [r1] */\n/* \tsub\tr1, r1, r5 */\n/* \tldrh\tr0, [r2] */\n/* \tsub\tr0, r0, r3 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr2, r0, #0x10 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tasr\tr1, r1, #0x10 */\n/* \tldr\tr0, .L19+0x8 */\n/* \tldrh\tr0, [r0] */\n/* \tmul\tr0, r0, r1 */\n/* \tmov\tr5, r8 */\n/* \tcmp\tr0, #0 */\n/* \tbge\t.L3\t@cond_branch */\n/* \tadd\tr0, r0, #0xff */\n/* .L3: */\n/* \tasr\tr4, r0, #0x8 */\n/* \tlsl\tr0, r2, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tldr\tr2, .L19+0xc */\n/* \tldrh\tr1, [r2] */\n/* \tmul\tr0, r0, r1 */\n/* \tadd\tr3, r2, #0 */\n/* \tcmp\tr0, #0 */\n/* \tbge\t.L4\t@cond_branch */\n/* \tadd\tr0, r0, #0xff */\n/* .L4: */\n/* \tasr\tr2, r0, #0x8 */\n/* \tmov\tr1, ip */\n/* \tldrh\tr0, [r1] */\n/* \tsub\tr4, r0, r4 */\n/* \tmov\tr0, r9 */\n/* \tcmp\tr0, #0xc */\n/* \tbls\t.L5\t@cond_branch */\n/* \tldr\tr0, .L19+0x10 */\n/* \tldr\tr0, [r0] */\n/* \tadd\tr0, r7, r0 */\n/* \tsub\tr0, r0, #0x68 */\n/* \tldr\tr0, [r0, #0x4] */\n/* \tb\t.L6 */\n/* .L20: */\n/* \t.align\t2, 0 */\n/* .L19: */\n/* \t.word\tgUnk_03002920 */\n/* \t.word\tgUnk_03003430 */\n/* \t.word\tgBg2XMag */\n/* \t.word\tgBg2YMag */\n/* \t.word\tgUnk_030051DC */\n/* .L5: */\n/* \tldr\tr0, .L21 */\n/* \tadd\tr0, r0, #0x4 */\n/* \tadd\tr0, r7, r0 */\n/* \tldr\tr0, [r0] */\n/* .L6: */\n/* \tldrb\tr0, [r0, #0x5] */\n/* \tmov\tr1, #0xf */\n/* \tand\tr1, r1, r0 */\n/* \tcmp\tr1, #0xb */\n/* \tbhi\t.L16\t@cond_branch */\n/* \tlsl\tr0, r1, #0x2 */\n/* \tldr\tr1, .L21+0x4 */\n/* \tadd\tr0, r0, r1 */\n/* \tldr\tr0, [r0] */\n/* \tmov\tpc, r0 */\n/* .L22: */\n/* \t.align\t2, 0 */\n/* .L21: */\n/* \t.word\tgUnk_08078FC8 */\n/* \t.word\t.L17 */\n/* \t.align\t2, 0 */\n/* \t.align\t2, 0 */\n/* .L17: */\n/* \t.word\t.L15 */\n/* \t.word\t.L12 */\n/* \t.word\t.L16 */\n/* \t.word\t.L9 */\n/* \t.word\t.L15 */\n/* \t.word\t.L15 */\n/* \t.word\t.L12 */\n/* \t.word\t.L16 */\n/* \t.word\t.L12 */\n/* \t.word\t.L16 */\n/* \t.word\t.L16 */\n/* \t.word\t.L9 */\n/* .L9: */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x42 */\n/* \tldrh\tr1, [r0] */\n/* \tsub\tr1, r1, r2 */\n/* \tldrh\tr2, [r3] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tsub\tr0, r0, r2 */\n/* \tasr\tr0, r0, #0x3 */\n/* \tb\t.L18 */\n/* .L12: */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x42 */\n/* \tldrh\tr1, [r0] */\n/* \tsub\tr1, r1, r2 */\n/* \tldrh\tr2, [r3] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tsub\tr0, r0, r2 */\n/* \tasr\tr0, r0, #0x5 */\n/* \tb\t.L18 */\n/* .L15: */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x42 */\n/* \tldrh\tr1, [r0] */\n/* \tsub\tr1, r1, r2 */\n/* \tldrh\tr2, [r3] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tsub\tr0, r0, r2 */\n/* \tasr\tr0, r0, #0x6 */\n/* \tb\t.L18 */\n/* .L16: */\n/* \tadd\tr0, r6, #0 */\n/* \tadd\tr0, r0, #0x42 */\n/* \tldrh\tr1, [r0] */\n/* \tsub\tr1, r1, r2 */\n/* \tldrh\tr2, [r3] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tsub\tr0, r0, r2 */\n/* \tasr\tr0, r0, #0x4 */\n/* .L18: */\n/* \tadd\tr2, r1, r0 */\n/* \tmov\tr1, r9 */\n/* \tlsl\tr0, r1, #0x3 */\n/* \tsub\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x2 */\n/* \tadd\tr0, r0, r5 */\n/* \tstrh\tr4, [r0, #0x4] */\n/* \tstrh\tr2, [r0, #0x6] */\n/* \tpop\t{r3, r4} */\n/* \tmov\tr8, r3 */\n/* \tmov\tr9, r4 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .Lfe1: */\n/* \t.size\t TransformSingleEntityToScreen,.Lfe1-TransformSingleEntityToScreen */\n/* .text */\n/* \t.align\t2, 0 */\nvoid TransformSingleEntityToScreen(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'TransformSingleEntityToScreen': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":194,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'TransformSingleEntityToScreen': indirect/computed jump 'mov pc, r0' — jump tables / computed gotos / register tail calls not supported"]},"m2c":{"decompiler":"m2c","outcome":"failed","source":"/*\nDecompilation failure in function TransformSingleEntityToScreen:\n\nUnable to determine jump table for mov instruction at in.s line 107.\n*/\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/*"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `TransformSingleEntityToScreen` — benchmark function kleod:TransformSingleEntityToScreen:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tTransformSingleEntityToScreen\n\t.type\t TransformSingleEntityToScreen,function\n\t.thumb_func\nTransformSingleEntityToScreen:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tldr\tr0, .L19\n\tmov\tr8, r0\n\tmov\tr0, r9\n\tlsl\tr7, r0, #0x3\n\tsub\tr4, r7, r0\n\tlsl\tr4, r4, #0x2\n\tadd\tr4, r4, r8\n\tlsl\tr1, r1, #0x18\n\tasr\tr1, r1, #0x18\n\tldrh\tr5, [r4]\n\tsub\tr5, r5, r1\n\tldr\tr6, .L19+0x4\n\tmov\tr1, #0x40\n\tadd\tr1, r1, r6\n\tmov\tip, r1\n\tldrh\tr0, [r1]\n\tsub\tr5, r5, r0\n\tstrh\tr5, [r4, #0x4]\n\tlsl\tr2, r2, #0x18\n\tasr\tr2, r2, #0x18\n\tldrh\tr3, [r4, #0x2]\n\tsub\tr3, r3, r2\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x42\n\tldrh\tr0, [r2]\n\tsub\tr3, r3, r0\n\tstrh\tr3, [r4, #0x6]\n\tldrh\tr1, [r1]\n\tsub\tr1, r1, r5\n\tldrh\tr0, [r2]\n\tsub\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tldr\tr0, .L19+0x8\n\tldrh\tr0, [r0]\n\tmul\tr0, r0, r1\n\tmov\tr5, r8\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L3:\n\tasr\tr4, r0, #0x8\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tldr\tr2, .L19+0xc\n\tldrh\tr1, [r2]\n\tmul\tr0, r0, r1\n\tadd\tr3, r2, #0\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L4:\n\tasr\tr2, r0, #0x8\n\tmov\tr1, ip\n\tldrh\tr0, [r1]\n\tsub\tr4, r0, r4\n\tmov\tr0, r9\n\tcmp\tr0, #0xc\n\tbls\t.L5\t@cond_branch\n\tldr\tr0, .L19+0x10\n\tldr\tr0, [r0]\n\tadd\tr0, r7, r0\n\tsub\tr0, r0, #0x68\n\tldr\tr0, [r0, #0x4]\n\tb\t.L6\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n\t.word\tgBg2XMag\n\t.word\tgBg2YMag\n\t.word\tgUnk_030051DC\n.L5:\n\tldr\tr0, .L21\n\tadd\tr0, r0, #0x4\n\tadd\tr0, r7, r0\n\tldr\tr0, [r0]\n.L6:\n\tldrb\tr0, [r0, #0x5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xb\n\tbhi\t.L16\t@cond_branch\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L21+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\tgUnk_08078FC8\n\t.word\t.L17\n\t.align\t2, 0\n\t.align\t2, 0\n.L17:\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L9\n\t.word\t.L15\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L16\n\t.word\t.L9\n.L9:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tb\t.L18\n.L12:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x5\n\tb\t.L18\n.L15:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x6\n\tb\t.L18\n.L16:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x4\n.L18:\n\tadd\tr2, r1, r0\n\tmov\tr1, r9\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r5\n\tstrh\tr4, [r0, #0x4]\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t TransformSingleEntityToScreen,.Lfe1-TransformSingleEntityToScreen\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function TransformSingleEntityToScreen # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `TransformSingleEntityToScreen` — benchmark function kleod:TransformSingleEntityToScreen:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:TransformSingleEntityToScreen:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tTransformSingleEntityToScreen\n\t.type\t TransformSingleEntityToScreen,function\n\t.thumb_func\nTransformSingleEntityToScreen:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tldr\tr0, .L19\n\tmov\tr8, r0\n\tmov\tr0, r9\n\tlsl\tr7, r0, #0x3\n\tsub\tr4, r7, r0\n\tlsl\tr4, r4, #0x2\n\tadd\tr4, r4, r8\n\tlsl\tr1, r1, #0x18\n\tasr\tr1, r1, #0x18\n\tldrh\tr5, [r4]\n\tsub\tr5, r5, r1\n\tldr\tr6, .L19+0x4\n\tmov\tr1, #0x40\n\tadd\tr1, r1, r6\n\tmov\tip, r1\n\tldrh\tr0, [r1]\n\tsub\tr5, r5, r0\n\tstrh\tr5, [r4, #0x4]\n\tlsl\tr2, r2, #0x18\n\tasr\tr2, r2, #0x18\n\tldrh\tr3, [r4, #0x2]\n\tsub\tr3, r3, r2\n\tadd\tr2, r6, #0\n\tadd\tr2, r2, #0x42\n\tldrh\tr0, [r2]\n\tsub\tr3, r3, r0\n\tstrh\tr3, [r4, #0x6]\n\tldrh\tr1, [r1]\n\tsub\tr1, r1, r5\n\tldrh\tr0, [r2]\n\tsub\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tldr\tr0, .L19+0x8\n\tldrh\tr0, [r0]\n\tmul\tr0, r0, r1\n\tmov\tr5, r8\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L3:\n\tasr\tr4, r0, #0x8\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tldr\tr2, .L19+0xc\n\tldrh\tr1, [r2]\n\tmul\tr0, r0, r1\n\tadd\tr3, r2, #0\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r0, #0xff\n.L4:\n\tasr\tr2, r0, #0x8\n\tmov\tr1, ip\n\tldrh\tr0, [r1]\n\tsub\tr4, r0, r4\n\tmov\tr0, r9\n\tcmp\tr0, #0xc\n\tbls\t.L5\t@cond_branch\n\tldr\tr0, .L19+0x10\n\tldr\tr0, [r0]\n\tadd\tr0, r7, r0\n\tsub\tr0, r0, #0x68\n\tldr\tr0, [r0, #0x4]\n\tb\t.L6\n.L20:\n\t.align\t2, 0\n.L19:\n\t.word\tgUnk_03002920\n\t.word\tgUnk_03003430\n\t.word\tgBg2XMag\n\t.word\tgBg2YMag\n\t.word\tgUnk_030051DC\n.L5:\n\tldr\tr0, .L21\n\tadd\tr0, r0, #0x4\n\tadd\tr0, r7, r0\n\tldr\tr0, [r0]\n.L6:\n\tldrb\tr0, [r0, #0x5]\n\tmov\tr1, #0xf\n\tand\tr1, r1, r0\n\tcmp\tr1, #0xb\n\tbhi\t.L16\t@cond_branch\n\tlsl\tr0, r1, #0x2\n\tldr\tr1, .L21+0x4\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L22:\n\t.align\t2, 0\n.L21:\n\t.word\tgUnk_08078FC8\n\t.word\t.L17\n\t.align\t2, 0\n\t.align\t2, 0\n.L17:\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L9\n\t.word\t.L15\n\t.word\t.L15\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L12\n\t.word\t.L16\n\t.word\t.L16\n\t.word\t.L9\n.L9:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tb\t.L18\n.L12:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x5\n\tb\t.L18\n.L15:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x6\n\tb\t.L18\n.L16:\n\tadd\tr0, r6, #0\n\tadd\tr0, r0, #0x42\n\tldrh\tr1, [r0]\n\tsub\tr1, r1, r2\n\tldrh\tr2, [r3]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x4\n.L18:\n\tadd\tr2, r1, r0\n\tmov\tr1, r9\n\tlsl\tr0, r1, #0x3\n\tsub\tr0, r0, r1\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r5\n\tstrh\tr4, [r0, #0x4]\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t TransformSingleEntityToScreen,.Lfe1-TransformSingleEntityToScreen\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name TransformSingleEntityToScreen # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:UpdateEntities:agbcc","sym":"UpdateEntities","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","branch","call","cast"],"loc":9,"refSource":"void UpdateEntities(void) {\n u8 i;\n for (i = 0; i <= 6; i++) {\n if ((u8)CheckWorldCompletion(i)) {\n CopyWorldMapTiles(i);\n UpdateWorldMapNodeTile(i);\n }\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/code_3.c#L40-L48","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateEntities\n\t.type\t UpdateEntities,function\n\t.thumb_func\nUpdateEntities:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tbl\tCheckWorldCompletion\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r4, #0\n\tbl\tCopyWorldMapTiles\n\tadd\tr0, r4, #0\n\tbl\tUpdateWorldMapNodeTile\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x6\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t UpdateEntities,.Lfe1-UpdateEntities\n\n.text\n\t.align\t2, 0\n","ctx":"u32 CheckWorldCompletion(u8);\nvoid CopyWorldMapTiles(u8);\nvoid UpdateWorldMapNodeTile(u8);","proto":{"UpdateEntities":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void UpdateEntities(void) {\n s32 v0;\n v0 = 0;\n do {\n if (CheckWorldCompletion(v0) << 24 != 0) {\n CopyWorldMapTiles(v0);\n UpdateWorldMapNodeTile(v0);\n }\n v0 = (u8)(v0 + 1);\n } while (v0 <= 6);\n return;\n}\n","score":1,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":12,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void UpdateEntities(void) {\n u8 var_r4;\n\n var_r4 = 0;\n do {\n if ((CheckWorldCompletion(var_r4) << 0x18) != 0) {\n CopyWorldMapTiles(var_r4);\n UpdateWorldMapNodeTile(var_r4);\n }\n var_r4 += 1;\n } while ((u32) var_r4 <= 6U);\n}\n","score":0,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UpdateEntities` — benchmark function kleod:UpdateEntities:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateEntities\n\t.type\t UpdateEntities,function\n\t.thumb_func\nUpdateEntities:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tbl\tCheckWorldCompletion\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r4, #0\n\tbl\tCopyWorldMapTiles\n\tadd\tr0, r4, #0\n\tbl\tUpdateWorldMapNodeTile\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x6\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t UpdateEntities,.Lfe1-UpdateEntities\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nu32 CheckWorldCompletion(u8);\nvoid CopyWorldMapTiles(u8);\nvoid UpdateWorldMapNodeTile(u8);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateEntities # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateEntities` — benchmark function kleod:UpdateEntities:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateEntities:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateEntities\n\t.type\t UpdateEntities,function\n\t.thumb_func\nUpdateEntities:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tbl\tCheckWorldCompletion\n\tlsl\tr0, r0, #0x18\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r4, #0\n\tbl\tCopyWorldMapTiles\n\tadd\tr0, r4, #0\n\tbl\tUpdateWorldMapNodeTile\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tcmp\tr4, #0x6\n\tbls\t.L6\t@cond_branch\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t UpdateEntities,.Lfe1-UpdateEntities\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"UpdateEntities\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateEntities # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:UpdateFadeEffect:agbcc","sym":"UpdateFadeEffect","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["mmio","global","call"],"loc":9,"refSource":"void UpdateFadeEffect(void) {\n vu8 *vcount_reg = ®_VCOUNT_L;\n u8 *entity = gEntityArray;\n u8 fade = sub_08051A0C(*vcount_reg, entity[0x08]);\n\n if (fade <= 16) {\n REG_BLDALPHA = ((u32)fade << 8) | fade;\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/engine.c#L48-L56","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateFadeEffect\n\t.type\t UpdateFadeEffect,function\n\t.thumb_func\nUpdateFadeEffect:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldr\tr1, .L4+0x4\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tbl\tsub_08051A0C\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x10\n\tbhi\t.L3\t@cond_branch\n\tldr\tr1, .L4+0x8\n\tlsl\tr0, r2, #0x8\n\torr\tr0, r0, r2\n\tstrh\tr0, [r1]\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x4000006\n\t.word\tgEntityArray\n\t.word\t0x4000052\n.Lfe1:\n\t.size\t UpdateFadeEffect,.Lfe1-UpdateFadeEffect\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gEntityArray","shape":"u8[]"}],"outcome":"nonmatch","source":"s32 UpdateFadeEffect(void) {\n s32 v0;\n s32 v1;\n v0 = sub_08051A0C(*(u8 *)67108870, gEntityArray[8]);\n if ((u8)v0 > 16) {\n v1 = v0 << 24;\n } else {\n *(u16 *)67108946 = (u8)v0 << 8 | (u8)v0;\n v1 = (u8)v0 << 8 | (u8)v0;\n }\n return v1;\n}\n","score":4,"maxScore":21,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":88,"lines":12,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 sub_08051A0C(u8, u8); /* extern */\n\nvoid UpdateFadeEffect(void) {\n u8 temp_r2;\n\n temp_r2 = sub_08051A0C(*(u8 *)0x04000006, gEntityArray->unk8);\n if ((u32) temp_r2 <= 0x10U) {\n *(s16 *)0x04000052 = (temp_r2 << 8) | temp_r2;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":96,"lines":8,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":2},"errorMarkers":["agbcc failed: /c.c:1077: request for member `unk8' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":4,"maxScore":21,"ratio":0.19047619047619047,"kinds":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UpdateFadeEffect` — benchmark function kleod:UpdateFadeEffect:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateFadeEffect\n\t.type\t UpdateFadeEffect,function\n\t.thumb_func\nUpdateFadeEffect:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldr\tr1, .L4+0x4\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tbl\tsub_08051A0C\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x10\n\tbhi\t.L3\t@cond_branch\n\tldr\tr1, .L4+0x8\n\tlsl\tr0, r2, #0x8\n\torr\tr0, r0, r2\n\tstrh\tr0, [r1]\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x4000006\n\t.word\tgEntityArray\n\t.word\t0x4000052\n.Lfe1:\n\t.size\t UpdateFadeEffect,.Lfe1-UpdateFadeEffect\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid UpdateFadeEffect(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateFadeEffect # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateFadeEffect` — benchmark function kleod:UpdateFadeEffect:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateFadeEffect:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateFadeEffect\n\t.type\t UpdateFadeEffect,function\n\t.thumb_func\nUpdateFadeEffect:\n\tpush\t{lr}\n\tldr\tr0, .L4\n\tldr\tr1, .L4+0x4\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1, #0x8]\n\tbl\tsub_08051A0C\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x10\n\tbhi\t.L3\t@cond_branch\n\tldr\tr1, .L4+0x8\n\tlsl\tr0, r2, #0x8\n\torr\tr0, r0, r2\n\tstrh\tr0, [r1]\n.L3:\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\t0x4000006\n\t.word\tgEntityArray\n\t.word\t0x4000052\n.Lfe1:\n\t.size\t UpdateFadeEffect,.Lfe1-UpdateFadeEffect\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateFadeEffect # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:UpdateHUDCounterDisplay:agbcc","sym":"UpdateHUDCounterDisplay","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","array","branch","soft-div"],"loc":35,"refSource":"s32 UpdateHUDCounterDisplay(void) {\n s32 var_r5;\n s32 var_sb;\n\n var_sb = 0;\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5 = 0x64;\n } else {\n var_r5 = 0x1E;\n }\n if (var_r5 == gUnk_03005220.dreamStones) {\n var_sb = 1;\n }\n\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5 = 1;\n if (gUnk_03005220.dreamStones > 0x63) {\n gBgTilemapBufs[0][0x252] += 0;\n gBgTilemapBufs[0][0x252] = gBgTilemapBufs[0][0x293];\n gBgTilemapBufs[0][0x272] += 0;\n gBgTilemapBufs[0][0x272] = gBgTilemapBufs[0][0x2B3];\n }\n } else {\n var_r5 = 0;\n }\n\n if (gUnk_03005220.dreamStones > 9) {\n gBgTilemapBufs[0][0x254 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones / 10) + 0x292];\n gBgTilemapBufs[0][0x274 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones / 10) + 0x2B2];\n }\n\n gBgTilemapBufs[0][0x255 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones % 10) + 0x292];\n gBgTilemapBufs[0][0x275 - var_r5] = gBgTilemapBufs[0][(gUnk_03005220.dreamStones % 10) + 0x2B2];\n return var_sb;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_1.c#L1184-L1218","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateHUDCounterDisplay\n\t.type\t UpdateHUDCounterDisplay,function\n\t.thumb_func\nUpdateHUDCounterDisplay:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tldr\tr0, .L12\n\tldrb\tr1, [r0, #0xa]\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L3\t@cond_branch\n.L4:\n\tmov\tr5, #0x64\n\tb\t.L5\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgUnk_03004C20\n.L3:\n\tmov\tr5, #0x1e\n.L5:\n\tldr\tr1, .L14\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr2, r0, #0x19\n\tmov\tr8, r1\n\tcmp\tr5, r2\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x1\n\tmov\tr9, r1\n.L6:\n\tldrb\tr0, [r3, #0xa]\n\tcmp\tr0, #0x1\n\tbeq\t.L8\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L7\t@cond_branch\n.L8:\n\tmov\tr5, #0x1\n\tldr\tr6, .L14+0x4\n\tcmp\tr2, #0x63\n\tble\t.L10\t@cond_branch\n\tldr\tr2, .L14+0x8\n\tadd\tr1, r6, r2\n\tadd\tr2, r2, #0x82\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L14+0xc\n\tadd\tr1, r6, r0\n\tadd\tr2, r2, #0x40\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L10\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x4a4\n\t.word\t0x4e4\n.L7:\n\tmov\tr5, #0x0\n\tldr\tr6, .L16\n.L10:\n\tmov\tr7, r8\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tcmp\tr0, #0x9\n\tble\t.L11\t@cond_branch\n\tmov\tr4, #0x95\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr1, .L16+0x4\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr4, #0x9d\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n.L11:\n\tldr\tr4, .L16+0xc\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x4\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldr\tr4, .L16+0x10\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr0, r9\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgBgTilemapBufs\n\t.word\t0x292\n\t.word\t0x2b2\n\t.word\t0x255\n\t.word\t0x275\n.Lfe1:\n\t.size\t UpdateHUDCounterDisplay,.Lfe1-UpdateHUDCounterDisplay\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","droppedCandidates":[{"label":"unsigned/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-CcKKJi/c.c:1088: incompatible types in assignment"},{"label":"signed/raw-globals","error":"agbcc failed: /var/folders/q_/6tsqtbsd2ks6l381b5yc8fvh0000gn/T/bench-cand-yO9fF2/c.c:1088: incompatible types in assignment"}],"symbolsUsed":[{"name":"gBgTilemapBufs","shape":"u16[]"},{"name":"gUnk_03004C20","shape":"struct Unk_03004C20 (24 B)"},{"name":"gUnk_03005220","shape":"struct Unk_03005220 (100 B)"}],"outcome":"nonmatch","source":"s32 UpdateHUDCounterDisplay(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n u16 * v5;\n if (gUnk_03004C20.unkA == 1) {\n v2 = 100;\n } else {\n if (gUnk_03004C20.level != 6) {\n v2 = 30;\n } else {\n v2 = 100;\n }\n }\n v0 = *(u16 *)&gUnk_03005220;\n if (v2 != (u32)(v0 << 20) >> 25) {\n v3 = 0;\n } else {\n v3 = 1;\n }\n if (gUnk_03004C20.unkA == 1) {\n if ((u32)(v0 << 20) >> 25 <= 99) {\n v4 = 1;\n v5 = &gBgTilemapBufs;\n } else {\n gBgTilemapBufs[0][594] = gBgTilemapBufs[0][659];\n gBgTilemapBufs[0][626] = gBgTilemapBufs[0][691];\n v4 = 1;\n v5 = &gBgTilemapBufs;\n }\n } else {\n if (gUnk_03004C20.level != 6) {\n v4 = 0;\n v5 = &gBgTilemapBufs;\n } else {\n if ((u32)(v0 << 20) >> 25 <= 99) {\n v4 = 1;\n v5 = &gBgTilemapBufs;\n } else {\n gBgTilemapBufs[0][594] = gBgTilemapBufs[0][659];\n gBgTilemapBufs[0][626] = gBgTilemapBufs[0][691];\n v4 = 1;\n v5 = &gBgTilemapBufs;\n }\n }\n }\n v1 = *(u16 *)&gUnk_03005220;\n if ((u32)(v1 << 20) >> 25 > 9) {\n v5[(149 << 2) - v4] = v5[((u32)(v1 << 20) >> 25) / 10 + 658];\n v5[(157 << 2) - v4] = v5[((u32)(*(u16 *)&gUnk_03005220 << 20) >> 25) / 10 + 690];\n }\n v5[597 - v4] = v5[((u32)(*(u16 *)&gUnk_03005220 << 20) >> 25) % 10 + 658];\n v5[629 - v4] = v5[((u32)(*(u16 *)&gUnk_03005220 << 20) >> 25) % 10 + 690];\n return v3;\n}\n","score":127,"maxScore":181,"compileErrors":null,"breakdown":{"insert":45,"delete":20,"replace":5,"opMismatch":9,"argMismatch":48},"quality":{"score":88,"lines":57,"gotos":0,"casts":13,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 UpdateHUDCounterDisplay(void) {\n s32 var_r5;\n s32 var_r5_2;\n s32 var_r9;\n u32 temp_r0;\n u32 temp_r2;\n\n var_r9 = 0;\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5 = 0x64;\n } else {\n var_r5 = 0x1E;\n }\n temp_r2 = (u32) (gUnk_03005220 << 0x14) >> 0x19;\n if (var_r5 == temp_r2) {\n var_r9 = 1;\n }\n if ((gUnk_03004C20.unkA == 1) || (gUnk_03004C20.level == 6)) {\n var_r5_2 = 1;\n if ((s32) temp_r2 > 0x63) {\n gBgTilemapBufs[0][0x252] = gBgTilemapBufs[0][0x293];\n gBgTilemapBufs[0][0x272] = gBgTilemapBufs[0][0x2B3];\n }\n } else {\n var_r5_2 = 0;\n }\n temp_r0 = (u32) (gUnk_03005220 << 0x14) >> 0x19;\n if ((s32) temp_r0 > 9) {\n gBgTilemapBufs->unk0[0x254 - var_r5_2] = gBgTilemapBufs->unk0[((s32) temp_r0 / 10) + 0x292];\n gBgTilemapBufs->unk0[0x274 - var_r5_2] = gBgTilemapBufs->unk0[((s32) ((u32) (gUnk_03005220 << 0x14) >> 0x19) / 10) + 0x2B2];\n }\n gBgTilemapBufs->unk0[0x255 - var_r5_2] = gBgTilemapBufs->unk0[((s32) ((u32) (gUnk_03005220 << 0x14) >> 0x19) % 10) + 0x292];\n gBgTilemapBufs->unk0[0x275 - var_r5_2] = gBgTilemapBufs->unk0[((s32) ((u32) (gUnk_03005220 << 0x14) >> 0x19) % 10) + 0x2B2];\n return var_r9;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":34,"gotos":0,"casts":12,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:1085: invalid operands to binary <<","/c.c:1098: invalid operands to binary <<","/c.c:1100: request for member `unk0' in something not a structure or union","/c.c:1101: request for member `unk0' in something not a structure or union","/c.c:1101: invalid operands to binary <<"]},"gapSize":{"decompiler":"asmlift","score":127,"maxScore":181,"ratio":0.7016574585635359,"kinds":{"insert":45,"delete":20,"replace":5,"opMismatch":9,"argMismatch":48}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UpdateHUDCounterDisplay` — benchmark function kleod:UpdateHUDCounterDisplay:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateHUDCounterDisplay\n\t.type\t UpdateHUDCounterDisplay,function\n\t.thumb_func\nUpdateHUDCounterDisplay:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tldr\tr0, .L12\n\tldrb\tr1, [r0, #0xa]\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L3\t@cond_branch\n.L4:\n\tmov\tr5, #0x64\n\tb\t.L5\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgUnk_03004C20\n.L3:\n\tmov\tr5, #0x1e\n.L5:\n\tldr\tr1, .L14\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr2, r0, #0x19\n\tmov\tr8, r1\n\tcmp\tr5, r2\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x1\n\tmov\tr9, r1\n.L6:\n\tldrb\tr0, [r3, #0xa]\n\tcmp\tr0, #0x1\n\tbeq\t.L8\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L7\t@cond_branch\n.L8:\n\tmov\tr5, #0x1\n\tldr\tr6, .L14+0x4\n\tcmp\tr2, #0x63\n\tble\t.L10\t@cond_branch\n\tldr\tr2, .L14+0x8\n\tadd\tr1, r6, r2\n\tadd\tr2, r2, #0x82\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L14+0xc\n\tadd\tr1, r6, r0\n\tadd\tr2, r2, #0x40\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L10\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x4a4\n\t.word\t0x4e4\n.L7:\n\tmov\tr5, #0x0\n\tldr\tr6, .L16\n.L10:\n\tmov\tr7, r8\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tcmp\tr0, #0x9\n\tble\t.L11\t@cond_branch\n\tmov\tr4, #0x95\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr1, .L16+0x4\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr4, #0x9d\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n.L11:\n\tldr\tr4, .L16+0xc\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x4\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldr\tr4, .L16+0x10\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr0, r9\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgBgTilemapBufs\n\t.word\t0x292\n\t.word\t0x2b2\n\t.word\t0x255\n\t.word\t0x275\n.Lfe1:\n\t.size\t UpdateHUDCounterDisplay,.Lfe1-UpdateHUDCounterDisplay\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 UpdateHUDCounterDisplay(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateHUDCounterDisplay # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateHUDCounterDisplay` — benchmark function kleod:UpdateHUDCounterDisplay:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateHUDCounterDisplay:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateHUDCounterDisplay\n\t.type\t UpdateHUDCounterDisplay,function\n\t.thumb_func\nUpdateHUDCounterDisplay:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tldr\tr0, .L12\n\tldrb\tr1, [r0, #0xa]\n\tadd\tr3, r0, #0\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L3\t@cond_branch\n.L4:\n\tmov\tr5, #0x64\n\tb\t.L5\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgUnk_03004C20\n.L3:\n\tmov\tr5, #0x1e\n.L5:\n\tldr\tr1, .L14\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr2, r0, #0x19\n\tmov\tr8, r1\n\tcmp\tr5, r2\n\tbne\t.L6\t@cond_branch\n\tmov\tr1, #0x1\n\tmov\tr9, r1\n.L6:\n\tldrb\tr0, [r3, #0xa]\n\tcmp\tr0, #0x1\n\tbeq\t.L8\t@cond_branch\n\tldrb\tr0, [r3, #0xc]\n\tcmp\tr0, #0x6\n\tbne\t.L7\t@cond_branch\n.L8:\n\tmov\tr5, #0x1\n\tldr\tr6, .L14+0x4\n\tcmp\tr2, #0x63\n\tble\t.L10\t@cond_branch\n\tldr\tr2, .L14+0x8\n\tadd\tr1, r6, r2\n\tadd\tr2, r2, #0x82\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tldr\tr0, .L14+0xc\n\tadd\tr1, r6, r0\n\tadd\tr2, r2, #0x40\n\tadd\tr0, r6, r2\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tb\t.L10\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgUnk_03005220\n\t.word\tgBgTilemapBufs\n\t.word\t0x4a4\n\t.word\t0x4e4\n.L7:\n\tmov\tr5, #0x0\n\tldr\tr6, .L16\n.L10:\n\tmov\tr7, r8\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tcmp\tr0, #0x9\n\tble\t.L11\t@cond_branch\n\tmov\tr4, #0x95\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr1, .L16+0x4\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr4, #0x9d\n\tlsl\tr4, r4, #0x2\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tldrh\tr0, [r7]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n.L11:\n\tldr\tr4, .L16+0xc\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x4\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tldr\tr4, .L16+0x10\n\tsub\tr4, r4, r5\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r6\n\tmov\tr1, r8\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x14\n\tlsr\tr0, r0, #0x19\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tldr\tr2, .L16+0x8\n\tadd\tr0, r0, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r4]\n\tmov\tr0, r9\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgBgTilemapBufs\n\t.word\t0x292\n\t.word\t0x2b2\n\t.word\t0x255\n\t.word\t0x275\n.Lfe1:\n\t.size\t UpdateHUDCounterDisplay,.Lfe1-UpdateHUDCounterDisplay\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateHUDCounterDisplay # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:UpdateWorldMapNodeTile:agbcc","sym":"UpdateWorldMapNodeTile","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","array","branch","table"],"loc":22,"refSource":"void UpdateWorldMapNodeTile(u8 arg0) {\n vu32 a; // Required to match\n if (arg0 < 4) {\n gBgTilemapBufs[1][gUnk_08116748[arg0][0] + (gUnk_08116748[arg0][1] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 0];\n gBgTilemapBufs[1][gUnk_08116748[arg0][2] + (gUnk_08116748[arg0][3] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 1];\n gBgTilemapBufs[1][gUnk_08116748[arg0][4] + (gUnk_08116748[arg0][5] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 2];\n gBgTilemapBufs[1][gUnk_08116748[arg0][6] + (gUnk_08116748[arg0][7] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 3];\n } else {\n gBgTilemapBufs[1][gUnk_08116748[arg0][0] + (gUnk_08116748[arg0][1] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 4];\n gBgTilemapBufs[1][gUnk_08116748[arg0][2] + (gUnk_08116748[arg0][3] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 5];\n gBgTilemapBufs[1][gUnk_08116748[arg0][4] + (gUnk_08116748[arg0][5] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 6];\n gBgTilemapBufs[1][gUnk_08116748[arg0][6] + (gUnk_08116748[arg0][7] << 5)]\n = gBgTilemapBufs[1][((gUnk_08116880[arg0] + 0x1C) * 0x20) + 7];\n }\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/ed09229e28615a1bd585a5be6b1a9ba2c8a77315/src/code_3.c#L1849-L1870","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeTile\n\t.type\t UpdateWorldMapNodeTile,function\n\t.thumb_func\nUpdateWorldMapNodeTile:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr6, .L6\n\tldr\tr4, .L6+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L6+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr0, r3, #0x6\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x3\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.L3:\n\tldr\tr6, .L8\n\tldr\tr4, .L8+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L8+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x4\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x5\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x6\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x7\n.L5:\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r6\n\tldrh\tr1, [r3]\n\tstrh\tr1, [r0]\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.Lfe1:\n\t.size\t UpdateWorldMapNodeTile,.Lfe1-UpdateWorldMapNodeTile\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'UpdateWorldMapNodeTile' — lift: cannot lift 'UpdateWorldMapNodeTile': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tUpdateWorldMapNodeTile */\n/* \t.type\t UpdateWorldMapNodeTile,function */\n/* \t.thumb_func */\n/* UpdateWorldMapNodeTile: */\n/* \tpush\t{r4, r5, r6, lr} */\n/* \tadd\tsp, sp, #-0x4 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr3, r0, #0x18 */\n/* \tcmp\tr3, #0x3 */\n/* \tbhi\t.L3\t@cond_branch */\n/* \tldr\tr6, .L6 */\n/* \tldr\tr4, .L6+0x4 */\n/* \tlsl\tr5, r3, #0x3 */\n/* \tadd\tr2, r5, r4 */\n/* \tadd\tr0, r4, #0x1 */\n/* \tadd\tr0, r5, r0 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr2, [r2] */\n/* \tadd\tr1, r1, r2 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tadd\tr6, r6, r0 */\n/* \tadd\tr1, r1, r6 */\n/* \tldr\tr0, .L6+0x8 */\n/* \tadd\tr0, r3, r0 */\n/* \tldrb\tr3, [r0] */\n/* \tadd\tr3, r3, #0x1c */\n/* \tlsl\tr0, r3, #0x6 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr2, r4, #0x2 */\n/* \tadd\tr2, r5, r2 */\n/* \tadd\tr0, r4, #0x3 */\n/* \tadd\tr0, r5, r0 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr2, [r2] */\n/* \tadd\tr1, r1, r2 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tadd\tr1, r1, r6 */\n/* \tlsl\tr3, r3, #0x5 */\n/* \tadd\tr0, r3, #0x1 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr2, r4, #0x4 */\n/* \tadd\tr2, r5, r2 */\n/* \tadd\tr0, r4, #0x5 */\n/* \tadd\tr0, r5, r0 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr2, [r2] */\n/* \tadd\tr1, r1, r2 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tadd\tr1, r1, r6 */\n/* \tadd\tr0, r3, #0x2 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr1, r4, #0x6 */\n/* \tadd\tr1, r5, r1 */\n/* \tadd\tr4, r4, #0x7 */\n/* \tadd\tr5, r5, r4 */\n/* \tldrb\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x5 */\n/* \tldrb\tr1, [r1] */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tadd\tr3, r3, #0x3 */\n/* \tb\t.L5 */\n/* .L7: */\n/* \t.align\t2, 0 */\n/* .L6: */\n/* \t.word\tgBgTilemapBufs */\n/* \t.word\tgUnk_08116748 */\n/* \t.word\tgUnk_08116880 */\n/* .L3: */\n/* \tldr\tr6, .L8 */\n/* \tldr\tr4, .L8+0x4 */\n/* \tlsl\tr5, r3, #0x3 */\n/* \tadd\tr2, r5, r4 */\n/* \tadd\tr0, r4, #0x1 */\n/* \tadd\tr0, r5, r0 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr2, [r2] */\n/* \tadd\tr1, r1, r2 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tadd\tr6, r6, r0 */\n/* \tadd\tr1, r1, r6 */\n/* \tldr\tr0, .L8+0x8 */\n/* \tadd\tr0, r3, r0 */\n/* \tldrb\tr3, [r0] */\n/* \tadd\tr3, r3, #0x1c */\n/* \tlsl\tr3, r3, #0x5 */\n/* \tadd\tr0, r3, #0x4 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr2, r4, #0x2 */\n/* \tadd\tr2, r5, r2 */\n/* \tadd\tr0, r4, #0x3 */\n/* \tadd\tr0, r5, r0 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr2, [r2] */\n/* \tadd\tr1, r1, r2 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tadd\tr1, r1, r6 */\n/* \tadd\tr0, r3, #0x5 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr2, r4, #0x4 */\n/* \tadd\tr2, r5, r2 */\n/* \tadd\tr0, r4, #0x5 */\n/* \tadd\tr0, r5, r0 */\n/* \tldrb\tr1, [r0] */\n/* \tlsl\tr1, r1, #0x5 */\n/* \tldrb\tr2, [r2] */\n/* \tadd\tr1, r1, r2 */\n/* \tlsl\tr1, r1, #0x1 */\n/* \tadd\tr1, r1, r6 */\n/* \tadd\tr0, r3, #0x6 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tstrh\tr0, [r1] */\n/* \tadd\tr1, r4, #0x6 */\n/* \tadd\tr1, r5, r1 */\n/* \tadd\tr4, r4, #0x7 */\n/* \tadd\tr5, r5, r4 */\n/* \tldrb\tr0, [r5] */\n/* \tlsl\tr0, r0, #0x5 */\n/* \tldrb\tr1, [r1] */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x1 */\n/* \tadd\tr0, r0, r6 */\n/* \tadd\tr3, r3, #0x7 */\n/* .L5: */\n/* \tlsl\tr3, r3, #0x1 */\n/* \tadd\tr3, r3, r6 */\n/* \tldrh\tr1, [r3] */\n/* \tstrh\tr1, [r0] */\n/* \tadd\tsp, sp, #0x4 */\n/* \tpop\t{r4, r5, r6} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L9: */\n/* \t.align\t2, 0 */\n/* .L8: */\n/* \t.word\tgBgTilemapBufs */\n/* \t.word\tgUnk_08116748 */\n/* \t.word\tgUnk_08116880 */\n/* .Lfe1: */\n/* \t.size\t UpdateWorldMapNodeTile,.Lfe1-UpdateWorldMapNodeTile */\n/* .text */\n/* \t.align\t2, 0 */\nvoid UpdateWorldMapNodeTile(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'UpdateWorldMapNodeTile': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":178,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'UpdateWorldMapNodeTile': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void UpdateWorldMapNodeTile(u8 arg0) {\n s32 temp_r3_2;\n s32 temp_r3_3;\n s32 temp_r3_4;\n s32 temp_r5;\n s32 temp_r5_2;\n s32 var_r3;\n u16 (*var_r6)[0x400];\n u16 *var_r0;\n u8 temp_r3;\n\n temp_r3 = arg0;\n if ((u32) temp_r3 <= 3U) {\n temp_r5 = temp_r3 * 8;\n var_r6 = gBgTilemapBufs + 0x800;\n temp_r3_2 = gUnk_08116880[temp_r3] + 0x1C;\n (*var_r6)[(*(temp_r5 + &gUnk_08116748[0][1]) << 5) + *gUnk_08116748[temp_r3]] = *((temp_r3_2 << 6) + var_r6);\n temp_r3_3 = temp_r3_2 << 5;\n (*var_r6)[(*(temp_r5 + &gUnk_08116748[0][3]) << 5) + *(temp_r5 + &gUnk_08116748[0][2])] = (*var_r6)[temp_r3_3 + 1];\n (*var_r6)[(*(temp_r5 + &gUnk_08116748[0][5]) << 5) + *(temp_r5 + &gUnk_08116748[0][4])] = (*var_r6)[temp_r3_3 + 2];\n var_r0 = &(*var_r6)[(*(temp_r5 + &gUnk_08116748[0][7]) << 5) + *(temp_r5 + &gUnk_08116748[0][6])];\n var_r3 = temp_r3_3 + 3;\n } else {\n temp_r5_2 = temp_r3 * 8;\n var_r6 = gBgTilemapBufs + 0x800;\n temp_r3_4 = (gUnk_08116880[temp_r3] + 0x1C) << 5;\n (*var_r6)[(*(temp_r5_2 + &gUnk_08116748[0][1]) << 5) + *gUnk_08116748[temp_r3]] = (*var_r6)[temp_r3_4 + 4];\n (*var_r6)[(*(temp_r5_2 + &gUnk_08116748[0][3]) << 5) + *(temp_r5_2 + &gUnk_08116748[0][2])] = (*var_r6)[temp_r3_4 + 5];\n (*var_r6)[(*(temp_r5_2 + &gUnk_08116748[0][5]) << 5) + *(temp_r5_2 + &gUnk_08116748[0][4])] = (*var_r6)[temp_r3_4 + 6];\n var_r0 = &(*var_r6)[(*(temp_r5_2 + &gUnk_08116748[0][7]) << 5) + *(temp_r5_2 + &gUnk_08116748[0][6])];\n var_r3 = temp_r3_4 + 7;\n }\n *var_r0 = (*var_r6)[var_r3];\n}\n","score":151,"maxScore":170,"compileErrors":null,"breakdown":{"insert":18,"delete":36,"replace":12,"opMismatch":2,"argMismatch":83},"quality":{"score":100,"lines":33,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":151,"maxScore":170,"ratio":0.888235294117647,"kinds":{"insert":18,"delete":36,"replace":12,"opMismatch":2,"argMismatch":83}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UpdateWorldMapNodeTile` — benchmark function kleod:UpdateWorldMapNodeTile:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeTile\n\t.type\t UpdateWorldMapNodeTile,function\n\t.thumb_func\nUpdateWorldMapNodeTile:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr6, .L6\n\tldr\tr4, .L6+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L6+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr0, r3, #0x6\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x3\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.L3:\n\tldr\tr6, .L8\n\tldr\tr4, .L8+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L8+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x4\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x5\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x6\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x7\n.L5:\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r6\n\tldrh\tr1, [r3]\n\tstrh\tr1, [r0]\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.Lfe1:\n\t.size\t UpdateWorldMapNodeTile,.Lfe1-UpdateWorldMapNodeTile\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/kleod/ctx-b4ae03db0859.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid UpdateWorldMapNodeTile(u8 arg0);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UpdateWorldMapNodeTile # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UpdateWorldMapNodeTile` — benchmark function kleod:UpdateWorldMapNodeTile:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:UpdateWorldMapNodeTile:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tUpdateWorldMapNodeTile\n\t.type\t UpdateWorldMapNodeTile,function\n\t.thumb_func\nUpdateWorldMapNodeTile:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x4\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tcmp\tr3, #0x3\n\tbhi\t.L3\t@cond_branch\n\tldr\tr6, .L6\n\tldr\tr4, .L6+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L6+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr0, r3, #0x6\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x3\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.L3:\n\tldr\tr6, .L8\n\tldr\tr4, .L8+0x4\n\tlsl\tr5, r3, #0x3\n\tadd\tr2, r5, r4\n\tadd\tr0, r4, #0x1\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tadd\tr6, r6, r0\n\tadd\tr1, r1, r6\n\tldr\tr0, .L8+0x8\n\tadd\tr0, r3, r0\n\tldrb\tr3, [r0]\n\tadd\tr3, r3, #0x1c\n\tlsl\tr3, r3, #0x5\n\tadd\tr0, r3, #0x4\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x2\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x3\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x5\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr2, r4, #0x4\n\tadd\tr2, r5, r2\n\tadd\tr0, r4, #0x5\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r0]\n\tlsl\tr1, r1, #0x5\n\tldrb\tr2, [r2]\n\tadd\tr1, r1, r2\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r6\n\tadd\tr0, r3, #0x6\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tstrh\tr0, [r1]\n\tadd\tr1, r4, #0x6\n\tadd\tr1, r5, r1\n\tadd\tr4, r4, #0x7\n\tadd\tr5, r5, r4\n\tldrb\tr0, [r5]\n\tlsl\tr0, r0, #0x5\n\tldrb\tr1, [r1]\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, r6\n\tadd\tr3, r3, #0x7\n.L5:\n\tlsl\tr3, r3, #0x1\n\tadd\tr3, r3, r6\n\tldrh\tr1, [r3]\n\tstrh\tr1, [r0]\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgBgTilemapBufs\n\t.word\tgUnk_08116748\n\t.word\tgUnk_08116880\n.Lfe1:\n\t.size\t UpdateWorldMapNodeTile,.Lfe1-UpdateWorldMapNodeTile\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name UpdateWorldMapNodeTile # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:VBlankHandlerMinimal:agbcc","sym":"VBlankHandlerMinimal","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["mmio","global","call"],"loc":5,"refSource":"void VBlankHandlerMinimal(void) {\n m4aSoundVSync();\n m4aSoundMain();\n gIMEAcknowledge = 1;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/math.c#L71-L75","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVBlankHandlerMinimal\n\t.type\t VBlankHandlerMinimal,function\n\t.thumb_func\nVBlankHandlerMinimal:\n\tpush\t{lr}\n\tbl\tm4aSoundVSync\n\tbl\tm4aSoundMain\n\tldr\tr1, .L3\n\tmov\tr0, #0x1\n\tstrh\tr0, [r1]\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3007ff8\n.Lfe1:\n\t.size\t VBlankHandlerMinimal,.Lfe1-VBlankHandlerMinimal\n\n.text\n\t.align\t2, 0\n","ctx":"void m4aSoundVSync(void);\nvoid m4aSoundMain(void);","proto":{"VBlankHandlerMinimal":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gIMEAcknowledge","shape":"scalar u16"}],"outcome":"match","source":"void VBlankHandlerMinimal(void) {\n m4aSoundMain(m4aSoundVSync());\n gIMEAcknowledge = 1;\n return;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void VBlankHandlerMinimal(void) {\n m4aSoundVSync();\n m4aSoundMain();\n *(s16 *)0x03007FF8 = 1;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":1}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `VBlankHandlerMinimal` — benchmark function kleod:VBlankHandlerMinimal:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVBlankHandlerMinimal\n\t.type\t VBlankHandlerMinimal,function\n\t.thumb_func\nVBlankHandlerMinimal:\n\tpush\t{lr}\n\tbl\tm4aSoundVSync\n\tbl\tm4aSoundMain\n\tldr\tr1, .L3\n\tmov\tr0, #0x1\n\tstrh\tr0, [r1]\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3007ff8\n.Lfe1:\n\t.size\t VBlankHandlerMinimal,.Lfe1-VBlankHandlerMinimal\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid m4aSoundVSync(void);\nvoid m4aSoundMain(void);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function VBlankHandlerMinimal # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `VBlankHandlerMinimal` — benchmark function kleod:VBlankHandlerMinimal:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:VBlankHandlerMinimal:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVBlankHandlerMinimal\n\t.type\t VBlankHandlerMinimal,function\n\t.thumb_func\nVBlankHandlerMinimal:\n\tpush\t{lr}\n\tbl\tm4aSoundVSync\n\tbl\tm4aSoundMain\n\tldr\tr1, .L3\n\tmov\tr0, #0x1\n\tstrh\tr0, [r1]\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3007ff8\n.Lfe1:\n\t.size\t VBlankHandlerMinimal,.Lfe1-VBlankHandlerMinimal\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"VBlankHandlerMinimal\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VBlankHandlerMinimal # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"kleod:WritePaletteColor:agbcc","sym":"WritePaletteColor","project":"kleod","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["call","global","pointer","memory","mmio"],"loc":7,"refSource":"void WritePaletteColor(void) {\n u8 **gp = &gStreamPtr;\n u16 color = ReadUnalignedU16(*gp + 3);\n u8 *ptr = *gp;\n *(u16 *)(BG_PAL_RAM + ptr[2] * 2) = color;\n *gp = ptr + 5;\n}","sourceUrl":"https://github.com/Dream-Atelier/kl-eod-decomp/blob/494f49912be3c9f6d893dd5bc15fd81be64f4d13/src/gfx.c#L448-L454","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tWritePaletteColor\n\t.type\t WritePaletteColor,function\n\t.thumb_func\nWritePaletteColor:\n\tpush\t{r4, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr1, [r3, #0x2]\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, #0xa0\n\tlsl\tr2, r2, #0x13\n\tadd\tr1, r1, r2\n\tstrh\tr0, [r1]\n\tadd\tr3, r3, #0x5\n\tstr\tr3, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t WritePaletteColor,.Lfe1-WritePaletteColor\n\n.text\n\t.align\t2, 0\n","proto":{"WritePaletteColor":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void WritePaletteColor(void) {\n s32 * v0;\n s32 v1;\n u8 * v2;\n v0 = (s32 *)50351492;\n v1 = ReadUnalignedU16(*v0 + 3);\n v2 = (u8 *)*v0;\n ((u16 *)(160 << 19))[v2[2]] = v1;\n *v0 = v2 + 5;\n return;\n}\n","score":0,"maxScore":18,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":11,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s16 ReadUnalignedU16(s32); /* extern */\n\nvoid WritePaletteColor(void) {\n void *temp_r3;\n\n temp_r3 = *(void **)0x03004D84;\n (temp_r3->unk2 * 2)->unk5000000 = ReadUnalignedU16(*(void **)0x03004D84 + 3);\n *(void **)0x03004D84 = temp_r3 + 5;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":94,"lines":7,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":3},"errorMarkers":["agbcc failed: /c.c:1073: conflicting types for `ReadUnalignedU16'","/c.c:1071: previous declaration of `ReadUnalignedU16'","/c.c:1079: warning: dereferencing `void *' pointer","/c.c:1079: request for member `unk2' in something not a structure or union","/c.c:1079: warning: passing arg 1 of `ReadUnalignedU16' makes integer from pointer without a cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `WritePaletteColor` — benchmark function kleod:WritePaletteColor:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tWritePaletteColor\n\t.type\t WritePaletteColor,function\n\t.thumb_func\nWritePaletteColor:\n\tpush\t{r4, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr1, [r3, #0x2]\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, #0xa0\n\tlsl\tr2, r2, #0x13\n\tadd\tr1, r1, r2\n\tstrh\tr0, [r1]\n\tadd\tr3, r3, #0x5\n\tstr\tr3, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t WritePaletteColor,.Lfe1-WritePaletteColor\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function WritePaletteColor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `WritePaletteColor` — benchmark function kleod:WritePaletteColor:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/Dream-Atelier/kl-eod-decomp.git klonoa-empire-of-dreams\n# make -C klonoa-empire-of-dreams\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/kleod/symbols.json.gz\n# sha256 of the decompressed map JSON: e01bf79c83f6fffa960d9dd1fc84233cc074b385a825136f5ac3f159416eed70\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/klonoa-empire-of-dreams'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target kleod:WritePaletteColor:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tWritePaletteColor\n\t.type\t WritePaletteColor,function\n\t.thumb_func\nWritePaletteColor:\n\tpush\t{r4, lr}\n\tldr\tr4, .L3\n\tldr\tr0, [r4]\n\tadd\tr0, r0, #0x3\n\tbl\tReadUnalignedU16\n\tldr\tr3, [r4]\n\tldrb\tr1, [r3, #0x2]\n\tlsl\tr1, r1, #0x1\n\tmov\tr2, #0xa0\n\tlsl\tr2, r2, #0x13\n\tadd\tr1, r1, r2\n\tstrh\tr0, [r1]\n\tadd\tr3, r3, #0x5\n\tstr\tr3, [r4]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0x3004d84\n.Lfe1:\n\t.size\t WritePaletteColor,.Lfe1-WritePaletteColor\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"WritePaletteColor\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name WritePaletteColor # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:CameraScissorSet:gcc2.7.2","sym":"CameraScissorSet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","arithmetic"],"loc":7,"refSource":"void CameraScissorSet(s16 camIndex, RectF *arg1) {\n HuCamera *camera = &gCameraList[camIndex];\n camera->screenLeft = arg1->x1;\n camera->screenTop = arg1->y1;\n camera->screenRight = arg1->x2;\n camera->screenBottom = arg1->y2;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L72-L78","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x3\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x2\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x4\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\taddu\tv0,v0,v1\n 28:\tlwc1\t$f0,0(a1)\n 2c:\tswc1\t$f0,144(v0)\n 30:\tlwc1\t$f0,4(a1)\n 34:\tswc1\t$f0,148(v0)\n 38:\tlwc1\t$f0,8(a1)\n 3c:\tswc1\t$f0,152(v0)\n 40:\tlwc1\t$f0,12(a1)\n 44:\tjr\tra\n 48:\tswc1\t$f0,156(v0)\n 4c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-3f9d594d88fa.i.gz","proto":{"CameraScissorSet":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-333d6c1dd230dd41/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c CameraScissorSet\n00000000 *UND*\t00000000 gCameraList\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 gCameraList\n00000020 R_MIPS_LO16 gCameraList\n\n\nContents of section .text:\n 0000 00042400 00042403 000410c0 00441021 ..$...$......D.!\n 0010 00021080 00441023 00021100 3c030000 .....D.#....<...\n 0020 8c630000 00431021 c4a00000 e4400090 .c...C.!.....@..\n 0030 c4a00004 e4400094 c4a00008 e4400098 .....@.......@..\n 0040 c4a0000c 03e00008 e440009c 00000000 .........@......\nContents of section .reginfo:\n 0000 8000003c 00000000 00000001 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'CameraScissorSet' — lift: cannot lift 'CameraScissorSet @0x28': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsll\ta0,a0,0x10 */\n/* 4:\tsra\ta0,a0,0x10 */\n/* 8:\tsll\tv0,a0,0x3 */\n/* c:\taddu\tv0,v0,a0 */\n/* 10:\tsll\tv0,v0,0x2 */\n/* 14:\tsubu\tv0,v0,a0 */\n/* 18:\tsll\tv0,v0,0x4 */\n/* 1c:\tlui\tv1,0x0 */\n/* 20:\tlw\tv1,0(v1) */\n/* 24:\taddu\tv0,v0,v1 */\n/* 28:\tlwc1\t$f0,0(a1) */\n/* 2c:\tswc1\t$f0,144(v0) */\n/* 30:\tlwc1\t$f0,4(a1) */\n/* 34:\tswc1\t$f0,148(v0) */\n/* 38:\tlwc1\t$f0,8(a1) */\n/* 3c:\tswc1\t$f0,152(v0) */\n/* 40:\tlwc1\t$f0,12(a1) */\n/* 44:\tjr\tra */\n/* 48:\tswc1\t$f0,156(v0) */\n/* 4c:\tnop */\nvoid CameraScissorSet(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'CameraScissorSet @0x28': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":28,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'CameraScissorSet @0x28': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void CameraScissorSet(s16 camIndex, RectF *arg1) {\n HuCamera *temp_v0;\n\n temp_v0 = &gCameraList[camIndex];\n temp_v0->screenLeft = arg1->x1;\n temp_v0->screenTop = arg1->y1;\n temp_v0->screenRight = arg1->x2;\n temp_v0->screenBottom = arg1->y2;\n}\n","score":0,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CameraScissorSet` — benchmark function marioparty3:CameraScissorSet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel CameraScissorSet\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$v0, $a0, 0x3\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x4\n lui\t$v1, %hi(gCameraList)\n lw\t$v1, %lo(gCameraList)($v1)\n addu\t$v0, $v0, $v1\n lwc1\t$f0, 0($a1)\n swc1\t$f0, 144($v0)\n lwc1\t$f0, 4($a1)\n swc1\t$f0, 148($v0)\n lwc1\t$f0, 8($a1)\n swc1\t$f0, 152($v0)\n lwc1\t$f0, 12($a1)\n jr\t$ra\n swc1\t$f0, 156($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-3f9d594d88fa.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid CameraScissorSet(s16 camIndex, RectF *arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CameraScissorSet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CameraScissorSet` — benchmark function marioparty3:CameraScissorSet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:CameraScissorSet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x3\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x2\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x4\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\taddu\tv0,v0,v1\n 28:\tlwc1\t$f0,0(a1)\n 2c:\tswc1\t$f0,144(v0)\n 30:\tlwc1\t$f0,4(a1)\n 34:\tswc1\t$f0,148(v0)\n 38:\tlwc1\t$f0,8(a1)\n 3c:\tswc1\t$f0,152(v0)\n 40:\tlwc1\t$f0,12(a1)\n 44:\tjr\tra\n 48:\tswc1\t$f0,156(v0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-333d6c1dd230dd41/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c CameraScissorSet\n00000000 *UND*\t00000000 gCameraList\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 gCameraList\n00000020 R_MIPS_LO16 gCameraList\n\n\nContents of section .text:\n 0000 00042400 00042403 000410c0 00441021 ..$...$......D.!\n 0010 00021080 00441023 00021100 3c030000 .....D.#....<...\n 0020 8c630000 00431021 c4a00000 e4400090 .c...C.!.....@..\n 0030 c4a00004 e4400094 c4a00008 e4400098 .....@.......@..\n 0040 c4a0000c 03e00008 e440009c 00000000 .........@......\nContents of section .reginfo:\n 0000 8000003c 00000000 00000001 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"CameraScissorSet\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name CameraScissorSet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8000F024_FC24:gcc2.7.2","sym":"func_8000F024_FC24","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","arithmetic"],"loc":5,"refSource":"void func_8000F024_FC24(void **pool, u16 size, u16 segment) {\n frameBufferPool = pool;\n frameBufferCount = size;\n frameBufferSegmentID = segment;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L225-L229","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsw\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tjr\tra\n 18:\tsh\ta2,0(at)\n 1c:\tnop\n","proto":{"func_8000F024_FC24":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f9d164df3a2c16f4/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_8000F024_FC24\n00000000 *UND*\t00000000 frameBufferPool\n00000000 *UND*\t00000000 frameBufferCount\n00000000 *UND*\t00000000 frameBufferSegmentID\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 frameBufferPool\n00000004 R_MIPS_LO16 frameBufferPool\n00000008 R_MIPS_HI16 frameBufferCount\n0000000c R_MIPS_LO16 frameBufferCount\n00000010 R_MIPS_HI16 frameBufferSegmentID\n00000018 R_MIPS_LO16 frameBufferSegmentID\n\n\nContents of section .text:\n 0000 3c010000 ac240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 03e00008 a4260000 00000000 <........&......\nContents of section .reginfo:\n 0000 80000072 00000000 00000000 00000000 ...r............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"frameBufferCount"},{"name":"frameBufferPool"},{"name":"frameBufferSegmentID"}],"outcome":"match","source":"void func_8000F024_FC24(u32 a0, u32 a1, u32 a2) {\n frameBufferPool = a0;\n frameBufferCount = a1;\n frameBufferSegmentID = a2;\n return;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"extern s16 frameBufferCount;\nextern s32 frameBufferPool;\nextern s16 frameBufferSegmentID;\n\nvoid func_8000F024_FC24(s32 arg0, s16 arg1, s16 arg2) {\n frameBufferPool = arg0;\n frameBufferCount = arg1;\n frameBufferSegmentID = arg2;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8000F024_FC24` — benchmark function marioparty3:func_8000F024_FC24:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F024_FC24\n lui\t$at, %hi(frameBufferPool)\n sw\t$a0, %lo(frameBufferPool)($at)\n lui\t$at, %hi(frameBufferCount)\n sh\t$a1, %lo(frameBufferCount)($at)\n lui\t$at, %hi(frameBufferSegmentID)\n jr\t$ra\n sh\t$a2, %lo(frameBufferSegmentID)($at)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F024_FC24 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F024_FC24` — benchmark function marioparty3:func_8000F024_FC24:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F024_FC24:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsw\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tjr\tra\n 18:\tsh\ta2,0(at)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f9d164df3a2c16f4/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_8000F024_FC24\n00000000 *UND*\t00000000 frameBufferPool\n00000000 *UND*\t00000000 frameBufferCount\n00000000 *UND*\t00000000 frameBufferSegmentID\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 frameBufferPool\n00000004 R_MIPS_LO16 frameBufferPool\n00000008 R_MIPS_HI16 frameBufferCount\n0000000c R_MIPS_LO16 frameBufferCount\n00000010 R_MIPS_HI16 frameBufferSegmentID\n00000018 R_MIPS_LO16 frameBufferSegmentID\n\n\nContents of section .text:\n 0000 3c010000 ac240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 03e00008 a4260000 00000000 <........&......\nContents of section .reginfo:\n 0000 80000072 00000000 00000000 00000000 ...r............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F024_FC24\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F024_FC24 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8000F04C_FC4C:gcc2.7.2","sym":"func_8000F04C_FC4C","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","global","arithmetic"],"loc":6,"refSource":"void func_8000F04C_FC4C(u64 **threadStacks) {\n gThread3Stack = *threadStacks++;\n gThreadOutStack = *threadStacks++;\n gThreadOutStackSize = *threadStacks++;\n gThreadYieldStack = *threadStacks;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L237-L242","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tlui\tat,0x0\n 8:\tsw\tv0,0(at)\n c:\taddiu\ta0,a0,4\n 10:\tlw\tv0,0(a0)\n 14:\tlui\tat,0x0\n 18:\tsw\tv0,0(at)\n 1c:\taddiu\ta0,a0,4\n 20:\tlw\tv0,0(a0)\n 24:\tlui\tat,0x0\n 28:\tsw\tv0,0(at)\n 2c:\tlw\tv0,4(a0)\n 30:\tlui\tat,0x0\n 34:\tjr\tra\n 38:\tsw\tv0,0(at)\n 3c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-5423b0a9a65c.i.gz","proto":{"func_8000F04C_FC4C":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-7e5035f793b0f45c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_8000F04C_FC4C\n00000000 *UND*\t00000000 gThread3Stack\n00000000 *UND*\t00000000 gThreadOutStack\n00000000 *UND*\t00000000 gThreadOutStackSize\n00000000 *UND*\t00000000 gThreadYieldStack\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 gThread3Stack\n00000008 R_MIPS_LO16 gThread3Stack\n00000014 R_MIPS_HI16 gThreadOutStack\n00000018 R_MIPS_LO16 gThreadOutStack\n00000024 R_MIPS_HI16 gThreadOutStackSize\n00000028 R_MIPS_LO16 gThreadOutStackSize\n00000030 R_MIPS_HI16 gThreadYieldStack\n00000038 R_MIPS_LO16 gThreadYieldStack\n\n\nContents of section .text:\n 0000 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0010 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0020 8c820000 3c010000 ac220000 8c820004 ....<....\"......\n 0030 3c010000 03e00008 ac220000 00000000 <........\"......\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gThread3Stack"},{"name":"gThreadOutStack"},{"name":"gThreadOutStackSize"},{"name":"gThreadYieldStack"}],"outcome":"nonmatch","source":"void func_8000F04C_FC4C(s32 * a0) {\n gThread3Stack = *a0;\n gThreadOutStack = *(a0 + 1);\n gThreadOutStackSize = *(a0 + 1 + 1);\n gThreadYieldStack = (a0 + 1 + 1)[1];\n return;\n}\n","score":5,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_8000F04C_FC4C(u64 **threadStacks) {\n u64 **temp_a0;\n\n gThread3Stack = threadStacks->unk0;\n temp_a0 = threadStacks + 4;\n gThreadOutStack = threadStacks->unk4;\n gThreadOutStackSize = temp_a0->unk4;\n gThreadYieldStack = (temp_a0 + 4)->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5517: request for member `unk0' in something not a structure or union","/c.i:5519: request for member `unk4' in something not a structure or union","/c.i:5520: request for member `unk4' in something not a structure or union","/c.i:5521: request for member `unk4' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":15,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8000F04C_FC4C` — benchmark function marioparty3:func_8000F04C_FC4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F04C_FC4C\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThread3Stack)\n sw\t$v0, %lo(gThread3Stack)($at)\n addiu\t$a0, $a0, 4\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThreadOutStack)\n sw\t$v0, %lo(gThreadOutStack)($at)\n addiu\t$a0, $a0, 4\n lw\t$v0, 0($a0)\n lui\t$at, %hi(gThreadOutStackSize)\n sw\t$v0, %lo(gThreadOutStackSize)($at)\n lw\t$v0, 4($a0)\n lui\t$at, %hi(gThreadYieldStack)\n jr\t$ra\n sw\t$v0, %lo(gThreadYieldStack)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-5423b0a9a65c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8000F04C_FC4C(u64 **threadStacks);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F04C_FC4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F04C_FC4C` — benchmark function marioparty3:func_8000F04C_FC4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F04C_FC4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tlui\tat,0x0\n 8:\tsw\tv0,0(at)\n c:\taddiu\ta0,a0,4\n 10:\tlw\tv0,0(a0)\n 14:\tlui\tat,0x0\n 18:\tsw\tv0,0(at)\n 1c:\taddiu\ta0,a0,4\n 20:\tlw\tv0,0(a0)\n 24:\tlui\tat,0x0\n 28:\tsw\tv0,0(at)\n 2c:\tlw\tv0,4(a0)\n 30:\tlui\tat,0x0\n 34:\tjr\tra\n 38:\tsw\tv0,0(at)\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-7e5035f793b0f45c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_8000F04C_FC4C\n00000000 *UND*\t00000000 gThread3Stack\n00000000 *UND*\t00000000 gThreadOutStack\n00000000 *UND*\t00000000 gThreadOutStackSize\n00000000 *UND*\t00000000 gThreadYieldStack\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 gThread3Stack\n00000008 R_MIPS_LO16 gThread3Stack\n00000014 R_MIPS_HI16 gThreadOutStack\n00000018 R_MIPS_LO16 gThreadOutStack\n00000024 R_MIPS_HI16 gThreadOutStackSize\n00000028 R_MIPS_LO16 gThreadOutStackSize\n00000030 R_MIPS_HI16 gThreadYieldStack\n00000038 R_MIPS_LO16 gThreadYieldStack\n\n\nContents of section .text:\n 0000 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0010 8c820000 3c010000 ac220000 24840004 ....<....\"..$...\n 0020 8c820000 3c010000 ac220000 8c820004 ....<....\"......\n 0030 3c010000 03e00008 ac220000 00000000 <........\"......\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F04C_FC4C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F04C_FC4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8000F088_FC88:gcc2.7.2","sym":"func_8000F088_FC88","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","global","arithmetic"],"loc":3,"refSource":"void func_8000F088_FC88(s32 *uCodeAdresses) {\n gUCodeAddresses = uCodeAdresses;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/graphics.c#L245-L247","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsw\ta0,0(at)\n c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-c25019c2fe69.i.gz","proto":{"func_8000F088_FC88":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6e75782630e57f66/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8000F088_FC88\n00000000 *UND*\t00000000 gUCodeAddresses\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gUCodeAddresses\n00000008 R_MIPS_LO16 gUCodeAddresses\n\n\nContents of section .text:\n 0000 3c010000 03e00008 ac240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gUCodeAddresses"}],"outcome":"match","source":"void func_8000F088_FC88(u32 a0) {\n gUCodeAddresses = a0;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8000F088_FC88(s32 *uCodeAdresses) {\n gUCodeAddresses = uCodeAdresses;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8000F088_FC88` — benchmark function marioparty3:func_8000F088_FC88:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8000F088_FC88\n lui\t$at, %hi(gUCodeAddresses)\n jr\t$ra\n sw\t$a0, %lo(gUCodeAddresses)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-c25019c2fe69.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8000F088_FC88(s32 *uCodeAdresses);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8000F088_FC88 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8000F088_FC88` — benchmark function marioparty3:func_8000F088_FC88:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8000F088_FC88:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsw\ta0,0(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6e75782630e57f66/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8000F088_FC88\n00000000 *UND*\t00000000 gUCodeAddresses\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gUCodeAddresses\n00000008 R_MIPS_LO16 gUCodeAddresses\n\n\nContents of section .text:\n 0000 3c010000 03e00008 ac240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8000F088_FC88\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8000F088_FC88 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80011460_12060:gcc2.7.2","sym":"func_80011460_12060","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","loop","arithmetic"],"loc":13,"refSource":"s16 func_80011460_12060(u8 *arg0) {\n s32 sum = 0;\n s16 i = 1;\n u8 c = arg0[0];\n\n while (c != 0 && i < 28) {\n sum += i * c;\n arg0++;\n i++;\n c = arg0[0];\n }\n return sum;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfload.c#L31-L43","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\ta3,zero\n 4:\tli\ta2,1\n 8:\tlbu\tv0,0(a0)\n c:\tbeqz\tv0,54 \n 10:\tmove\ta1,v0\n 14:\tsll\tv0,a2,0x10\n 18:\tsra\tv0,v0,0x10\n 1c:\tmult\tv0,a1\n 20:\tmflo\tv0\n 24:\taddu\ta3,a3,v0\n 28:\taddiu\ta0,a0,1\n 2c:\taddiu\tv0,a2,1\n 30:\tmove\ta2,v0\n 34:\tlbu\ta1,0(a0)\n 38:\tsltu\tv1,zero,a1\n 3c:\tsll\tv0,v0,0x10\n 40:\tsra\tv0,v0,0x10\n 44:\tslti\tv0,v0,28\n 48:\tand\tv1,v1,v0\n 4c:\tbnezl\tv1,18 \n 50:\tsll\tv0,a2,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tjr\tra\n 5c:\tsra\tv0,v0,0x10\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-be8a3ce746675614/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80011460_12060\n\n\nContents of section .text:\n 0000 00003821 24060001 90820000 10400011 ..8!$........@..\n 0010 00402821 00061400 00021403 00450018 .@(!.........E..\n 0020 00001012 00e23821 24840001 24c20001 ......8!$...$...\n 0030 00403021 90850000 0005182b 00021400 .@0!.......+....\n 0040 00021403 2842001c 00621824 5460fff2 ....(B...b.$T`..\n 0050 00061400 00071400 03e00008 00021403 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80011460_12060' — lift: cannot lift 'func_80011460_12060': unmodelled control transfer 'bnezl' at 0x4c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\ta3,zero */\n/* 4:\tli\ta2,1 */\n/* 8:\tlbu\tv0,0(a0) */\n/* c:\tbeqz\tv0,54 */\n/* 10:\tmove\ta1,v0 */\n/* 14:\tsll\tv0,a2,0x10 */\n/* 18:\tsra\tv0,v0,0x10 */\n/* 1c:\tmult\tv0,a1 */\n/* 20:\tmflo\tv0 */\n/* 24:\taddu\ta3,a3,v0 */\n/* 28:\taddiu\ta0,a0,1 */\n/* 2c:\taddiu\tv0,a2,1 */\n/* 30:\tmove\ta2,v0 */\n/* 34:\tlbu\ta1,0(a0) */\n/* 38:\tsltu\tv1,zero,a1 */\n/* 3c:\tsll\tv0,v0,0x10 */\n/* 40:\tsra\tv0,v0,0x10 */\n/* 44:\tslti\tv0,v0,28 */\n/* 48:\tand\tv1,v1,v0 */\n/* 4c:\tbnezl\tv1,18 */\n/* 50:\tsll\tv0,a2,0x10 */\n/* 54:\tsll\tv0,a3,0x10 */\n/* 58:\tjr\tra */\n/* 5c:\tsra\tv0,v0,0x10 */\nvoid func_80011460_12060(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80011460_12060': unmodelled control transfer 'bnezl' at 0x4c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80011460_12060': unmodelled control transfer 'bnezl' at 0x4c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 func_80011460_12060(u8 *arg0) {\n s16 temp_v0_2;\n s16 var_a2;\n s16 var_a3;\n u8 *var_a0;\n u8 temp_v0;\n u8 var_a1;\n\n var_a0 = arg0;\n var_a3 = 0;\n var_a2 = 1;\n temp_v0 = *var_a0;\n var_a1 = temp_v0;\n if (temp_v0 != 0) {\n do {\n var_a3 += var_a2 * var_a1;\n var_a0 += 1;\n temp_v0_2 = var_a2 + 1;\n var_a2 = temp_v0_2;\n var_a1 = *var_a0;\n } while ((var_a1 != 0) & (temp_v0_2 < 0x1C));\n }\n return var_a3;\n}\n","score":4,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":23,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":24,"ratio":0.16666666666666666,"kinds":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80011460_12060` — benchmark function marioparty3:func_80011460_12060:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80011460_12060\n move\t$a3, $zero\n li\t$a2, 1\n lbu\t$v0, 0($a0)\n beqz\t$v0, .L54\n move\t$a1, $v0\n sll\t$v0, $a2, 0x10\n.L18:\n sra\t$v0, $v0, 0x10\n mult\t$v0, $a1\n mflo\t$v0\n addu\t$a3, $a3, $v0\n addiu\t$a0, $a0, 1\n addiu\t$v0, $a2, 1\n move\t$a2, $v0\n lbu\t$a1, 0($a0)\n sltu\t$v1, $zero, $a1\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 28\n and\t$v1, $v1, $v0\n bnezl\t$v1, .L18\n sll\t$v0, $a2, 0x10\n.L54:\n sll\t$v0, $a3, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80011460_12060 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80011460_12060` — benchmark function marioparty3:func_80011460_12060:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80011460_12060:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\ta3,zero\n 4:\tli\ta2,1\n 8:\tlbu\tv0,0(a0)\n c:\tbeqz\tv0,54 \n 10:\tmove\ta1,v0\n 14:\tsll\tv0,a2,0x10\n 18:\tsra\tv0,v0,0x10\n 1c:\tmult\tv0,a1\n 20:\tmflo\tv0\n 24:\taddu\ta3,a3,v0\n 28:\taddiu\ta0,a0,1\n 2c:\taddiu\tv0,a2,1\n 30:\tmove\ta2,v0\n 34:\tlbu\ta1,0(a0)\n 38:\tsltu\tv1,zero,a1\n 3c:\tsll\tv0,v0,0x10\n 40:\tsra\tv0,v0,0x10\n 44:\tslti\tv0,v0,28\n 48:\tand\tv1,v1,v0\n 4c:\tbnezl\tv1,18 \n 50:\tsll\tv0,a2,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tjr\tra\n 5c:\tsra\tv0,v0,0x10\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-be8a3ce746675614/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80011460_12060\n\n\nContents of section .text:\n 0000 00003821 24060001 90820000 10400011 ..8!$........@..\n 0010 00402821 00061400 00021403 00450018 .@(!.........E..\n 0020 00001012 00e23821 24840001 24c20001 ......8!$...$...\n 0030 00403021 90850000 0005182b 00021400 .@0!.......+....\n 0040 00021403 2842001c 00621824 5460fff2 ....(B...b.$T`..\n 0050 00061400 00071400 03e00008 00021403 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80011460_12060 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800123F4_12FF4:gcc2.7.2","sym":"func_800123F4_12FF4","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":3,"refSource":"void func_800123F4_12FF4(void) {\n D_800D418E_D4D8E = D_800D2008_D2C08;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/camera.c#L53-L55","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlbu\tv0,0(v0)\n 8:\tlui\tat,0x0\n c:\tjr\tra\n 10:\tsh\tv0,0(at)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-888e856682f4.i.gz","proto":{"func_800123F4_12FF4":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-05c12408f5e201a5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 func_800123F4_12FF4\n00000000 *UND*\t00000000 D_800D2008_D2C08\n00000000 *UND*\t00000000 D_800D418E_D4D8E\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D2008_D2C08\n00000004 R_MIPS_LO16 D_800D2008_D2C08\n00000008 R_MIPS_HI16 D_800D418E_D4D8E\n00000010 R_MIPS_LO16 D_800D418E_D4D8E\n\n\nContents of section .text:\n 0000 3c020000 90420000 3c010000 03e00008 <....B..<.......\n 0010 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000006 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800D2008_D2C08"},{"name":"D_800D418E_D4D8E"}],"outcome":"match","source":"void func_800123F4_12FF4(void) {\n D_800D418E_D4D8E = D_800D2008_D2C08;\n return;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_800123F4_12FF4(void) {\n D_800D418E_D4D8E = (s16) D_800D2008_D2C08;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800123F4_12FF4` — benchmark function marioparty3:func_800123F4_12FF4:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800123F4_12FF4\n lui\t$v0, %hi(D_800D2008_D2C08)\n lbu\t$v0, %lo(D_800D2008_D2C08)($v0)\n lui\t$at, %hi(D_800D418E_D4D8E)\n jr\t$ra\n sh\t$v0, %lo(D_800D418E_D4D8E)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-888e856682f4.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800123F4_12FF4(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800123F4_12FF4 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800123F4_12FF4` — benchmark function marioparty3:func_800123F4_12FF4:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800123F4_12FF4:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlbu\tv0,0(v0)\n 8:\tlui\tat,0x0\n c:\tjr\tra\n 10:\tsh\tv0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-05c12408f5e201a5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 func_800123F4_12FF4\n00000000 *UND*\t00000000 D_800D2008_D2C08\n00000000 *UND*\t00000000 D_800D418E_D4D8E\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D2008_D2C08\n00000004 R_MIPS_LO16 D_800D2008_D2C08\n00000008 R_MIPS_HI16 D_800D418E_D4D8E\n00000010 R_MIPS_LO16 D_800D418E_D4D8E\n\n\nContents of section .text:\n 0000 3c020000 90420000 3c010000 03e00008 <....B..<.......\n 0010 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000006 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800123F4_12FF4\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800123F4_12FF4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8001D330_1DF30:gcc2.7.2","sym":"func_8001D330_1DF30","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":3,"refSource":"void func_8001D330_1DF30(s16 arg0) {\n D_800A0A78_A1678 = arg0;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfman.c#L525-L527","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsh\ta0,0(at)\n c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-f8dec0704e6a.i.gz","proto":{"func_8001D330_1DF30":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fda35e2082dacdbe/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8001D330_1DF30\n00000000 *UND*\t00000000 D_800A0A78_A1678\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800A0A78_A1678\n00000008 R_MIPS_LO16 D_800A0A78_A1678\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a4240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800A0A78_A1678"}],"outcome":"match","source":"void func_8001D330_1DF30(u32 a0) {\n D_800A0A78_A1678 = a0;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8001D330_1DF30(s16 arg0) {\n D_800A0A78_A1678 = arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8001D330_1DF30` — benchmark function marioparty3:func_8001D330_1DF30:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001D330_1DF30\n lui\t$at, %hi(D_800A0A78_A1678)\n jr\t$ra\n sh\t$a0, %lo(D_800A0A78_A1678)($at)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-f8dec0704e6a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8001D330_1DF30(s16 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001D330_1DF30 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001D330_1DF30` — benchmark function marioparty3:func_8001D330_1DF30:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8001D330_1DF30:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsh\ta0,0(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fda35e2082dacdbe/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_8001D330_1DF30\n00000000 *UND*\t00000000 D_800A0A78_A1678\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800A0A78_A1678\n00000008 R_MIPS_LO16 D_800A0A78_A1678\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a4240000 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001D330_1DF30\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001D330_1DF30 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8001FBBC_207BC:gcc2.7.2","sym":"func_8001FBBC_207BC","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","arithmetic"],"loc":10,"refSource":"void func_8001FBBC_207BC(s16 arg0, s8 arg1, s8 arg2, s8 arg3) {\n HmfModel *other;\n\n other = HmfModelData[arg0].unkB4;\n if (other != NULL) {\n other->unk00 = arg1;\n other->unk01 = arg2;\n other->unk02 = arg3;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/hmfman.c#L615-L624","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tlui\tv1,0x0\n c:\tlw\tv1,0(v1)\n 10:\tsll\tv0,a0,0x1\n 14:\taddu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x6\n 1c:\taddu\tv0,v0,v1\n 20:\tlw\tv0,180(v0)\n 24:\tbeqz\tv0,38 \n 28:\tnop\n 2c:\tsb\ta1,0(v0)\n 30:\tsb\ta2,1(v0)\n 34:\tsb\ta3,2(v0)\n 38:\tjr\tra\n 3c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_8001FBBC_207BC":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ecb67d8ea63f745/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001FBBC_207BC\n00000000 *UND*\t00000000 HmfModelData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HmfModelData\n0000000c R_MIPS_LO16 HmfModelData\n\n\nContents of section .text:\n 0000 00042400 00042403 3c030000 8c630000 ..$...$.<....c..\n 0010 00041040 00441021 00021180 00431021 ...@.D.!.....C.!\n 0020 8c4200b4 10400004 00000000 a0450000 .B...@.......E..\n 0030 a0460001 a0470002 03e00008 00000000 .F...G..........\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[{"name":"HmfModelData","shape":"pointer"}],"outcome":"match","source":"struct Elem0 { u8 _pad0[180]; s32 field_180; u8 _pad1[8]; };\nvoid func_8001FBBC_207BC(s32 a0, s32 a1, s32 a2, s32 a3) {\n u8 * v0;\n v0 = (u8 *)((struct Elem0 *)HmfModelData)[a0 << 16 >> 16].field_180;\n if (v0 != 0) {\n *v0 = a1;\n v0[1] = a2;\n v0[2] = a3;\n }\n return;\n}\n","score":0,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8001FBBC_207BC(s16 arg0, s8 arg1, s8 arg2, s8 arg3) {\n HmfModel *temp_v0;\n\n temp_v0 = HmfModelData[arg0].unkB4;\n if (temp_v0 != NULL) {\n temp_v0->unk00 = arg1;\n temp_v0->unk01 = (u8) arg2;\n temp_v0->unk02 = (u8) arg3;\n }\n}\n","score":0,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8001FBBC_207BC` — benchmark function marioparty3:func_8001FBBC_207BC:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001FBBC_207BC\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n lui\t$v1, %hi(HmfModelData)\n lw\t$v1, %lo(HmfModelData)($v1)\n sll\t$v0, $a0, 0x1\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x6\n addu\t$v0, $v0, $v1\n lw\t$v0, 180($v0)\n beqz\t$v0, .L38\n nop\n sb\t$a1, 0($v0)\n sb\t$a2, 1($v0)\n sb\t$a3, 2($v0)\n.L38:\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8001FBBC_207BC(s16 arg0, s8 arg1, s8 arg2, s8 arg3);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001FBBC_207BC # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001FBBC_207BC` — benchmark function marioparty3:func_8001FBBC_207BC:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8001FBBC_207BC:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tlui\tv1,0x0\n c:\tlw\tv1,0(v1)\n 10:\tsll\tv0,a0,0x1\n 14:\taddu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x6\n 1c:\taddu\tv0,v0,v1\n 20:\tlw\tv0,180(v0)\n 24:\tbeqz\tv0,38 \n 28:\tnop\n 2c:\tsb\ta1,0(v0)\n 30:\tsb\ta2,1(v0)\n 34:\tsb\ta3,2(v0)\n 38:\tjr\tra\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ecb67d8ea63f745/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001FBBC_207BC\n00000000 *UND*\t00000000 HmfModelData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HmfModelData\n0000000c R_MIPS_LO16 HmfModelData\n\n\nContents of section .text:\n 0000 00042400 00042403 3c030000 8c630000 ..$...$.<....c..\n 0010 00041040 00441021 00021180 00431021 ...@.D.!.....C.!\n 0020 8c4200b4 10400004 00000000 a0450000 .B...@.......E..\n 0030 a0460001 a0470002 03e00008 00000000 .F...G..........\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001FBBC_207BC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001FBBC_207BC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8002FD48_30948:gcc2.7.2","sym":"func_8002FD48_30948","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","arithmetic"],"loc":3,"refSource":"void func_8002FD48_30948(HmfData *arg0) {\n arg0->unkA0 = 0;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/22EB0.c#L208-L210","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\tzero,160(a0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_8002FD48_30948":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ae562d6511b20a82/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_8002FD48_30948\n\n\nContents of section .text:\n 0000 03e00008 ac8000a0 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000010 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void func_8002FD48_30948(s32 * a0) {\n a0[40] = 0;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8002FD48_30948(HmfData *arg0) {\n arg0->unkA0 = 0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8002FD48_30948` — benchmark function marioparty3:func_8002FD48_30948:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002FD48_30948\n jr\t$ra\n sw\t$zero, 160($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8002FD48_30948(HmfData *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002FD48_30948 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002FD48_30948` — benchmark function marioparty3:func_8002FD48_30948:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8002FD48_30948:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\tzero,160(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ae562d6511b20a82/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_8002FD48_30948\n\n\nContents of section .text:\n 0000 03e00008 ac8000a0 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000010 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8002FD48_30948\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002FD48_30948 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80045314_45F14:gcc2.7.2","sym":"func_80045314_45F14","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["branch","arithmetic"],"loc":10,"refSource":"s32 func_80045314_45F14(void) {\n switch (omovl) {\n case 2:\n return 20;\n case 3:\n return -20;\n default:\n return 0;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/gamemes.c#L743-L752","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tli\tv0,2\n c:\tbeq\tv1,v0,24 \n 10:\tli\tv0,3\n 14:\tbeq\tv1,v0,28 \n 18:\tli\tv0,-20\n 1c:\tj\t28 \n 20:\tmove\tv0,zero\n 24:\tli\tv0,20\n 28:\tjr\tra\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fe5bd170329e178e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_80045314_45F14\n00000000 *UND*\t00000000 omovl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 omovl\n00000004 R_MIPS_LO16 omovl\n0000001c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 3c030000 8c630000 24020002 10620005 <....c..$....b..\n 0010 24020003 10620004 2402ffec 0800000a $....b..$.......\n 0020 00001021 24020014 03e00008 00000000 ...!$...........\nContents of section .reginfo:\n 0000 8000000c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"omovl"}],"outcome":"nonmatch","source":"s32 func_80045314_45F14(void) {\n s32 v0;\n if (omovl == 2) {\n v0 = 20;\n } else {\n if (omovl == 3) {\n v0 = -20;\n } else {\n v0 = 0;\n }\n }\n return v0;\n}\n","score":11,"maxScore":18,"compileErrors":null,"breakdown":{"insert":6,"delete":3,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":13,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern s32 omovl;\n\ns32 func_80045314_45F14(void) {\n s32 var_v0;\n\n if (omovl != 2) {\n var_v0 = -0x14;\n if (omovl != 3) {\n return 0;\n }\n /* Duplicate return node #4. Try simplifying control flow for better match */\n return var_v0;\n }\n var_v0 = 0x14;\n return var_v0;\n}\n","score":5,"maxScore":13,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":3,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":14,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":5,"maxScore":13,"ratio":0.38461538461538464,"kinds":{"insert":1,"delete":0,"replace":3,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80045314_45F14` — benchmark function marioparty3:func_80045314_45F14:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045314_45F14\n lui\t$v1, %hi(omovl)\n lw\t$v1, %lo(omovl)($v1)\n li\t$v0, 2\n beq\t$v1, $v0, .L24\n li\t$v0, 3\n beq\t$v1, $v0, .L28\n li\t$v0, -20\n j\t.L28\n move\t$v0, $zero\n.L24:\n li\t$v0, 20\n.L28:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045314_45F14 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045314_45F14` — benchmark function marioparty3:func_80045314_45F14:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045314_45F14:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tli\tv0,2\n c:\tbeq\tv1,v0,24 \n 10:\tli\tv0,3\n 14:\tbeq\tv1,v0,28 \n 18:\tli\tv0,-20\n 1c:\tj\t28 \n 20:\tmove\tv0,zero\n 24:\tli\tv0,20\n 28:\tjr\tra\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-fe5bd170329e178e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_80045314_45F14\n00000000 *UND*\t00000000 omovl\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 omovl\n00000004 R_MIPS_LO16 omovl\n0000001c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 3c030000 8c630000 24020002 10620005 <....c..$....b..\n 0010 24020003 10620004 2402ffec 0800000a $....b..$.......\n 0020 00001021 24020014 03e00008 00000000 ...!$...........\nContents of section .reginfo:\n 0000 8000000c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045314_45F14 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80045350_45F50:gcc2.7.2","sym":"func_80045350_45F50","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","loop","branch","global","arithmetic"],"loc":13,"refSource":"void func_80045350_45F50(void) {\n s32 var_v1;\n\n if (D_800A6D44_A7944[GwSystem.minigame_index - 1].minigameType == 6) {\n return;\n }\n for (var_v1 = 0; var_v1 < 4; var_v1++) {\n GW_PLAYER *temp_v0 = &GwPlayer[var_v1];\n\n temp_v0->gameCoin = 0;\n temp_v0->bonusCoin = 0;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/pause.c#L61-L73","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlb\tv1,16(v1)\n 8:\taddiu\tv1,v1,-1\n c:\tsll\tv0,v1,0x2\n 10:\taddu\tv0,v0,v1\n 14:\tsll\tv0,v0,0x2\n 18:\tlui\tv1,0x0\n 1c:\taddu\tv1,v1,v0\n 20:\tlbu\tv1,0(v1)\n 24:\tli\tv0,6\n 28:\tbeq\tv1,v0,64 \n 2c:\tnop\n 30:\tmove\tv1,zero\n 34:\tlui\ta0,0x0\n 38:\taddiu\ta0,a0,0\n 3c:\tsll\tv0,v1,0x3\n 40:\tsubu\tv0,v0,v1\n 44:\tsll\tv0,v0,0x3\n 48:\taddu\tv0,v0,a0\n 4c:\tsh\tzero,6(v0)\n 50:\tsh\tzero,8(v0)\n 54:\taddiu\tv1,v1,1\n 58:\tslti\tv0,v1,4\n 5c:\tbnez\tv0,40 \n 60:\tsll\tv0,v1,0x3\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-a3d2d0baeda1.i.gz","proto":{"func_80045350_45F50":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-42758b8683c841eb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80045350_45F50\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 D_800A6D44_A7944\n00000000 *UND*\t00000000 GwPlayer\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000004 R_MIPS_LO16 GwSystem\n00000018 R_MIPS_HI16 D_800A6D44_A7944\n00000020 R_MIPS_LO16 D_800A6D44_A7944\n00000034 R_MIPS_HI16 GwPlayer\n00000038 R_MIPS_LO16 GwPlayer\n\n\nContents of section .text:\n 0000 3c030000 80630010 2463ffff 00031080 <....c..$c......\n 0010 00431021 00021080 3c030000 00621821 .C.!....<....b.!\n 0020 90630000 24020006 1062000e 00000000 .c..$....b......\n 0030 00001821 3c040000 24840000 000310c0 ...!<...$.......\n 0040 00431023 000210c0 00441021 a4400006 .C.#.....D.!.@..\n 0050 a4400008 24630001 28620004 1440fff8 .@..$c..(b...@..\n 0060 000310c0 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80045350_45F50' — lift: cannot lift 'func_80045350_45F50': %hi(D_800A6D44_A7944) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlui\tv1,0x0 */\n/* 4:\tlb\tv1,16(v1) */\n/* 8:\taddiu\tv1,v1,-1 */\n/* c:\tsll\tv0,v1,0x2 */\n/* 10:\taddu\tv0,v0,v1 */\n/* 14:\tsll\tv0,v0,0x2 */\n/* 18:\tlui\tv1,0x0 */\n/* 1c:\taddu\tv1,v1,v0 */\n/* 20:\tlbu\tv1,0(v1) */\n/* 24:\tli\tv0,6 */\n/* 28:\tbeq\tv1,v0,64 */\n/* 2c:\tnop */\n/* 30:\tmove\tv1,zero */\n/* 34:\tlui\ta0,0x0 */\n/* 38:\taddiu\ta0,a0,0 */\n/* 3c:\tsll\tv0,v1,0x3 */\n/* 40:\tsubu\tv0,v0,v1 */\n/* 44:\tsll\tv0,v0,0x3 */\n/* 48:\taddu\tv0,v0,a0 */\n/* 4c:\tsh\tzero,6(v0) */\n/* 50:\tsh\tzero,8(v0) */\n/* 54:\taddiu\tv1,v1,1 */\n/* 58:\tslti\tv0,v1,4 */\n/* 5c:\tbnez\tv0,40 */\n/* 60:\tsll\tv0,v1,0x3 */\n/* 64:\tjr\tra */\n/* 68:\tnop */\n/* 6c:\tnop */\nvoid func_80045350_45F50(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80045350_45F50': %hi(D_800A6D44_A7944) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":36,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80045350_45F50': %hi(D_800A6D44_A7944) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_80045350_45F50(void) {\n s32 var_v0;\n s32 var_v1;\n void *temp_v0;\n\n if (D_800A6D44_A7944[GwSystem.playMode - 1].minigameType != 6) {\n var_v1 = 0;\n var_v0 = 0 * 8;\n do {\n temp_v0 = ((var_v0 - var_v1) * 8) + GwPlayer;\n temp_v0->unk6 = 0;\n temp_v0->unk8 = 0;\n var_v1 += 1;\n var_v0 = var_v1 * 8;\n } while (var_v1 < 4);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":16,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5521: warning: dereferencing `void *' pointer","/c.i:5521: request for member `unk6' in something not a structure or union","/c.i:5522: warning: dereferencing `void *' pointer","/c.i:5522: request for member `unk8' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80045350_45F50` — benchmark function marioparty3:func_80045350_45F50:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045350_45F50\n lui\t$v1, %hi(GwSystem)\n lb\t$v1, %lo(GwSystem)($v1)\n addiu\t$v1, $v1, -1\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_800A6D44_A7944)\n addu\t$v1, $v1, $v0\n lbu\t$v1, %lo(D_800A6D44_A7944)($v1)\n li\t$v0, 6\n beq\t$v1, $v0, .L64\n nop\n move\t$v1, $zero\n lui\t$a0, %hi(GwPlayer)\n addiu\t$a0, $a0, %lo(GwPlayer)\n sll\t$v0, $v1, 0x3\n.L40:\n subu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x3\n addu\t$v0, $v0, $a0\n sh\t$zero, 6($v0)\n sh\t$zero, 8($v0)\n addiu\t$v1, $v1, 1\n slti\t$v0, $v1, 4\n bnez\t$v0, .L40\n sll\t$v0, $v1, 0x3\n.L64:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-a3d2d0baeda1.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80045350_45F50(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045350_45F50 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045350_45F50` — benchmark function marioparty3:func_80045350_45F50:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045350_45F50:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlb\tv1,16(v1)\n 8:\taddiu\tv1,v1,-1\n c:\tsll\tv0,v1,0x2\n 10:\taddu\tv0,v0,v1\n 14:\tsll\tv0,v0,0x2\n 18:\tlui\tv1,0x0\n 1c:\taddu\tv1,v1,v0\n 20:\tlbu\tv1,0(v1)\n 24:\tli\tv0,6\n 28:\tbeq\tv1,v0,64 \n 2c:\tnop\n 30:\tmove\tv1,zero\n 34:\tlui\ta0,0x0\n 38:\taddiu\ta0,a0,0\n 3c:\tsll\tv0,v1,0x3\n 40:\tsubu\tv0,v0,v1\n 44:\tsll\tv0,v0,0x3\n 48:\taddu\tv0,v0,a0\n 4c:\tsh\tzero,6(v0)\n 50:\tsh\tzero,8(v0)\n 54:\taddiu\tv1,v1,1\n 58:\tslti\tv0,v1,4\n 5c:\tbnez\tv0,40 \n 60:\tsll\tv0,v1,0x3\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-42758b8683c841eb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80045350_45F50\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 D_800A6D44_A7944\n00000000 *UND*\t00000000 GwPlayer\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000004 R_MIPS_LO16 GwSystem\n00000018 R_MIPS_HI16 D_800A6D44_A7944\n00000020 R_MIPS_LO16 D_800A6D44_A7944\n00000034 R_MIPS_HI16 GwPlayer\n00000038 R_MIPS_LO16 GwPlayer\n\n\nContents of section .text:\n 0000 3c030000 80630010 2463ffff 00031080 <....c..$c......\n 0010 00431021 00021080 3c030000 00621821 .C.!....<....b.!\n 0020 90630000 24020006 1062000e 00000000 .c..$....b......\n 0030 00001821 3c040000 24840000 000310c0 ...!<...$.......\n 0040 00431023 000210c0 00441021 a4400006 .C.#.....D.!.@..\n 0050 a4400008 24630001 28620004 1440fff8 .@..$c..(b...@..\n 0060 000310c0 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80045350_45F50\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045350_45F50 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80045BF0_467F0:gcc2.7.2","sym":"func_80045BF0_467F0","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["loop","branch","global","arithmetic"],"loc":14,"refSource":"s32 func_80045BF0_467F0(s32 arg0) {\n u32 var_v0;\n u32 var_v1;\n\n for (var_v1 = 0; var_v1 < 9; var_v1++) {\n if ((arg0 & 0xFF) == D_800A1590_A2190[var_v1]) {\n break;\n }\n }\n if (var_v1 >= 9) {\n var_v1 = -1;\n }\n return var_v1;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/pause.c#L217-L230","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tandi\ta0,a0,0xff\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,v1\n 10:\tlbu\tv0,0(v0)\n 14:\tbeq\ta0,v0,2c \n 18:\tsltiu\tv0,v1,9\n 1c:\taddiu\tv1,v1,1\n 20:\tsltiu\tv0,v1,9\n 24:\tbnez\tv0,8 \n 28:\tnop\n 2c:\tbeqzl\tv0,34 \n 30:\tli\tv1,-1\n 34:\tjr\tra\n 38:\tmove\tv0,v1\n 3c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-60e502c4aebd.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a29f6a37f2d335f7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_80045BF0_467F0\n00000000 *UND*\t00000000 D_800A1590_A2190\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800A1590_A2190\n00000010 R_MIPS_LO16 D_800A1590_A2190\n\n\nContents of section .text:\n 0000 00001821 308400ff 3c020000 00431021 ...!0...<....C.!\n 0010 90420000 10820005 2c620009 24630001 .B......,b..$c..\n 0020 2c620009 1440fff8 00000000 50400001 ,b...@......P@..\n 0030 2403ffff 03e00008 00601021 00000000 $........`.!....\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80045BF0_467F0' — lift: cannot lift 'func_80045BF0_467F0': unmodelled control transfer 'beqzl' at 0x2c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tandi\ta0,a0,0xff */\n/* 8:\tlui\tv0,0x0 */\n/* c:\taddu\tv0,v0,v1 */\n/* 10:\tlbu\tv0,0(v0) */\n/* 14:\tbeq\ta0,v0,2c */\n/* 18:\tsltiu\tv0,v1,9 */\n/* 1c:\taddiu\tv1,v1,1 */\n/* 20:\tsltiu\tv0,v1,9 */\n/* 24:\tbnez\tv0,8 */\n/* 28:\tnop */\n/* 2c:\tbeqzl\tv0,34 */\n/* 30:\tli\tv1,-1 */\n/* 34:\tjr\tra */\n/* 38:\tmove\tv0,v1 */\n/* 3c:\tnop */\nvoid func_80045BF0_467F0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80045BF0_467F0': unmodelled control transfer 'beqzl' at 0x2c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":24,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80045BF0_467F0': unmodelled control transfer 'beqzl' at 0x2c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 func_80045BF0_467F0(s32 arg0) {\n s32 var_v0;\n u32 var_v1;\n\n var_v1 = 0;\nloop_1:\n var_v0 = var_v1 < 9U;\n if ((arg0 & 0xFF) != D_800A1590_A2190[var_v1]) {\n var_v1 += 1;\n var_v0 = var_v1 < 9U;\n if (var_v0 != 0) {\n goto loop_1;\n }\n }\n if (var_v0 == 0) {\n var_v1 = -1U;\n }\n return (s32) var_v1;\n}\n","score":11,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":11},"quality":{"score":88,"lines":18,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":11,"maxScore":15,"ratio":0.7333333333333333,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80045BF0_467F0` — benchmark function marioparty3:func_80045BF0_467F0:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80045BF0_467F0\n move\t$v1, $zero\n andi\t$a0, $a0, 0xff\n.L8:\n lui\t$v0, %hi(D_800A1590_A2190)\n addu\t$v0, $v0, $v1\n lbu\t$v0, %lo(D_800A1590_A2190)($v0)\n beq\t$a0, $v0, .L2c\n sltiu\t$v0, $v1, 9\n addiu\t$v1, $v1, 1\n sltiu\t$v0, $v1, 9\n bnez\t$v0, .L8\n nop\n.L2c:\n beqzl\t$v0, .L34\n li\t$v1, -1\n.L34:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-60e502c4aebd.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns32 func_80045BF0_467F0(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80045BF0_467F0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80045BF0_467F0` — benchmark function marioparty3:func_80045BF0_467F0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80045BF0_467F0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tandi\ta0,a0,0xff\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,v1\n 10:\tlbu\tv0,0(v0)\n 14:\tbeq\ta0,v0,2c \n 18:\tsltiu\tv0,v1,9\n 1c:\taddiu\tv1,v1,1\n 20:\tsltiu\tv0,v1,9\n 24:\tbnez\tv0,8 \n 28:\tnop\n 2c:\tbeqzl\tv0,34 \n 30:\tli\tv1,-1\n 34:\tjr\tra\n 38:\tmove\tv0,v1\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a29f6a37f2d335f7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c func_80045BF0_467F0\n00000000 *UND*\t00000000 D_800A1590_A2190\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800A1590_A2190\n00000010 R_MIPS_LO16 D_800A1590_A2190\n\n\nContents of section .text:\n 0000 00001821 308400ff 3c020000 00431021 ...!0...<....C.!\n 0010 90420000 10820005 2c620009 24630001 .B......,b..$c..\n 0020 2c620009 1440fff8 00000000 50400001 ,b...@......P@..\n 0030 2403ffff 03e00008 00601021 00000000 $........`.!....\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80045BF0_467F0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80047E90_48A90:gcc2.7.2","sym":"func_80047E90_48A90","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","arithmetic"],"loc":3,"refSource":"void func_80047E90_48A90(omObjData *obj, s32 arg1) {\n obj->unk10 |= arg1;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L516-L518","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,16(a0)\n 4:\tor\ta1,a1,v0\n 8:\tjr\tra\n c:\tsw\ta1,16(a0)\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_80047E90_48A90":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-18006fbfe679d559/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_80047E90_48A90\n\n\nContents of section .text:\n 0000 8c820010 00a22825 03e00008 ac850010 ......(%........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void func_80047E90_48A90(s32 * a0, u32 a1) {\n a0[4] = a1 | a0[4];\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_80047E90_48A90(omObjData *obj, s32 arg1) {\n obj->unk10 |= arg1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80047E90_48A90` — benchmark function marioparty3:func_80047E90_48A90:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80047E90_48A90\n lw\t$v0, 16($a0)\n or\t$a1, $a1, $v0\n jr\t$ra\n sw\t$a1, 16($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80047E90_48A90(omObjData *obj, s32 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80047E90_48A90 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80047E90_48A90` — benchmark function marioparty3:func_80047E90_48A90:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80047E90_48A90:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,16(a0)\n 4:\tor\ta1,a1,v0\n 8:\tjr\tra\n c:\tsw\ta1,16(a0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-18006fbfe679d559/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_80047E90_48A90\n\n\nContents of section .text:\n 0000 8c820010 00a22825 03e00008 ac850010 ......(%........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80047E90_48A90\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80047E90_48A90 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8004A444_4B044:gcc2.7.2","sym":"func_8004A444_4B044","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":5,"refSource":"void func_8004A444_4B044(s32 arg0) {\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n D_800D1710_D2310 = arg0;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L1053-L1057","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tlui\tat,0x0\n 8:\tsh\tv0,0(at)\n c:\tli\tv0,4\n 10:\tlui\tat,0x0\n 14:\tsh\tv0,0(at)\n 18:\tlui\tat,0x0\n 1c:\tjr\tra\n 20:\tsb\ta0,0(at)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-36a64acb471a.i.gz","proto":{"func_8004A444_4B044":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-74d5e58386117089/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 func_8004A444_4B044\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n00000000 *UND*\t00000000 D_800D1710_D2310\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 D_800A1780_A2380\n00000008 R_MIPS_LO16 D_800A1780_A2380\n00000010 R_MIPS_HI16 D_800D0A3A_D163A\n00000014 R_MIPS_LO16 D_800D0A3A_D163A\n00000018 R_MIPS_HI16 D_800D1710_D2310\n00000020 R_MIPS_LO16 D_800D1710_D2310\n\n\nContents of section .text:\n 0000 24020001 3c010000 a4220000 24020004 $...<....\"..$...\n 0010 3c010000 a4220000 3c010000 03e00008 <....\"..<.......\n 0020 a0240000 00000000 00000000 00000000 .$..............\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800A1780_A2380"},{"name":"D_800D0A3A_D163A"},{"name":"D_800D1710_D2310"}],"outcome":"match","source":"void func_8004A444_4B044(u32 a0) {\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n D_800D1710_D2310 = a0;\n return;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8004A444_4B044(s32 arg0) {\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n D_800D1710_D2310 = (s8) arg0;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8004A444_4B044` — benchmark function marioparty3:func_8004A444_4B044:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8004A444_4B044\n li\t$v0, 1\n lui\t$at, %hi(D_800A1780_A2380)\n sh\t$v0, %lo(D_800A1780_A2380)($at)\n li\t$v0, 4\n lui\t$at, %hi(D_800D0A3A_D163A)\n sh\t$v0, %lo(D_800D0A3A_D163A)($at)\n lui\t$at, %hi(D_800D1710_D2310)\n jr\t$ra\n sb\t$a0, %lo(D_800D1710_D2310)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-36a64acb471a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8004A444_4B044(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8004A444_4B044 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8004A444_4B044` — benchmark function marioparty3:func_8004A444_4B044:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8004A444_4B044:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tlui\tat,0x0\n 8:\tsh\tv0,0(at)\n c:\tli\tv0,4\n 10:\tlui\tat,0x0\n 14:\tsh\tv0,0(at)\n 18:\tlui\tat,0x0\n 1c:\tjr\tra\n 20:\tsb\ta0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-74d5e58386117089/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 func_8004A444_4B044\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n00000000 *UND*\t00000000 D_800D1710_D2310\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000004 R_MIPS_HI16 D_800A1780_A2380\n00000008 R_MIPS_LO16 D_800A1780_A2380\n00000010 R_MIPS_HI16 D_800D0A3A_D163A\n00000014 R_MIPS_LO16 D_800D0A3A_D163A\n00000018 R_MIPS_HI16 D_800D1710_D2310\n00000020 R_MIPS_LO16 D_800D1710_D2310\n\n\nContents of section .text:\n 0000 24020001 3c010000 a4220000 24020004 $...<....\"..$...\n 0010 3c010000 a4220000 3c010000 03e00008 <....\"..<.......\n 0020 a0240000 00000000 00000000 00000000 .$..............\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8004A444_4B044\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8004A444_4B044 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8004A468_4B068:gcc2.7.2","sym":"func_8004A468_4B068","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":7,"refSource":"void func_8004A468_4B068(u16 arg0, u16 arg1, u16 arg2) {\n D_800D4082_D4C82 = arg0;\n D_800CD2F4_CDEF4 = arg1;\n D_800D6A56_D7656 = arg2;\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/objmain.c#L1059-L1065","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsh\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tsh\ta2,0(at)\n 18:\tli\tv0,1\n 1c:\tlui\tat,0x0\n 20:\tsh\tv0,0(at)\n 24:\tli\tv0,4\n 28:\tlui\tat,0x0\n 2c:\tjr\tra\n 30:\tsh\tv0,0(at)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-568fac34e668.i.gz","proto":{"func_8004A468_4B068":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-de11bb2b49be74db/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8004A468_4B068\n00000000 *UND*\t00000000 D_800D4082_D4C82\n00000000 *UND*\t00000000 D_800CD2F4_CDEF4\n00000000 *UND*\t00000000 D_800D6A56_D7656\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D4082_D4C82\n00000004 R_MIPS_LO16 D_800D4082_D4C82\n00000008 R_MIPS_HI16 D_800CD2F4_CDEF4\n0000000c R_MIPS_LO16 D_800CD2F4_CDEF4\n00000010 R_MIPS_HI16 D_800D6A56_D7656\n00000014 R_MIPS_LO16 D_800D6A56_D7656\n0000001c R_MIPS_HI16 D_800A1780_A2380\n00000020 R_MIPS_LO16 D_800A1780_A2380\n00000028 R_MIPS_HI16 D_800D0A3A_D163A\n00000030 R_MIPS_LO16 D_800D0A3A_D163A\n\n\nContents of section .text:\n 0000 3c010000 a4240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 a4260000 24020001 3c010000 <....&..$...<...\n 0020 a4220000 24020004 3c010000 03e00008 .\"..$...<.......\n 0030 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"D_800A1780_A2380"},{"name":"D_800CD2F4_CDEF4"},{"name":"D_800D0A3A_D163A"},{"name":"D_800D4082_D4C82"},{"name":"D_800D6A56_D7656"}],"outcome":"match","source":"void func_8004A468_4B068(u32 a0, u32 a1, u32 a2) {\n D_800D4082_D4C82 = a0;\n D_800CD2F4_CDEF4 = a1;\n D_800D6A56_D7656 = a2;\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n return;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8004A468_4B068(u16 arg0, u16 arg1, u16 arg2) {\n D_800D4082_D4C82 = arg0;\n D_800CD2F4_CDEF4 = arg1;\n D_800D6A56_D7656 = arg2;\n D_800A1780_A2380 = 1;\n D_800D0A3A_D163A = 4;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8004A468_4B068` — benchmark function marioparty3:func_8004A468_4B068:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8004A468_4B068\n lui\t$at, %hi(D_800D4082_D4C82)\n sh\t$a0, %lo(D_800D4082_D4C82)($at)\n lui\t$at, %hi(D_800CD2F4_CDEF4)\n sh\t$a1, %lo(D_800CD2F4_CDEF4)($at)\n lui\t$at, %hi(D_800D6A56_D7656)\n sh\t$a2, %lo(D_800D6A56_D7656)($at)\n li\t$v0, 1\n lui\t$at, %hi(D_800A1780_A2380)\n sh\t$v0, %lo(D_800A1780_A2380)($at)\n li\t$v0, 4\n lui\t$at, %hi(D_800D0A3A_D163A)\n jr\t$ra\n sh\t$v0, %lo(D_800D0A3A_D163A)($at)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-568fac34e668.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8004A468_4B068(u16 arg0, u16 arg1, u16 arg2);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8004A468_4B068 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8004A468_4B068` — benchmark function marioparty3:func_8004A468_4B068:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8004A468_4B068:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tsh\ta0,0(at)\n 8:\tlui\tat,0x0\n c:\tsh\ta1,0(at)\n 10:\tlui\tat,0x0\n 14:\tsh\ta2,0(at)\n 18:\tli\tv0,1\n 1c:\tlui\tat,0x0\n 20:\tsh\tv0,0(at)\n 24:\tli\tv0,4\n 28:\tlui\tat,0x0\n 2c:\tjr\tra\n 30:\tsh\tv0,0(at)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-de11bb2b49be74db/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8004A468_4B068\n00000000 *UND*\t00000000 D_800D4082_D4C82\n00000000 *UND*\t00000000 D_800CD2F4_CDEF4\n00000000 *UND*\t00000000 D_800D6A56_D7656\n00000000 *UND*\t00000000 D_800A1780_A2380\n00000000 *UND*\t00000000 D_800D0A3A_D163A\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800D4082_D4C82\n00000004 R_MIPS_LO16 D_800D4082_D4C82\n00000008 R_MIPS_HI16 D_800CD2F4_CDEF4\n0000000c R_MIPS_LO16 D_800CD2F4_CDEF4\n00000010 R_MIPS_HI16 D_800D6A56_D7656\n00000014 R_MIPS_LO16 D_800D6A56_D7656\n0000001c R_MIPS_HI16 D_800A1780_A2380\n00000020 R_MIPS_LO16 D_800A1780_A2380\n00000028 R_MIPS_HI16 D_800D0A3A_D163A\n00000030 R_MIPS_LO16 D_800D0A3A_D163A\n\n\nContents of section .text:\n 0000 3c010000 a4240000 3c010000 a4250000 <....$..<....%..\n 0010 3c010000 a4260000 24020001 3c010000 <....&..$...<...\n 0020 a4220000 24020004 3c010000 03e00008 .\"..$...<.......\n 0030 a4220000 00000000 00000000 00000000 .\"..............\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8004A468_4B068\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8004A468_4B068 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80052E14_53A14:gcc2.7.2","sym":"func_80052E14_53A14","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","arithmetic"],"loc":13,"refSource":"void func_80052E14_53A14(HuSprite *arg0) {\n arg0->unk_68.unk00 = arg0->unk_84;\n arg0->unk_68.unk04 = arg0->unk_88;\n arg0->unk_68.unk06 = arg0->unk_0E;\n arg0->unk_68.unk0A = arg0->unk_8A;\n arg0->unk_68.unk08 = arg0->unk_0C;\n arg0->unk_68.unk0C = arg0->unk_8C;\n arg0->unk_68.unk10 = arg0->unk_10;\n arg0->unk_68.unk16 = arg0->unk_92;\n arg0->unk_68.unk14 = arg0->unk_90;\n arg0->unk_68.unk18 = 0;\n arg0->unk_68.unk17 = 0;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L213-L225","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,132(a0)\n 4:\tsw\tv0,104(a0)\n 8:\tlbu\tv0,136(a0)\n c:\tsb\tv0,108(a0)\n 10:\tlhu\tv0,14(a0)\n 14:\tsh\tv0,110(a0)\n 18:\tlhu\tv0,138(a0)\n 1c:\tsh\tv0,114(a0)\n 20:\tlhu\tv0,12(a0)\n 24:\tsh\tv0,112(a0)\n 28:\tlwc1\t$f0,140(a0)\n 2c:\tswc1\t$f0,116(a0)\n 30:\tlwc1\t$f0,16(a0)\n 34:\tswc1\t$f0,120(a0)\n 38:\tlbu\tv0,146(a0)\n 3c:\tsb\tv0,126(a0)\n 40:\tlhu\tv0,144(a0)\n 44:\tsh\tv0,124(a0)\n 48:\tsb\tzero,128(a0)\n 4c:\tjr\tra\n 50:\tsb\tzero,127(a0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_80052E14_53A14":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-175e7c1a4c54ca05/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80052E14_53A14\n\n\nContents of section .text:\n 0000 8c820084 ac820068 90820088 a082006c .......h.......l\n 0010 9482000e a482006e 9482008a a4820072 .......n.......r\n 0020 9482000c a4820070 c480008c e4800074 .......p.......t\n 0030 c4800010 e4800078 90820092 a082007e .......x.......~\n 0040 94820090 a482007c a0800080 03e00008 .......|........\n 0050 a080007f 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80052E14_53A14' — lift: cannot lift 'func_80052E14_53A14 @0x28': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlw\tv0,132(a0) */\n/* 4:\tsw\tv0,104(a0) */\n/* 8:\tlbu\tv0,136(a0) */\n/* c:\tsb\tv0,108(a0) */\n/* 10:\tlhu\tv0,14(a0) */\n/* 14:\tsh\tv0,110(a0) */\n/* 18:\tlhu\tv0,138(a0) */\n/* 1c:\tsh\tv0,114(a0) */\n/* 20:\tlhu\tv0,12(a0) */\n/* 24:\tsh\tv0,112(a0) */\n/* 28:\tlwc1\t$f0,140(a0) */\n/* 2c:\tswc1\t$f0,116(a0) */\n/* 30:\tlwc1\t$f0,16(a0) */\n/* 34:\tswc1\t$f0,120(a0) */\n/* 38:\tlbu\tv0,146(a0) */\n/* 3c:\tsb\tv0,126(a0) */\n/* 40:\tlhu\tv0,144(a0) */\n/* 44:\tsh\tv0,124(a0) */\n/* 48:\tsb\tzero,128(a0) */\n/* 4c:\tjr\tra */\n/* 50:\tsb\tzero,127(a0) */\n/* \t... */\nvoid func_80052E14_53A14(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80052E14_53A14 @0x28': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":30,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80052E14_53A14 @0x28': unmodelled effect instruction 'lwc1' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_80052E14_53A14(HuSprite *arg0) {\n arg0->unk_68.unk00 = arg0->unk_84;\n arg0->unk_68.unk04 = (u8) arg0->unk_88;\n arg0->unk_68.unk06 = (s16) (u16) arg0->unk_0E;\n arg0->unk_68.unk0A = (s16) (u16) arg0->unk_8A;\n arg0->unk_68.unk08 = (s16) (u16) arg0->unk_0C;\n arg0->unk_68.unk0C = arg0->unk_8C;\n arg0->unk_68.unk10 = arg0->unk_10;\n arg0->unk_68.unk16 = (u8) arg0->unk_92;\n arg0->unk_68.unk14 = (s16) (u16) arg0->unk_90;\n arg0->unk_68.unk18 = 0;\n arg0->unk_68.unk17 = 0;\n}\n","score":0,"maxScore":21,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":88,"lines":13,"gotos":0,"casts":10,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80052E14_53A14` — benchmark function marioparty3:func_80052E14_53A14:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80052E14_53A14\n lw\t$v0, 132($a0)\n sw\t$v0, 104($a0)\n lbu\t$v0, 136($a0)\n sb\t$v0, 108($a0)\n lhu\t$v0, 14($a0)\n sh\t$v0, 110($a0)\n lhu\t$v0, 138($a0)\n sh\t$v0, 114($a0)\n lhu\t$v0, 12($a0)\n sh\t$v0, 112($a0)\n lwc1\t$f0, 140($a0)\n swc1\t$f0, 116($a0)\n lwc1\t$f0, 16($a0)\n swc1\t$f0, 120($a0)\n lbu\t$v0, 146($a0)\n sb\t$v0, 126($a0)\n lhu\t$v0, 144($a0)\n sh\t$v0, 124($a0)\n sb\t$zero, 128($a0)\n jr\t$ra\n sb\t$zero, 127($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80052E14_53A14(HuSprite *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80052E14_53A14 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80052E14_53A14` — benchmark function marioparty3:func_80052E14_53A14:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80052E14_53A14:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,132(a0)\n 4:\tsw\tv0,104(a0)\n 8:\tlbu\tv0,136(a0)\n c:\tsb\tv0,108(a0)\n 10:\tlhu\tv0,14(a0)\n 14:\tsh\tv0,110(a0)\n 18:\tlhu\tv0,138(a0)\n 1c:\tsh\tv0,114(a0)\n 20:\tlhu\tv0,12(a0)\n 24:\tsh\tv0,112(a0)\n 28:\tlwc1\t$f0,140(a0)\n 2c:\tswc1\t$f0,116(a0)\n 30:\tlwc1\t$f0,16(a0)\n 34:\tswc1\t$f0,120(a0)\n 38:\tlbu\tv0,146(a0)\n 3c:\tsb\tv0,126(a0)\n 40:\tlhu\tv0,144(a0)\n 44:\tsh\tv0,124(a0)\n 48:\tsb\tzero,128(a0)\n 4c:\tjr\tra\n 50:\tsb\tzero,127(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-175e7c1a4c54ca05/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80052E14_53A14\n\n\nContents of section .text:\n 0000 8c820084 ac820068 90820088 a082006c .......h.......l\n 0010 9482000e a482006e 9482008a a4820072 .......n.......r\n 0020 9482000c a4820070 c480008c e4800074 .......p.......t\n 0030 c4800010 e4800078 90820092 a082007e .......x.......~\n 0040 94820090 a482007c a0800080 03e00008 .......|........\n 0050 a080007f 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80052E14_53A14\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80052E14_53A14 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800560D8_56CD8:gcc2.7.2","sym":"func_800560D8_56CD8","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","arithmetic"],"loc":3,"refSource":"HuSprite_Unk84_Unk00_Struct *func_800560D8_56CD8(s16 arg0, u16 arg1) {\n return &D_800C9530_CA130[arg0]->unk00[arg1];\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L636-L638","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\tjr\tra\n 2c:\taddu\tv0,v0,v1\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ccfed22fe178e2d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_800560D8_56CD8\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 03e00008 00431021 .....c.......C.!\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800560D8_56CD8' — lift: cannot lift 'func_800560D8_56CD8': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsll\ta0,a0,0x10 */\n/* 4:\tsra\ta0,a0,0xe */\n/* 8:\tlui\tv1,0x0 */\n/* c:\taddu\tv1,v1,a0 */\n/* 10:\tlw\tv1,0(v1) */\n/* 14:\tandi\ta1,a1,0xffff */\n/* 18:\tsll\tv0,a1,0x1 */\n/* 1c:\taddu\tv0,v0,a1 */\n/* 20:\tsll\tv0,v0,0x2 */\n/* 24:\tlw\tv1,0(v1) */\n/* 28:\tjr\tra */\n/* 2c:\taddu\tv0,v0,v1 */\nvoid func_800560D8_56CD8(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800560D8_56CD8': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800560D8_56CD8': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"HuSprite_Unk84_Unk00_Struct *func_800560D8_56CD8(s16 arg0, u16 arg1) {\n return ((arg1 & 0xFFFF) * 0xC) + **(D_800C9530_CA130 + ((s32) (arg0 << 0x10) >> 0xE));\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5513: invalid operands to binary +"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800560D8_56CD8` — benchmark function marioparty3:func_800560D8_56CD8:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800560D8_56CD8\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v1, %hi(D_800C9530_CA130)\n addu\t$v1, $v1, $a0\n lw\t$v1, %lo(D_800C9530_CA130)($v1)\n andi\t$a1, $a1, 0xffff\n sll\t$v0, $a1, 0x1\n addu\t$v0, $v0, $a1\n sll\t$v0, $v0, 0x2\n lw\t$v1, 0($v1)\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nHuSprite_Unk84_Unk00_Struct *func_800560D8_56CD8(s16 arg0, u16 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800560D8_56CD8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800560D8_56CD8` — benchmark function marioparty3:func_800560D8_56CD8:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800560D8_56CD8:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\tjr\tra\n 2c:\taddu\tv0,v0,v1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6ccfed22fe178e2d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 func_800560D8_56CD8\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 03e00008 00431021 .....c.......C.!\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800560D8_56CD8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8005614C_56D4C:gcc2.7.2","sym":"func_8005614C_56D4C","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","arithmetic"],"loc":5,"refSource":"void *func_8005614C_56D4C(s16 arg0, u16 arg1) {\n HuSprite_Unk84_Unk00_Struct *entry = &D_800C9530_CA130[arg0]->unk00[arg1];\n\n return entry->unk00;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L650-L654","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\taddu\tv0,v0,v1\n 2c:\tjr\tra\n 30:\tlw\tv0,0(v0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz","proto":{"func_8005614C_56D4C":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ce007631d46caae3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8005614C_56D4C\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 00431021 03e00008 .....c...C.!....\n 0030 8c420000 00000000 00000000 00000000 .B..............\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8005614C_56D4C' — lift: cannot lift 'func_8005614C_56D4C': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsll\ta0,a0,0x10 */\n/* 4:\tsra\ta0,a0,0xe */\n/* 8:\tlui\tv1,0x0 */\n/* c:\taddu\tv1,v1,a0 */\n/* 10:\tlw\tv1,0(v1) */\n/* 14:\tandi\ta1,a1,0xffff */\n/* 18:\tsll\tv0,a1,0x1 */\n/* 1c:\taddu\tv0,v0,a1 */\n/* 20:\tsll\tv0,v0,0x2 */\n/* 24:\tlw\tv1,0(v1) */\n/* 28:\taddu\tv0,v0,v1 */\n/* 2c:\tjr\tra */\n/* 30:\tlw\tv0,0(v0) */\n/* \t... */\nvoid func_8005614C_56D4C(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8005614C_56D4C': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8005614C_56D4C': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *func_8005614C_56D4C(s16 arg0, u16 arg1) {\n return *(((arg1 & 0xFFFF) * 0xC) + **(D_800C9530_CA130 + ((s32) (arg0 << 0x10) >> 0xE)));\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5513: invalid operands to binary +"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8005614C_56D4C` — benchmark function marioparty3:func_8005614C_56D4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8005614C_56D4C\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v1, %hi(D_800C9530_CA130)\n addu\t$v1, $v1, $a0\n lw\t$v1, %lo(D_800C9530_CA130)($v1)\n andi\t$a1, $a1, 0xffff\n sll\t$v0, $a1, 0x1\n addu\t$v0, $v0, $a1\n sll\t$v0, $v0, 0x2\n lw\t$v1, 0($v1)\n addu\t$v0, $v0, $v1\n jr\t$ra\n lw\t$v0, 0($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_8005614C_56D4C(s16 arg0, u16 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8005614C_56D4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005614C_56D4C` — benchmark function marioparty3:func_8005614C_56D4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8005614C_56D4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv1,0x0\n c:\taddu\tv1,v1,a0\n 10:\tlw\tv1,0(v1)\n 14:\tandi\ta1,a1,0xffff\n 18:\tsll\tv0,a1,0x1\n 1c:\taddu\tv0,v0,a1\n 20:\tsll\tv0,v0,0x2\n 24:\tlw\tv1,0(v1)\n 28:\taddu\tv0,v0,v1\n 2c:\tjr\tra\n 30:\tlw\tv0,0(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ce007631d46caae3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_8005614C_56D4C\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c030000 00641821 ..$...#.<....d.!\n 0010 8c630000 30a5ffff 00051040 00451021 .c..0......@.E.!\n 0020 00021080 8c630000 00431021 03e00008 .....c...C.!....\n 0030 8c420000 00000000 00000000 00000000 .B..............\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8005614C_56D4C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8005614C_56D4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80056254_56E54:gcc2.7.2","sym":"func_80056254_56E54","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","arithmetic"],"loc":3,"refSource":"void *func_80056254_56E54(HuSprite_Unk84_Struct **arg0) {\n return (*arg0)->unk0C;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L676-L678","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tjr\tra\n 8:\tlw\tv0,12(v0)\n c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_80056254_56E54":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f915d8b63c68575e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_80056254_56E54\n\n\nContents of section .text:\n 0000 8c820000 03e00008 8c42000c 00000000 .........B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void func_80056254_56E54(s32 * a0) {\n return;\n}\n","score":2,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void *func_80056254_56E54(HuSprite_Unk84_Struct **arg0) {\n return (*arg0)->unk0C;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80056254_56E54` — benchmark function marioparty3:func_80056254_56E54:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056254_56E54\n lw\t$v0, 0($a0)\n jr\t$ra\n lw\t$v0, 12($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80056254_56E54(HuSprite_Unk84_Struct **arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056254_56E54 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056254_56E54` — benchmark function marioparty3:func_80056254_56E54:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056254_56E54:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a0)\n 4:\tjr\tra\n 8:\tlw\tv0,12(v0)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f915d8b63c68575e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c func_80056254_56E54\n\n\nContents of section .text:\n 0000 8c820000 03e00008 8c42000c 00000000 .........B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80056254_56E54\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056254_56E54 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80056260_56E60:gcc2.7.2","sym":"func_80056260_56E60","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","global","arithmetic"],"loc":3,"refSource":"void *func_80056260_56E60(s16 arg0) {\n return D_800C9530_CA130[arg0]->unk0C;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L680-L682","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tjr\tra\n 18:\tlw\tv0,12(v0)\n 1c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz","proto":{"func_80056260_56E60":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c88c2e4abac83811/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_80056260_56E60\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 03e00008 8c42000c 00000000 .B.......B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80056260_56E60' — lift: cannot lift 'func_80056260_56E60': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsll\ta0,a0,0x10 */\n/* 4:\tsra\ta0,a0,0xe */\n/* 8:\tlui\tv0,0x0 */\n/* c:\taddu\tv0,v0,a0 */\n/* 10:\tlw\tv0,0(v0) */\n/* 14:\tjr\tra */\n/* 18:\tlw\tv0,12(v0) */\n/* 1c:\tnop */\nvoid func_80056260_56E60(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80056260_56E60': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80056260_56E60': %hi(D_800C9530_CA130) register used as data before a matching %lo — split hi/lo relocation not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *func_80056260_56E60(s16 arg0) {\n return (*(D_800C9530_CA130 + ((s32) (arg0 << 0x10) >> 0xE)))->unkC;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5513: structure has no member named `unkC'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80056260_56E60` — benchmark function marioparty3:func_80056260_56E60:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056260_56E60\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v0, %hi(D_800C9530_CA130)\n addu\t$v0, $v0, $a0\n lw\t$v0, %lo(D_800C9530_CA130)($v0)\n jr\t$ra\n lw\t$v0, 12($v0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-11cca7d0b904.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80056260_56E60(s16 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056260_56E60 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056260_56E60` — benchmark function marioparty3:func_80056260_56E60:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056260_56E60:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tjr\tra\n 18:\tlw\tv0,12(v0)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c88c2e4abac83811/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_80056260_56E60\n00000000 *UND*\t00000000 D_800C9530_CA130\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 D_800C9530_CA130\n00000010 R_MIPS_LO16 D_800C9530_CA130\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 03e00008 8c42000c 00000000 .B.......B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80056260_56E60\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056260_56E60 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80056C98_57898:gcc2.7.2","sym":"func_80056C98_57898","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","arithmetic"],"loc":7,"refSource":"u32 func_80056C98_57898(u8 **arg0) {\n u8 *p = *arg0;\n u32 val = (p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3];\n\n *arg0 = p + 4;\n return val;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L777-L783","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\ta1,0(a0)\n 4:\tlbu\tv0,0(a1)\n 8:\tsll\tv0,v0,0x18\n c:\tlbu\tv1,1(a1)\n 10:\tsll\tv1,v1,0x10\n 14:\taddu\tv0,v0,v1\n 18:\tlbu\tv1,2(a1)\n 1c:\tsll\tv1,v1,0x8\n 20:\taddu\tv0,v0,v1\n 24:\tlbu\tv1,3(a1)\n 28:\taddiu\ta1,a1,4\n 2c:\tsw\ta1,0(a0)\n 30:\tjr\tra\n 34:\taddu\tv0,v0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-0bc2346d0a617052/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 func_80056C98_57898\n\n\nContents of section .text:\n 0000 8c850000 90a20000 00021600 90a30001 ................\n 0010 00031c00 00431021 90a30002 00031a00 .....C.!........\n 0020 00431021 90a30003 24a50004 ac850000 .C.!....$.......\n 0030 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 func_80056C98_57898(s32 * a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n v0 = *(u8 *)*a0;\n v1 = ((u8 *)*a0)[1];\n v2 = ((u8 *)*a0)[2];\n v3 = ((u8 *)*a0)[3];\n *a0 = *a0 + 4;\n return (v0 << 24) + (v1 << 16) + (v2 << 8) + v3;\n}\n","score":18,"maxScore":19,"compileErrors":null,"breakdown":{"insert":5,"delete":5,"replace":0,"opMismatch":0,"argMismatch":8},"quality":{"score":96,"lines":12,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 func_80056C98_57898(void **arg0) {\n void *temp_a1;\n\n temp_a1 = *arg0;\n *arg0 = temp_a1 + 4;\n return (temp_a1->unk0 << 0x18) + (temp_a1->unk1 << 0x10) + (temp_a1->unk2 << 8) + temp_a1->unk3;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5515: warning: dereferencing `void *' pointer","/c.i:5515: request for member `unk0' in something not a structure or union","/c.i:5515: request for member `unk1' in something not a structure or union","/c.i:5515: request for member `unk2' in something not a structure or union","/c.i:5515: request for member `unk3' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":18,"maxScore":19,"ratio":0.9473684210526315,"kinds":{"insert":5,"delete":5,"replace":0,"opMismatch":0,"argMismatch":8}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80056C98_57898` — benchmark function marioparty3:func_80056C98_57898:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80056C98_57898\n lw\t$a1, 0($a0)\n lbu\t$v0, 0($a1)\n sll\t$v0, $v0, 0x18\n lbu\t$v1, 1($a1)\n sll\t$v1, $v1, 0x10\n addu\t$v0, $v0, $v1\n lbu\t$v1, 2($a1)\n sll\t$v1, $v1, 0x8\n addu\t$v0, $v0, $v1\n lbu\t$v1, 3($a1)\n addiu\t$a1, $a1, 4\n sw\t$a1, 0($a0)\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80056C98_57898 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80056C98_57898` — benchmark function marioparty3:func_80056C98_57898:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80056C98_57898:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\ta1,0(a0)\n 4:\tlbu\tv0,0(a1)\n 8:\tsll\tv0,v0,0x18\n c:\tlbu\tv1,1(a1)\n 10:\tsll\tv1,v1,0x10\n 14:\taddu\tv0,v0,v1\n 18:\tlbu\tv1,2(a1)\n 1c:\tsll\tv1,v1,0x8\n 20:\taddu\tv0,v0,v1\n 24:\tlbu\tv1,3(a1)\n 28:\taddiu\ta1,a1,4\n 2c:\tsw\ta1,0(a0)\n 30:\tjr\tra\n 34:\taddu\tv0,v0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-0bc2346d0a617052/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 func_80056C98_57898\n\n\nContents of section .text:\n 0000 8c850000 90a20000 00021600 90a30001 ................\n 0010 00031c00 00431021 90a30002 00031a00 .....C.!........\n 0020 00431021 90a30003 24a50004 ac850000 .C.!....$.......\n 0030 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80056C98_57898 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800570A8_57CA8:gcc2.7.2","sym":"func_800570A8_57CA8","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","loop","global","arithmetic"],"loc":12,"refSource":"void func_800570A8_57CA8(s16 group, s16 member, s16 arg2) {\n HuSprite *sprite = HuSprGrpData[group]->members[member];\n s32 i;\n\n sprite->unk_98 = D_800D0A50_D1650[arg2];\n sprite->unk_FC.f = 1.0f;\n for (i = 0; i < 0x10; i++) {\n sprite->unk_9C[i] = 0xFFFF;\n sprite->unk_BC[i] = 0;\n }\n sprite->unk_104 = 0;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/sprman.c#L823-L834","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tsll\ta1,a1,0x10\n 18:\tsra\ta1,a1,0xe\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\ta0,16(a1)\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0xe\n 2c:\tlui\tv0,0x0\n 30:\taddu\tv0,v0,a2\n 34:\tlw\tv0,0(v0)\n 38:\tsw\tv0,152(a0)\n 3c:\tlui\tat,0x3f80\n 40:\tmtc1\tat,$f0\n 44:\tnop\n 48:\tswc1\t$f0,252(a0)\n 4c:\tmove\tv1,zero\n 50:\tli\ta1,0xffff\n 54:\tsll\tv0,v1,0x1\n 58:\taddu\tv0,v0,a0\n 5c:\tsh\ta1,156(v0)\n 60:\tsll\tv0,v1,0x2\n 64:\taddu\tv0,v0,a0\n 68:\tsw\tzero,188(v0)\n 6c:\taddiu\tv1,v1,1\n 70:\tslti\tv0,v1,16\n 74:\tbnezl\tv0,58 \n 78:\tsll\tv0,v1,0x1\n 7c:\tjr\tra\n 80:\tsw\tzero,260(a0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-b2e749e20c8f.i.gz","proto":{"func_800570A8_57CA8":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c7814ced67c9c843/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800570A8_57CA8\n00000000 *UND*\t00000000 HuSprGrpData\n00000000 *UND*\t00000000 D_800D0A50_D1650\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HuSprGrpData\n00000010 R_MIPS_LO16 HuSprGrpData\n0000002c R_MIPS_HI16 D_800D0A50_D1650\n00000034 R_MIPS_LO16 D_800D0A50_D1650\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 00052c00 00052b83 00a22821 .B....,...+...(!\n 0020 8ca40010 00063400 00063383 3c020000 ......4...3.<...\n 0030 00461021 8c420000 ac820098 3c013f80 .F.!.B......<.?.\n 0040 44810000 00000000 e48000fc 00001821 D..............!\n 0050 3405ffff 00031040 00441021 a445009c 4......@.D.!.E..\n 0060 00031080 00441021 ac4000bc 24630001 .....D.!.@..$c..\n 0070 28620010 5440fff8 00031040 03e00008 (b..T@.....@....\n 0080 ac800104 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007e 00000000 00000001 00000000 ...~............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800570A8_57CA8' — lift: cannot lift 'func_800570A8_57CA8': unmodelled control transfer 'bnezl' at 0x74 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsll\ta0,a0,0x10 */\n/* 4:\tsra\ta0,a0,0xe */\n/* 8:\tlui\tv0,0x0 */\n/* c:\taddu\tv0,v0,a0 */\n/* 10:\tlw\tv0,0(v0) */\n/* 14:\tsll\ta1,a1,0x10 */\n/* 18:\tsra\ta1,a1,0xe */\n/* 1c:\taddu\ta1,a1,v0 */\n/* 20:\tlw\ta0,16(a1) */\n/* 24:\tsll\ta2,a2,0x10 */\n/* 28:\tsra\ta2,a2,0xe */\n/* 2c:\tlui\tv0,0x0 */\n/* 30:\taddu\tv0,v0,a2 */\n/* 34:\tlw\tv0,0(v0) */\n/* 38:\tsw\tv0,152(a0) */\n/* 3c:\tlui\tat,0x3f80 */\n/* 40:\tmtc1\tat,$f0 */\n/* 44:\tnop */\n/* 48:\tswc1\t$f0,252(a0) */\n/* 4c:\tmove\tv1,zero */\n/* 50:\tli\ta1,0xffff */\n/* 54:\tsll\tv0,v1,0x1 */\n/* 58:\taddu\tv0,v0,a0 */\n/* 5c:\tsh\ta1,156(v0) */\n/* 60:\tsll\tv0,v1,0x2 */\n/* 64:\taddu\tv0,v0,a0 */\n/* 68:\tsw\tzero,188(v0) */\n/* 6c:\taddiu\tv1,v1,1 */\n/* 70:\tslti\tv0,v1,16 */\n/* 74:\tbnezl\tv0,58 */\n/* 78:\tsll\tv0,v1,0x1 */\n/* 7c:\tjr\tra */\n/* 80:\tsw\tzero,260(a0) */\n/* \t... */\nvoid func_800570A8_57CA8(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800570A8_57CA8': unmodelled control transfer 'bnezl' at 0x74 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":42,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800570A8_57CA8': unmodelled control transfer 'bnezl' at 0x74 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_800570A8_57CA8(s16 group, s16 member, s16 arg2) {\n s32 var_v1;\n void *temp_a0;\n\n temp_a0 = (((s32) (member << 0x10) >> 0xE) + *(HuSprGrpData + ((s32) (group << 0x10) >> 0xE)))->unk10;\n temp_a0->unk98 = (s32) *(D_800D0A50_D1650 + ((s32) (arg2 << 0x10) >> 0xE));\n temp_a0->unkFC = 1.0f;\n var_v1 = 0;\n do {\n ((var_v1 * 2) + temp_a0)->unk9C = 0xFFFF;\n ((var_v1 * 4) + temp_a0)->unkBC = 0;\n var_v1 += 1;\n } while (var_v1 < 0x10);\n temp_a0->unk104 = 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":96,"lines":14,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5515: structure has no member named `unk10'","/c.i:5516: warning: dereferencing `void *' pointer","/c.i:5516: request for member `unk98' in something not a structure or union","/c.i:5517: warning: dereferencing `void *' pointer","/c.i:5517: request for member `unkFC' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800570A8_57CA8` — benchmark function marioparty3:func_800570A8_57CA8:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800570A8_57CA8\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0xe\n lui\t$v0, %hi(HuSprGrpData)\n addu\t$v0, $v0, $a0\n lw\t$v0, %lo(HuSprGrpData)($v0)\n sll\t$a1, $a1, 0x10\n sra\t$a1, $a1, 0xe\n addu\t$a1, $a1, $v0\n lw\t$a0, 16($a1)\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0xe\n lui\t$v0, %hi(D_800D0A50_D1650)\n addu\t$v0, $v0, $a2\n lw\t$v0, %lo(D_800D0A50_D1650)($v0)\n sw\t$v0, 152($a0)\n lui\t$at, 0x3f80\n mtc1\t$at, $f0\n nop\n swc1\t$f0, 252($a0)\n move\t$v1, $zero\n li\t$a1, 0xffff\n sll\t$v0, $v1, 0x1\n.L58:\n addu\t$v0, $v0, $a0\n sh\t$a1, 156($v0)\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $a0\n sw\t$zero, 188($v0)\n addiu\t$v1, $v1, 1\n slti\t$v0, $v1, 16\n bnezl\t$v0, .L58\n sll\t$v0, $v1, 0x1\n jr\t$ra\n sw\t$zero, 260($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-b2e749e20c8f.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800570A8_57CA8(s16 group, s16 member, s16 arg2);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800570A8_57CA8 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800570A8_57CA8` — benchmark function marioparty3:func_800570A8_57CA8:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800570A8_57CA8:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0xe\n 8:\tlui\tv0,0x0\n c:\taddu\tv0,v0,a0\n 10:\tlw\tv0,0(v0)\n 14:\tsll\ta1,a1,0x10\n 18:\tsra\ta1,a1,0xe\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\ta0,16(a1)\n 24:\tsll\ta2,a2,0x10\n 28:\tsra\ta2,a2,0xe\n 2c:\tlui\tv0,0x0\n 30:\taddu\tv0,v0,a2\n 34:\tlw\tv0,0(v0)\n 38:\tsw\tv0,152(a0)\n 3c:\tlui\tat,0x3f80\n 40:\tmtc1\tat,$f0\n 44:\tnop\n 48:\tswc1\t$f0,252(a0)\n 4c:\tmove\tv1,zero\n 50:\tli\ta1,0xffff\n 54:\tsll\tv0,v1,0x1\n 58:\taddu\tv0,v0,a0\n 5c:\tsh\ta1,156(v0)\n 60:\tsll\tv0,v1,0x2\n 64:\taddu\tv0,v0,a0\n 68:\tsw\tzero,188(v0)\n 6c:\taddiu\tv1,v1,1\n 70:\tslti\tv0,v1,16\n 74:\tbnezl\tv0,58 \n 78:\tsll\tv0,v1,0x1\n 7c:\tjr\tra\n 80:\tsw\tzero,260(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c7814ced67c9c843/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800570A8_57CA8\n00000000 *UND*\t00000000 HuSprGrpData\n00000000 *UND*\t00000000 D_800D0A50_D1650\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_HI16 HuSprGrpData\n00000010 R_MIPS_LO16 HuSprGrpData\n0000002c R_MIPS_HI16 D_800D0A50_D1650\n00000034 R_MIPS_LO16 D_800D0A50_D1650\n\n\nContents of section .text:\n 0000 00042400 00042383 3c020000 00441021 ..$...#.<....D.!\n 0010 8c420000 00052c00 00052b83 00a22821 .B....,...+...(!\n 0020 8ca40010 00063400 00063383 3c020000 ......4...3.<...\n 0030 00461021 8c420000 ac820098 3c013f80 .F.!.B......<.?.\n 0040 44810000 00000000 e48000fc 00001821 D..............!\n 0050 3405ffff 00031040 00441021 a445009c 4......@.D.!.E..\n 0060 00031080 00441021 ac4000bc 24630001 .....D.!.@..$c..\n 0070 28620010 5440fff8 00031040 03e00008 (b..T@.....@....\n 0080 ac800104 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007e 00000000 00000001 00000000 ...~............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800570A8_57CA8\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800570A8_57CA8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8005FA90_60690:gcc2.7.2","sym":"func_8005FA90_60690","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","loop","branch","global","arithmetic"],"loc":17,"refSource":"u8 func_8005FA90_60690(u8 *arg0) {\n s16 i, j;\n\n for (i = 0; i < 10; i += 2) {\n if (D_800A232C_A2F2C[i] == arg0[0] && D_800A232C_A2F2C[i + 1] == arg0[1]) {\n return i / 2;\n }\n }\n for (i = 0; i < 16; i++) {\n for (j = 0; j < 32; j += 2) {\n if (D_800A2344_A2F44[i][j] == arg0[0] && D_800A2344_A2F44[i][j + 1] == arg0[1]) {\n return i * 16 + j / 2;\n }\n }\n }\n return 16;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L297-L313","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,zero\n 4:\tlbu\ta3,0(a0)\n 8:\tsll\ta2,t0,0x10\n c:\tsra\ta1,a2,0x10\n 10:\tlui\tv0,0x0\n 14:\taddu\tv0,v0,a1\n 18:\tlbu\tv0,0(v0)\n 1c:\tbne\tv0,a3,50 \n 20:\taddiu\tv0,t0,2\n 24:\tlui\tv1,0x0\n 28:\taddu\tv1,v1,a1\n 2c:\tlbu\tv1,1(v1)\n 30:\tlbu\tv0,1(a0)\n 34:\tbnel\tv1,v0,50 \n 38:\taddiu\tv0,t0,2\n 3c:\tsrl\tv0,a2,0x1f\n 40:\taddu\tv0,a1,v0\n 44:\tsrl\tv0,v0,0x1\n 48:\tj\t10c \n 4c:\tandi\tv0,v0,0xff\n 50:\tmove\tt0,v0\n 54:\tsll\tv0,v0,0x10\n 58:\tsra\tv0,v0,0x10\n 5c:\tslti\tv0,v0,10\n 60:\tbnez\tv0,c \n 64:\tsll\ta2,t0,0x10\n 68:\tmove\tt0,zero\n 6c:\tlui\tt4,0x0\n 70:\taddiu\tt4,t4,0\n 74:\tlbu\tt3,0(a0)\n 78:\tmove\ta3,zero\n 7c:\tsll\tv1,t0,0x10\n 80:\tsra\tv1,v1,0x10\n 84:\tsll\tv0,v1,0x2\n 88:\taddu\tv0,v0,t4\n 8c:\tlw\tt1,0(v0)\n 90:\tsll\tt2,v1,0x4\n 94:\tsll\ta1,a3,0x10\n 98:\tsra\ta2,a1,0x10\n 9c:\taddu\tv1,t1,a2\n a0:\tlbu\tv0,0(v1)\n a4:\tbne\tv0,t3,d4 \n a8:\taddiu\tv0,a3,2\n ac:\tlbu\tv1,1(v1)\n b0:\tlbu\tv0,1(a0)\n b4:\tbnel\tv1,v0,d4 \n b8:\taddiu\tv0,a3,2\n bc:\tsrl\tv0,a1,0x1f\n c0:\taddu\tv0,a2,v0\n c4:\tsra\tv0,v0,0x1\n c8:\taddu\tv0,v0,t2\n cc:\tj\t10c \n d0:\tandi\tv0,v0,0xff\n d4:\tmove\ta3,v0\n d8:\tsll\tv0,v0,0x10\n dc:\tsra\tv0,v0,0x10\n e0:\tslti\tv0,v0,32\n e4:\tbnez\tv0,98 \n e8:\tsll\ta1,a3,0x10\n ec:\taddiu\tv0,t0,1\n f0:\tmove\tt0,v0\n f4:\tsll\tv0,v0,0x10\n f8:\tsra\tv0,v0,0x10\n fc:\tslti\tv0,v0,16\n 100:\tbnezl\tv0,7c \n 104:\tmove\ta3,zero\n 108:\tli\tv0,16\n 10c:\tjr\tra\n 110:\tnop\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-08282be5c7c2.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-9446791f5273df55/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000114 func_8005FA90_60690\n00000000 *UND*\t00000000 D_800A232C_A2F2C\n00000000 *UND*\t00000000 D_800A2344_A2F44\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 D_800A232C_A2F2C\n00000018 R_MIPS_LO16 D_800A232C_A2F2C\n00000024 R_MIPS_HI16 D_800A232C_A2F2C\n0000002c R_MIPS_LO16 D_800A232C_A2F2C\n00000048 R_MIPS_26 .text\n0000006c R_MIPS_HI16 D_800A2344_A2F44\n00000070 R_MIPS_LO16 D_800A2344_A2F44\n000000cc R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00004021 90870000 00083400 00062c03 ..@!......4...,.\n 0010 3c020000 00451021 90420000 1447000c <....E.!.B...G..\n 0020 25020002 3c030000 00651821 90630001 %...<....e.!.c..\n 0030 90820001 54620006 25020002 000617c2 ....Tb..%.......\n 0040 00a21021 00021042 08000043 304200ff ...!...B...C0B..\n 0050 00404021 00021400 00021403 2842000a .@@!........(B..\n 0060 1440ffea 00083400 00004021 3c0c0000 .@....4...@!<...\n 0070 258c0000 908b0000 00003821 00081c00 %.........8!....\n 0080 00031c03 00031080 004c1021 8c490000 .........L.!.I..\n 0090 00035100 00072c00 00053403 01261821 ..Q...,...4..&.!\n 00a0 90620000 144b000b 24e20002 90630001 .b...K..$....c..\n 00b0 90820001 54620007 24e20002 000517c2 ....Tb..$.......\n 00c0 00c21021 00021043 004a1021 08000043 ...!...C.J.!...C\n 00d0 304200ff 00403821 00021400 00021403 0B...@8!........\n 00e0 28420020 1440ffec 00072c00 25020001 (B. .@....,.%...\n 00f0 00404021 00021400 00021403 28420010 .@@!........(B..\n 0100 5440ffde 00003821 24020010 03e00008 T@....8!$.......\n 0110 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80001ffc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8005FA90_60690' — lift: cannot lift 'func_8005FA90_60690': unmodelled control transfer 'bnel' at 0x34 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tt0,zero */\n/* 4:\tlbu\ta3,0(a0) */\n/* 8:\tsll\ta2,t0,0x10 */\n/* c:\tsra\ta1,a2,0x10 */\n/* 10:\tlui\tv0,0x0 */\n/* 14:\taddu\tv0,v0,a1 */\n/* 18:\tlbu\tv0,0(v0) */\n/* 1c:\tbne\tv0,a3,50 */\n/* 20:\taddiu\tv0,t0,2 */\n/* 24:\tlui\tv1,0x0 */\n/* 28:\taddu\tv1,v1,a1 */\n/* 2c:\tlbu\tv1,1(v1) */\n/* 30:\tlbu\tv0,1(a0) */\n/* 34:\tbnel\tv1,v0,50 */\n/* 38:\taddiu\tv0,t0,2 */\n/* 3c:\tsrl\tv0,a2,0x1f */\n/* 40:\taddu\tv0,a1,v0 */\n/* 44:\tsrl\tv0,v0,0x1 */\n/* 48:\tj\t10c */\n/* 4c:\tandi\tv0,v0,0xff */\n/* 50:\tmove\tt0,v0 */\n/* 54:\tsll\tv0,v0,0x10 */\n/* 58:\tsra\tv0,v0,0x10 */\n/* 5c:\tslti\tv0,v0,10 */\n/* 60:\tbnez\tv0,c */\n/* 64:\tsll\ta2,t0,0x10 */\n/* 68:\tmove\tt0,zero */\n/* 6c:\tlui\tt4,0x0 */\n/* 70:\taddiu\tt4,t4,0 */\n/* 74:\tlbu\tt3,0(a0) */\n/* 78:\tmove\ta3,zero */\n/* 7c:\tsll\tv1,t0,0x10 */\n/* 80:\tsra\tv1,v1,0x10 */\n/* 84:\tsll\tv0,v1,0x2 */\n/* 88:\taddu\tv0,v0,t4 */\n/* 8c:\tlw\tt1,0(v0) */\n/* 90:\tsll\tt2,v1,0x4 */\n/* 94:\tsll\ta1,a3,0x10 */\n/* 98:\tsra\ta2,a1,0x10 */\n/* 9c:\taddu\tv1,t1,a2 */\n/* a0:\tlbu\tv0,0(v1) */\n/* a4:\tbne\tv0,t3,d4 */\n/* a8:\taddiu\tv0,a3,2 */\n/* ac:\tlbu\tv1,1(v1) */\n/* b0:\tlbu\tv0,1(a0) */\n/* b4:\tbnel\tv1,v0,d4 */\n/* b8:\taddiu\tv0,a3,2 */\n/* bc:\tsrl\tv0,a1,0x1f */\n/* c0:\taddu\tv0,a2,v0 */\n/* c4:\tsra\tv0,v0,0x1 */\n/* c8:\taddu\tv0,v0,t2 */\n/* cc:\tj\t10c */\n/* d0:\tandi\tv0,v0,0xff */\n/* d4:\tmove\ta3,v0 */\n/* d8:\tsll\tv0,v0,0x10 */\n/* dc:\tsra\tv0,v0,0x10 */\n/* e0:\tslti\tv0,v0,32 */\n/* e4:\tbnez\tv0,98 */\n/* e8:\tsll\ta1,a3,0x10 */\n/* ec:\taddiu\tv0,t0,1 */\n/* f0:\tmove\tt0,v0 */\n/* f4:\tsll\tv0,v0,0x10 */\n/* f8:\tsra\tv0,v0,0x10 */\n/* fc:\tslti\tv0,v0,16 */\n/* 100:\tbnezl\tv0,7c */\n/* 104:\tmove\ta3,zero */\n/* 108:\tli\tv0,16 */\n/* 10c:\tjr\tra */\n/* 110:\tnop */\n/* \t... */\nvoid func_8005FA90_60690(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8005FA90_60690': unmodelled control transfer 'bnel' at 0x34 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":78,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8005FA90_60690': unmodelled control transfer 'bnel' at 0x34 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 func_8005FA90_60690(u8 *arg0) {\n s16 temp_v0;\n s16 var_a3;\n s16 var_t0;\n s16 var_t0_2;\n s16 var_v0;\n s16 var_v0_2;\n s32 temp_a1;\n s32 temp_a2;\n s32 var_a1;\n s32 var_a2;\n u8 *temp_v1;\n\n var_t0_2 = 0;\n var_a2 = 0 << 0x10;\nloop_1:\n temp_a1 = var_a2 >> 0x10;\n var_v0 = var_t0_2 + 2;\n if (D_800A232C_A2F2C[temp_a1] == arg0->unk0) {\n if (D_800A232C_A2F2C[temp_a1] != arg0->unk1) {\n var_v0 = var_t0_2 + 2;\n goto block_6;\n }\n return ((u32) (temp_a1 + ((u32) var_a2 >> 0x1F)) >> 1) & 0xFF;\n }\nblock_6:\n var_t0_2 = var_v0;\n var_a2 = var_t0_2 << 0x10;\n if (var_v0 >= 0xA) {\n var_t0 = 0;\nloop_8:\n var_a3 = 0;\n var_a1 = 0 << 0x10;\nloop_9:\n temp_a2 = var_a1 >> 0x10;\n temp_v1 = &D_800A2344_A2F44[var_t0][temp_a2];\n var_v0_2 = var_a3 + 2;\n if (temp_v1->unk0 == arg0->unk0) {\n if (temp_v1->unk1 != arg0->unk1) {\n var_v0_2 = var_a3 + 2;\n goto block_14;\n }\n return (((s32) (temp_a2 + ((u32) var_a1 >> 0x1F)) >> 1) + (var_t0 * 0x10)) & 0xFF;\n }\nblock_14:\n var_a3 = var_v0_2;\n var_a1 = var_a3 << 0x10;\n if (var_v0_2 >= 0x20) {\n temp_v0 = var_t0 + 1;\n var_t0 = temp_v0;\n if (temp_v0 >= 0x10) {\n return 0x10U;\n }\n goto loop_8;\n }\n goto loop_9;\n }\n goto loop_1;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":60,"lines":58,"gotos":5,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["gcc 2.7.2 failed: /c.i:5530: request for member `unk0' in something not a structure or union","/c.i:5531: request for member `unk1' in something not a structure or union","/c.i:5549: request for member `unk0' in something not a structure or union","/c.i:5550: request for member `unk1' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8005FA90_60690` — benchmark function marioparty3:func_8005FA90_60690:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8005FA90_60690\n move\t$t0, $zero\n lbu\t$a3, 0($a0)\n sll\t$a2, $t0, 0x10\n.Lc:\n sra\t$a1, $a2, 0x10\n lui\t$v0, %hi(D_800A232C_A2F2C)\n addu\t$v0, $v0, $a1\n lbu\t$v0, %lo(D_800A232C_A2F2C)($v0)\n bne\t$v0, $a3, .L50\n addiu\t$v0, $t0, 2\n lui\t$v1, %hi(D_800A232C_A2F2C)\n addu\t$v1, $v1, $a1\n lbu\t$v1, %lo(D_800A232C_A2F2C)($v1)\n lbu\t$v0, 1($a0)\n bnel\t$v1, $v0, .L50\n addiu\t$v0, $t0, 2\n srl\t$v0, $a2, 0x1f\n addu\t$v0, $a1, $v0\n srl\t$v0, $v0, 0x1\n j\t.L10c\n andi\t$v0, $v0, 0xff\n.L50:\n move\t$t0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 10\n bnez\t$v0, .Lc\n sll\t$a2, $t0, 0x10\n move\t$t0, $zero\n lui\t$t4, %hi(D_800A2344_A2F44)\n addiu\t$t4, $t4, %lo(D_800A2344_A2F44)\n lbu\t$t3, 0($a0)\n move\t$a3, $zero\n.L7c:\n sll\t$v1, $t0, 0x10\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $t4\n lw\t$t1, 0($v0)\n sll\t$t2, $v1, 0x4\n sll\t$a1, $a3, 0x10\n.L98:\n sra\t$a2, $a1, 0x10\n addu\t$v1, $t1, $a2\n lbu\t$v0, 0($v1)\n bne\t$v0, $t3, .Ld4\n addiu\t$v0, $a3, 2\n lbu\t$v1, 1($v1)\n lbu\t$v0, 1($a0)\n bnel\t$v1, $v0, .Ld4\n addiu\t$v0, $a3, 2\n srl\t$v0, $a1, 0x1f\n addu\t$v0, $a2, $v0\n sra\t$v0, $v0, 0x1\n addu\t$v0, $v0, $t2\n j\t.L10c\n andi\t$v0, $v0, 0xff\n.Ld4:\n move\t$a3, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 32\n bnez\t$v0, .L98\n sll\t$a1, $a3, 0x10\n addiu\t$v0, $t0, 1\n move\t$t0, $v0\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 16\n bnezl\t$v0, .L7c\n move\t$a3, $zero\n li\t$v0, 16\n.L10c:\n jr\t$ra\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-08282be5c7c2.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 func_8005FA90_60690(u8 *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8005FA90_60690 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8005FA90_60690` — benchmark function marioparty3:func_8005FA90_60690:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8005FA90_60690:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,zero\n 4:\tlbu\ta3,0(a0)\n 8:\tsll\ta2,t0,0x10\n c:\tsra\ta1,a2,0x10\n 10:\tlui\tv0,0x0\n 14:\taddu\tv0,v0,a1\n 18:\tlbu\tv0,0(v0)\n 1c:\tbne\tv0,a3,50 \n 20:\taddiu\tv0,t0,2\n 24:\tlui\tv1,0x0\n 28:\taddu\tv1,v1,a1\n 2c:\tlbu\tv1,1(v1)\n 30:\tlbu\tv0,1(a0)\n 34:\tbnel\tv1,v0,50 \n 38:\taddiu\tv0,t0,2\n 3c:\tsrl\tv0,a2,0x1f\n 40:\taddu\tv0,a1,v0\n 44:\tsrl\tv0,v0,0x1\n 48:\tj\t10c \n 4c:\tandi\tv0,v0,0xff\n 50:\tmove\tt0,v0\n 54:\tsll\tv0,v0,0x10\n 58:\tsra\tv0,v0,0x10\n 5c:\tslti\tv0,v0,10\n 60:\tbnez\tv0,c \n 64:\tsll\ta2,t0,0x10\n 68:\tmove\tt0,zero\n 6c:\tlui\tt4,0x0\n 70:\taddiu\tt4,t4,0\n 74:\tlbu\tt3,0(a0)\n 78:\tmove\ta3,zero\n 7c:\tsll\tv1,t0,0x10\n 80:\tsra\tv1,v1,0x10\n 84:\tsll\tv0,v1,0x2\n 88:\taddu\tv0,v0,t4\n 8c:\tlw\tt1,0(v0)\n 90:\tsll\tt2,v1,0x4\n 94:\tsll\ta1,a3,0x10\n 98:\tsra\ta2,a1,0x10\n 9c:\taddu\tv1,t1,a2\n a0:\tlbu\tv0,0(v1)\n a4:\tbne\tv0,t3,d4 \n a8:\taddiu\tv0,a3,2\n ac:\tlbu\tv1,1(v1)\n b0:\tlbu\tv0,1(a0)\n b4:\tbnel\tv1,v0,d4 \n b8:\taddiu\tv0,a3,2\n bc:\tsrl\tv0,a1,0x1f\n c0:\taddu\tv0,a2,v0\n c4:\tsra\tv0,v0,0x1\n c8:\taddu\tv0,v0,t2\n cc:\tj\t10c \n d0:\tandi\tv0,v0,0xff\n d4:\tmove\ta3,v0\n d8:\tsll\tv0,v0,0x10\n dc:\tsra\tv0,v0,0x10\n e0:\tslti\tv0,v0,32\n e4:\tbnez\tv0,98 \n e8:\tsll\ta1,a3,0x10\n ec:\taddiu\tv0,t0,1\n f0:\tmove\tt0,v0\n f4:\tsll\tv0,v0,0x10\n f8:\tsra\tv0,v0,0x10\n fc:\tslti\tv0,v0,16\n 100:\tbnezl\tv0,7c \n 104:\tmove\ta3,zero\n 108:\tli\tv0,16\n 10c:\tjr\tra\n 110:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-9446791f5273df55/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000114 func_8005FA90_60690\n00000000 *UND*\t00000000 D_800A232C_A2F2C\n00000000 *UND*\t00000000 D_800A2344_A2F44\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 D_800A232C_A2F2C\n00000018 R_MIPS_LO16 D_800A232C_A2F2C\n00000024 R_MIPS_HI16 D_800A232C_A2F2C\n0000002c R_MIPS_LO16 D_800A232C_A2F2C\n00000048 R_MIPS_26 .text\n0000006c R_MIPS_HI16 D_800A2344_A2F44\n00000070 R_MIPS_LO16 D_800A2344_A2F44\n000000cc R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00004021 90870000 00083400 00062c03 ..@!......4...,.\n 0010 3c020000 00451021 90420000 1447000c <....E.!.B...G..\n 0020 25020002 3c030000 00651821 90630001 %...<....e.!.c..\n 0030 90820001 54620006 25020002 000617c2 ....Tb..%.......\n 0040 00a21021 00021042 08000043 304200ff ...!...B...C0B..\n 0050 00404021 00021400 00021403 2842000a .@@!........(B..\n 0060 1440ffea 00083400 00004021 3c0c0000 .@....4...@!<...\n 0070 258c0000 908b0000 00003821 00081c00 %.........8!....\n 0080 00031c03 00031080 004c1021 8c490000 .........L.!.I..\n 0090 00035100 00072c00 00053403 01261821 ..Q...,...4..&.!\n 00a0 90620000 144b000b 24e20002 90630001 .b...K..$....c..\n 00b0 90820001 54620007 24e20002 000517c2 ....Tb..$.......\n 00c0 00c21021 00021043 004a1021 08000043 ...!...C.J.!...C\n 00d0 304200ff 00403821 00021400 00021403 0B...@8!........\n 00e0 28420020 1440ffec 00072c00 25020001 (B. .@....,.%...\n 00f0 00404021 00021400 00021403 28420010 .@@!........(B..\n 0100 5440ffde 00003821 24020010 03e00008 T@....8!$.......\n 0110 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80001ffc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8005FA90_60690 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_800600C0_60CC0:gcc2.7.2","sym":"func_800600C0_60CC0","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","global","arithmetic"],"loc":10,"refSource":"void func_800600C0_60CC0(s16 winId, s32 arg1) {\n TextWindow *window;\n\n window = &D_800CC69C_CD29C[winId];\n if (arg1 != 0) {\n window->unk_38 |= 0x10;\n } else {\n window->unk_38 &= ~0x10;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L325-L334","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\tbeqz\ta1,38 \n 28:\taddu\ta0,v0,v1\n 2c:\tlw\tv0,56(a0)\n 30:\tj\t44 \n 34:\tori\tv0,v0,0x10\n 38:\tlw\tv0,56(a0)\n 3c:\tli\tv1,-17\n 40:\tand\tv0,v0,v1\n 44:\tjr\tra\n 48:\tsw\tv0,56(a0)\n 4c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz","proto":{"func_800600C0_60CC0":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ebcbb216a187e6c6/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_800600C0_60CC0\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 D_800CC69C_CD29C\n00000020 R_MIPS_LO16 D_800CC69C_CD29C\n00000030 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00042400 00042403 00041080 00441021 ..$...$......D.!\n 0010 00021140 00441023 00021080 3c030000 ...@.D.#....<...\n 0020 8c630000 10a00004 00432021 8c820038 .c.......C !...8\n 0030 08000011 34420010 8c820038 2403ffef ....4B.....8$...\n 0040 00431024 03e00008 ac820038 00000000 .C.$.......8....\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[{"name":"D_800CC69C_CD29C","shape":"pointer"}],"outcome":"nonmatch","source":"void func_800600C0_60CC0(s32 a0, s32 a1) {\n s32 v0;\n s32 v1;\n v0 = D_800CC69C_CD29C;\n if (a1 == 0) {\n v1 = ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] & -17;\n } else {\n v1 = ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] | 16;\n }\n ((s32 *)(((a0 << 16 >> 16) * 160 - (a0 << 16 >> 16) << 2) + v0))[14] = v1;\n return;\n}\n","score":41,"maxScore":42,"compileErrors":null,"breakdown":{"insert":23,"delete":7,"replace":4,"opMismatch":0,"argMismatch":7},"quality":{"score":98,"lines":12,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_800600C0_60CC0(s16 winId, s32 arg1) {\n TextWindow *temp_a0;\n u32 var_v0;\n\n temp_a0 = &D_800CC69C_CD29C[winId];\n if (arg1 != 0) {\n var_v0 = temp_a0->unk_38 | 0x10;\n } else {\n var_v0 = temp_a0->unk_38 & ~0x10;\n }\n temp_a0->unk_38 = var_v0;\n}\n","score":3,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":19,"ratio":0.15789473684210525,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800600C0_60CC0` — benchmark function marioparty3:func_800600C0_60CC0:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800600C0_60CC0\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$v0, $a0, 0x2\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x5\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_800CC69C_CD29C)\n lw\t$v1, %lo(D_800CC69C_CD29C)($v1)\n beqz\t$a1, .L38\n addu\t$a0, $v0, $v1\n lw\t$v0, 56($a0)\n j\t.L44\n ori\t$v0, $v0, 0x10\n.L38:\n lw\t$v0, 56($a0)\n li\t$v1, -17\n and\t$v0, $v0, $v1\n.L44:\n jr\t$ra\n sw\t$v0, 56($a0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800600C0_60CC0(s16 winId, s32 arg1);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800600C0_60CC0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800600C0_60CC0` — benchmark function marioparty3:func_800600C0_60CC0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_800600C0_60CC0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\tlui\tv1,0x0\n 20:\tlw\tv1,0(v1)\n 24:\tbeqz\ta1,38 \n 28:\taddu\ta0,v0,v1\n 2c:\tlw\tv0,56(a0)\n 30:\tj\t44 \n 34:\tori\tv0,v0,0x10\n 38:\tlw\tv0,56(a0)\n 3c:\tli\tv1,-17\n 40:\tand\tv0,v0,v1\n 44:\tjr\tra\n 48:\tsw\tv0,56(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-ebcbb216a187e6c6/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_800600C0_60CC0\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 D_800CC69C_CD29C\n00000020 R_MIPS_LO16 D_800CC69C_CD29C\n00000030 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00042400 00042403 00041080 00441021 ..$...$......D.!\n 0010 00021140 00441023 00021080 3c030000 ...@.D.#....<...\n 0020 8c630000 10a00004 00432021 8c820038 .c.......C !...8\n 0030 08000011 34420010 8c820038 2403ffef ....4B.....8$...\n 0040 00431024 03e00008 ac820038 00000000 .C.$.......8....\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800600C0_60CC0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800600C0_60CC0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8006014C_60D4C:gcc2.7.2","sym":"func_8006014C_60D4C","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["global"],"loc":3,"refSource":"s8 func_8006014C_60D4C(s32 winId) {\n return D_800CC69C_CD29C[winId].unk_31;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/window.c#L345-L347","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\taddu\tv0,v0,v1\n 20:\tjr\tra\n 24:\tlb\tv0,49(v0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f52bf81a0ee885b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 func_8006014C_60D4C\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800CC69C_CD29C\n00000004 R_MIPS_LO16 D_800CC69C_CD29C\n\n\nContents of section .text:\n 0000 3c030000 8c630000 00041080 00441021 <....c.......D.!\n 0010 00021140 00441023 00021080 00431021 ...@.D.#.....C.!\n 0020 03e00008 80420031 00000000 00000000 .....B.1........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","symbolsUsed":[{"name":"D_800CC69C_CD29C","shape":"pointer"}],"outcome":"nonmatch","source":"s32 func_8006014C_60D4C(u32 a0) {\n return ((s8 *)((a0 * 160 - a0 << 2) + D_800CC69C_CD29C))[49];\n}\n","score":11,"maxScore":15,"compileErrors":null,"breakdown":{"insert":5,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 func_8006014C_60D4C(s32 winId) {\n return D_800CC69C_CD29C[winId].unk_31;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8006014C_60D4C` — benchmark function marioparty3:func_8006014C_60D4C:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8006014C_60D4C\n lui\t$v1, %hi(D_800CC69C_CD29C)\n lw\t$v1, %lo(D_800CC69C_CD29C)($v1)\n sll\t$v0, $a0, 0x2\n addu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x5\n subu\t$v0, $v0, $a0\n sll\t$v0, $v0, 0x2\n addu\t$v0, $v0, $v1\n jr\t$ra\n lb\t$v0, 49($v0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-634bc95b6a8b.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns8 func_8006014C_60D4C(s32 winId);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8006014C_60D4C # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8006014C_60D4C` — benchmark function marioparty3:func_8006014C_60D4C:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8006014C_60D4C:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv1,0x0\n 4:\tlw\tv1,0(v1)\n 8:\tsll\tv0,a0,0x2\n c:\taddu\tv0,v0,a0\n 10:\tsll\tv0,v0,0x5\n 14:\tsubu\tv0,v0,a0\n 18:\tsll\tv0,v0,0x2\n 1c:\taddu\tv0,v0,v1\n 20:\tjr\tra\n 24:\tlb\tv0,49(v0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-f52bf81a0ee885b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 func_8006014C_60D4C\n00000000 *UND*\t00000000 D_800CC69C_CD29C\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 D_800CC69C_CD29C\n00000004 R_MIPS_LO16 D_800CC69C_CD29C\n\n\nContents of section .text:\n 0000 3c030000 8c630000 00041080 00441021 <....c.......D.!\n 0010 00021140 00441023 00021080 00431021 ...@.D.#.....C.!\n 0020 03e00008 80420031 00000000 00000000 .....B.1........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8006014C_60D4C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_80071B40_72740:gcc2.7.2","sym":"func_80071B40_72740","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","arithmetic"],"loc":3,"refSource":"void func_80071B40_72740(ALVoice *voice, s16 priority) {\n voice->priority = priority;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/72740.c#L3-L5","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsh\ta1,22(a0)\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_80071B40_72740":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6172ae035c3f8dd3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_80071B40_72740\n\n\nContents of section .text:\n 0000 03e00008 a4850016 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void func_80071B40_72740(u16 * a0, u32 a1) {\n a0[11] = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_80071B40_72740(ALVoice *voice, s16 priority) {\n voice->priority = priority;\n}\n/* Warning: struct PVoice_s is not defined (only forward-declared) */\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80071B40_72740` — benchmark function marioparty3:func_80071B40_72740:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80071B40_72740\n jr\t$ra\n sh\t$a1, 22($a0)\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80071B40_72740(ALVoice *voice, s16 priority);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80071B40_72740 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80071B40_72740` — benchmark function marioparty3:func_80071B40_72740:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_80071B40_72740:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsh\ta1,22(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-6172ae035c3f8dd3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 func_80071B40_72740\n\n\nContents of section .text:\n 0000 03e00008 a4850016 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80071B40_72740\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80071B40_72740 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:func_8008A0D0_8ACD0:gcc2.7.2","sym":"func_8008A0D0_8ACD0","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","arithmetic"],"loc":16,"refSource":"void func_8008A0D0_8ACD0(Mtx *arg0) {\n arg0->m[0][1] =\n arg0->m[0][3] =\n arg0->m[1][0] =\n arg0->m[1][2] =\n arg0->m[2][0] =\n arg0->m[2][1] =\n arg0->m[2][2] =\n arg0->m[2][3] =\n arg0->m[3][0] =\n arg0->m[3][1] =\n arg0->m[3][2] =\n arg0->m[3][3] = 0;\n arg0->m[0][0] = arg0->m[1][1] = 0x10000;\n arg0->m[0][2] = arg0->m[1][3] = 1;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/8ACD0.c#L3-L18","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,60(a0)\n 4:\tsw\tzero,56(a0)\n 8:\tsw\tzero,52(a0)\n c:\tsw\tzero,48(a0)\n 10:\tsw\tzero,44(a0)\n 14:\tsw\tzero,40(a0)\n 18:\tsw\tzero,36(a0)\n 1c:\tsw\tzero,32(a0)\n 20:\tsw\tzero,24(a0)\n 24:\tsw\tzero,16(a0)\n 28:\tsw\tzero,12(a0)\n 2c:\tsw\tzero,4(a0)\n 30:\tlui\tv0,0x1\n 34:\tsw\tv0,20(a0)\n 38:\tsw\tv0,0(a0)\n 3c:\tli\tv0,1\n 40:\tsw\tv0,28(a0)\n 44:\tjr\tra\n 48:\tsw\tv0,8(a0)\n 4c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"func_8008A0D0_8ACD0":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cfcfe2081306cc0e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_8008A0D0_8ACD0\n\n\nContents of section .text:\n 0000 ac80003c ac800038 ac800034 ac800030 ...<...8...4...0\n 0010 ac80002c ac800028 ac800024 ac800020 ...,...(...$... \n 0020 ac800018 ac800010 ac80000c ac800004 ................\n 0030 3c020001 ac820014 ac820000 24020001 <...........$...\n 0040 ac82001c 03e00008 ac820008 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void func_8008A0D0_8ACD0(s32 * a0) {\n a0[15] = 0;\n a0[14] = 0;\n a0[13] = 0;\n a0[12] = 0;\n a0[11] = 0;\n a0[10] = 0;\n a0[9] = 0;\n a0[8] = 0;\n a0[6] = 0;\n a0[4] = 0;\n a0[3] = 0;\n a0[1] = 0;\n a0[5] = 65536;\n *a0 = 65536;\n a0[7] = 1;\n a0[2] = 1;\n return;\n}\n","score":0,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":19,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_8008A0D0_8ACD0(Mtx *arg0) {\n arg0->m[3][3] = 0;\n arg0->m[3][2] = 0;\n arg0->m[3][1] = 0;\n arg0->m[3][0] = 0;\n arg0->m[2][3] = 0;\n arg0->m[2][2] = 0;\n arg0->m[2][1] = 0;\n arg0->m[2][0] = 0;\n arg0->m[1][2] = 0;\n arg0->m[1][0] = 0;\n arg0->m[0][3] = 0;\n arg0->m[0][1] = 0;\n arg0->m[1][1] = 0x10000;\n arg0->m[0][0] = 0x10000;\n arg0->m[1][3] = 1;\n arg0->m[0][2] = 1;\n}\n","score":0,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8008A0D0_8ACD0` — benchmark function marioparty3:func_8008A0D0_8ACD0:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8008A0D0_8ACD0\n sw\t$zero, 60($a0)\n sw\t$zero, 56($a0)\n sw\t$zero, 52($a0)\n sw\t$zero, 48($a0)\n sw\t$zero, 44($a0)\n sw\t$zero, 40($a0)\n sw\t$zero, 36($a0)\n sw\t$zero, 32($a0)\n sw\t$zero, 24($a0)\n sw\t$zero, 16($a0)\n sw\t$zero, 12($a0)\n sw\t$zero, 4($a0)\n lui\t$v0, 0x1\n sw\t$v0, 20($a0)\n sw\t$v0, 0($a0)\n li\t$v0, 1\n sw\t$v0, 28($a0)\n jr\t$ra\n sw\t$v0, 8($a0)\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8008A0D0_8ACD0(Mtx *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8008A0D0_8ACD0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8008A0D0_8ACD0` — benchmark function marioparty3:func_8008A0D0_8ACD0:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:func_8008A0D0_8ACD0:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\tzero,60(a0)\n 4:\tsw\tzero,56(a0)\n 8:\tsw\tzero,52(a0)\n c:\tsw\tzero,48(a0)\n 10:\tsw\tzero,44(a0)\n 14:\tsw\tzero,40(a0)\n 18:\tsw\tzero,36(a0)\n 1c:\tsw\tzero,32(a0)\n 20:\tsw\tzero,24(a0)\n 24:\tsw\tzero,16(a0)\n 28:\tsw\tzero,12(a0)\n 2c:\tsw\tzero,4(a0)\n 30:\tlui\tv0,0x1\n 34:\tsw\tv0,20(a0)\n 38:\tsw\tv0,0(a0)\n 3c:\tli\tv0,1\n 40:\tsw\tv0,28(a0)\n 44:\tjr\tra\n 48:\tsw\tv0,8(a0)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cfcfe2081306cc0e/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c func_8008A0D0_8ACD0\n\n\nContents of section .text:\n 0000 ac80003c ac800038 ac800034 ac800030 ...<...8...4...0\n 0010 ac80002c ac800028 ac800024 ac800020 ...,...(...$... \n 0020 ac800018 ac800010 ac80000c ac800004 ................\n 0030 3c020001 ac820014 ac820000 24020001 <...........$...\n 0040 ac82001c 03e00008 ac820008 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8008A0D0_8ACD0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8008A0D0_8ACD0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:GWBoardRecordGet:gcc2.7.2","sym":"GWBoardRecordGet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["pointer","branch","arithmetic"],"loc":12,"refSource":"u8 *GWBoardRecordGet(s16 arg0) {\n s16 idx = arg0;\n\n if (arg0 < 0) {\n idx = GwSystem.current_board_index;\n }\n\n if (GwSystem.playMode & 1) {\n return (u8 *)&GwCommon.unk_1D[2] + idx * 9;\n }\n return (u8 *)&GwCommon.unk_1D[0x38] + idx * 9;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/save.c#L80-L91","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tsll\ta0,a0,0x10\n 8:\tbgez\ta0,20 \n c:\tnop\n 10:\tlui\tv0,0x0\n 14:\tlbu\tv0,1(v0)\n 18:\tsll\tv0,v0,0x18\n 1c:\tsra\tv1,v0,0x18\n 20:\tlui\tv0,0x0\n 24:\tlbu\tv0,0(v0)\n 28:\tandi\tv0,v0,0x1\n 2c:\tbnez\tv0,4c \n 30:\tsll\tv1,v1,0x10\n 34:\tsra\tv1,v1,0x10\n 38:\tsll\tv0,v1,0x3\n 3c:\taddu\tv0,v0,v1\n 40:\tlui\tv1,0x0\n 44:\tj\t60 \n 48:\taddiu\tv1,v1,85\n 4c:\tsra\tv1,v1,0x10\n 50:\tsll\tv0,v1,0x3\n 54:\taddu\tv0,v0,v1\n 58:\tlui\tv1,0x0\n 5c:\taddiu\tv1,v1,31\n 60:\tjr\tra\n 64:\taddu\tv0,v0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-8ff646f69be78698/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000068 GWBoardRecordGet\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 GwCommon\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 GwSystem\n00000014 R_MIPS_LO16 GwSystem\n00000020 R_MIPS_HI16 GwSystem\n00000024 R_MIPS_LO16 GwSystem\n00000040 R_MIPS_HI16 GwCommon\n00000048 R_MIPS_LO16 GwCommon\n00000044 R_MIPS_26 .text\n00000058 R_MIPS_HI16 GwCommon\n0000005c R_MIPS_LO16 GwCommon\n\n\nContents of section .text:\n 0000 00801821 00042400 04810005 00000000 ...!..$.........\n 0010 3c020000 90420001 00021600 00021e03 <....B..........\n 0020 3c020000 90420000 30420001 14400007 <....B..0B...@..\n 0030 00031c00 00031c03 000310c0 00431021 .............C.!\n 0040 3c030000 08000018 24630055 00031c03 <.......$c.U....\n 0050 000310c0 00431021 3c030000 2463001f .....C.!<...$c..\n 0060 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[{"name":"GwCommon","shape":"struct GwCommon_s (164 B)"},{"name":"GwSystem","shape":"struct GW_SYSTEM (164 B)"}],"outcome":"nonmatch","source":"s32 GWBoardRecordGet(s32 a0) {\n s32 v0;\n s32 v1;\n if (a0 << 16 < 0) a0 = (s32)(GwSystem.current_board_index << 24) >> 24;\n if ((GwSystem.playMode & 1) != 0) {\n v0 = (a0 << 16 >> 16) * 9;\n v1 = (u32)&GwCommon + 31;\n } else {\n v0 = (a0 << 16 >> 16) * 9;\n v1 = (u32)&GwCommon + 85;\n }\n return v0 + v1;\n}\n","score":20,"maxScore":26,"compileErrors":null,"breakdown":{"insert":0,"delete":3,"replace":2,"opMismatch":0,"argMismatch":15},"quality":{"score":100,"lines":13,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"extern ? GwCommon;\nextern u8 GwSystem;\n\nvoid *GWBoardRecordGet(s8 arg0) {\n s32 var_v0;\n s8 var_v1;\n\n var_v1 = arg0;\n if (arg0 & 0x8000) {\n var_v1 = (s8) GwSystem;\n }\n if (!(GwSystem & 1)) {\n var_v0 = (s16) var_v1 * 9;\n } else {\n var_v0 = (s16) var_v1 * 9;\n }\n return var_v0 + &GwCommon;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":98,"lines":16,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":{"decompiler":"asmlift","score":20,"maxScore":26,"ratio":0.7692307692307693,"kinds":{"insert":0,"delete":3,"replace":2,"opMismatch":0,"argMismatch":15}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GWBoardRecordGet` — benchmark function marioparty3:GWBoardRecordGet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GWBoardRecordGet\n move\t$v1, $a0\n sll\t$a0, $a0, 0x10\n bgez\t$a0, .L20\n nop\n lui\t$v0, %hi(GwSystem)\n lbu\t$v0, %lo(GwSystem)($v0)\n sll\t$v0, $v0, 0x18\n sra\t$v1, $v0, 0x18\n.L20:\n lui\t$v0, %hi(GwSystem)\n lbu\t$v0, %lo(GwSystem)($v0)\n andi\t$v0, $v0, 0x1\n bnez\t$v0, .L4c\n sll\t$v1, $v1, 0x10\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x3\n addu\t$v0, $v0, $v1\n lui\t$v1, %hi(GwCommon)\n j\t.L60\n addiu\t$v1, $v1, %lo(GwCommon)\n.L4c:\n sra\t$v1, $v1, 0x10\n sll\t$v0, $v1, 0x3\n addu\t$v0, $v0, $v1\n lui\t$v1, %hi(GwCommon)\n addiu\t$v1, $v1, %lo(GwCommon)\n.L60:\n jr\t$ra\n addu\t$v0, $v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GWBoardRecordGet # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GWBoardRecordGet` — benchmark function marioparty3:GWBoardRecordGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:GWBoardRecordGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tsll\ta0,a0,0x10\n 8:\tbgez\ta0,20 \n c:\tnop\n 10:\tlui\tv0,0x0\n 14:\tlbu\tv0,1(v0)\n 18:\tsll\tv0,v0,0x18\n 1c:\tsra\tv1,v0,0x18\n 20:\tlui\tv0,0x0\n 24:\tlbu\tv0,0(v0)\n 28:\tandi\tv0,v0,0x1\n 2c:\tbnez\tv0,4c \n 30:\tsll\tv1,v1,0x10\n 34:\tsra\tv1,v1,0x10\n 38:\tsll\tv0,v1,0x3\n 3c:\taddu\tv0,v0,v1\n 40:\tlui\tv1,0x0\n 44:\tj\t60 \n 48:\taddiu\tv1,v1,85\n 4c:\tsra\tv1,v1,0x10\n 50:\tsll\tv0,v1,0x3\n 54:\taddu\tv0,v0,v1\n 58:\tlui\tv1,0x0\n 5c:\taddiu\tv1,v1,31\n 60:\tjr\tra\n 64:\taddu\tv0,v0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-8ff646f69be78698/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000068 GWBoardRecordGet\n00000000 *UND*\t00000000 GwSystem\n00000000 *UND*\t00000000 GwCommon\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 GwSystem\n00000014 R_MIPS_LO16 GwSystem\n00000020 R_MIPS_HI16 GwSystem\n00000024 R_MIPS_LO16 GwSystem\n00000040 R_MIPS_HI16 GwCommon\n00000048 R_MIPS_LO16 GwCommon\n00000044 R_MIPS_26 .text\n00000058 R_MIPS_HI16 GwCommon\n0000005c R_MIPS_LO16 GwCommon\n\n\nContents of section .text:\n 0000 00801821 00042400 04810005 00000000 ...!..$.........\n 0010 3c020000 90420001 00021600 00021e03 <....B..........\n 0020 3c020000 90420000 30420001 14400007 <....B..0B...@..\n 0030 00031c00 00031c03 000310c0 00431021 .............C.!\n 0040 3c030000 08000018 24630055 00031c03 <.......$c.U....\n 0050 000310c0 00431021 3c030000 2463001f .....C.!<...$c..\n 0060 03e00008 00431021 00000000 00000000 .....C.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name GWBoardRecordGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:GWMgNoSet:gcc2.7.2","sym":"GWMgNoSet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic"],"loc":3,"refSource":"void GWMgNoSet(s8 arg0) {\n GwSystem.minigame_index = arg0;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/save.c#L17-L19","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsb\ta0,16(at)\n c:\tnop\n","proto":{"GWMgNoSet":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a0e672d23a10fb4c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c GWMgNoSet\n00000000 *UND*\t00000000 GwSystem\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000008 R_MIPS_LO16 GwSystem\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a0240010 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"GwSystem","shape":"struct GW_SYSTEM (164 B)"}],"outcome":"match","source":"void GWMgNoSet(u32 a0) {\n GwSystem.minigame_index = a0;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern s8 GwSystem;\n\nvoid GWMgNoSet(s8 arg0) {\n GwSystem = arg0;\n}\n","score":2,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GWMgNoSet` — benchmark function marioparty3:GWMgNoSet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GWMgNoSet\n lui\t$at, %hi(GwSystem)\n jr\t$ra\n sb\t$a0, %lo(GwSystem)($at)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GWMgNoSet # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GWMgNoSet` — benchmark function marioparty3:GWMgNoSet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:GWMgNoSet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tat,0x0\n 4:\tjr\tra\n 8:\tsb\ta0,16(at)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-a0e672d23a10fb4c/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c GWMgNoSet\n00000000 *UND*\t00000000 GwSystem\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 GwSystem\n00000008 R_MIPS_LO16 GwSystem\n\n\nContents of section .text:\n 0000 3c010000 03e00008 a0240010 00000000 <........$......\nContents of section .reginfo:\n 0000 80000012 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GWMgNoSet\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name GWMgNoSet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2","sym":"HuMemUsedMemoryBlockGet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","loop","arithmetic"],"loc":13,"refSource":"u32 HuMemUsedMemoryBlockGet(HeapNode *heap) {\n HeapNode *cur_heap;\n u32 count_free;\n\n cur_heap = heap;\n count_free = 0;\n do {\n count_free += (cur_heap->active ^ TRUE) == FALSE ? 1 : 0;\n cur_heap = cur_heap->next;\n } while (cur_heap != heap);\n\n return count_free;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/malloc.c#L158-L170","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tlbu\tv0,5(v1)\n c:\txori\tv0,v0,0x1\n 10:\tsltiu\tv0,v0,1\n 14:\tlw\tv1,12(v1)\n 18:\tbne\tv1,a0,8 \n 1c:\taddu\ta1,a1,v0\n 20:\tjr\tra\n 24:\tmove\tv0,a1\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c8d399600d2a1b5d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 HuMemUsedMemoryBlockGet\n\n\nContents of section .text:\n 0000 00801821 00002821 90620005 38420001 ...!..(!.b..8B..\n 0010 2c420001 8c63000c 1464fffb 00a22821 ,B...c...d....(!\n 0020 03e00008 00a01021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"struct Struct0 { u8 _pad0[5]; u8 field_5; u8 _pad1[6]; s32 field_12; };\ns32 HuMemUsedMemoryBlockGet(struct Struct0 * a0) {\n s32 v0;\n struct Struct0 * v1;\n s32 v2;\n v1 = a0;\n v2 = 0;\n do {\n v0 = v1->field_5;\n v1 = (struct Struct0 *)v1->field_12;\n v2 = v2 + ((v0 ^ 1) < 1);\n } while (v1 != a0);\n return v2;\n}\n","score":3,"maxScore":11,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 HuMemUsedMemoryBlockGet(HeapNode *heap) {\n HeapNode *var_v1;\n s32 temp_v0;\n u32 var_a1;\n\n var_v1 = heap;\n var_a1 = 0;\n do {\n temp_v0 = var_v1->active == 1;\n var_v1 = var_v1->next;\n var_a1 += temp_v0;\n } while (var_v1 != heap);\n return var_a1;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `HuMemUsedMemoryBlockGet` — benchmark function marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel HuMemUsedMemoryBlockGet\n move\t$v1, $a0\n move\t$a1, $zero\n.L8:\n lbu\t$v0, 5($v1)\n xori\t$v0, $v0, 0x1\n sltiu\t$v0, $v0, 1\n lw\t$v1, 12($v1)\n bne\t$v1, $a0, .L8\n addu\t$a1, $a1, $v0\n jr\t$ra\n move\t$v0, $a1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu32 HuMemUsedMemoryBlockGet(HeapNode *heap);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function HuMemUsedMemoryBlockGet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `HuMemUsedMemoryBlockGet` — benchmark function marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuMemUsedMemoryBlockGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tlbu\tv0,5(v1)\n c:\txori\tv0,v0,0x1\n 10:\tsltiu\tv0,v0,1\n 14:\tlw\tv1,12(v1)\n 18:\tbne\tv1,a0,8 \n 1c:\taddu\ta1,a1,v0\n 20:\tjr\tra\n 24:\tmove\tv0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-c8d399600d2a1b5d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 HuMemUsedMemoryBlockGet\n\n\nContents of section .text:\n 0000 00801821 00002821 90620005 38420001 ...!..(!.b..8B..\n 0010 2c420001 8c63000c 1464fffb 00a22821 ,B...c...d....(!\n 0020 03e00008 00a01021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name HuMemUsedMemoryBlockGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2","sym":"HuMemUsedMemorySizeGet","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","loop","branch","arithmetic"],"loc":15,"refSource":"u32 HuMemUsedMemorySizeGet(HeapNode *heap) {\n HeapNode *cur_heap;\n u32 total_size;\n\n cur_heap = heap;\n total_size = 0;\n do {\n if (cur_heap->active == TRUE) {\n total_size += cur_heap->size;\n }\n cur_heap = cur_heap->next;\n } while (cur_heap != heap);\n\n return total_size;\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/malloc.c#L139-L153","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tli\ta2,1\n c:\tlbu\tv0,5(v1)\n 10:\tbne\tv0,a2,20 \n 14:\tnop\n 18:\tlw\tv0,0(v1)\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\tv1,12(v1)\n 24:\tbne\tv1,a0,c \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,a1\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-73de7a10111e47ad/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 HuMemUsedMemorySizeGet\n\n\nContents of section .text:\n 0000 00801821 00002821 24060001 90620005 ...!..(!$....b..\n 0010 14460003 00000000 8c620000 00a22821 .F.......b....(!\n 0020 8c63000c 1464fff9 00000000 03e00008 .c...d..........\n 0030 00a01021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"struct Struct0 { s32 field_0; u8 _pad0[1]; u8 field_5; u8 _pad1[6]; s32 field_12; };\ns32 HuMemUsedMemorySizeGet(struct Struct0 * a0) {\n struct Struct0 * v0;\n s32 v1;\n s32 v2;\n v0 = a0;\n v1 = 0;\n do {\n if (v0->field_5 != 1) {\n v2 = v1;\n } else {\n v2 = v1 + v0->field_0;\n }\n v1 = v2;\n v0 = (struct Struct0 *)v0->field_12;\n } while (v0 != a0);\n return v1;\n}\n","score":4,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":3,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 HuMemUsedMemorySizeGet(HeapNode *heap) {\n HeapNode *var_v1;\n u32 var_a1;\n\n var_v1 = heap;\n var_a1 = 0;\n do {\n if (var_v1->active == 1) {\n var_a1 += var_v1->size;\n }\n var_v1 = var_v1->next;\n } while (var_v1 != heap);\n return var_a1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `HuMemUsedMemorySizeGet` — benchmark function marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel HuMemUsedMemorySizeGet\n move\t$v1, $a0\n move\t$a1, $zero\n li\t$a2, 1\n.Lc:\n lbu\t$v0, 5($v1)\n bne\t$v0, $a2, .L20\n nop\n lw\t$v0, 0($v1)\n addu\t$a1, $a1, $v0\n.L20:\n lw\t$v1, 12($v1)\n bne\t$v1, $a0, .Lc\n nop\n jr\t$ra\n move\t$v0, $a1\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu32 HuMemUsedMemorySizeGet(HeapNode *heap);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function HuMemUsedMemorySizeGet # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `HuMemUsedMemorySizeGet` — benchmark function marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:HuMemUsedMemorySizeGet:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tmove\ta1,zero\n 8:\tli\ta2,1\n c:\tlbu\tv0,5(v1)\n 10:\tbne\tv0,a2,20 \n 14:\tnop\n 18:\tlw\tv0,0(v1)\n 1c:\taddu\ta1,a1,v0\n 20:\tlw\tv1,12(v1)\n 24:\tbne\tv1,a0,c \n 28:\tnop\n 2c:\tjr\tra\n 30:\tmove\tv0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-73de7a10111e47ad/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 HuMemUsedMemorySizeGet\n\n\nContents of section .text:\n 0000 00801821 00002821 24060001 90620005 ...!..(!$....b..\n 0010 14460003 00000000 8c620000 00a22821 .F.......b....(!\n 0020 8c63000c 1464fff9 00000000 03e00008 .c...d..........\n 0030 00a01021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name HuMemUsedMemorySizeGet # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"marioparty3:UnlinkProcess:gcc2.7.2","sym":"UnlinkProcess","project":"marioparty3","tier":"real","toolchain":"gcc2.7.2","isa":"mips","compiler":"gcc","language":"c","features":["struct","pointer","branch","arithmetic"],"loc":10,"refSource":"static void UnlinkProcess(Process **root, Process *process) {\n if (process->next) {\n process->next->youngest_child = process->youngest_child;\n }\n if (process->youngest_child) {\n process->youngest_child->next = process->next;\n } else {\n *root = process->next;\n }\n}","sourceUrl":"https://github.com/macabeus/marioparty3/blob/89c0fafd30375f21222c39bcefd8456bac130c53/src/process.c#L45-L54","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,0(a1)\n 4:\tbeqz\tv1,14 \n 8:\tnop\n c:\tlw\tv0,4(a1)\n 10:\tsw\tv0,4(v1)\n 14:\tlw\tv1,4(a1)\n 18:\tbeqz\tv1,2c \n 1c:\tnop\n 20:\tlw\tv0,0(a1)\n 24:\tj\t34 \n 28:\tsw\tv0,0(v1)\n 2c:\tlw\tv0,0(a1)\n 30:\tsw\tv0,0(a0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz","proto":{"UnlinkProcess":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cc80fd6fc668362f/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l F .text\t0000003c UnlinkProcess\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8ca30000 10600003 00000000 8ca20004 .....`..........\n 0010 ac620004 8ca30004 10600004 00000000 .b.......`......\n 0020 8ca20000 0800000d ac620000 8ca20000 .........b......\n 0030 ac820000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void UnlinkProcess(s32 * a0, s32 * a1) {\n s32 v0;\n s32 v1;\n if (*a1 != 0) ((s32 *)*a1)[1] = a1[1];\n if (a1[1] == 0) {\n v1 = *a1;\n *a0 = v1;\n } else {\n v0 = *a1;\n *(s32 *)a1[1] = v0;\n }\n return;\n}\n","score":5,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":13,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void UnlinkProcess(Process **root, Process *process) {\n Process *temp_v1;\n Process *temp_v1_2;\n\n temp_v1 = process->next;\n if (temp_v1 != NULL) {\n temp_v1->youngest_child = process->youngest_child;\n }\n temp_v1_2 = process->youngest_child;\n if (temp_v1_2 != NULL) {\n temp_v1_2->next = process->next;\n return;\n }\n *root = process->next;\n}\n","score":0,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `UnlinkProcess` — benchmark function marioparty3:UnlinkProcess:gcc2.7.2.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel UnlinkProcess\n lw\t$v1, 0($a1)\n beqz\t$v1, .L14\n nop\n lw\t$v0, 4($a1)\n sw\t$v0, 4($v1)\n.L14:\n lw\t$v1, 4($a1)\n beqz\t$v1, .L2c\n nop\n lw\t$v0, 0($a1)\n j\t.L34\n sw\t$v0, 0($v1)\n.L2c:\n lw\t$v0, 0($a1)\n sw\t$v0, 0($a0)\n.L34:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/marioparty3/ctx-0eb9f921480c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nstatic void UnlinkProcess(Process **root, Process *process);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function UnlinkProcess # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `UnlinkProcess` — benchmark function marioparty3:UnlinkProcess:gcc2.7.2.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/marioparty3.git marioparty3\n# make -C marioparty3\n# make -C marioparty3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/marioparty3/symbols.json.gz\n# sha256 of the decompressed map JSON: e249a038f016048d9e33be700c6bdb39406578cdee1a84bb4cef6fd98d39da20\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/marioparty3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target marioparty3:UnlinkProcess:gcc2.7.2 --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,0(a1)\n 4:\tbeqz\tv1,14 \n 8:\tnop\n c:\tlw\tv0,4(a1)\n 10:\tsw\tv0,4(v1)\n 14:\tlw\tv1,4(a1)\n 18:\tbeqz\tv1,2c \n 1c:\tnop\n 20:\tlw\tv0,0(a1)\n 24:\tj\t34 \n 28:\tsw\tv0,0(v1)\n 2c:\tlw\tv0,0(a1)\n 30:\tsw\tv0,0(a0)\n 34:\tjr\tra\n 38:\tnop\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc272-cc80fd6fc668362f/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l F .text\t0000003c UnlinkProcess\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000024 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 8ca30000 10600003 00000000 8ca20004 .....`..........\n 0010 ac620004 8ca30004 10600004 00000000 .b.......`......\n 0020 8ca20000 0800000d ac620000 8ca20000 .........b......\n 0030 ac820000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"UnlinkProcess\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2 # frontend + target description (ISA, calling convention, compiler idioms)\n --name UnlinkProcess # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:CalcByteArraySum:agbcc","sym":"CalcByteArraySum","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","loop","pointer","array"],"loc":7,"refSource":"u32 CalcByteArraySum(const u8 *data, u32 length)\n{\n u32 sum, i;\n for (sum = 0, i = 0; i < length; i++)\n sum += data[i];\n return sum;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L256-L262","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcByteArraySum\n\t.type\t CalcByteArraySum,function\n\t.thumb_func\nCalcByteArraySum:\n\tpush\t{r4, lr}\n\tadd\tr4, r0, #0\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r4, r2\n\tldrb\tr0, [r0]\n\tadd\tr3, r3, r0\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, r1\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcByteArraySum,.Lfe1-CalcByteArraySum\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 CalcByteArraySum(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n v1 = 0;\n for (v0 = 0; v0 < a1; v0 = v0 + 1) {\n v1 = v1 + *(u8 *)(a0 + v0);\n }\n return v1;\n}\n","score":0,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 CalcByteArraySum(s32 arg0, u32 arg1) {\n s32 var_r3;\n u32 var_r2;\n\n var_r3 = 0;\n var_r2 = 0;\n if (arg1 > 0U) {\n do {\n var_r3 += *(arg0 + var_r2);\n var_r2 += 1;\n } while (var_r2 < arg1);\n }\n return var_r3;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3929: invalid type argument of `unary *'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CalcByteArraySum` — benchmark function pokeemerald:CalcByteArraySum:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcByteArraySum\n\t.type\t CalcByteArraySum,function\n\t.thumb_func\nCalcByteArraySum:\n\tpush\t{r4, lr}\n\tadd\tr4, r0, #0\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r4, r2\n\tldrb\tr0, [r0]\n\tadd\tr3, r3, r0\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, r1\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcByteArraySum,.Lfe1-CalcByteArraySum\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CalcByteArraySum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CalcByteArraySum` — benchmark function pokeemerald:CalcByteArraySum:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalcByteArraySum:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcByteArraySum\n\t.type\t CalcByteArraySum,function\n\t.thumb_func\nCalcByteArraySum:\n\tpush\t{r4, lr}\n\tadd\tr4, r0, #0\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tcmp\tr3, r1\n\tbcs\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r4, r2\n\tldrb\tr0, [r0]\n\tadd\tr3, r3, r0\n\tadd\tr2, r2, #0x1\n\tcmp\tr2, r1\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcByteArraySum,.Lfe1-CalcByteArraySum\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalcByteArraySum # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:CalcCRC16:agbcc","sym":"CalcCRC16","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","loop","branch","nested-loop"],"loc":18,"refSource":"u16 CalcCRC16(const u8 *data, s32 length)\n{\n u16 i, j;\n u16 crc = 0x1121;\n\n for (i = 0; i < length; i++)\n {\n crc ^= data[i];\n for (j = 0; j < 8; j++)\n {\n if (crc & 1)\n crc = (crc >> 1) ^ 0x8408;\n else\n crc >>= 1;\n }\n }\n return ~crc;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L222-L239","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16\n\t.type\t CalcCRC16,function\n\t.thumb_func\nCalcCRC16:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L15\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbge\t.L4\t@cond_branch\n\tmov\tr6, #0x1\n\tldr\tr0, .L15+0x4\n\tadd\tr5, r0, #0\n.L6:\n\tadd\tr0, r7, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tmov\tr1, #0x0\n\tadd\tr3, r3, #0x1\n.L10:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r6\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tlsr\tr0, r2, #0x1\n\teor\tr0, r0, r5\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tb\t.L9\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t0x1121\n\t.word\t0x8408\n.L11:\n\tlsr\tr2, r2, #0x1\n.L9:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0x7\n\tbls\t.L10\t@cond_branch\n\tlsl\tr0, r3, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcCRC16,.Lfe1-CalcCRC16\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 CalcCRC16(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n if (0 >= a1) {\n v4 = 4385;\n } else {\n v0 = 0;\n v1 = 4385;\n do {\n v2 = v1 ^ *(u8 *)(a0 + v0);\n v3 = 0;\n do {\n if ((v2 & 1) == 0) {\n v4 = (u32)v2 >> 1;\n } else {\n v4 = (u16)((u32)v2 >> 1 ^ 33800);\n }\n v2 = v4;\n v3 = (u16)(v3 + 1);\n } while (v3 <= 7);\n v1 = v4;\n v0 = (u16)(v0 + 1);\n } while (v0 < a1);\n v4 = v1;\n }\n return (u16)~v4;\n}\n","score":45,"maxScore":55,"compileErrors":null,"breakdown":{"insert":13,"delete":5,"replace":1,"opMismatch":5,"argMismatch":21},"quality":{"score":86,"lines":30,"gotos":0,"casts":7,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u16 CalcCRC16(s32 arg0, s32 arg1) {\n u16 var_r1;\n u16 var_r2;\n u16 var_r3;\n\n var_r2 = 0x1121;\n var_r3 = 0;\n if (arg1 > 0) {\n do {\n var_r2 ^= *(arg0 + var_r3);\n var_r1 = 0;\nloop_3:\n if (var_r2 & 1) {\n var_r2 = (var_r2 >> 1) ^ 0x8408;\n } else {\n var_r2 = (u16) (var_r2 >> 1);\n }\n var_r1 += 1;\n if ((u32) var_r1 <= 7U) {\n goto loop_3;\n }\n var_r3 += 1;\n } while ((s32) var_r3 < arg1);\n }\n return (u16) ~var_r2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":84,"lines":25,"gotos":1,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3930: invalid type argument of `unary *'"]},"gapSize":{"decompiler":"asmlift","score":45,"maxScore":55,"ratio":0.8181818181818182,"kinds":{"insert":13,"delete":5,"replace":1,"opMismatch":5,"argMismatch":21}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CalcCRC16` — benchmark function pokeemerald:CalcCRC16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16\n\t.type\t CalcCRC16,function\n\t.thumb_func\nCalcCRC16:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L15\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbge\t.L4\t@cond_branch\n\tmov\tr6, #0x1\n\tldr\tr0, .L15+0x4\n\tadd\tr5, r0, #0\n.L6:\n\tadd\tr0, r7, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tmov\tr1, #0x0\n\tadd\tr3, r3, #0x1\n.L10:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r6\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tlsr\tr0, r2, #0x1\n\teor\tr0, r0, r5\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tb\t.L9\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t0x1121\n\t.word\t0x8408\n.L11:\n\tlsr\tr2, r2, #0x1\n.L9:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0x7\n\tbls\t.L10\t@cond_branch\n\tlsl\tr0, r3, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcCRC16,.Lfe1-CalcCRC16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CalcCRC16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CalcCRC16` — benchmark function pokeemerald:CalcCRC16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalcCRC16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16\n\t.type\t CalcCRC16,function\n\t.thumb_func\nCalcCRC16:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L15\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbge\t.L4\t@cond_branch\n\tmov\tr6, #0x1\n\tldr\tr0, .L15+0x4\n\tadd\tr5, r0, #0\n.L6:\n\tadd\tr0, r7, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tmov\tr1, #0x0\n\tadd\tr3, r3, #0x1\n.L10:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r6\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tlsr\tr0, r2, #0x1\n\teor\tr0, r0, r5\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tb\t.L9\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t0x1121\n\t.word\t0x8408\n.L11:\n\tlsr\tr2, r2, #0x1\n.L9:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tcmp\tr1, #0x7\n\tbls\t.L10\t@cond_branch\n\tlsl\tr0, r3, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t CalcCRC16,.Lfe1-CalcCRC16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalcCRC16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:CalcCRC16WithTable:agbcc","sym":"CalcCRC16WithTable","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","array","bitwise","cast","table"],"loc":14,"refSource":"u16 CalcCRC16WithTable(const u8 *data, u32 length)\n{\n u16 i;\n u16 crc = 0x1121;\n u8 byte;\n\n for (i = 0; i < length; i++)\n {\n byte = crc >> 8;\n crc ^= data[i];\n crc = byte ^ sCrc16Table[(u8)crc];\n }\n return ~crc;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L241-L254","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t1, 0\n\t.type\t sCrc16Table,object\nsCrc16Table:\n\t.short\t0x0\n\t.short\t0x1189\n\t.short\t0x2312\n\t.short\t0x329b\n\t.short\t0x4624\n\t.short\t0x57ad\n\t.short\t0x6536\n\t.short\t0x74bf\n\t.short\t0x8c48\n\t.short\t0x9dc1\n\t.short\t0xaf5a\n\t.short\t0xbed3\n\t.short\t0xca6c\n\t.short\t0xdbe5\n\t.short\t0xe97e\n\t.short\t0xf8f7\n\t.short\t0x1081\n\t.short\t0x108\n\t.short\t0x3393\n\t.short\t0x221a\n\t.short\t0x56a5\n\t.short\t0x472c\n\t.short\t0x75b7\n\t.short\t0x643e\n\t.short\t0x9cc9\n\t.short\t0x8d40\n\t.short\t0xbfdb\n\t.short\t0xae52\n\t.short\t0xdaed\n\t.short\t0xcb64\n\t.short\t0xf9ff\n\t.short\t0xe876\n\t.short\t0x2102\n\t.short\t0x308b\n\t.short\t0x210\n\t.short\t0x1399\n\t.short\t0x6726\n\t.short\t0x76af\n\t.short\t0x4434\n\t.short\t0x55bd\n\t.short\t0xad4a\n\t.short\t0xbcc3\n\t.short\t0x8e58\n\t.short\t0x9fd1\n\t.short\t0xeb6e\n\t.short\t0xfae7\n\t.short\t0xc87c\n\t.short\t0xd9f5\n\t.short\t0x3183\n\t.short\t0x200a\n\t.short\t0x1291\n\t.short\t0x318\n\t.short\t0x77a7\n\t.short\t0x662e\n\t.short\t0x54b5\n\t.short\t0x453c\n\t.short\t0xbdcb\n\t.short\t0xac42\n\t.short\t0x9ed9\n\t.short\t0x8f50\n\t.short\t0xfbef\n\t.short\t0xea66\n\t.short\t0xd8fd\n\t.short\t0xc974\n\t.short\t0x4204\n\t.short\t0x538d\n\t.short\t0x6116\n\t.short\t0x709f\n\t.short\t0x420\n\t.short\t0x15a9\n\t.short\t0x2732\n\t.short\t0x36bb\n\t.short\t0xce4c\n\t.short\t0xdfc5\n\t.short\t0xed5e\n\t.short\t0xfcd7\n\t.short\t0x8868\n\t.short\t0x99e1\n\t.short\t0xab7a\n\t.short\t0xbaf3\n\t.short\t0x5285\n\t.short\t0x430c\n\t.short\t0x7197\n\t.short\t0x601e\n\t.short\t0x14a1\n\t.short\t0x528\n\t.short\t0x37b3\n\t.short\t0x263a\n\t.short\t0xdecd\n\t.short\t0xcf44\n\t.short\t0xfddf\n\t.short\t0xec56\n\t.short\t0x98e9\n\t.short\t0x8960\n\t.short\t0xbbfb\n\t.short\t0xaa72\n\t.short\t0x6306\n\t.short\t0x728f\n\t.short\t0x4014\n\t.short\t0x519d\n\t.short\t0x2522\n\t.short\t0x34ab\n\t.short\t0x630\n\t.short\t0x17b9\n\t.short\t0xef4e\n\t.short\t0xfec7\n\t.short\t0xcc5c\n\t.short\t0xddd5\n\t.short\t0xa96a\n\t.short\t0xb8e3\n\t.short\t0x8a78\n\t.short\t0x9bf1\n\t.short\t0x7387\n\t.short\t0x620e\n\t.short\t0x5095\n\t.short\t0x411c\n\t.short\t0x35a3\n\t.short\t0x242a\n\t.short\t0x16b1\n\t.short\t0x738\n\t.short\t0xffcf\n\t.short\t0xee46\n\t.short\t0xdcdd\n\t.short\t0xcd54\n\t.short\t0xb9eb\n\t.short\t0xa862\n\t.short\t0x9af9\n\t.short\t0x8b70\n\t.short\t0x8408\n\t.short\t0x9581\n\t.short\t0xa71a\n\t.short\t0xb693\n\t.short\t0xc22c\n\t.short\t0xd3a5\n\t.short\t0xe13e\n\t.short\t0xf0b7\n\t.short\t0x840\n\t.short\t0x19c9\n\t.short\t0x2b52\n\t.short\t0x3adb\n\t.short\t0x4e64\n\t.short\t0x5fed\n\t.short\t0x6d76\n\t.short\t0x7cff\n\t.short\t0x9489\n\t.short\t0x8500\n\t.short\t0xb79b\n\t.short\t0xa612\n\t.short\t0xd2ad\n\t.short\t0xc324\n\t.short\t0xf1bf\n\t.short\t0xe036\n\t.short\t0x18c1\n\t.short\t0x948\n\t.short\t0x3bd3\n\t.short\t0x2a5a\n\t.short\t0x5ee5\n\t.short\t0x4f6c\n\t.short\t0x7df7\n\t.short\t0x6c7e\n\t.short\t0xa50a\n\t.short\t0xb483\n\t.short\t0x8618\n\t.short\t0x9791\n\t.short\t0xe32e\n\t.short\t0xf2a7\n\t.short\t0xc03c\n\t.short\t0xd1b5\n\t.short\t0x2942\n\t.short\t0x38cb\n\t.short\t0xa50\n\t.short\t0x1bd9\n\t.short\t0x6f66\n\t.short\t0x7eef\n\t.short\t0x4c74\n\t.short\t0x5dfd\n\t.short\t0xb58b\n\t.short\t0xa402\n\t.short\t0x9699\n\t.short\t0x8710\n\t.short\t0xf3af\n\t.short\t0xe226\n\t.short\t0xd0bd\n\t.short\t0xc134\n\t.short\t0x39c3\n\t.short\t0x284a\n\t.short\t0x1ad1\n\t.short\t0xb58\n\t.short\t0x7fe7\n\t.short\t0x6e6e\n\t.short\t0x5cf5\n\t.short\t0x4d7c\n\t.short\t0xc60c\n\t.short\t0xd785\n\t.short\t0xe51e\n\t.short\t0xf497\n\t.short\t0x8028\n\t.short\t0x91a1\n\t.short\t0xa33a\n\t.short\t0xb2b3\n\t.short\t0x4a44\n\t.short\t0x5bcd\n\t.short\t0x6956\n\t.short\t0x78df\n\t.short\t0xc60\n\t.short\t0x1de9\n\t.short\t0x2f72\n\t.short\t0x3efb\n\t.short\t0xd68d\n\t.short\t0xc704\n\t.short\t0xf59f\n\t.short\t0xe416\n\t.short\t0x90a9\n\t.short\t0x8120\n\t.short\t0xb3bb\n\t.short\t0xa232\n\t.short\t0x5ac5\n\t.short\t0x4b4c\n\t.short\t0x79d7\n\t.short\t0x685e\n\t.short\t0x1ce1\n\t.short\t0xd68\n\t.short\t0x3ff3\n\t.short\t0x2e7a\n\t.short\t0xe70e\n\t.short\t0xf687\n\t.short\t0xc41c\n\t.short\t0xd595\n\t.short\t0xa12a\n\t.short\t0xb0a3\n\t.short\t0x8238\n\t.short\t0x93b1\n\t.short\t0x6b46\n\t.short\t0x7acf\n\t.short\t0x4854\n\t.short\t0x59dd\n\t.short\t0x2d62\n\t.short\t0x3ceb\n\t.short\t0xe70\n\t.short\t0x1ff9\n\t.short\t0xf78f\n\t.short\t0xe606\n\t.short\t0xd49d\n\t.short\t0xc514\n\t.short\t0xb1ab\n\t.short\t0xa022\n\t.short\t0x92b9\n\t.short\t0x8330\n\t.short\t0x7bc7\n\t.short\t0x6a4e\n\t.short\t0x58d5\n\t.short\t0x495c\n\t.short\t0x3de3\n\t.short\t0x2c6a\n\t.short\t0x1ef1\n\t.short\t0xf78\n\t.size\t sCrc16Table,512\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16WithTable\n\t.type\t CalcCRC16WithTable,function\n\t.thumb_func\nCalcCRC16WithTable:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L8\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L8+0x4\n.L6:\n\tlsr\tr1, r2, #0x8\n\tadd\tr0, r5, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tlsl\tr0, r2, #0x18\n\tlsr\tr0, r0, #0x17\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tadd\tr2, r0, #0\n\teor\tr2, r2, r1\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x1121\n\t.word\tsCrc16Table\n.Lfe1:\n\t.size\t CalcCRC16WithTable,.Lfe1-CalcCRC16WithTable\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-dbb6d12e4277.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'CalcCRC16WithTable' — lift: cannot lift 'CalcCRC16WithTable': reads the sub-word data table 'sCrc16Table' (.short) — sub-word table data is not modelled */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* \t.section .rodata */\n/* \t.align\t1, 0 */\n/* \t.type\t sCrc16Table,object */\n/* sCrc16Table: */\n/* \t.short\t0x0 */\n/* \t.short\t0x1189 */\n/* \t.short\t0x2312 */\n/* \t.short\t0x329b */\n/* \t.short\t0x4624 */\n/* \t.short\t0x57ad */\n/* \t.short\t0x6536 */\n/* \t.short\t0x74bf */\n/* \t.short\t0x8c48 */\n/* \t.short\t0x9dc1 */\n/* \t.short\t0xaf5a */\n/* \t.short\t0xbed3 */\n/* \t.short\t0xca6c */\n/* \t.short\t0xdbe5 */\n/* \t.short\t0xe97e */\n/* \t.short\t0xf8f7 */\n/* \t.short\t0x1081 */\n/* \t.short\t0x108 */\n/* \t.short\t0x3393 */\n/* \t.short\t0x221a */\n/* \t.short\t0x56a5 */\n/* \t.short\t0x472c */\n/* \t.short\t0x75b7 */\n/* \t.short\t0x643e */\n/* \t.short\t0x9cc9 */\n/* \t.short\t0x8d40 */\n/* \t.short\t0xbfdb */\n/* \t.short\t0xae52 */\n/* \t.short\t0xdaed */\n/* \t.short\t0xcb64 */\n/* \t.short\t0xf9ff */\n/* \t.short\t0xe876 */\n/* \t.short\t0x2102 */\n/* \t.short\t0x308b */\n/* \t.short\t0x210 */\n/* \t.short\t0x1399 */\n/* \t.short\t0x6726 */\n/* \t.short\t0x76af */\n/* \t.short\t0x4434 */\n/* \t.short\t0x55bd */\n/* \t.short\t0xad4a */\n/* \t.short\t0xbcc3 */\n/* \t.short\t0x8e58 */\n/* \t.short\t0x9fd1 */\n/* \t.short\t0xeb6e */\n/* \t.short\t0xfae7 */\n/* \t.short\t0xc87c */\n/* \t.short\t0xd9f5 */\n/* \t.short\t0x3183 */\n/* \t.short\t0x200a */\n/* \t.short\t0x1291 */\n/* \t.short\t0x318 */\n/* \t.short\t0x77a7 */\n/* \t.short\t0x662e */\n/* \t.short\t0x54b5 */\n/* \t.short\t0x453c */\n/* \t.short\t0xbdcb */\n/* \t.short\t0xac42 */\n/* \t.short\t0x9ed9 */\n/* \t.short\t0x8f50 */\n/* \t.short\t0xfbef */\n/* \t.short\t0xea66 */\n/* \t.short\t0xd8fd */\n/* \t.short\t0xc974 */\n/* \t.short\t0x4204 */\n/* \t.short\t0x538d */\n/* \t.short\t0x6116 */\n/* \t.short\t0x709f */\n/* \t.short\t0x420 */\n/* \t.short\t0x15a9 */\n/* \t.short\t0x2732 */\n/* \t.short\t0x36bb */\n/* \t.short\t0xce4c */\n/* \t.short\t0xdfc5 */\n/* \t.short\t0xed5e */\n/* \t.short\t0xfcd7 */\n/* \t.short\t0x8868 */\n/* \t.short\t0x99e1 */\n/* \t.short\t0xab7a */\n/* \t.short\t0xbaf3 */\n/* \t.short\t0x5285 */\n/* \t.short\t0x430c */\n/* \t.short\t0x7197 */\n/* \t.short\t0x601e */\n/* \t.short\t0x14a1 */\n/* \t.short\t0x528 */\n/* \t.short\t0x37b3 */\n/* \t.short\t0x263a */\n/* \t.short\t0xdecd */\n/* \t.short\t0xcf44 */\n/* \t.short\t0xfddf */\n/* \t.short\t0xec56 */\n/* \t.short\t0x98e9 */\n/* \t.short\t0x8960 */\n/* \t.short\t0xbbfb */\n/* \t.short\t0xaa72 */\n/* \t.short\t0x6306 */\n/* \t.short\t0x728f */\n/* \t.short\t0x4014 */\n/* \t.short\t0x519d */\n/* \t.short\t0x2522 */\n/* \t.short\t0x34ab */\n/* \t.short\t0x630 */\n/* \t.short\t0x17b9 */\n/* \t.short\t0xef4e */\n/* \t.short\t0xfec7 */\n/* \t.short\t0xcc5c */\n/* \t.short\t0xddd5 */\n/* \t.short\t0xa96a */\n/* \t.short\t0xb8e3 */\n/* \t.short\t0x8a78 */\n/* \t.short\t0x9bf1 */\n/* \t.short\t0x7387 */\n/* \t.short\t0x620e */\n/* \t.short\t0x5095 */\n/* \t.short\t0x411c */\n/* \t.short\t0x35a3 */\n/* \t.short\t0x242a */\n/* \t.short\t0x16b1 */\n/* \t.short\t0x738 */\n/* \t.short\t0xffcf */\n/* \t.short\t0xee46 */\n/* \t.short\t0xdcdd */\n/* \t.short\t0xcd54 */\n/* \t.short\t0xb9eb */\n/* \t.short\t0xa862 */\n/* \t.short\t0x9af9 */\n/* \t.short\t0x8b70 */\n/* \t.short\t0x8408 */\n/* \t.short\t0x9581 */\n/* \t.short\t0xa71a */\n/* \t.short\t0xb693 */\n/* \t.short\t0xc22c */\n/* \t.short\t0xd3a5 */\n/* \t.short\t0xe13e */\n/* \t.short\t0xf0b7 */\n/* \t.short\t0x840 */\n/* \t.short\t0x19c9 */\n/* \t.short\t0x2b52 */\n/* \t.short\t0x3adb */\n/* \t.short\t0x4e64 */\n/* \t.short\t0x5fed */\n/* \t.short\t0x6d76 */\n/* \t.short\t0x7cff */\n/* \t.short\t0x9489 */\n/* \t.short\t0x8500 */\n/* \t.short\t0xb79b */\n/* \t.short\t0xa612 */\n/* \t.short\t0xd2ad */\n/* \t.short\t0xc324 */\n/* \t.short\t0xf1bf */\n/* \t.short\t0xe036 */\n/* \t.short\t0x18c1 */\n/* \t.short\t0x948 */\n/* \t.short\t0x3bd3 */\n/* \t.short\t0x2a5a */\n/* \t.short\t0x5ee5 */\n/* \t.short\t0x4f6c */\n/* \t.short\t0x7df7 */\n/* \t.short\t0x6c7e */\n/* \t.short\t0xa50a */\n/* \t.short\t0xb483 */\n/* \t.short\t0x8618 */\n/* \t.short\t0x9791 */\n/* \t.short\t0xe32e */\n/* \t.short\t0xf2a7 */\n/* \t.short\t0xc03c */\n/* \t.short\t0xd1b5 */\n/* \t.short\t0x2942 */\n/* \t.short\t0x38cb */\n/* \t.short\t0xa50 */\n/* \t.short\t0x1bd9 */\n/* \t.short\t0x6f66 */\n/* \t.short\t0x7eef */\n/* \t.short\t0x4c74 */\n/* \t.short\t0x5dfd */\n/* \t.short\t0xb58b */\n/* \t.short\t0xa402 */\n/* \t.short\t0x9699 */\n/* \t.short\t0x8710 */\n/* \t.short\t0xf3af */\n/* \t.short\t0xe226 */\n/* \t.short\t0xd0bd */\n/* \t.short\t0xc134 */\n/* \t.short\t0x39c3 */\n/* \t.short\t0x284a */\n/* \t.short\t0x1ad1 */\n/* \t.short\t0xb58 */\n/* \t.short\t0x7fe7 */\n/* \t.short\t0x6e6e */\n/* \t.short\t0x5cf5 */\n/* \t.short\t0x4d7c */\n/* \t.short\t0xc60c */\n/* \t.short\t0xd785 */\n/* \t.short\t0xe51e */\n/* \t.short\t0xf497 */\n/* \t.short\t0x8028 */\n/* \t.short\t0x91a1 */\n/* \t.short\t0xa33a */\n/* \t.short\t0xb2b3 */\n/* \t.short\t0x4a44 */\n/* \t.short\t0x5bcd */\n/* \t.short\t0x6956 */\n/* \t.short\t0x78df */\n/* \t.short\t0xc60 */\n/* \t.short\t0x1de9 */\n/* \t.short\t0x2f72 */\n/* \t.short\t0x3efb */\n/* \t.short\t0xd68d */\n/* \t.short\t0xc704 */\n/* \t.short\t0xf59f */\n/* \t.short\t0xe416 */\n/* \t.short\t0x90a9 */\n/* \t.short\t0x8120 */\n/* \t.short\t0xb3bb */\n/* \t.short\t0xa232 */\n/* \t.short\t0x5ac5 */\n/* \t.short\t0x4b4c */\n/* \t.short\t0x79d7 */\n/* \t.short\t0x685e */\n/* \t.short\t0x1ce1 */\n/* \t.short\t0xd68 */\n/* \t.short\t0x3ff3 */\n/* \t.short\t0x2e7a */\n/* \t.short\t0xe70e */\n/* \t.short\t0xf687 */\n/* \t.short\t0xc41c */\n/* \t.short\t0xd595 */\n/* \t.short\t0xa12a */\n/* \t.short\t0xb0a3 */\n/* \t.short\t0x8238 */\n/* \t.short\t0x93b1 */\n/* \t.short\t0x6b46 */\n/* \t.short\t0x7acf */\n/* \t.short\t0x4854 */\n/* \t.short\t0x59dd */\n/* \t.short\t0x2d62 */\n/* \t.short\t0x3ceb */\n/* \t.short\t0xe70 */\n/* \t.short\t0x1ff9 */\n/* \t.short\t0xf78f */\n/* \t.short\t0xe606 */\n/* \t.short\t0xd49d */\n/* \t.short\t0xc514 */\n/* \t.short\t0xb1ab */\n/* \t.short\t0xa022 */\n/* \t.short\t0x92b9 */\n/* \t.short\t0x8330 */\n/* \t.short\t0x7bc7 */\n/* \t.short\t0x6a4e */\n/* \t.short\t0x58d5 */\n/* \t.short\t0x495c */\n/* \t.short\t0x3de3 */\n/* \t.short\t0x2c6a */\n/* \t.short\t0x1ef1 */\n/* \t.short\t0xf78 */\n/* \t.size\t sCrc16Table,512 */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tCalcCRC16WithTable */\n/* \t.type\t CalcCRC16WithTable,function */\n/* \t.thumb_func */\n/* CalcCRC16WithTable: */\n/* \tpush\t{r4, r5, r6, lr} */\n/* \tadd\tr5, r0, #0 */\n/* \tadd\tr4, r1, #0 */\n/* \tldr\tr2, .L8 */\n/* \tmov\tr3, #0x0 */\n/* \tcmp\tr3, r4 */\n/* \tbcs\t.L4\t@cond_branch */\n/* \tldr\tr6, .L8+0x4 */\n/* .L6: */\n/* \tlsr\tr1, r2, #0x8 */\n/* \tadd\tr0, r5, r3 */\n/* \tldrb\tr0, [r0] */\n/* \teor\tr2, r2, r0 */\n/* \tlsl\tr0, r2, #0x18 */\n/* \tlsr\tr0, r0, #0x17 */\n/* \tadd\tr0, r0, r6 */\n/* \tldrh\tr0, [r0] */\n/* \tadd\tr2, r0, #0 */\n/* \teor\tr2, r2, r1 */\n/* \tadd\tr0, r3, #0x1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr3, r0, #0x10 */\n/* \tcmp\tr3, r4 */\n/* \tbcc\t.L6\t@cond_branch */\n/* .L4: */\n/* \tmvn\tr0, r2 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr0, r0, #0x10 */\n/* \tpop\t{r4, r5, r6} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .L9: */\n/* \t.align\t2, 0 */\n/* .L8: */\n/* \t.word\t0x1121 */\n/* \t.word\tsCrc16Table */\n/* .Lfe1: */\n/* \t.size\t CalcCRC16WithTable,.Lfe1-CalcCRC16WithTable */\n/* .text */\n/* \t.align\t2, 0 */\nvoid CalcCRC16WithTable(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'CalcCRC16WithTable': reads the sub-word data table 'sCrc16Table' (.short) — sub-word table data is not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":315,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'CalcCRC16WithTable': reads the sub-word data table 'sCrc16Table' (.short) — sub-word table data is not modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u16 CalcCRC16WithTable(u8 *data, u32 length) {\n u16 var_r2;\n u16 var_r3;\n\n var_r2 = 0x1121;\n var_r3 = 0;\n if (length > 0U) {\n do {\n var_r2 = *(((u32) ((var_r2 ^ data[var_r3]) << 0x18) >> 0x17) + sCrc16Table) ^ (var_r2 >> 8);\n var_r3 += 1;\n } while ((u32) var_r3 < length);\n }\n return (u16) ~var_r2;\n}\n","score":19,"maxScore":33,"compileErrors":null,"breakdown":{"insert":1,"delete":3,"replace":3,"opMismatch":1,"argMismatch":11},"quality":{"score":98,"lines":13,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":19,"maxScore":33,"ratio":0.5757575757575758,"kinds":{"insert":1,"delete":3,"replace":3,"opMismatch":1,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CalcCRC16WithTable` — benchmark function pokeemerald:CalcCRC16WithTable:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t1, 0\n\t.type\t sCrc16Table,object\nsCrc16Table:\n\t.short\t0x0\n\t.short\t0x1189\n\t.short\t0x2312\n\t.short\t0x329b\n\t.short\t0x4624\n\t.short\t0x57ad\n\t.short\t0x6536\n\t.short\t0x74bf\n\t.short\t0x8c48\n\t.short\t0x9dc1\n\t.short\t0xaf5a\n\t.short\t0xbed3\n\t.short\t0xca6c\n\t.short\t0xdbe5\n\t.short\t0xe97e\n\t.short\t0xf8f7\n\t.short\t0x1081\n\t.short\t0x108\n\t.short\t0x3393\n\t.short\t0x221a\n\t.short\t0x56a5\n\t.short\t0x472c\n\t.short\t0x75b7\n\t.short\t0x643e\n\t.short\t0x9cc9\n\t.short\t0x8d40\n\t.short\t0xbfdb\n\t.short\t0xae52\n\t.short\t0xdaed\n\t.short\t0xcb64\n\t.short\t0xf9ff\n\t.short\t0xe876\n\t.short\t0x2102\n\t.short\t0x308b\n\t.short\t0x210\n\t.short\t0x1399\n\t.short\t0x6726\n\t.short\t0x76af\n\t.short\t0x4434\n\t.short\t0x55bd\n\t.short\t0xad4a\n\t.short\t0xbcc3\n\t.short\t0x8e58\n\t.short\t0x9fd1\n\t.short\t0xeb6e\n\t.short\t0xfae7\n\t.short\t0xc87c\n\t.short\t0xd9f5\n\t.short\t0x3183\n\t.short\t0x200a\n\t.short\t0x1291\n\t.short\t0x318\n\t.short\t0x77a7\n\t.short\t0x662e\n\t.short\t0x54b5\n\t.short\t0x453c\n\t.short\t0xbdcb\n\t.short\t0xac42\n\t.short\t0x9ed9\n\t.short\t0x8f50\n\t.short\t0xfbef\n\t.short\t0xea66\n\t.short\t0xd8fd\n\t.short\t0xc974\n\t.short\t0x4204\n\t.short\t0x538d\n\t.short\t0x6116\n\t.short\t0x709f\n\t.short\t0x420\n\t.short\t0x15a9\n\t.short\t0x2732\n\t.short\t0x36bb\n\t.short\t0xce4c\n\t.short\t0xdfc5\n\t.short\t0xed5e\n\t.short\t0xfcd7\n\t.short\t0x8868\n\t.short\t0x99e1\n\t.short\t0xab7a\n\t.short\t0xbaf3\n\t.short\t0x5285\n\t.short\t0x430c\n\t.short\t0x7197\n\t.short\t0x601e\n\t.short\t0x14a1\n\t.short\t0x528\n\t.short\t0x37b3\n\t.short\t0x263a\n\t.short\t0xdecd\n\t.short\t0xcf44\n\t.short\t0xfddf\n\t.short\t0xec56\n\t.short\t0x98e9\n\t.short\t0x8960\n\t.short\t0xbbfb\n\t.short\t0xaa72\n\t.short\t0x6306\n\t.short\t0x728f\n\t.short\t0x4014\n\t.short\t0x519d\n\t.short\t0x2522\n\t.short\t0x34ab\n\t.short\t0x630\n\t.short\t0x17b9\n\t.short\t0xef4e\n\t.short\t0xfec7\n\t.short\t0xcc5c\n\t.short\t0xddd5\n\t.short\t0xa96a\n\t.short\t0xb8e3\n\t.short\t0x8a78\n\t.short\t0x9bf1\n\t.short\t0x7387\n\t.short\t0x620e\n\t.short\t0x5095\n\t.short\t0x411c\n\t.short\t0x35a3\n\t.short\t0x242a\n\t.short\t0x16b1\n\t.short\t0x738\n\t.short\t0xffcf\n\t.short\t0xee46\n\t.short\t0xdcdd\n\t.short\t0xcd54\n\t.short\t0xb9eb\n\t.short\t0xa862\n\t.short\t0x9af9\n\t.short\t0x8b70\n\t.short\t0x8408\n\t.short\t0x9581\n\t.short\t0xa71a\n\t.short\t0xb693\n\t.short\t0xc22c\n\t.short\t0xd3a5\n\t.short\t0xe13e\n\t.short\t0xf0b7\n\t.short\t0x840\n\t.short\t0x19c9\n\t.short\t0x2b52\n\t.short\t0x3adb\n\t.short\t0x4e64\n\t.short\t0x5fed\n\t.short\t0x6d76\n\t.short\t0x7cff\n\t.short\t0x9489\n\t.short\t0x8500\n\t.short\t0xb79b\n\t.short\t0xa612\n\t.short\t0xd2ad\n\t.short\t0xc324\n\t.short\t0xf1bf\n\t.short\t0xe036\n\t.short\t0x18c1\n\t.short\t0x948\n\t.short\t0x3bd3\n\t.short\t0x2a5a\n\t.short\t0x5ee5\n\t.short\t0x4f6c\n\t.short\t0x7df7\n\t.short\t0x6c7e\n\t.short\t0xa50a\n\t.short\t0xb483\n\t.short\t0x8618\n\t.short\t0x9791\n\t.short\t0xe32e\n\t.short\t0xf2a7\n\t.short\t0xc03c\n\t.short\t0xd1b5\n\t.short\t0x2942\n\t.short\t0x38cb\n\t.short\t0xa50\n\t.short\t0x1bd9\n\t.short\t0x6f66\n\t.short\t0x7eef\n\t.short\t0x4c74\n\t.short\t0x5dfd\n\t.short\t0xb58b\n\t.short\t0xa402\n\t.short\t0x9699\n\t.short\t0x8710\n\t.short\t0xf3af\n\t.short\t0xe226\n\t.short\t0xd0bd\n\t.short\t0xc134\n\t.short\t0x39c3\n\t.short\t0x284a\n\t.short\t0x1ad1\n\t.short\t0xb58\n\t.short\t0x7fe7\n\t.short\t0x6e6e\n\t.short\t0x5cf5\n\t.short\t0x4d7c\n\t.short\t0xc60c\n\t.short\t0xd785\n\t.short\t0xe51e\n\t.short\t0xf497\n\t.short\t0x8028\n\t.short\t0x91a1\n\t.short\t0xa33a\n\t.short\t0xb2b3\n\t.short\t0x4a44\n\t.short\t0x5bcd\n\t.short\t0x6956\n\t.short\t0x78df\n\t.short\t0xc60\n\t.short\t0x1de9\n\t.short\t0x2f72\n\t.short\t0x3efb\n\t.short\t0xd68d\n\t.short\t0xc704\n\t.short\t0xf59f\n\t.short\t0xe416\n\t.short\t0x90a9\n\t.short\t0x8120\n\t.short\t0xb3bb\n\t.short\t0xa232\n\t.short\t0x5ac5\n\t.short\t0x4b4c\n\t.short\t0x79d7\n\t.short\t0x685e\n\t.short\t0x1ce1\n\t.short\t0xd68\n\t.short\t0x3ff3\n\t.short\t0x2e7a\n\t.short\t0xe70e\n\t.short\t0xf687\n\t.short\t0xc41c\n\t.short\t0xd595\n\t.short\t0xa12a\n\t.short\t0xb0a3\n\t.short\t0x8238\n\t.short\t0x93b1\n\t.short\t0x6b46\n\t.short\t0x7acf\n\t.short\t0x4854\n\t.short\t0x59dd\n\t.short\t0x2d62\n\t.short\t0x3ceb\n\t.short\t0xe70\n\t.short\t0x1ff9\n\t.short\t0xf78f\n\t.short\t0xe606\n\t.short\t0xd49d\n\t.short\t0xc514\n\t.short\t0xb1ab\n\t.short\t0xa022\n\t.short\t0x92b9\n\t.short\t0x8330\n\t.short\t0x7bc7\n\t.short\t0x6a4e\n\t.short\t0x58d5\n\t.short\t0x495c\n\t.short\t0x3de3\n\t.short\t0x2c6a\n\t.short\t0x1ef1\n\t.short\t0xf78\n\t.size\t sCrc16Table,512\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16WithTable\n\t.type\t CalcCRC16WithTable,function\n\t.thumb_func\nCalcCRC16WithTable:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L8\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L8+0x4\n.L6:\n\tlsr\tr1, r2, #0x8\n\tadd\tr0, r5, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tlsl\tr0, r2, #0x18\n\tlsr\tr0, r0, #0x17\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tadd\tr2, r0, #0\n\teor\tr2, r2, r1\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x1121\n\t.word\tsCrc16Table\n.Lfe1:\n\t.size\t CalcCRC16WithTable,.Lfe1-CalcCRC16WithTable\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-dbb6d12e4277.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu16 CalcCRC16WithTable(const u8 *data, u32 length);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CalcCRC16WithTable # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CalcCRC16WithTable` — benchmark function pokeemerald:CalcCRC16WithTable:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalcCRC16WithTable:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t1, 0\n\t.type\t sCrc16Table,object\nsCrc16Table:\n\t.short\t0x0\n\t.short\t0x1189\n\t.short\t0x2312\n\t.short\t0x329b\n\t.short\t0x4624\n\t.short\t0x57ad\n\t.short\t0x6536\n\t.short\t0x74bf\n\t.short\t0x8c48\n\t.short\t0x9dc1\n\t.short\t0xaf5a\n\t.short\t0xbed3\n\t.short\t0xca6c\n\t.short\t0xdbe5\n\t.short\t0xe97e\n\t.short\t0xf8f7\n\t.short\t0x1081\n\t.short\t0x108\n\t.short\t0x3393\n\t.short\t0x221a\n\t.short\t0x56a5\n\t.short\t0x472c\n\t.short\t0x75b7\n\t.short\t0x643e\n\t.short\t0x9cc9\n\t.short\t0x8d40\n\t.short\t0xbfdb\n\t.short\t0xae52\n\t.short\t0xdaed\n\t.short\t0xcb64\n\t.short\t0xf9ff\n\t.short\t0xe876\n\t.short\t0x2102\n\t.short\t0x308b\n\t.short\t0x210\n\t.short\t0x1399\n\t.short\t0x6726\n\t.short\t0x76af\n\t.short\t0x4434\n\t.short\t0x55bd\n\t.short\t0xad4a\n\t.short\t0xbcc3\n\t.short\t0x8e58\n\t.short\t0x9fd1\n\t.short\t0xeb6e\n\t.short\t0xfae7\n\t.short\t0xc87c\n\t.short\t0xd9f5\n\t.short\t0x3183\n\t.short\t0x200a\n\t.short\t0x1291\n\t.short\t0x318\n\t.short\t0x77a7\n\t.short\t0x662e\n\t.short\t0x54b5\n\t.short\t0x453c\n\t.short\t0xbdcb\n\t.short\t0xac42\n\t.short\t0x9ed9\n\t.short\t0x8f50\n\t.short\t0xfbef\n\t.short\t0xea66\n\t.short\t0xd8fd\n\t.short\t0xc974\n\t.short\t0x4204\n\t.short\t0x538d\n\t.short\t0x6116\n\t.short\t0x709f\n\t.short\t0x420\n\t.short\t0x15a9\n\t.short\t0x2732\n\t.short\t0x36bb\n\t.short\t0xce4c\n\t.short\t0xdfc5\n\t.short\t0xed5e\n\t.short\t0xfcd7\n\t.short\t0x8868\n\t.short\t0x99e1\n\t.short\t0xab7a\n\t.short\t0xbaf3\n\t.short\t0x5285\n\t.short\t0x430c\n\t.short\t0x7197\n\t.short\t0x601e\n\t.short\t0x14a1\n\t.short\t0x528\n\t.short\t0x37b3\n\t.short\t0x263a\n\t.short\t0xdecd\n\t.short\t0xcf44\n\t.short\t0xfddf\n\t.short\t0xec56\n\t.short\t0x98e9\n\t.short\t0x8960\n\t.short\t0xbbfb\n\t.short\t0xaa72\n\t.short\t0x6306\n\t.short\t0x728f\n\t.short\t0x4014\n\t.short\t0x519d\n\t.short\t0x2522\n\t.short\t0x34ab\n\t.short\t0x630\n\t.short\t0x17b9\n\t.short\t0xef4e\n\t.short\t0xfec7\n\t.short\t0xcc5c\n\t.short\t0xddd5\n\t.short\t0xa96a\n\t.short\t0xb8e3\n\t.short\t0x8a78\n\t.short\t0x9bf1\n\t.short\t0x7387\n\t.short\t0x620e\n\t.short\t0x5095\n\t.short\t0x411c\n\t.short\t0x35a3\n\t.short\t0x242a\n\t.short\t0x16b1\n\t.short\t0x738\n\t.short\t0xffcf\n\t.short\t0xee46\n\t.short\t0xdcdd\n\t.short\t0xcd54\n\t.short\t0xb9eb\n\t.short\t0xa862\n\t.short\t0x9af9\n\t.short\t0x8b70\n\t.short\t0x8408\n\t.short\t0x9581\n\t.short\t0xa71a\n\t.short\t0xb693\n\t.short\t0xc22c\n\t.short\t0xd3a5\n\t.short\t0xe13e\n\t.short\t0xf0b7\n\t.short\t0x840\n\t.short\t0x19c9\n\t.short\t0x2b52\n\t.short\t0x3adb\n\t.short\t0x4e64\n\t.short\t0x5fed\n\t.short\t0x6d76\n\t.short\t0x7cff\n\t.short\t0x9489\n\t.short\t0x8500\n\t.short\t0xb79b\n\t.short\t0xa612\n\t.short\t0xd2ad\n\t.short\t0xc324\n\t.short\t0xf1bf\n\t.short\t0xe036\n\t.short\t0x18c1\n\t.short\t0x948\n\t.short\t0x3bd3\n\t.short\t0x2a5a\n\t.short\t0x5ee5\n\t.short\t0x4f6c\n\t.short\t0x7df7\n\t.short\t0x6c7e\n\t.short\t0xa50a\n\t.short\t0xb483\n\t.short\t0x8618\n\t.short\t0x9791\n\t.short\t0xe32e\n\t.short\t0xf2a7\n\t.short\t0xc03c\n\t.short\t0xd1b5\n\t.short\t0x2942\n\t.short\t0x38cb\n\t.short\t0xa50\n\t.short\t0x1bd9\n\t.short\t0x6f66\n\t.short\t0x7eef\n\t.short\t0x4c74\n\t.short\t0x5dfd\n\t.short\t0xb58b\n\t.short\t0xa402\n\t.short\t0x9699\n\t.short\t0x8710\n\t.short\t0xf3af\n\t.short\t0xe226\n\t.short\t0xd0bd\n\t.short\t0xc134\n\t.short\t0x39c3\n\t.short\t0x284a\n\t.short\t0x1ad1\n\t.short\t0xb58\n\t.short\t0x7fe7\n\t.short\t0x6e6e\n\t.short\t0x5cf5\n\t.short\t0x4d7c\n\t.short\t0xc60c\n\t.short\t0xd785\n\t.short\t0xe51e\n\t.short\t0xf497\n\t.short\t0x8028\n\t.short\t0x91a1\n\t.short\t0xa33a\n\t.short\t0xb2b3\n\t.short\t0x4a44\n\t.short\t0x5bcd\n\t.short\t0x6956\n\t.short\t0x78df\n\t.short\t0xc60\n\t.short\t0x1de9\n\t.short\t0x2f72\n\t.short\t0x3efb\n\t.short\t0xd68d\n\t.short\t0xc704\n\t.short\t0xf59f\n\t.short\t0xe416\n\t.short\t0x90a9\n\t.short\t0x8120\n\t.short\t0xb3bb\n\t.short\t0xa232\n\t.short\t0x5ac5\n\t.short\t0x4b4c\n\t.short\t0x79d7\n\t.short\t0x685e\n\t.short\t0x1ce1\n\t.short\t0xd68\n\t.short\t0x3ff3\n\t.short\t0x2e7a\n\t.short\t0xe70e\n\t.short\t0xf687\n\t.short\t0xc41c\n\t.short\t0xd595\n\t.short\t0xa12a\n\t.short\t0xb0a3\n\t.short\t0x8238\n\t.short\t0x93b1\n\t.short\t0x6b46\n\t.short\t0x7acf\n\t.short\t0x4854\n\t.short\t0x59dd\n\t.short\t0x2d62\n\t.short\t0x3ceb\n\t.short\t0xe70\n\t.short\t0x1ff9\n\t.short\t0xf78f\n\t.short\t0xe606\n\t.short\t0xd49d\n\t.short\t0xc514\n\t.short\t0xb1ab\n\t.short\t0xa022\n\t.short\t0x92b9\n\t.short\t0x8330\n\t.short\t0x7bc7\n\t.short\t0x6a4e\n\t.short\t0x58d5\n\t.short\t0x495c\n\t.short\t0x3de3\n\t.short\t0x2c6a\n\t.short\t0x1ef1\n\t.short\t0xf78\n\t.size\t sCrc16Table,512\n.text\n\t.align\t2, 0\n\t.globl\tCalcCRC16WithTable\n\t.type\t CalcCRC16WithTable,function\n\t.thumb_func\nCalcCRC16WithTable:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr5, r0, #0\n\tadd\tr4, r1, #0\n\tldr\tr2, .L8\n\tmov\tr3, #0x0\n\tcmp\tr3, r4\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L8+0x4\n.L6:\n\tlsr\tr1, r2, #0x8\n\tadd\tr0, r5, r3\n\tldrb\tr0, [r0]\n\teor\tr2, r2, r0\n\tlsl\tr0, r2, #0x18\n\tlsr\tr0, r0, #0x17\n\tadd\tr0, r0, r6\n\tldrh\tr0, [r0]\n\tadd\tr2, r0, #0\n\teor\tr2, r2, r1\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tmvn\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\t0x1121\n\t.word\tsCrc16Table\n.Lfe1:\n\t.size\t CalcCRC16WithTable,.Lfe1-CalcCRC16WithTable\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalcCRC16WithTable # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:CalculatePPWithBonus:agbcc","sym":"CalculatePPWithBonus","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","shift","bitwise","soft-div","global","table"],"loc":5,"refSource":"u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex)\n{\n u8 basePP = gBattleMoves[move].pp;\n return basePP + ((basePP * 20 * ((gPPUpGetMask[moveIndex] & ppBonuses) >> (2 * moveIndex))) / 100);\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L4636-L4640","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalculatePPWithBonus\n\t.type\t CalculatePPWithBonus,function\n\t.thumb_func\nCalculatePPWithBonus:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tldr\tr4, .L3\n\tlsl\tr3, r0, #0x1\n\tadd\tr3, r3, r0\n\tlsl\tr3, r3, #0x2\n\tadd\tr3, r3, r4\n\tldrb\tr4, [r3, #0x4]\n\tldr\tr0, .L3+0x4\n\tadd\tr0, r2, r0\n\tldrb\tr3, [r0]\n\tand\tr3, r3, r1\n\tlsl\tr2, r2, #0x1\n\tasr\tr3, r3, r2\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r3\n\tlsl\tr0, r0, #0x2\n\tmul\tr0, r0, r4\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tadd\tr4, r4, r0\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgBattleMoves\n\t.word\tgPPUpGetMask\n.Lfe1:\n\t.size\t CalculatePPWithBonus,.Lfe1-CalculatePPWithBonus\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed/raw-globals","symbolsUsed":[{"name":"gBattleMoves","shape":"array (12 B/elem)"},{"name":"gPPUpGetMask","shape":"u8[]"}],"outcome":"nonmatch","source":"struct Elem0 { u8 _pad0[4]; u8 field_4; u8 _pad1[7]; };\ns32 CalculatePPWithBonus(s32 a0, s32 a1, s32 a2) {\n return (u8)(((struct Elem0 *)&gBattleMoves)[(u16)a0].field_4 + ((((u8 *)&gPPUpGetMask)[(u8)a2] & a1) >> ((u8)a2 << 1)) * 20 * ((struct Elem0 *)&gBattleMoves)[(u16)a0].field_4 / 100);\n}\n","score":17,"maxScore":36,"compileErrors":null,"breakdown":{"insert":3,"delete":3,"replace":4,"opMismatch":0,"argMismatch":7},"quality":{"score":92,"lines":4,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex) {\n u8 temp_r2;\n u8 temp_r4;\n\n temp_r2 = moveIndex;\n temp_r4 = gBattleMoves[move].pp;\n return (u8) (temp_r4 + ((s32) (((s32) (gPPUpGetMask[temp_r2] & ppBonuses) >> (temp_r2 * 2)) * 0x14 * temp_r4) / 100));\n}\n","score":3,"maxScore":33,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":98,"lines":7,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":33,"ratio":0.09090909090909091,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CalculatePPWithBonus` — benchmark function pokeemerald:CalculatePPWithBonus:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalculatePPWithBonus\n\t.type\t CalculatePPWithBonus,function\n\t.thumb_func\nCalculatePPWithBonus:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tldr\tr4, .L3\n\tlsl\tr3, r0, #0x1\n\tadd\tr3, r3, r0\n\tlsl\tr3, r3, #0x2\n\tadd\tr3, r3, r4\n\tldrb\tr4, [r3, #0x4]\n\tldr\tr0, .L3+0x4\n\tadd\tr0, r2, r0\n\tldrb\tr3, [r0]\n\tand\tr3, r3, r1\n\tlsl\tr2, r2, #0x1\n\tasr\tr3, r3, r2\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r3\n\tlsl\tr0, r0, #0x2\n\tmul\tr0, r0, r4\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tadd\tr4, r4, r0\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgBattleMoves\n\t.word\tgPPUpGetMask\n.Lfe1:\n\t.size\t CalculatePPWithBonus,.Lfe1-CalculatePPWithBonus\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 CalculatePPWithBonus(u16 move, u8 ppBonuses, u8 moveIndex);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CalculatePPWithBonus # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CalculatePPWithBonus` — benchmark function pokeemerald:CalculatePPWithBonus:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CalculatePPWithBonus:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCalculatePPWithBonus\n\t.type\t CalculatePPWithBonus,function\n\t.thumb_func\nCalculatePPWithBonus:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tldr\tr4, .L3\n\tlsl\tr3, r0, #0x1\n\tadd\tr3, r3, r0\n\tlsl\tr3, r3, #0x2\n\tadd\tr3, r3, r4\n\tldrb\tr4, [r3, #0x4]\n\tldr\tr0, .L3+0x4\n\tadd\tr0, r2, r0\n\tldrb\tr3, [r0]\n\tand\tr3, r3, r1\n\tlsl\tr2, r2, #0x1\n\tasr\tr3, r3, r2\n\tlsl\tr0, r3, #0x2\n\tadd\tr0, r0, r3\n\tlsl\tr0, r0, #0x2\n\tmul\tr0, r0, r4\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tadd\tr4, r4, r0\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgBattleMoves\n\t.word\tgPPUpGetMask\n.Lfe1:\n\t.size\t CalculatePPWithBonus,.Lfe1-CalculatePPWithBonus\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CalculatePPWithBonus # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:Cos2:agbcc","sym":"Cos2","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","call"],"loc":4,"refSource":"s16 Cos2(u16 angle)\n{\n return Sin2(angle + 90);\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/trig.c#L540-L543","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCos2\n\t.type\t Cos2,function\n\t.thumb_func\nCos2:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tmov\tr1, #0xb4\n\tlsl\tr1, r1, #0xf\n\tadd\tr0, r0, r1\n\tlsr\tr0, r0, #0x10\n\tbl\tSin2\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Cos2,.Lfe1-Cos2\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 Cos2(u32 a0) {\n return (s16)Sin2((a0 << 16) + (180 << 15) >> 16);\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s16 Sin2(u32); /* extern */\n\ns16 Cos2(s32 arg0) {\n return Sin2((u32) ((arg0 << 0x10) + 0x5A0000) >> 0x10);\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Cos2` — benchmark function pokeemerald:Cos2:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCos2\n\t.type\t Cos2,function\n\t.thumb_func\nCos2:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tmov\tr1, #0xb4\n\tlsl\tr1, r1, #0xf\n\tadd\tr0, r0, r1\n\tlsr\tr0, r0, #0x10\n\tbl\tSin2\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Cos2,.Lfe1-Cos2\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Cos2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Cos2` — benchmark function pokeemerald:Cos2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:Cos2:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCos2\n\t.type\t Cos2,function\n\t.thumb_func\nCos2:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tmov\tr1, #0xb4\n\tlsl\tr1, r1, #0xf\n\tadd\tr0, r0, r1\n\tlsr\tr0, r0, #0x10\n\tbl\tSin2\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Cos2,.Lfe1-Cos2\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Cos2 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:CountTrailingZeroBits:agbcc","sym":"CountTrailingZeroBits","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","loop","branch","shift"],"loc":13,"refSource":"int CountTrailingZeroBits(u32 value)\n{\n u8 i;\n\n for (i = 0; i < 32; i++)\n {\n if ((value & 1) == 0)\n value >>= 1;\n else\n return i;\n }\n return 0;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L208-L220","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountTrailingZeroBits\n\t.type\t CountTrailingZeroBits,function\n\t.thumb_func\nCountTrailingZeroBits:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tmov\tr3, #0x1\n.L6:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r3\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L10\n.L7:\n\tlsr\tr2, r2, #0x1\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0x1f\n\tbls\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n.L10:\n\tbx\tlr\n.Lfe1:\n\t.size\t CountTrailingZeroBits,.Lfe1-CountTrailingZeroBits\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 CountTrailingZeroBits(u32 a0) {\n s32 v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n while ((v0 & 1) == 0) {\n v0 = (u32)v0 >> 1;\n v1 = (u8)(v1 + 1);\n if (v1 > 31) {\n v1 = 0;\n return v1;\n }\n }\n return v1;\n}\n","score":19,"maxScore":23,"compileErrors":null,"breakdown":{"insert":6,"delete":2,"replace":0,"opMismatch":2,"argMismatch":9},"quality":{"score":100,"lines":15,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 CountTrailingZeroBits(u32 arg0) {\n u32 var_r2;\n u8 var_r1;\n\n var_r2 = arg0;\n var_r1 = 0;\nloop_1:\n if (var_r2 & 1) {\n return var_r1;\n }\n var_r2 = var_r2 >> 1;\n var_r1 += 1;\n if ((u32) var_r1 > 0x1FU) {\n return 0U;\n }\n goto loop_1;\n}\n","score":15,"maxScore":19,"compileErrors":null,"breakdown":{"insert":2,"delete":3,"replace":0,"opMismatch":1,"argMismatch":9},"quality":{"score":88,"lines":16,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":15,"maxScore":19,"ratio":0.7894736842105263,"kinds":{"insert":2,"delete":3,"replace":0,"opMismatch":1,"argMismatch":9}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `CountTrailingZeroBits` — benchmark function pokeemerald:CountTrailingZeroBits:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountTrailingZeroBits\n\t.type\t CountTrailingZeroBits,function\n\t.thumb_func\nCountTrailingZeroBits:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tmov\tr3, #0x1\n.L6:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r3\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L10\n.L7:\n\tlsr\tr2, r2, #0x1\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0x1f\n\tbls\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n.L10:\n\tbx\tlr\n.Lfe1:\n\t.size\t CountTrailingZeroBits,.Lfe1-CountTrailingZeroBits\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function CountTrailingZeroBits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `CountTrailingZeroBits` — benchmark function pokeemerald:CountTrailingZeroBits:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:CountTrailingZeroBits:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tCountTrailingZeroBits\n\t.type\t CountTrailingZeroBits,function\n\t.thumb_func\nCountTrailingZeroBits:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tmov\tr3, #0x1\n.L6:\n\tadd\tr0, r2, #0\n\tand\tr0, r0, r3\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L10\n.L7:\n\tlsr\tr2, r2, #0x1\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0x1f\n\tbls\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n.L10:\n\tbx\tlr\n.Lfe1:\n\t.size\t CountTrailingZeroBits,.Lfe1-CountTrailingZeroBits\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name CountTrailingZeroBits # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:FeebasRandom:agbcc","sym":"FeebasRandom","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","shift","global"],"loc":5,"refSource":"static u16 FeebasRandom(void)\n{\n sFeebasRngValue = ISO_RANDOMIZE2(sFeebasRngValue);\n return sFeebasRngValue >> 16;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/wild_encounter.c#L170-L174","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.type\t FeebasRandom,function\n\t.thumb_func\nFeebasRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tsFeebasRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x3039\n.Lfe1:\n\t.size\t FeebasRandom,.Lfe1-FeebasRandom\n\n\t.lcomm\tsFeebasRngValue,4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"sFeebasRngValue","shape":"scalar u32"}],"outcome":"match","source":"s32 FeebasRandom(void) {\n s32 v0;\n v0 = sFeebasRngValue;\n sFeebasRngValue = 1103515245 * v0 + 12345;\n return (u32)(1103515245 * v0 + 12345) >> 16;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern u32 sFeebasRngValue;\n\nu32 FeebasRandom(void) {\n u32 temp_r0;\n\n temp_r0 = (0x41C64E6D * sFeebasRngValue) + 0x3039;\n sFeebasRngValue = temp_r0;\n return temp_r0 >> 0x10;\n}\n","score":1,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `FeebasRandom` — benchmark function pokeemerald:FeebasRandom:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.type\t FeebasRandom,function\n\t.thumb_func\nFeebasRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tsFeebasRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x3039\n.Lfe1:\n\t.size\t FeebasRandom,.Lfe1-FeebasRandom\n\n\t.lcomm\tsFeebasRngValue,4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function FeebasRandom # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `FeebasRandom` — benchmark function pokeemerald:FeebasRandom:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:FeebasRandom:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.type\t FeebasRandom,function\n\t.thumb_func\nFeebasRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tsFeebasRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x3039\n.Lfe1:\n\t.size\t FeebasRandom,.Lfe1-FeebasRandom\n\n\t.lcomm\tsFeebasRngValue,4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name FeebasRandom # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:GetGenderFromSpeciesAndPersonality:agbcc","sym":"GetGenderFromSpeciesAndPersonality","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","branch","global","struct"],"loc":15,"refSource":"u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality)\n{\n switch (gSpeciesInfo[species].genderRatio)\n {\n case MON_MALE:\n case MON_FEMALE:\n case MON_GENDERLESS:\n return gSpeciesInfo[species].genderRatio;\n }\n\n if (gSpeciesInfo[species].genderRatio > (personality & 0xFF))\n return MON_FEMALE;\n else\n return MON_MALE;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L3471-L3485","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetGenderFromSpeciesAndPersonality\n\t.type\t GetGenderFromSpeciesAndPersonality,function\n\t.thumb_func\nGetGenderFromSpeciesAndPersonality:\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tldr\tr1, .L12\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0, #0x10]\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tcmp\tr0, #0\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, #0xff\n\tbgt\t.L3\t@cond_branch\n\tcmp\tr0, #0xfe\n\tbge\t.L11\t@cond_branch\n.L3:\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x10]\n\tmov\tr0, #0xff\n\tand\tr0, r0, r3\n\tcmp\tr1, r0\n\tbhi\t.L9\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L11\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgSpeciesInfo\n.L9:\n\tmov\tr0, #0xfe\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t GetGenderFromSpeciesAndPersonality,.Lfe1-GetGenderFromSpeciesAndPersonality\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gSpeciesInfo","shape":"array (28 B/elem)"}],"outcome":"nonmatch","source":"struct Elem0 { u8 _pad0[16]; u8 field_16; u8 _pad1[11]; };\ns32 GetGenderFromSpeciesAndPersonality(u32 a0, u32 a1) {\n s32 v0;\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 == 0) {\n v0 = ((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16;\n } else {\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 < 0) {\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 > (255 & a1)) {\n v0 = 254;\n } else {\n v0 = 0;\n }\n } else {\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 > 255) {\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 > (255 & a1)) {\n v0 = 254;\n } else {\n v0 = 0;\n }\n } else {\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 >= 254) {\n v0 = ((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16;\n } else {\n if (((struct Elem0 *)&gSpeciesInfo)[(u16)a0].field_16 > (255 & a1)) {\n v0 = 254;\n } else {\n v0 = 0;\n }\n }\n }\n }\n }\n return v0;\n}\n","score":32,"maxScore":37,"compileErrors":null,"breakdown":{"insert":6,"delete":9,"replace":4,"opMismatch":5,"argMismatch":8},"quality":{"score":88,"lines":34,"gotos":0,"casts":9,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality) {\n u16 temp_r2;\n u8 var_r0;\n\n temp_r2 = species;\n var_r0 = gSpeciesInfo[temp_r2].genderRatio;\n if ((var_r0 != 0) && (((s32) var_r0 < 0) || ((s32) var_r0 > 0xFF) || ((s32) var_r0 < 0xFE))) {\n if ((u32) gSpeciesInfo[temp_r2].genderRatio <= (u32) (0xFF & personality)) {\n return 0U;\n }\n var_r0 = 0xFE;\n /* Duplicate return node #7. Try simplifying control flow for better match */\n return var_r0;\n }\n return var_r0;\n}\n","score":25,"maxScore":36,"compileErrors":null,"breakdown":{"insert":5,"delete":11,"replace":1,"opMismatch":1,"argMismatch":7},"quality":{"score":96,"lines":15,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":25,"maxScore":36,"ratio":0.6944444444444444,"kinds":{"insert":5,"delete":11,"replace":1,"opMismatch":1,"argMismatch":7}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GetGenderFromSpeciesAndPersonality` — benchmark function pokeemerald:GetGenderFromSpeciesAndPersonality:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetGenderFromSpeciesAndPersonality\n\t.type\t GetGenderFromSpeciesAndPersonality,function\n\t.thumb_func\nGetGenderFromSpeciesAndPersonality:\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tldr\tr1, .L12\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0, #0x10]\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tcmp\tr0, #0\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, #0xff\n\tbgt\t.L3\t@cond_branch\n\tcmp\tr0, #0xfe\n\tbge\t.L11\t@cond_branch\n.L3:\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x10]\n\tmov\tr0, #0xff\n\tand\tr0, r0, r3\n\tcmp\tr1, r0\n\tbhi\t.L9\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L11\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgSpeciesInfo\n.L9:\n\tmov\tr0, #0xfe\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t GetGenderFromSpeciesAndPersonality,.Lfe1-GetGenderFromSpeciesAndPersonality\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GetGenderFromSpeciesAndPersonality # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GetGenderFromSpeciesAndPersonality` — benchmark function pokeemerald:GetGenderFromSpeciesAndPersonality:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:GetGenderFromSpeciesAndPersonality:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetGenderFromSpeciesAndPersonality\n\t.type\t GetGenderFromSpeciesAndPersonality,function\n\t.thumb_func\nGetGenderFromSpeciesAndPersonality:\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tldr\tr1, .L12\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0, #0x10]\n\tcmp\tr0, #0\n\tbeq\t.L11\t@cond_branch\n\tcmp\tr0, #0\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, #0xff\n\tbgt\t.L3\t@cond_branch\n\tcmp\tr0, #0xfe\n\tbge\t.L11\t@cond_branch\n.L3:\n\tlsl\tr0, r2, #0x3\n\tsub\tr0, r0, r2\n\tlsl\tr0, r0, #0x2\n\tadd\tr0, r0, r1\n\tldrb\tr1, [r0, #0x10]\n\tmov\tr0, #0xff\n\tand\tr0, r0, r3\n\tcmp\tr1, r0\n\tbhi\t.L9\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L11\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgSpeciesInfo\n.L9:\n\tmov\tr0, #0xfe\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t GetGenderFromSpeciesAndPersonality,.Lfe1-GetGenderFromSpeciesAndPersonality\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetGenderFromSpeciesAndPersonality # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:GiveBerryPowder:agbcc","sym":"GiveBerryPowder","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["branch","call","memory","global"],"loc":15,"refSource":"bool8 GiveBerryPowder(u32 amountToAdd)\n{\n u32 *powder = &gSaveBlock2Ptr->berryCrush.berryPowderAmount;\n u32 amount = DecryptBerryPowder(powder) + amountToAdd;\n if (amount > MAX_BERRY_POWDER)\n {\n SetBerryPowder(powder, MAX_BERRY_POWDER);\n return FALSE;\n }\n else\n {\n SetBerryPowder(powder, amount);\n return TRUE;\n }\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/berry_powder.c#L162-L176","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGiveBerryPowder\n\t.type\t GiveBerryPowder,function\n\t.thumb_func\nGiveBerryPowder:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tldr\tr0, .L6\n\tldr\tr0, [r0]\n\tmov\tr1, #0xfa\n\tlsl\tr1, r1, #0x1\n\tadd\tr5, r0, r1\n\tadd\tr0, r5, #0\n\tbl\tDecryptBerryPowder\n\tadd\tr1, r0, r4\n\tldr\tr2, .L6+0x4\n\tcmp\tr1, r2\n\tbhi\t.L3\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x1\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgSaveBlock2Ptr\n\t.word\t0x1869f\n.L3:\n\tadd\tr0, r5, #0\n\tadd\tr1, r2, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GiveBerryPowder,.Lfe1-GiveBerryPowder\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-264361caa05e.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gSaveBlock2Ptr","shape":"pointer"}],"outcome":"nonmatch","source":"s32 GiveBerryPowder(u32 a0) {\n s32 v0;\n s32 v1;\n u32 v2;\n s32 v3;\n v0 = gSaveBlock2Ptr;\n v1 = DecryptBerryPowder(v0 + (250 << 1));\n v2 = 99999;\n if (v1 + a0 > v2) {\n SetBerryPowder(v0 + (250 << 1), v2);\n v3 = 0;\n } else {\n SetBerryPowder(v0 + (250 << 1), v1 + a0);\n v3 = 1;\n }\n return v3;\n}\n","score":11,"maxScore":29,"compileErrors":null,"breakdown":{"insert":2,"delete":3,"replace":0,"opMismatch":2,"argMismatch":4},"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 GiveBerryPowder(u32 amountToAdd) {\n u32 *temp_r5;\n u32 temp_r1;\n\n temp_r5 = &gSaveBlock2Ptr->berryCrush.berryPowderAmount;\n temp_r1 = DecryptBerryPowder(temp_r5) + amountToAdd;\n if (temp_r1 <= 0x1869FU) {\n SetBerryPowder(temp_r5, temp_r1);\n return 1U;\n }\n SetBerryPowder(temp_r5, 0x1869FU);\n return 0U;\n}\n","score":9,"maxScore":28,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":0,"opMismatch":2,"argMismatch":4},"quality":{"score":100,"lines":12,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":9,"maxScore":28,"ratio":0.32142857142857145,"kinds":{"insert":1,"delete":2,"replace":0,"opMismatch":2,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GiveBerryPowder` — benchmark function pokeemerald:GiveBerryPowder:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGiveBerryPowder\n\t.type\t GiveBerryPowder,function\n\t.thumb_func\nGiveBerryPowder:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tldr\tr0, .L6\n\tldr\tr0, [r0]\n\tmov\tr1, #0xfa\n\tlsl\tr1, r1, #0x1\n\tadd\tr5, r0, r1\n\tadd\tr0, r5, #0\n\tbl\tDecryptBerryPowder\n\tadd\tr1, r0, r4\n\tldr\tr2, .L6+0x4\n\tcmp\tr1, r2\n\tbhi\t.L3\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x1\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgSaveBlock2Ptr\n\t.word\t0x1869f\n.L3:\n\tadd\tr0, r5, #0\n\tadd\tr1, r2, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GiveBerryPowder,.Lfe1-GiveBerryPowder\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-264361caa05e.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nbool8 GiveBerryPowder(u32 amountToAdd);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GiveBerryPowder # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GiveBerryPowder` — benchmark function pokeemerald:GiveBerryPowder:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:GiveBerryPowder:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGiveBerryPowder\n\t.type\t GiveBerryPowder,function\n\t.thumb_func\nGiveBerryPowder:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tldr\tr0, .L6\n\tldr\tr0, [r0]\n\tmov\tr1, #0xfa\n\tlsl\tr1, r1, #0x1\n\tadd\tr5, r0, r1\n\tadd\tr0, r5, #0\n\tbl\tDecryptBerryPowder\n\tadd\tr1, r0, r4\n\tldr\tr2, .L6+0x4\n\tcmp\tr1, r2\n\tbhi\t.L3\t@cond_branch\n\tadd\tr0, r5, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x1\n\tb\t.L5\n.L7:\n\t.align\t2, 0\n.L6:\n\t.word\tgSaveBlock2Ptr\n\t.word\t0x1869f\n.L3:\n\tadd\tr0, r5, #0\n\tadd\tr1, r2, #0\n\tbl\tSetBerryPowder\n\tmov\tr0, #0x0\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GiveBerryPowder,.Lfe1-GiveBerryPowder\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GiveBerryPowder # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:IsStringLengthAtLeast:agbcc","sym":"IsStringLengthAtLeast","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","branch","pointer","array"],"loc":10,"refSource":"bool8 IsStringLengthAtLeast(const u8 *str, s32 n)\n{\n u8 i;\n\n for (i = 0; i < n; i++)\n if (str[i] && str[i] != EOS)\n return TRUE;\n\n return FALSE;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L152-L161","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tIsStringLengthAtLeast\n\t.type\t IsStringLengthAtLeast,function\n\t.thumb_func\nIsStringLengthAtLeast:\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tcmp\tr2, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0xff\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L9\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, r1\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t IsStringLengthAtLeast,.Lfe1-IsStringLengthAtLeast\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"nonmatch","source":"s32 IsStringLengthAtLeast(s32 a0, s32 a1) {\n s32 v0;\n if (0 < a1) {\n v0 = 0;\n do {\n if (*(u8 *)(a0 + v0) != 0) {\n if (*(u8 *)(a0 + v0) != 255) return 1;\n }\n v0 = (u8)(v0 + 1);\n } while (v0 < a1);\n return 0;\n } else {\n return 0;\n }\n}\n","score":10,"maxScore":23,"compileErrors":null,"breakdown":{"insert":4,"delete":3,"replace":0,"opMismatch":2,"argMismatch":1},"quality":{"score":90,"lines":15,"gotos":0,"casts":3,"unkGlue":0,"rawMem":2,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 IsStringLengthAtLeast(s32 arg0, s32 arg1) {\n u8 temp_r0;\n u8 var_r2;\n\n var_r2 = 0;\n if (arg1 > 0) {\nloop_1:\n temp_r0 = *(arg0 + var_r2);\n if ((temp_r0 != 0) && (temp_r0 != 0xFF)) {\n return 1;\n }\n var_r2 += 1;\n if ((s32) var_r2 >= arg1) {\n goto block_5;\n }\n goto loop_1;\n }\nblock_5:\n return 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":76,"lines":19,"gotos":2,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3928: invalid type argument of `unary *'"]},"gapSize":{"decompiler":"asmlift","score":10,"maxScore":23,"ratio":0.43478260869565216,"kinds":{"insert":4,"delete":3,"replace":0,"opMismatch":2,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `IsStringLengthAtLeast` — benchmark function pokeemerald:IsStringLengthAtLeast:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tIsStringLengthAtLeast\n\t.type\t IsStringLengthAtLeast,function\n\t.thumb_func\nIsStringLengthAtLeast:\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tcmp\tr2, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0xff\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L9\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, r1\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t IsStringLengthAtLeast,.Lfe1-IsStringLengthAtLeast\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function IsStringLengthAtLeast # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `IsStringLengthAtLeast` — benchmark function pokeemerald:IsStringLengthAtLeast:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:IsStringLengthAtLeast:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tIsStringLengthAtLeast\n\t.type\t IsStringLengthAtLeast,function\n\t.thumb_func\nIsStringLengthAtLeast:\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tcmp\tr2, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r3, r2\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0xff\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L9\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, r1\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t IsStringLengthAtLeast,.Lfe1-IsStringLengthAtLeast\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name IsStringLengthAtLeast # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:LoadWordFromTwoHalfwords:agbcc","sym":"LoadWordFromTwoHalfwords","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","pointer","array","bitwise","shift"],"loc":4,"refSource":"void LoadWordFromTwoHalfwords(u16 *h, u32 *w)\n{\n *w = h[0] | (s16)h[1] << 16;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L133-L136","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tLoadWordFromTwoHalfwords\n\t.type\t LoadWordFromTwoHalfwords,function\n\t.thumb_func\nLoadWordFromTwoHalfwords:\n\tldrh\tr2, [r0]\n\tmov\tr3, #0x2\n\tldrsh\tr0, [r0, r3]\n\tlsl\tr0, r0, #0x10\n\torr\tr2, r2, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t LoadWordFromTwoHalfwords,.Lfe1-LoadWordFromTwoHalfwords\n\n.text\n\t.align\t2, 0\n","proto":{"LoadWordFromTwoHalfwords":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void LoadWordFromTwoHalfwords(u16 * a0, s32 * a1) {\n *a1 = *a0 | *(a0 + 1) << 16;\n return;\n}\n","score":2,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void LoadWordFromTwoHalfwords(void *arg0, s32 *arg1) {\n *arg1 = arg0->unk0 | (arg0->unk2 << 0x10);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3922: warning: dereferencing `void *' pointer","/c.c:3922: request for member `unk0' in something not a structure or union","/c.c:3922: request for member `unk2' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":7,"ratio":0.2857142857142857,"kinds":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `LoadWordFromTwoHalfwords` — benchmark function pokeemerald:LoadWordFromTwoHalfwords:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tLoadWordFromTwoHalfwords\n\t.type\t LoadWordFromTwoHalfwords,function\n\t.thumb_func\nLoadWordFromTwoHalfwords:\n\tldrh\tr2, [r0]\n\tmov\tr3, #0x2\n\tldrsh\tr0, [r0, r3]\n\tlsl\tr0, r0, #0x10\n\torr\tr2, r2, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t LoadWordFromTwoHalfwords,.Lfe1-LoadWordFromTwoHalfwords\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function LoadWordFromTwoHalfwords # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `LoadWordFromTwoHalfwords` — benchmark function pokeemerald:LoadWordFromTwoHalfwords:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:LoadWordFromTwoHalfwords:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tLoadWordFromTwoHalfwords\n\t.type\t LoadWordFromTwoHalfwords,function\n\t.thumb_func\nLoadWordFromTwoHalfwords:\n\tldrh\tr2, [r0]\n\tmov\tr3, #0x2\n\tldrsh\tr0, [r0, r3]\n\tlsl\tr0, r0, #0x10\n\torr\tr2, r2, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t LoadWordFromTwoHalfwords,.Lfe1-LoadWordFromTwoHalfwords\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"LoadWordFromTwoHalfwords\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name LoadWordFromTwoHalfwords # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:MathUtil_Div16:agbcc","sym":"MathUtil_Div16","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div","branch","shift"],"loc":8,"refSource":"s16 MathUtil_Div16(s16 x, s16 y)\n{\n if (y == 0)\n {\n return 0;\n }\n return (x << 8) / y;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L33-L40","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16\n\t.type\t MathUtil_Div16,function\n\t.thumb_func\nMathUtil_Div16:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16,.Lfe1-MathUtil_Div16\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 MathUtil_Div16(u32 a0, u32 a1) {\n s32 v0;\n if ((s16)a1 == 0) {\n v0 = 0;\n } else {\n v0 = (s16)(((u16)a0 << 16 >> 8) / (s16)a1);\n }\n return v0;\n}\n","score":16,"maxScore":22,"compileErrors":null,"breakdown":{"insert":6,"delete":8,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":96,"lines":9,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 MathUtil_Div16(u16 arg0, s16 arg1) {\n s16 temp_r1;\n\n temp_r1 = arg1;\n if (temp_r1 != 0) {\n return (s16) ((s32) ((s32) (arg0 << 0x10) >> 8) / temp_r1);\n }\n return 0;\n}\n","score":5,"maxScore":18,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":98,"lines":8,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":5,"maxScore":18,"ratio":0.2777777777777778,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Div16` — benchmark function pokeemerald:MathUtil_Div16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16\n\t.type\t MathUtil_Div16,function\n\t.thumb_func\nMathUtil_Div16:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16,.Lfe1-MathUtil_Div16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Div16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Div16` — benchmark function pokeemerald:MathUtil_Div16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Div16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16\n\t.type\t MathUtil_Div16,function\n\t.thumb_func\nMathUtil_Div16:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x8\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16,.Lfe1-MathUtil_Div16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Div16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:MathUtil_Div16Shift:agbcc","sym":"MathUtil_Div16Shift","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div","branch","shift"],"loc":8,"refSource":"s16 MathUtil_Div16Shift(u8 s, s16 x, s16 y)\n{\n if (y == 0)\n {\n return 0;\n }\n return (x << s) / y;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L42-L49","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16Shift\n\t.type\t MathUtil_Div16Shift,function\n\t.thumb_func\nMathUtil_Div16Shift:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr0, r1, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr1, r2, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr0, r0, r3\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16Shift,.Lfe1-MathUtil_Div16Shift\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 MathUtil_Div16Shift(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n if ((s16)a2 == 0) {\n v0 = 0;\n } else {\n v0 = (s16)(((s16)(u16)a1 << (u8)a0) / (s16)a2);\n }\n return v0;\n}\n","score":16,"maxScore":24,"compileErrors":null,"breakdown":{"insert":5,"delete":5,"replace":4,"opMismatch":1,"argMismatch":1},"quality":{"score":92,"lines":9,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 MathUtil_Div16Shift(u8 arg0, u16 arg1, s16 arg2) {\n s16 temp_r1;\n\n temp_r1 = arg2;\n if (temp_r1 != 0) {\n return (s16) ((s32) ((s16) arg1 << arg0) / temp_r1);\n }\n return 0;\n}\n","score":5,"maxScore":21,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":98,"lines":8,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":5,"maxScore":21,"ratio":0.23809523809523808,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Div16Shift` — benchmark function pokeemerald:MathUtil_Div16Shift:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16Shift\n\t.type\t MathUtil_Div16Shift,function\n\t.thumb_func\nMathUtil_Div16Shift:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr0, r1, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr1, r2, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr0, r0, r3\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16Shift,.Lfe1-MathUtil_Div16Shift\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Div16Shift # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Div16Shift` — benchmark function pokeemerald:MathUtil_Div16Shift:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Div16Shift:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Div16Shift\n\t.type\t MathUtil_Div16Shift,function\n\t.thumb_func\nMathUtil_Div16Shift:\n\tpush\t{lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr3, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr0, r1, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr1, r2, #0x10\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr0, r0, r3\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tb\t.L4\n.L3:\n\tmov\tr0, #0x0\n.L4:\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Div16Shift,.Lfe1-MathUtil_Div16Shift\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Div16Shift # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:MathUtil_Inv16:agbcc","sym":"MathUtil_Inv16","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div"],"loc":7,"refSource":"s16 MathUtil_Inv16(s16 y)\n{\n s32 x;\n\n x = 0x10000;\n return x / y;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L64-L70","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Inv16\n\t.type\t MathUtil_Inv16,function\n\t.thumb_func\nMathUtil_Inv16:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Inv16,.Lfe1-MathUtil_Inv16\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/regcopy","symbolsUsed":[],"outcome":"match","source":"s32 MathUtil_Inv16(u32 a0) {\n s32 w0;\n w0 = 128 << 9;\n return (s16)(w0 / (s16)a0);\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 MathUtil_Inv16(s16 arg0) {\n return (s16) (0x10000 / arg0);\n}\n","score":4,"maxScore":13,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Inv16` — benchmark function pokeemerald:MathUtil_Inv16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Inv16\n\t.type\t MathUtil_Inv16,function\n\t.thumb_func\nMathUtil_Inv16:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Inv16,.Lfe1-MathUtil_Inv16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Inv16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Inv16` — benchmark function pokeemerald:MathUtil_Inv16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Inv16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Inv16\n\t.type\t MathUtil_Inv16,function\n\t.thumb_func\nMathUtil_Inv16:\n\tpush\t{lr}\n\tadd\tr1, r0, #0\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x9\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Inv16,.Lfe1-MathUtil_Inv16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Inv16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:MathUtil_Mul16:agbcc","sym":"MathUtil_Mul16","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","fixed-point","soft-div"],"loc":9,"refSource":"s16 MathUtil_Mul16(s16 x, s16 y)\n{\n s32 result;\n\n result = x;\n result *= y;\n result /= 256;\n return result;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L3-L11","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16\n\t.type\t MathUtil_Mul16,function\n\t.thumb_func\nMathUtil_Mul16:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MathUtil_Mul16,.Lfe1-MathUtil_Mul16\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/regcopy-ret","symbolsUsed":[],"outcome":"match","source":"s32 MathUtil_Mul16(u32 a0, u32 a1) {\n s32 v0;\n s32 w0;\n v0 = (s16)a0 * (s16)a1;\n w0 = v0;\n if (w0 < 0) w0 = w0 + 255;\n v0 = w0 << 8 >> 16;\n return v0;\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 MathUtil_Mul16(s16 arg0, s16 arg1) {\n s32 temp_r0;\n s32 var_r1;\n\n temp_r0 = arg0 * arg1;\n var_r1 = temp_r0;\n if (temp_r0 < 0) {\n var_r1 += 0xFF;\n }\n return (s32) (var_r1 << 8) >> 0x10;\n}\n","score":3,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":10,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Mul16` — benchmark function pokeemerald:MathUtil_Mul16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16\n\t.type\t MathUtil_Mul16,function\n\t.thumb_func\nMathUtil_Mul16:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MathUtil_Mul16,.Lfe1-MathUtil_Mul16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Mul16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Mul16` — benchmark function pokeemerald:MathUtil_Mul16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Mul16:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16\n\t.type\t MathUtil_Mul16,function\n\t.thumb_func\nMathUtil_Mul16:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tadd\tr1, r0, #0\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r1, #0xff\n.L3:\n\tlsl\tr0, r1, #0x8\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t MathUtil_Mul16,.Lfe1-MathUtil_Mul16\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Mul16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:MathUtil_Mul16Shift:agbcc","sym":"MathUtil_Mul16Shift","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","fixed-point","soft-div","shift"],"loc":9,"refSource":"s16 MathUtil_Mul16Shift(u8 s, s16 x, s16 y)\n{\n s32 result;\n\n result = x;\n result *= y;\n result /= (1 << s);\n return result;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L13-L21","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16Shift\n\t.type\t MathUtil_Mul16Shift,function\n\t.thumb_func\nMathUtil_Mul16Shift:\n\tpush\t{lr}\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr3, r3, #0x10\n\tasr\tr3, r3, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tmul\tr3, r3, r2\n\tmov\tr1, #0x1\n\tlsl\tr1, r1, r0\n\tadd\tr0, r3, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul16Shift,.Lfe1-MathUtil_Mul16Shift\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 MathUtil_Mul16Shift(u32 a0, u32 a1, u32 a2) {\n return (s16)((s16)a1 * (s16)a2 / (1 << (u8)a0));\n}\n","score":13,"maxScore":22,"compileErrors":null,"breakdown":{"insert":5,"delete":6,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":96,"lines":3,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 MathUtil_Mul16Shift(u8 arg0, s16 arg1, s16 arg2) {\n return (s16) ((s32) (arg1 * arg2) / (s32) (1 << arg0));\n}\n","score":5,"maxScore":17,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":98,"lines":3,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":5,"maxScore":17,"ratio":0.29411764705882354,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Mul16Shift` — benchmark function pokeemerald:MathUtil_Mul16Shift:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16Shift\n\t.type\t MathUtil_Mul16Shift,function\n\t.thumb_func\nMathUtil_Mul16Shift:\n\tpush\t{lr}\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr3, r3, #0x10\n\tasr\tr3, r3, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tmul\tr3, r3, r2\n\tmov\tr1, #0x1\n\tlsl\tr1, r1, r0\n\tadd\tr0, r3, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul16Shift,.Lfe1-MathUtil_Mul16Shift\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Mul16Shift # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Mul16Shift` — benchmark function pokeemerald:MathUtil_Mul16Shift:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Mul16Shift:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul16Shift\n\t.type\t MathUtil_Mul16Shift,function\n\t.thumb_func\nMathUtil_Mul16Shift:\n\tpush\t{lr}\n\tadd\tr3, r1, #0\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr3, r3, #0x10\n\tasr\tr3, r3, #0x10\n\tlsl\tr2, r2, #0x10\n\tasr\tr2, r2, #0x10\n\tmul\tr3, r3, r2\n\tmov\tr1, #0x1\n\tlsl\tr1, r1, r0\n\tadd\tr0, r3, #0\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul16Shift,.Lfe1-MathUtil_Mul16Shift\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Mul16Shift # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:MathUtil_Mul32:agbcc","sym":"MathUtil_Mul32","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","fixed-point","long-long","soft-div"],"loc":9,"refSource":"s32 MathUtil_Mul32(s32 x, s32 y)\n{\n s64 result;\n\n result = x;\n result *= y;\n result /= 256;\n return result;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/math_util.c#L23-L31","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul32\n\t.type\t MathUtil_Mul32,function\n\t.thumb_func\nMathUtil_Mul32:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r1, #0\n\tadd\tr4, r0, #0\n\tasr\tr5, r0, #0x1f\n\tasr\tr3, r2, #0x1f\n\tadd\tr1, r5, #0\n\tadd\tr0, r4, #0\n\tbl\t__muldi3\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr7, r5, #0\n\tadd\tr6, r4, #0\n\tcmp\tr5, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr6, #0xff\n\tmov\tr7, #0\n\tadd\tr6, r6, r4\n\tadc\tr7, r7, r5\n.L3:\n\tlsl\tr3, r7, #0x18\n\tlsr\tr2, r6, #0x8\n\tadd\tr0, r3, #0\n\torr\tr0, r0, r2\n\tasr\tr1, r7, #0x8\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul32,.Lfe1-MathUtil_Mul32\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"s32 MathUtil_Mul32(s32 a0, s32 a1) {\n s32 v0;\n s32 v1;\n v0 = __muldi3(a0, a0 >> 31, a1, a1 >> 31);\n if (a0 >> 31 >= 0) {\n v1 = a0 >> 31;\n } else {\n v0 = 255 + v0;\n v1 = ASMLIFT_ERROR(\"unmodelled instruction 'adc'\", 0, a0 >> 31);\n }\n return v1 << 24 | (u32)v0 >> 8;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":12,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: unmodelled instruction 'adc'"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u32 __muldi3(s32, s32, s32, s32); /* extern */\n\ns32 MathUtil_Mul32(s32 arg0, s32 arg1) {\n s32 temp_r1;\n s32 var_r7;\n u32 temp_r0;\n u32 temp_ret;\n u32 var_r6;\n\n temp_ret = __muldi3(arg0, arg0 >> 0x1F, arg1, arg1 >> 0x1F);\n temp_r0 = temp_ret;\n temp_r1 = SECOND_REG(temp_ret);\n var_r7 = temp_r1;\n var_r6 = temp_r0;\n if (temp_r1 < 0) {\n var_r6 = temp_r0 + 0xFF;\n var_r7 = temp_r1 + M2C_CARRY(var_r6);\n }\n return (var_r7 << 0x18) | (var_r6 >> 8);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_CARRY"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `MathUtil_Mul32` — benchmark function pokeemerald:MathUtil_Mul32:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul32\n\t.type\t MathUtil_Mul32,function\n\t.thumb_func\nMathUtil_Mul32:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r1, #0\n\tadd\tr4, r0, #0\n\tasr\tr5, r0, #0x1f\n\tasr\tr3, r2, #0x1f\n\tadd\tr1, r5, #0\n\tadd\tr0, r4, #0\n\tbl\t__muldi3\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr7, r5, #0\n\tadd\tr6, r4, #0\n\tcmp\tr5, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr6, #0xff\n\tmov\tr7, #0\n\tadd\tr6, r6, r4\n\tadc\tr7, r7, r5\n.L3:\n\tlsl\tr3, r7, #0x18\n\tlsr\tr2, r6, #0x8\n\tadd\tr0, r3, #0\n\torr\tr0, r0, r2\n\tasr\tr1, r7, #0x8\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul32,.Lfe1-MathUtil_Mul32\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function MathUtil_Mul32 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `MathUtil_Mul32` — benchmark function pokeemerald:MathUtil_Mul32:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:MathUtil_Mul32:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tMathUtil_Mul32\n\t.type\t MathUtil_Mul32,function\n\t.thumb_func\nMathUtil_Mul32:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr2, r1, #0\n\tadd\tr4, r0, #0\n\tasr\tr5, r0, #0x1f\n\tasr\tr3, r2, #0x1f\n\tadd\tr1, r5, #0\n\tadd\tr0, r4, #0\n\tbl\t__muldi3\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr7, r5, #0\n\tadd\tr6, r4, #0\n\tcmp\tr5, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr6, #0xff\n\tmov\tr7, #0\n\tadd\tr6, r6, r4\n\tadc\tr7, r7, r5\n.L3:\n\tlsl\tr3, r7, #0x18\n\tlsr\tr2, r6, #0x8\n\tadd\tr0, r3, #0\n\torr\tr0, r0, r2\n\tasr\tr1, r7, #0x8\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n\tadd\tr0, r4, #0\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t MathUtil_Mul32,.Lfe1-MathUtil_Mul32\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name MathUtil_Mul32 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:ModifyStatByNature:agbcc","sym":"ModifyStatByNature","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","branch","arithmetic","soft-div","global"],"loc":25,"refSource":"u16 ModifyStatByNature(u8 nature, u16 stat, u8 statIndex)\n{\n u16 retVal;\n\n // Don't modify HP, Accuracy, or Evasion by nature\n if (statIndex <= STAT_HP || statIndex > NUM_NATURE_STATS)\n return stat;\n\n switch (gNatureStatTable[nature][statIndex - 1])\n {\n case 1:\n retVal = stat * 110;\n retVal /= 100;\n break;\n case -1:\n retVal = stat * 90;\n retVal /= 100;\n break;\n default:\n retVal = stat;\n break;\n }\n\n return retVal;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon.c#L5864-L5898","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tModifyStatByNature\n\t.type\t ModifyStatByNature,function\n\t.thumb_func\nModifyStatByNature:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr0, #0xff\n\tlsl\tr0, r0, #0x18\n\tadd\tr2, r2, r0\n\tlsr\tr2, r2, #0x18\n\tcmp\tr2, #0x4\n\tbls\t.L3\t@cond_branch\n\tadd\tr0, r3, #0\n\tb\t.L9\n.L3:\n\tldr\tr0, .L11\n\tlsl\tr1, r4, #0x2\n\tadd\tr1, r1, r4\n\tsub\tr1, r1, #0x1\n\tadd\tr1, r5, r1\n\tadd\tr1, r1, r0\n\tldrb\tr1, [r1, #0]\n\tlsl\tr1, r1, #24\n\tasr\tr1, r1, #24\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr1, r0\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbne\t.L7\t@cond_branch\n\tmov\tr0, #0x6e\n\tb\t.L10\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\tgNatureStatTable\n.L6:\n\tmov\tr0, #0x5a\n.L10:\n\tmul\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tmov\tr1, #0x64\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L9\n.L7:\n\tadd\tr0, r3, #0\n.L9:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ModifyStatByNature,.Lfe1-ModifyStatByNature\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gNatureStatTable","shape":"s8[]"}],"outcome":"nonmatch","source":"s32 ModifyStatByNature(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n s32 v1;\n if ((a2 << 24) + (255 << 24) >> 24 > 4) {\n return (u16)a1;\n } else {\n v0 = gNatureStatTable[0][(u8)a2 + ((u8)a0 * 5 - 1)];\n switch ((s8)v0) {\n case -1:\n v1 = 90;\n return (u16)((u16)(v1 * (u16)a1) / 100);\n case 1:\n v1 = 110;\n return (u16)((u16)(v1 * (u16)a1) / 100);\n default:\n return (u16)a1;\n }\n }\n}\n","score":40,"maxScore":56,"compileErrors":null,"breakdown":{"insert":10,"delete":8,"replace":8,"opMismatch":2,"argMismatch":12},"quality":{"score":84,"lines":19,"gotos":0,"casts":11,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u16 ModifyStatByNature(u8 nature, u16 stat, u8 statIndex) {\n s32 var_r0;\n s8 temp_r1;\n u16 temp_r3;\n\n temp_r3 = stat;\n if ((u32) ((u32) ((statIndex << 0x18) + 0xFF000000) >> 0x18) > 4U) {\n return temp_r3;\n }\n temp_r1 = (s8) (u8) (*gNatureStatTable)[statIndex + ((nature * 5) - 1)];\n switch (temp_r1) { /* irregular */\n case 1:\n var_r0 = 0x6E;\nblock_6:\n return (u16) ((u16) (var_r0 * temp_r3) / 100U);\n case -1:\n var_r0 = 0x5A;\n goto block_6;\n default:\n return temp_r3;\n }\n}\n","score":31,"maxScore":55,"compileErrors":null,"breakdown":{"insert":9,"delete":11,"replace":3,"opMismatch":1,"argMismatch":7},"quality":{"score":76,"lines":21,"gotos":1,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":31,"maxScore":55,"ratio":0.5636363636363636,"kinds":{"insert":9,"delete":11,"replace":3,"opMismatch":1,"argMismatch":7}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ModifyStatByNature` — benchmark function pokeemerald:ModifyStatByNature:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tModifyStatByNature\n\t.type\t ModifyStatByNature,function\n\t.thumb_func\nModifyStatByNature:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr0, #0xff\n\tlsl\tr0, r0, #0x18\n\tadd\tr2, r2, r0\n\tlsr\tr2, r2, #0x18\n\tcmp\tr2, #0x4\n\tbls\t.L3\t@cond_branch\n\tadd\tr0, r3, #0\n\tb\t.L9\n.L3:\n\tldr\tr0, .L11\n\tlsl\tr1, r4, #0x2\n\tadd\tr1, r1, r4\n\tsub\tr1, r1, #0x1\n\tadd\tr1, r5, r1\n\tadd\tr1, r1, r0\n\tldrb\tr1, [r1, #0]\n\tlsl\tr1, r1, #24\n\tasr\tr1, r1, #24\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr1, r0\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbne\t.L7\t@cond_branch\n\tmov\tr0, #0x6e\n\tb\t.L10\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\tgNatureStatTable\n.L6:\n\tmov\tr0, #0x5a\n.L10:\n\tmul\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tmov\tr1, #0x64\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L9\n.L7:\n\tadd\tr0, r3, #0\n.L9:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ModifyStatByNature,.Lfe1-ModifyStatByNature\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-b98da8e28d15.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu16 ModifyStatByNature(u8 nature, u16 stat, u8 statIndex);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ModifyStatByNature # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ModifyStatByNature` — benchmark function pokeemerald:ModifyStatByNature:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:ModifyStatByNature:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tModifyStatByNature\n\t.type\t ModifyStatByNature,function\n\t.thumb_func\nModifyStatByNature:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr4, r0, #0x18\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr0, #0xff\n\tlsl\tr0, r0, #0x18\n\tadd\tr2, r2, r0\n\tlsr\tr2, r2, #0x18\n\tcmp\tr2, #0x4\n\tbls\t.L3\t@cond_branch\n\tadd\tr0, r3, #0\n\tb\t.L9\n.L3:\n\tldr\tr0, .L11\n\tlsl\tr1, r4, #0x2\n\tadd\tr1, r1, r4\n\tsub\tr1, r1, #0x1\n\tadd\tr1, r5, r1\n\tadd\tr1, r1, r0\n\tldrb\tr1, [r1, #0]\n\tlsl\tr1, r1, #24\n\tasr\tr1, r1, #24\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr1, r0\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr1, #0x1\n\tbne\t.L7\t@cond_branch\n\tmov\tr0, #0x6e\n\tb\t.L10\n.L12:\n\t.align\t2, 0\n.L11:\n\t.word\tgNatureStatTable\n.L6:\n\tmov\tr0, #0x5a\n.L10:\n\tmul\tr0, r0, r3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tmov\tr1, #0x64\n\tbl\t__udivsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tb\t.L9\n.L7:\n\tadd\tr0, r3, #0\n.L9:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t ModifyStatByNature,.Lfe1-ModifyStatByNature\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ModifyStatByNature # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:PutFirstMemBlockHeader:agbcc","sym":"PutFirstMemBlockHeader","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["pointer","struct","call"],"loc":4,"refSource":"void PutFirstMemBlockHeader(void *block, u32 size)\n{\n PutMemBlockHeader(block, (struct MemBlock *)block, (struct MemBlock *)block, size - sizeof(struct MemBlock));\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/malloc.c#L42-L45","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutFirstMemBlockHeader\n\t.type\t PutFirstMemBlockHeader,function\n\t.thumb_func\nPutFirstMemBlockHeader:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr3, r3, #0x10\n\tadd\tr1, r2, #0\n\tbl\tPutMemBlockHeader\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t PutFirstMemBlockHeader,.Lfe1-PutFirstMemBlockHeader\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-92d4b72c07b6.i.gz","proto":{"PutFirstMemBlockHeader":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void PutFirstMemBlockHeader(u32 a0, u32 a1) {\n PutMemBlockHeader(a0, a0, a0, a1 - 16);\n return;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void PutFirstMemBlockHeader(void *block, u32 size) {\n PutMemBlockHeader(block, (struct MemBlock *) block, (struct MemBlock *) block, size - 0x10);\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `PutFirstMemBlockHeader` — benchmark function pokeemerald:PutFirstMemBlockHeader:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutFirstMemBlockHeader\n\t.type\t PutFirstMemBlockHeader,function\n\t.thumb_func\nPutFirstMemBlockHeader:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr3, r3, #0x10\n\tadd\tr1, r2, #0\n\tbl\tPutMemBlockHeader\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t PutFirstMemBlockHeader,.Lfe1-PutFirstMemBlockHeader\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-92d4b72c07b6.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid PutFirstMemBlockHeader(void *block, u32 size);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function PutFirstMemBlockHeader # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `PutFirstMemBlockHeader` — benchmark function pokeemerald:PutFirstMemBlockHeader:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:PutFirstMemBlockHeader:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutFirstMemBlockHeader\n\t.type\t PutFirstMemBlockHeader,function\n\t.thumb_func\nPutFirstMemBlockHeader:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr3, r3, #0x10\n\tadd\tr1, r2, #0\n\tbl\tPutMemBlockHeader\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t PutFirstMemBlockHeader,.Lfe1-PutFirstMemBlockHeader\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"PutFirstMemBlockHeader\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name PutFirstMemBlockHeader # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:PutMemBlockHeader:agbcc","sym":"PutMemBlockHeader","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","pointer","struct"],"loc":10,"refSource":"void PutMemBlockHeader(void *block, struct MemBlock *prev, struct MemBlock *next, u32 size)\n{\n struct MemBlock *header = (struct MemBlock *)block;\n\n header->flag = FALSE;\n header->magic = MALLOC_SYSTEM_ID;\n header->size = size;\n header->prev = prev;\n header->next = next;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/malloc.c#L31-L40","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutMemBlockHeader\n\t.type\t PutMemBlockHeader,function\n\t.thumb_func\nPutMemBlockHeader:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr4, .L3\n\tstrh\tr4, [r0, #0x2]\n\tstr\tr3, [r0, #0x4]\n\tstr\tr1, [r0, #0x8]\n\tstr\tr2, [r0, #0xc]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xa3a3\n.Lfe1:\n\t.size\t PutMemBlockHeader,.Lfe1-PutMemBlockHeader\n\n.text\n\t.align\t2, 0\n","proto":{"PutMemBlockHeader":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"struct Struct0 { u16 field_0; u16 field_2; s32 field_4; s32 field_8; s32 field_12; };\nvoid PutMemBlockHeader(struct Struct0 * a0, u32 a1, u32 a2, u32 a3) {\n a0->field_0 = 0;\n a0->field_2 = 41891;\n a0->field_4 = a3;\n a0->field_8 = a1;\n a0->field_12 = a2;\n return;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void PutMemBlockHeader(void *arg0, s32 arg1, s32 arg2, s32 arg3) {\n arg0->unk0 = 0;\n arg0->unk2 = 0xA3A3;\n arg0->unk4 = arg3;\n arg0->unk8 = arg1;\n arg0->unkC = arg2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3930: warning: dereferencing `void *' pointer","/c.c:3930: request for member `unk0' in something not a structure or union","/c.c:3931: warning: dereferencing `void *' pointer","/c.c:3931: request for member `unk2' in something not a structure or union","/c.c:3932: warning: dereferencing `void *' pointer"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `PutMemBlockHeader` — benchmark function pokeemerald:PutMemBlockHeader:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutMemBlockHeader\n\t.type\t PutMemBlockHeader,function\n\t.thumb_func\nPutMemBlockHeader:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr4, .L3\n\tstrh\tr4, [r0, #0x2]\n\tstr\tr3, [r0, #0x4]\n\tstr\tr1, [r0, #0x8]\n\tstr\tr2, [r0, #0xc]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xa3a3\n.Lfe1:\n\t.size\t PutMemBlockHeader,.Lfe1-PutMemBlockHeader\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function PutMemBlockHeader # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `PutMemBlockHeader` — benchmark function pokeemerald:PutMemBlockHeader:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:PutMemBlockHeader:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tPutMemBlockHeader\n\t.type\t PutMemBlockHeader,function\n\t.thumb_func\nPutMemBlockHeader:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tstrh\tr4, [r0]\n\tldr\tr4, .L3\n\tstrh\tr4, [r0, #0x2]\n\tstr\tr3, [r0, #0x4]\n\tstr\tr1, [r0, #0x8]\n\tstr\tr2, [r0, #0xc]\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xa3a3\n.Lfe1:\n\t.size\t PutMemBlockHeader,.Lfe1-PutMemBlockHeader\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"PutMemBlockHeader\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name PutMemBlockHeader # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:Random:agbcc","sym":"Random","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","arithmetic","shift","call"],"loc":6,"refSource":"u16 Random(void)\n{\n gRngValue = ISO_RANDOMIZE1(gRngValue);\n sRandCount++;\n return gRngValue >> 16;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/random.c#L11-L16","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tldr\tr2, .L3+0xc\n\tldr\tr1, [r2]\n\tadd\tr1, r1, #0x1\n\tstr\tr1, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x6073\n\t.word\tsRandCount\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\n\t.lcomm\tsRandCount,4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gRngValue","shape":"scalar u32"},{"name":"sRandCount","shape":"scalar u32"}],"outcome":"match","source":"s32 Random(void) {\n s32 v0;\n v0 = gRngValue;\n gRngValue = 1103515245 * v0 + 24691;\n sRandCount = sRandCount + 1;\n return (u32)(1103515245 * v0 + 24691) >> 16;\n}\n","score":0,"maxScore":18,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern u32 gRngValue;\nextern s32 sRandCount;\n\nu32 Random(void) {\n u32 temp_r0;\n\n temp_r0 = (0x41C64E6D * gRngValue) + 0x6073;\n gRngValue = temp_r0;\n sRandCount += 1;\n return temp_r0 >> 0x10;\n}\n","score":1,"maxScore":18,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Random` — benchmark function pokeemerald:Random:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tldr\tr2, .L3+0xc\n\tldr\tr1, [r2]\n\tadd\tr1, r1, #0x1\n\tstr\tr1, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x6073\n\t.word\tsRandCount\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\n\t.lcomm\tsRandCount,4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Random # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Random` — benchmark function pokeemerald:Random:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:Random:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr2, .L3\n\tldr\tr1, [r2]\n\tldr\tr0, .L3+0x4\n\tmul\tr0, r0, r1\n\tldr\tr1, .L3+0x8\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2]\n\tldr\tr2, .L3+0xc\n\tldr\tr1, [r2]\n\tadd\tr1, r1, #0x1\n\tstr\tr1, [r2]\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngValue\n\t.word\t0x41c64e6d\n\t.word\t0x6073\n\t.word\tsRandCount\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\n\t.lcomm\tsRandCount,4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Random # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:SetupBytecodeScript:agbcc","sym":"SetupBytecodeScript","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","pointer","struct"],"loc":6,"refSource":"u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr)\n{\n ctx->scriptPtr = ptr;\n ctx->mode = SCRIPT_MODE_BYTECODE;\n return 1;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/script.c#L52-L57","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSetupBytecodeScript\n\t.type\t SetupBytecodeScript,function\n\t.thumb_func\nSetupBytecodeScript:\n\tstr\tr1, [r0, #0x8]\n\tmov\tr1, #0x1\n\tstrb\tr1, [r0, #0x1]\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t SetupBytecodeScript,.Lfe1-SetupBytecodeScript\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"struct Struct0 { u8 _pad0[1]; u8 field_1; u8 _pad1[6]; s32 field_8; };\ns32 SetupBytecodeScript(struct Struct0 * a0, u32 a1) {\n a0->field_8 = a1;\n a0->field_1 = 1;\n return 1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 SetupBytecodeScript(void *arg0, s32 arg1) {\n arg0->unk8 = arg1;\n arg0->unk1 = 1;\n return 1;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3979: warning: dereferencing `void *' pointer","/c.c:3979: request for member `unk8' in something not a structure or union","/c.c:3980: warning: dereferencing `void *' pointer","/c.c:3980: request for member `unk1' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `SetupBytecodeScript` — benchmark function pokeemerald:SetupBytecodeScript:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSetupBytecodeScript\n\t.type\t SetupBytecodeScript,function\n\t.thumb_func\nSetupBytecodeScript:\n\tstr\tr1, [r0, #0x8]\n\tmov\tr1, #0x1\n\tstrb\tr1, [r0, #0x1]\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t SetupBytecodeScript,.Lfe1-SetupBytecodeScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function SetupBytecodeScript # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `SetupBytecodeScript` — benchmark function pokeemerald:SetupBytecodeScript:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:SetupBytecodeScript:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSetupBytecodeScript\n\t.type\t SetupBytecodeScript,function\n\t.thumb_func\nSetupBytecodeScript:\n\tstr\tr1, [r0, #0x8]\n\tmov\tr1, #0x1\n\tstrb\tr1, [r0, #0x1]\n\tmov\tr0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t SetupBytecodeScript,.Lfe1-SetupBytecodeScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name SetupBytecodeScript # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:Sin2:agbcc","sym":"Sin2","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div","bitwise","branch","table"],"loc":11,"refSource":"s16 Sin2(u16 angle)\n{\n s32 angleMod = angle % 180;\n s32 negate = ((angle / 180) & 1);\n s16 value = gSineDegreeTable[angleMod];\n\n if (negate)\n return -value;\n else\n return value;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/trig.c#L527-L537","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSin2\n\t.type\t Sin2,function\n\t.thumb_func\nSin2:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__umodsi3\n\tadd\tr4, r0, #0\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__udivsi3\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldr\tr1, .L8\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r1\n\tldrh\tr1, [r4]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tlsl\tr0, r1, #0x10\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgSineDegreeTable\n.L3:\n\tlsl\tr0, r1, #0x10\n\tneg\tr0, r0\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sin2,.Lfe1-Sin2\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-3b544fd3decb.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","symbolsUsed":[{"name":"gSineDegreeTable","shape":"s16[]"}],"outcome":"nonmatch","source":"s32 Sin2(u32 a0) {\n s32 v0;\n u16 * p0;\n p0 = (u16 *)&gSineDegreeTable;\n if (((u16)a0 / 180 & 1) != 0) {\n v0 = -(p0[(u16)((u16)a0 % 180)] << 16);\n } else {\n v0 = p0[(u16)((u16)a0 % 180)] << 16;\n }\n return v0 >> 16;\n}\n","score":34,"maxScore":45,"compileErrors":null,"breakdown":{"insert":14,"delete":10,"replace":7,"opMismatch":1,"argMismatch":2},"quality":{"score":92,"lines":11,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 Sin2(u16 angle) {\n s32 var_r0;\n u16 temp_r1;\n u16 temp_r5;\n\n temp_r5 = angle;\n temp_r1 = (u16) gSineDegreeTable[(u16) (temp_r5 % 180U)];\n if (!((temp_r5 / 180U) & 1)) {\n var_r0 = temp_r1 << 0x10;\n } else {\n var_r0 = 0 - (temp_r1 << 0x10);\n }\n return (s16) (var_r0 >> 0x10);\n}\n","score":29,"maxScore":40,"compileErrors":null,"breakdown":{"insert":9,"delete":11,"replace":0,"opMismatch":0,"argMismatch":9},"quality":{"score":98,"lines":13,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":29,"maxScore":40,"ratio":0.725,"kinds":{"insert":9,"delete":11,"replace":0,"opMismatch":0,"argMismatch":9}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Sin2` — benchmark function pokeemerald:Sin2:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSin2\n\t.type\t Sin2,function\n\t.thumb_func\nSin2:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__umodsi3\n\tadd\tr4, r0, #0\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__udivsi3\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldr\tr1, .L8\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r1\n\tldrh\tr1, [r4]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tlsl\tr0, r1, #0x10\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgSineDegreeTable\n.L3:\n\tlsl\tr0, r1, #0x10\n\tneg\tr0, r0\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sin2,.Lfe1-Sin2\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-3b544fd3decb.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns16 Sin2(u16 angle);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Sin2 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Sin2` — benchmark function pokeemerald:Sin2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:Sin2:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSin2\n\t.type\t Sin2,function\n\t.thumb_func\nSin2:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__umodsi3\n\tadd\tr4, r0, #0\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tadd\tr0, r5, #0\n\tmov\tr1, #0xb4\n\tbl\t__udivsi3\n\tmov\tr1, #0x1\n\tand\tr0, r0, r1\n\tldr\tr1, .L8\n\tlsl\tr4, r4, #0x1\n\tadd\tr4, r4, r1\n\tldrh\tr1, [r4]\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tlsl\tr0, r1, #0x10\n\tb\t.L7\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgSineDegreeTable\n.L3:\n\tlsl\tr0, r1, #0x10\n\tneg\tr0, r0\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Sin2,.Lfe1-Sin2\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Sin2 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StopScript:agbcc","sym":"StopScript","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","pointer","struct","branch"],"loc":5,"refSource":"void StopScript(struct ScriptContext *ctx)\n{\n ctx->mode = SCRIPT_MODE_STOPPED;\n ctx->scriptPtr = NULL;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/script.c#L65-L69","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStopScript\n\t.type\t StopScript,function\n\t.thumb_func\nStopScript:\n\tmov\tr1, #0x0\n\tstrb\tr1, [r0, #0x1]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t StopScript,.Lfe1-StopScript\n\n.text\n\t.align\t2, 0\n","proto":{"StopScript":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"struct Struct0 { u8 _pad0[1]; u8 field_1; u8 _pad1[6]; s32 field_8; };\nvoid StopScript(struct Struct0 * a0) {\n a0->field_1 = 0;\n a0->field_8 = 0;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void StopScript(void *arg0) {\n arg0->unk1 = 0;\n arg0->unk8 = 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3979: warning: dereferencing `void *' pointer","/c.c:3979: request for member `unk1' in something not a structure or union","/c.c:3980: warning: dereferencing `void *' pointer","/c.c:3980: request for member `unk8' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StopScript` — benchmark function pokeemerald:StopScript:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStopScript\n\t.type\t StopScript,function\n\t.thumb_func\nStopScript:\n\tmov\tr1, #0x0\n\tstrb\tr1, [r0, #0x1]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t StopScript,.Lfe1-StopScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StopScript # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StopScript` — benchmark function pokeemerald:StopScript:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StopScript:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStopScript\n\t.type\t StopScript,function\n\t.thumb_func\nStopScript:\n\tmov\tr1, #0x0\n\tstrb\tr1, [r0, #0x1]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t StopScript,.Lfe1-StopScript\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StopScript\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StopScript # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StoreWordInTwoHalfwords:agbcc","sym":"StoreWordInTwoHalfwords","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","pointer","array","shift"],"loc":5,"refSource":"void StoreWordInTwoHalfwords(u16 *h, u32 w)\n{\n h[0] = (u16)(w);\n h[1] = (u16)(w >> 16);\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/util.c#L127-L131","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStoreWordInTwoHalfwords\n\t.type\t StoreWordInTwoHalfwords,function\n\t.thumb_func\nStoreWordInTwoHalfwords:\n\tstrh\tr1, [r0]\n\tlsr\tr1, r1, #0x10\n\tstrh\tr1, [r0, #0x2]\n\tbx\tlr\n.Lfe1:\n\t.size\t StoreWordInTwoHalfwords,.Lfe1-StoreWordInTwoHalfwords\n\n.text\n\t.align\t2, 0\n","proto":{"StoreWordInTwoHalfwords":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"void StoreWordInTwoHalfwords(u16 * a0, u32 a1) {\n *a0 = a1;\n a0[1] = a1 >> 16;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void StoreWordInTwoHalfwords(void *arg0, u16 arg1) {\n arg0->unk0 = arg1;\n arg0->unk2 = (s16) (arg1 >> 0x10);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3922: warning: dereferencing `void *' pointer","/c.c:3922: request for member `unk0' in something not a structure or union","/c.c:3923: warning: dereferencing `void *' pointer","/c.c:3923: request for member `unk2' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StoreWordInTwoHalfwords` — benchmark function pokeemerald:StoreWordInTwoHalfwords:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStoreWordInTwoHalfwords\n\t.type\t StoreWordInTwoHalfwords,function\n\t.thumb_func\nStoreWordInTwoHalfwords:\n\tstrh\tr1, [r0]\n\tlsr\tr1, r1, #0x10\n\tstrh\tr1, [r0, #0x2]\n\tbx\tlr\n.Lfe1:\n\t.size\t StoreWordInTwoHalfwords,.Lfe1-StoreWordInTwoHalfwords\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StoreWordInTwoHalfwords # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StoreWordInTwoHalfwords` — benchmark function pokeemerald:StoreWordInTwoHalfwords:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StoreWordInTwoHalfwords:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStoreWordInTwoHalfwords\n\t.type\t StoreWordInTwoHalfwords,function\n\t.thumb_func\nStoreWordInTwoHalfwords:\n\tstrh\tr1, [r0]\n\tlsr\tr1, r1, #0x10\n\tstrh\tr1, [r0, #0x2]\n\tbx\tlr\n.Lfe1:\n\t.size\t StoreWordInTwoHalfwords,.Lfe1-StoreWordInTwoHalfwords\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"StoreWordInTwoHalfwords\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StoreWordInTwoHalfwords # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StringAppend:agbcc","sym":"StringAppend","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","call","branch"],"loc":7,"refSource":"u8 *StringAppend(u8 *dest, const u8 *src)\n{\n while (*dest != EOS)\n dest++;\n\n return StringCopy(dest, src);\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L88-L94","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringAppend\n\t.type\t StringAppend,function\n\t.thumb_func\nStringAppend:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n.L7:\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tStringCopy\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringAppend,.Lfe1-StringAppend\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/pokeemerald/ctx-9801ce0c65ce.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 StringAppend(u8 * a0, u32 a1) {\n u8 * v0;\n for (v0 = a0; *v0 != 255; v0 = v0 + 1) {\n }\n return StringCopy(v0, a1);\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 *StringAppend(u8 *dest, u8 *src) {\n u8 *var_r2;\n\n var_r2 = dest;\nloop_2:\n if (*var_r2 != 0xFF) {\n var_r2 += 1;\n goto loop_2;\n }\n return StringCopy(var_r2, src);\n}\n","score":5,"maxScore":13,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":88,"lines":10,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StringAppend` — benchmark function pokeemerald:StringAppend:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringAppend\n\t.type\t StringAppend,function\n\t.thumb_func\nStringAppend:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n.L7:\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tStringCopy\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringAppend,.Lfe1-StringAppend\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/pokeemerald/ctx-9801ce0c65ce.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu8 *StringAppend(u8 *dest, const u8 *src);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringAppend # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StringAppend` — benchmark function pokeemerald:StringAppend:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringAppend:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringAppend\n\t.type\t StringAppend,function\n\t.thumb_func\nStringAppend:\n\tpush\t{lr}\n\tadd\tr2, r0, #0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n.L7:\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbl\tStringCopy\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringAppend,.Lfe1-StringAppend\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringAppend # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StringCompare:agbcc","sym":"StringCompare","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","branch","pointer","arithmetic"],"loc":12,"refSource":"s32 StringCompare(const u8 *str1, const u8 *str2)\n{\n while (*str1 == *str2)\n {\n if (*str1 == EOS)\n return 0;\n str1++;\n str2++;\n }\n\n return *str1 - *str2;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L124-L135","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompare\n\t.type\t StringCompare,function\n\t.thumb_func\nStringCompare:\n\tadd\tr2, r0, #0\n\tb\t.L9\n.L5:\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L6:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L9:\n\tldrb\tr0, [r2]\n\tldrb\tr3, [r1]\n\tcmp\tr0, r3\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L8:\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCompare,.Lfe1-StringCompare\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'StringCompare' — structure: cannot structure 'StringCompare': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tStringCompare */\n/* \t.type\t StringCompare,function */\n/* \t.thumb_func */\n/* StringCompare: */\n/* \tadd\tr2, r0, #0 */\n/* \tb\t.L9 */\n/* .L5: */\n/* \tcmp\tr0, #0xff */\n/* \tbne\t.L6\t@cond_branch */\n/* \tmov\tr0, #0x0 */\n/* \tb\t.L8 */\n/* .L6: */\n/* \tadd\tr2, r2, #0x1 */\n/* \tadd\tr1, r1, #0x1 */\n/* .L9: */\n/* \tldrb\tr0, [r2] */\n/* \tldrb\tr3, [r1] */\n/* \tcmp\tr0, r3 */\n/* \tbeq\t.L5\t@cond_branch */\n/* \tldrb\tr0, [r2] */\n/* \tldrb\tr1, [r1] */\n/* \tsub\tr0, r0, r1 */\n/* .L8: */\n/* \tbx\tlr */\n/* .Lfe1: */\n/* \t.size\t StringCompare,.Lfe1-StringCompare */\n/* .text */\n/* \t.align\t2, 0 */\nvoid StringCompare(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'StringCompare': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":38,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'StringCompare': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 StringCompare(u8 *arg0, u8 *arg1) {\n u8 *var_r1;\n u8 *var_r2;\n u8 temp_r0;\n\n var_r1 = arg1;\n var_r2 = arg0;\nloop_4:\n temp_r0 = *var_r2;\n if (temp_r0 != *var_r1) {\n return *var_r2 - *var_r1;\n }\n if (temp_r0 == 0xFF) {\n return 0;\n }\n var_r2 += 1;\n var_r1 += 1;\n goto loop_4;\n}\n","score":21,"maxScore":23,"compileErrors":null,"breakdown":{"insert":7,"delete":9,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":88,"lines":18,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":21,"maxScore":23,"ratio":0.9130434782608695,"kinds":{"insert":7,"delete":9,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StringCompare` — benchmark function pokeemerald:StringCompare:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompare\n\t.type\t StringCompare,function\n\t.thumb_func\nStringCompare:\n\tadd\tr2, r0, #0\n\tb\t.L9\n.L5:\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L6:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L9:\n\tldrb\tr0, [r2]\n\tldrb\tr3, [r1]\n\tcmp\tr0, r3\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L8:\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCompare,.Lfe1-StringCompare\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringCompare # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StringCompare` — benchmark function pokeemerald:StringCompare:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCompare:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompare\n\t.type\t StringCompare,function\n\t.thumb_func\nStringCompare:\n\tadd\tr2, r0, #0\n\tb\t.L9\n.L5:\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L6:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L9:\n\tldrb\tr0, [r2]\n\tldrb\tr3, [r1]\n\tcmp\tr0, r3\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r2]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L8:\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCompare,.Lfe1-StringCompare\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCompare # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StringCompareN:agbcc","sym":"StringCompareN","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","branch","pointer","arithmetic"],"loc":14,"refSource":"s32 StringCompareN(const u8 *str1, const u8 *str2, u32 n)\n{\n while (*str1 == *str2)\n {\n if (*str1 == EOS)\n return 0;\n str1++;\n str2++;\n if (--n == 0)\n return 0;\n }\n\n return *str1 - *str2;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L137-L150","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompareN\n\t.type\t StringCompareN,function\n\t.thumb_func\nStringCompareN:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tb\t.L3\n.L5:\n\tcmp\tr0, #0xff\n\tbeq\t.L10\t@cond_branch\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n.L10:\n\tmov\tr0, #0x0\n\tb\t.L9\n.L3:\n\tldrb\tr0, [r3]\n\tldrb\tr4, [r1]\n\tcmp\tr0, r4\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r3]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L9:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCompareN,.Lfe1-StringCompareN\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 StringCompareN(u8 * a0, u8 * a1, u32 a2) {\n u8 * v0;\n u8 * v1;\n s32 v2;\n v0 = a0;\n v1 = a1;\n v2 = a2;\n while (*v0 == *v1) {\n if (*v0 != 255) {\n v0 = v0 + 1;\n v1 = v1 + 1;\n v2 = v2 - 1;\n if (v2 == 0) return 0;\n } else {\n return 0;\n }\n }\n return *v0 - *v1;\n}\n","score":0,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":19,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 StringCompareN(u8 *arg0, u8 *arg1, s32 arg2) {\n s32 var_r2;\n u8 *var_r1;\n u8 *var_r3;\n u8 temp_r0;\n\n var_r1 = arg1;\n var_r2 = arg2;\n var_r3 = arg0;\nloop_4:\n temp_r0 = *var_r3;\n if (temp_r0 != *var_r1) {\n return *var_r3 - *var_r1;\n }\n if ((temp_r0 == 0xFF) || (var_r3 += 1, var_r1 += 1, var_r2 -= 1, (var_r2 == 0))) {\n return 0;\n }\n goto loop_4;\n}\n","score":18,"maxScore":27,"compileErrors":null,"breakdown":{"insert":5,"delete":8,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":88,"lines":18,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StringCompareN` — benchmark function pokeemerald:StringCompareN:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompareN\n\t.type\t StringCompareN,function\n\t.thumb_func\nStringCompareN:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tb\t.L3\n.L5:\n\tcmp\tr0, #0xff\n\tbeq\t.L10\t@cond_branch\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n.L10:\n\tmov\tr0, #0x0\n\tb\t.L9\n.L3:\n\tldrb\tr0, [r3]\n\tldrb\tr4, [r1]\n\tcmp\tr0, r4\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r3]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L9:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCompareN,.Lfe1-StringCompareN\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringCompareN # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StringCompareN` — benchmark function pokeemerald:StringCompareN:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCompareN:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCompareN\n\t.type\t StringCompareN,function\n\t.thumb_func\nStringCompareN:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tb\t.L3\n.L5:\n\tcmp\tr0, #0xff\n\tbeq\t.L10\t@cond_branch\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, #0\n\tbne\t.L3\t@cond_branch\n.L10:\n\tmov\tr0, #0x0\n\tb\t.L9\n.L3:\n\tldrb\tr0, [r3]\n\tldrb\tr4, [r1]\n\tcmp\tr0, r4\n\tbeq\t.L5\t@cond_branch\n\tldrb\tr0, [r3]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n.L9:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCompareN,.Lfe1-StringCompareN\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCompareN # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StringCopy:agbcc","sym":"StringCopy","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","branch"],"loc":12,"refSource":"u8 *StringCopy(u8 *dest, const u8 *src)\n{\n while (*src != EOS)\n {\n *dest = *src;\n dest++;\n src++;\n }\n\n *dest = EOS;\n return dest;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L75-L86","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopy\n\t.type\t StringCopy,function\n\t.thumb_func\nStringCopy:\n\tadd\tr3, r0, #0\n\tb\t.L7\n.L5:\n\tstrb\tr2, [r3]\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr2, [r1]\n\tadd\tr0, r2, #0\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n\tstrb\tr0, [r3]\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCopy,.Lfe1-StringCopy\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"u8 * StringCopy(u8 * a0, u8 * a1) {\n u8 * v0;\n u8 * v1;\n v0 = a1;\n v1 = a0;\n while (*v0 != 255) {\n *v1 = *v0;\n v1 = v1 + 1;\n v0 = v0 + 1;\n }\n *v1 = 255;\n return v1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 *StringCopy(u8 *arg0, u8 *arg1) {\n u8 *var_r1;\n u8 *var_r3;\n u8 temp_r2;\n\n var_r1 = arg1;\n var_r3 = arg0;\nloop_2:\n temp_r2 = *var_r1;\n if (temp_r2 != 0xFF) {\n *var_r3 = temp_r2;\n var_r3 += 1;\n var_r1 += 1;\n goto loop_2;\n }\n *var_r3 = 0xFF;\n return var_r3;\n}\n","score":14,"maxScore":16,"compileErrors":null,"breakdown":{"insert":3,"delete":7,"replace":1,"opMismatch":1,"argMismatch":2},"quality":{"score":88,"lines":17,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StringCopy` — benchmark function pokeemerald:StringCopy:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopy\n\t.type\t StringCopy,function\n\t.thumb_func\nStringCopy:\n\tadd\tr3, r0, #0\n\tb\t.L7\n.L5:\n\tstrb\tr2, [r3]\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr2, [r1]\n\tadd\tr0, r2, #0\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n\tstrb\tr0, [r3]\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCopy,.Lfe1-StringCopy\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringCopy # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StringCopy` — benchmark function pokeemerald:StringCopy:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCopy:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopy\n\t.type\t StringCopy,function\n\t.thumb_func\nStringCopy:\n\tadd\tr3, r0, #0\n\tb\t.L7\n.L5:\n\tstrb\tr2, [r3]\n\tadd\tr3, r3, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr2, [r1]\n\tadd\tr0, r2, #0\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n\tstrb\tr0, [r3]\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringCopy,.Lfe1-StringCopy\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCopy # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StringCopyN:agbcc","sym":"StringCopyN","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","array"],"loc":9,"refSource":"u8 *StringCopyN(u8 *dest, const u8 *src, u8 n)\n{\n u16 i;\n\n for (i = 0; i < n; i++)\n dest[i] = src[i];\n\n return &dest[n];\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L96-L104","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopyN\n\t.type\t StringCopyN,function\n\t.thumb_func\nStringCopyN:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr3, #0x0\n\tadd\tr0, r5, #0\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tadd\tr1, r4, r3\n\tadd\tr0, r6, r3\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r2\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r4, r5\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCopyN,.Lfe1-StringCopyN\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 StringCopyN(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n if (0 < (u8)a2) {\n v0 = 0;\n do {\n *(u8 *)(a0 + v0) = *(u8 *)(a1 + v0);\n v0 = (u16)(v0 + 1);\n } while (v0 < (u8)a2);\n }\n return a0 + (u8)a2;\n}\n","score":15,"maxScore":27,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":2,"opMismatch":2,"argMismatch":5},"quality":{"score":84,"lines":11,"gotos":0,"casts":6,"unkGlue":0,"rawMem":2,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 StringCopyN(s32 arg0, s32 arg1, u8 arg2) {\n u16 var_r3;\n u8 temp_r5;\n\n temp_r5 = arg2;\n var_r3 = 0;\n if ((u32) temp_r5 > 0U) {\n do {\n *(arg0 + var_r3) = *(arg1 + var_r3);\n var_r3 += 1;\n } while ((u32) var_r3 < (u32) temp_r5);\n }\n return arg0 + temp_r5;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":98,"lines":13,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:3929: invalid type argument of `unary *'"]},"gapSize":{"decompiler":"asmlift","score":15,"maxScore":27,"ratio":0.5555555555555556,"kinds":{"insert":4,"delete":2,"replace":2,"opMismatch":2,"argMismatch":5}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StringCopyN` — benchmark function pokeemerald:StringCopyN:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopyN\n\t.type\t StringCopyN,function\n\t.thumb_func\nStringCopyN:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr3, #0x0\n\tadd\tr0, r5, #0\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tadd\tr1, r4, r3\n\tadd\tr0, r6, r3\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r2\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r4, r5\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCopyN,.Lfe1-StringCopyN\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringCopyN # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StringCopyN` — benchmark function pokeemerald:StringCopyN:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringCopyN:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringCopyN\n\t.type\t StringCopyN,function\n\t.thumb_func\nStringCopyN:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tr4, r0, #0\n\tadd\tr6, r1, #0\n\tlsl\tr2, r2, #0x18\n\tlsr\tr5, r2, #0x18\n\tmov\tr3, #0x0\n\tadd\tr0, r5, #0\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tadd\tr1, r4, r3\n\tadd\tr0, r6, r3\n\tldrb\tr0, [r0]\n\tstrb\tr0, [r1]\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tcmp\tr3, r2\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r4, r5\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t StringCopyN,.Lfe1-StringCopyN\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringCopyN # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:StringLength:agbcc","sym":"StringLength","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","array","branch"],"loc":9,"refSource":"u16 StringLength(const u8 *str)\n{\n u16 length = 0;\n\n while (str[length] != EOS)\n length++;\n\n return length;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/string_util.c#L114-L122","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringLength\n\t.type\t StringLength,function\n\t.thumb_func\nStringLength:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tadd\tr0, r2, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringLength,.Lfe1-StringLength\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 StringLength(u8 * a0) {\n s32 v0;\n for (v0 = 0; *(a0 + v0) != 255; v0 = (u16)(v0 + 1)) {\n }\n return v0;\n}\n","score":0,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u16 StringLength(u8 *arg0) {\n u16 var_r1;\n\n var_r1 = 0;\n if (*arg0 != 0xFF) {\n do {\n var_r1 += 1;\n } while (*(arg0 + var_r1) != 0xFF);\n }\n return var_r1;\n}\n","score":0,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":10,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `StringLength` — benchmark function pokeemerald:StringLength:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringLength\n\t.type\t StringLength,function\n\t.thumb_func\nStringLength:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tadd\tr0, r2, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringLength,.Lfe1-StringLength\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function StringLength # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `StringLength` — benchmark function pokeemerald:StringLength:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:StringLength:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tStringLength\n\t.type\t StringLength,function\n\t.thumb_func\nStringLength:\n\tadd\tr2, r0, #0\n\tmov\tr1, #0x0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr1, r0, #0x10\n\tadd\tr0, r2, r1\n\tldrb\tr0, [r0]\n\tcmp\tr0, #0xff\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t StringLength,.Lfe1-StringLength\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name StringLength # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"pokeemerald:TranslateBigMonSizeTableIndex:agbcc","sym":"TranslateBigMonSizeTableIndex","project":"pokeemerald","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","branch","array","struct","table"],"loc":11,"refSource":"static u8 TranslateBigMonSizeTableIndex(u16 a)\n{\n u8 i;\n\n for (i = 1; i < 15; i++)\n {\n if (a < sBigMonSizeTable[i].unk4)\n return i - 1;\n }\n return i;\n}","sourceUrl":"https://github.com/macabeus/pokeemerald/blob/25ffb2c12c069ac6b2040f9238b2978f1de72e3f/src/pokemon_size_record.c#L67-L77","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t2, 0\n\t.type\t sBigMonSizeTable,object\nsBigMonSizeTable:\n\t.short\t0x122\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0x0\n\t.space\t2\n\t.short\t0x12c\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xa\n\t.space\t2\n\t.short\t0x190\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0x6e\n\t.space\t2\n\t.short\t0x1f4\n\t.byte\t0x4\n\t.space\t1\n\t.short\t0x136\n\t.space\t2\n\t.short\t0x258\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0x2c6\n\t.space\t2\n\t.short\t0x2bc\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xa96\n\t.space\t2\n\t.short\t0x320\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0x1e1e\n\t.space\t2\n\t.short\t0x384\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x452e\n\t.space\t2\n\t.short\t0x3e8\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x7fc6\n\t.space\t2\n\t.short\t0x44c\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0xba5e\n\t.space\t2\n\t.short\t0x4b0\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xe16e\n\t.space\t2\n\t.short\t0x514\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0xf4f6\n\t.space\t2\n\t.short\t0x578\n\t.byte\t0x5\n\t.space\t1\n\t.short\t0xfcc6\n\t.space\t2\n\t.short\t0x5dc\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0xfeba\n\t.space\t2\n\t.short\t0x640\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xff82\n\t.space\t2\n\t.short\t0x6a4\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xffe6\n\t.space\t2\n\t.size\t sBigMonSizeTable,128\n.text\n\t.align\t2, 0\n\t.type\t TranslateBigMonSizeTableIndex,function\n\t.thumb_func\nTranslateBigMonSizeTableIndex:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tmov\tr1, #0x1\n\tldr\tr3, .L10\n.L6:\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x4]\n\tcmp\tr2, r0\n\tbcs\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tsBigMonSizeTable\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0xe\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r1, #0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t TranslateBigMonSizeTableIndex,.Lfe1-TranslateBigMonSizeTableIndex\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'TranslateBigMonSizeTableIndex' — lift: cannot lift 'TranslateBigMonSizeTableIndex': reads the sub-word data table 'sBigMonSizeTable' (.space) — sub-word table data is not modelled */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* \t.section .rodata */\n/* \t.align\t2, 0 */\n/* \t.type\t sBigMonSizeTable,object */\n/* sBigMonSizeTable: */\n/* \t.short\t0x122 */\n/* \t.byte\t0x1 */\n/* \t.space\t1 */\n/* \t.short\t0x0 */\n/* \t.space\t2 */\n/* \t.short\t0x12c */\n/* \t.byte\t0x1 */\n/* \t.space\t1 */\n/* \t.short\t0xa */\n/* \t.space\t2 */\n/* \t.short\t0x190 */\n/* \t.byte\t0x2 */\n/* \t.space\t1 */\n/* \t.short\t0x6e */\n/* \t.space\t2 */\n/* \t.short\t0x1f4 */\n/* \t.byte\t0x4 */\n/* \t.space\t1 */\n/* \t.short\t0x136 */\n/* \t.space\t2 */\n/* \t.short\t0x258 */\n/* \t.byte\t0x14 */\n/* \t.space\t1 */\n/* \t.short\t0x2c6 */\n/* \t.space\t2 */\n/* \t.short\t0x2bc */\n/* \t.byte\t0x32 */\n/* \t.space\t1 */\n/* \t.short\t0xa96 */\n/* \t.space\t2 */\n/* \t.short\t0x320 */\n/* \t.byte\t0x64 */\n/* \t.space\t1 */\n/* \t.short\t0x1e1e */\n/* \t.space\t2 */\n/* \t.short\t0x384 */\n/* \t.byte\t0x96 */\n/* \t.space\t1 */\n/* \t.short\t0x452e */\n/* \t.space\t2 */\n/* \t.short\t0x3e8 */\n/* \t.byte\t0x96 */\n/* \t.space\t1 */\n/* \t.short\t0x7fc6 */\n/* \t.space\t2 */\n/* \t.short\t0x44c */\n/* \t.byte\t0x64 */\n/* \t.space\t1 */\n/* \t.short\t0xba5e */\n/* \t.space\t2 */\n/* \t.short\t0x4b0 */\n/* \t.byte\t0x32 */\n/* \t.space\t1 */\n/* \t.short\t0xe16e */\n/* \t.space\t2 */\n/* \t.short\t0x514 */\n/* \t.byte\t0x14 */\n/* \t.space\t1 */\n/* \t.short\t0xf4f6 */\n/* \t.space\t2 */\n/* \t.short\t0x578 */\n/* \t.byte\t0x5 */\n/* \t.space\t1 */\n/* \t.short\t0xfcc6 */\n/* \t.space\t2 */\n/* \t.short\t0x5dc */\n/* \t.byte\t0x2 */\n/* \t.space\t1 */\n/* \t.short\t0xfeba */\n/* \t.space\t2 */\n/* \t.short\t0x640 */\n/* \t.byte\t0x1 */\n/* \t.space\t1 */\n/* \t.short\t0xff82 */\n/* \t.space\t2 */\n/* \t.short\t0x6a4 */\n/* \t.byte\t0x1 */\n/* \t.space\t1 */\n/* \t.short\t0xffe6 */\n/* \t.space\t2 */\n/* \t.size\t sBigMonSizeTable,128 */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.type\t TranslateBigMonSizeTableIndex,function */\n/* \t.thumb_func */\n/* TranslateBigMonSizeTableIndex: */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr2, r0, #0x10 */\n/* \tmov\tr1, #0x1 */\n/* \tldr\tr3, .L10 */\n/* .L6: */\n/* \tlsl\tr0, r1, #0x3 */\n/* \tadd\tr0, r0, r3 */\n/* \tldrh\tr0, [r0, #0x4] */\n/* \tcmp\tr2, r0 */\n/* \tbcs\t.L5\t@cond_branch */\n/* \tsub\tr0, r1, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tb\t.L9 */\n/* .L11: */\n/* \t.align\t2, 0 */\n/* .L10: */\n/* \t.word\tsBigMonSizeTable */\n/* .L5: */\n/* \tadd\tr0, r1, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr1, r0, #0x18 */\n/* \tcmp\tr1, #0xe */\n/* \tbls\t.L6\t@cond_branch */\n/* \tadd\tr0, r1, #0 */\n/* .L9: */\n/* \tbx\tlr */\n/* .Lfe1: */\n/* \t.size\t TranslateBigMonSizeTableIndex,.Lfe1-TranslateBigMonSizeTableIndex */\n/* .text */\n/* \t.align\t2, 0 */\nvoid TranslateBigMonSizeTableIndex(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'TranslateBigMonSizeTableIndex': reads the sub-word data table 'sBigMonSizeTable' (.space) — sub-word table data is not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":129,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'TranslateBigMonSizeTableIndex': reads the sub-word data table 'sBigMonSizeTable' (.space) — sub-word table data is not modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"struct _struct_sBigMonSizeTable_0x8 {\n /* 0x0 */ char pad0[4];\n /* 0x4 */ u16 unk4; /* inferred */\n /* 0x6 */ char pad6[2];\n}; /* size = 0x8 */\n\nstatic struct _struct_sBigMonSizeTable_0x8 sBigMonSizeTable[0x10]; /* unable to generate initializer: non-zero padding; const */\n\nu8 TranslateBigMonSizeTableIndex(u16 arg0) {\n u8 var_r1;\n\n var_r1 = 1;\nloop_1:\n if ((u32) arg0 < (u32) sBigMonSizeTable[var_r1].unk4) {\n return (u8) (var_r1 - 1);\n }\n var_r1 += 1;\n if ((u32) var_r1 > 0xEU) {\n return var_r1;\n }\n goto loop_1;\n}\n","score":19,"maxScore":30,"compileErrors":null,"breakdown":{"insert":8,"delete":9,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":86,"lines":19,"gotos":1,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":19,"maxScore":30,"ratio":0.6333333333333333,"kinds":{"insert":8,"delete":9,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `TranslateBigMonSizeTableIndex` — benchmark function pokeemerald:TranslateBigMonSizeTableIndex:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t2, 0\n\t.type\t sBigMonSizeTable,object\nsBigMonSizeTable:\n\t.short\t0x122\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0x0\n\t.space\t2\n\t.short\t0x12c\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xa\n\t.space\t2\n\t.short\t0x190\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0x6e\n\t.space\t2\n\t.short\t0x1f4\n\t.byte\t0x4\n\t.space\t1\n\t.short\t0x136\n\t.space\t2\n\t.short\t0x258\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0x2c6\n\t.space\t2\n\t.short\t0x2bc\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xa96\n\t.space\t2\n\t.short\t0x320\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0x1e1e\n\t.space\t2\n\t.short\t0x384\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x452e\n\t.space\t2\n\t.short\t0x3e8\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x7fc6\n\t.space\t2\n\t.short\t0x44c\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0xba5e\n\t.space\t2\n\t.short\t0x4b0\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xe16e\n\t.space\t2\n\t.short\t0x514\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0xf4f6\n\t.space\t2\n\t.short\t0x578\n\t.byte\t0x5\n\t.space\t1\n\t.short\t0xfcc6\n\t.space\t2\n\t.short\t0x5dc\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0xfeba\n\t.space\t2\n\t.short\t0x640\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xff82\n\t.space\t2\n\t.short\t0x6a4\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xffe6\n\t.space\t2\n\t.size\t sBigMonSizeTable,128\n.text\n\t.align\t2, 0\n\t.type\t TranslateBigMonSizeTableIndex,function\n\t.thumb_func\nTranslateBigMonSizeTableIndex:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tmov\tr1, #0x1\n\tldr\tr3, .L10\n.L6:\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x4]\n\tcmp\tr2, r0\n\tbcs\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tsBigMonSizeTable\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0xe\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r1, #0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t TranslateBigMonSizeTableIndex,.Lfe1-TranslateBigMonSizeTableIndex\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function TranslateBigMonSizeTableIndex # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `TranslateBigMonSizeTableIndex` — benchmark function pokeemerald:TranslateBigMonSizeTableIndex:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/pokeemerald.git pokeemerald\n# make -C pokeemerald\n# make -C pokeemerald asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/pokeemerald/symbols.json.gz\n# sha256 of the decompressed map JSON: d431614d5749f68cdd1197cf5797c48f8a17c67d6df30c45a39a140c8ba5b322\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/pokeemerald'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target pokeemerald:TranslateBigMonSizeTableIndex:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.align\t2, 0\n\t.type\t sBigMonSizeTable,object\nsBigMonSizeTable:\n\t.short\t0x122\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0x0\n\t.space\t2\n\t.short\t0x12c\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xa\n\t.space\t2\n\t.short\t0x190\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0x6e\n\t.space\t2\n\t.short\t0x1f4\n\t.byte\t0x4\n\t.space\t1\n\t.short\t0x136\n\t.space\t2\n\t.short\t0x258\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0x2c6\n\t.space\t2\n\t.short\t0x2bc\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xa96\n\t.space\t2\n\t.short\t0x320\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0x1e1e\n\t.space\t2\n\t.short\t0x384\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x452e\n\t.space\t2\n\t.short\t0x3e8\n\t.byte\t0x96\n\t.space\t1\n\t.short\t0x7fc6\n\t.space\t2\n\t.short\t0x44c\n\t.byte\t0x64\n\t.space\t1\n\t.short\t0xba5e\n\t.space\t2\n\t.short\t0x4b0\n\t.byte\t0x32\n\t.space\t1\n\t.short\t0xe16e\n\t.space\t2\n\t.short\t0x514\n\t.byte\t0x14\n\t.space\t1\n\t.short\t0xf4f6\n\t.space\t2\n\t.short\t0x578\n\t.byte\t0x5\n\t.space\t1\n\t.short\t0xfcc6\n\t.space\t2\n\t.short\t0x5dc\n\t.byte\t0x2\n\t.space\t1\n\t.short\t0xfeba\n\t.space\t2\n\t.short\t0x640\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xff82\n\t.space\t2\n\t.short\t0x6a4\n\t.byte\t0x1\n\t.space\t1\n\t.short\t0xffe6\n\t.space\t2\n\t.size\t sBigMonSizeTable,128\n.text\n\t.align\t2, 0\n\t.type\t TranslateBigMonSizeTableIndex,function\n\t.thumb_func\nTranslateBigMonSizeTableIndex:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tmov\tr1, #0x1\n\tldr\tr3, .L10\n.L6:\n\tlsl\tr0, r1, #0x3\n\tadd\tr0, r0, r3\n\tldrh\tr0, [r0, #0x4]\n\tcmp\tr2, r0\n\tbcs\t.L5\t@cond_branch\n\tsub\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tsBigMonSizeTable\n.L5:\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr1, r0, #0x18\n\tcmp\tr1, #0xe\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r1, #0\n.L9:\n\tbx\tlr\n.Lfe1:\n\t.size\t TranslateBigMonSizeTableIndex,.Lfe1-TranslateBigMonSizeTableIndex\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name TranslateBigMonSizeTableIndex # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:AbsMax:agbcc","sym":"AbsMax","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","branch","abs"],"loc":15,"refSource":"u32 AbsMax(s32 a, s32 b)\n{\n if (a < 0) {\n a = -a;\n }\n\n if (b < 0) {\n b = -b;\n }\n\n if (b < a) {\n return a;\n }\n return b;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L433-L447","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tAbsMax\n\t.type\t AbsMax,function\n\t.thumb_func\nAbsMax:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr2, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr2, r2\n.L3:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tneg\tr0, r0\n.L4:\n\tcmp\tr0, r2\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n.L6:\n\tbx\tlr\n.Lfe1:\n\t.size\t AbsMax,.Lfe1-AbsMax\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 AbsMax(s32 a0, s32 a1) {\n if (a0 < 0) a0 = -a0;\n if (a1 < 0) a1 = -a1;\n if (a1 < a0) a1 = a0;\n return a1;\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 AbsMax(s32 arg0, s32 arg1) {\n s32 var_r0;\n s32 var_r2;\n\n var_r2 = arg0;\n var_r0 = arg1;\n if (var_r2 < 0) {\n var_r2 = 0 - var_r2;\n }\n if (var_r0 < 0) {\n var_r0 = 0 - var_r0;\n }\n if (var_r0 < var_r2) {\n var_r0 = var_r2;\n }\n return var_r0;\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `AbsMax` — benchmark function sa3:AbsMax:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tAbsMax\n\t.type\t AbsMax,function\n\t.thumb_func\nAbsMax:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr2, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr2, r2\n.L3:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tneg\tr0, r0\n.L4:\n\tcmp\tr0, r2\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n.L6:\n\tbx\tlr\n.Lfe1:\n\t.size\t AbsMax,.Lfe1-AbsMax\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function AbsMax # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `AbsMax` — benchmark function sa3:AbsMax:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:AbsMax:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tAbsMax\n\t.type\t AbsMax,function\n\t.thumb_func\nAbsMax:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr2, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr2, r2\n.L3:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tneg\tr0, r0\n.L4:\n\tcmp\tr0, r2\n\tbge\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n.L6:\n\tbx\tlr\n.Lfe1:\n\t.size\t AbsMax,.Lfe1-AbsMax\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name AbsMax # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:Base10DigitsToHexNibbles:agbcc","sym":"Base10DigitsToHexNibbles","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","soft-div","bitwise","shift"],"loc":19,"refSource":"u32 Base10DigitsToHexNibbles(u16 num)\n{\n u8 i;\n u16 result;\n u8 lowDigit;\n u16 remainder = num;\n\n result = 0;\n for (i = 0; i < 4; i++) {\n s32 divisor = Div(remainder, 10);\n lowDigit = remainder - (divisor * 10);\n remainder = divisor;\n\n result |= lowDigit << (i * 4);\n }\n\n return result;\n}\n","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L147-L164","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tBase10DigitsToHexNibbles\n\t.type\t Base10DigitsToHexNibbles,function\n\t.thumb_func\nBase10DigitsToHexNibbles:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x0\n\tmov\tr5, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tmov\tr1, #0xa\n\tbl\tDiv\n\tlsl\tr1, r0, #0x2\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tsub\tr1, r4, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr0, r5, #0x2\n\tlsl\tr1, r1, r0\n\torr\tr6, r6, r1\n\tlsl\tr0, r6, #0x10\n\tlsr\tr6, r0, #0x10\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r6, #0\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Base10DigitsToHexNibbles,.Lfe1-Base10DigitsToHexNibbles\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 Base10DigitsToHexNibbles(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n v1 = (u16)a0;\n v3 = 0;\n v2 = 0;\n do {\n v0 = Div(v1, 10);\n v3 = (u16)(v3 | (u8)(v1 - v0 * 10) << (v2 << 2));\n v1 = (u16)v0;\n v2 = (u8)(v2 + 1);\n } while (v2 <= 3);\n return v3;\n}\n","score":9,"maxScore":32,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":1,"opMismatch":1,"argMismatch":3},"quality":{"score":94,"lines":16,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u16 Div(u16, s32); /* extern */\n\nu16 Base10DigitsToHexNibbles(u16 arg0) {\n u16 temp_r0;\n u16 var_r4;\n u16 var_r6;\n u8 temp_r1;\n u8 var_r5;\n\n var_r4 = arg0;\n var_r6 = 0;\n var_r5 = 0;\n do {\n temp_r0 = Div(var_r4, 0xA);\n temp_r1 = var_r4 - (temp_r0 * 0xA);\n var_r4 = temp_r0;\n var_r6 |= temp_r1 << (var_r5 * 4);\n var_r5 += 1;\n } while ((u32) var_r5 <= 3U);\n return var_r6;\n}\n","score":13,"maxScore":32,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":2,"opMismatch":0,"argMismatch":8},"quality":{"score":100,"lines":19,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"Div() resolves to an inline macro (int division) — soft-div idiom.","gapSize":{"decompiler":"asmlift","score":9,"maxScore":32,"ratio":0.28125,"kinds":{"insert":2,"delete":2,"replace":1,"opMismatch":1,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Base10DigitsToHexNibbles` — benchmark function sa3:Base10DigitsToHexNibbles:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tBase10DigitsToHexNibbles\n\t.type\t Base10DigitsToHexNibbles,function\n\t.thumb_func\nBase10DigitsToHexNibbles:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x0\n\tmov\tr5, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tmov\tr1, #0xa\n\tbl\tDiv\n\tlsl\tr1, r0, #0x2\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tsub\tr1, r4, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr0, r5, #0x2\n\tlsl\tr1, r1, r0\n\torr\tr6, r6, r1\n\tlsl\tr0, r6, #0x10\n\tlsr\tr6, r0, #0x10\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r6, #0\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Base10DigitsToHexNibbles,.Lfe1-Base10DigitsToHexNibbles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Base10DigitsToHexNibbles # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Base10DigitsToHexNibbles` — benchmark function sa3:Base10DigitsToHexNibbles:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:Base10DigitsToHexNibbles:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tBase10DigitsToHexNibbles\n\t.type\t Base10DigitsToHexNibbles,function\n\t.thumb_func\nBase10DigitsToHexNibbles:\n\tpush\t{r4, r5, r6, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x0\n\tmov\tr5, #0x0\n.L6:\n\tadd\tr0, r4, #0\n\tmov\tr1, #0xa\n\tbl\tDiv\n\tlsl\tr1, r0, #0x2\n\tadd\tr1, r1, r0\n\tlsl\tr1, r1, #0x1\n\tsub\tr1, r4, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr0, r5, #0x2\n\tlsl\tr1, r1, r0\n\torr\tr6, r6, r1\n\tlsl\tr0, r6, #0x10\n\tlsr\tr6, r0, #0x10\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr0, r6, #0\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t Base10DigitsToHexNibbles,.Lfe1-Base10DigitsToHexNibbles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Base10DigitsToHexNibbles # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:EwramFree:agbcc","sym":"EwramFree","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","pointer","loop","branch"],"loc":26,"refSource":"void EwramFree(void *p)\n{\n struct EwramNode *node, *slow, *fast, *tmp;\n\n if (p && ewram_end != p) {\n node = p - offsetof(struct EwramNode, space);\n\n for (fast = slow = (struct EwramNode *)gEwramHeap; node != fast; fast = fast->next)\n slow = fast;\n\n if (node->state < 0)\n node->state = -node->state;\n\n if ((void *)slow + slow->state == node && slow->state > 0) {\n slow->next = fast->next;\n slow->state += node->state;\n node = slow;\n }\n\n tmp = (void *)node + node->state;\n if (tmp == node->next && tmp->state > 0) {\n node->state += tmp->state;\n node->next = tmp->next;\n }\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L63-L97","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramFree\n\t.type\t EwramFree,function\n\t.thumb_func\nEwramFree:\n\tpush\t{r4, lr}\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L12\n\tldr\tr0, [r0]\n\tcmp\tr0, r1\n\tbeq\t.L3\t@cond_branch\n\tsub\tr1, r1, #0x8\n\tldr\tr3, .L12+0x4\n\tadd\tr4, r3, #0\n\tcmp\tr1, r3\n\tbeq\t.L5\t@cond_branch\n.L7:\n\tadd\tr3, r4, #0\n\tldr\tr4, [r3]\n\tcmp\tr1, r4\n\tbne\t.L7\t@cond_branch\n.L5:\n\tldr\tr0, [r1, #0x4]\n\tcmp\tr0, #0\n\tbge\t.L9\t@cond_branch\n\tneg\tr0, r0\n\tstr\tr0, [r1, #0x4]\n.L9:\n\tldr\tr2, [r3, #0x4]\n\tadd\tr0, r3, r2\n\tcmp\tr0, r1\n\tbne\t.L10\t@cond_branch\n\tcmp\tr2, #0\n\tble\t.L10\t@cond_branch\n\tldr\tr0, [r4]\n\tstr\tr0, [r3]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr0, r2, r0\n\tstr\tr0, [r3, #0x4]\n\tadd\tr1, r3, #0\n.L10:\n\tldr\tr3, [r1, #0x4]\n\tadd\tr2, r1, r3\n\tldr\tr0, [r1]\n\tcmp\tr2, r0\n\tbne\t.L3\t@cond_branch\n\tldr\tr0, [r2, #0x4]\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tadd\tr0, r3, r0\n\tstr\tr0, [r1, #0x4]\n\tldr\tr0, [r2]\n\tstr\tr0, [r1]\n.L3:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tewram_end\n\t.word\tgEwramHeap\n.Lfe1:\n\t.size\t EwramFree,.Lfe1-EwramFree\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz","proto":{"EwramFree":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'EwramFree' — structure: cannot structure 'EwramFree': loop condition or a post-loop value reads a pre-update loop variable */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tEwramFree */\n/* \t.type\t EwramFree,function */\n/* \t.thumb_func */\n/* EwramFree: */\n/* \tpush\t{r4, lr} */\n/* \tadd\tr1, r0, #0 */\n/* \tcmp\tr1, #0 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tldr\tr0, .L12 */\n/* \tldr\tr0, [r0] */\n/* \tcmp\tr0, r1 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tsub\tr1, r1, #0x8 */\n/* \tldr\tr3, .L12+0x4 */\n/* \tadd\tr4, r3, #0 */\n/* \tcmp\tr1, r3 */\n/* \tbeq\t.L5\t@cond_branch */\n/* .L7: */\n/* \tadd\tr3, r4, #0 */\n/* \tldr\tr4, [r3] */\n/* \tcmp\tr1, r4 */\n/* \tbne\t.L7\t@cond_branch */\n/* .L5: */\n/* \tldr\tr0, [r1, #0x4] */\n/* \tcmp\tr0, #0 */\n/* \tbge\t.L9\t@cond_branch */\n/* \tneg\tr0, r0 */\n/* \tstr\tr0, [r1, #0x4] */\n/* .L9: */\n/* \tldr\tr2, [r3, #0x4] */\n/* \tadd\tr0, r3, r2 */\n/* \tcmp\tr0, r1 */\n/* \tbne\t.L10\t@cond_branch */\n/* \tcmp\tr2, #0 */\n/* \tble\t.L10\t@cond_branch */\n/* \tldr\tr0, [r4] */\n/* \tstr\tr0, [r3] */\n/* \tldr\tr0, [r1, #0x4] */\n/* \tadd\tr0, r2, r0 */\n/* \tstr\tr0, [r3, #0x4] */\n/* \tadd\tr1, r3, #0 */\n/* .L10: */\n/* \tldr\tr3, [r1, #0x4] */\n/* \tadd\tr2, r1, r3 */\n/* \tldr\tr0, [r1] */\n/* \tcmp\tr2, r0 */\n/* \tbne\t.L3\t@cond_branch */\n/* \tldr\tr0, [r2, #0x4] */\n/* \tcmp\tr0, #0 */\n/* \tble\t.L3\t@cond_branch */\n/* \tadd\tr0, r3, r0 */\n/* \tstr\tr0, [r1, #0x4] */\n/* \tldr\tr0, [r2] */\n/* \tstr\tr0, [r1] */\n/* .L3: */\n/* \tpop\t{r4} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L13: */\n/* \t.align\t2, 0 */\n/* .L12: */\n/* \t.word\tewram_end */\n/* \t.word\tgEwramHeap */\n/* .Lfe1: */\n/* \t.size\t EwramFree,.Lfe1-EwramFree */\n/* .text */\n/* \t.align\t2, 0 */\nvoid EwramFree(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'EwramFree': loop condition or a post-loop value reads a pre-update loop variable\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":77,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'EwramFree': loop condition or a post-loop value reads a pre-update loop variable"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void EwramFree(void *p) {\n s32 temp_r0;\n s32 temp_r0_2;\n s32 temp_r2;\n s32 temp_r3;\n u8 *temp_r2_2;\n u8 *var_r1;\n u8 *var_r3;\n u8 *var_r4;\n\n if ((p != NULL) && (ewram_end != p)) {\n var_r1 = p - 8;\n var_r3 = gEwramHeap;\n var_r4 = gEwramHeap;\n if (var_r1 != gEwramHeap) {\n do {\n var_r3 = var_r4;\n var_r4 = *var_r3;\n } while (var_r1 != var_r4);\n }\n temp_r0 = var_r1->unk4;\n if (temp_r0 < 0) {\n var_r1->unk4 = (s32) (0 - temp_r0);\n }\n temp_r2 = var_r3->unk4;\n if ((&var_r3[temp_r2] == var_r1) && (temp_r2 > 0)) {\n var_r3->unk0 = (s32) *var_r4;\n var_r3->unk4 = (s32) (temp_r2 + var_r1->unk4);\n var_r1 = var_r3;\n }\n temp_r3 = var_r1->unk4;\n temp_r2_2 = &var_r1[temp_r3];\n if (temp_r2_2 == var_r1->unk0) {\n temp_r0_2 = temp_r2_2->unk4;\n if (temp_r0_2 > 0) {\n var_r1->unk4 = (s32) (temp_r3 + temp_r0_2);\n var_r1->unk0 = (s32) temp_r2_2->unk0;\n }\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":94,"lines":40,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:323: warning: assignment makes pointer from integer without a cast","/c.c:326: request for member `unk4' in something not a structure or union","/c.c:328: request for member `unk4' in something not a structure or union","/c.c:330: request for member `unk4' in something not a structure or union","/c.c:332: request for member `unk0' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `EwramFree` — benchmark function sa3:EwramFree:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramFree\n\t.type\t EwramFree,function\n\t.thumb_func\nEwramFree:\n\tpush\t{r4, lr}\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L12\n\tldr\tr0, [r0]\n\tcmp\tr0, r1\n\tbeq\t.L3\t@cond_branch\n\tsub\tr1, r1, #0x8\n\tldr\tr3, .L12+0x4\n\tadd\tr4, r3, #0\n\tcmp\tr1, r3\n\tbeq\t.L5\t@cond_branch\n.L7:\n\tadd\tr3, r4, #0\n\tldr\tr4, [r3]\n\tcmp\tr1, r4\n\tbne\t.L7\t@cond_branch\n.L5:\n\tldr\tr0, [r1, #0x4]\n\tcmp\tr0, #0\n\tbge\t.L9\t@cond_branch\n\tneg\tr0, r0\n\tstr\tr0, [r1, #0x4]\n.L9:\n\tldr\tr2, [r3, #0x4]\n\tadd\tr0, r3, r2\n\tcmp\tr0, r1\n\tbne\t.L10\t@cond_branch\n\tcmp\tr2, #0\n\tble\t.L10\t@cond_branch\n\tldr\tr0, [r4]\n\tstr\tr0, [r3]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr0, r2, r0\n\tstr\tr0, [r3, #0x4]\n\tadd\tr1, r3, #0\n.L10:\n\tldr\tr3, [r1, #0x4]\n\tadd\tr2, r1, r3\n\tldr\tr0, [r1]\n\tcmp\tr2, r0\n\tbne\t.L3\t@cond_branch\n\tldr\tr0, [r2, #0x4]\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tadd\tr0, r3, r0\n\tstr\tr0, [r1, #0x4]\n\tldr\tr0, [r2]\n\tstr\tr0, [r1]\n.L3:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tewram_end\n\t.word\tgEwramHeap\n.Lfe1:\n\t.size\t EwramFree,.Lfe1-EwramFree\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid EwramFree(void *p);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function EwramFree # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `EwramFree` — benchmark function sa3:EwramFree:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:EwramFree:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramFree\n\t.type\t EwramFree,function\n\t.thumb_func\nEwramFree:\n\tpush\t{r4, lr}\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, .L12\n\tldr\tr0, [r0]\n\tcmp\tr0, r1\n\tbeq\t.L3\t@cond_branch\n\tsub\tr1, r1, #0x8\n\tldr\tr3, .L12+0x4\n\tadd\tr4, r3, #0\n\tcmp\tr1, r3\n\tbeq\t.L5\t@cond_branch\n.L7:\n\tadd\tr3, r4, #0\n\tldr\tr4, [r3]\n\tcmp\tr1, r4\n\tbne\t.L7\t@cond_branch\n.L5:\n\tldr\tr0, [r1, #0x4]\n\tcmp\tr0, #0\n\tbge\t.L9\t@cond_branch\n\tneg\tr0, r0\n\tstr\tr0, [r1, #0x4]\n.L9:\n\tldr\tr2, [r3, #0x4]\n\tadd\tr0, r3, r2\n\tcmp\tr0, r1\n\tbne\t.L10\t@cond_branch\n\tcmp\tr2, #0\n\tble\t.L10\t@cond_branch\n\tldr\tr0, [r4]\n\tstr\tr0, [r3]\n\tldr\tr0, [r1, #0x4]\n\tadd\tr0, r2, r0\n\tstr\tr0, [r3, #0x4]\n\tadd\tr1, r3, #0\n.L10:\n\tldr\tr3, [r1, #0x4]\n\tadd\tr2, r1, r3\n\tldr\tr0, [r1]\n\tcmp\tr2, r0\n\tbne\t.L3\t@cond_branch\n\tldr\tr0, [r2, #0x4]\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tadd\tr0, r3, r0\n\tstr\tr0, [r1, #0x4]\n\tldr\tr0, [r2]\n\tstr\tr0, [r1]\n.L3:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tewram_end\n\t.word\tgEwramHeap\n.Lfe1:\n\t.size\t EwramFree,.Lfe1-EwramFree\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"EwramFree\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EwramFree # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:EwramInitHeap:agbcc","sym":"EwramInitHeap","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","global","pointer"],"loc":6,"refSource":"void EwramInitHeap(void)\n{\n struct EwramNode *root = (struct EwramNode *)&gEwramHeap[0];\n root->next = NULL;\n root->state = sizeof(gEwramHeap);\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L7-L12","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramInitHeap\n\t.type\t EwramInitHeap,function\n\t.thumb_func\nEwramInitHeap:\n\tldr\tr0, .L3\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tldr\tr1, .L3+0x4\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgEwramHeap\n\t.word\t0x20080\n.Lfe1:\n\t.size\t EwramInitHeap,.Lfe1-EwramInitHeap\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz","proto":{"EwramInitHeap":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gEwramHeap","shape":"u8[]"}],"outcome":"match","source":"void EwramInitHeap(void) {\n s32 * p0;\n p0 = (s32 *)&gEwramHeap;\n *p0 = 0;\n p0[1] = 131200;\n return;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void EwramInitHeap(void) {\n gEwramHeap->unk0 = 0;\n gEwramHeap->unk4 = 0x20080;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:307: request for member `unk0' in something not a structure or union","/c.c:308: request for member `unk4' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `EwramInitHeap` — benchmark function sa3:EwramInitHeap:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramInitHeap\n\t.type\t EwramInitHeap,function\n\t.thumb_func\nEwramInitHeap:\n\tldr\tr0, .L3\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tldr\tr1, .L3+0x4\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgEwramHeap\n\t.word\t0x20080\n.Lfe1:\n\t.size\t EwramInitHeap,.Lfe1-EwramInitHeap\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid EwramInitHeap(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function EwramInitHeap # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `EwramInitHeap` — benchmark function sa3:EwramInitHeap:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:EwramInitHeap:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramInitHeap\n\t.type\t EwramInitHeap,function\n\t.thumb_func\nEwramInitHeap:\n\tldr\tr0, .L3\n\tmov\tr1, #0x0\n\tstr\tr1, [r0]\n\tldr\tr1, .L3+0x4\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgEwramHeap\n\t.word\t0x20080\n.Lfe1:\n\t.size\t EwramInitHeap,.Lfe1-EwramInitHeap\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"EwramInitHeap\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EwramInitHeap # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:EwramMalloc:agbcc","sym":"EwramMalloc","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","struct","field","pointer","branch"],"loc":37,"refSource":"void *EwramMalloc(u32 req)\n{\n struct EwramNode *node;\n s32 requestedSpace = req;\n\n requestedSpace = (req + 3) / 4;\n if (requestedSpace != 0) {\n requestedSpace = requestedSpace * 4 + sizeof(struct EwramNode);\n node = (struct EwramNode *)gEwramHeap;\n while (1) {\n if (requestedSpace <= (u32)node->state) {\n if (requestedSpace == node->state) {\n node->state = -requestedSpace;\n return node->space;\n }\n\n if (requestedSpace + (s32)sizeof(struct EwramNode) <= node->state) {\n struct EwramNode *addr = (void *)node + requestedSpace;\n\n addr->next = node->next;\n ++node;\n --node;\n addr->state = node->state - requestedSpace;\n node->next = addr;\n node->state = -requestedSpace;\n return node->space;\n }\n }\n ++requestedSpace;\n --requestedSpace;\n if (!node->next)\n return ewram_end;\n node = node->next;\n }\n }\n return ewram_end;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_ewram.c#L14-L61","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramMalloc\n\t.type\t EwramMalloc,function\n\t.thumb_func\nEwramMalloc:\n\tadd\tr2, r0, #0\n\tadd\tr0, r2, #0x3\n\tlsr\tr2, r0, #0x2\n\tcmp\tr2, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r2, #0x2\n\tadd\tr2, r0, #0\n\tadd\tr2, r2, #0x8\n\tldr\tr3, .L14\n.L6:\n\tldr\tr1, [r3, #0x4]\n\tcmp\tr2, r1\n\tbhi\t.L7\t@cond_branch\n\tcmp\tr2, r1\n\tbne\t.L8\t@cond_branch\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgEwramHeap\n.L8:\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tcmp\tr0, r1\n\tbgt\t.L7\t@cond_branch\n\tadd\tr1, r3, r2\n\tldr\tr0, [r3]\n\tstr\tr0, [r1]\n\tldr\tr0, [r3, #0x4]\n\tsub\tr0, r0, r2\n\tstr\tr0, [r1, #0x4]\n\tstr\tr1, [r3]\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L7:\n\tldr\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr3, r0, #0\n\tb\t.L6\n.L3:\n\tldr\tr0, .L16\n\tldr\tr0, [r0]\n.L13:\n\tbx\tlr\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tewram_end\n.Lfe1:\n\t.size\t EwramMalloc,.Lfe1-EwramMalloc\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'EwramMalloc' — structure: cannot structure 'EwramMalloc': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tEwramMalloc */\n/* \t.type\t EwramMalloc,function */\n/* \t.thumb_func */\n/* EwramMalloc: */\n/* \tadd\tr2, r0, #0 */\n/* \tadd\tr0, r2, #0x3 */\n/* \tlsr\tr2, r0, #0x2 */\n/* \tcmp\tr2, #0 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tlsl\tr0, r2, #0x2 */\n/* \tadd\tr2, r0, #0 */\n/* \tadd\tr2, r2, #0x8 */\n/* \tldr\tr3, .L14 */\n/* .L6: */\n/* \tldr\tr1, [r3, #0x4] */\n/* \tcmp\tr2, r1 */\n/* \tbhi\t.L7\t@cond_branch */\n/* \tcmp\tr2, r1 */\n/* \tbne\t.L8\t@cond_branch */\n/* \tneg\tr0, r2 */\n/* \tstr\tr0, [r3, #0x4] */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x8 */\n/* \tb\t.L13 */\n/* .L15: */\n/* \t.align\t2, 0 */\n/* .L14: */\n/* \t.word\tgEwramHeap */\n/* .L8: */\n/* \tadd\tr0, r2, #0 */\n/* \tadd\tr0, r0, #0x8 */\n/* \tcmp\tr0, r1 */\n/* \tbgt\t.L7\t@cond_branch */\n/* \tadd\tr1, r3, r2 */\n/* \tldr\tr0, [r3] */\n/* \tstr\tr0, [r1] */\n/* \tldr\tr0, [r3, #0x4] */\n/* \tsub\tr0, r0, r2 */\n/* \tstr\tr0, [r1, #0x4] */\n/* \tstr\tr1, [r3] */\n/* \tneg\tr0, r2 */\n/* \tstr\tr0, [r3, #0x4] */\n/* \tadd\tr0, r3, #0 */\n/* \tadd\tr0, r0, #0x8 */\n/* \tb\t.L13 */\n/* .L7: */\n/* \tldr\tr0, [r3] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L3\t@cond_branch */\n/* \tadd\tr3, r0, #0 */\n/* \tb\t.L6 */\n/* .L3: */\n/* \tldr\tr0, .L16 */\n/* \tldr\tr0, [r0] */\n/* .L13: */\n/* \tbx\tlr */\n/* .L17: */\n/* \t.align\t2, 0 */\n/* .L16: */\n/* \t.word\tewram_end */\n/* .Lfe1: */\n/* \t.size\t EwramMalloc,.Lfe1-EwramMalloc */\n/* .text */\n/* \t.align\t2, 0 */\nvoid EwramMalloc(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'EwramMalloc': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":74,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'EwramMalloc': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *EwramMalloc(u32 req) {\n u32 temp_r1;\n u32 temp_r2;\n u32 temp_r2_2;\n u8 *temp_r0;\n u8 *temp_r1_2;\n u8 *var_r3;\n\n temp_r2 = (u32) (req + 3) >> 2;\n if (temp_r2 != 0) {\n temp_r2_2 = (temp_r2 * 4) + 8;\n var_r3 = gEwramHeap;\nloop_2:\n temp_r1 = var_r3->unk4;\n if (temp_r2_2 <= temp_r1) {\n if (temp_r2_2 == temp_r1) {\n var_r3->unk4 = (u32) (0 - temp_r2_2);\n return &var_r3[8];\n }\n if ((s32) (temp_r2_2 + 8) <= (s32) temp_r1) {\n temp_r1_2 = var_r3 + temp_r2_2;\n temp_r1_2->unk0 = (u8 *) var_r3->unk0;\n temp_r1_2->unk4 = (s32) (var_r3->unk4 - temp_r2_2);\n var_r3->unk0 = temp_r1_2;\n var_r3->unk4 = (u32) (0 - temp_r2_2);\n return &var_r3[8];\n }\n goto block_7;\n }\nblock_7:\n temp_r0 = var_r3->unk0;\n if (temp_r0 != NULL) {\n var_r3 = temp_r0;\n goto loop_2;\n }\n goto block_9;\n }\nblock_9:\n return ewram_end;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":54,"lines":39,"gotos":3,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:319: request for member `unk4' in something not a structure or union","/c.c:322: request for member `unk4' in something not a structure or union","/c.c:327: request for member `unk0' in something not a structure or union","/c.c:328: request for member `unk4' in something not a structure or union","/c.c:329: request for member `unk0' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `EwramMalloc` — benchmark function sa3:EwramMalloc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramMalloc\n\t.type\t EwramMalloc,function\n\t.thumb_func\nEwramMalloc:\n\tadd\tr2, r0, #0\n\tadd\tr0, r2, #0x3\n\tlsr\tr2, r0, #0x2\n\tcmp\tr2, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r2, #0x2\n\tadd\tr2, r0, #0\n\tadd\tr2, r2, #0x8\n\tldr\tr3, .L14\n.L6:\n\tldr\tr1, [r3, #0x4]\n\tcmp\tr2, r1\n\tbhi\t.L7\t@cond_branch\n\tcmp\tr2, r1\n\tbne\t.L8\t@cond_branch\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgEwramHeap\n.L8:\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tcmp\tr0, r1\n\tbgt\t.L7\t@cond_branch\n\tadd\tr1, r3, r2\n\tldr\tr0, [r3]\n\tstr\tr0, [r1]\n\tldr\tr0, [r3, #0x4]\n\tsub\tr0, r0, r2\n\tstr\tr0, [r1, #0x4]\n\tstr\tr1, [r3]\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L7:\n\tldr\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr3, r0, #0\n\tb\t.L6\n.L3:\n\tldr\tr0, .L16\n\tldr\tr0, [r0]\n.L13:\n\tbx\tlr\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tewram_end\n.Lfe1:\n\t.size\t EwramMalloc,.Lfe1-EwramMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-bef3af60bae2.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *EwramMalloc(u32 req);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function EwramMalloc # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `EwramMalloc` — benchmark function sa3:EwramMalloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:EwramMalloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tEwramMalloc\n\t.type\t EwramMalloc,function\n\t.thumb_func\nEwramMalloc:\n\tadd\tr2, r0, #0\n\tadd\tr0, r2, #0x3\n\tlsr\tr2, r0, #0x2\n\tcmp\tr2, #0\n\tbeq\t.L3\t@cond_branch\n\tlsl\tr0, r2, #0x2\n\tadd\tr2, r0, #0\n\tadd\tr2, r2, #0x8\n\tldr\tr3, .L14\n.L6:\n\tldr\tr1, [r3, #0x4]\n\tcmp\tr2, r1\n\tbhi\t.L7\t@cond_branch\n\tcmp\tr2, r1\n\tbne\t.L8\t@cond_branch\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L15:\n\t.align\t2, 0\n.L14:\n\t.word\tgEwramHeap\n.L8:\n\tadd\tr0, r2, #0\n\tadd\tr0, r0, #0x8\n\tcmp\tr0, r1\n\tbgt\t.L7\t@cond_branch\n\tadd\tr1, r3, r2\n\tldr\tr0, [r3]\n\tstr\tr0, [r1]\n\tldr\tr0, [r3, #0x4]\n\tsub\tr0, r0, r2\n\tstr\tr0, [r1, #0x4]\n\tstr\tr1, [r3]\n\tneg\tr0, r2\n\tstr\tr0, [r3, #0x4]\n\tadd\tr0, r3, #0\n\tadd\tr0, r0, #0x8\n\tb\t.L13\n.L7:\n\tldr\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr3, r0, #0\n\tb\t.L6\n.L3:\n\tldr\tr0, .L16\n\tldr\tr0, [r0]\n.L13:\n\tbx\tlr\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tewram_end\n.Lfe1:\n\t.size\t EwramMalloc,.Lfe1-EwramMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name EwramMalloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:GetInput:agbcc","sym":"GetInput","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","bitwise","array","branch","global","shift"],"loc":50,"refSource":"void GetInput(void)\n{\n s8 i;\n u8 *repeatKeyCounters = gRepeatedKeysTestCounter, *firstIntervals = gKeysFirstRepeatIntervals,\n *continuedHoldIntervals = gKeysContinuedRepeatIntervals;\n\n gInput = (~REG_KEYINPUT & KEYS_MASK);\n\n // My guess is that whilst the input recorder\n // is running we still want to know the actual\n // input. For example; to be able to know when\n // to exit the demo\n gPhysicalInput = gInput;\n\n#ifndef COLLECT_RINGS_ROM\n if (gInputRecorder.mode == RECORDER_RECORD) {\n InputRecorderWrite(gInput);\n } else if (gInputRecorder.mode == RECORDER_PLAYBACK) {\n gInput = InputRecorderRead();\n }\n#endif\n\n gPressedKeys = (gInput ^ gPrevInput) & gInput;\n gReleasedKeys = (gInput ^ gPrevInput) & gPrevInput;\n gPrevInput = gInput;\n\n // Repeated keys will be the currently pressed keys\n gRepeatedKeys = gPressedKeys;\n\n // Calculate the next repeated state for every key\n for (i = 0; i < 10; i++) {\n if (!GetBit(gInput, i)) {\n // If a key is not pressed, reset its counter\n // to the settings for that key's\n // first repeat interval\n repeatKeyCounters[i] = firstIntervals[i];\n } else if (repeatKeyCounters[i] > 0) {\n // If the key is not yet ready to be repeated\n // continue to wait\n repeatKeyCounters[i]--;\n } else {\n // If the key is ready to be repeated,\n // add the key to the repeated keys\n gRepeatedKeys |= 1 << i;\n // And reset its counter to the settings\n // for continued hold interval\n repeatKeyCounters[i] = continuedHoldIntervals[i];\n }\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/core.c#L971-L1020","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetInput\n\t.type\t GetInput,function\n\t.thumb_func\nGetInput:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tldr\tr7, .L16\n\tldr\tr0, .L16+0x4\n\tmov\tr9, r0\n\tldr\tr1, .L16+0x8\n\tmov\tr8, r1\n\tldr\tr4, .L16+0xc\n\tldr\tr0, .L16+0x10\n\tldrh\tr1, [r0]\n\tldr\tr2, .L16+0x14\n\tadd\tr0, r2, #0\n\tbic\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tldr\tr1, .L16+0x18\n\tstrh\tr0, [r1]\n\tldr\tr0, .L16+0x1c\n\tldrb\tr0, [r0, #0x8]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldrh\tr0, [r4]\n\tbl\tInputRecorderWrite\n\tb\t.L4\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgRepeatedKeysTestCounter\n\t.word\tgKeysFirstRepeatIntervals\n\t.word\tgKeysContinuedRepeatIntervals\n\t.word\tgInput\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgPhysicalInput\n\t.word\tgInputRecorder\n.L3:\n\tcmp\tr0, #0x2\n\tbne\t.L4\t@cond_branch\n\tbl\tInputRecorderRead\n\tstrh\tr0, [r4]\n.L4:\n\tldr\tr2, .L18\n\tldr\tr6, .L18+0x4\n\tldr\tr5, .L18+0x8\n\tldrh\tr3, [r6]\n\tldrh\tr4, [r5]\n\tadd\tr0, r3, #0\n\teor\tr0, r0, r4\n\tadd\tr1, r0, #0\n\tand\tr1, r1, r3\n\tstrh\tr1, [r2]\n\tldr\tr2, .L18+0xc\n\tand\tr0, r0, r4\n\tstrh\tr0, [r2]\n\tstrh\tr3, [r5]\n\tldr\tr0, .L18+0x10\n\tstrh\tr1, [r0]\n\tmov\tr1, #0x0\n\tmov\tip, r6\n\tmov\tr6, #0x1\n\tadd\tr5, r0, #0\n.L9:\n\tmov\tr3, ip\n\tldrh\tr0, [r3]\n\tlsl\tr1, r1, #0x18\n\tasr\tr2, r1, #0x18\n\tasr\tr0, r0, r2\n\tand\tr0, r0, r6\n\tadd\tr4, r1, #0\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tadd\tr0, r7, r2\n\tmov\tr3, r9\n\tadd\tr1, r3, r2\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r0]\n\tb\t.L8\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgPressedKeys\n\t.word\tgInput\n\t.word\tgPrevInput\n\t.word\tgReleasedKeys\n\t.word\tgRepeatedKeys\n.L10:\n\tadd\tr3, r7, r2\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tb\t.L15\n.L12:\n\tadd\tr0, r6, #0\n\tlsl\tr0, r0, r2\n\tldrh\tr1, [r5]\n\torr\tr0, r0, r1\n\tstrh\tr0, [r5]\n\tmov\tr1, r8\n\tadd\tr0, r1, r2\n\tldrb\tr0, [r0]\n.L15:\n\tstrb\tr0, [r3]\n.L8:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x11\n\tadd\tr0, r4, r2\n\tlsr\tr1, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tcmp\tr0, #0x9\n\tble\t.L9\t@cond_branch\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t GetInput,.Lfe1-GetInput\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-9580348e8bae.i.gz","proto":{"GetInput":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'GetInput' — structure: cannot structure 'GetInput': do-while condition or a post-loop value reads a pre-update loop variable */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tGetInput */\n/* \t.type\t GetInput,function */\n/* \t.thumb_func */\n/* GetInput: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, r9 */\n/* \tmov\tr6, r8 */\n/* \tpush\t{r6, r7} */\n/* \tldr\tr7, .L16 */\n/* \tldr\tr0, .L16+0x4 */\n/* \tmov\tr9, r0 */\n/* \tldr\tr1, .L16+0x8 */\n/* \tmov\tr8, r1 */\n/* \tldr\tr4, .L16+0xc */\n/* \tldr\tr0, .L16+0x10 */\n/* \tldrh\tr1, [r0] */\n/* \tldr\tr2, .L16+0x14 */\n/* \tadd\tr0, r2, #0 */\n/* \tbic\tr0, r0, r1 */\n/* \tstrh\tr0, [r4] */\n/* \tldr\tr1, .L16+0x18 */\n/* \tstrh\tr0, [r1] */\n/* \tldr\tr0, .L16+0x1c */\n/* \tldrb\tr0, [r0, #0x8] */\n/* \tcmp\tr0, #0x1 */\n/* \tbne\t.L3\t@cond_branch */\n/* \tldrh\tr0, [r4] */\n/* \tbl\tInputRecorderWrite */\n/* \tb\t.L4 */\n/* .L17: */\n/* \t.align\t2, 0 */\n/* .L16: */\n/* \t.word\tgRepeatedKeysTestCounter */\n/* \t.word\tgKeysFirstRepeatIntervals */\n/* \t.word\tgKeysContinuedRepeatIntervals */\n/* \t.word\tgInput */\n/* \t.word\t0x4000130 */\n/* \t.word\t0x3ff */\n/* \t.word\tgPhysicalInput */\n/* \t.word\tgInputRecorder */\n/* .L3: */\n/* \tcmp\tr0, #0x2 */\n/* \tbne\t.L4\t@cond_branch */\n/* \tbl\tInputRecorderRead */\n/* \tstrh\tr0, [r4] */\n/* .L4: */\n/* \tldr\tr2, .L18 */\n/* \tldr\tr6, .L18+0x4 */\n/* \tldr\tr5, .L18+0x8 */\n/* \tldrh\tr3, [r6] */\n/* \tldrh\tr4, [r5] */\n/* \tadd\tr0, r3, #0 */\n/* \teor\tr0, r0, r4 */\n/* \tadd\tr1, r0, #0 */\n/* \tand\tr1, r1, r3 */\n/* \tstrh\tr1, [r2] */\n/* \tldr\tr2, .L18+0xc */\n/* \tand\tr0, r0, r4 */\n/* \tstrh\tr0, [r2] */\n/* \tstrh\tr3, [r5] */\n/* \tldr\tr0, .L18+0x10 */\n/* \tstrh\tr1, [r0] */\n/* \tmov\tr1, #0x0 */\n/* \tmov\tip, r6 */\n/* \tmov\tr6, #0x1 */\n/* \tadd\tr5, r0, #0 */\n/* .L9: */\n/* \tmov\tr3, ip */\n/* \tldrh\tr0, [r3] */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tasr\tr2, r1, #0x18 */\n/* \tasr\tr0, r0, r2 */\n/* \tand\tr0, r0, r6 */\n/* \tadd\tr4, r1, #0 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L10\t@cond_branch */\n/* \tadd\tr0, r7, r2 */\n/* \tmov\tr3, r9 */\n/* \tadd\tr1, r3, r2 */\n/* \tldrb\tr1, [r1] */\n/* \tstrb\tr1, [r0] */\n/* \tb\t.L8 */\n/* .L19: */\n/* \t.align\t2, 0 */\n/* .L18: */\n/* \t.word\tgPressedKeys */\n/* \t.word\tgInput */\n/* \t.word\tgPrevInput */\n/* \t.word\tgReleasedKeys */\n/* \t.word\tgRepeatedKeys */\n/* .L10: */\n/* \tadd\tr3, r7, r2 */\n/* \tldrb\tr0, [r3] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L12\t@cond_branch */\n/* \tsub\tr0, r0, #0x1 */\n/* \tb\t.L15 */\n/* .L12: */\n/* \tadd\tr0, r6, #0 */\n/* \tlsl\tr0, r0, r2 */\n/* \tldrh\tr1, [r5] */\n/* \torr\tr0, r0, r1 */\n/* \tstrh\tr0, [r5] */\n/* \tmov\tr1, r8 */\n/* \tadd\tr0, r1, r2 */\n/* \tldrb\tr0, [r0] */\n/* .L15: */\n/* \tstrb\tr0, [r3] */\n/* .L8: */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x11 */\n/* \tadd\tr0, r4, r2 */\n/* \tlsr\tr1, r0, #0x18 */\n/* \tasr\tr0, r0, #0x18 */\n/* \tcmp\tr0, #0x9 */\n/* \tble\t.L9\t@cond_branch */\n/* \tpop\t{r3, r4} */\n/* \tmov\tr8, r3 */\n/* \tmov\tr9, r4 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .Lfe1: */\n/* \t.size\t GetInput,.Lfe1-GetInput */\n/* .text */\n/* \t.align\t2, 0 */\nvoid GetInput(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'GetInput': do-while condition or a post-loop value reads a pre-update loop variable\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":136,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'GetInput': do-while condition or a post-loop value reads a pre-update loop variable"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void GetInput(void) {\n s32 temp_r0_2;\n s32 temp_r4;\n s8 temp_r2;\n s8 var_r1;\n u16 temp_r0;\n u16 temp_r1;\n u32 temp_r0_3;\n u8 *temp_r3;\n u8 temp_r0_4;\n u8 var_r0;\n\n temp_r0 = 0x3FF & ~*(u16 *)0x04000130;\n gInput = temp_r0;\n gPhysicalInput = temp_r0;\n if (gInputRecorder.mode == 1) {\n InputRecorderWrite(gInput);\n } else if (gInputRecorder.mode == 2) {\n gInput = InputRecorderRead();\n }\n temp_r0_2 = gInput ^ gPrevInput;\n temp_r1 = temp_r0_2 & gInput;\n gPressedKeys = temp_r1;\n gReleasedKeys = temp_r0_2 & gPrevInput;\n gPrevInput = gInput;\n gRepeatedKeys = temp_r1;\n var_r1 = 0;\n do {\n temp_r2 = var_r1;\n temp_r4 = var_r1 << 0x18;\n if (!(((s32) gInput >> temp_r2) & 1)) {\n gRepeatedKeysTestCounter[temp_r2] = gKeysFirstRepeatIntervals[temp_r2];\n } else {\n temp_r3 = &gRepeatedKeysTestCounter[temp_r2];\n temp_r0_4 = *temp_r3;\n if (temp_r0_4 != 0) {\n var_r0 = temp_r0_4 - 1;\n } else {\n gRepeatedKeys |= 1 << temp_r2;\n var_r0 = gKeysContinuedRepeatIntervals[temp_r2];\n }\n *temp_r3 = var_r0;\n }\n temp_r0_3 = temp_r4 + 0x01000000;\n var_r1 = (s8) (temp_r0_3 >> 0x18);\n } while ((s32) ((s32) temp_r0_3 >> 0x18) <= 9);\n}\n","score":70,"maxScore":117,"compileErrors":null,"breakdown":{"insert":12,"delete":18,"replace":2,"opMismatch":1,"argMismatch":37},"quality":{"score":92,"lines":46,"gotos":0,"casts":6,"unkGlue":0,"rawMem":0,"addrDeref":1}},"gapSize":{"decompiler":"m2c","score":70,"maxScore":117,"ratio":0.5982905982905983,"kinds":{"insert":12,"delete":18,"replace":2,"opMismatch":1,"argMismatch":37}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GetInput` — benchmark function sa3:GetInput:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetInput\n\t.type\t GetInput,function\n\t.thumb_func\nGetInput:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tldr\tr7, .L16\n\tldr\tr0, .L16+0x4\n\tmov\tr9, r0\n\tldr\tr1, .L16+0x8\n\tmov\tr8, r1\n\tldr\tr4, .L16+0xc\n\tldr\tr0, .L16+0x10\n\tldrh\tr1, [r0]\n\tldr\tr2, .L16+0x14\n\tadd\tr0, r2, #0\n\tbic\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tldr\tr1, .L16+0x18\n\tstrh\tr0, [r1]\n\tldr\tr0, .L16+0x1c\n\tldrb\tr0, [r0, #0x8]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldrh\tr0, [r4]\n\tbl\tInputRecorderWrite\n\tb\t.L4\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgRepeatedKeysTestCounter\n\t.word\tgKeysFirstRepeatIntervals\n\t.word\tgKeysContinuedRepeatIntervals\n\t.word\tgInput\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgPhysicalInput\n\t.word\tgInputRecorder\n.L3:\n\tcmp\tr0, #0x2\n\tbne\t.L4\t@cond_branch\n\tbl\tInputRecorderRead\n\tstrh\tr0, [r4]\n.L4:\n\tldr\tr2, .L18\n\tldr\tr6, .L18+0x4\n\tldr\tr5, .L18+0x8\n\tldrh\tr3, [r6]\n\tldrh\tr4, [r5]\n\tadd\tr0, r3, #0\n\teor\tr0, r0, r4\n\tadd\tr1, r0, #0\n\tand\tr1, r1, r3\n\tstrh\tr1, [r2]\n\tldr\tr2, .L18+0xc\n\tand\tr0, r0, r4\n\tstrh\tr0, [r2]\n\tstrh\tr3, [r5]\n\tldr\tr0, .L18+0x10\n\tstrh\tr1, [r0]\n\tmov\tr1, #0x0\n\tmov\tip, r6\n\tmov\tr6, #0x1\n\tadd\tr5, r0, #0\n.L9:\n\tmov\tr3, ip\n\tldrh\tr0, [r3]\n\tlsl\tr1, r1, #0x18\n\tasr\tr2, r1, #0x18\n\tasr\tr0, r0, r2\n\tand\tr0, r0, r6\n\tadd\tr4, r1, #0\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tadd\tr0, r7, r2\n\tmov\tr3, r9\n\tadd\tr1, r3, r2\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r0]\n\tb\t.L8\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgPressedKeys\n\t.word\tgInput\n\t.word\tgPrevInput\n\t.word\tgReleasedKeys\n\t.word\tgRepeatedKeys\n.L10:\n\tadd\tr3, r7, r2\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tb\t.L15\n.L12:\n\tadd\tr0, r6, #0\n\tlsl\tr0, r0, r2\n\tldrh\tr1, [r5]\n\torr\tr0, r0, r1\n\tstrh\tr0, [r5]\n\tmov\tr1, r8\n\tadd\tr0, r1, r2\n\tldrb\tr0, [r0]\n.L15:\n\tstrb\tr0, [r3]\n.L8:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x11\n\tadd\tr0, r4, r2\n\tlsr\tr1, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tcmp\tr0, #0x9\n\tble\t.L9\t@cond_branch\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t GetInput,.Lfe1-GetInput\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-9580348e8bae.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid GetInput(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GetInput # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GetInput` — benchmark function sa3:GetInput:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:GetInput:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetInput\n\t.type\t GetInput,function\n\t.thumb_func\nGetInput:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tldr\tr7, .L16\n\tldr\tr0, .L16+0x4\n\tmov\tr9, r0\n\tldr\tr1, .L16+0x8\n\tmov\tr8, r1\n\tldr\tr4, .L16+0xc\n\tldr\tr0, .L16+0x10\n\tldrh\tr1, [r0]\n\tldr\tr2, .L16+0x14\n\tadd\tr0, r2, #0\n\tbic\tr0, r0, r1\n\tstrh\tr0, [r4]\n\tldr\tr1, .L16+0x18\n\tstrh\tr0, [r1]\n\tldr\tr0, .L16+0x1c\n\tldrb\tr0, [r0, #0x8]\n\tcmp\tr0, #0x1\n\tbne\t.L3\t@cond_branch\n\tldrh\tr0, [r4]\n\tbl\tInputRecorderWrite\n\tb\t.L4\n.L17:\n\t.align\t2, 0\n.L16:\n\t.word\tgRepeatedKeysTestCounter\n\t.word\tgKeysFirstRepeatIntervals\n\t.word\tgKeysContinuedRepeatIntervals\n\t.word\tgInput\n\t.word\t0x4000130\n\t.word\t0x3ff\n\t.word\tgPhysicalInput\n\t.word\tgInputRecorder\n.L3:\n\tcmp\tr0, #0x2\n\tbne\t.L4\t@cond_branch\n\tbl\tInputRecorderRead\n\tstrh\tr0, [r4]\n.L4:\n\tldr\tr2, .L18\n\tldr\tr6, .L18+0x4\n\tldr\tr5, .L18+0x8\n\tldrh\tr3, [r6]\n\tldrh\tr4, [r5]\n\tadd\tr0, r3, #0\n\teor\tr0, r0, r4\n\tadd\tr1, r0, #0\n\tand\tr1, r1, r3\n\tstrh\tr1, [r2]\n\tldr\tr2, .L18+0xc\n\tand\tr0, r0, r4\n\tstrh\tr0, [r2]\n\tstrh\tr3, [r5]\n\tldr\tr0, .L18+0x10\n\tstrh\tr1, [r0]\n\tmov\tr1, #0x0\n\tmov\tip, r6\n\tmov\tr6, #0x1\n\tadd\tr5, r0, #0\n.L9:\n\tmov\tr3, ip\n\tldrh\tr0, [r3]\n\tlsl\tr1, r1, #0x18\n\tasr\tr2, r1, #0x18\n\tasr\tr0, r0, r2\n\tand\tr0, r0, r6\n\tadd\tr4, r1, #0\n\tcmp\tr0, #0\n\tbne\t.L10\t@cond_branch\n\tadd\tr0, r7, r2\n\tmov\tr3, r9\n\tadd\tr1, r3, r2\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r0]\n\tb\t.L8\n.L19:\n\t.align\t2, 0\n.L18:\n\t.word\tgPressedKeys\n\t.word\tgInput\n\t.word\tgPrevInput\n\t.word\tgReleasedKeys\n\t.word\tgRepeatedKeys\n.L10:\n\tadd\tr3, r7, r2\n\tldrb\tr0, [r3]\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tsub\tr0, r0, #0x1\n\tb\t.L15\n.L12:\n\tadd\tr0, r6, #0\n\tlsl\tr0, r0, r2\n\tldrh\tr1, [r5]\n\torr\tr0, r0, r1\n\tstrh\tr0, [r5]\n\tmov\tr1, r8\n\tadd\tr0, r1, r2\n\tldrb\tr0, [r0]\n.L15:\n\tstrb\tr0, [r3]\n.L8:\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x11\n\tadd\tr0, r4, r2\n\tlsr\tr1, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tcmp\tr0, #0x9\n\tble\t.L9\t@cond_branch\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t GetInput,.Lfe1-GetInput\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GetInput\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetInput # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:GetSaveSectorChecksum:agbcc","sym":"GetSaveSectorChecksum","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","cast","sizeof","struct"],"loc":15,"refSource":"u32 GetSaveSectorChecksum(SaveSectorData *sector)\n{\n u8 *ptr = (u8 *)sector;\n\n u32 checkSum = 0;\n u32 i = 0;\n\n u32 size = (sizeof(SaveSectorData) - sizeof(sector->checksum));\n\n for (; i < size; i += sizeof(u32)) {\n checkSum += *((u32 *)(ptr + i));\n }\n\n return checkSum;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/code_0_0.c#L1036-L1050","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetSaveSectorChecksum\n\t.type\t GetSaveSectorChecksum,function\n\t.thumb_func\nGetSaveSectorChecksum:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr4, #0xda\n\tlsl\tr4, r4, #0x2\n.L6:\n\tadd\tr0, r3, r1\n\tldr\tr0, [r0]\n\tadd\tr2, r2, r0\n\tadd\tr1, r1, #0x4\n\tcmp\tr1, r4\n\tbcc\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GetSaveSectorChecksum,.Lfe1-GetSaveSectorChecksum\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 GetSaveSectorChecksum(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n v2 = 0;\n v1 = 0;\n do {\n v0 = *(s32 *)(a0 + v1);\n v2 = v2 + v0;\n v1 = v1 + 4;\n } while (v1 < 218 << 2);\n return v2;\n}\n","score":5,"maxScore":18,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":1,"opMismatch":1,"argMismatch":0},"quality":{"score":96,"lines":13,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 GetSaveSectorChecksum(s32 arg0) {\n s32 var_r2;\n u32 var_r1;\n\n var_r2 = 0;\n var_r1 = 0;\n do {\n var_r2 += *(arg0 + var_r1);\n var_r1 += 4;\n } while (var_r1 < 0x368U);\n return var_r2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:964: invalid type argument of `unary *'"]},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":18,"ratio":0.2777777777777778,"kinds":{"insert":2,"delete":1,"replace":1,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GetSaveSectorChecksum` — benchmark function sa3:GetSaveSectorChecksum:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetSaveSectorChecksum\n\t.type\t GetSaveSectorChecksum,function\n\t.thumb_func\nGetSaveSectorChecksum:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr4, #0xda\n\tlsl\tr4, r4, #0x2\n.L6:\n\tadd\tr0, r3, r1\n\tldr\tr0, [r0]\n\tadd\tr2, r2, r0\n\tadd\tr1, r1, #0x4\n\tcmp\tr1, r4\n\tbcc\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GetSaveSectorChecksum,.Lfe1-GetSaveSectorChecksum\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GetSaveSectorChecksum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GetSaveSectorChecksum` — benchmark function sa3:GetSaveSectorChecksum:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:GetSaveSectorChecksum:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tGetSaveSectorChecksum\n\t.type\t GetSaveSectorChecksum,function\n\t.thumb_func\nGetSaveSectorChecksum:\n\tpush\t{r4, lr}\n\tadd\tr3, r0, #0\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tmov\tr4, #0xda\n\tlsl\tr4, r4, #0x2\n.L6:\n\tadd\tr0, r3, r1\n\tldr\tr0, [r0]\n\tadd\tr2, r2, r0\n\tadd\tr1, r1, #0x4\n\tcmp\tr1, r4\n\tbcc\t.L6\t@cond_branch\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t GetSaveSectorChecksum,.Lfe1-GetSaveSectorChecksum\n\t.comm\tgUnknown_03001150, 1136\t@ 1136\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GetSaveSectorChecksum # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:numToASCII:agbcc","sym":"numToASCII","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","array","bitwise","branch","shift"],"loc":15,"refSource":"void numToASCII(u8 digits[5], u16 number)\n{\n u8 i;\n\n for (i = 0; i < 4; number <<= 4, i++) {\n u16 value = ((number & 0xF000) >> 12);\n if (value > 9) {\n digits[i] = value + 87;\n } else {\n digits[i] = value + '0';\n }\n }\n\n digits[i] = 0;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L127-L141","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnumToASCII\n\t.type\t numToASCII,function\n\t.thumb_func\nnumToASCII:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tmov\tr2, #0x0\n\tmov\tr5, #0xf0\n\tlsl\tr5, r5, #0x8\n.L6:\n\tadd\tr0, r3, #0\n\tand\tr0, r0, r5\n\tlsr\tr0, r0, #0xc\n\tcmp\tr0, #0x9\n\tbls\t.L7\t@cond_branch\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x57\n\tb\t.L10\n.L7:\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x30\n.L10:\n\tstrb\tr0, [r1]\n\tlsl\tr0, r3, #0x14\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr1, r4, r2\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t numToASCII,.Lfe1-numToASCII\n\n.text\n\t.align\t2, 0\n","proto":{"numToASCII":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void numToASCII(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n u8 * v2;\n s32 v3;\n v0 = (u16)a1;\n v1 = 0;\n do {\n if ((u32)(v0 & 240 << 8) >> 12 <= 9) {\n v2 = (u8 *)(a0 + v1);\n v3 = ((u32)(v0 & 240 << 8) >> 12) + 48;\n } else {\n v2 = (u8 *)(a0 + v1);\n v3 = ((u32)(v0 & 240 << 8) >> 12) + 87;\n }\n *v2 = v3;\n v0 = (u32)(v0 << 20) >> 16;\n v1 = (u8)(v1 + 1);\n } while (v1 <= 3);\n *(u8 *)(a0 + v1) = 0;\n return;\n}\n","score":12,"maxScore":31,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":2,"argMismatch":10},"quality":{"score":84,"lines":22,"gotos":0,"casts":9,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void numToASCII(s32 arg0, u16 arg1) {\n s8 *var_r1;\n s8 var_r0;\n u16 var_r3;\n u32 temp_r0;\n u8 var_r2;\n\n var_r3 = arg1;\n var_r2 = 0;\n do {\n temp_r0 = (u32) (var_r3 & 0xF000) >> 0xC;\n if (temp_r0 > 9U) {\n var_r1 = arg0 + var_r2;\n var_r0 = temp_r0 + 0x57;\n } else {\n var_r1 = arg0 + var_r2;\n var_r0 = temp_r0 + 0x30;\n }\n *var_r1 = var_r0;\n var_r3 *= 0x10;\n var_r2 += 1;\n } while ((u32) var_r2 <= 3U);\n *(arg0 + var_r2) = 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":23,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:319: warning: assignment makes pointer from integer without a cast","/c.c:322: warning: assignment makes pointer from integer without a cast","/c.c:329: invalid type argument of `unary *'"]},"gapSize":{"decompiler":"asmlift","score":12,"maxScore":31,"ratio":0.3870967741935484,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":2,"argMismatch":10}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `numToASCII` — benchmark function sa3:numToASCII:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnumToASCII\n\t.type\t numToASCII,function\n\t.thumb_func\nnumToASCII:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tmov\tr2, #0x0\n\tmov\tr5, #0xf0\n\tlsl\tr5, r5, #0x8\n.L6:\n\tadd\tr0, r3, #0\n\tand\tr0, r0, r5\n\tlsr\tr0, r0, #0xc\n\tcmp\tr0, #0x9\n\tbls\t.L7\t@cond_branch\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x57\n\tb\t.L10\n.L7:\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x30\n.L10:\n\tstrb\tr0, [r1]\n\tlsl\tr0, r3, #0x14\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr1, r4, r2\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t numToASCII,.Lfe1-numToASCII\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function numToASCII # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `numToASCII` — benchmark function sa3:numToASCII:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:numToASCII:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnumToASCII\n\t.type\t numToASCII,function\n\t.thumb_func\nnumToASCII:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tmov\tr2, #0x0\n\tmov\tr5, #0xf0\n\tlsl\tr5, r5, #0x8\n.L6:\n\tadd\tr0, r3, #0\n\tand\tr0, r0, r5\n\tlsr\tr0, r0, #0xc\n\tcmp\tr0, #0x9\n\tbls\t.L7\t@cond_branch\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x57\n\tb\t.L10\n.L7:\n\tadd\tr1, r4, r2\n\tadd\tr0, r0, #0x30\n.L10:\n\tstrb\tr0, [r1]\n\tlsl\tr0, r3, #0x14\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr2, r0, #0x18\n\tcmp\tr2, #0x3\n\tbls\t.L6\t@cond_branch\n\tadd\tr1, r4, r2\n\tmov\tr0, #0x0\n\tstrb\tr0, [r1]\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t numToASCII,.Lfe1-numToASCII\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"numToASCII\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name numToASCII # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:OamMalloc:agbcc","sym":"OamMalloc","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["branch","global","array","struct","field"],"loc":27,"refSource":"OamData *OamMalloc(u8 order)\n{\n OamData *result;\n\n if (order > 31) {\n order = 31;\n }\n\n if (gOamFreeIndex > OAM_ENTRY_COUNT - 1) {\n result = (OamData *)iwram_end;\n } else {\n if (gOamMallocOrders_StartIndex[order] == 0xFF) {\n gOamMallocBuffer[gOamFreeIndex].split.fractional = 0xFF;\n gOamMallocOrders_StartIndex[order] = gOamFreeIndex;\n gOamMallocOrders_EndIndex[order] = gOamFreeIndex;\n } else {\n gOamMallocBuffer[gOamFreeIndex].split.fractional = 0xFF;\n gOamMallocBuffer[gOamMallocOrders_EndIndex[order]].split.fractional = gOamFreeIndex;\n gOamMallocOrders_EndIndex[order] = gOamFreeIndex;\n }\n\n gOamFreeIndex++;\n result = &gOamMallocBuffer[gOamFreeIndex - 1];\n }\n\n return result;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L931-L957","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tOamMalloc\n\t.type\t OamMalloc,function\n\t.thumb_func\nOamMalloc:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1f\n\tbls\t.L3\t@cond_branch\n\tmov\tr5, #0x1f\n.L3:\n\tldr\tr0, .L8\n\tmov\tr1, #0x0\n\tldrsb\tr1, [r0, r1]\n\tadd\tr4, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L4\t@cond_branch\n\tldr\tr0, .L8+0x4\n\tldr\tr0, [r0]\n\tb\t.L5\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgOamFreeIndex\n\t.word\tiwram_end\n.L4:\n\tldr\tr0, .L10\n\tadd\tr2, r5, r0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tldr\tr1, .L10+0x4\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L10+0x8\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0]\n\tb\t.L7\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n.L6:\n\tldr\tr3, .L12\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldr\tr2, .L12+0x4\n\tadd\tr2, r5, r2\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n.L7:\n\tldrb\tr0, [r4]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4]\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tldr\tr1, .L12+0x8\n\tadd\tr0, r0, r1\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n\t.word\tgOamMallocBuffer+-0x8\n.Lfe1:\n\t.size\t OamMalloc,.Lfe1-OamMalloc\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-9580348e8bae.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'OamMalloc' — lift: cannot lift 'OamMalloc': literal-pool load of pool word 'gOamMallocBuffer+-0x8' is a symbol offset or code label — not modelled */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tOamMalloc */\n/* \t.type\t OamMalloc,function */\n/* \t.thumb_func */\n/* OamMalloc: */\n/* \tpush\t{r4, r5, lr} */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tcmp\tr5, #0x1f */\n/* \tbls\t.L3\t@cond_branch */\n/* \tmov\tr5, #0x1f */\n/* .L3: */\n/* \tldr\tr0, .L8 */\n/* \tmov\tr1, #0x0 */\n/* \tldrsb\tr1, [r0, r1] */\n/* \tadd\tr4, r0, #0 */\n/* \tcmp\tr1, #0 */\n/* \tbge\t.L4\t@cond_branch */\n/* \tldr\tr0, .L8+0x4 */\n/* \tldr\tr0, [r0] */\n/* \tb\t.L5 */\n/* .L9: */\n/* \t.align\t2, 0 */\n/* .L8: */\n/* \t.word\tgOamFreeIndex */\n/* \t.word\tiwram_end */\n/* .L4: */\n/* \tldr\tr0, .L10 */\n/* \tadd\tr2, r5, r0 */\n/* \tldrb\tr0, [r2] */\n/* \tcmp\tr0, #0xff */\n/* \tbne\t.L6\t@cond_branch */\n/* \tldr\tr1, .L10+0x4 */\n/* \tldrb\tr0, [r4] */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tadd\tr0, r0, r1 */\n/* \tmov\tr1, #0xff */\n/* \tstrb\tr1, [r0, #0x6] */\n/* \tldrb\tr0, [r4] */\n/* \tstrb\tr0, [r2] */\n/* \tldr\tr0, .L10+0x8 */\n/* \tadd\tr0, r5, r0 */\n/* \tldrb\tr1, [r4] */\n/* \tstrb\tr1, [r0] */\n/* \tb\t.L7 */\n/* .L11: */\n/* \t.align\t2, 0 */\n/* .L10: */\n/* \t.word\tgOamMallocOrders_StartIndex */\n/* \t.word\tgOamMallocBuffer */\n/* \t.word\tgOamMallocOrders_EndIndex */\n/* .L6: */\n/* \tldr\tr3, .L12 */\n/* \tldrb\tr0, [r4] */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tadd\tr0, r0, r3 */\n/* \tmov\tr1, #0xff */\n/* \tstrb\tr1, [r0, #0x6] */\n/* \tldr\tr2, .L12+0x4 */\n/* \tadd\tr2, r5, r2 */\n/* \tldrb\tr0, [r2] */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tadd\tr0, r0, r3 */\n/* \tldrb\tr1, [r4] */\n/* \tstrb\tr1, [r0, #0x6] */\n/* \tldrb\tr0, [r4] */\n/* \tstrb\tr0, [r2] */\n/* .L7: */\n/* \tldrb\tr0, [r4] */\n/* \tadd\tr0, r0, #0x1 */\n/* \tstrb\tr0, [r4] */\n/* \tldrb\tr0, [r4] */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tldr\tr1, .L12+0x8 */\n/* \tadd\tr0, r0, r1 */\n/* .L5: */\n/* \tpop\t{r4, r5} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .L13: */\n/* \t.align\t2, 0 */\n/* .L12: */\n/* \t.word\tgOamMallocBuffer */\n/* \t.word\tgOamMallocOrders_EndIndex */\n/* \t.word\tgOamMallocBuffer+-0x8 */\n/* .Lfe1: */\n/* \t.size\t OamMalloc,.Lfe1-OamMalloc */\n/* .text */\n/* \t.align\t2, 0 */\nvoid OamMalloc(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'OamMalloc': literal-pool load of pool word 'gOamMallocBuffer+-0x8' is a symbol offset or code label — not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":98,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'OamMalloc': literal-pool load of pool word 'gOamMallocBuffer+-0x8' is a symbol offset or code label — not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"OamData *OamMalloc(u8 order) {\n u8 *temp_r2;\n u8 *temp_r2_2;\n u8 var_r5;\n\n var_r5 = order;\n if ((u32) var_r5 > 0x1FU) {\n var_r5 = 0x1F;\n }\n if ((s32) (s8) gOamFreeIndex < 0) {\n return (OamData *) iwram_end;\n }\n temp_r2 = &gOamMallocOrders_StartIndex[var_r5];\n if (*temp_r2 == 0xFF) {\n gOamMallocBuffer[gOamFreeIndex].unk6 = 0xFF;\n *temp_r2 = gOamFreeIndex;\n gOamMallocOrders_EndIndex[var_r5] = gOamFreeIndex;\n } else {\n gOamMallocBuffer[gOamFreeIndex].unk6 = 0xFF;\n temp_r2_2 = &gOamMallocOrders_EndIndex[var_r5];\n gOamMallocBuffer[*temp_r2_2].unk6 = (u8) gOamFreeIndex;\n *temp_r2_2 = gOamFreeIndex;\n }\n gOamFreeIndex += 1;\n return &(gOamMallocBuffer - 8)[gOamFreeIndex];\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":96,"lines":25,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:931: union has no member named `unk6'","/c.c:935: union has no member named `unk6'","/c.c:937: union has no member named `unk6'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `OamMalloc` — benchmark function sa3:OamMalloc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tOamMalloc\n\t.type\t OamMalloc,function\n\t.thumb_func\nOamMalloc:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1f\n\tbls\t.L3\t@cond_branch\n\tmov\tr5, #0x1f\n.L3:\n\tldr\tr0, .L8\n\tmov\tr1, #0x0\n\tldrsb\tr1, [r0, r1]\n\tadd\tr4, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L4\t@cond_branch\n\tldr\tr0, .L8+0x4\n\tldr\tr0, [r0]\n\tb\t.L5\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgOamFreeIndex\n\t.word\tiwram_end\n.L4:\n\tldr\tr0, .L10\n\tadd\tr2, r5, r0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tldr\tr1, .L10+0x4\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L10+0x8\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0]\n\tb\t.L7\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n.L6:\n\tldr\tr3, .L12\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldr\tr2, .L12+0x4\n\tadd\tr2, r5, r2\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n.L7:\n\tldrb\tr0, [r4]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4]\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tldr\tr1, .L12+0x8\n\tadd\tr0, r0, r1\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n\t.word\tgOamMallocBuffer+-0x8\n.Lfe1:\n\t.size\t OamMalloc,.Lfe1-OamMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-9580348e8bae.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nOamData *OamMalloc(u8 order);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function OamMalloc # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `OamMalloc` — benchmark function sa3:OamMalloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:OamMalloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tOamMalloc\n\t.type\t OamMalloc,function\n\t.thumb_func\nOamMalloc:\n\tpush\t{r4, r5, lr}\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0x1f\n\tbls\t.L3\t@cond_branch\n\tmov\tr5, #0x1f\n.L3:\n\tldr\tr0, .L8\n\tmov\tr1, #0x0\n\tldrsb\tr1, [r0, r1]\n\tadd\tr4, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L4\t@cond_branch\n\tldr\tr0, .L8+0x4\n\tldr\tr0, [r0]\n\tb\t.L5\n.L9:\n\t.align\t2, 0\n.L8:\n\t.word\tgOamFreeIndex\n\t.word\tiwram_end\n.L4:\n\tldr\tr0, .L10\n\tadd\tr2, r5, r0\n\tldrb\tr0, [r2]\n\tcmp\tr0, #0xff\n\tbne\t.L6\t@cond_branch\n\tldr\tr1, .L10+0x4\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n\tldr\tr0, .L10+0x8\n\tadd\tr0, r5, r0\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0]\n\tb\t.L7\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n.L6:\n\tldr\tr3, .L12\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tmov\tr1, #0xff\n\tstrb\tr1, [r0, #0x6]\n\tldr\tr2, .L12+0x4\n\tadd\tr2, r5, r2\n\tldrb\tr0, [r2]\n\tlsl\tr0, r0, #0x3\n\tadd\tr0, r0, r3\n\tldrb\tr1, [r4]\n\tstrb\tr1, [r0, #0x6]\n\tldrb\tr0, [r4]\n\tstrb\tr0, [r2]\n.L7:\n\tldrb\tr0, [r4]\n\tadd\tr0, r0, #0x1\n\tstrb\tr0, [r4]\n\tldrb\tr0, [r4]\n\tlsl\tr0, r0, #0x3\n\tldr\tr1, .L12+0x8\n\tadd\tr0, r0, r1\n.L5:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\tgOamMallocBuffer\n\t.word\tgOamMallocOrders_EndIndex\n\t.word\tgOamMallocBuffer+-0x8\n.Lfe1:\n\t.size\t OamMalloc,.Lfe1-OamMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name OamMalloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:ProcessOamBuffers:agbcc","sym":"ProcessOamBuffers","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","struct","loop","dma","call"],"loc":71,"refSource":"void ProcessOamBuffers(void)\n{\n OamData *dstOam = &gOamBuffer[0];\n u8 i = 0;\n s32 r3;\n\n for (r3 = 0; r3 < 32; r3++) {\n s8 index = gOamMallocOrders_StartIndex[r3];\n\n while (index != -1) {\n u8 newI;\n u8 *byteArray = gOamMallocCopiedOrder;\n DmaCopy16(3, &gOamMallocBuffer[index], dstOam, sizeof(OamDataShort));\n dstOam++;\n\n byteArray += index;\n newI = i++;\n *byteArray = newI;\n index = gOamMallocBuffer[index].split.fractional;\n };\n }\n\n if (gFlags & FLAGS_800) {\n r3 = gOamFreeIndex;\n dstOam = &gOamBuffer[r3];\n\n while (r3 < gOamFirstPausedIndex) {\n DmaFill16(3, 0x200, dstOam, sizeof(OamDataShort));\n dstOam++;\n r3++;\n }\n } else if (gFlags & FLAGS_PAUSE_GAME) {\n /* Push all active OAM entries to te end of OAM temporarily while\n * the game is paused */\n s32 k, l;\n r3 = gOamFreeIndex - 1;\n dstOam = &gOamBuffer[r3];\n\n for (k = l = 0; r3 >= 0;) {\n s32 size = sizeof(OamDataShort);\n DmaCopy16(3, dstOam - k, &gOamBuffer[OAM_ENTRY_COUNT - 1 - l], size);\n k++, r3--, l++;\n }\n\n // _08005A5E\n\n gOamFirstPausedIndex = OAM_ENTRY_COUNT - gOamFreeIndex;\n\n for (r3 = 0; r3 < gOamFirstPausedIndex; r3++) {\n DmaFill16(3, 0x200, &gOamBuffer[r3], sizeof(OamDataShort));\n#ifndef NON_MATCHING\n // unlike when using --, using ++ changes the condition to something entirely\n // different unless we tell the compiler that we want to use r3's values\n // (without actually doing so)\n asm(\"\" ::\"r\"(r3));\n#endif\n }\n\n } else {\n gOamFirstPausedIndex = 0;\n }\n\n gOamFreeIndex = 0;\n if (gFlags & FLAGS_4000) {\n CpuFill32(-1, gOamMallocOrders_StartIndex, sizeof(gOamMallocOrders_StartIndex));\n CpuFill32(-1, gOamMallocOrders_EndIndex, sizeof(gOamMallocOrders_EndIndex));\n } else {\n DmaFill32(3, -1, gOamMallocOrders_StartIndex, sizeof(gOamMallocOrders_StartIndex));\n DmaFill32(3, -1, gOamMallocOrders_EndIndex, sizeof(gOamMallocOrders_EndIndex));\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L959-L1029","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessOamBuffers\n\t.type\t ProcessOamBuffers,function\n\t.thumb_func\nProcessOamBuffers:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x10\n\tldr\tr5, .L32\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tmov\tr3, #0x0\n\tldr\tr1, .L32+0x4\n\tmov\tsl, r1\n\tmov\tr2, sp\n\tadd\tr2, r2, #0x8\n\tstr\tr2, [sp, #0xc]\n.L6:\n\tldr\tr1, .L32+0x8\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tadd\tr6, r3, #0x1\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbeq\t.L5\t@cond_branch\n\tldr\tr4, .L32+0xc\n\tmov\tr8, r1\n\tldr\tr0, .L32+0x10\n\tmov\tip, r0\n\tldr\tr7, .L32+0x14\n.L9:\n\tasr\tr2, r2, #0x18\n\tlsl\tr3, r2, #0x3\n\tadd\tr3, r3, r7\n\tstr\tr3, [r4]\n\tstr\tr5, [r4, #0x4]\n\tldr\tr0, .L32+0x18\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr2, r2, ip\n\tmov\tr1, r9\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tstrb\tr1, [r2]\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tcmp\tr0, r8\n\tbne\t.L9\t@cond_branch\n.L5:\n\tadd\tr3, r6, #0\n\tcmp\tr3, #0x1f\n\tble\t.L6\t@cond_branch\n\tldr\tr2, .L32+0x1c\n\tldr\tr1, [r2]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L32+0x20\n\tldrb\tr3, [r0]\n\tlsl\tr0, r3, #0x3\n\tldr\tr1, .L32\n\tadd\tr5, r0, r1\n\tmov\tr2, sl\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr4, sp\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tadd\tr7, r1, #0\n\tldr\tr1, .L32+0xc\n\tldr\tr6, .L32+0x24\n.L15:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr5, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr3, r3, #0x1\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tblt\t.L15\t@cond_branch\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgOamBuffer\n\t.word\tgOamFirstPausedIndex\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t0x40000d4\n\t.word\tgOamMallocCopiedOrder\n\t.word\tgOamMallocBuffer\n\t.word\t-0x7ffffffd\n\t.word\tgFlags\n\t.word\tgOamFreeIndex\n\t.word\t-0x7efffffd\n.L12:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr1, .L34\n\tldrb\tr0, [r1]\n\tsub\tr3, r0, #0x1\n\tlsl\tr0, r3, #0x3\n\tldr\tr2, .L34+0x4\n\tadd\tr5, r0, r2\n\tcmp\tr3, #0\n\tblt\t.L20\t@cond_branch\n\tldr\tr2, .L34+0x8\n\tldr\tr6, .L34+0xc\n\tldr\tr0, .L34+0x4\n\tmov\tr1, #0xfe\n\tlsl\tr1, r1, #0x2\n\tadd\tr4, r0, r1\n\tadd\tr1, r5, #0\n.L22:\n\tstr\tr1, [r2]\n\tstr\tr4, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr1, r1, #0x8\n\tsub\tr3, r3, #0x1\n\tsub\tr4, r4, #0x8\n\tcmp\tr3, #0\n\tbge\t.L22\t@cond_branch\n.L20:\n\tldr\tr2, .L34\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x80\n\tsub\tr0, r0, r1\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n\tmov\tr3, #0x0\n\tldrb\tr0, [r1]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr5, sp\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr7, r2, #0\n\tldr\tr1, .L34+0x8\n\tadd\tr4, r0, #0\n\tldr\tr6, .L34+0x10\n\tldr\tr2, .L34+0x4\n.L27:\n\tstrh\tr7, [r5]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr2, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\t.code\t16\n\tadd\tr2, r2, #0x8\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r4\n\tblt\t.L27\t@cond_branch\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgOamFreeIndex\n\t.word\tgOamBuffer\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffd\n\t.word\t-0x7efffffd\n.L18:\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n.L17:\n\tmov\tr0, #0x0\n\tldr\tr2, .L36\n\tstrb\tr0, [r2]\n\tldr\tr1, .L36+0x4\n\tldr\tr0, [r1]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x7\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L30\t@cond_branch\n\tmov\tr4, #0x1\n\tneg\tr4, r4\n\tstr\tr4, [sp, #0x4]\n\tadd\tr0, sp, #0x4\n\tldr\tr5, .L36+0x8\n\tldr\tr1, .L36+0xc\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tstr\tr4, [sp, #0x8]\n\tldr\tr1, .L36+0x10\n\tldr\tr0, [sp, #0xc]\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tb\t.L31\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgOamFreeIndex\n\t.word\tgFlags\n\t.word\t0x5000008\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocOrders_EndIndex\n.L30:\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tstr\tr1, [sp, #0x8]\n\tldr\tr0, .L38\n\tldr\tr2, [sp, #0xc]\n\tstr\tr2, [r0]\n\tldr\tr2, .L38+0x4\n\tstr\tr2, [r0, #0x4]\n\tldr\tr2, .L38+0x8\n\tstr\tr2, [r0, #0x8]\n\tldr\tr3, [r0, #0x8]\n\tstr\tr1, [sp, #0x8]\n\tldr\tr1, [sp, #0xc]\n\tstr\tr1, [r0]\n\tldr\tr1, .L38+0xc\n\tstr\tr1, [r0, #0x4]\n\tstr\tr2, [r0, #0x8]\n\tldr\tr0, [r0, #0x8]\n.L31:\n\tadd\tsp, sp, #0x10\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0x40000d4\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t-0x7afffff8\n\t.word\tgOamMallocOrders_EndIndex\n.Lfe1:\n\t.size\t ProcessOamBuffers,.Lfe1-ProcessOamBuffers\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-0fac75cf4324.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'ProcessOamBuffers' — lift: cannot lift 'ProcessOamBuffers': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tProcessOamBuffers */\n/* \t.type\t ProcessOamBuffers,function */\n/* \t.thumb_func */\n/* ProcessOamBuffers: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, sl */\n/* \tmov\tr6, r9 */\n/* \tmov\tr5, r8 */\n/* \tpush\t{r5, r6, r7} */\n/* \tadd\tsp, sp, #-0x10 */\n/* \tldr\tr5, .L32 */\n/* \tmov\tr0, #0x0 */\n/* \tmov\tr9, r0 */\n/* \tmov\tr3, #0x0 */\n/* \tldr\tr1, .L32+0x4 */\n/* \tmov\tsl, r1 */\n/* \tmov\tr2, sp */\n/* \tadd\tr2, r2, #0x8 */\n/* \tstr\tr2, [sp, #0xc] */\n/* .L6: */\n/* \tldr\tr1, .L32+0x8 */\n/* \tadd\tr0, r3, r1 */\n/* \tldrb\tr0, [r0] */\n/* \tlsl\tr2, r0, #0x18 */\n/* \tasr\tr0, r2, #0x18 */\n/* \tadd\tr6, r3, #0x1 */\n/* \tmov\tr1, #0x1 */\n/* \tneg\tr1, r1 */\n/* \tcmp\tr0, r1 */\n/* \tbeq\t.L5\t@cond_branch */\n/* \tldr\tr4, .L32+0xc */\n/* \tmov\tr8, r1 */\n/* \tldr\tr0, .L32+0x10 */\n/* \tmov\tip, r0 */\n/* \tldr\tr7, .L32+0x14 */\n/* .L9: */\n/* \tasr\tr2, r2, #0x18 */\n/* \tlsl\tr3, r2, #0x3 */\n/* \tadd\tr3, r3, r7 */\n/* \tstr\tr3, [r4] */\n/* \tstr\tr5, [r4, #0x4] */\n/* \tldr\tr0, .L32+0x18 */\n/* \tstr\tr0, [r4, #0x8] */\n/* \tldr\tr0, [r4, #0x8] */\n/* \tadd\tr5, r5, #0x8 */\n/* \tadd\tr2, r2, ip */\n/* \tmov\tr1, r9 */\n/* \tadd\tr0, r1, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr0, r0, #0x18 */\n/* \tmov\tr9, r0 */\n/* \tstrb\tr1, [r2] */\n/* \tldrb\tr0, [r3, #0x6] */\n/* \tlsl\tr2, r0, #0x18 */\n/* \tasr\tr0, r2, #0x18 */\n/* \tcmp\tr0, r8 */\n/* \tbne\t.L9\t@cond_branch */\n/* .L5: */\n/* \tadd\tr3, r6, #0 */\n/* \tcmp\tr3, #0x1f */\n/* \tble\t.L6\t@cond_branch */\n/* \tldr\tr2, .L32+0x1c */\n/* \tldr\tr1, [r2] */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x4 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L12\t@cond_branch */\n/* \tldr\tr0, .L32+0x20 */\n/* \tldrb\tr3, [r0] */\n/* \tlsl\tr0, r3, #0x3 */\n/* \tldr\tr1, .L32 */\n/* \tadd\tr5, r0, r1 */\n/* \tmov\tr2, sl */\n/* \tldrb\tr0, [r2] */\n/* \tcmp\tr3, r0 */\n/* \tbge\t.L17\t@cond_branch */\n/* \tmov\tr4, sp */\n/* \tmov\tr1, #0x80 */\n/* \tlsl\tr1, r1, #0x2 */\n/* \tadd\tr7, r1, #0 */\n/* \tldr\tr1, .L32+0xc */\n/* \tldr\tr6, .L32+0x24 */\n/* .L15: */\n/* \tstrh\tr7, [r4] */\n/* \tmov\tr0, sp */\n/* \tstr\tr0, [r1] */\n/* \tstr\tr5, [r1, #0x4] */\n/* \tstr\tr6, [r1, #0x8] */\n/* \tldr\tr0, [r1, #0x8] */\n/* \tadd\tr5, r5, #0x8 */\n/* \tadd\tr3, r3, #0x1 */\n/* \tldrb\tr0, [r2] */\n/* \tcmp\tr3, r0 */\n/* \tblt\t.L15\t@cond_branch */\n/* \tb\t.L17 */\n/* .L33: */\n/* \t.align\t2, 0 */\n/* .L32: */\n/* \t.word\tgOamBuffer */\n/* \t.word\tgOamFirstPausedIndex */\n/* \t.word\tgOamMallocOrders_StartIndex */\n/* \t.word\t0x40000d4 */\n/* \t.word\tgOamMallocCopiedOrder */\n/* \t.word\tgOamMallocBuffer */\n/* \t.word\t-0x7ffffffd */\n/* \t.word\tgFlags */\n/* \t.word\tgOamFreeIndex */\n/* \t.word\t-0x7efffffd */\n/* .L12: */\n/* \tmov\tr0, #0x80 */\n/* \tlsl\tr0, r0, #0x3 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L18\t@cond_branch */\n/* \tldr\tr1, .L34 */\n/* \tldrb\tr0, [r1] */\n/* \tsub\tr3, r0, #0x1 */\n/* \tlsl\tr0, r3, #0x3 */\n/* \tldr\tr2, .L34+0x4 */\n/* \tadd\tr5, r0, r2 */\n/* \tcmp\tr3, #0 */\n/* \tblt\t.L20\t@cond_branch */\n/* \tldr\tr2, .L34+0x8 */\n/* \tldr\tr6, .L34+0xc */\n/* \tldr\tr0, .L34+0x4 */\n/* \tmov\tr1, #0xfe */\n/* \tlsl\tr1, r1, #0x2 */\n/* \tadd\tr4, r0, r1 */\n/* \tadd\tr1, r5, #0 */\n/* .L22: */\n/* \tstr\tr1, [r2] */\n/* \tstr\tr4, [r2, #0x4] */\n/* \tstr\tr6, [r2, #0x8] */\n/* \tldr\tr0, [r2, #0x8] */\n/* \tsub\tr1, r1, #0x8 */\n/* \tsub\tr3, r3, #0x1 */\n/* \tsub\tr4, r4, #0x8 */\n/* \tcmp\tr3, #0 */\n/* \tbge\t.L22\t@cond_branch */\n/* .L20: */\n/* \tldr\tr2, .L34 */\n/* \tldrb\tr1, [r2] */\n/* \tmov\tr0, #0x80 */\n/* \tsub\tr0, r0, r1 */\n/* \tmov\tr1, sl */\n/* \tstrb\tr0, [r1] */\n/* \tmov\tr3, #0x0 */\n/* \tldrb\tr0, [r1] */\n/* \tcmp\tr3, r0 */\n/* \tbge\t.L17\t@cond_branch */\n/* \tmov\tr5, sp */\n/* \tmov\tr2, #0x80 */\n/* \tlsl\tr2, r2, #0x2 */\n/* \tadd\tr7, r2, #0 */\n/* \tldr\tr1, .L34+0x8 */\n/* \tadd\tr4, r0, #0 */\n/* \tldr\tr6, .L34+0x10 */\n/* \tldr\tr2, .L34+0x4 */\n/* .L27: */\n/* \tstrh\tr7, [r5] */\n/* \tmov\tr0, sp */\n/* \tstr\tr0, [r1] */\n/* \tstr\tr2, [r1, #0x4] */\n/* \tstr\tr6, [r1, #0x8] */\n/* \tldr\tr0, [r1, #0x8] */\n/* \t.code\t16 */\n/* \tadd\tr2, r2, #0x8 */\n/* \tadd\tr3, r3, #0x1 */\n/* \tcmp\tr3, r4 */\n/* \tblt\t.L27\t@cond_branch */\n/* \tb\t.L17 */\n/* .L35: */\n/* \t.align\t2, 0 */\n/* .L34: */\n/* \t.word\tgOamFreeIndex */\n/* \t.word\tgOamBuffer */\n/* \t.word\t0x40000d4 */\n/* \t.word\t-0x7ffffffd */\n/* \t.word\t-0x7efffffd */\n/* .L18: */\n/* \tmov\tr1, sl */\n/* \tstrb\tr0, [r1] */\n/* .L17: */\n/* \tmov\tr0, #0x0 */\n/* \tldr\tr2, .L36 */\n/* \tstrb\tr0, [r2] */\n/* \tldr\tr1, .L36+0x4 */\n/* \tldr\tr0, [r1] */\n/* \tmov\tr1, #0x80 */\n/* \tlsl\tr1, r1, #0x7 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L30\t@cond_branch */\n/* \tmov\tr4, #0x1 */\n/* \tneg\tr4, r4 */\n/* \tstr\tr4, [sp, #0x4] */\n/* \tadd\tr0, sp, #0x4 */\n/* \tldr\tr5, .L36+0x8 */\n/* \tldr\tr1, .L36+0xc */\n/* \tadd\tr2, r5, #0 */\n/* \tbl\tCpuSet */\n/* \tstr\tr4, [sp, #0x8] */\n/* \tldr\tr1, .L36+0x10 */\n/* \tldr\tr0, [sp, #0xc] */\n/* \tadd\tr2, r5, #0 */\n/* \tbl\tCpuSet */\n/* \tb\t.L31 */\n/* .L37: */\n/* \t.align\t2, 0 */\n/* .L36: */\n/* \t.word\tgOamFreeIndex */\n/* \t.word\tgFlags */\n/* \t.word\t0x5000008 */\n/* \t.word\tgOamMallocOrders_StartIndex */\n/* \t.word\tgOamMallocOrders_EndIndex */\n/* .L30: */\n/* \tmov\tr1, #0x1 */\n/* \tneg\tr1, r1 */\n/* \tstr\tr1, [sp, #0x8] */\n/* \tldr\tr0, .L38 */\n/* \tldr\tr2, [sp, #0xc] */\n/* \tstr\tr2, [r0] */\n/* \tldr\tr2, .L38+0x4 */\n/* \tstr\tr2, [r0, #0x4] */\n/* \tldr\tr2, .L38+0x8 */\n/* \tstr\tr2, [r0, #0x8] */\n/* \tldr\tr3, [r0, #0x8] */\n/* \tstr\tr1, [sp, #0x8] */\n/* \tldr\tr1, [sp, #0xc] */\n/* \tstr\tr1, [r0] */\n/* \tldr\tr1, .L38+0xc */\n/* \tstr\tr1, [r0, #0x4] */\n/* \tstr\tr2, [r0, #0x8] */\n/* \tldr\tr0, [r0, #0x8] */\n/* .L31: */\n/* \tadd\tsp, sp, #0x10 */\n/* \tpop\t{r3, r4, r5} */\n/* \tmov\tr8, r3 */\n/* \tmov\tr9, r4 */\n/* \tmov\tsl, r5 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L39: */\n/* \t.align\t2, 0 */\n/* .L38: */\n/* \t.word\t0x40000d4 */\n/* \t.word\tgOamMallocOrders_StartIndex */\n/* \t.word\t-0x7afffff8 */\n/* \t.word\tgOamMallocOrders_EndIndex */\n/* .Lfe1: */\n/* \t.size\t ProcessOamBuffers,.Lfe1-ProcessOamBuffers */\n/* .text */\n/* \t.align\t2, 0 */\nvoid ProcessOamBuffers(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'ProcessOamBuffers': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":265,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'ProcessOamBuffers': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void ProcessOamBuffers(void) {\n OamData *temp_r3;\n OamData *var_r1;\n OamData *var_r2_2;\n OamData *var_r4;\n OamData *var_r5;\n OamData *var_r5_2;\n s32 temp_r2;\n s32 temp_r3_2;\n s32 var_r2;\n s32 var_r3;\n s32 var_r3_3;\n s32 var_r3_4;\n u8 temp_r0;\n u8 temp_r0_2;\n u8 temp_r0_3;\n u8 temp_r1;\n u8 var_r3_2;\n u8 var_r9;\n\n var_r5 = gOamBuffer;\n var_r9 = 0;\n var_r3 = 0;\n unkspC = &unksp0 + 8;\n do {\n temp_r0 = gOamMallocOrders_StartIndex[var_r3];\n var_r2 = temp_r0 << 0x18;\n if ((s8) temp_r0 != -1) {\n do {\n temp_r2 = var_r2 >> 0x18;\n temp_r3 = &gOamMallocBuffer[temp_r2];\n (void *)0x040000D4->unk0 = temp_r3;\n (void *)0x040000D4->unk4 = var_r5;\n (void *)0x040000D4->unk8 = 0x80000003;\n var_r5 += 8;\n temp_r1 = var_r9;\n var_r9 = temp_r1 + 1;\n gOamMallocCopiedOrder[temp_r2] = temp_r1;\n temp_r0_2 = temp_r3->unk6;\n var_r2 = temp_r0_2 << 0x18;\n } while ((s8) temp_r0_2 != -1);\n }\n var_r3 += 1;\n } while (var_r3 <= 0x1F);\n if (0x800 & gFlags) {\n var_r3_2 = gOamFreeIndex;\n var_r5_2 = &gOamBuffer[var_r3_2];\n if ((s32) var_r3_2 < (s32) gOamFirstPausedIndex) {\n do {\n unksp0 = 0x200;\n (void *)0x040000D4->unk0 = (OamData *) &unksp0;\n (void *)0x040000D4->unk4 = var_r5_2;\n (void *)0x040000D4->unk8 = 0x81000003;\n var_r5_2 += 8;\n var_r3_2 += 1;\n } while ((s32) var_r3_2 < (s32) gOamFirstPausedIndex);\n }\n } else {\n temp_r0_3 = 0x400 & gFlags;\n if (temp_r0_3 != 0) {\n var_r3_3 = gOamFreeIndex - 1;\n if (var_r3_3 >= 0) {\n var_r4 = &gOamBuffer[0x7F];\n var_r1 = &gOamBuffer[var_r3_3];\n do {\n (void *)0x040000D4->unk0 = var_r1;\n (void *)0x040000D4->unk4 = var_r4;\n (void *)0x040000D4->unk8 = 0x80000003;\n var_r1 -= 8;\n var_r3_3 -= 1;\n var_r4 -= 8;\n } while (var_r3_3 >= 0);\n }\n gOamFirstPausedIndex = 0x80 - gOamFreeIndex;\n var_r3_4 = 0;\n if ((s32) gOamFirstPausedIndex > 0) {\n var_r2_2 = gOamBuffer;\n do {\n unksp0 = 0x200;\n (void *)0x040000D4->unk0 = (OamData *) &unksp0;\n (void *)0x040000D4->unk4 = var_r2_2;\n (void *)0x040000D4->unk8 = 0x81000003;\n var_r2_2 += 8;\n var_r3_4 += 1;\n } while (var_r3_4 < (s32) gOamFirstPausedIndex);\n }\n } else {\n gOamFirstPausedIndex = temp_r0_3;\n }\n }\n gOamFreeIndex = 0;\n if (gFlags & 0x4000) {\n unksp4 = -1;\n CpuSet(&unksp4, gOamMallocOrders_StartIndex, 0x05000008U);\n unksp8 = -1;\n CpuSet(unkspC, gOamMallocOrders_EndIndex, 0x05000008U);\n return;\n }\n unksp8 = -1;\n (void *)0x040000D4->unk0 = unkspC;\n (void *)0x040000D4->unk4 = (OamData *) gOamMallocOrders_StartIndex;\n (void *)0x040000D4->unk8 = 0x85000008;\n temp_r3_2 = (void *)0x040000D4->unk8;\n unksp8 = -1;\n (void *)0x040000D4->unk0 = unkspC;\n (void *)0x040000D4->unk4 = (OamData *) gOamMallocOrders_EndIndex;\n (void *)0x040000D4->unk8 = 0x85000008;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":107,"gotos":0,"casts":28,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:941: `unkspC' undeclared (first use in this function)","/c.c:941: (Each undeclared identifier is reported only once","/c.c:941: for each function it appears in.)","/c.c:941: `unksp0' undeclared (first use in this function)","/c.c:949: invalid type argument of `->'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ProcessOamBuffers` — benchmark function sa3:ProcessOamBuffers:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessOamBuffers\n\t.type\t ProcessOamBuffers,function\n\t.thumb_func\nProcessOamBuffers:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x10\n\tldr\tr5, .L32\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tmov\tr3, #0x0\n\tldr\tr1, .L32+0x4\n\tmov\tsl, r1\n\tmov\tr2, sp\n\tadd\tr2, r2, #0x8\n\tstr\tr2, [sp, #0xc]\n.L6:\n\tldr\tr1, .L32+0x8\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tadd\tr6, r3, #0x1\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbeq\t.L5\t@cond_branch\n\tldr\tr4, .L32+0xc\n\tmov\tr8, r1\n\tldr\tr0, .L32+0x10\n\tmov\tip, r0\n\tldr\tr7, .L32+0x14\n.L9:\n\tasr\tr2, r2, #0x18\n\tlsl\tr3, r2, #0x3\n\tadd\tr3, r3, r7\n\tstr\tr3, [r4]\n\tstr\tr5, [r4, #0x4]\n\tldr\tr0, .L32+0x18\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr2, r2, ip\n\tmov\tr1, r9\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tstrb\tr1, [r2]\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tcmp\tr0, r8\n\tbne\t.L9\t@cond_branch\n.L5:\n\tadd\tr3, r6, #0\n\tcmp\tr3, #0x1f\n\tble\t.L6\t@cond_branch\n\tldr\tr2, .L32+0x1c\n\tldr\tr1, [r2]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L32+0x20\n\tldrb\tr3, [r0]\n\tlsl\tr0, r3, #0x3\n\tldr\tr1, .L32\n\tadd\tr5, r0, r1\n\tmov\tr2, sl\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr4, sp\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tadd\tr7, r1, #0\n\tldr\tr1, .L32+0xc\n\tldr\tr6, .L32+0x24\n.L15:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr5, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr3, r3, #0x1\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tblt\t.L15\t@cond_branch\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgOamBuffer\n\t.word\tgOamFirstPausedIndex\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t0x40000d4\n\t.word\tgOamMallocCopiedOrder\n\t.word\tgOamMallocBuffer\n\t.word\t-0x7ffffffd\n\t.word\tgFlags\n\t.word\tgOamFreeIndex\n\t.word\t-0x7efffffd\n.L12:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr1, .L34\n\tldrb\tr0, [r1]\n\tsub\tr3, r0, #0x1\n\tlsl\tr0, r3, #0x3\n\tldr\tr2, .L34+0x4\n\tadd\tr5, r0, r2\n\tcmp\tr3, #0\n\tblt\t.L20\t@cond_branch\n\tldr\tr2, .L34+0x8\n\tldr\tr6, .L34+0xc\n\tldr\tr0, .L34+0x4\n\tmov\tr1, #0xfe\n\tlsl\tr1, r1, #0x2\n\tadd\tr4, r0, r1\n\tadd\tr1, r5, #0\n.L22:\n\tstr\tr1, [r2]\n\tstr\tr4, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr1, r1, #0x8\n\tsub\tr3, r3, #0x1\n\tsub\tr4, r4, #0x8\n\tcmp\tr3, #0\n\tbge\t.L22\t@cond_branch\n.L20:\n\tldr\tr2, .L34\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x80\n\tsub\tr0, r0, r1\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n\tmov\tr3, #0x0\n\tldrb\tr0, [r1]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr5, sp\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr7, r2, #0\n\tldr\tr1, .L34+0x8\n\tadd\tr4, r0, #0\n\tldr\tr6, .L34+0x10\n\tldr\tr2, .L34+0x4\n.L27:\n\tstrh\tr7, [r5]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr2, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\t.code\t16\n\tadd\tr2, r2, #0x8\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r4\n\tblt\t.L27\t@cond_branch\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgOamFreeIndex\n\t.word\tgOamBuffer\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffd\n\t.word\t-0x7efffffd\n.L18:\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n.L17:\n\tmov\tr0, #0x0\n\tldr\tr2, .L36\n\tstrb\tr0, [r2]\n\tldr\tr1, .L36+0x4\n\tldr\tr0, [r1]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x7\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L30\t@cond_branch\n\tmov\tr4, #0x1\n\tneg\tr4, r4\n\tstr\tr4, [sp, #0x4]\n\tadd\tr0, sp, #0x4\n\tldr\tr5, .L36+0x8\n\tldr\tr1, .L36+0xc\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tstr\tr4, [sp, #0x8]\n\tldr\tr1, .L36+0x10\n\tldr\tr0, [sp, #0xc]\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tb\t.L31\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgOamFreeIndex\n\t.word\tgFlags\n\t.word\t0x5000008\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocOrders_EndIndex\n.L30:\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tstr\tr1, [sp, #0x8]\n\tldr\tr0, .L38\n\tldr\tr2, [sp, #0xc]\n\tstr\tr2, [r0]\n\tldr\tr2, .L38+0x4\n\tstr\tr2, [r0, #0x4]\n\tldr\tr2, .L38+0x8\n\tstr\tr2, [r0, #0x8]\n\tldr\tr3, [r0, #0x8]\n\tstr\tr1, [sp, #0x8]\n\tldr\tr1, [sp, #0xc]\n\tstr\tr1, [r0]\n\tldr\tr1, .L38+0xc\n\tstr\tr1, [r0, #0x4]\n\tstr\tr2, [r0, #0x8]\n\tldr\tr0, [r0, #0x8]\n.L31:\n\tadd\tsp, sp, #0x10\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0x40000d4\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t-0x7afffff8\n\t.word\tgOamMallocOrders_EndIndex\n.Lfe1:\n\t.size\t ProcessOamBuffers,.Lfe1-ProcessOamBuffers\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-0fac75cf4324.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid ProcessOamBuffers(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ProcessOamBuffers # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ProcessOamBuffers` — benchmark function sa3:ProcessOamBuffers:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:ProcessOamBuffers:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tProcessOamBuffers\n\t.type\t ProcessOamBuffers,function\n\t.thumb_func\nProcessOamBuffers:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tsp, sp, #-0x10\n\tldr\tr5, .L32\n\tmov\tr0, #0x0\n\tmov\tr9, r0\n\tmov\tr3, #0x0\n\tldr\tr1, .L32+0x4\n\tmov\tsl, r1\n\tmov\tr2, sp\n\tadd\tr2, r2, #0x8\n\tstr\tr2, [sp, #0xc]\n.L6:\n\tldr\tr1, .L32+0x8\n\tadd\tr0, r3, r1\n\tldrb\tr0, [r0]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tadd\tr6, r3, #0x1\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tcmp\tr0, r1\n\tbeq\t.L5\t@cond_branch\n\tldr\tr4, .L32+0xc\n\tmov\tr8, r1\n\tldr\tr0, .L32+0x10\n\tmov\tip, r0\n\tldr\tr7, .L32+0x14\n.L9:\n\tasr\tr2, r2, #0x18\n\tlsl\tr3, r2, #0x3\n\tadd\tr3, r3, r7\n\tstr\tr3, [r4]\n\tstr\tr5, [r4, #0x4]\n\tldr\tr0, .L32+0x18\n\tstr\tr0, [r4, #0x8]\n\tldr\tr0, [r4, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr2, r2, ip\n\tmov\tr1, r9\n\tadd\tr0, r1, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tmov\tr9, r0\n\tstrb\tr1, [r2]\n\tldrb\tr0, [r3, #0x6]\n\tlsl\tr2, r0, #0x18\n\tasr\tr0, r2, #0x18\n\tcmp\tr0, r8\n\tbne\t.L9\t@cond_branch\n.L5:\n\tadd\tr3, r6, #0\n\tcmp\tr3, #0x1f\n\tble\t.L6\t@cond_branch\n\tldr\tr2, .L32+0x1c\n\tldr\tr1, [r2]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x4\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L12\t@cond_branch\n\tldr\tr0, .L32+0x20\n\tldrb\tr3, [r0]\n\tlsl\tr0, r3, #0x3\n\tldr\tr1, .L32\n\tadd\tr5, r0, r1\n\tmov\tr2, sl\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr4, sp\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x2\n\tadd\tr7, r1, #0\n\tldr\tr1, .L32+0xc\n\tldr\tr6, .L32+0x24\n.L15:\n\tstrh\tr7, [r4]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr5, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\tadd\tr5, r5, #0x8\n\tadd\tr3, r3, #0x1\n\tldrb\tr0, [r2]\n\tcmp\tr3, r0\n\tblt\t.L15\t@cond_branch\n\tb\t.L17\n.L33:\n\t.align\t2, 0\n.L32:\n\t.word\tgOamBuffer\n\t.word\tgOamFirstPausedIndex\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t0x40000d4\n\t.word\tgOamMallocCopiedOrder\n\t.word\tgOamMallocBuffer\n\t.word\t-0x7ffffffd\n\t.word\tgFlags\n\t.word\tgOamFreeIndex\n\t.word\t-0x7efffffd\n.L12:\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L18\t@cond_branch\n\tldr\tr1, .L34\n\tldrb\tr0, [r1]\n\tsub\tr3, r0, #0x1\n\tlsl\tr0, r3, #0x3\n\tldr\tr2, .L34+0x4\n\tadd\tr5, r0, r2\n\tcmp\tr3, #0\n\tblt\t.L20\t@cond_branch\n\tldr\tr2, .L34+0x8\n\tldr\tr6, .L34+0xc\n\tldr\tr0, .L34+0x4\n\tmov\tr1, #0xfe\n\tlsl\tr1, r1, #0x2\n\tadd\tr4, r0, r1\n\tadd\tr1, r5, #0\n.L22:\n\tstr\tr1, [r2]\n\tstr\tr4, [r2, #0x4]\n\tstr\tr6, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n\tsub\tr1, r1, #0x8\n\tsub\tr3, r3, #0x1\n\tsub\tr4, r4, #0x8\n\tcmp\tr3, #0\n\tbge\t.L22\t@cond_branch\n.L20:\n\tldr\tr2, .L34\n\tldrb\tr1, [r2]\n\tmov\tr0, #0x80\n\tsub\tr0, r0, r1\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n\tmov\tr3, #0x0\n\tldrb\tr0, [r1]\n\tcmp\tr3, r0\n\tbge\t.L17\t@cond_branch\n\tmov\tr5, sp\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x2\n\tadd\tr7, r2, #0\n\tldr\tr1, .L34+0x8\n\tadd\tr4, r0, #0\n\tldr\tr6, .L34+0x10\n\tldr\tr2, .L34+0x4\n.L27:\n\tstrh\tr7, [r5]\n\tmov\tr0, sp\n\tstr\tr0, [r1]\n\tstr\tr2, [r1, #0x4]\n\tstr\tr6, [r1, #0x8]\n\tldr\tr0, [r1, #0x8]\n\t.code\t16\n\tadd\tr2, r2, #0x8\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r4\n\tblt\t.L27\t@cond_branch\n\tb\t.L17\n.L35:\n\t.align\t2, 0\n.L34:\n\t.word\tgOamFreeIndex\n\t.word\tgOamBuffer\n\t.word\t0x40000d4\n\t.word\t-0x7ffffffd\n\t.word\t-0x7efffffd\n.L18:\n\tmov\tr1, sl\n\tstrb\tr0, [r1]\n.L17:\n\tmov\tr0, #0x0\n\tldr\tr2, .L36\n\tstrb\tr0, [r2]\n\tldr\tr1, .L36+0x4\n\tldr\tr0, [r1]\n\tmov\tr1, #0x80\n\tlsl\tr1, r1, #0x7\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L30\t@cond_branch\n\tmov\tr4, #0x1\n\tneg\tr4, r4\n\tstr\tr4, [sp, #0x4]\n\tadd\tr0, sp, #0x4\n\tldr\tr5, .L36+0x8\n\tldr\tr1, .L36+0xc\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tstr\tr4, [sp, #0x8]\n\tldr\tr1, .L36+0x10\n\tldr\tr0, [sp, #0xc]\n\tadd\tr2, r5, #0\n\tbl\tCpuSet\n\tb\t.L31\n.L37:\n\t.align\t2, 0\n.L36:\n\t.word\tgOamFreeIndex\n\t.word\tgFlags\n\t.word\t0x5000008\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\tgOamMallocOrders_EndIndex\n.L30:\n\tmov\tr1, #0x1\n\tneg\tr1, r1\n\tstr\tr1, [sp, #0x8]\n\tldr\tr0, .L38\n\tldr\tr2, [sp, #0xc]\n\tstr\tr2, [r0]\n\tldr\tr2, .L38+0x4\n\tstr\tr2, [r0, #0x4]\n\tldr\tr2, .L38+0x8\n\tstr\tr2, [r0, #0x8]\n\tldr\tr3, [r0, #0x8]\n\tstr\tr1, [sp, #0x8]\n\tldr\tr1, [sp, #0xc]\n\tstr\tr1, [r0]\n\tldr\tr1, .L38+0xc\n\tstr\tr1, [r0, #0x4]\n\tstr\tr2, [r0, #0x8]\n\tldr\tr0, [r0, #0x8]\n.L31:\n\tadd\tsp, sp, #0x10\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L39:\n\t.align\t2, 0\n.L38:\n\t.word\t0x40000d4\n\t.word\tgOamMallocOrders_StartIndex\n\t.word\t-0x7afffff8\n\t.word\tgOamMallocOrders_EndIndex\n.Lfe1:\n\t.size\t ProcessOamBuffers,.Lfe1-ProcessOamBuffers\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ProcessOamBuffers # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:Random:agbcc","sym":"Random","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","pointer","arithmetic"],"loc":16,"refSource":"u16 Random(void)\n{\n u32 new;\n u32 *pPrev = &gRngPrevValue;\n u32 *pCurrent = &gRngValue;\n\n u32 prev = *pPrev;\n gRngPrevValue = *pCurrent;\n\n new = prev + RAND_CONST;\n new += *pCurrent;\n\n gRngValue = new;\n\n return ((u16 *)&gRngValue)[1];\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L402-L425","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr3, .L3\n\tldr\tr1, .L3+0x4\n\tldr\tr0, [r3]\n\tldr\tr2, [r1]\n\tstr\tr2, [r3]\n\tldr\tr3, .L3+0x8\n\tadd\tr0, r0, r3\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldrh\tr0, [r1, #0x2]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n\t.word\t0x37119371\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-3c6c541b53d3.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'Random' — raise: cannot recover struct 'Struct0': field at offset 2 overlaps the prior field (aligned to 4) — unions not modelled */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tRandom */\n/* \t.type\t Random,function */\n/* \t.thumb_func */\n/* Random: */\n/* \tldr\tr3, .L3 */\n/* \tldr\tr1, .L3+0x4 */\n/* \tldr\tr0, [r3] */\n/* \tldr\tr2, [r1] */\n/* \tstr\tr2, [r3] */\n/* \tldr\tr3, .L3+0x8 */\n/* \tadd\tr0, r0, r3 */\n/* \tadd\tr0, r0, r2 */\n/* \tstr\tr0, [r1] */\n/* \tldrh\tr0, [r1, #0x2] */\n/* \tbx\tlr */\n/* .L4: */\n/* \t.align\t2, 0 */\n/* .L3: */\n/* \t.word\tgRngPrevValue */\n/* \t.word\tgRngValue */\n/* \t.word\t0x37119371 */\n/* .Lfe1: */\n/* \t.size\t Random,.Lfe1-Random */\n/* \t.comm\tgRngPrevValue, 4\t@ 4 */\n/* \t.comm\tgRngValue, 4\t@ 4 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid Random(void) {\n ASMLIFT_ERROR(\"could not decompile (raise): cannot recover struct 'Struct0': field at offset 2 overlaps the prior field (aligned to 4) — unions not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":37,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["raise: cannot recover struct 'Struct0': field at offset 2 overlaps the prior field (aligned to 4) — unions not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u16 Random(void) {\n u32 temp_r0;\n\n temp_r0 = gRngPrevValue;\n gRngPrevValue = gRngValue.unk0;\n gRngValue.unk0 += temp_r0 + 0x37119371;\n return gRngValue.unk2;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":7,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:313: request for member `unk0' in something not a structure or union","/c.c:314: request for member `unk0' in something not a structure or union","/c.c:315: request for member `unk2' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Random` — benchmark function sa3:Random:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr3, .L3\n\tldr\tr1, .L3+0x4\n\tldr\tr0, [r3]\n\tldr\tr2, [r1]\n\tstr\tr2, [r3]\n\tldr\tr3, .L3+0x8\n\tadd\tr0, r0, r3\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldrh\tr0, [r1, #0x2]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n\t.word\t0x37119371\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-3c6c541b53d3.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu16 Random(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Random # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Random` — benchmark function sa3:Random:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:Random:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tRandom\n\t.type\t Random,function\n\t.thumb_func\nRandom:\n\tldr\tr3, .L3\n\tldr\tr1, .L3+0x4\n\tldr\tr0, [r3]\n\tldr\tr2, [r1]\n\tstr\tr2, [r3]\n\tldr\tr3, .L3+0x8\n\tadd\tr0, r0, r3\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldrh\tr0, [r1, #0x2]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n\t.word\t0x37119371\n.Lfe1:\n\t.size\t Random,.Lfe1-Random\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name Random # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8004418:agbcc","sym":"sa2__sub_8004418","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["branch","cast","fixed-point","array","memcpy"],"loc":53,"refSource":"s16 sa2__sub_8004418(s16 x, s16 y)\n{\n s16 fraction;\n s32 result;\n u8 index = 0;\n u8 array[8];\n memcpy(array, unkFractions, sizeof(array));\n\n if ((x | y) == 0) {\n result = -1;\n } else {\n if (x <= 0) {\n x = -x;\n index = 4;\n }\n if (y <= 0) {\n y = -y;\n index += 2;\n }\n if (x >= y) {\n // fraction = y*0.5 / x\n y *= Q(0.5);\n\n if (x == 0) {\n fraction = y;\n } else {\n fraction = y / x;\n }\n } else {\n index += 1;\n\n x *= Q(0.5);\n\n if (y == 0) {\n fraction = x;\n } else {\n fraction = x / y;\n }\n }\n\n if (array[index] & 0x01) {\n fraction = Q(0.5) - fraction;\n }\n\n {\n s32 val = array[index] * Q(0.5);\n fraction += val;\n result = ((u32)(fraction << 22) >> 22);\n }\n }\n\n return result;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/sprite.c#L73-L125","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.type\t unkFractions,object\n\t.size\t unkFractions,8\nunkFractions:\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x2\n\t.byte\t0x3\n\t.byte\t0x6\n\t.byte\t0x7\n\t.byte\t0x5\n\t.byte\t0x4\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8004418\n\t.type\t sa2__sub_8004418,function\n\t.thumb_func\nsa2__sub_8004418:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x8\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tmov\tr6, #0x0\n\tldr\tr1, .L15\n\tmov\tr0, sp\n\tmov\tr2, #0x8\n\tbl\tmemcpy\n\tlsl\tr0, r4, #0x10\n\tasr\tr1, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr2, r0, #0x10\n\tadd\tr0, r1, #0\n\torr\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tb\t.L4\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\tunkFractions\n.L3:\n\tcmp\tr1, #0\n\tbgt\t.L5\t@cond_branch\n\tneg\tr0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x4\n.L5:\n\tcmp\tr2, #0\n\tbgt\t.L6\t@cond_branch\n\tneg\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tadd\tr0, r6, #0x2\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L6:\n\tlsl\tr0, r4, #0x10\n\tasr\tr2, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr1, r0, #0x10\n\tcmp\tr2, r1\n\tblt\t.L7\t@cond_branch\n\tlsl\tr0, r1, #0x17\n\tlsr\tr5, r0, #0x10\n\tcmp\tr2, #0\n\tbne\t.L8\t@cond_branch\n\tadd\tr2, r5, #0\n\tb\t.L10\n.L8:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r2, #0\n\tb\t.L14\n.L7:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tlsl\tr0, r2, #0x17\n\tlsr\tr4, r0, #0x10\n\tcmp\tr1, #0\n\tbne\t.L11\t@cond_branch\n\tadd\tr2, r4, #0\n\tb\t.L10\n.L11:\n\tlsl\tr0, r4, #0x10\n\tasr\tr0, r0, #0x10\n.L14:\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L10:\n\tmov\tr0, sp\n\tadd\tr3, r0, r6\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr2, r1, #0x10\n.L13:\n\tldrb\tr1, [r3]\n\tlsl\tr1, r1, #0x7\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x16\n\tlsr\tr0, r0, #0x16\n.L4:\n\tadd\tsp, sp, #0x8\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8004418,.Lfe1-sa2__sub_8004418\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-4e7a3b17981a.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sa2__sub_8004418' — lift: cannot lift 'sa2__sub_8004418': reads the sub-word data table 'unkFractions' (.byte) — sub-word table data is not modelled */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* \t.section .rodata */\n/* \t.type\t unkFractions,object */\n/* \t.size\t unkFractions,8 */\n/* unkFractions: */\n/* \t.byte\t0x1 */\n/* \t.byte\t0x0 */\n/* \t.byte\t0x2 */\n/* \t.byte\t0x3 */\n/* \t.byte\t0x6 */\n/* \t.byte\t0x7 */\n/* \t.byte\t0x5 */\n/* \t.byte\t0x4 */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tsa2__sub_8004418 */\n/* \t.type\t sa2__sub_8004418,function */\n/* \t.thumb_func */\n/* sa2__sub_8004418: */\n/* \tpush\t{r4, r5, r6, lr} */\n/* \tadd\tsp, sp, #-0x8 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr4, r0, #0x10 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr5, r1, #0x10 */\n/* \tmov\tr6, #0x0 */\n/* \tldr\tr1, .L15 */\n/* \tmov\tr0, sp */\n/* \tmov\tr2, #0x8 */\n/* \tbl\tmemcpy */\n/* \tlsl\tr0, r4, #0x10 */\n/* \tasr\tr1, r0, #0x10 */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tasr\tr2, r0, #0x10 */\n/* \tadd\tr0, r1, #0 */\n/* \torr\tr0, r0, r2 */\n/* \tcmp\tr0, #0 */\n/* \tbne\t.L3\t@cond_branch */\n/* \tmov\tr0, #0x1 */\n/* \tneg\tr0, r0 */\n/* \tb\t.L4 */\n/* .L16: */\n/* \t.align\t2, 0 */\n/* .L15: */\n/* \t.word\tunkFractions */\n/* .L3: */\n/* \tcmp\tr1, #0 */\n/* \tbgt\t.L5\t@cond_branch */\n/* \tneg\tr0, r1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr4, r0, #0x10 */\n/* \tmov\tr6, #0x4 */\n/* .L5: */\n/* \tcmp\tr2, #0 */\n/* \tbgt\t.L6\t@cond_branch */\n/* \tneg\tr0, r2 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr5, r0, #0x10 */\n/* \tadd\tr0, r6, #0x2 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr6, r0, #0x18 */\n/* .L6: */\n/* \tlsl\tr0, r4, #0x10 */\n/* \tasr\tr2, r0, #0x10 */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tasr\tr1, r0, #0x10 */\n/* \tcmp\tr2, r1 */\n/* \tblt\t.L7\t@cond_branch */\n/* \tlsl\tr0, r1, #0x17 */\n/* \tlsr\tr5, r0, #0x10 */\n/* \tcmp\tr2, #0 */\n/* \tbne\t.L8\t@cond_branch */\n/* \tadd\tr2, r5, #0 */\n/* \tb\t.L10 */\n/* .L8: */\n/* \tlsl\tr0, r5, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tadd\tr1, r2, #0 */\n/* \tb\t.L14 */\n/* .L7: */\n/* \tadd\tr0, r6, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr6, r0, #0x18 */\n/* \tlsl\tr0, r2, #0x17 */\n/* \tlsr\tr4, r0, #0x10 */\n/* \tcmp\tr1, #0 */\n/* \tbne\t.L11\t@cond_branch */\n/* \tadd\tr2, r4, #0 */\n/* \tb\t.L10 */\n/* .L11: */\n/* \tlsl\tr0, r4, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* .L14: */\n/* \tbl\t__divsi3 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr2, r0, #0x10 */\n/* .L10: */\n/* \tmov\tr0, sp */\n/* \tadd\tr3, r0, r6 */\n/* \tldrb\tr1, [r3] */\n/* \tmov\tr0, #0x1 */\n/* \tand\tr0, r0, r1 */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L13\t@cond_branch */\n/* \tmov\tr1, #0x80 */\n/* \tlsl\tr0, r2, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tsub\tr1, r1, r0 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr2, r1, #0x10 */\n/* .L13: */\n/* \tldrb\tr1, [r3] */\n/* \tlsl\tr1, r1, #0x7 */\n/* \tlsl\tr0, r2, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tadd\tr0, r0, r1 */\n/* \tlsl\tr0, r0, #0x16 */\n/* \tlsr\tr0, r0, #0x16 */\n/* .L4: */\n/* \tadd\tsp, sp, #0x8 */\n/* \tpop\t{r4, r5, r6} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .Lfe1: */\n/* \t.size\t sa2__sub_8004418,.Lfe1-sa2__sub_8004418 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid sa2__sub_8004418(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sa2__sub_8004418': reads the sub-word data table 'unkFractions' (.byte) — sub-word table data is not modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":134,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sa2__sub_8004418': reads the sub-word data table 'unkFractions' (.byte) — sub-word table data is not modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s16 sa2__sub_8004418(s16 x, s16 y) {\n s16 temp_r1;\n s16 temp_r2;\n s16 temp_r2_2;\n s16 var_r0;\n s16 var_r1;\n u16 temp_r4;\n u16 temp_r5;\n u16 var_r2;\n u16 var_r4;\n u16 var_r5;\n u8 *temp_r3;\n u8 var_r6;\n\n var_r4 = (u16) x;\n var_r5 = (u16) y;\n var_r6 = 0;\n memcpy(&unksp0, unkFractions, 8U);\n temp_r1 = (s16) var_r4;\n temp_r2 = (s16) var_r5;\n if ((temp_r1 | temp_r2) == 0) {\n return -1;\n }\n if ((s32) temp_r1 <= 0) {\n var_r4 = 0 - temp_r1;\n var_r6 = 4;\n }\n if ((s32) temp_r2 <= 0) {\n var_r5 = 0 - temp_r2;\n var_r6 += 2;\n }\n temp_r2_2 = (s16) var_r4;\n var_r1 = (s16) var_r5;\n if ((s32) temp_r2_2 >= (s32) var_r1) {\n temp_r5 = var_r1 << 7;\n if (temp_r2_2 == 0) {\n var_r2 = temp_r5;\n } else {\n var_r0 = (s16) temp_r5;\n var_r1 = temp_r2_2;\n goto block_13;\n }\n } else {\n var_r6 += 1;\n temp_r4 = temp_r2_2 << 7;\n if (var_r1 == 0) {\n var_r2 = temp_r4;\n } else {\n var_r0 = (s16) temp_r4;\nblock_13:\n var_r2 = (u16) (var_r0 / var_r1);\n }\n }\n temp_r3 = &unksp0 + var_r6;\n if (1 & *temp_r3) {\n var_r2 = 0x80 - (s16) var_r2;\n }\n return (s16) ((u32) (((s16) var_r2 + (*temp_r3 << 7)) << 0x16) >> 0x16);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":76,"lines":58,"gotos":1,"casts":17,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:363: `unksp0' undeclared (first use in this function)","/c.c:363: (Each undeclared identifier is reported only once","/c.c:363: for each function it appears in.)"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8004418` — benchmark function sa3:sa2__sub_8004418:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.type\t unkFractions,object\n\t.size\t unkFractions,8\nunkFractions:\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x2\n\t.byte\t0x3\n\t.byte\t0x6\n\t.byte\t0x7\n\t.byte\t0x5\n\t.byte\t0x4\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8004418\n\t.type\t sa2__sub_8004418,function\n\t.thumb_func\nsa2__sub_8004418:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x8\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tmov\tr6, #0x0\n\tldr\tr1, .L15\n\tmov\tr0, sp\n\tmov\tr2, #0x8\n\tbl\tmemcpy\n\tlsl\tr0, r4, #0x10\n\tasr\tr1, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr2, r0, #0x10\n\tadd\tr0, r1, #0\n\torr\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tb\t.L4\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\tunkFractions\n.L3:\n\tcmp\tr1, #0\n\tbgt\t.L5\t@cond_branch\n\tneg\tr0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x4\n.L5:\n\tcmp\tr2, #0\n\tbgt\t.L6\t@cond_branch\n\tneg\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tadd\tr0, r6, #0x2\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L6:\n\tlsl\tr0, r4, #0x10\n\tasr\tr2, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr1, r0, #0x10\n\tcmp\tr2, r1\n\tblt\t.L7\t@cond_branch\n\tlsl\tr0, r1, #0x17\n\tlsr\tr5, r0, #0x10\n\tcmp\tr2, #0\n\tbne\t.L8\t@cond_branch\n\tadd\tr2, r5, #0\n\tb\t.L10\n.L8:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r2, #0\n\tb\t.L14\n.L7:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tlsl\tr0, r2, #0x17\n\tlsr\tr4, r0, #0x10\n\tcmp\tr1, #0\n\tbne\t.L11\t@cond_branch\n\tadd\tr2, r4, #0\n\tb\t.L10\n.L11:\n\tlsl\tr0, r4, #0x10\n\tasr\tr0, r0, #0x10\n.L14:\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L10:\n\tmov\tr0, sp\n\tadd\tr3, r0, r6\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr2, r1, #0x10\n.L13:\n\tldrb\tr1, [r3]\n\tlsl\tr1, r1, #0x7\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x16\n\tlsr\tr0, r0, #0x16\n.L4:\n\tadd\tsp, sp, #0x8\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8004418,.Lfe1-sa2__sub_8004418\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-4e7a3b17981a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\ns16 sa2__sub_8004418(s16 x, s16 y);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8004418 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8004418` — benchmark function sa3:sa2__sub_8004418:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8004418:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n\t.section .rodata\n\t.type\t unkFractions,object\n\t.size\t unkFractions,8\nunkFractions:\n\t.byte\t0x1\n\t.byte\t0x0\n\t.byte\t0x2\n\t.byte\t0x3\n\t.byte\t0x6\n\t.byte\t0x7\n\t.byte\t0x5\n\t.byte\t0x4\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8004418\n\t.type\t sa2__sub_8004418,function\n\t.thumb_func\nsa2__sub_8004418:\n\tpush\t{r4, r5, r6, lr}\n\tadd\tsp, sp, #-0x8\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tmov\tr6, #0x0\n\tldr\tr1, .L15\n\tmov\tr0, sp\n\tmov\tr2, #0x8\n\tbl\tmemcpy\n\tlsl\tr0, r4, #0x10\n\tasr\tr1, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr2, r0, #0x10\n\tadd\tr0, r1, #0\n\torr\tr0, r0, r2\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tb\t.L4\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\tunkFractions\n.L3:\n\tcmp\tr1, #0\n\tbgt\t.L5\t@cond_branch\n\tneg\tr0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr6, #0x4\n.L5:\n\tcmp\tr2, #0\n\tbgt\t.L6\t@cond_branch\n\tneg\tr0, r2\n\tlsl\tr0, r0, #0x10\n\tlsr\tr5, r0, #0x10\n\tadd\tr0, r6, #0x2\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n.L6:\n\tlsl\tr0, r4, #0x10\n\tasr\tr2, r0, #0x10\n\tlsl\tr0, r5, #0x10\n\tasr\tr1, r0, #0x10\n\tcmp\tr2, r1\n\tblt\t.L7\t@cond_branch\n\tlsl\tr0, r1, #0x17\n\tlsr\tr5, r0, #0x10\n\tcmp\tr2, #0\n\tbne\t.L8\t@cond_branch\n\tadd\tr2, r5, #0\n\tb\t.L10\n.L8:\n\tlsl\tr0, r5, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr1, r2, #0\n\tb\t.L14\n.L7:\n\tadd\tr0, r6, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr6, r0, #0x18\n\tlsl\tr0, r2, #0x17\n\tlsr\tr4, r0, #0x10\n\tcmp\tr1, #0\n\tbne\t.L11\t@cond_branch\n\tadd\tr2, r4, #0\n\tb\t.L10\n.L11:\n\tlsl\tr0, r4, #0x10\n\tasr\tr0, r0, #0x10\n.L14:\n\tbl\t__divsi3\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L10:\n\tmov\tr0, sp\n\tadd\tr3, r0, r6\n\tldrb\tr1, [r3]\n\tmov\tr0, #0x1\n\tand\tr0, r0, r1\n\tcmp\tr0, #0\n\tbeq\t.L13\t@cond_branch\n\tmov\tr1, #0x80\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tsub\tr1, r1, r0\n\tlsl\tr1, r1, #0x10\n\tlsr\tr2, r1, #0x10\n.L13:\n\tldrb\tr1, [r3]\n\tlsl\tr1, r1, #0x7\n\tlsl\tr0, r2, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x16\n\tlsr\tr0, r0, #0x16\n.L4:\n\tadd\tsp, sp, #0x8\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8004418,.Lfe1-sa2__sub_8004418\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8004418 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8007858:agbcc","sym":"sa2__sub_8007858","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","global","bitwise","cast"],"loc":23,"refSource":"void sa2__sub_8007858(u8 param0, int_vcount minY, int_vcount maxY, u16 param3, u16 param4)\n{\n u16 *cursor;\n\n gFlags |= FLAGS_EXECUTE_HBLANK_COPY;\n\n gHBlankCopyTarget = (void *)&((u8 *)®_BG0HOFS)[param0 * 4];\n gHBlankCopySize = 4;\n\n cursor = &((u16 *)gBgOffsetsHBlankPrimary)[minY * 2];\n\n param4 = (param4 - minY) & 0x1FF;\n param3 &= 0x1FF;\n\n while (minY < maxY) {\n *cursor = param3;\n cursor++;\n *cursor = param4--;\n cursor++;\n\n minY++;\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L826-L848","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007858\n\t.type\t sa2__sub_8007858,function\n\t.thumb_func\nsa2__sub_8007858:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r3, #0\n\tldr\tr3, [sp, #0x14]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr6, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr4, r3, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tsub\tr4, r4, r5\n\tldr\tr1, .L7+0x14\n\tadd\tr0, r1, #0\n\tand\tr4, r4, r0\n\tand\tr7, r7, r0\n\tcmp\tr5, r6\n\tbcs\t.L4\t@cond_branch\n.L5:\n\tstrh\tr7, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r4, #0\n\tsub\tr1, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr4, r1, #0x10\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, r6\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007858,.Lfe1-sa2__sub_8007858\n\n.text\n\t.align\t2, 0\n","proto":{"sa2__sub_8007858":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sa2__sub_8007858' — lift: cannot lift 'sa2__sub_8007858': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tsa2__sub_8007858 */\n/* \t.type\t sa2__sub_8007858,function */\n/* \t.thumb_func */\n/* sa2__sub_8007858: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tadd\tr7, r3, #0 */\n/* \tldr\tr3, [sp, #0x14] */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tlsr\tr5, r1, #0x18 */\n/* \tlsl\tr2, r2, #0x18 */\n/* \tlsr\tr6, r2, #0x18 */\n/* \tlsl\tr3, r3, #0x10 */\n/* \tlsr\tr4, r3, #0x10 */\n/* \tldr\tr2, .L7 */\n/* \tldr\tr1, [r2] */\n/* \tmov\tr3, #0x4 */\n/* \torr\tr1, r1, r3 */\n/* \tstr\tr1, [r2] */\n/* \tldr\tr1, .L7+0x4 */\n/* \tlsr\tr0, r0, #0x16 */\n/* \tldr\tr2, .L7+0x8 */\n/* \tadd\tr0, r0, r2 */\n/* \tstr\tr0, [r1] */\n/* \tldr\tr0, .L7+0xc */\n/* \tstrb\tr3, [r0] */\n/* \tldr\tr0, .L7+0x10 */\n/* \tlsl\tr1, r5, #0x2 */\n/* \tldr\tr0, [r0] */\n/* \tadd\tr2, r0, r1 */\n/* \tsub\tr4, r4, r5 */\n/* \tldr\tr1, .L7+0x14 */\n/* \tadd\tr0, r1, #0 */\n/* \tand\tr4, r4, r0 */\n/* \tand\tr7, r7, r0 */\n/* \tcmp\tr5, r6 */\n/* \tbcs\t.L4\t@cond_branch */\n/* .L5: */\n/* \tstrh\tr7, [r2] */\n/* \tadd\tr2, r2, #0x2 */\n/* \tadd\tr0, r4, #0 */\n/* \tsub\tr1, r0, #0x1 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr4, r1, #0x10 */\n/* \tstrh\tr0, [r2] */\n/* \tadd\tr2, r2, #0x2 */\n/* \tadd\tr0, r5, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tcmp\tr5, r6 */\n/* \tbcc\t.L5\t@cond_branch */\n/* .L4: */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L8: */\n/* \t.align\t2, 0 */\n/* .L7: */\n/* \t.word\tgFlags */\n/* \t.word\tgHBlankCopyTarget */\n/* \t.word\t0x4000010 */\n/* \t.word\tgHBlankCopySize */\n/* \t.word\tgBgOffsetsHBlankPrimary */\n/* \t.word\t0x1ff */\n/* .Lfe1: */\n/* \t.size\t sa2__sub_8007858,.Lfe1-sa2__sub_8007858 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid sa2__sub_8007858(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sa2__sub_8007858': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":78,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sa2__sub_8007858': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern s32 gBgOffsetsHBlankPrimary;\nextern s32 gFlags;\nextern s8 gHBlankCopySize;\nextern s32 gHBlankCopyTarget;\n\nvoid sa2__sub_8007858(s32 arg0, u8 arg1, u8 arg2, s32 arg3, s32 arg4) {\n u16 temp_r0;\n u16 var_r4;\n u8 temp_r6;\n u8 var_r5;\n void *var_r2;\n\n var_r5 = arg1;\n temp_r6 = arg2;\n gFlags |= 4;\n gHBlankCopyTarget = ((u32) (arg0 << 0x18) >> 0x16) + 0x04000010;\n gHBlankCopySize = 4;\n var_r2 = gBgOffsetsHBlankPrimary + (var_r5 * 4);\n var_r4 = ((u16) arg4 - var_r5) & 0x1FF;\n if ((u32) var_r5 < (u32) temp_r6) {\n do {\n var_r2->unk0 = (s16) (arg3 & 0x1FF);\n temp_r0 = var_r4;\n var_r4 = temp_r0 - 1;\n var_r2->unk2 = temp_r0;\n var_r2 = var_r2 + 2 + 2;\n var_r5 += 1;\n } while ((u32) var_r5 < (u32) temp_r6);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":90,"lines":28,"gotos":0,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:919: conflicting types for `gBgOffsetsHBlankPrimary'","/c.c:877: previous declaration of `gBgOffsetsHBlankPrimary'","/c.c:920: conflicting types for `gFlags'","/c.c:917: previous declaration of `gFlags'","/c.c:921: conflicting types for `gHBlankCopySize'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8007858` — benchmark function sa3:sa2__sub_8007858:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007858\n\t.type\t sa2__sub_8007858,function\n\t.thumb_func\nsa2__sub_8007858:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r3, #0\n\tldr\tr3, [sp, #0x14]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr6, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr4, r3, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tsub\tr4, r4, r5\n\tldr\tr1, .L7+0x14\n\tadd\tr0, r1, #0\n\tand\tr4, r4, r0\n\tand\tr7, r7, r0\n\tcmp\tr5, r6\n\tbcs\t.L4\t@cond_branch\n.L5:\n\tstrh\tr7, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r4, #0\n\tsub\tr1, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr4, r1, #0x10\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, r6\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007858,.Lfe1-sa2__sub_8007858\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8007858 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8007858` — benchmark function sa3:sa2__sub_8007858:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8007858:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007858\n\t.type\t sa2__sub_8007858,function\n\t.thumb_func\nsa2__sub_8007858:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tr7, r3, #0\n\tldr\tr3, [sp, #0x14]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr6, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr4, r3, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tsub\tr4, r4, r5\n\tldr\tr1, .L7+0x14\n\tadd\tr0, r1, #0\n\tand\tr4, r4, r0\n\tand\tr7, r7, r0\n\tcmp\tr5, r6\n\tbcs\t.L4\t@cond_branch\n.L5:\n\tstrh\tr7, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r4, #0\n\tsub\tr1, r0, #0x1\n\tlsl\tr1, r1, #0x10\n\tlsr\tr4, r1, #0x10\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tadd\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, r6\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007858,.Lfe1-sa2__sub_8007858\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_8007858\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8007858 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_80078D4:agbcc","sym":"sa2__sub_80078D4","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["mmio","global","dma","bitwise"],"loc":15,"refSource":"void sa2__sub_80078D4(u8 bg, int_vcount minY, int_vcount maxY, u16 offsetEven, u16 offsetOdd)\n{\n s32 fillVal;\n\n gFlags |= FLAGS_EXECUTE_HBLANK_COPY;\n\n gHBlankCopyTarget = (void *)&((u8 *)®_BG0HOFS)[bg * 4];\n gHBlankCopySize = 4;\n\n if (minY < maxY) {\n fillVal = (offsetEven %= 512u) | ((offsetOdd % 512u) << 16);\n\n DmaFill32(3, fillVal, &((u16 *)gBgOffsetsHBlankPrimary)[minY * 2], (maxY - minY) * 4);\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L850-L864","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80078D4\n\t.type\t sa2__sub_80078D4,function\n\t.thumb_func\nsa2__sub_80078D4:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x18]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr7, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tldr\tr2, .L4\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L4+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L4+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L4+0xc\n\tstrb\tr3, [r0]\n\tcmp\tr5, r7\n\tbcs\t.L3\t@cond_branch\n\tldr\tr2, .L4+0x10\n\tadd\tr1, r6, #0\n\tand\tr1, r1, r2\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r2\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tstr\tr1, [sp]\n\tldr\tr2, .L4+0x14\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldr\tr0, .L4+0x18\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2, #0x4]\n\tsub\tr0, r7, r5\n\tmov\tr1, #0x85\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n.L3:\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\t0x1ff\n\t.word\t0x40000d4\n\t.word\tgBgOffsetsHBlankPrimary\n.Lfe1:\n\t.size\t sa2__sub_80078D4,.Lfe1-sa2__sub_80078D4\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sa2__sub_80078D4' — lift: cannot lift 'sa2__sub_80078D4': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tsa2__sub_80078D4 */\n/* \t.type\t sa2__sub_80078D4,function */\n/* \t.thumb_func */\n/* sa2__sub_80078D4: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tadd\tsp, sp, #-0x4 */\n/* \tldr\tr4, [sp, #0x18] */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tlsr\tr5, r1, #0x18 */\n/* \tlsl\tr2, r2, #0x18 */\n/* \tlsr\tr7, r2, #0x18 */\n/* \tlsl\tr3, r3, #0x10 */\n/* \tlsr\tr6, r3, #0x10 */\n/* \tlsl\tr4, r4, #0x10 */\n/* \tlsr\tr4, r4, #0x10 */\n/* \tldr\tr2, .L4 */\n/* \tldr\tr1, [r2] */\n/* \tmov\tr3, #0x4 */\n/* \torr\tr1, r1, r3 */\n/* \tstr\tr1, [r2] */\n/* \tldr\tr1, .L4+0x4 */\n/* \tlsr\tr0, r0, #0x16 */\n/* \tldr\tr2, .L4+0x8 */\n/* \tadd\tr0, r0, r2 */\n/* \tstr\tr0, [r1] */\n/* \tldr\tr0, .L4+0xc */\n/* \tstrb\tr3, [r0] */\n/* \tcmp\tr5, r7 */\n/* \tbcs\t.L3\t@cond_branch */\n/* \tldr\tr2, .L4+0x10 */\n/* \tadd\tr1, r6, #0 */\n/* \tand\tr1, r1, r2 */\n/* \tadd\tr0, r4, #0 */\n/* \tand\tr0, r0, r2 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \torr\tr1, r1, r0 */\n/* \tstr\tr1, [sp] */\n/* \tldr\tr2, .L4+0x14 */\n/* \tmov\tr0, sp */\n/* \tstr\tr0, [r2] */\n/* \tldr\tr0, .L4+0x18 */\n/* \tlsl\tr1, r5, #0x2 */\n/* \tldr\tr0, [r0] */\n/* \tadd\tr0, r0, r1 */\n/* \tstr\tr0, [r2, #0x4] */\n/* \tsub\tr0, r7, r5 */\n/* \tmov\tr1, #0x85 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \torr\tr0, r0, r1 */\n/* \tstr\tr0, [r2, #0x8] */\n/* \tldr\tr0, [r2, #0x8] */\n/* .L3: */\n/* \tadd\tsp, sp, #0x4 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L5: */\n/* \t.align\t2, 0 */\n/* .L4: */\n/* \t.word\tgFlags */\n/* \t.word\tgHBlankCopyTarget */\n/* \t.word\t0x4000010 */\n/* \t.word\tgHBlankCopySize */\n/* \t.word\t0x1ff */\n/* \t.word\t0x40000d4 */\n/* \t.word\tgBgOffsetsHBlankPrimary */\n/* .Lfe1: */\n/* \t.size\t sa2__sub_80078D4,.Lfe1-sa2__sub_80078D4 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid sa2__sub_80078D4(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sa2__sub_80078D4': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":81,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sa2__sub_80078D4': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern s32 gBgOffsetsHBlankPrimary;\nextern s32 gFlags;\nextern s8 gHBlankCopySize;\nextern s32 gHBlankCopyTarget;\n\ns32 sa2__sub_80078D4(s32 arg0, u8 arg1, u8 arg2, u16 arg3, s32 arg5) {\n s8 *var_r0;\n u8 temp_r5;\n u8 temp_r7;\n\n temp_r5 = arg1;\n temp_r7 = arg2;\n gFlags |= 4;\n gHBlankCopyTarget = ((u32) (arg0 << 0x18) >> 0x16) + 0x04000010;\n var_r0 = &gHBlankCopySize;\n gHBlankCopySize = 4;\n if ((u32) temp_r5 < (u32) temp_r7) {\n unksp0 = (arg3 & 0x1FF) | (((u16) arg5 & 0x1FF) << 0x10);\n (void *)0x040000D4->unk0 = &unksp0;\n (void *)0x040000D4->unk4 = (s32) (gBgOffsetsHBlankPrimary + (temp_r5 * 4));\n (void *)0x040000D4->unk8 = (s32) ((temp_r7 - temp_r5) | 0x85000000);\n var_r0 = (s8 *) (void *)0x040000D4->unk8;\n }\n return (s32) var_r0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":23,"gotos":0,"casts":12,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:919: conflicting types for `gBgOffsetsHBlankPrimary'","/c.c:877: previous declaration of `gBgOffsetsHBlankPrimary'","/c.c:920: conflicting types for `gFlags'","/c.c:917: previous declaration of `gFlags'","/c.c:921: conflicting types for `gHBlankCopySize'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80078D4` — benchmark function sa3:sa2__sub_80078D4:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80078D4\n\t.type\t sa2__sub_80078D4,function\n\t.thumb_func\nsa2__sub_80078D4:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x18]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr7, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tldr\tr2, .L4\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L4+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L4+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L4+0xc\n\tstrb\tr3, [r0]\n\tcmp\tr5, r7\n\tbcs\t.L3\t@cond_branch\n\tldr\tr2, .L4+0x10\n\tadd\tr1, r6, #0\n\tand\tr1, r1, r2\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r2\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tstr\tr1, [sp]\n\tldr\tr2, .L4+0x14\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldr\tr0, .L4+0x18\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2, #0x4]\n\tsub\tr0, r7, r5\n\tmov\tr1, #0x85\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n.L3:\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\t0x1ff\n\t.word\t0x40000d4\n\t.word\tgBgOffsetsHBlankPrimary\n.Lfe1:\n\t.size\t sa2__sub_80078D4,.Lfe1-sa2__sub_80078D4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80078D4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80078D4` — benchmark function sa3:sa2__sub_80078D4:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80078D4:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80078D4\n\t.type\t sa2__sub_80078D4,function\n\t.thumb_func\nsa2__sub_80078D4:\n\tpush\t{r4, r5, r6, r7, lr}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x18]\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr5, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr7, r2, #0x18\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x10\n\tlsr\tr4, r4, #0x10\n\tldr\tr2, .L4\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L4+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L4+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L4+0xc\n\tstrb\tr3, [r0]\n\tcmp\tr5, r7\n\tbcs\t.L3\t@cond_branch\n\tldr\tr2, .L4+0x10\n\tadd\tr1, r6, #0\n\tand\tr1, r1, r2\n\tadd\tr0, r4, #0\n\tand\tr0, r0, r2\n\tlsl\tr0, r0, #0x10\n\torr\tr1, r1, r0\n\tstr\tr1, [sp]\n\tldr\tr2, .L4+0x14\n\tmov\tr0, sp\n\tstr\tr0, [r2]\n\tldr\tr0, .L4+0x18\n\tlsl\tr1, r5, #0x2\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tstr\tr0, [r2, #0x4]\n\tsub\tr0, r7, r5\n\tmov\tr1, #0x85\n\tlsl\tr1, r1, #0x18\n\torr\tr0, r0, r1\n\tstr\tr0, [r2, #0x8]\n\tldr\tr0, [r2, #0x8]\n.L3:\n\tadd\tsp, sp, #0x4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L5:\n\t.align\t2, 0\n.L4:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\t0x1ff\n\t.word\t0x40000d4\n\t.word\tgBgOffsetsHBlankPrimary\n.Lfe1:\n\t.size\t sa2__sub_80078D4,.Lfe1-sa2__sub_80078D4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80078D4 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8007958:agbcc","sym":"sa2__sub_8007958","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","global","bitwise","arithmetic"],"loc":24,"refSource":"void sa2__sub_8007958(u8 bg, int_vcount minY, int_vcount maxY, s16 param3, s8 param4, u16 param5, u16 param6)\n{\n u16 *cursor;\n\n gFlags |= FLAGS_EXECUTE_HBLANK_COPY;\n\n gHBlankCopyTarget = (void *)&((u8 *)®_BG0HOFS)[bg * 4];\n gHBlankCopySize = 4;\n\n cursor = &((u16 *)gBgOffsetsHBlankPrimary)[minY * 2];\n\n while (minY < maxY) {\n *cursor = (param3 + param5) & 0x1FF;\n cursor++;\n *cursor = param6;\n cursor++;\n\n param3 = -(param3 + param4);\n param4 = -param4;\n\n minY++;\n }\n}\n","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/bg_triangles.c#L866-L888","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007958\n\t.type\t sa2__sub_8007958,function\n\t.thumb_func\nsa2__sub_8007958:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x20]\n\tldr\tr5, [sp, #0x24]\n\tldr\tr6, [sp, #0x28]\n\tmov\tr8, r6\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr7, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tip, r2\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tmov\tr9, r5\n\tmov\tr1, r8\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r7, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tcmp\tr7, ip\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L7+0x14\n\tadd\tr3, r0, #0\n.L5:\n\tmov\tr1, r9\n\tadd\tr0, r1, r6\n\tand\tr0, r0, r3\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tstrh\tr5, [r2]\n\tadd\tr2, r2, #0x2\n\tlsl\tr1, r4, #0x18\n\tasr\tr1, r1, #0x18\n\tlsl\tr0, r6, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tneg\tr0, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr6, r0, #0x10\n\tneg\tr1, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr4, r1, #0x18\n\tadd\tr0, r7, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr7, r0, #0x18\n\tcmp\tr7, ip\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007958,.Lfe1-sa2__sub_8007958\n\n.text\n\t.align\t2, 0\n","proto":{"sa2__sub_8007958":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sa2__sub_8007958' — lift: cannot lift 'sa2__sub_8007958': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tsa2__sub_8007958 */\n/* \t.type\t sa2__sub_8007958,function */\n/* \t.thumb_func */\n/* sa2__sub_8007958: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, r9 */\n/* \tmov\tr6, r8 */\n/* \tpush\t{r6, r7} */\n/* \tadd\tsp, sp, #-0x4 */\n/* \tldr\tr4, [sp, #0x20] */\n/* \tldr\tr5, [sp, #0x24] */\n/* \tldr\tr6, [sp, #0x28] */\n/* \tmov\tr8, r6 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tlsr\tr7, r1, #0x18 */\n/* \tlsl\tr2, r2, #0x18 */\n/* \tlsr\tr2, r2, #0x18 */\n/* \tmov\tip, r2 */\n/* \tlsl\tr3, r3, #0x10 */\n/* \tlsr\tr6, r3, #0x10 */\n/* \tlsl\tr4, r4, #0x18 */\n/* \tlsr\tr4, r4, #0x18 */\n/* \tlsl\tr5, r5, #0x10 */\n/* \tlsr\tr5, r5, #0x10 */\n/* \tmov\tr9, r5 */\n/* \tmov\tr1, r8 */\n/* \tlsl\tr1, r1, #0x10 */\n/* \tlsr\tr5, r1, #0x10 */\n/* \tldr\tr2, .L7 */\n/* \tldr\tr1, [r2] */\n/* \tmov\tr3, #0x4 */\n/* \torr\tr1, r1, r3 */\n/* \tstr\tr1, [r2] */\n/* \tldr\tr1, .L7+0x4 */\n/* \tlsr\tr0, r0, #0x16 */\n/* \tldr\tr2, .L7+0x8 */\n/* \tadd\tr0, r0, r2 */\n/* \tstr\tr0, [r1] */\n/* \tldr\tr0, .L7+0xc */\n/* \tstrb\tr3, [r0] */\n/* \tldr\tr0, .L7+0x10 */\n/* \tlsl\tr1, r7, #0x2 */\n/* \tldr\tr0, [r0] */\n/* \tadd\tr2, r0, r1 */\n/* \tcmp\tr7, ip */\n/* \tbcs\t.L4\t@cond_branch */\n/* \tldr\tr0, .L7+0x14 */\n/* \tadd\tr3, r0, #0 */\n/* .L5: */\n/* \tmov\tr1, r9 */\n/* \tadd\tr0, r1, r6 */\n/* \tand\tr0, r0, r3 */\n/* \tstrh\tr0, [r2] */\n/* \tadd\tr2, r2, #0x2 */\n/* \tstrh\tr5, [r2] */\n/* \tadd\tr2, r2, #0x2 */\n/* \tlsl\tr1, r4, #0x18 */\n/* \tasr\tr1, r1, #0x18 */\n/* \tlsl\tr0, r6, #0x10 */\n/* \tasr\tr0, r0, #0x10 */\n/* \tadd\tr0, r0, r1 */\n/* \tneg\tr0, r0 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr6, r0, #0x10 */\n/* \tneg\tr1, r1 */\n/* \tlsl\tr1, r1, #0x18 */\n/* \tlsr\tr4, r1, #0x18 */\n/* \tadd\tr0, r7, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr7, r0, #0x18 */\n/* \tcmp\tr7, ip */\n/* \tbcc\t.L5\t@cond_branch */\n/* .L4: */\n/* \tadd\tsp, sp, #0x4 */\n/* \tpop\t{r3, r4} */\n/* \tmov\tr8, r3 */\n/* \tmov\tr9, r4 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r0} */\n/* \tbx\tr0 */\n/* .L8: */\n/* \t.align\t2, 0 */\n/* .L7: */\n/* \t.word\tgFlags */\n/* \t.word\tgHBlankCopyTarget */\n/* \t.word\t0x4000010 */\n/* \t.word\tgHBlankCopySize */\n/* \t.word\tgBgOffsetsHBlankPrimary */\n/* \t.word\t0x1ff */\n/* .Lfe1: */\n/* \t.size\t sa2__sub_8007958,.Lfe1-sa2__sub_8007958 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid sa2__sub_8007958(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sa2__sub_8007958': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":104,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sa2__sub_8007958': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern s32 gBgOffsetsHBlankPrimary;\nextern s32 gFlags;\nextern s8 gHBlankCopySize;\nextern s32 gHBlankCopyTarget;\n\nvoid sa2__sub_8007958(s32 arg0, u8 arg1, u8 arg2, u16 arg3, s32 arg5, s32 arg6, s32 arg7) {\n s8 temp_r1;\n u16 var_r6;\n u8 temp_r2;\n u8 var_r4;\n u8 var_r7;\n void *var_r2;\n\n var_r7 = arg1;\n temp_r2 = arg2;\n var_r6 = arg3;\n var_r4 = (u8) arg5;\n gFlags |= 4;\n gHBlankCopyTarget = ((u32) (arg0 << 0x18) >> 0x16) + 0x04000010;\n gHBlankCopySize = 4;\n var_r2 = gBgOffsetsHBlankPrimary + (var_r7 * 4);\n if ((u32) var_r7 < (u32) temp_r2) {\n do {\n var_r2->unk0 = (s16) (((u16) arg6 + var_r6) & 0x1FF);\n var_r2->unk2 = (u16) arg7;\n var_r2 = var_r2 + 2 + 2;\n temp_r1 = (s8) var_r4;\n var_r6 = 0 - ((s16) var_r6 + temp_r1);\n var_r4 = 0 - temp_r1;\n var_r7 += 1;\n } while ((u32) var_r7 < (u32) temp_r2);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":31,"gotos":0,"casts":11,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:919: conflicting types for `gBgOffsetsHBlankPrimary'","/c.c:877: previous declaration of `gBgOffsetsHBlankPrimary'","/c.c:920: conflicting types for `gFlags'","/c.c:917: previous declaration of `gFlags'","/c.c:921: conflicting types for `gHBlankCopySize'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8007958` — benchmark function sa3:sa2__sub_8007958:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007958\n\t.type\t sa2__sub_8007958,function\n\t.thumb_func\nsa2__sub_8007958:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x20]\n\tldr\tr5, [sp, #0x24]\n\tldr\tr6, [sp, #0x28]\n\tmov\tr8, r6\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr7, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tip, r2\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tmov\tr9, r5\n\tmov\tr1, r8\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r7, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tcmp\tr7, ip\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L7+0x14\n\tadd\tr3, r0, #0\n.L5:\n\tmov\tr1, r9\n\tadd\tr0, r1, r6\n\tand\tr0, r0, r3\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tstrh\tr5, [r2]\n\tadd\tr2, r2, #0x2\n\tlsl\tr1, r4, #0x18\n\tasr\tr1, r1, #0x18\n\tlsl\tr0, r6, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tneg\tr0, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr6, r0, #0x10\n\tneg\tr1, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr4, r1, #0x18\n\tadd\tr0, r7, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr7, r0, #0x18\n\tcmp\tr7, ip\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007958,.Lfe1-sa2__sub_8007958\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8007958 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8007958` — benchmark function sa3:sa2__sub_8007958:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8007958:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8007958\n\t.type\t sa2__sub_8007958,function\n\t.thumb_func\nsa2__sub_8007958:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r9\n\tmov\tr6, r8\n\tpush\t{r6, r7}\n\tadd\tsp, sp, #-0x4\n\tldr\tr4, [sp, #0x20]\n\tldr\tr5, [sp, #0x24]\n\tldr\tr6, [sp, #0x28]\n\tmov\tr8, r6\n\tlsl\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr7, r1, #0x18\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tip, r2\n\tlsl\tr3, r3, #0x10\n\tlsr\tr6, r3, #0x10\n\tlsl\tr4, r4, #0x18\n\tlsr\tr4, r4, #0x18\n\tlsl\tr5, r5, #0x10\n\tlsr\tr5, r5, #0x10\n\tmov\tr9, r5\n\tmov\tr1, r8\n\tlsl\tr1, r1, #0x10\n\tlsr\tr5, r1, #0x10\n\tldr\tr2, .L7\n\tldr\tr1, [r2]\n\tmov\tr3, #0x4\n\torr\tr1, r1, r3\n\tstr\tr1, [r2]\n\tldr\tr1, .L7+0x4\n\tlsr\tr0, r0, #0x16\n\tldr\tr2, .L7+0x8\n\tadd\tr0, r0, r2\n\tstr\tr0, [r1]\n\tldr\tr0, .L7+0xc\n\tstrb\tr3, [r0]\n\tldr\tr0, .L7+0x10\n\tlsl\tr1, r7, #0x2\n\tldr\tr0, [r0]\n\tadd\tr2, r0, r1\n\tcmp\tr7, ip\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L7+0x14\n\tadd\tr3, r0, #0\n.L5:\n\tmov\tr1, r9\n\tadd\tr0, r1, r6\n\tand\tr0, r0, r3\n\tstrh\tr0, [r2]\n\tadd\tr2, r2, #0x2\n\tstrh\tr5, [r2]\n\tadd\tr2, r2, #0x2\n\tlsl\tr1, r4, #0x18\n\tasr\tr1, r1, #0x18\n\tlsl\tr0, r6, #0x10\n\tasr\tr0, r0, #0x10\n\tadd\tr0, r0, r1\n\tneg\tr0, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr6, r0, #0x10\n\tneg\tr1, r1\n\tlsl\tr1, r1, #0x18\n\tlsr\tr4, r1, #0x18\n\tadd\tr0, r7, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr7, r0, #0x18\n\tcmp\tr7, ip\n\tbcc\t.L5\t@cond_branch\n.L4:\n\tadd\tsp, sp, #0x4\n\tpop\t{r3, r4}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L8:\n\t.align\t2, 0\n.L7:\n\t.word\tgFlags\n\t.word\tgHBlankCopyTarget\n\t.word\t0x4000010\n\t.word\tgHBlankCopySize\n\t.word\tgBgOffsetsHBlankPrimary\n\t.word\t0x1ff\n.Lfe1:\n\t.size\t sa2__sub_8007958,.Lfe1-sa2__sub_8007958\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_8007958\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8007958 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8083504:agbcc","sym":"sa2__sub_8083504","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","branch","fixed-point","shift"],"loc":26,"refSource":"void SA2_LABEL(sub_8083504)(UNK_8085D14_2 *arg0, UNK_8085D14_2 *arg1, UNK_8085D14_2 *arg2)\n{\n s32 var_r3, var_r4;\n\n if (arg1->unk2 != 0x400) {\n var_r3 = (arg1->unk2 * arg0->unk8) >> 0xA;\n arg2->unk2 = ((arg1->unk2 * arg0->unk2) >> 0xA);\n } else {\n var_r3 = arg0->unk8;\n }\n if (arg1->unk4 != 0x400) {\n var_r4 = (arg1->unk4 * arg0->unkC) >> 0xA;\n arg2->unk4 = ((arg1->unk4 * arg0->unk4) >> 0xA);\n } else {\n var_r4 = arg0->unkC;\n }\n\n if (arg1->unk0 != 0) {\n arg2->unk8 = (arg1->unk8 + (((var_r3 * (COS(arg1->unk0) >> 6)) >> 8) - ((var_r4 * (SIN(arg1->unk0) >> 6)) >> 8)));\n arg2->unkC = arg1->unkC + (((var_r3 * (SIN(arg1->unk0) >> 6)) >> 8) + ((var_r4 * (COS(arg1->unk0) >> 6)) >> 8));\n } else {\n arg2->unk8 = (arg1->unk8 + var_r3);\n arg2->unkC = arg1->unkC + var_r4;\n }\n arg2->unk0 = ((arg0->unk0 + arg1->unk0) & (SIN_PERIOD - 1));\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L67-L92","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8083504\n\t.type\t sa2__sub_8083504,function\n\t.thumb_func\nsa2__sub_8083504:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tadd\tr7, r2, #0\n\tmov\tr0, #0x2\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, [r6, #0x8]\n\tmul\tr0, r0, r1\n\tasr\tr3, r0, #0xa\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x2]\n\tb\t.L4\n.L3:\n\tldr\tr3, [r6, #0x8]\n.L4:\n\tmov\tr0, #0x4\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, [r6, #0xc]\n\tmul\tr0, r0, r1\n\tasr\tr4, r0, #0xa\n\tmov\tr2, #0x4\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x4]\n\tb\t.L6\n.L5:\n\tldr\tr4, [r6, #0xc]\n.L6:\n\tldrh\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr0, .L10\n\tmov\tip, r0\n\tldrh\tr1, [r5]\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tmov\tr8, r2\n\tadd\tr0, r1, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tsub\tr2, r2, r0\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r2\n\tstr\tr0, [r7, #0x8]\n\tldrh\tr1, [r5]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tadd\tr1, r1, r8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tadd\tr2, r2, r0\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r2\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgSineTable\n.L7:\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r3\n\tstr\tr0, [r7, #0x8]\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r4\n.L9:\n\tstr\tr0, [r7, #0xc]\n\tldrh\tr0, [r5]\n\tldrh\tr6, [r6]\n\tadd\tr0, r0, r6\n\tldr\tr2, .L12\n\tadd\tr1, r2, #0\n\tand\tr0, r0, r1\n\tstrh\tr0, [r7]\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0x3ff\n.Lfe1:\n\t.size\t sa2__sub_8083504,.Lfe1-sa2__sub_8083504\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-13f369a7ed62.i.gz","proto":{"sa2__sub_8083504":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/raw-globals","symbolsUsed":[{"name":"gSineTable","shape":"s16[]"}],"outcome":"nonmatch","source":"struct Struct0 { u16 field_0; u8 _pad0[6]; s32 field_8; s32 field_12; };\nstruct Struct1 { u16 field_0; u16 field_2; u16 field_4; s32 field_8; s32 field_12; };\nstruct Struct2 { u16 field_0; u8 _pad0[6]; s32 field_8; s32 field_12; };\nvoid sa2__sub_8083504(struct Struct0 * a0, struct Struct2 * a1, struct Struct1 * a2, u32 a3) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n s32 v6;\n u16 * p0;\n p0 = (u16 *)&gSineTable;\n v0 = *(s16 *)(a1 + 2);\n if (v0 == 128 << 3) {\n v4 = a0->field_8;\n } else {\n v1 = a0->field_8;\n a2->field_2 = (s32)(*(s16 *)(a0 + 2) * v0) >> 10;\n v4 = v1 * v0 >> 10;\n }\n v2 = *(s16 *)(a1 + 4);\n if (v2 == 128 << 3) {\n v5 = a0->field_12;\n } else {\n v3 = a0->field_12;\n a2->field_4 = (s32)(*(s16 *)(a0 + 4) * v2) >> 10;\n v5 = v3 * v2 >> 10;\n }\n if (a1->field_0 == 0) {\n a2->field_8 = a1->field_8 + v4;\n v6 = a1->field_12 + v5;\n } else {\n a2->field_8 = a1->field_8 + ((v4 * (p0[a1->field_0 + (128 << 1)] << 16 >> 22) >> 8) - ((p0[a1->field_0] << 16 >> 22) * v5 >> 8));\n v6 = a1->field_12 + ((v4 * (p0[a1->field_0] << 16 >> 22) >> 8) + ((p0[a1->field_0 + (128 << 1)] << 16 >> 22) * v5 >> 8));\n }\n a2->field_12 = v6;\n a2->field_0 = a1->field_0 + a0->field_0 & 1023;\n return;\n}\n","score":85,"maxScore":125,"compileErrors":null,"breakdown":{"insert":17,"delete":15,"replace":11,"opMismatch":3,"argMismatch":39},"quality":{"score":74,"lines":40,"gotos":0,"casts":7,"unkGlue":0,"rawMem":4,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sa2__sub_8083504(void *arg0, void *arg1, void *arg2) {\n s16 temp_r1;\n s16 temp_r1_2;\n s32 var_r0;\n s32 var_r3;\n s32 var_r4;\n u16 temp_r1_3;\n u16 temp_r1_4;\n\n temp_r1 = arg1->unk2;\n if (temp_r1 != 0x400) {\n var_r3 = (s32) (arg0->unk8 * temp_r1) >> 0xA;\n arg2->unk2 = (s16) ((s32) (arg0->unk2 * temp_r1) >> 0xA);\n } else {\n var_r3 = arg0->unk8;\n }\n temp_r1_2 = arg1->unk4;\n if (temp_r1_2 != 0x400) {\n var_r4 = (s32) (arg0->unkC * temp_r1_2) >> 0xA;\n arg2->unk4 = (s16) ((s32) (arg0->unk4 * temp_r1_2) >> 0xA);\n } else {\n var_r4 = arg0->unkC;\n }\n if (arg1->unk0 != 0) {\n temp_r1_3 = arg1->unk0;\n arg2->unk8 = (s32) (arg1->unk8 + (((s32) (var_r3 * ((s32) ((u16) gSineTable[temp_r1_3 + 0x100] << 0x10) >> 0x16)) >> 8) - ((s32) (((s32) ((u16) gSineTable[temp_r1_3] << 0x10) >> 0x16) * var_r4) >> 8)));\n temp_r1_4 = arg1->unk0;\n var_r0 = arg1->unkC + (((s32) (var_r3 * ((s32) ((u16) gSineTable[temp_r1_4] << 0x10) >> 0x16)) >> 8) + ((s32) (((s32) ((u16) gSineTable[temp_r1_4 + 0x100] << 0x10) >> 0x16) * var_r4) >> 8));\n } else {\n arg2->unk8 = (s32) (arg1->unk8 + var_r3);\n var_r0 = arg1->unkC + var_r4;\n }\n arg2->unkC = var_r0;\n arg2->unk0 = (s16) ((arg1->unk0 + arg0->unk0) & 0x3FF);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":34,"gotos":0,"casts":21,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:330: warning: dereferencing `void *' pointer","/c.c:330: request for member `unk2' in something not a structure or union","/c.c:332: warning: dereferencing `void *' pointer","/c.c:332: request for member `unk8' in something not a structure or union","/c.c:333: warning: dereferencing `void *' pointer"]},"gapSize":{"decompiler":"asmlift","score":85,"maxScore":125,"ratio":0.68,"kinds":{"insert":17,"delete":15,"replace":11,"opMismatch":3,"argMismatch":39}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8083504` — benchmark function sa3:sa2__sub_8083504:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8083504\n\t.type\t sa2__sub_8083504,function\n\t.thumb_func\nsa2__sub_8083504:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tadd\tr7, r2, #0\n\tmov\tr0, #0x2\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, [r6, #0x8]\n\tmul\tr0, r0, r1\n\tasr\tr3, r0, #0xa\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x2]\n\tb\t.L4\n.L3:\n\tldr\tr3, [r6, #0x8]\n.L4:\n\tmov\tr0, #0x4\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, [r6, #0xc]\n\tmul\tr0, r0, r1\n\tasr\tr4, r0, #0xa\n\tmov\tr2, #0x4\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x4]\n\tb\t.L6\n.L5:\n\tldr\tr4, [r6, #0xc]\n.L6:\n\tldrh\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr0, .L10\n\tmov\tip, r0\n\tldrh\tr1, [r5]\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tmov\tr8, r2\n\tadd\tr0, r1, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tsub\tr2, r2, r0\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r2\n\tstr\tr0, [r7, #0x8]\n\tldrh\tr1, [r5]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tadd\tr1, r1, r8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tadd\tr2, r2, r0\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r2\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgSineTable\n.L7:\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r3\n\tstr\tr0, [r7, #0x8]\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r4\n.L9:\n\tstr\tr0, [r7, #0xc]\n\tldrh\tr0, [r5]\n\tldrh\tr6, [r6]\n\tadd\tr0, r0, r6\n\tldr\tr2, .L12\n\tadd\tr1, r2, #0\n\tand\tr0, r0, r1\n\tstrh\tr0, [r7]\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0x3ff\n.Lfe1:\n\t.size\t sa2__sub_8083504,.Lfe1-sa2__sub_8083504\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-13f369a7ed62.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8083504 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8083504` — benchmark function sa3:sa2__sub_8083504:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8083504:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8083504\n\t.type\t sa2__sub_8083504,function\n\t.thumb_func\nsa2__sub_8083504:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr6, r0, #0\n\tadd\tr5, r1, #0\n\tadd\tr7, r2, #0\n\tmov\tr0, #0x2\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tldr\tr0, [r6, #0x8]\n\tmul\tr0, r0, r1\n\tasr\tr3, r0, #0xa\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x2]\n\tb\t.L4\n.L3:\n\tldr\tr3, [r6, #0x8]\n.L4:\n\tmov\tr0, #0x4\n\tldrsh\tr1, [r5, r0]\n\tmov\tr0, #0x80\n\tlsl\tr0, r0, #0x3\n\tcmp\tr1, r0\n\tbeq\t.L5\t@cond_branch\n\tldr\tr0, [r6, #0xc]\n\tmul\tr0, r0, r1\n\tasr\tr4, r0, #0xa\n\tmov\tr2, #0x4\n\tldrsh\tr0, [r6, r2]\n\tmul\tr0, r0, r1\n\tasr\tr0, r0, #0xa\n\tstrh\tr0, [r7, #0x4]\n\tb\t.L6\n.L5:\n\tldr\tr4, [r6, #0xc]\n.L6:\n\tldrh\tr0, [r5]\n\tcmp\tr0, #0\n\tbeq\t.L7\t@cond_branch\n\tldr\tr0, .L10\n\tmov\tip, r0\n\tldrh\tr1, [r5]\n\tmov\tr2, #0x80\n\tlsl\tr2, r2, #0x1\n\tmov\tr8, r2\n\tadd\tr0, r1, r2\n\tlsl\tr0, r0, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tsub\tr2, r2, r0\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r2\n\tstr\tr0, [r7, #0x8]\n\tldrh\tr1, [r5]\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, ip\n\tldrh\tr0, [r0]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmov\tr2, r3\n\tmul\tr2, r2, r0\n\tasr\tr2, r2, #0x8\n\tadd\tr1, r1, r8\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, ip\n\tldrh\tr0, [r1]\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x16\n\tmul\tr0, r0, r4\n\tasr\tr0, r0, #0x8\n\tadd\tr2, r2, r0\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r2\n\tb\t.L9\n.L11:\n\t.align\t2, 0\n.L10:\n\t.word\tgSineTable\n.L7:\n\tldr\tr0, [r5, #0x8]\n\tadd\tr0, r0, r3\n\tstr\tr0, [r7, #0x8]\n\tldr\tr0, [r5, #0xc]\n\tadd\tr0, r0, r4\n.L9:\n\tstr\tr0, [r7, #0xc]\n\tldrh\tr0, [r5]\n\tldrh\tr6, [r6]\n\tadd\tr0, r0, r6\n\tldr\tr2, .L12\n\tadd\tr1, r2, #0\n\tand\tr0, r0, r1\n\tstrh\tr0, [r7]\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.L13:\n\t.align\t2, 0\n.L12:\n\t.word\t0x3ff\n.Lfe1:\n\t.size\t sa2__sub_8083504,.Lfe1-sa2__sub_8083504\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_8083504\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8083504 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_80838CC:agbcc","sym":"sa2__sub_80838CC","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","arithmetic","shift"],"loc":7,"refSource":"void SA2_LABEL(sub_80838CC)(UNK_8085D14 *arg0, UNK_8085D14 *arg1, UNK_8085D14 *arg2)\n{\n arg2->unk0 = (((arg0->unk6 * arg1->unk0) + (arg0->unk0 * arg1->unk6) + (arg0->unk2 * arg1->unk4)) - (arg0->unk4 * arg1->unk2)) >> 0xA;\n arg2->unk2 = (((arg0->unk6 * arg1->unk2) - (arg0->unk0 * arg1->unk4)) + (arg0->unk2 * arg1->unk6) + (arg0->unk4 * arg1->unk0)) >> 0xA;\n arg2->unk4 = ((((arg0->unk6 * arg1->unk4) + (arg0->unk0 * arg1->unk2)) - (arg0->unk2 * arg1->unk0)) + (arg0->unk4 * arg1->unk6)) >> 0xA;\n arg2->unk6 = ((((arg0->unk6 * arg1->unk6) - (arg0->unk0 * arg1->unk0)) - (arg0->unk2 * arg1->unk2)) - (arg0->unk4 * arg1->unk4)) >> 0xA;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L177-L183","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80838CC\n\t.type\t sa2__sub_80838CC,function\n\t.thumb_func\nsa2__sub_80838CC:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x0\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x2\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x4\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x4]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x6\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr5, #0x4\n\tldrsh\tr4, [r0, r5]\n\tmov\tr6, #0x4\n\tldrsh\tr0, [r1, r6]\n\tmul\tr0, r0, r4\n\tsub\tr3, r3, r0\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x6]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_80838CC,.Lfe1-sa2__sub_80838CC\n\n.text\n\t.align\t2, 0\n","proto":{"sa2__sub_80838CC":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void sa2__sub_80838CC(s16 * a0, s16 * a1, u16 * a2) {\n *a2 = *(a1 + 0) * *(a0 + 3) + *(a1 + 3) * *(a0 + 0) + *(a1 + 2) * *(a0 + 1) - *(a1 + 1) * *(a0 + 2) >> 10;\n a2[1] = *(a1 + 1) * *(a0 + 3) - *(a1 + 2) * *(a0 + 0) + *(a1 + 3) * *(a0 + 1) + *(a1 + 0) * *(a0 + 2) >> 10;\n a2[2] = *(a1 + 2) * *(a0 + 3) + *(a1 + 1) * *(a0 + 0) - *(a1 + 0) * *(a0 + 1) + *(a1 + 3) * *(a0 + 2) >> 10;\n a2[3] = *(a1 + 3) * *(a0 + 3) - *(a1 + 0) * *(a0 + 0) - *(a1 + 1) * *(a0 + 1) - *(a1 + 2) * *(a0 + 2) >> 10;\n return;\n}\n","score":59,"maxScore":104,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":59},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sa2__sub_80838CC(void *arg0, void *arg1, void *arg2) {\n arg2->unk0 = (s16) ((s32) (((arg1->unk0 * arg0->unk6) + (arg1->unk6 * arg0->unk0) + (arg1->unk4 * arg0->unk2)) - (arg1->unk2 * arg0->unk4)) >> 0xA);\n arg2->unk2 = (s16) ((s32) (((arg1->unk2 * arg0->unk6) - (arg1->unk4 * arg0->unk0)) + (arg1->unk6 * arg0->unk2) + (arg1->unk0 * arg0->unk4)) >> 0xA);\n arg2->unk4 = (s16) ((s32) ((((arg1->unk4 * arg0->unk6) + (arg1->unk2 * arg0->unk0)) - (arg1->unk0 * arg0->unk2)) + (arg1->unk6 * arg0->unk4)) >> 0xA);\n arg2->unk6 = (s16) ((s32) ((((arg1->unk6 * arg0->unk6) - (arg1->unk0 * arg0->unk0)) - (arg1->unk2 * arg0->unk2)) - (arg1->unk4 * arg0->unk4)) >> 0xA);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":6,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:323: warning: dereferencing `void *' pointer","/c.c:323: request for member `unk0' in something not a structure or union","/c.c:323: request for member `unk6' in something not a structure or union","/c.c:323: request for member `unk4' in something not a structure or union","/c.c:323: request for member `unk2' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":59,"maxScore":104,"ratio":0.5673076923076923,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":59}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80838CC` — benchmark function sa3:sa2__sub_80838CC:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80838CC\n\t.type\t sa2__sub_80838CC,function\n\t.thumb_func\nsa2__sub_80838CC:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x0\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x2\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x4\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x4]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x6\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr5, #0x4\n\tldrsh\tr4, [r0, r5]\n\tmov\tr6, #0x4\n\tldrsh\tr0, [r1, r6]\n\tmul\tr0, r0, r4\n\tsub\tr3, r3, r0\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x6]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_80838CC,.Lfe1-sa2__sub_80838CC\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80838CC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80838CC` — benchmark function sa3:sa2__sub_80838CC:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80838CC:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80838CC\n\t.type\t sa2__sub_80838CC,function\n\t.thumb_func\nsa2__sub_80838CC:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x0\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x2\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x4\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x2]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x4\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x4\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x6\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tadd\tr3, r3, r4\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x4]\n\tmov\tr3, #0x6\n\tldrsh\tr4, [r0, r3]\n\tmov\tr5, #0x6\n\tldrsh\tr3, [r1, r5]\n\tmul\tr3, r3, r4\n\tmov\tr6, #0x0\n\tldrsh\tr5, [r0, r6]\n\tmov\tr6, #0x0\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr4, #0x2\n\tldrsh\tr5, [r0, r4]\n\tmov\tr6, #0x2\n\tldrsh\tr4, [r1, r6]\n\tmul\tr4, r4, r5\n\tsub\tr3, r3, r4\n\tmov\tr5, #0x4\n\tldrsh\tr4, [r0, r5]\n\tmov\tr6, #0x4\n\tldrsh\tr0, [r1, r6]\n\tmul\tr0, r0, r4\n\tsub\tr3, r3, r0\n\tasr\tr3, r3, #0xa\n\tstrh\tr3, [r2, #0x6]\n\tpop\t{r4, r5, r6}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_80838CC,.Lfe1-sa2__sub_80838CC\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_80838CC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80838CC # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_808399C:agbcc","sym":"sa2__sub_808399C","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","arithmetic","shift"],"loc":10,"refSource":"void SA2_LABEL(sub_808399C)(UNK_8085D14 *arg0, UNK_8085D14 *arg1)\n{\n s16 r6 = arg0->unk0;\n s16 r5 = arg0->unk2;\n s16 r4 = arg0->unk4;\n arg0->unk0 = (((arg0->unk6 * arg1->unk0) + (r6 * arg1->unk6) + (r5 * arg1->unk4)) - (r4 * arg1->unk2)) >> 10;\n arg0->unk2 = (((arg0->unk6 * arg1->unk2) - (r6 * arg1->unk4)) + (r5 * arg1->unk6) + (r4 * arg1->unk0)) >> 10;\n arg0->unk4 = ((((arg0->unk6 * arg1->unk4) + (r6 * arg1->unk2)) - (r5 * arg1->unk0)) + (r4 * arg1->unk6)) >> 10;\n arg0->unk6 = ((((arg0->unk6 * arg1->unk6) - (r6 * arg1->unk0)) - (r5 * arg1->unk2)) - (r4 * arg1->unk4)) >> 10;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L185-L194","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808399C\n\t.type\t sa2__sub_808399C,function\n\t.thumb_func\nsa2__sub_808399C:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr4, #0x0\n\tldrsh\tr2, [r1, r4]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr6, [r0, r7]\n\tmov\tr4, #0x6\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr5, [r0, r7]\n\tmov\tr4, #0x4\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr4, [r0, r7]\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tsub\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x2\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x2]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x4\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x4]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x6\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr6, #0x2\n\tldrsh\tr3, [r1, r6]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr1, [r1, r7]\n\tmul\tr1, r1, r4\n\tsub\tr2, r2, r1\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_808399C,.Lfe1-sa2__sub_808399C\n\n.text\n\t.align\t2, 0\n","proto":{"sa2__sub_808399C":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"void sa2__sub_808399C(u16 * a0, s16 * a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n v0 = *(a0 + 0);\n v1 = *(a0 + 1);\n v2 = *(a0 + 2);\n *a0 = *(a1 + 0) * *(a0 + 3) + *(a1 + 3) * v0 + *(a1 + 2) * v1 - *(a1 + 1) * v2 >> 10;\n a0[1] = *(a1 + 1) * *(a0 + 3) - *(a1 + 2) * v0 + *(a1 + 3) * v1 + *(a1 + 0) * v2 >> 10;\n a0[2] = *(a1 + 2) * *(a0 + 3) + *(a1 + 1) * v0 - *(a1 + 0) * v1 + *(a1 + 3) * v2 >> 10;\n a0[3] = *(a1 + 3) * *(a0 + 3) - *(a1 + 0) * v0 - *(a1 + 1) * v1 - *(a1 + 2) * v2 >> 10;\n return;\n}\n","score":41,"maxScore":90,"compileErrors":null,"breakdown":{"insert":4,"delete":11,"replace":3,"opMismatch":0,"argMismatch":23},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sa2__sub_808399C(void *arg0, void *arg1) {\n s16 temp_r4;\n s16 temp_r5;\n s16 temp_r6;\n\n temp_r6 = arg0->unk0;\n temp_r5 = arg0->unk2;\n temp_r4 = arg0->unk4;\n arg0->unk0 = (s16) ((s32) (((arg1->unk0 * arg0->unk6) + (arg1->unk6 * temp_r6) + (arg1->unk4 * temp_r5)) - (arg1->unk2 * temp_r4)) >> 0xA);\n arg0->unk2 = (s16) ((s32) (((arg1->unk2 * arg0->unk6) - (arg1->unk4 * temp_r6)) + (arg1->unk6 * temp_r5) + (arg1->unk0 * temp_r4)) >> 0xA);\n arg0->unk4 = (s16) ((s32) ((((arg1->unk4 * arg0->unk6) + (arg1->unk2 * temp_r6)) - (arg1->unk0 * temp_r5)) + (arg1->unk6 * temp_r4)) >> 0xA);\n arg0->unk6 = (s16) ((s32) ((((arg1->unk6 * arg0->unk6) - (arg1->unk0 * temp_r6)) - (arg1->unk2 * temp_r5)) - (arg1->unk4 * temp_r4)) >> 0xA);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":12,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["agbcc failed: /c.c:327: warning: dereferencing `void *' pointer","/c.c:327: request for member `unk0' in something not a structure or union","/c.c:328: warning: dereferencing `void *' pointer","/c.c:328: request for member `unk2' in something not a structure or union","/c.c:329: warning: dereferencing `void *' pointer"]},"gapSize":{"decompiler":"asmlift","score":41,"maxScore":90,"ratio":0.45555555555555555,"kinds":{"insert":4,"delete":11,"replace":3,"opMismatch":0,"argMismatch":23}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_808399C` — benchmark function sa3:sa2__sub_808399C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808399C\n\t.type\t sa2__sub_808399C,function\n\t.thumb_func\nsa2__sub_808399C:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr4, #0x0\n\tldrsh\tr2, [r1, r4]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr6, [r0, r7]\n\tmov\tr4, #0x6\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr5, [r0, r7]\n\tmov\tr4, #0x4\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr4, [r0, r7]\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tsub\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x2\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x2]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x4\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x4]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x6\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr6, #0x2\n\tldrsh\tr3, [r1, r6]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr1, [r1, r7]\n\tmul\tr1, r1, r4\n\tsub\tr2, r2, r1\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_808399C,.Lfe1-sa2__sub_808399C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_808399C # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_808399C` — benchmark function sa3:sa2__sub_808399C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_808399C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808399C\n\t.type\t sa2__sub_808399C,function\n\t.thumb_func\nsa2__sub_808399C:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr4, #0x0\n\tldrsh\tr2, [r1, r4]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr6, [r0, r7]\n\tmov\tr4, #0x6\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr5, [r0, r7]\n\tmov\tr4, #0x4\n\tldrsh\tr3, [r1, r4]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr4, [r0, r7]\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tsub\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x2\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x2]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x4\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x2\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tadd\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x6\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r4\n\tadd\tr2, r2, r3\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x4]\n\tmov\tr2, #0x6\n\tldrsh\tr3, [r0, r2]\n\tmov\tr7, #0x6\n\tldrsh\tr2, [r1, r7]\n\tmul\tr2, r2, r3\n\tmov\tr7, #0x0\n\tldrsh\tr3, [r1, r7]\n\tmul\tr3, r3, r6\n\tsub\tr2, r2, r3\n\tmov\tr6, #0x2\n\tldrsh\tr3, [r1, r6]\n\tmul\tr3, r3, r5\n\tsub\tr2, r2, r3\n\tmov\tr7, #0x4\n\tldrsh\tr1, [r1, r7]\n\tmul\tr1, r1, r4\n\tsub\tr2, r2, r1\n\tasr\tr2, r2, #0xa\n\tstrh\tr2, [r0, #0x6]\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t sa2__sub_808399C,.Lfe1-sa2__sub_808399C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sa2__sub_808399C\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_808399C # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_808558C:agbcc","sym":"sa2__sub_808558C","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","bitwise","branch","shift"],"loc":14,"refSource":"s16 SA2_LABEL(sub_808558C)(u16 angleA, u16 angleB, u8 numDecimalBits)\n{\n u32 c1 = (1 << numDecimalBits);\n u16 c2 = c1 - 1;\n\n angleB -= angleA;\n angleB &= c2;\n\n if (angleB <= (c1 / 2)) {\n return angleB;\n } else {\n return (angleB - c1);\n }\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L469-L482","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808558C\n\t.type\t sa2__sub_808558C,function\n\t.thumb_func\nsa2__sub_808558C:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr4, #0x1\n\tlsl\tr4, r4, r2\n\tsub\tr1, r4, #0x1\n\tsub\tr0, r3, r0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tlsr\tr0, r4, #0x1\n\tcmp\tr3, r0\n\tbls\t.L3\t@cond_branch\n\tsub\tr0, r3, r4\n\tlsl\tr0, r0, #0x10\n\tb\t.L7\n.L3:\n\tlsl\tr0, r3, #0x10\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_808558C,.Lfe1-sa2__sub_808558C\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 sa2__sub_808558C(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n if ((u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) <= (u32)(1 << (u8)a2) >> 1) {\n v0 = (u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) << 16;\n } else {\n v0 = (u16)((u16)a1 - (u16)a0 & (1 << (u8)a2) - 1) - (1 << (u8)a2) << 16;\n }\n return v0 >> 16;\n}\n","score":22,"maxScore":26,"compileErrors":null,"breakdown":{"insert":1,"delete":8,"replace":4,"opMismatch":1,"argMismatch":8},"quality":{"score":88,"lines":9,"gotos":0,"casts":15,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sa2__sub_808558C(u16 arg0, u16 arg1, u8 arg2) {\n s32 var_r0;\n u16 temp_r3;\n u32 temp_r4;\n\n temp_r4 = 1 << arg2;\n temp_r3 = (arg1 - arg0) & (temp_r4 - 1);\n if ((u32) temp_r3 > (u32) (temp_r4 >> 1)) {\n var_r0 = (temp_r3 - temp_r4) << 0x10;\n } else {\n var_r0 = temp_r3 << 0x10;\n }\n return var_r0 >> 0x10;\n}\n","score":16,"maxScore":25,"compileErrors":null,"breakdown":{"insert":0,"delete":3,"replace":3,"opMismatch":0,"argMismatch":10},"quality":{"score":100,"lines":13,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":16,"maxScore":25,"ratio":0.64,"kinds":{"insert":0,"delete":3,"replace":3,"opMismatch":0,"argMismatch":10}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_808558C` — benchmark function sa3:sa2__sub_808558C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808558C\n\t.type\t sa2__sub_808558C,function\n\t.thumb_func\nsa2__sub_808558C:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr4, #0x1\n\tlsl\tr4, r4, r2\n\tsub\tr1, r4, #0x1\n\tsub\tr0, r3, r0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tlsr\tr0, r4, #0x1\n\tcmp\tr3, r0\n\tbls\t.L3\t@cond_branch\n\tsub\tr0, r3, r4\n\tlsl\tr0, r0, #0x10\n\tb\t.L7\n.L3:\n\tlsl\tr0, r3, #0x10\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_808558C,.Lfe1-sa2__sub_808558C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_808558C # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_808558C` — benchmark function sa3:sa2__sub_808558C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_808558C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808558C\n\t.type\t sa2__sub_808558C,function\n\t.thumb_func\nsa2__sub_808558C:\n\tpush\t{r4, lr}\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tlsr\tr3, r1, #0x10\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr4, #0x1\n\tlsl\tr4, r4, r2\n\tsub\tr1, r4, #0x1\n\tsub\tr0, r3, r0\n\tand\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tlsr\tr0, r4, #0x1\n\tcmp\tr3, r0\n\tbls\t.L3\t@cond_branch\n\tsub\tr0, r3, r4\n\tlsl\tr0, r0, #0x10\n\tb\t.L7\n.L3:\n\tlsl\tr0, r3, #0x10\n.L7:\n\tasr\tr0, r0, #0x10\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_808558C,.Lfe1-sa2__sub_808558C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_808558C # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_80855C0:agbcc","sym":"sa2__sub_80855C0","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","int64","shift"],"loc":6,"refSource":"u32 SA2_LABEL(sub_80855C0)(s32 a, s32 b, s32 c, u8 d)\n{\n s64 e = (s64)c * (a - b);\n\n return a - (e >> d);\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L484-L489","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80855C0\n\t.type\t sa2__sub_80855C0,function\n\t.thumb_func\nsa2__sub_80855C0:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr6, r8\n\tpush\t{r6}\n\tmov\tr8, r0\n\tadd\tr4, r1, #0\n\tadd\tr0, r2, #0\n\tlsl\tr6, r3, #0x18\n\tlsr\tr6, r6, #0x18\n\tasr\tr1, r0, #0x1f\n\tmov\tr2, r8\n\tsub\tr4, r2, r4\n\tasr\tr5, r4, #0x1f\n\tadd\tr3, r5, #0\n\tadd\tr2, r4, #0\n\tbl\t__muldi3\n\tadd\tr2, r6, #0\n\tbl\t__ashrdi3\n\tmov\tr2, r8\n\tsub\tr2, r2, r0\n\tmov\tr8, r2\n\tmov\tr0, r8\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80855C0,.Lfe1-sa2__sub_80855C0\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"nonmatch","source":"s32 sa2__sub_80855C0(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4) {\n return a0 - __ashrdi3(__muldi3(a2, a2 >> 31, a0 - a1, a0 - a1 >> 31), a2 >> 31, (u8)a3, a0 - a1 >> 31);\n}\n","score":31,"maxScore":38,"compileErrors":null,"breakdown":{"insert":12,"delete":7,"replace":2,"opMismatch":0,"argMismatch":10},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 __ashrdi3(s32, s32, u8); /* extern */\ns32 __muldi3(s32, s32, s32, s32); /* extern */\n\ns32 sa2__sub_80855C0(s32 arg0, s32 arg1, s32 arg2, u8 arg3) {\n s32 temp_r4;\n s32 temp_ret;\n\n temp_r4 = arg0 - arg1;\n temp_ret = __muldi3(arg2, arg2 >> 0x1F, temp_r4, temp_r4 >> 0x1F);\n return arg0 - __ashrdi3(temp_ret, SECOND_REG(temp_ret), arg3);\n}\n","score":20,"maxScore":28,"compileErrors":null,"breakdown":{"insert":2,"delete":6,"replace":1,"opMismatch":0,"argMismatch":11},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":20,"maxScore":28,"ratio":0.7142857142857143,"kinds":{"insert":2,"delete":6,"replace":1,"opMismatch":0,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80855C0` — benchmark function sa3:sa2__sub_80855C0:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80855C0\n\t.type\t sa2__sub_80855C0,function\n\t.thumb_func\nsa2__sub_80855C0:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr6, r8\n\tpush\t{r6}\n\tmov\tr8, r0\n\tadd\tr4, r1, #0\n\tadd\tr0, r2, #0\n\tlsl\tr6, r3, #0x18\n\tlsr\tr6, r6, #0x18\n\tasr\tr1, r0, #0x1f\n\tmov\tr2, r8\n\tsub\tr4, r2, r4\n\tasr\tr5, r4, #0x1f\n\tadd\tr3, r5, #0\n\tadd\tr2, r4, #0\n\tbl\t__muldi3\n\tadd\tr2, r6, #0\n\tbl\t__ashrdi3\n\tmov\tr2, r8\n\tsub\tr2, r2, r0\n\tmov\tr8, r2\n\tmov\tr0, r8\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80855C0,.Lfe1-sa2__sub_80855C0\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80855C0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80855C0` — benchmark function sa3:sa2__sub_80855C0:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80855C0:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80855C0\n\t.type\t sa2__sub_80855C0,function\n\t.thumb_func\nsa2__sub_80855C0:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr6, r8\n\tpush\t{r6}\n\tmov\tr8, r0\n\tadd\tr4, r1, #0\n\tadd\tr0, r2, #0\n\tlsl\tr6, r3, #0x18\n\tlsr\tr6, r6, #0x18\n\tasr\tr1, r0, #0x1f\n\tmov\tr2, r8\n\tsub\tr4, r2, r4\n\tasr\tr5, r4, #0x1f\n\tadd\tr3, r5, #0\n\tadd\tr2, r4, #0\n\tbl\t__muldi3\n\tadd\tr2, r6, #0\n\tbl\t__ashrdi3\n\tmov\tr2, r8\n\tsub\tr2, r2, r0\n\tmov\tr8, r2\n\tmov\tr0, r8\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80855C0,.Lfe1-sa2__sub_80855C0\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80855C0 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8085654:agbcc","sym":"sa2__sub_8085654","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","arithmetic","int64","shift"],"loc":9,"refSource":"s32 SA2_LABEL(sub_8085654)(s32 a, s32 b, s32 c, u8 d, u8 e)\n{\n do {\n a -= (((s64)c * (s64)(a - b))) >> d;\n e -= 1;\n } while (e != 0xFF);\n\n return a;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L509-L517","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085654\n\t.type\t sa2__sub_8085654,function\n\t.thumb_func\nsa2__sub_8085654:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr4, r0, #0\n\tmov\tr8, r1\n\tadd\tr6, r2, #0\n\tldr\tr0, [sp, #0x18]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr7, r3, #0x18\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n.L3:\n\tadd\tr0, r6, #0\n\tasr\tr1, r6, #0x1f\n\tmov\tr3, r8\n\tsub\tr2, r4, r3\n\tasr\tr3, r2, #0x1f\n\tbl\t__muldi3\n\tadd\tr2, r7, #0\n\tbl\t__ashrdi3\n\tsub\tr4, r4, r0\n\tsub\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0xff\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r4, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8085654,.Lfe1-sa2__sub_8085654\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'sa2__sub_8085654' — lift: cannot lift 'sa2__sub_8085654': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tsa2__sub_8085654 */\n/* \t.type\t sa2__sub_8085654,function */\n/* \t.thumb_func */\n/* sa2__sub_8085654: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, r8 */\n/* \tpush\t{r7} */\n/* \tadd\tr4, r0, #0 */\n/* \tmov\tr8, r1 */\n/* \tadd\tr6, r2, #0 */\n/* \tldr\tr0, [sp, #0x18] */\n/* \tlsl\tr3, r3, #0x18 */\n/* \tlsr\tr7, r3, #0x18 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* .L3: */\n/* \tadd\tr0, r6, #0 */\n/* \tasr\tr1, r6, #0x1f */\n/* \tmov\tr3, r8 */\n/* \tsub\tr2, r4, r3 */\n/* \tasr\tr3, r2, #0x1f */\n/* \tbl\t__muldi3 */\n/* \tadd\tr2, r7, #0 */\n/* \tbl\t__ashrdi3 */\n/* \tsub\tr4, r4, r0 */\n/* \tsub\tr0, r5, #0x1 */\n/* \tlsl\tr0, r0, #0x18 */\n/* \tlsr\tr5, r0, #0x18 */\n/* \tcmp\tr5, #0xff */\n/* \tbne\t.L3\t@cond_branch */\n/* \tadd\tr0, r4, #0 */\n/* \tpop\t{r3} */\n/* \tmov\tr8, r3 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .Lfe1: */\n/* \t.size\t sa2__sub_8085654,.Lfe1-sa2__sub_8085654 */\n/* .text */\n/* \t.align\t2, 0 */\nvoid sa2__sub_8085654(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sa2__sub_8085654': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":50,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sa2__sub_8085654': stack pointer used as data (address-taken local / sp-relative slot / frame arithmetic) — local stack frames not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 __ashrdi3(s32, s32, u8); /* extern */\ns32 __muldi3(s32, s32, s32, s32); /* extern */\n\ns32 sa2__sub_8085654(s32 arg0, s32 arg1, s32 arg2, u8 arg3, s32 arg4) {\n s32 temp_r2;\n s32 temp_ret;\n s32 var_r4;\n u8 var_r5;\n\n var_r4 = arg0;\n var_r5 = (u8) arg4;\n do {\n temp_r2 = var_r4 - arg1;\n temp_ret = __muldi3(arg2, arg2 >> 0x1F, temp_r2, temp_r2 >> 0x1F);\n var_r4 -= __ashrdi3(temp_ret, SECOND_REG(temp_ret), arg3);\n var_r5 -= 1;\n } while (var_r5 != 0xFF);\n return var_r4;\n}\n","score":31,"maxScore":40,"compileErrors":null,"breakdown":{"insert":9,"delete":2,"replace":3,"opMismatch":0,"argMismatch":17},"quality":{"score":100,"lines":17,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":31,"maxScore":40,"ratio":0.775,"kinds":{"insert":9,"delete":2,"replace":3,"opMismatch":0,"argMismatch":17}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085654` — benchmark function sa3:sa2__sub_8085654:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085654\n\t.type\t sa2__sub_8085654,function\n\t.thumb_func\nsa2__sub_8085654:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr4, r0, #0\n\tmov\tr8, r1\n\tadd\tr6, r2, #0\n\tldr\tr0, [sp, #0x18]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr7, r3, #0x18\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n.L3:\n\tadd\tr0, r6, #0\n\tasr\tr1, r6, #0x1f\n\tmov\tr3, r8\n\tsub\tr2, r4, r3\n\tasr\tr3, r2, #0x1f\n\tbl\t__muldi3\n\tadd\tr2, r7, #0\n\tbl\t__ashrdi3\n\tsub\tr4, r4, r0\n\tsub\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0xff\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r4, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8085654,.Lfe1-sa2__sub_8085654\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085654 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085654` — benchmark function sa3:sa2__sub_8085654:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085654:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085654\n\t.type\t sa2__sub_8085654,function\n\t.thumb_func\nsa2__sub_8085654:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, r8\n\tpush\t{r7}\n\tadd\tr4, r0, #0\n\tmov\tr8, r1\n\tadd\tr6, r2, #0\n\tldr\tr0, [sp, #0x18]\n\tlsl\tr3, r3, #0x18\n\tlsr\tr7, r3, #0x18\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n.L3:\n\tadd\tr0, r6, #0\n\tasr\tr1, r6, #0x1f\n\tmov\tr3, r8\n\tsub\tr2, r4, r3\n\tasr\tr3, r2, #0x1f\n\tbl\t__muldi3\n\tadd\tr2, r7, #0\n\tbl\t__ashrdi3\n\tsub\tr4, r4, r0\n\tsub\tr0, r5, #0x1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr5, r0, #0x18\n\tcmp\tr5, #0xff\n\tbne\t.L3\t@cond_branch\n\tadd\tr0, r4, #0\n\tpop\t{r3}\n\tmov\tr8, r3\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_8085654,.Lfe1-sa2__sub_8085654\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085654 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_80856DC:agbcc","sym":"sa2__sub_80856DC","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div"],"loc":1,"refSource":"s32 SA2_LABEL(sub_80856DC)(s32 a, s32 b, s32 c) { return (a * 7 + b * 6 - c) / 12; }","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L529-L529","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856DC\n\t.type\t sa2__sub_80856DC,function\n\t.thumb_func\nsa2__sub_80856DC:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r3, #0x3\n\tsub\tr0, r0, r3\n\tlsl\tr3, r1, #0x1\n\tadd\tr3, r3, r1\n\tlsl\tr3, r3, #0x1\n\tadd\tr0, r0, r3\n\tsub\tr0, r0, r2\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856DC,.Lfe1-sa2__sub_80856DC\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 sa2__sub_80856DC(s32 a0, s32 a1, s32 a2) {\n return (a0 * 7 + a1 * 6 - a2) / 12;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sa2__sub_80856DC(s32 arg0, s32 arg1, s32 arg2) {\n return (s32) (((arg0 * 7) + (arg1 * 6)) - arg2) / 12;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80856DC` — benchmark function sa3:sa2__sub_80856DC:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856DC\n\t.type\t sa2__sub_80856DC,function\n\t.thumb_func\nsa2__sub_80856DC:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r3, #0x3\n\tsub\tr0, r0, r3\n\tlsl\tr3, r1, #0x1\n\tadd\tr3, r3, r1\n\tlsl\tr3, r3, #0x1\n\tadd\tr0, r0, r3\n\tsub\tr0, r0, r2\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856DC,.Lfe1-sa2__sub_80856DC\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80856DC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80856DC` — benchmark function sa3:sa2__sub_80856DC:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80856DC:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856DC\n\t.type\t sa2__sub_80856DC,function\n\t.thumb_func\nsa2__sub_80856DC:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r3, #0x3\n\tsub\tr0, r0, r3\n\tlsl\tr3, r1, #0x1\n\tadd\tr3, r3, r1\n\tlsl\tr3, r3, #0x1\n\tadd\tr0, r0, r3\n\tsub\tr0, r0, r2\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856DC,.Lfe1-sa2__sub_80856DC\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80856DC # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_80856F8:agbcc","sym":"sa2__sub_80856F8","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","soft-div"],"loc":1,"refSource":"s32 SA2_LABEL(sub_80856F8)(s32 a, s32 b, s32 c) { return ((b * 6 - a) + c * 7) / 12; }","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L531-L531","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856F8\n\t.type\t sa2__sub_80856F8,function\n\t.thumb_func\nsa2__sub_80856F8:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r3\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856F8,.Lfe1-sa2__sub_80856F8\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 sa2__sub_80856F8(s32 a0, s32 a1, s32 a2) {\n return (a1 * 6 - a0 + a2 * 7) / 12;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sa2__sub_80856F8(s32 arg0, s32 arg1, s32 arg2) {\n return (s32) (((arg1 * 6) - arg0) + (arg2 * 7)) / 12;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_80856F8` — benchmark function sa3:sa2__sub_80856F8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856F8\n\t.type\t sa2__sub_80856F8,function\n\t.thumb_func\nsa2__sub_80856F8:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r3\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856F8,.Lfe1-sa2__sub_80856F8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_80856F8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_80856F8` — benchmark function sa3:sa2__sub_80856F8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_80856F8:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_80856F8\n\t.type\t sa2__sub_80856F8,function\n\t.thumb_func\nsa2__sub_80856F8:\n\tpush\t{lr}\n\tadd\tr3, r0, #0\n\tlsl\tr0, r1, #0x1\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tsub\tr0, r0, r3\n\tlsl\tr1, r2, #0x3\n\tsub\tr1, r1, r2\n\tadd\tr0, r0, r1\n\tmov\tr1, #0xc\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t sa2__sub_80856F8,.Lfe1-sa2__sub_80856F8\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_80856F8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8085714:agbcc","sym":"sa2__sub_8085714","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","shift"],"loc":1,"refSource":"s32 SA2_LABEL(sub_8085714)(s32 a, s32 b, s32 c) { return ((a + b * 8) - c) >> 3; }","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L533-L533","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085714\n\t.type\t sa2__sub_8085714,function\n\t.thumb_func\nsa2__sub_8085714:\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r0, r1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085714,.Lfe1-sa2__sub_8085714\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 sa2__sub_8085714(s32 a0, s32 a1, s32 a2) {\n return a0 + (a1 << 3) - a2 >> 3;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sa2__sub_8085714(s32 arg0, s32 arg1, s32 arg2) {\n return (s32) ((arg0 + (arg1 * 8)) - arg2) >> 3;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085714` — benchmark function sa3:sa2__sub_8085714:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085714\n\t.type\t sa2__sub_8085714,function\n\t.thumb_func\nsa2__sub_8085714:\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r0, r1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085714,.Lfe1-sa2__sub_8085714\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085714 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085714` — benchmark function sa3:sa2__sub_8085714:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085714:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085714\n\t.type\t sa2__sub_8085714,function\n\t.thumb_func\nsa2__sub_8085714:\n\tlsl\tr1, r1, #0x3\n\tadd\tr0, r0, r1\n\tsub\tr0, r0, r2\n\tasr\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085714,.Lfe1-sa2__sub_8085714\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085714 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8085720:agbcc","sym":"sa2__sub_8085720","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","shift"],"loc":1,"refSource":"s32 SA2_LABEL(sub_8085720)(s32 a, s32 b, s32 c) { return ((b * 8 - a) + c) >> 3; }","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L535-L535","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085720\n\t.type\t sa2__sub_8085720,function\n\t.thumb_func\nsa2__sub_8085720:\n\tlsl\tr1, r1, #0x3\n\tsub\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tasr\tr1, r1, #0x3\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085720,.Lfe1-sa2__sub_8085720\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 sa2__sub_8085720(s32 a0, s32 a1, s32 a2) {\n return (a1 << 3) - a0 + a2 >> 3;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sa2__sub_8085720(s32 arg0, s32 arg1, s32 arg2) {\n return (s32) (((arg1 * 8) - arg0) + arg2) >> 3;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085720` — benchmark function sa3:sa2__sub_8085720:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085720\n\t.type\t sa2__sub_8085720,function\n\t.thumb_func\nsa2__sub_8085720:\n\tlsl\tr1, r1, #0x3\n\tsub\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tasr\tr1, r1, #0x3\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085720,.Lfe1-sa2__sub_8085720\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085720 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085720` — benchmark function sa3:sa2__sub_8085720:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085720:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085720\n\t.type\t sa2__sub_8085720,function\n\t.thumb_func\nsa2__sub_8085720:\n\tlsl\tr1, r1, #0x3\n\tsub\tr1, r1, r0\n\tadd\tr1, r1, r2\n\tasr\tr1, r1, #0x3\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085720,.Lfe1-sa2__sub_8085720\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085720 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8085758:agbcc","sym":"sa2__sub_8085758","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"s32 SA2_LABEL(sub_8085758)(s32 a, s32 b) { return b - a; }","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L539-L539","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085758\n\t.type\t sa2__sub_8085758,function\n\t.thumb_func\nsa2__sub_8085758:\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085758,.Lfe1-sa2__sub_8085758\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 sa2__sub_8085758(u32 a0, u32 a1) {\n return a1 - a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sa2__sub_8085758(s32 arg0, s32 arg1) {\n return arg1 - arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085758` — benchmark function sa3:sa2__sub_8085758:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085758\n\t.type\t sa2__sub_8085758,function\n\t.thumb_func\nsa2__sub_8085758:\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085758,.Lfe1-sa2__sub_8085758\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085758 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085758` — benchmark function sa3:sa2__sub_8085758:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085758:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085758\n\t.type\t sa2__sub_8085758,function\n\t.thumb_func\nsa2__sub_8085758:\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085758,.Lfe1-sa2__sub_8085758\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085758 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_8085798:agbcc","sym":"sa2__sub_8085798","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","shift"],"loc":1,"refSource":"s32 SA2_LABEL(sub_8085798)(s32 a, s32 b, s32 c) { return ((c - a) + ((c - a) >> 1)) - (b >> 1); }","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L549-L549","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085798\n\t.type\t sa2__sub_8085798,function\n\t.thumb_func\nsa2__sub_8085798:\n\tsub\tr0, r2, r0\n\tasr\tr2, r0, #0x1\n\tadd\tr0, r0, r2\n\tasr\tr1, r1, #0x1\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085798,.Lfe1-sa2__sub_8085798\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 sa2__sub_8085798(s32 a0, s32 a1, s32 a2) {\n return a2 - a0 + (a2 - a0 >> 1) - (a1 >> 1);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sa2__sub_8085798(s32 arg0, s32 arg1, s32 arg2) {\n s32 temp_r0;\n\n temp_r0 = arg2 - arg0;\n return (temp_r0 + (temp_r0 >> 1)) - (arg1 >> 1);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_8085798` — benchmark function sa3:sa2__sub_8085798:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085798\n\t.type\t sa2__sub_8085798,function\n\t.thumb_func\nsa2__sub_8085798:\n\tsub\tr0, r2, r0\n\tasr\tr2, r0, #0x1\n\tadd\tr0, r0, r2\n\tasr\tr1, r1, #0x1\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085798,.Lfe1-sa2__sub_8085798\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_8085798 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_8085798` — benchmark function sa3:sa2__sub_8085798:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_8085798:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_8085798\n\t.type\t sa2__sub_8085798,function\n\t.thumb_func\nsa2__sub_8085798:\n\tsub\tr0, r2, r0\n\tasr\tr2, r0, #0x1\n\tadd\tr0, r0, r2\n\tasr\tr1, r1, #0x1\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_8085798,.Lfe1-sa2__sub_8085798\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_8085798 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:sa2__sub_808595C:agbcc","sym":"sa2__sub_808595C","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","shift"],"loc":8,"refSource":"s32 SA2_LABEL(sub_808595C)(s32 a, s32 b, s32 c)\n{\n s32 e = (b - a);\n s32 f = (c - b);\n f -= e;\n f >>= 1;\n return e + f;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L580-L587","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808595C\n\t.type\t sa2__sub_808595C,function\n\t.thumb_func\nsa2__sub_808595C:\n\tsub\tr0, r1, r0\n\tsub\tr2, r2, r1\n\tsub\tr2, r2, r0\n\tasr\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_808595C,.Lfe1-sa2__sub_808595C\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"signed","symbolsUsed":[],"outcome":"match","source":"s32 sa2__sub_808595C(s32 a0, s32 a1, s32 a2) {\n return a1 - a0 + (a2 - a1 - (a1 - a0) >> 1);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sa2__sub_808595C(s32 arg0, s32 arg1, s32 arg2) {\n s32 temp_r0;\n\n temp_r0 = arg1 - arg0;\n return temp_r0 + ((s32) ((arg2 - arg1) - temp_r0) >> 1);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sa2__sub_808595C` — benchmark function sa3:sa2__sub_808595C:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808595C\n\t.type\t sa2__sub_808595C,function\n\t.thumb_func\nsa2__sub_808595C:\n\tsub\tr0, r1, r0\n\tsub\tr2, r2, r1\n\tsub\tr2, r2, r0\n\tasr\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_808595C,.Lfe1-sa2__sub_808595C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sa2__sub_808595C # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sa2__sub_808595C` — benchmark function sa3:sa2__sub_808595C:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:sa2__sub_808595C:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsa2__sub_808595C\n\t.type\t sa2__sub_808595C,function\n\t.thumb_func\nsa2__sub_808595C:\n\tsub\tr0, r1, r0\n\tsub\tr2, r2, r1\n\tsub\tr2, r2, r0\n\tasr\tr2, r2, #0x1\n\tadd\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t sa2__sub_808595C,.Lfe1-sa2__sub_808595C\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sa2__sub_808595C # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:SeedRng:agbcc","sym":"SeedRng","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["global","store"],"loc":5,"refSource":"void SeedRng(u32 a, u32 b)\n{\n gRngPrevValue = a;\n gRngValue = b;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/game/math.c#L427-L431","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSeedRng\n\t.type\t SeedRng,function\n\t.thumb_func\nSeedRng:\n\tldr\tr2, .L3\n\tstr\tr0, [r2]\n\tldr\tr0, .L3+0x4\n\tstr\tr1, [r0]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n.Lfe1:\n\t.size\t SeedRng,.Lfe1-SeedRng\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\n","proto":{"SeedRng":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gRngPrevValue","shape":"scalar u32"},{"name":"gRngValue","shape":"scalar u32"}],"outcome":"match","source":"void SeedRng(u32 a0, u32 a1) {\n gRngPrevValue = a0;\n gRngValue = a1;\n return;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"extern s32 gRngPrevValue;\nextern s32 gRngValue;\n\nvoid SeedRng(s32 arg0, s32 arg1) {\n gRngPrevValue = arg0;\n gRngValue = arg1;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `SeedRng` — benchmark function sa3:SeedRng:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSeedRng\n\t.type\t SeedRng,function\n\t.thumb_func\nSeedRng:\n\tldr\tr2, .L3\n\tstr\tr0, [r2]\n\tldr\tr0, .L3+0x4\n\tstr\tr1, [r0]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n.Lfe1:\n\t.size\t SeedRng,.Lfe1-SeedRng\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function SeedRng # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `SeedRng` — benchmark function sa3:SeedRng:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:SeedRng:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tSeedRng\n\t.type\t SeedRng,function\n\t.thumb_func\nSeedRng:\n\tldr\tr2, .L3\n\tstr\tr0, [r2]\n\tldr\tr0, .L3+0x4\n\tstr\tr1, [r0]\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\tgRngPrevValue\n\t.word\tgRngValue\n.Lfe1:\n\t.size\t SeedRng,.Lfe1-SeedRng\n\t.comm\tgRngPrevValue, 4\t@ 4\n\t.comm\tgRngValue, 4\t@ 4\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"SeedRng\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name SeedRng # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:VerifyFlashSector_Core:agbcc","sym":"VerifyFlashSector_Core","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","pointer","cast","branch"],"loc":9,"refSource":"u32 VerifyFlashSector_Core(u8 *src, u8 *tgt, u32 size)\n{\n while (size-- != 0) {\n if (*tgt++ != *src++)\n return (uintptr_t)(tgt - 1);\n }\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/lib/agb_flash/agb_flash.c#L286-L294","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVerifyFlashSector_Core\n\t.type\t VerifyFlashSector_Core,function\n\t.thumb_func\nVerifyFlashSector_Core:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr2, r2, #0x1\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr2, r0\n\tbeq\t.L4\t@cond_branch\n\tadd\tr5, r0, #0\n.L5:\n\tldrb\tr1, [r3]\n\tldrb\tr0, [r4]\n\tadd\tr4, r4, #0x1\n\tadd\tr3, r3, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r3, #0x1\n\tb\t.L8\n.L3:\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, r5\n\tbne\t.L5\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L8:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t VerifyFlashSector_Core,.Lfe1-VerifyFlashSector_Core\n\n.text\n\t.align\t2, 0\n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"u8 * VerifyFlashSector_Core(u8 * a0, u8 * a1, u32 a2) {\n u8 * v0;\n u8 * v1;\n s32 v2;\n if (a2 - 1 != -1) {\n v0 = a1;\n v1 = a0;\n v2 = a2 - 1;\n while (*v0 == *v1) {\n v0 = v0 + 1;\n v1 = v1 + 1;\n v2 = v2 - 1;\n if (v2 == -1) return (u8 *)0;\n }\n return v0 + 1 - 1;\n } else {\n return (u8 *)0;\n }\n}\n","score":19,"maxScore":27,"compileErrors":null,"breakdown":{"insert":3,"delete":3,"replace":3,"opMismatch":2,"argMismatch":8},"quality":{"score":100,"lines":19,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 VerifyFlashSector_Core(u8 *arg0, u8 *arg1, s32 arg2) {\n s32 var_r2;\n u8 *var_r3;\n u8 *var_r4;\n u8 temp_r0;\n u8 temp_r1;\n\n var_r4 = arg0;\n var_r3 = arg1;\n var_r2 = arg2 - 1;\n if (var_r2 != -1) {\nloop_2:\n temp_r1 = *var_r3;\n temp_r0 = *var_r4;\n var_r4 += 1;\n var_r3 += 1;\n if (temp_r1 != temp_r0) {\n return var_r3 - 1;\n }\n var_r2 -= 1;\n if (var_r2 == -1) {\n goto block_5;\n }\n goto loop_2;\n }\nblock_5:\n return 0;\n}\n","score":28,"maxScore":35,"compileErrors":null,"breakdown":{"insert":11,"delete":12,"replace":1,"opMismatch":1,"argMismatch":3},"quality":{"score":76,"lines":27,"gotos":2,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":19,"maxScore":27,"ratio":0.7037037037037037,"kinds":{"insert":3,"delete":3,"replace":3,"opMismatch":2,"argMismatch":8}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `VerifyFlashSector_Core` — benchmark function sa3:VerifyFlashSector_Core:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVerifyFlashSector_Core\n\t.type\t VerifyFlashSector_Core,function\n\t.thumb_func\nVerifyFlashSector_Core:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr2, r2, #0x1\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr2, r0\n\tbeq\t.L4\t@cond_branch\n\tadd\tr5, r0, #0\n.L5:\n\tldrb\tr1, [r3]\n\tldrb\tr0, [r4]\n\tadd\tr4, r4, #0x1\n\tadd\tr3, r3, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r3, #0x1\n\tb\t.L8\n.L3:\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, r5\n\tbne\t.L5\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L8:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t VerifyFlashSector_Core,.Lfe1-VerifyFlashSector_Core\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function VerifyFlashSector_Core # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `VerifyFlashSector_Core` — benchmark function sa3:VerifyFlashSector_Core:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:VerifyFlashSector_Core:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVerifyFlashSector_Core\n\t.type\t VerifyFlashSector_Core,function\n\t.thumb_func\nVerifyFlashSector_Core:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tadd\tr3, r1, #0\n\tsub\tr2, r2, #0x1\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n\tcmp\tr2, r0\n\tbeq\t.L4\t@cond_branch\n\tadd\tr5, r0, #0\n.L5:\n\tldrb\tr1, [r3]\n\tldrb\tr0, [r4]\n\tadd\tr4, r4, #0x1\n\tadd\tr3, r3, #0x1\n\tcmp\tr1, r0\n\tbeq\t.L3\t@cond_branch\n\tsub\tr0, r3, #0x1\n\tb\t.L8\n.L3:\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, r5\n\tbne\t.L5\t@cond_branch\n.L4:\n\tmov\tr0, #0x0\n.L8:\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t VerifyFlashSector_Core,.Lfe1-VerifyFlashSector_Core\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VerifyFlashSector_Core # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:VramGetTotalAllocatedTiles:agbcc","sym":"VramGetTotalAllocatedTiles","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","global","array","branch"],"loc":14,"refSource":"u16 VramGetTotalAllocatedTiles(void)\n{\n u16 i;\n u16 count = 0;\n\n for (i = 0; i < gVramHeapMaxTileSlots / VRAM_TILE_SLOTS_PER_SEGMENT; ++i) {\n if (gVramHeapState[i]) {\n count += gVramHeapState[i];\n i = gVramHeapState[i] - 1 + i; // next slot to check, -1 because of ++i\n }\n }\n return count * VRAM_TILE_SLOTS_PER_SEGMENT;\n}\n","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_vram.c#L46-L58","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramGetTotalAllocatedTiles\n\t.type\t VramGetTotalAllocatedTiles,function\n\t.thumb_func\nVramGetTotalAllocatedTiles:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tldr\tr0, .L9\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L9+0x4\n\tadd\tr4, r0, #0\n\tldr\tr0, .L9+0x8\n\tadd\tr5, r0, #0\n.L6:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, r5\n\tadd\tr0, r1, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tcmp\tr2, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tlsl\tr0, r3, #0x12\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\t0xffff\n.Lfe1:\n\t.size\t VramGetTotalAllocatedTiles,.Lfe1-VramGetTotalAllocatedTiles\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-648ffdb40ca9.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gVramHeapMaxTileSlots","shape":"scalar u16"},{"name":"gVramHeapState","shape":"u16[]"}],"outcome":"nonmatch","source":"s32 VramGetTotalAllocatedTiles(void) {\n s32 v0;\n s32 v1;\n s32 v2;\n v0 = gVramHeapMaxTileSlots;\n if (0 >= (u32)v0 >> 2) {\n v2 = 0;\n } else {\n v1 = 0;\n v2 = 0;\n do {\n if (gVramHeapState[v1] != 0) {\n v2 = (u16)(v2 + gVramHeapState[v1]);\n v1 = (u16)(gVramHeapState[v1] + (v1 + 65535));\n }\n v1 = (u16)(v1 + 1);\n } while (v1 < (u32)v0 >> 2);\n }\n return (u32)(v2 << 18) >> 16;\n}\n","score":22,"maxScore":43,"compileErrors":null,"breakdown":{"insert":6,"delete":4,"replace":0,"opMismatch":1,"argMismatch":11},"quality":{"score":90,"lines":20,"gotos":0,"casts":7,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u16 VramGetTotalAllocatedTiles(void) {\n u16 temp_r1;\n u16 var_r2;\n u16 var_r3;\n u32 temp_r0;\n\n var_r3 = 0;\n var_r2 = 0;\n temp_r0 = (u16) gVramHeapMaxTileSlots >> 2;\n if (temp_r0 > 0U) {\n do {\n temp_r1 = gVramHeapState[var_r2];\n if (temp_r1 != 0) {\n var_r3 += temp_r1;\n var_r2 = temp_r1 + (var_r2 + 0xFFFF);\n }\n var_r2 += 1;\n } while ((u32) var_r2 < temp_r0);\n }\n return (u16) (var_r3 * 4);\n}\n","score":16,"maxScore":38,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":1,"opMismatch":2,"argMismatch":11},"quality":{"score":96,"lines":20,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":16,"maxScore":38,"ratio":0.42105263157894735,"kinds":{"insert":1,"delete":1,"replace":1,"opMismatch":2,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `VramGetTotalAllocatedTiles` — benchmark function sa3:VramGetTotalAllocatedTiles:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramGetTotalAllocatedTiles\n\t.type\t VramGetTotalAllocatedTiles,function\n\t.thumb_func\nVramGetTotalAllocatedTiles:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tldr\tr0, .L9\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L9+0x4\n\tadd\tr4, r0, #0\n\tldr\tr0, .L9+0x8\n\tadd\tr5, r0, #0\n.L6:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, r5\n\tadd\tr0, r1, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tcmp\tr2, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tlsl\tr0, r3, #0x12\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\t0xffff\n.Lfe1:\n\t.size\t VramGetTotalAllocatedTiles,.Lfe1-VramGetTotalAllocatedTiles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-648ffdb40ca9.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nu16 VramGetTotalAllocatedTiles(void);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function VramGetTotalAllocatedTiles # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `VramGetTotalAllocatedTiles` — benchmark function sa3:VramGetTotalAllocatedTiles:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:VramGetTotalAllocatedTiles:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramGetTotalAllocatedTiles\n\t.type\t VramGetTotalAllocatedTiles,function\n\t.thumb_func\nVramGetTotalAllocatedTiles:\n\tpush\t{r4, r5, r6, lr}\n\tmov\tr3, #0x0\n\tmov\tr2, #0x0\n\tldr\tr0, .L9\n\tldrh\tr0, [r0]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr3, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr6, .L9+0x4\n\tadd\tr4, r0, #0\n\tldr\tr0, .L9+0x8\n\tadd\tr5, r0, #0\n.L6:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, r6\n\tldrh\tr1, [r0]\n\tcmp\tr1, #0\n\tbeq\t.L5\t@cond_branch\n\tadd\tr0, r3, r1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n\tadd\tr0, r2, r5\n\tadd\tr0, r1, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n.L5:\n\tadd\tr0, r2, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr2, r0, #0x10\n\tcmp\tr2, r4\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tlsl\tr0, r3, #0x12\n\tlsr\tr0, r0, #0x10\n\tpop\t{r4, r5, r6}\n\tpop\t{r1}\n\tbx\tr1\n.L10:\n\t.align\t2, 0\n.L9:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\t0xffff\n.Lfe1:\n\t.size\t VramGetTotalAllocatedTiles,.Lfe1-VramGetTotalAllocatedTiles\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VramGetTotalAllocatedTiles # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"sa3:VramMalloc:agbcc","sym":"VramMalloc","project":"sa3","tier":"real","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","nested","global","array","branch","pointer"],"loc":27,"refSource":"void *VramMalloc(u32 numTiles)\n{\n u16 i, j;\n u32 count = numTiles;\n count = (count + (VRAM_TILE_SLOTS_PER_SEGMENT - 1)) / VRAM_TILE_SLOTS_PER_SEGMENT; // round up\n\n for (i = 0; i < gVramHeapMaxTileSlots / VRAM_TILE_SLOTS_PER_SEGMENT; i++) {\n if (gVramHeapState[i] == 0) {\n for (j = 0; j < count; j++) {\n if (i + j >= (gVramHeapMaxTileSlots / VRAM_TILE_SLOTS_PER_SEGMENT)) {\n return ewram_end;\n }\n if (gVramHeapState[i + j] != 0) {\n break;\n }\n }\n\n if (j == count) {\n gVramHeapState[i] = count;\n return (void *)(gVramHeapStartAddr + i * VRAM_HEAP_SEGMENT_SIZE);\n }\n } else {\n i = (gVramHeapState[i] - 1) + i; // next slot to check, -1 because of ++i\n }\n }\n return ewram_end;\n}","sourceUrl":"https://github.com/macabeus/sa3/blob/b0321cdc57ef829b24d4179ed625cb3403e26633/src/malloc_vram.c#L5-L31","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramMalloc\n\t.type\t VramMalloc,function\n\t.thumb_func\nVramMalloc:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tr5, r0, #0\n\tadd\tr0, r5, #0x3\n\tlsr\tr5, r0, #0x2\n\tmov\tr4, #0x0\n\tldr\tr1, .L20\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tmov\tr9, r1\n\tcmp\tr4, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tmov\tr8, r0\n.L6:\n\tlsl\tr1, r4, #0x1\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tldrh\tr2, [r0]\n\tcmp\tr2, #0\n\tbne\t.L7\t@cond_branch\n\tmov\tr3, #0x0\n\tldr\tr7, .L20\n\tmov\tip, r7\n\tldr\tr0, .L20+0x4\n\tmov\tsl, r0\n\tldr\tr6, .L20+0x8\n\tb\t.L8\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\tewram_end\n.L10:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n.L8:\n\tcmp\tr3, r5\n\tbcs\t.L9\t@cond_branch\n\tadd\tr2, r4, r3\n\tmov\tr7, ip\n\tldrh\tr0, [r7]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr2, r0\n\tblt\t.L12\t@cond_branch\n\tldr\tr0, [r6]\n\tb\t.L19\n.L12:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, sl\n\tldrh\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n.L9:\n\tcmp\tr3, r5\n\tbne\t.L5\t@cond_branch\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tstrh\tr5, [r0]\n\tldr\tr0, .L22\n\tlsl\tr1, r4, #0x7\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tb\t.L19\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgVramHeapStartAddr\n.L7:\n\tldr\tr7, .L24\n\tadd\tr0, r4, r7\n\tadd\tr0, r2, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr1, r9\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr4, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L24+0x4\n\tldr\tr0, [r0]\n.L19:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\t0xffff\n\t.word\tewram_end\n.Lfe1:\n\t.size\t VramMalloc,.Lfe1-VramMalloc\n\n.text\n\t.align\t2, 0\n","ctxRef":"apps/benchmark/dataset/real/tu/sa3/ctx-648ffdb40ca9.i.gz","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'VramMalloc' — structure: cannot structure 'VramMalloc': unrecovered back-edge into block #5 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tVramMalloc */\n/* \t.type\t VramMalloc,function */\n/* \t.thumb_func */\n/* VramMalloc: */\n/* \tpush\t{r4, r5, r6, r7, lr} */\n/* \tmov\tr7, sl */\n/* \tmov\tr6, r9 */\n/* \tmov\tr5, r8 */\n/* \tpush\t{r5, r6, r7} */\n/* \tadd\tr5, r0, #0 */\n/* \tadd\tr0, r5, #0x3 */\n/* \tlsr\tr5, r0, #0x2 */\n/* \tmov\tr4, #0x0 */\n/* \tldr\tr1, .L20 */\n/* \tldrh\tr0, [r1] */\n/* \tlsr\tr0, r0, #0x2 */\n/* \tmov\tr9, r1 */\n/* \tcmp\tr4, r0 */\n/* \tbcs\t.L4\t@cond_branch */\n/* \tldr\tr0, .L20+0x4 */\n/* \tmov\tr8, r0 */\n/* .L6: */\n/* \tlsl\tr1, r4, #0x1 */\n/* \tmov\tr2, r8 */\n/* \tadd\tr0, r1, r2 */\n/* \tldrh\tr2, [r0] */\n/* \tcmp\tr2, #0 */\n/* \tbne\t.L7\t@cond_branch */\n/* \tmov\tr3, #0x0 */\n/* \tldr\tr7, .L20 */\n/* \tmov\tip, r7 */\n/* \tldr\tr0, .L20+0x4 */\n/* \tmov\tsl, r0 */\n/* \tldr\tr6, .L20+0x8 */\n/* \tb\t.L8 */\n/* .L21: */\n/* \t.align\t2, 0 */\n/* .L20: */\n/* \t.word\tgVramHeapMaxTileSlots */\n/* \t.word\tgVramHeapState */\n/* \t.word\tewram_end */\n/* .L10: */\n/* \tadd\tr0, r3, #0x1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr3, r0, #0x10 */\n/* .L8: */\n/* \tcmp\tr3, r5 */\n/* \tbcs\t.L9\t@cond_branch */\n/* \tadd\tr2, r4, r3 */\n/* \tmov\tr7, ip */\n/* \tldrh\tr0, [r7] */\n/* \tlsr\tr0, r0, #0x2 */\n/* \tcmp\tr2, r0 */\n/* \tblt\t.L12\t@cond_branch */\n/* \tldr\tr0, [r6] */\n/* \tb\t.L19 */\n/* .L12: */\n/* \tlsl\tr0, r2, #0x1 */\n/* \tadd\tr0, r0, sl */\n/* \tldrh\tr0, [r0] */\n/* \tcmp\tr0, #0 */\n/* \tbeq\t.L10\t@cond_branch */\n/* .L9: */\n/* \tcmp\tr3, r5 */\n/* \tbne\t.L5\t@cond_branch */\n/* \tmov\tr2, r8 */\n/* \tadd\tr0, r1, r2 */\n/* \tstrh\tr5, [r0] */\n/* \tldr\tr0, .L22 */\n/* \tlsl\tr1, r4, #0x7 */\n/* \tldr\tr0, [r0] */\n/* \tadd\tr0, r0, r1 */\n/* \tb\t.L19 */\n/* .L23: */\n/* \t.align\t2, 0 */\n/* .L22: */\n/* \t.word\tgVramHeapStartAddr */\n/* .L7: */\n/* \tldr\tr7, .L24 */\n/* \tadd\tr0, r4, r7 */\n/* \tadd\tr0, r2, r0 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr4, r0, #0x10 */\n/* .L5: */\n/* \tadd\tr0, r4, #0x1 */\n/* \tlsl\tr0, r0, #0x10 */\n/* \tlsr\tr4, r0, #0x10 */\n/* \tmov\tr1, r9 */\n/* \tldrh\tr0, [r1] */\n/* \tlsr\tr0, r0, #0x2 */\n/* \tcmp\tr4, r0 */\n/* \tbcc\t.L6\t@cond_branch */\n/* .L4: */\n/* \tldr\tr0, .L24+0x4 */\n/* \tldr\tr0, [r0] */\n/* .L19: */\n/* \tpop\t{r3, r4, r5} */\n/* \tmov\tr8, r3 */\n/* \tmov\tr9, r4 */\n/* \tmov\tsl, r5 */\n/* \tpop\t{r4, r5, r6, r7} */\n/* \tpop\t{r1} */\n/* \tbx\tr1 */\n/* .L25: */\n/* \t.align\t2, 0 */\n/* .L24: */\n/* \t.word\t0xffff */\n/* \t.word\tewram_end */\n/* .Lfe1: */\n/* \t.size\t VramMalloc,.Lfe1-VramMalloc */\n/* .text */\n/* \t.align\t2, 0 */\nvoid VramMalloc(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'VramMalloc': unrecovered back-edge into block #5 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":122,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'VramMalloc': unrecovered back-edge into block #5 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void *VramMalloc(u32 numTiles) {\n s32 temp_r2_2;\n u16 temp_r2;\n u16 var_r4;\n u32 temp_r5;\n u32 var_r3;\n\n temp_r5 = (u32) (numTiles + 3) >> 2;\n var_r4 = 0;\n if ((u32) ((u16) gVramHeapMaxTileSlots >> 2) > 0U) {\nloop_2:\n temp_r2 = gVramHeapState[var_r4];\n if (temp_r2 == 0) {\n var_r3 = 0;\nloop_5:\n if (var_r3 < temp_r5) {\n temp_r2_2 = var_r4 + var_r3;\n if (temp_r2_2 >= (s32) ((u16) gVramHeapMaxTileSlots >> 2)) {\n return ewram_end;\n }\n if (gVramHeapState[temp_r2_2] != 0) {\n goto block_9;\n }\n var_r3 = (u32) (u16) (var_r3 + 1);\n goto loop_5;\n }\nblock_9:\n if (var_r3 == temp_r5) {\n gVramHeapState[var_r4] = (u16) temp_r5;\n return gVramHeapStartAddr + (var_r4 << 7);\n }\n goto block_12;\n }\n var_r4 = temp_r2 + (var_r4 + 0xFFFF);\nblock_12:\n var_r4 += 1;\n if ((u32) var_r4 >= (u32) ((u16) gVramHeapMaxTileSlots >> 2)) {\n goto block_13;\n }\n goto loop_2;\n }\nblock_13:\n return ewram_end;\n}\n","score":63,"maxScore":95,"compileErrors":null,"breakdown":{"insert":9,"delete":28,"replace":1,"opMismatch":5,"argMismatch":20},"quality":{"score":52,"lines":43,"gotos":5,"casts":11,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":63,"maxScore":95,"ratio":0.6631578947368421,"kinds":{"insert":9,"delete":28,"replace":1,"opMismatch":5,"argMismatch":20}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `VramMalloc` — benchmark function sa3:VramMalloc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramMalloc\n\t.type\t VramMalloc,function\n\t.thumb_func\nVramMalloc:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tr5, r0, #0\n\tadd\tr0, r5, #0x3\n\tlsr\tr5, r0, #0x2\n\tmov\tr4, #0x0\n\tldr\tr1, .L20\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tmov\tr9, r1\n\tcmp\tr4, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tmov\tr8, r0\n.L6:\n\tlsl\tr1, r4, #0x1\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tldrh\tr2, [r0]\n\tcmp\tr2, #0\n\tbne\t.L7\t@cond_branch\n\tmov\tr3, #0x0\n\tldr\tr7, .L20\n\tmov\tip, r7\n\tldr\tr0, .L20+0x4\n\tmov\tsl, r0\n\tldr\tr6, .L20+0x8\n\tb\t.L8\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\tewram_end\n.L10:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n.L8:\n\tcmp\tr3, r5\n\tbcs\t.L9\t@cond_branch\n\tadd\tr2, r4, r3\n\tmov\tr7, ip\n\tldrh\tr0, [r7]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr2, r0\n\tblt\t.L12\t@cond_branch\n\tldr\tr0, [r6]\n\tb\t.L19\n.L12:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, sl\n\tldrh\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n.L9:\n\tcmp\tr3, r5\n\tbne\t.L5\t@cond_branch\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tstrh\tr5, [r0]\n\tldr\tr0, .L22\n\tlsl\tr1, r4, #0x7\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tb\t.L19\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgVramHeapStartAddr\n.L7:\n\tldr\tr7, .L24\n\tadd\tr0, r4, r7\n\tadd\tr0, r2, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr1, r9\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr4, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L24+0x4\n\tldr\tr0, [r0]\n.L19:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\t0xffff\n\t.word\tewram_end\n.Lfe1:\n\t.size\t VramMalloc,.Lfe1-VramMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/sa3/ctx-648ffdb40ca9.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *VramMalloc(u32 numTiles);\nCTX_PROTO\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function VramMalloc # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `VramMalloc` — benchmark function sa3:VramMalloc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/sa3.git sa3\n# make -C sa3\n# make -C sa3 asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/sa3/symbols.json.gz\n# sha256 of the decompressed map JSON: 8e6bb9624298f3f368597658c62d28893e14c65d4712475da890291d6db84a46\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/sa3'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target sa3:VramMalloc:agbcc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tVramMalloc\n\t.type\t VramMalloc,function\n\t.thumb_func\nVramMalloc:\n\tpush\t{r4, r5, r6, r7, lr}\n\tmov\tr7, sl\n\tmov\tr6, r9\n\tmov\tr5, r8\n\tpush\t{r5, r6, r7}\n\tadd\tr5, r0, #0\n\tadd\tr0, r5, #0x3\n\tlsr\tr5, r0, #0x2\n\tmov\tr4, #0x0\n\tldr\tr1, .L20\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tmov\tr9, r1\n\tcmp\tr4, r0\n\tbcs\t.L4\t@cond_branch\n\tldr\tr0, .L20+0x4\n\tmov\tr8, r0\n.L6:\n\tlsl\tr1, r4, #0x1\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tldrh\tr2, [r0]\n\tcmp\tr2, #0\n\tbne\t.L7\t@cond_branch\n\tmov\tr3, #0x0\n\tldr\tr7, .L20\n\tmov\tip, r7\n\tldr\tr0, .L20+0x4\n\tmov\tsl, r0\n\tldr\tr6, .L20+0x8\n\tb\t.L8\n.L21:\n\t.align\t2, 0\n.L20:\n\t.word\tgVramHeapMaxTileSlots\n\t.word\tgVramHeapState\n\t.word\tewram_end\n.L10:\n\tadd\tr0, r3, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr3, r0, #0x10\n.L8:\n\tcmp\tr3, r5\n\tbcs\t.L9\t@cond_branch\n\tadd\tr2, r4, r3\n\tmov\tr7, ip\n\tldrh\tr0, [r7]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr2, r0\n\tblt\t.L12\t@cond_branch\n\tldr\tr0, [r6]\n\tb\t.L19\n.L12:\n\tlsl\tr0, r2, #0x1\n\tadd\tr0, r0, sl\n\tldrh\tr0, [r0]\n\tcmp\tr0, #0\n\tbeq\t.L10\t@cond_branch\n.L9:\n\tcmp\tr3, r5\n\tbne\t.L5\t@cond_branch\n\tmov\tr2, r8\n\tadd\tr0, r1, r2\n\tstrh\tr5, [r0]\n\tldr\tr0, .L22\n\tlsl\tr1, r4, #0x7\n\tldr\tr0, [r0]\n\tadd\tr0, r0, r1\n\tb\t.L19\n.L23:\n\t.align\t2, 0\n.L22:\n\t.word\tgVramHeapStartAddr\n.L7:\n\tldr\tr7, .L24\n\tadd\tr0, r4, r7\n\tadd\tr0, r2, r0\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n.L5:\n\tadd\tr0, r4, #0x1\n\tlsl\tr0, r0, #0x10\n\tlsr\tr4, r0, #0x10\n\tmov\tr1, r9\n\tldrh\tr0, [r1]\n\tlsr\tr0, r0, #0x2\n\tcmp\tr4, r0\n\tbcc\t.L6\t@cond_branch\n.L4:\n\tldr\tr0, .L24+0x4\n\tldr\tr0, [r0]\n.L19:\n\tpop\t{r3, r4, r5}\n\tmov\tr8, r3\n\tmov\tr9, r4\n\tmov\tsl, r5\n\tpop\t{r4, r5, r6, r7}\n\tpop\t{r1}\n\tbx\tr1\n.L25:\n\t.align\t2, 0\n.L24:\n\t.word\t0xffff\n\t.word\tewram_end\n.Lfe1:\n\t.size\t VramMalloc,.Lfe1-VramMalloc\n\n.text\n\t.align\t2, 0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name VramMalloc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80014440_15040:gcc2.7.2kmc","sym":"func_80014440_15040","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","global","array"],"loc":8,"refSource":"void func_80014440_15040(void) {\n s32 i;\n\n gDefaultFontPalette[0] = 0;\n for (i = 1; i < 256; i++) {\n gDefaultFontPalette[i] = 0xFFFF;\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/10AD0.c#L32-L39","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\taddiu\tv0,v0,0\n 8:\tsh\tzero,0(v0)\n c:\tli\ta0,1\n 10:\tli\ta1,0xffff\n 14:\taddiu\tv1,v0,2\n 18:\tsh\ta1,0(v1)\n 1c:\taddiu\ta0,a0,1\n 20:\tslti\tv0,a0,256\n 24:\tbnez\tv0,18 \n 28:\taddiu\tv1,v1,2\n 2c:\tjr\tra\n 30:\tnop\n\t...\n","proto":{"func_80014440_15040":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-4d63b4a654117c31/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_80014440_15040\n00000000 *UND*\t00000000 gDefaultFontPalette\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gDefaultFontPalette\n00000004 R_MIPS_LO16 gDefaultFontPalette\n\n\nContents of section .text:\n 0000 3c020000 24420000 a4400000 24040001 <...$B...@..$...\n 0010 3405ffff 24430002 a4650000 24840001 4...$C...e..$...\n 0020 28820100 1440fffc 24630002 03e00008 (....@..$c......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"gDefaultFontPalette"}],"outcome":"nonmatch","source":"void func_80014440_15040(void) {\n u16 * v0;\n s32 v1;\n *(u16 *)&gDefaultFontPalette = 0;\n v1 = 1;\n v0 = (u16 *)((u32)&gDefaultFontPalette + 2);\n do {\n *v0 = 65535;\n v1 = v1 + 1;\n v0 = v0 + 1;\n } while (v1 < 256);\n return;\n}\n","score":2,"maxScore":14,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":98,"lines":13,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"extern s16 gDefaultFontPalette;\n\nvoid func_80014440_15040(void) {\n s16 *var_v1;\n s32 var_a0;\n\n gDefaultFontPalette = 0;\n var_a0 = 1;\n var_v1 = &gDefaultFontPalette + 2;\n do {\n *var_v1 = 0xFFFF;\n var_a0 += 1;\n var_v1 += 2;\n } while (var_a0 < 0x100);\n}\n","score":8,"maxScore":14,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":1,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":13,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/10AD0.c: fills a font palette global; index 0 cleared, rest set to white","gapSize":{"decompiler":"asmlift","score":2,"maxScore":14,"ratio":0.14285714285714285,"kinds":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80014440_15040` — benchmark function snowboardkids2:func_80014440_15040:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80014440_15040\n lui\t$v0, %hi(gDefaultFontPalette)\n addiu\t$v0, $v0, %lo(gDefaultFontPalette)\n sh\t$zero, 0($v0)\n li\t$a0, 1\n li\t$a1, 0xffff\n addiu\t$v1, $v0, 2\n.L18:\n sh\t$a1, 0($v1)\n addiu\t$a0, $a0, 1\n slti\t$v0, $a0, 256\n bnez\t$v0, .L18\n addiu\t$v1, $v1, 2\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80014440_15040 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80014440_15040` — benchmark function snowboardkids2:func_80014440_15040:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80014440_15040:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\taddiu\tv0,v0,0\n 8:\tsh\tzero,0(v0)\n c:\tli\ta0,1\n 10:\tli\ta1,0xffff\n 14:\taddiu\tv1,v0,2\n 18:\tsh\ta1,0(v1)\n 1c:\taddiu\ta0,a0,1\n 20:\tslti\tv0,a0,256\n 24:\tbnez\tv0,18 \n 28:\taddiu\tv1,v1,2\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-4d63b4a654117c31/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 func_80014440_15040\n00000000 *UND*\t00000000 gDefaultFontPalette\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 gDefaultFontPalette\n00000004 R_MIPS_LO16 gDefaultFontPalette\n\n\nContents of section .text:\n 0000 3c020000 24420000 a4400000 24040001 <...$B...@..$...\n 0010 3405ffff 24430002 a4650000 24840001 4...$C...e..$...\n 0020 28820100 1440fffc 24630002 03e00008 (....@..$c......\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80014440_15040\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80014440_15040 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc","sym":"func_800154A8_160A8","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","branch","call"],"loc":15,"refSource":"void func_800154A8_160A8(s8 *arg0, u16 arg1) {\n s32 end;\n s32 ptr;\n\n if (arg1 == 0) {\n return;\n }\n\n ptr = (s32)arg0;\n end = arg1 + ptr;\n do {\n *(s8 *)ptr = 0;\n ptr++;\n } while (ptr < end);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/15690.c#L304-L318","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta1,a1,0xffff\n 4:\tbeqz\ta1,24 \n 8:\tnop\n c:\taddu\ta1,a1,a0\n 10:\tsb\tzero,0(a0)\n 14:\taddiu\ta0,a0,1\n 18:\tslt\tv0,a0,a1\n 1c:\tbnezl\tv0,14 \n 20:\tsb\tzero,0(a0)\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dd25ecd019108913/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_800154A8_160A8\n\n\nContents of section .text:\n 0000 30a5ffff 10a00007 00000000 00a42821 0.............(!\n 0010 a0800000 24840001 0085102a 5440fffd ....$......*T@..\n 0020 a0800000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800154A8_160A8' — lift: cannot lift 'func_800154A8_160A8': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tandi\ta1,a1,0xffff */\n/* 4:\tbeqz\ta1,24 */\n/* 8:\tnop */\n/* c:\taddu\ta1,a1,a0 */\n/* 10:\tsb\tzero,0(a0) */\n/* 14:\taddiu\ta0,a0,1 */\n/* 18:\tslt\tv0,a0,a1 */\n/* 1c:\tbnezl\tv0,14 */\n/* 20:\tsb\tzero,0(a0) */\n/* 24:\tjr\tra */\n/* 28:\tnop */\n/* 2c:\tnop */\nvoid func_800154A8_160A8(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800154A8_160A8': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800154A8_160A8': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_800154A8_160A8(s8 *arg0, s32 arg1) {\n s32 temp_a1;\n s32 temp_a1_2;\n s8 *var_a0;\n\n var_a0 = arg0;\n temp_a1 = arg1 & 0xFFFF;\n if (temp_a1 != 0) {\n temp_a1_2 = temp_a1 + var_a0;\n do {\n *var_a0 = 0;\n var_a0 += 1;\n } while ((s32) var_a0 < temp_a1_2);\n }\n}\n","score":1,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":14,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":1,"maxScore":11,"ratio":0.09090909090909091,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800154A8_160A8` — benchmark function snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800154A8_160A8\n andi\t$a1, $a1, 0xffff\n beqz\t$a1, .L24\n nop\n addu\t$a1, $a1, $a0\n sb\t$zero, 0($a0)\n.L14:\n addiu\t$a0, $a0, 1\n slt\t$v0, $a0, $a1\n bnezl\t$v0, .L14\n sb\t$zero, 0($a0)\n.L24:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800154A8_160A8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800154A8_160A8` — benchmark function snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800154A8_160A8:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta1,a1,0xffff\n 4:\tbeqz\ta1,24 \n 8:\tnop\n c:\taddu\ta1,a1,a0\n 10:\tsb\tzero,0(a0)\n 14:\taddiu\ta0,a0,1\n 18:\tslt\tv0,a0,a1\n 1c:\tbnezl\tv0,14 \n 20:\tsb\tzero,0(a0)\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dd25ecd019108913/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_800154A8_160A8\n\n\nContents of section .text:\n 0000 30a5ffff 10a00007 00000000 00a42821 0.............(!\n 0010 a0800000 24840001 0085102a 5440fffd ....$......*T@..\n 0020 a0800000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800154A8_160A8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc","sym":"func_800167B0_173B0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","struct","field","call"],"loc":16,"refSource":"void func_800167B0_173B0(Struct16728 *arg0) {\n if (arg0->unkC == 0) {\n arg0->unkD++;\n if ((arg0->unkD & 1) == 0) {\n arg0->unkE = (arg0->unkE + 1) & 1;\n arg0->unk8 = arg0->unkE + 7;\n }\n if (arg0->unkD == 0x10) {\n arg0->unkD = 0;\n arg0->unkC = 0x1E;\n }\n } else {\n arg0->unkC--;\n }\n debugEnqueueCallback(8, 1, func_8000FED0_10AD0, arg0);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/16FA0.c#L132-L147","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tmove\ta3,a0\n 8:\tsw\tra,16(sp)\n c:\tlbu\tv0,12(a3)\n 10:\tbnez\tv0,60 \n 14:\taddiu\tv0,v0,-1\n 18:\tlbu\tv0,13(a3)\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\tv0,13(a3)\n 24:\tandi\tv0,v0,0x1\n 28:\tbnez\tv0,48 \n 2c:\tnop\n 30:\tlbu\tv0,14(a3)\n 34:\taddiu\tv0,v0,1\n 38:\tandi\tv0,v0,0x1\n 3c:\tsb\tv0,14(a3)\n 40:\taddiu\tv0,v0,7\n 44:\tsh\tv0,8(a3)\n 48:\tlbu\tv1,13(a3)\n 4c:\tli\tv0,16\n 50:\tbne\tv1,v0,68 \n 54:\tli\ta0,8\n 58:\tli\tv0,30\n 5c:\tsb\tzero,13(a3)\n 60:\tsb\tv0,12(a3)\n 64:\tli\ta0,8\n 68:\tlui\ta2,0x0\n 6c:\taddiu\ta2,a2,0\n 70:\tjal\t0 \n 74:\tli\ta1,1\n 78:\tlw\tra,16(sp)\n 7c:\tjr\tra\n 80:\taddiu\tsp,sp,24\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-02e6b011bd38.i.gz","proto":{"func_800167B0_173B0":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0966834a6ef2f06d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800167B0_173B0\n00000000 *UND*\t00000000 func_8000FED0_10AD0\n00000000 *UND*\t00000000 debugEnqueueCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000068 R_MIPS_HI16 func_8000FED0_10AD0\n0000006c R_MIPS_LO16 func_8000FED0_10AD0\n00000070 R_MIPS_26 debugEnqueueCallback\n\n\nContents of section .text:\n 0000 27bdffe8 00803821 afbf0010 90e2000c '.....8!........\n 0010 14400013 2442ffff 90e2000d 24420001 .@..$B......$B..\n 0020 a0e2000d 30420001 14400007 00000000 ....0B...@......\n 0030 90e2000e 24420001 30420001 a0e2000e ....$B..0B......\n 0040 24420007 a4e20008 90e3000d 24020010 $B..........$...\n 0050 14620005 24040008 2402001e a0e0000d .b..$...$.......\n 0060 a0e2000c 24040008 3c060000 24c60000 ....$...<...$...\n 0070 0c000000 24050001 8fbf0010 03e00008 ....$...........\n 0080 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800167B0_173B0' — lift: cannot lift 'func_800167B0_173B0': function call 'jal' at 0x70 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tmove\ta3,a0 */\n/* 8:\tsw\tra,16(sp) */\n/* c:\tlbu\tv0,12(a3) */\n/* 10:\tbnez\tv0,60 */\n/* 14:\taddiu\tv0,v0,-1 */\n/* 18:\tlbu\tv0,13(a3) */\n/* 1c:\taddiu\tv0,v0,1 */\n/* 20:\tsb\tv0,13(a3) */\n/* 24:\tandi\tv0,v0,0x1 */\n/* 28:\tbnez\tv0,48 */\n/* 2c:\tnop */\n/* 30:\tlbu\tv0,14(a3) */\n/* 34:\taddiu\tv0,v0,1 */\n/* 38:\tandi\tv0,v0,0x1 */\n/* 3c:\tsb\tv0,14(a3) */\n/* 40:\taddiu\tv0,v0,7 */\n/* 44:\tsh\tv0,8(a3) */\n/* 48:\tlbu\tv1,13(a3) */\n/* 4c:\tli\tv0,16 */\n/* 50:\tbne\tv1,v0,68 */\n/* 54:\tli\ta0,8 */\n/* 58:\tli\tv0,30 */\n/* 5c:\tsb\tzero,13(a3) */\n/* 60:\tsb\tv0,12(a3) */\n/* 64:\tli\ta0,8 */\n/* 68:\tlui\ta2,0x0 */\n/* 6c:\taddiu\ta2,a2,0 */\n/* 70:\tjal\t0 */\n/* 74:\tli\ta1,1 */\n/* 78:\tlw\tra,16(sp) */\n/* 7c:\tjr\tra */\n/* 80:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid func_800167B0_173B0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800167B0_173B0': function call 'jal' at 0x70 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":42,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800167B0_173B0': function call 'jal' at 0x70 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_800167B0_173B0(Struct16728 *arg0) {\n u8 temp_v0;\n u8 temp_v0_2;\n u8 temp_v0_3;\n u8 var_v0;\n\n temp_v0 = arg0->unkC;\n var_v0 = temp_v0 - 1;\n if (temp_v0 == 0) {\n temp_v0_2 = arg0->unkD + 1;\n arg0->unkD = temp_v0_2;\n if (!(temp_v0_2 & 1)) {\n temp_v0_3 = (arg0->unkE + 1) & 1;\n arg0->unkE = temp_v0_3;\n arg0->unk8 = temp_v0_3 + 7;\n }\n if (arg0->unkD == 0x10) {\n var_v0 = 0x1E;\n arg0->unkD = 0;\n goto block_5;\n }\n } else {\nblock_5:\n arg0->unkC = var_v0;\n }\n debugEnqueueCallback(8U, 1U, func_8000FED0_10AD0, arg0);\n}\n","score":3,"maxScore":33,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":88,"lines":26,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/16FA0.c: animation ticker; toggles a frame index with bit math then re-enqueues itself","gapSize":{"decompiler":"m2c","score":3,"maxScore":33,"ratio":0.09090909090909091,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800167B0_173B0` — benchmark function snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800167B0_173B0\n addiu\t$sp, $sp, -24\n move\t$a3, $a0\n sw\t$ra, 16($sp)\n lbu\t$v0, 12($a3)\n bnez\t$v0, .L60\n addiu\t$v0, $v0, -1\n lbu\t$v0, 13($a3)\n addiu\t$v0, $v0, 1\n sb\t$v0, 13($a3)\n andi\t$v0, $v0, 0x1\n bnez\t$v0, .L48\n nop\n lbu\t$v0, 14($a3)\n addiu\t$v0, $v0, 1\n andi\t$v0, $v0, 0x1\n sb\t$v0, 14($a3)\n addiu\t$v0, $v0, 7\n sh\t$v0, 8($a3)\n.L48:\n lbu\t$v1, 13($a3)\n li\t$v0, 16\n bne\t$v1, $v0, .L68\n li\t$a0, 8\n li\t$v0, 30\n sb\t$zero, 13($a3)\n.L60:\n sb\t$v0, 12($a3)\n li\t$a0, 8\n.L68:\n lui\t$a2, %hi(func_8000FED0_10AD0)\n addiu\t$a2, $a2, %lo(func_8000FED0_10AD0)\n jal\tdebugEnqueueCallback\n li\t$a1, 1\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-02e6b011bd38.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800167B0_173B0(Struct16728 *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800167B0_173B0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800167B0_173B0` — benchmark function snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800167B0_173B0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tmove\ta3,a0\n 8:\tsw\tra,16(sp)\n c:\tlbu\tv0,12(a3)\n 10:\tbnez\tv0,60 \n 14:\taddiu\tv0,v0,-1\n 18:\tlbu\tv0,13(a3)\n 1c:\taddiu\tv0,v0,1\n 20:\tsb\tv0,13(a3)\n 24:\tandi\tv0,v0,0x1\n 28:\tbnez\tv0,48 \n 2c:\tnop\n 30:\tlbu\tv0,14(a3)\n 34:\taddiu\tv0,v0,1\n 38:\tandi\tv0,v0,0x1\n 3c:\tsb\tv0,14(a3)\n 40:\taddiu\tv0,v0,7\n 44:\tsh\tv0,8(a3)\n 48:\tlbu\tv1,13(a3)\n 4c:\tli\tv0,16\n 50:\tbne\tv1,v0,68 \n 54:\tli\ta0,8\n 58:\tli\tv0,30\n 5c:\tsb\tzero,13(a3)\n 60:\tsb\tv0,12(a3)\n 64:\tli\ta0,8\n 68:\tlui\ta2,0x0\n 6c:\taddiu\ta2,a2,0\n 70:\tjal\t0 \n 74:\tli\ta1,1\n 78:\tlw\tra,16(sp)\n 7c:\tjr\tra\n 80:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0966834a6ef2f06d/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000084 func_800167B0_173B0\n00000000 *UND*\t00000000 func_8000FED0_10AD0\n00000000 *UND*\t00000000 debugEnqueueCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000068 R_MIPS_HI16 func_8000FED0_10AD0\n0000006c R_MIPS_LO16 func_8000FED0_10AD0\n00000070 R_MIPS_26 debugEnqueueCallback\n\n\nContents of section .text:\n 0000 27bdffe8 00803821 afbf0010 90e2000c '.....8!........\n 0010 14400013 2442ffff 90e2000d 24420001 .@..$B......$B..\n 0020 a0e2000d 30420001 14400007 00000000 ....0B...@......\n 0030 90e2000e 24420001 30420001 a0e2000e ....$B..0B......\n 0040 24420007 a4e20008 90e3000d 24020010 $B..........$...\n 0050 14620005 24040008 2402001e a0e0000d .b..$...$.......\n 0060 a0e2000c 24040008 3c060000 24c60000 ....$...<...$...\n 0070 0c000000 24050001 8fbf0010 03e00008 ....$...........\n 0080 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_800167B0_173B0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800167B0_173B0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc","sym":"func_80018DC0_199C0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","call","global","branch"],"loc":14,"refSource":"void func_80018DC0_199C0(void) {\n task_mem_199C0 *mem;\n\n mem = (task_mem_199C0 *)allocateTaskMemory(4);\n mem->unk2 = 0;\n mem->unk0 = 0;\n\n if (D_800A8CC8_A0038 != 4) {\n func_800574A0_580A0(2);\n }\n\n createTaskQueue(D_8008D78C_8E38C[D_800A8CC8_A0038], 0x5A);\n setGameStateHandler(func_80018E2C_19A2C);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/199C0.c#L16-L29","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tli\ta0,4\n 10:\tsb\tzero,2(v0)\n 14:\tlui\tv1,0x0\n 18:\tlbu\tv1,0(v1)\n 1c:\tsh\tzero,0(v0)\n 20:\tli\tv0,4\n 24:\tbeq\tv1,v0,34 \n 28:\tnop\n 2c:\tjal\t0 \n 30:\tli\ta0,2\n 34:\tlui\tv0,0x0\n 38:\tlbu\tv0,0(v0)\n 3c:\tsll\tv0,v0,0x2\n 40:\tlui\ta0,0x0\n 44:\taddu\ta0,a0,v0\n 48:\tlw\ta0,0(a0)\n 4c:\tjal\t0 \n 50:\tli\ta1,90\n 54:\tlui\ta0,0x0\n 58:\tjal\t0 \n 5c:\taddiu\ta0,a0,0\n 60:\tlw\tra,16(sp)\n 64:\tjr\tra\n 68:\taddiu\tsp,sp,24\n 6c:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-163252facba5.i.gz","proto":{"func_80018DC0_199C0":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-72d0c8d03e081c13/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80018DC0_199C0\n00000000 *UND*\t00000000 allocateTaskMemory\n00000000 *UND*\t00000000 D_800A8CC8_A0038\n00000000 *UND*\t00000000 func_800574A0_580A0\n00000000 *UND*\t00000000 D_8008D78C_8E38C\n00000000 *UND*\t00000000 createTaskQueue\n00000000 *UND*\t00000000 func_80018E2C_19A2C\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 allocateTaskMemory\n00000014 R_MIPS_HI16 D_800A8CC8_A0038\n00000018 R_MIPS_LO16 D_800A8CC8_A0038\n0000002c R_MIPS_26 func_800574A0_580A0\n00000034 R_MIPS_HI16 D_800A8CC8_A0038\n00000038 R_MIPS_LO16 D_800A8CC8_A0038\n00000040 R_MIPS_HI16 D_8008D78C_8E38C\n00000048 R_MIPS_LO16 D_8008D78C_8E38C\n0000004c R_MIPS_26 createTaskQueue\n00000054 R_MIPS_HI16 func_80018E2C_19A2C\n0000005c R_MIPS_LO16 func_80018E2C_19A2C\n00000058 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 24040004 '...........$...\n 0010 a0400002 3c030000 90630000 a4400000 .@..<....c...@..\n 0020 24020004 10620003 00000000 0c000000 $....b..........\n 0030 24040002 3c020000 90420000 00021080 $...<....B......\n 0040 3c040000 00822021 8c840000 0c000000 <..... !........\n 0050 2405005a 3c040000 0c000000 24840000 $..Z<.......$...\n 0060 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80018DC0_199C0' — lift: cannot lift 'func_80018DC0_199C0': function call 'jal' at 0x8 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tjal\t0 */\n/* c:\tli\ta0,4 */\n/* 10:\tsb\tzero,2(v0) */\n/* 14:\tlui\tv1,0x0 */\n/* 18:\tlbu\tv1,0(v1) */\n/* 1c:\tsh\tzero,0(v0) */\n/* 20:\tli\tv0,4 */\n/* 24:\tbeq\tv1,v0,34 */\n/* 28:\tnop */\n/* 2c:\tjal\t0 */\n/* 30:\tli\ta0,2 */\n/* 34:\tlui\tv0,0x0 */\n/* 38:\tlbu\tv0,0(v0) */\n/* 3c:\tsll\tv0,v0,0x2 */\n/* 40:\tlui\ta0,0x0 */\n/* 44:\taddu\ta0,a0,v0 */\n/* 48:\tlw\ta0,0(a0) */\n/* 4c:\tjal\t0 */\n/* 50:\tli\ta1,90 */\n/* 54:\tlui\ta0,0x0 */\n/* 58:\tjal\t0 */\n/* 5c:\taddiu\ta0,a0,0 */\n/* 60:\tlw\tra,16(sp) */\n/* 64:\tjr\tra */\n/* 68:\taddiu\tsp,sp,24 */\n/* 6c:\tnop */\nvoid func_80018DC0_199C0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80018DC0_199C0': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":36,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80018DC0_199C0': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_80018DC0_199C0(void) {\n void *temp_v0;\n\n temp_v0 = allocateTaskMemory(4);\n temp_v0->unk2 = 0;\n temp_v0->unk0 = 0;\n if (D_800A8CC8_A0038 != 4) {\n func_800574A0_580A0(2);\n }\n createTaskQueue(D_8008D78C_8E38C[D_800A8CC8_A0038], 0x5A);\n setGameStateHandler(func_80018E2C_19A2C);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":11,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:1837: request for member `unk2' in something not a structure or union","/c.i:1838: request for member `unk0' in something not a structure or union"]},"note":"src/199C0.c: task init; allocates task memory, dispatches by global index","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80018DC0_199C0` — benchmark function snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80018DC0_199C0\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tallocateTaskMemory\n li\t$a0, 4\n sb\t$zero, 2($v0)\n lui\t$v1, %hi(D_800A8CC8_A0038)\n lbu\t$v1, %lo(D_800A8CC8_A0038)($v1)\n sh\t$zero, 0($v0)\n li\t$v0, 4\n beq\t$v1, $v0, .L34\n nop\n jal\tfunc_800574A0_580A0\n li\t$a0, 2\n.L34:\n lui\t$v0, %hi(D_800A8CC8_A0038)\n lbu\t$v0, %lo(D_800A8CC8_A0038)($v0)\n sll\t$v0, $v0, 0x2\n lui\t$a0, %hi(D_8008D78C_8E38C)\n addu\t$a0, $a0, $v0\n lw\t$a0, %lo(D_8008D78C_8E38C)($a0)\n jal\tcreateTaskQueue\n li\t$a1, 90\n lui\t$a0, %hi(func_80018E2C_19A2C)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80018E2C_19A2C)\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-163252facba5.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80018DC0_199C0(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80018DC0_199C0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80018DC0_199C0` — benchmark function snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80018DC0_199C0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tli\ta0,4\n 10:\tsb\tzero,2(v0)\n 14:\tlui\tv1,0x0\n 18:\tlbu\tv1,0(v1)\n 1c:\tsh\tzero,0(v0)\n 20:\tli\tv0,4\n 24:\tbeq\tv1,v0,34 \n 28:\tnop\n 2c:\tjal\t0 \n 30:\tli\ta0,2\n 34:\tlui\tv0,0x0\n 38:\tlbu\tv0,0(v0)\n 3c:\tsll\tv0,v0,0x2\n 40:\tlui\ta0,0x0\n 44:\taddu\ta0,a0,v0\n 48:\tlw\ta0,0(a0)\n 4c:\tjal\t0 \n 50:\tli\ta1,90\n 54:\tlui\ta0,0x0\n 58:\tjal\t0 \n 5c:\taddiu\ta0,a0,0\n 60:\tlw\tra,16(sp)\n 64:\tjr\tra\n 68:\taddiu\tsp,sp,24\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-72d0c8d03e081c13/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c func_80018DC0_199C0\n00000000 *UND*\t00000000 allocateTaskMemory\n00000000 *UND*\t00000000 D_800A8CC8_A0038\n00000000 *UND*\t00000000 func_800574A0_580A0\n00000000 *UND*\t00000000 D_8008D78C_8E38C\n00000000 *UND*\t00000000 createTaskQueue\n00000000 *UND*\t00000000 func_80018E2C_19A2C\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 allocateTaskMemory\n00000014 R_MIPS_HI16 D_800A8CC8_A0038\n00000018 R_MIPS_LO16 D_800A8CC8_A0038\n0000002c R_MIPS_26 func_800574A0_580A0\n00000034 R_MIPS_HI16 D_800A8CC8_A0038\n00000038 R_MIPS_LO16 D_800A8CC8_A0038\n00000040 R_MIPS_HI16 D_8008D78C_8E38C\n00000048 R_MIPS_LO16 D_8008D78C_8E38C\n0000004c R_MIPS_26 createTaskQueue\n00000054 R_MIPS_HI16 func_80018E2C_19A2C\n0000005c R_MIPS_LO16 func_80018E2C_19A2C\n00000058 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 24040004 '...........$...\n 0010 a0400002 3c030000 90630000 a4400000 .@..<....c...@..\n 0020 24020004 10620003 00000000 0c000000 $....b..........\n 0030 24040002 3c020000 90420000 00021080 $...<....B......\n 0040 3c040000 00822021 8c840000 0c000000 <..... !........\n 0050 2405005a 3c040000 0c000000 24840000 $..Z<.......$...\n 0060 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80018DC0_199C0\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80018DC0_199C0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc","sym":"func_8001BCDC_1C8DC","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","struct","field","global","branch"],"loc":20,"refSource":"void func_8001BCDC_1C8DC(void) {\n GameState *state = getCurrentAllocation();\n s32 i;\n s32 j;\n u8 count;\n\n for (i = 0; i < 9; i++) {\n count = 0;\n\n for (j = 0; j < D_800AFE8C_A71FC->unk8; j++) {\n if (state->unk59A[j] == 1 || state->unk59A[j] == 3) {\n count++;\n }\n }\n\n if (count == 0) {\n state->unk5B8[i] = 0;\n }\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1BBA0.c#L87-L106","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\tra,24(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tmove\tt0,v0\n 14:\tmove\ta2,zero\n 18:\tlui\tv0,0x0\n 1c:\tlw\tv0,0(v0)\n 20:\tlbu\tv0,8(v0)\n 24:\tmove\ta1,zero\n 28:\tblez\tv0,68 \n 2c:\tmove\ta0,zero\n 30:\tmove\ta3,v0\n 34:\taddu\tv0,t0,a0\n 38:\tlbu\tv0,1434(v0)\n 3c:\txori\tv1,v0,0x1\n 40:\tsltiu\tv1,v1,1\n 44:\txori\tv0,v0,0x3\n 48:\tsltiu\tv0,v0,1\n 4c:\tor\tv1,v1,v0\n 50:\tbnezl\tv1,58 \n 54:\taddiu\ta1,a1,1\n 58:\taddiu\ta0,a0,1\n 5c:\tslt\tv0,a0,a3\n 60:\tbnez\tv0,38 \n 64:\taddu\tv0,t0,a0\n 68:\tandi\tv0,a1,0xff\n 6c:\tbnezl\tv0,80 \n 70:\taddiu\ta2,a2,1\n 74:\taddu\tv0,t0,a2\n 78:\tsb\tzero,1464(v0)\n 7c:\taddiu\ta2,a2,1\n 80:\tslti\tv0,a2,9\n 84:\tbnez\tv0,18 \n 88:\tnop\n 8c:\tlw\tra,24(sp)\n 90:\tjr\tra\n 94:\taddiu\tsp,sp,32\n\t...\n","proto":{"func_8001BCDC_1C8DC":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3b0d9b3084dd05cc/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000098 func_8001BCDC_1C8DC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 D_800AFE8C_A71FC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_HI16 D_800AFE8C_A71FC\n0000001c R_MIPS_LO16 D_800AFE8C_A71FC\n\n\nContents of section .text:\n 0000 27bdffe0 afbf0018 0c000000 00000000 '...............\n 0010 00404021 00003021 3c020000 8c420000 .@@!..0!<....B..\n 0020 90420008 00002821 1840000f 00002021 .B....(!.@.... !\n 0030 00403821 01041021 9042059a 38430001 .@8!...!.B..8C..\n 0040 2c630001 38420003 2c420001 00621825 ,c..8B..,B...b.%\n 0050 54600001 24a50001 24840001 0087102a T`..$...$......*\n 0060 1440fff5 01041021 30a200ff 54400004 .@.....!0...T@..\n 0070 24c60001 01061021 a04005b8 24c60001 $......!.@..$...\n 0080 28c20009 1440ffe4 00000000 8fbf0018 (....@..........\n 0090 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8001BCDC_1C8DC' — lift: cannot lift 'func_8001BCDC_1C8DC': function call 'jal' at 0x8 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-32 */\n/* 4:\tsw\tra,24(sp) */\n/* 8:\tjal\t0 */\n/* c:\tnop */\n/* 10:\tmove\tt0,v0 */\n/* 14:\tmove\ta2,zero */\n/* 18:\tlui\tv0,0x0 */\n/* 1c:\tlw\tv0,0(v0) */\n/* 20:\tlbu\tv0,8(v0) */\n/* 24:\tmove\ta1,zero */\n/* 28:\tblez\tv0,68 */\n/* 2c:\tmove\ta0,zero */\n/* 30:\tmove\ta3,v0 */\n/* 34:\taddu\tv0,t0,a0 */\n/* 38:\tlbu\tv0,1434(v0) */\n/* 3c:\txori\tv1,v0,0x1 */\n/* 40:\tsltiu\tv1,v1,1 */\n/* 44:\txori\tv0,v0,0x3 */\n/* 48:\tsltiu\tv0,v0,1 */\n/* 4c:\tor\tv1,v1,v0 */\n/* 50:\tbnezl\tv1,58 */\n/* 54:\taddiu\ta1,a1,1 */\n/* 58:\taddiu\ta0,a0,1 */\n/* 5c:\tslt\tv0,a0,a3 */\n/* 60:\tbnez\tv0,38 */\n/* 64:\taddu\tv0,t0,a0 */\n/* 68:\tandi\tv0,a1,0xff */\n/* 6c:\tbnezl\tv0,80 */\n/* 70:\taddiu\ta2,a2,1 */\n/* 74:\taddu\tv0,t0,a2 */\n/* 78:\tsb\tzero,1464(v0) */\n/* 7c:\taddiu\ta2,a2,1 */\n/* 80:\tslti\tv0,a2,9 */\n/* 84:\tbnez\tv0,18 */\n/* 88:\tnop */\n/* 8c:\tlw\tra,24(sp) */\n/* 90:\tjr\tra */\n/* 94:\taddiu\tsp,sp,32 */\n/* \t... */\nvoid func_8001BCDC_1C8DC(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8001BCDC_1C8DC': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":47,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8001BCDC_1C8DC': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void *getCurrentAllocation(); /* extern */\nextern void *D_800AFE8C_A71FC;\n\nvoid func_8001BCDC_1C8DC(void) {\n s32 var_a0;\n s32 var_a1;\n s32 var_a2;\n u8 temp_v0;\n u8 temp_v0_2;\n void *temp_t0;\n void *var_v0;\n\n temp_t0 = getCurrentAllocation();\n var_a2 = 0;\n do {\n temp_v0 = D_800AFE8C_A71FC->unk8;\n var_a1 = 0;\n var_a0 = 0;\n if ((s32) temp_v0 > 0) {\n var_v0 = temp_t0;\n do {\n temp_v0_2 = var_v0->unk59A;\n if (((temp_v0_2 == 1) | (temp_v0_2 == 3)) != 0) {\n var_a1 += 1;\n }\n var_a0 += 1;\n var_v0 = temp_t0 + var_a0;\n } while (var_a0 < (s32) temp_v0);\n }\n if (!(var_a1 & 0xFF)) {\n (temp_t0 + var_a2)->unk5B8 = 0;\n }\n var_a2 += 1;\n } while (var_a2 < 9);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":98,"lines":33,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: kmc gcc (docker) failed: /c.i:2621: conflicting types for `D_800AFE8C_A71FC'","/c.i:2540: previous declaration of `D_800AFE8C_A71FC'","/c.i:2633: request for member `unk8' in something not a structure or union","/c.i:2639: request for member `unk59A' in something not a structure or union","/c.i:2648: request for member `unk5B8' in something not a structure or union"]},"note":"src/1BBA0.c: nested loop counting active players, clears a flag row when none remain","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8001BCDC_1C8DC` — benchmark function snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001BCDC_1C8DC\n addiu\t$sp, $sp, -32\n sw\t$ra, 24($sp)\n jal\tgetCurrentAllocation\n nop\n move\t$t0, $v0\n move\t$a2, $zero\n.L18:\n lui\t$v0, %hi(D_800AFE8C_A71FC)\n lw\t$v0, %lo(D_800AFE8C_A71FC)($v0)\n lbu\t$v0, 8($v0)\n move\t$a1, $zero\n blez\t$v0, .L68\n move\t$a0, $zero\n move\t$a3, $v0\n addu\t$v0, $t0, $a0\n.L38:\n lbu\t$v0, 1434($v0)\n xori\t$v1, $v0, 0x1\n sltiu\t$v1, $v1, 1\n xori\t$v0, $v0, 0x3\n sltiu\t$v0, $v0, 1\n or\t$v1, $v1, $v0\n bnezl\t$v1, .L58\n addiu\t$a1, $a1, 1\n.L58:\n addiu\t$a0, $a0, 1\n slt\t$v0, $a0, $a3\n bnez\t$v0, .L38\n addu\t$v0, $t0, $a0\n.L68:\n andi\t$v0, $a1, 0xff\n bnezl\t$v0, .L80\n addiu\t$a2, $a2, 1\n addu\t$v0, $t0, $a2\n sb\t$zero, 1464($v0)\n addiu\t$a2, $a2, 1\n.L80:\n slti\t$v0, $a2, 9\n bnez\t$v0, .L18\n nop\n lw\t$ra, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001BCDC_1C8DC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001BCDC_1C8DC` — benchmark function snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8001BCDC_1C8DC:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\tra,24(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tmove\tt0,v0\n 14:\tmove\ta2,zero\n 18:\tlui\tv0,0x0\n 1c:\tlw\tv0,0(v0)\n 20:\tlbu\tv0,8(v0)\n 24:\tmove\ta1,zero\n 28:\tblez\tv0,68 \n 2c:\tmove\ta0,zero\n 30:\tmove\ta3,v0\n 34:\taddu\tv0,t0,a0\n 38:\tlbu\tv0,1434(v0)\n 3c:\txori\tv1,v0,0x1\n 40:\tsltiu\tv1,v1,1\n 44:\txori\tv0,v0,0x3\n 48:\tsltiu\tv0,v0,1\n 4c:\tor\tv1,v1,v0\n 50:\tbnezl\tv1,58 \n 54:\taddiu\ta1,a1,1\n 58:\taddiu\ta0,a0,1\n 5c:\tslt\tv0,a0,a3\n 60:\tbnez\tv0,38 \n 64:\taddu\tv0,t0,a0\n 68:\tandi\tv0,a1,0xff\n 6c:\tbnezl\tv0,80 \n 70:\taddiu\ta2,a2,1\n 74:\taddu\tv0,t0,a2\n 78:\tsb\tzero,1464(v0)\n 7c:\taddiu\ta2,a2,1\n 80:\tslti\tv0,a2,9\n 84:\tbnez\tv0,18 \n 88:\tnop\n 8c:\tlw\tra,24(sp)\n 90:\tjr\tra\n 94:\taddiu\tsp,sp,32\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3b0d9b3084dd05cc/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000098 func_8001BCDC_1C8DC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 D_800AFE8C_A71FC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_HI16 D_800AFE8C_A71FC\n0000001c R_MIPS_LO16 D_800AFE8C_A71FC\n\n\nContents of section .text:\n 0000 27bdffe0 afbf0018 0c000000 00000000 '...............\n 0010 00404021 00003021 3c020000 8c420000 .@@!..0!<....B..\n 0020 90420008 00002821 1840000f 00002021 .B....(!.@.... !\n 0030 00403821 01041021 9042059a 38430001 .@8!...!.B..8C..\n 0040 2c630001 38420003 2c420001 00621825 ,c..8B..,B...b.%\n 0050 54600001 24a50001 24840001 0087102a T`..$...$......*\n 0060 1440fff5 01041021 30a200ff 54400004 .@.....!0...T@..\n 0070 24c60001 01061021 a04005b8 24c60001 $......!.@..$...\n 0080 28c20009 1440ffe4 00000000 8fbf0018 (....@..........\n 0090 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001BCDC_1C8DC\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001BCDC_1C8DC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc","sym":"func_8001BD74_1C974","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","pointer","memory"],"loc":10,"refSource":"void func_8001BD74_1C974(s8 *a0) {\n if (*a0 == 3) {\n *a0 = 2;\n } else if (*a0 == 8) {\n *a0 = 7;\n } else if (*a0 != 4) {\n } else {\n *a0 = 0;\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1BBA0.c#L108-L117","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlb\tv1,0(a0)\n 4:\tli\tv0,3\n 8:\tbne\tv1,v0,1c \n c:\tli\tv0,8\n 10:\tli\tv0,2\n 14:\tj\t38 \n 18:\tsb\tv0,0(a0)\n 1c:\tbne\tv1,v0,30 \n 20:\tli\tv0,4\n 24:\tli\tv0,7\n 28:\tj\t38 \n 2c:\tsb\tv0,0(a0)\n 30:\tbeql\tv1,v0,38 \n 34:\tsb\tzero,0(a0)\n 38:\tjr\tra\n 3c:\tnop\n","proto":{"func_8001BD74_1C974":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-bf8de6181edf7df5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001BD74_1C974\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 .text\n00000028 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 80830000 24020003 14620004 24020008 ....$....b..$...\n 0010 24020002 0800000e a0820000 14620004 $............b..\n 0020 24020004 24020007 0800000e a0820000 $...$...........\n 0030 50620001 a0800000 03e00008 00000000 Pb..............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8001BD74_1C974' — lift: cannot lift 'func_8001BD74_1C974': unmodelled control transfer 'beql' at 0x30 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlb\tv1,0(a0) */\n/* 4:\tli\tv0,3 */\n/* 8:\tbne\tv1,v0,1c */\n/* c:\tli\tv0,8 */\n/* 10:\tli\tv0,2 */\n/* 14:\tj\t38 */\n/* 18:\tsb\tv0,0(a0) */\n/* 1c:\tbne\tv1,v0,30 */\n/* 20:\tli\tv0,4 */\n/* 24:\tli\tv0,7 */\n/* 28:\tj\t38 */\n/* 2c:\tsb\tv0,0(a0) */\n/* 30:\tbeql\tv1,v0,38 */\n/* 34:\tsb\tzero,0(a0) */\n/* 38:\tjr\tra */\n/* 3c:\tnop */\nvoid func_8001BD74_1C974(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8001BD74_1C974': unmodelled control transfer 'beql' at 0x30 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":24,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8001BD74_1C974': unmodelled control transfer 'beql' at 0x30 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_8001BD74_1C974(s8 *arg0) {\n s8 temp_v1;\n\n temp_v1 = *arg0;\n switch (temp_v1) { /* irregular */\n case 3:\n *arg0 = 2;\n return;\n case 8:\n *arg0 = 7;\n return;\n case 4:\n *arg0 = 0;\n return;\n }\n}\n","score":14,"maxScore":23,"compileErrors":null,"breakdown":{"insert":7,"delete":1,"replace":3,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/1BBA0.c: remaps a state byte through a pointer via an if-chain; pure leaf","gapSize":{"decompiler":"m2c","score":14,"maxScore":23,"ratio":0.6086956521739131,"kinds":{"insert":7,"delete":1,"replace":3,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8001BD74_1C974` — benchmark function snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8001BD74_1C974\n lb\t$v1, 0($a0)\n li\t$v0, 3\n bne\t$v1, $v0, .L1c\n li\t$v0, 8\n li\t$v0, 2\n j\t.L38\n sb\t$v0, 0($a0)\n.L1c:\n bne\t$v1, $v0, .L30\n li\t$v0, 4\n li\t$v0, 7\n j\t.L38\n sb\t$v0, 0($a0)\n.L30:\n beql\t$v1, $v0, .L38\n sb\t$zero, 0($a0)\n.L38:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8001BD74_1C974 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8001BD74_1C974` — benchmark function snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8001BD74_1C974:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlb\tv1,0(a0)\n 4:\tli\tv0,3\n 8:\tbne\tv1,v0,1c \n c:\tli\tv0,8\n 10:\tli\tv0,2\n 14:\tj\t38 \n 18:\tsb\tv0,0(a0)\n 1c:\tbne\tv1,v0,30 \n 20:\tli\tv0,4\n 24:\tli\tv0,7\n 28:\tj\t38 \n 2c:\tsb\tv0,0(a0)\n 30:\tbeql\tv1,v0,38 \n 34:\tsb\tzero,0(a0)\n 38:\tjr\tra\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-bf8de6181edf7df5/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 func_8001BD74_1C974\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_26 .text\n00000028 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 80830000 24020003 14620004 24020008 ....$....b..$...\n 0010 24020002 0800000e a0820000 14620004 $............b..\n 0020 24020004 24020007 0800000e a0820000 $...$...........\n 0030 50620001 a0800000 03e00008 00000000 Pb..............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8001BD74_1C974\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8001BD74_1C974 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80021C00_22800:gcc2.7.2kmc","sym":"func_80021C00_22800","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["call","branch","compare"],"loc":9,"refSource":"void func_80021C00_22800(void) {\n s16 result = func_80069810_6A410();\n\n if (result == 0xFF) {\n terminateSchedulerWithCallback(&func_80021D00_22900);\n } else if (result == 1) {\n setGameStateHandler(&func_80021C58_22858);\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/227D0.c#L18-L26","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tsll\tv0,v0,0x10\n 14:\tsra\tv1,v0,0x10\n 18:\tli\tv0,255\n 1c:\tbne\tv1,v0,38 \n 20:\tli\tv0,1\n 24:\tlui\ta0,0x0\n 28:\tjal\t0 \n 2c:\taddiu\ta0,a0,0\n 30:\tj\t4c \n 34:\tnop\n 38:\tbne\tv1,v0,4c \n 3c:\tnop\n 40:\tlui\ta0,0x0\n 44:\tjal\t0 \n 48:\taddiu\ta0,a0,0\n 4c:\tlw\tra,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-c3df422c9dc8.i.gz","proto":{"func_80021C00_22800":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1bbfd2db97d42027/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80021C00_22800\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021D00_22900\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n00000000 *UND*\t00000000 func_80021C58_22858\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 func_80069810_6A410\n00000024 R_MIPS_HI16 func_80021D00_22900\n0000002c R_MIPS_LO16 func_80021D00_22900\n00000028 R_MIPS_26 terminateSchedulerWithCallback\n00000030 R_MIPS_26 .text\n00000040 R_MIPS_HI16 func_80021C58_22858\n00000048 R_MIPS_LO16 func_80021C58_22858\n00000044 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 00021400 00021c03 240200ff 14620006 ........$....b..\n 0020 24020001 3c040000 0c000000 24840000 $...<.......$...\n 0030 08000013 00000000 14620004 00000000 .........b......\n 0040 3c040000 0c000000 24840000 8fbf0010 <.......$.......\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80021C00_22800' — lift: cannot lift 'func_80021C00_22800': function call 'jal' at 0x8 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tjal\t0 */\n/* c:\tnop */\n/* 10:\tsll\tv0,v0,0x10 */\n/* 14:\tsra\tv1,v0,0x10 */\n/* 18:\tli\tv0,255 */\n/* 1c:\tbne\tv1,v0,38 */\n/* 20:\tli\tv0,1 */\n/* 24:\tlui\ta0,0x0 */\n/* 28:\tjal\t0 */\n/* 2c:\taddiu\ta0,a0,0 */\n/* 30:\tj\t4c */\n/* 34:\tnop */\n/* 38:\tbne\tv1,v0,4c */\n/* 3c:\tnop */\n/* 40:\tlui\ta0,0x0 */\n/* 44:\tjal\t0 */\n/* 48:\taddiu\ta0,a0,0 */\n/* 4c:\tlw\tra,16(sp) */\n/* 50:\tjr\tra */\n/* 54:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid func_80021C00_22800(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80021C00_22800': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":31,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80021C00_22800': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_80021C00_22800(void) {\n s16 temp_v0;\n\n temp_v0 = func_80069810_6A410();\n switch (temp_v0) { /* irregular */\n case 0xFF:\n terminateSchedulerWithCallback(func_80021D00_22900);\n return;\n case 0x1:\n setGameStateHandler(func_80021C58_22858);\n return;\n }\n}\n","score":7,"maxScore":24,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":12,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/227D0.c: game-state dispatch on a poll result","gapSize":{"decompiler":"m2c","score":7,"maxScore":24,"ratio":0.2916666666666667,"kinds":{"insert":2,"delete":2,"replace":1,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80021C00_22800` — benchmark function snowboardkids2:func_80021C00_22800:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80021C00_22800\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tfunc_80069810_6A410\n nop\n sll\t$v0, $v0, 0x10\n sra\t$v1, $v0, 0x10\n li\t$v0, 255\n bne\t$v1, $v0, .L38\n li\t$v0, 1\n lui\t$a0, %hi(func_80021D00_22900)\n jal\tterminateSchedulerWithCallback\n addiu\t$a0, $a0, %lo(func_80021D00_22900)\n j\t.L4c\n nop\n.L38:\n bne\t$v1, $v0, .L4c\n nop\n lui\t$a0, %hi(func_80021C58_22858)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80021C58_22858)\n.L4c:\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-c3df422c9dc8.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80021C00_22800(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80021C00_22800 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80021C00_22800` — benchmark function snowboardkids2:func_80021C00_22800:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80021C00_22800:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tsll\tv0,v0,0x10\n 14:\tsra\tv1,v0,0x10\n 18:\tli\tv0,255\n 1c:\tbne\tv1,v0,38 \n 20:\tli\tv0,1\n 24:\tlui\ta0,0x0\n 28:\tjal\t0 \n 2c:\taddiu\ta0,a0,0\n 30:\tj\t4c \n 34:\tnop\n 38:\tbne\tv1,v0,4c \n 3c:\tnop\n 40:\tlui\ta0,0x0\n 44:\tjal\t0 \n 48:\taddiu\ta0,a0,0\n 4c:\tlw\tra,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1bbfd2db97d42027/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80021C00_22800\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021D00_22900\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n00000000 *UND*\t00000000 func_80021C58_22858\n00000000 *UND*\t00000000 setGameStateHandler\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 func_80069810_6A410\n00000024 R_MIPS_HI16 func_80021D00_22900\n0000002c R_MIPS_LO16 func_80021D00_22900\n00000028 R_MIPS_26 terminateSchedulerWithCallback\n00000030 R_MIPS_26 .text\n00000040 R_MIPS_HI16 func_80021C58_22858\n00000048 R_MIPS_LO16 func_80021C58_22858\n00000044 R_MIPS_26 setGameStateHandler\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 00021400 00021c03 240200ff 14620006 ........$....b..\n 0020 24020001 3c040000 0c000000 24840000 $...<.......$...\n 0030 08000013 00000000 14620004 00000000 .........b......\n 0040 3c040000 0c000000 24840000 8fbf0010 <.......$.......\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80021C00_22800\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80021C00_22800 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80021D88_22988:gcc2.7.2kmc","sym":"func_80021D88_22988","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["call","branch","local"],"loc":12,"refSource":"void func_80021D88_22988(void) {\n s16 result;\n\n getCurrentAllocation();\n result = func_80069810_6A410();\n\n if (result == 1) {\n setGameStateHandler(func_80021DE8_229E8);\n } else if (result == 0xFF) {\n terminateSchedulerWithCallback(func_80022108_22D08);\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/22920.c#L35-L46","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tjal\t0 \n 14:\tnop\n 18:\tsll\tv0,v0,0x10\n 1c:\tsra\tv1,v0,0x10\n 20:\tli\tv0,1\n 24:\tbne\tv1,v0,40 \n 28:\tli\tv0,255\n 2c:\tlui\ta0,0x0\n 30:\tjal\t0 \n 34:\taddiu\ta0,a0,0\n 38:\tj\t54 \n 3c:\tnop\n 40:\tbne\tv1,v0,54 \n 44:\tnop\n 48:\tlui\ta0,0x0\n 4c:\tjal\t0 \n 50:\taddiu\ta0,a0,0\n 54:\tlw\tra,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-e0cb1bd24f0c.i.gz","proto":{"func_80021D88_22988":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-a50ccb5d3e41fbec/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80021D88_22988\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021DE8_229E8\n00000000 *UND*\t00000000 setGameStateHandler\n00000000 *UND*\t00000000 func_80022108_22D08\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000010 R_MIPS_26 func_80069810_6A410\n0000002c R_MIPS_HI16 func_80021DE8_229E8\n00000034 R_MIPS_LO16 func_80021DE8_229E8\n00000030 R_MIPS_26 setGameStateHandler\n00000038 R_MIPS_26 .text\n00000048 R_MIPS_HI16 func_80022108_22D08\n00000050 R_MIPS_LO16 func_80022108_22D08\n0000004c R_MIPS_26 terminateSchedulerWithCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 0c000000 00000000 00021400 00021c03 ................\n 0020 24020001 14620006 240200ff 3c040000 $....b..$...<...\n 0030 0c000000 24840000 08000015 00000000 ....$...........\n 0040 14620004 00000000 3c040000 0c000000 .b......<.......\n 0050 24840000 8fbf0010 03e00008 27bd0018 $...........'...\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80021D88_22988' — lift: cannot lift 'func_80021D88_22988': function call 'jal' at 0x8 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tjal\t0 */\n/* c:\tnop */\n/* 10:\tjal\t0 */\n/* 14:\tnop */\n/* 18:\tsll\tv0,v0,0x10 */\n/* 1c:\tsra\tv1,v0,0x10 */\n/* 20:\tli\tv0,1 */\n/* 24:\tbne\tv1,v0,40 */\n/* 28:\tli\tv0,255 */\n/* 2c:\tlui\ta0,0x0 */\n/* 30:\tjal\t0 */\n/* 34:\taddiu\ta0,a0,0 */\n/* 38:\tj\t54 */\n/* 3c:\tnop */\n/* 40:\tbne\tv1,v0,54 */\n/* 44:\tnop */\n/* 48:\tlui\ta0,0x0 */\n/* 4c:\tjal\t0 */\n/* 50:\taddiu\ta0,a0,0 */\n/* 54:\tlw\tra,16(sp) */\n/* 58:\tjr\tra */\n/* 5c:\taddiu\tsp,sp,24 */\nvoid func_80021D88_22988(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80021D88_22988': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80021D88_22988': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_80021D88_22988(void) {\n s16 temp_v0;\n\n getCurrentAllocation();\n temp_v0 = func_80069810_6A410();\n switch (temp_v0) { /* irregular */\n case 0x1:\n setGameStateHandler(func_80021DE8_229E8);\n return;\n case 0xFF:\n terminateSchedulerWithCallback(func_80022108_22D08);\n return;\n }\n}\n","score":7,"maxScore":28,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/22920.c: game-state dispatch","gapSize":{"decompiler":"m2c","score":7,"maxScore":28,"ratio":0.25,"kinds":{"insert":4,"delete":2,"replace":1,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80021D88_22988` — benchmark function snowboardkids2:func_80021D88_22988:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80021D88_22988\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tgetCurrentAllocation\n nop\n jal\tfunc_80069810_6A410\n nop\n sll\t$v0, $v0, 0x10\n sra\t$v1, $v0, 0x10\n li\t$v0, 1\n bne\t$v1, $v0, .L40\n li\t$v0, 255\n lui\t$a0, %hi(func_80021DE8_229E8)\n jal\tsetGameStateHandler\n addiu\t$a0, $a0, %lo(func_80021DE8_229E8)\n j\t.L54\n nop\n.L40:\n bne\t$v1, $v0, .L54\n nop\n lui\t$a0, %hi(func_80022108_22D08)\n jal\tterminateSchedulerWithCallback\n addiu\t$a0, $a0, %lo(func_80022108_22D08)\n.L54:\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-e0cb1bd24f0c.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80021D88_22988(void);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80021D88_22988 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80021D88_22988` — benchmark function snowboardkids2:func_80021D88_22988:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80021D88_22988:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tjal\t0 \n 14:\tnop\n 18:\tsll\tv0,v0,0x10\n 1c:\tsra\tv1,v0,0x10\n 20:\tli\tv0,1\n 24:\tbne\tv1,v0,40 \n 28:\tli\tv0,255\n 2c:\tlui\ta0,0x0\n 30:\tjal\t0 \n 34:\taddiu\ta0,a0,0\n 38:\tj\t54 \n 3c:\tnop\n 40:\tbne\tv1,v0,54 \n 44:\tnop\n 48:\tlui\ta0,0x0\n 4c:\tjal\t0 \n 50:\taddiu\ta0,a0,0\n 54:\tlw\tra,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-a50ccb5d3e41fbec/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80021D88_22988\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_80069810_6A410\n00000000 *UND*\t00000000 func_80021DE8_229E8\n00000000 *UND*\t00000000 setGameStateHandler\n00000000 *UND*\t00000000 func_80022108_22D08\n00000000 *UND*\t00000000 terminateSchedulerWithCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 getCurrentAllocation\n00000010 R_MIPS_26 func_80069810_6A410\n0000002c R_MIPS_HI16 func_80021DE8_229E8\n00000034 R_MIPS_LO16 func_80021DE8_229E8\n00000030 R_MIPS_26 setGameStateHandler\n00000038 R_MIPS_26 .text\n00000048 R_MIPS_HI16 func_80022108_22D08\n00000050 R_MIPS_LO16 func_80022108_22D08\n0000004c R_MIPS_26 terminateSchedulerWithCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 0c000000 00000000 00021400 00021c03 ................\n 0020 24020001 14620006 240200ff 3c040000 $....b..$...<...\n 0030 0c000000 24840000 08000015 00000000 ....$...........\n 0040 14620004 00000000 3c040000 0c000000 .b......<.......\n 0050 24840000 8fbf0010 03e00008 27bd0018 $...........'...\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_80021D88_22988\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80021D88_22988 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc","sym":"func_80028BB0_297B0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","bitwise","call"],"loc":9,"refSource":"void func_80028BB0_297B0(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = randB() & 0xF;\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028C08_29808);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L42-L50","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\tlhu\ta1,44(s0)\n 24:\taddiu\ta0,s0,4\n 28:\tandi\tv0,v0,0xf\n 2c:\tjal\t0 \n 30:\tsh\tv0,90(s0)\n 34:\tjal\t0 \n 38:\tmove\ta0,s0\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,20(sp)\n 4c:\tlw\ts0,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-02d774e5b23e4379/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80028BB0_297B0\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028C08_29808\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n0000002c R_MIPS_26 createYRotationMatrix\n00000034 R_MIPS_26 func_8002A290_2AE90\n0000003c R_MIPS_HI16 func_80028C08_29808\n00000044 R_MIPS_LO16 func_80028C08_29808\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 9605002c 26040004 3042000f 0c000000 ...,&...0B......\n 0030 a602005a 0c000000 02002021 3c040000 ...Z...... !<...\n 0040 0c000000 24840000 8fbf0014 8fb00010 ....$...........\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a0010034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80028BB0_297B0' — lift: cannot lift 'func_80028BB0_297B0': function call 'jal' at 0x18 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tsb\tzero,94(s0) */\n/* 14:\tsb\tzero,97(s0) */\n/* 18:\tjal\t0 */\n/* 1c:\tsb\tzero,98(s0) */\n/* 20:\tlhu\ta1,44(s0) */\n/* 24:\taddiu\ta0,s0,4 */\n/* 28:\tandi\tv0,v0,0xf */\n/* 2c:\tjal\t0 */\n/* 30:\tsh\tv0,90(s0) */\n/* 34:\tjal\t0 */\n/* 38:\tmove\ta0,s0 */\n/* 3c:\tlui\ta0,0x0 */\n/* 40:\tjal\t0 */\n/* 44:\taddiu\ta0,a0,0 */\n/* 48:\tlw\tra,20(sp) */\n/* 4c:\tlw\ts0,16(sp) */\n/* 50:\tjr\tra */\n/* 54:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid func_80028BB0_297B0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80028BB0_297B0': function call 'jal' at 0x18 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":31,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80028BB0_297B0': function call 'jal' at 0x18 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_80028BB0_297B0(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = randB() & 0xF;\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028C08_29808);\n}\n","score":0,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80028BB0_297B0` — benchmark function snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80028BB0_297B0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n sb\t$zero, 94($s0)\n sb\t$zero, 97($s0)\n jal\trandB\n sb\t$zero, 98($s0)\n lhu\t$a1, 44($s0)\n addiu\t$a0, $s0, 4\n andi\t$v0, $v0, 0xf\n jal\tcreateYRotationMatrix\n sh\t$v0, 90($s0)\n jal\tfunc_8002A290_2AE90\n move\t$a0, $s0\n lui\t$a0, %hi(func_80028C08_29808)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80028C08_29808)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80028BB0_297B0(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80028BB0_297B0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80028BB0_297B0` — benchmark function snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80028BB0_297B0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\tlhu\ta1,44(s0)\n 24:\taddiu\ta0,s0,4\n 28:\tandi\tv0,v0,0xf\n 2c:\tjal\t0 \n 30:\tsh\tv0,90(s0)\n 34:\tjal\t0 \n 38:\tmove\ta0,s0\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,20(sp)\n 4c:\tlw\ts0,16(sp)\n 50:\tjr\tra\n 54:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-02d774e5b23e4379/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80028BB0_297B0\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028C08_29808\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n0000002c R_MIPS_26 createYRotationMatrix\n00000034 R_MIPS_26 func_8002A290_2AE90\n0000003c R_MIPS_HI16 func_80028C08_29808\n00000044 R_MIPS_LO16 func_80028C08_29808\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 9605002c 26040004 3042000f 0c000000 ...,&...0B......\n 0030 a602005a 0c000000 02002021 3c040000 ...Z...... !<...\n 0040 0c000000 24840000 8fbf0014 8fb00010 ....$...........\n 0050 03e00008 27bd0018 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a0010034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80028BB0_297B0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80028D90_29990:gcc2.7.2kmc","sym":"func_80028D90_29990","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","bitwise","call"],"loc":9,"refSource":"void func_80028D90_29990(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = arg0->unk5A + (randB() & 0xF);\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028DF0_299F0);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L123-L131","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\taddiu\ta0,s0,4\n 24:\tlhu\tv1,90(s0)\n 28:\tlhu\ta1,44(s0)\n 2c:\tandi\tv0,v0,0xf\n 30:\taddu\tv1,v1,v0\n 34:\tjal\t0 \n 38:\tsh\tv1,90(s0)\n 3c:\tjal\t0 \n 40:\tmove\ta0,s0\n 44:\tlui\ta0,0x0\n 48:\tjal\t0 \n 4c:\taddiu\ta0,a0,0\n 50:\tlw\tra,20(sp)\n 54:\tlw\ts0,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-49adcb1d8c59c3fb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80028D90_29990\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028DF0_299F0\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n00000034 R_MIPS_26 createYRotationMatrix\n0000003c R_MIPS_26 func_8002A290_2AE90\n00000044 R_MIPS_HI16 func_80028DF0_299F0\n0000004c R_MIPS_LO16 func_80028DF0_299F0\n00000048 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 26040004 9603005a 9605002c 3042000f &......Z...,0B..\n 0030 00621821 0c000000 a603005a 0c000000 .b.!.......Z....\n 0040 02002021 3c040000 0c000000 24840000 .. !<.......$...\n 0050 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a001003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80028D90_29990' — lift: cannot lift 'func_80028D90_29990': function call 'jal' at 0x18 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tsb\tzero,94(s0) */\n/* 14:\tsb\tzero,97(s0) */\n/* 18:\tjal\t0 */\n/* 1c:\tsb\tzero,98(s0) */\n/* 20:\taddiu\ta0,s0,4 */\n/* 24:\tlhu\tv1,90(s0) */\n/* 28:\tlhu\ta1,44(s0) */\n/* 2c:\tandi\tv0,v0,0xf */\n/* 30:\taddu\tv1,v1,v0 */\n/* 34:\tjal\t0 */\n/* 38:\tsh\tv1,90(s0) */\n/* 3c:\tjal\t0 */\n/* 40:\tmove\ta0,s0 */\n/* 44:\tlui\ta0,0x0 */\n/* 48:\tjal\t0 */\n/* 4c:\taddiu\ta0,a0,0 */\n/* 50:\tlw\tra,20(sp) */\n/* 54:\tlw\ts0,16(sp) */\n/* 58:\tjr\tra */\n/* 5c:\taddiu\tsp,sp,24 */\nvoid func_80028D90_29990(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80028D90_29990': function call 'jal' at 0x18 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80028D90_29990': function call 'jal' at 0x18 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void func_80028D90_29990(Func297D8Arg *arg0) {\n arg0->unk5E = 0;\n arg0->unk61 = 0;\n arg0->unk62 = 0;\n arg0->unk5A = (u16) arg0->unk5A + (randB() & 0xF);\n createYRotationMatrix(&arg0->matrix, arg0->rotation);\n func_8002A290_2AE90(arg0);\n setCallback(func_80028DF0_299F0);\n}\n","score":0,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80028D90_29990` — benchmark function snowboardkids2:func_80028D90_29990:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80028D90_29990\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n sb\t$zero, 94($s0)\n sb\t$zero, 97($s0)\n jal\trandB\n sb\t$zero, 98($s0)\n addiu\t$a0, $s0, 4\n lhu\t$v1, 90($s0)\n lhu\t$a1, 44($s0)\n andi\t$v0, $v0, 0xf\n addu\t$v1, $v1, $v0\n jal\tcreateYRotationMatrix\n sh\t$v1, 90($s0)\n jal\tfunc_8002A290_2AE90\n move\t$a0, $s0\n lui\t$a0, %hi(func_80028DF0_299F0)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80028DF0_299F0)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_80028D90_29990(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80028D90_29990 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80028D90_29990` — benchmark function snowboardkids2:func_80028D90_29990:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80028D90_29990:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tsb\tzero,94(s0)\n 14:\tsb\tzero,97(s0)\n 18:\tjal\t0 \n 1c:\tsb\tzero,98(s0)\n 20:\taddiu\ta0,s0,4\n 24:\tlhu\tv1,90(s0)\n 28:\tlhu\ta1,44(s0)\n 2c:\tandi\tv0,v0,0xf\n 30:\taddu\tv1,v1,v0\n 34:\tjal\t0 \n 38:\tsh\tv1,90(s0)\n 3c:\tjal\t0 \n 40:\tmove\ta0,s0\n 44:\tlui\ta0,0x0\n 48:\tjal\t0 \n 4c:\taddiu\ta0,a0,0\n 50:\tlw\tra,20(sp)\n 54:\tlw\ts0,16(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-49adcb1d8c59c3fb/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_80028D90_29990\n00000000 *UND*\t00000000 randB\n00000000 *UND*\t00000000 createYRotationMatrix\n00000000 *UND*\t00000000 func_8002A290_2AE90\n00000000 *UND*\t00000000 func_80028DF0_299F0\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 randB\n00000034 R_MIPS_26 createYRotationMatrix\n0000003c R_MIPS_26 func_8002A290_2AE90\n00000044 R_MIPS_HI16 func_80028DF0_299F0\n0000004c R_MIPS_LO16 func_80028DF0_299F0\n00000048 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 a200005e a2000061 0c000000 a2000062 ...^...a.......b\n 0020 26040004 9603005a 9605002c 3042000f &......Z...,0B..\n 0030 00621821 0c000000 a603005a 0c000000 .b.!.......Z....\n 0040 02002021 3c040000 0c000000 24840000 .. !<.......$...\n 0050 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a001003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80028D90_29990 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc","sym":"func_8002A2D0_2AED0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","bitwise","branch","call"],"loc":32,"refSource":"void func_8002A2D0_2AED0(Func297D8Arg *arg0) {\n s32 result;\n\n getCurrentAllocation();\n applyTransformToModel(arg0->model, &arg0->matrix);\n\n if (arg0->unk50 != arg0->unk52) {\n arg0->unk52 = arg0->unk50;\n setModelAnimation(arg0->model, arg0->unk50);\n arg0->unk62 = 0;\n }\n\n if (arg0->unk62 != -1) {\n result = clearModelRotation(arg0->model);\n } else {\n result = 0;\n }\n\n if (result != 0) {\n arg0->unk37 = 1;\n arg0->unk62 = (arg0->unk62 & 0x7F) + 1;\n if (arg0->unk50 == 0x98) {\n if (arg0->unk5E == 2) {\n arg0->unk50 = 0x90;\n } else {\n arg0->unk50 = arg0->unk58;\n }\n }\n }\n\n updateModelGeometry(arg0->model);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/297B0.c#L862-L893","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,24(sp)\n 8:\tsw\tra,28(sp)\n c:\tjal\t0 \n 10:\tmove\ts0,a0\n 14:\tlw\ta0,0(s0)\n 18:\tjal\t0 \n 1c:\taddiu\ta1,s0,4\n 20:\tlh\tv1,80(s0)\n 24:\tlh\tv0,82(s0)\n 28:\tbeq\tv1,v0,44 \n 2c:\tmove\ta2,v1\n 30:\tlw\ta0,0(s0)\n 34:\tlh\ta1,80(s0)\n 38:\tjal\t0 \n 3c:\tsh\ta2,82(s0)\n 40:\tsb\tzero,98(s0)\n 44:\tlb\tv1,98(s0)\n 48:\tli\tv0,-1\n 4c:\tbeq\tv1,v0,60 \n 50:\tmove\tv0,zero\n 54:\tlw\ta0,0(s0)\n 58:\tjal\t0 \n 5c:\tnop\n 60:\tbeqz\tv0,a0 \n 64:\tli\tv1,1\n 68:\tlbu\tv0,98(s0)\n 6c:\tsb\tv1,55(s0)\n 70:\tlh\tv1,80(s0)\n 74:\tandi\tv0,v0,0x7f\n 78:\taddiu\tv0,v0,1\n 7c:\tsb\tv0,98(s0)\n 80:\tli\tv0,152\n 84:\tbne\tv1,v0,a0 \n 88:\tli\tv0,2\n 8c:\tlbu\tv1,94(s0)\n 90:\tbeq\tv1,v0,9c \n 94:\tli\tv0,144\n 98:\tlhu\tv0,88(s0)\n 9c:\tsh\tv0,80(s0)\n a0:\tjal\t0 \n a4:\tlw\ta0,0(s0)\n a8:\tlw\tra,28(sp)\n ac:\tlw\ts0,24(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,32\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3384bda726611237/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002A2D0_2AED0\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 applyTransformToModel\n00000000 *UND*\t00000000 setModelAnimation\n00000000 *UND*\t00000000 clearModelRotation\n00000000 *UND*\t00000000 updateModelGeometry\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_26 applyTransformToModel\n00000038 R_MIPS_26 setModelAnimation\n00000058 R_MIPS_26 clearModelRotation\n000000a0 R_MIPS_26 updateModelGeometry\n\n\nContents of section .text:\n 0000 27bdffe0 afb00018 afbf001c 0c000000 '...............\n 0010 00808021 8e040000 0c000000 26050004 ...!........&...\n 0020 86030050 86020052 10620006 00603021 ...P...R.b...`0!\n 0030 8e040000 86050050 0c000000 a6060052 .......P.......R\n 0040 a2000062 82030062 2402ffff 10620004 ...b...b$....b..\n 0050 00001021 8e040000 0c000000 00000000 ...!............\n 0060 1040000f 24030001 92020062 a2030037 .@..$......b...7\n 0070 86030050 3042007f 24420001 a2020062 ...P0B..$B.....b\n 0080 24020098 14620006 24020002 9203005e $....b..$......^\n 0090 10620002 24020090 96020058 a6020050 .b..$......X...P\n 00a0 0c000000 8e040000 8fbf001c 8fb00018 ................\n 00b0 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a001007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8002A2D0_2AED0' — lift: cannot lift 'func_8002A2D0_2AED0': function call 'jal' at 0xc — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-32 */\n/* 4:\tsw\ts0,24(sp) */\n/* 8:\tsw\tra,28(sp) */\n/* c:\tjal\t0 */\n/* 10:\tmove\ts0,a0 */\n/* 14:\tlw\ta0,0(s0) */\n/* 18:\tjal\t0 */\n/* 1c:\taddiu\ta1,s0,4 */\n/* 20:\tlh\tv1,80(s0) */\n/* 24:\tlh\tv0,82(s0) */\n/* 28:\tbeq\tv1,v0,44 */\n/* 2c:\tmove\ta2,v1 */\n/* 30:\tlw\ta0,0(s0) */\n/* 34:\tlh\ta1,80(s0) */\n/* 38:\tjal\t0 */\n/* 3c:\tsh\ta2,82(s0) */\n/* 40:\tsb\tzero,98(s0) */\n/* 44:\tlb\tv1,98(s0) */\n/* 48:\tli\tv0,-1 */\n/* 4c:\tbeq\tv1,v0,60 */\n/* 50:\tmove\tv0,zero */\n/* 54:\tlw\ta0,0(s0) */\n/* 58:\tjal\t0 */\n/* 5c:\tnop */\n/* 60:\tbeqz\tv0,a0 */\n/* 64:\tli\tv1,1 */\n/* 68:\tlbu\tv0,98(s0) */\n/* 6c:\tsb\tv1,55(s0) */\n/* 70:\tlh\tv1,80(s0) */\n/* 74:\tandi\tv0,v0,0x7f */\n/* 78:\taddiu\tv0,v0,1 */\n/* 7c:\tsb\tv0,98(s0) */\n/* 80:\tli\tv0,152 */\n/* 84:\tbne\tv1,v0,a0 */\n/* 88:\tli\tv0,2 */\n/* 8c:\tlbu\tv1,94(s0) */\n/* 90:\tbeq\tv1,v0,9c */\n/* 94:\tli\tv0,144 */\n/* 98:\tlhu\tv0,88(s0) */\n/* 9c:\tsh\tv0,80(s0) */\n/* a0:\tjal\t0 */\n/* a4:\tlw\ta0,0(s0) */\n/* a8:\tlw\tra,28(sp) */\n/* ac:\tlw\ts0,24(sp) */\n/* b0:\tjr\tra */\n/* b4:\taddiu\tsp,sp,32 */\n/* \t... */\nvoid func_8002A2D0_2AED0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8002A2D0_2AED0': function call 'jal' at 0xc — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":55,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8002A2D0_2AED0': function call 'jal' at 0xc — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void func_8002A2D0_2AED0(Func297D8Arg *arg0) {\n s16 temp_v1;\n s32 var_v0;\n u16 var_v0_2;\n\n getCurrentAllocation();\n applyTransformToModel(arg0->model, &arg0->matrix);\n temp_v1 = arg0->unk50;\n if (temp_v1 != arg0->unk52) {\n arg0->unk52 = temp_v1;\n setModelAnimation(arg0->model, arg0->unk50);\n arg0->unk62 = 0;\n }\n var_v0 = 0;\n if (arg0->unk62 != -1) {\n var_v0 = clearModelRotation(arg0->model);\n }\n if (var_v0 != 0) {\n arg0->unk37 = 1;\n arg0->unk62 = ((u8) arg0->unk62 & 0x7F) + 1;\n if (arg0->unk50 == 0x98) {\n var_v0_2 = 0x90;\n if (arg0->unk5E != 2) {\n var_v0_2 = arg0->unk58;\n }\n arg0->unk50 = (s16) var_v0_2;\n }\n }\n updateModelGeometry(arg0->model);\n}\n","score":6,"maxScore":47,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":29,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":47,"ratio":0.1276595744680851,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":5}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8002A2D0_2AED0` — benchmark function snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002A2D0_2AED0\n addiu\t$sp, $sp, -32\n sw\t$s0, 24($sp)\n sw\t$ra, 28($sp)\n jal\tgetCurrentAllocation\n move\t$s0, $a0\n lw\t$a0, 0($s0)\n jal\tapplyTransformToModel\n addiu\t$a1, $s0, 4\n lh\t$v1, 80($s0)\n lh\t$v0, 82($s0)\n beq\t$v1, $v0, .L44\n move\t$a2, $v1\n lw\t$a0, 0($s0)\n lh\t$a1, 80($s0)\n jal\tsetModelAnimation\n sh\t$a2, 82($s0)\n sb\t$zero, 98($s0)\n.L44:\n lb\t$v1, 98($s0)\n li\t$v0, -1\n beq\t$v1, $v0, .L60\n move\t$v0, $zero\n lw\t$a0, 0($s0)\n jal\tclearModelRotation\n nop\n.L60:\n beqz\t$v0, .La0\n li\t$v1, 1\n lbu\t$v0, 98($s0)\n sb\t$v1, 55($s0)\n lh\t$v1, 80($s0)\n andi\t$v0, $v0, 0x7f\n addiu\t$v0, $v0, 1\n sb\t$v0, 98($s0)\n li\t$v0, 152\n bne\t$v1, $v0, .La0\n li\t$v0, 2\n lbu\t$v1, 94($s0)\n beq\t$v1, $v0, .L9c\n li\t$v0, 144\n lhu\t$v0, 88($s0)\n.L9c:\n sh\t$v0, 80($s0)\n.La0:\n jal\tupdateModelGeometry\n lw\t$a0, 0($s0)\n lw\t$ra, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-778569b77f08.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_8002A2D0_2AED0(Func297D8Arg *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002A2D0_2AED0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002A2D0_2AED0` — benchmark function snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002A2D0_2AED0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,24(sp)\n 8:\tsw\tra,28(sp)\n c:\tjal\t0 \n 10:\tmove\ts0,a0\n 14:\tlw\ta0,0(s0)\n 18:\tjal\t0 \n 1c:\taddiu\ta1,s0,4\n 20:\tlh\tv1,80(s0)\n 24:\tlh\tv0,82(s0)\n 28:\tbeq\tv1,v0,44 \n 2c:\tmove\ta2,v1\n 30:\tlw\ta0,0(s0)\n 34:\tlh\ta1,80(s0)\n 38:\tjal\t0 \n 3c:\tsh\ta2,82(s0)\n 40:\tsb\tzero,98(s0)\n 44:\tlb\tv1,98(s0)\n 48:\tli\tv0,-1\n 4c:\tbeq\tv1,v0,60 \n 50:\tmove\tv0,zero\n 54:\tlw\ta0,0(s0)\n 58:\tjal\t0 \n 5c:\tnop\n 60:\tbeqz\tv0,a0 \n 64:\tli\tv1,1\n 68:\tlbu\tv0,98(s0)\n 6c:\tsb\tv1,55(s0)\n 70:\tlh\tv1,80(s0)\n 74:\tandi\tv0,v0,0x7f\n 78:\taddiu\tv0,v0,1\n 7c:\tsb\tv0,98(s0)\n 80:\tli\tv0,152\n 84:\tbne\tv1,v0,a0 \n 88:\tli\tv0,2\n 8c:\tlbu\tv1,94(s0)\n 90:\tbeq\tv1,v0,9c \n 94:\tli\tv0,144\n 98:\tlhu\tv0,88(s0)\n 9c:\tsh\tv0,80(s0)\n a0:\tjal\t0 \n a4:\tlw\ta0,0(s0)\n a8:\tlw\tra,28(sp)\n ac:\tlw\ts0,24(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,32\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-3384bda726611237/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002A2D0_2AED0\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 applyTransformToModel\n00000000 *UND*\t00000000 setModelAnimation\n00000000 *UND*\t00000000 clearModelRotation\n00000000 *UND*\t00000000 updateModelGeometry\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_MIPS_26 getCurrentAllocation\n00000018 R_MIPS_26 applyTransformToModel\n00000038 R_MIPS_26 setModelAnimation\n00000058 R_MIPS_26 clearModelRotation\n000000a0 R_MIPS_26 updateModelGeometry\n\n\nContents of section .text:\n 0000 27bdffe0 afb00018 afbf001c 0c000000 '...............\n 0010 00808021 8e040000 0c000000 26050004 ...!........&...\n 0020 86030050 86020052 10620006 00603021 ...P...R.b...`0!\n 0030 8e040000 86050050 0c000000 a6060052 .......P.......R\n 0040 a2000062 82030062 2402ffff 10620004 ...b...b$....b..\n 0050 00001021 8e040000 0c000000 00000000 ...!............\n 0060 1040000f 24030001 92020062 a2030037 .@..$......b...7\n 0070 86030050 3042007f 24420001 a2020062 ...P0B..$B.....b\n 0080 24020098 14620006 24020002 9203005e $....b..$......^\n 0090 10620002 24020090 96020058 a6020050 .b..$......X...P\n 00a0 0c000000 8e040000 8fbf001c 8fb00018 ................\n 00b0 03e00008 27bd0020 00000000 00000000 ....'.. ........\nContents of section .reginfo:\n 0000 a001007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002A2D0_2AED0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc","sym":"func_8002A390_2AF90","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["switch","struct","call","branch","global"],"loc":49,"refSource":"s32 func_8002A390_2AF90(Func8002A390Arg *arg0) {\n GameState *state;\n s32 stateVal;\n\n state = getCurrentAllocation();\n stateVal = arg0->unk5E;\n\n switch (stateVal) {\n case 0:\n if (func_8002A4AC_2B0AC(&arg0->matrix, arg0->unk5D) != 0) {\n return 1;\n }\n if (state->unk421 != 0) {\n return 0;\n }\n if (func_8002ACFC_2B8FC(arg0->matrix.translation.x, arg0->matrix.translation.z, arg0->unk2E) == 0) {\n return 0;\n }\n arg0->unk54 = arg0->unk50;\n if (arg0->unk5D == 5) {\n arg0->unk50 = 0x21;\n } else {\n arg0->unk50 = 0;\n }\n arg0->unk61 = arg0->unk5E;\n arg0->unk5E = 0x44;\n break;\n case 1:\n case 2:\n case 3:\n case 4:\n if (func_8002A7CC_2B3CC(arg0) == 0) {\n return 0;\n }\n arg0->unk61 = arg0->unk5E;\n arg0->unk5E = 0;\n break;\n case 0x44:\n if (func_8002A7CC_2B3CC(arg0) == 0) {\n return 0;\n }\n arg0->unk61 = arg0->unk5E;\n arg0->unk5E = 0;\n arg0->unk50 = arg0->unk54;\n break;\n }\n\n return 0;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L34-L82","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,24(sp)\n 10:\tjal\t0 \n 14:\tsw\ts1,20(sp)\n 18:\tlbu\tv1,94(s0)\n 1c:\tmove\ts1,v0\n 20:\tslti\tv0,v1,5\n 24:\tbeqzl\tv0,44 \n 28:\tli\tv0,68\n 2c:\tbnez\tv1,c0 \n 30:\tnop\n 34:\tbeqz\tv1,54 \n 38:\tmove\tv0,zero\n 3c:\tj\t108 \n 40:\tnop\n 44:\tbeq\tv1,v0,e0 \n 48:\tmove\tv0,zero\n 4c:\tj\t108 \n 50:\tnop\n 54:\tlbu\ta1,93(s0)\n 58:\tjal\t0 \n 5c:\taddiu\ta0,s0,4\n 60:\tbnez\tv0,108 \n 64:\tli\tv0,1\n 68:\tlbu\tv0,1057(s1)\n 6c:\tbnez\tv0,108 \n 70:\tmove\tv0,zero\n 74:\tlw\ta0,24(s0)\n 78:\tlw\ta1,32(s0)\n 7c:\tjal\t0 \n 80:\tlh\ta2,46(s0)\n 84:\tbeqz\tv0,108 \n 88:\tmove\tv0,zero\n 8c:\tlhu\tv0,80(s0)\n 90:\tlbu\tv1,93(s0)\n 94:\tsh\tv0,84(s0)\n 98:\tli\tv0,5\n 9c:\tbnel\tv1,v0,ac \n a0:\tsh\tzero,80(s0)\n a4:\tli\tv0,33\n a8:\tsh\tv0,80(s0)\n ac:\tlbu\tv1,94(s0)\n b0:\tli\tv0,68\n b4:\tsb\tv0,94(s0)\n b8:\tj\t104 \n bc:\tsb\tv1,97(s0)\n c0:\tjal\t0 \n c4:\tmove\ta0,s0\n c8:\tbeqz\tv0,108 \n cc:\tmove\tv0,zero\n d0:\tlbu\tv0,94(s0)\n d4:\tsb\tzero,94(s0)\n d8:\tj\t104 \n dc:\tsb\tv0,97(s0)\n e0:\tjal\t0 \n e4:\tmove\ta0,s0\n e8:\tbeqz\tv0,108 \n ec:\tmove\tv0,zero\n f0:\tlbu\tv0,94(s0)\n f4:\tlhu\tv1,84(s0)\n f8:\tsb\tzero,94(s0)\n fc:\tsb\tv0,97(s0)\n 100:\tsh\tv1,80(s0)\n 104:\tmove\tv0,zero\n 108:\tlw\tra,24(sp)\n 10c:\tlw\ts1,20(sp)\n 110:\tlw\ts0,16(sp)\n 114:\tjr\tra\n 118:\taddiu\tsp,sp,32\n 11c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e91a09b3f45124d2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000011c func_8002A390_2AF90\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8002A4AC_2B0AC\n00000000 *UND*\t00000000 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 func_8002A7CC_2B3CC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 getCurrentAllocation\n0000003c R_MIPS_26 .text\n0000004c R_MIPS_26 .text\n00000058 R_MIPS_26 func_8002A4AC_2B0AC\n0000007c R_MIPS_26 func_8002ACFC_2B8FC\n000000b8 R_MIPS_26 .text\n000000c0 R_MIPS_26 func_8002A7CC_2B3CC\n000000d8 R_MIPS_26 .text\n000000e0 R_MIPS_26 func_8002A7CC_2B3CC\n\n\nContents of section .text:\n 0000 27bdffe0 afb00010 00808021 afbf0018 '..........!....\n 0010 0c000000 afb10014 9203005e 00408821 ...........^.@.!\n 0020 28620005 50400007 24020044 14600024 (b..P@..$..D.`.$\n 0030 00000000 10600007 00001021 08000042 .....`.....!...B\n 0040 00000000 10620026 00001021 08000042 .....b.&...!...B\n 0050 00000000 9205005d 0c000000 26040004 .......]....&...\n 0060 14400029 24020001 92220421 14400026 .@.)$....\".!.@.&\n 0070 00001021 8e040018 8e050020 0c000000 ...!....... ....\n 0080 8606002e 10400020 00001021 96020050 .....@. ...!...P\n 0090 9203005d a6020054 24020005 54620003 ...]...T$...Tb..\n 00a0 a6000050 24020021 a6020050 9203005e ...P$..!...P...^\n 00b0 24020044 a202005e 08000041 a2030061 $..D...^...A...a\n 00c0 0c000000 02002021 1040000f 00001021 ...... !.@.....!\n 00d0 9202005e a200005e 08000041 a2020061 ...^...^...A...a\n 00e0 0c000000 02002021 10400007 00001021 ...... !.@.....!\n 00f0 9202005e 96030054 a200005e a2020061 ...^...T...^...a\n 0100 a6030050 00001021 8fbf0018 8fb10014 ...P...!........\n 0110 8fb00010 03e00008 27bd0020 00000000 ........'.. ....\nContents of section .reginfo:\n 0000 a003007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8002A390_2AF90' — lift: cannot lift 'func_8002A390_2AF90': function call 'jal' at 0x10 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-32 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,24(sp) */\n/* 10:\tjal\t0 */\n/* 14:\tsw\ts1,20(sp) */\n/* 18:\tlbu\tv1,94(s0) */\n/* 1c:\tmove\ts1,v0 */\n/* 20:\tslti\tv0,v1,5 */\n/* 24:\tbeqzl\tv0,44 */\n/* 28:\tli\tv0,68 */\n/* 2c:\tbnez\tv1,c0 */\n/* 30:\tnop */\n/* 34:\tbeqz\tv1,54 */\n/* 38:\tmove\tv0,zero */\n/* 3c:\tj\t108 */\n/* 40:\tnop */\n/* 44:\tbeq\tv1,v0,e0 */\n/* 48:\tmove\tv0,zero */\n/* 4c:\tj\t108 */\n/* 50:\tnop */\n/* 54:\tlbu\ta1,93(s0) */\n/* 58:\tjal\t0 */\n/* 5c:\taddiu\ta0,s0,4 */\n/* 60:\tbnez\tv0,108 */\n/* 64:\tli\tv0,1 */\n/* 68:\tlbu\tv0,1057(s1) */\n/* 6c:\tbnez\tv0,108 */\n/* 70:\tmove\tv0,zero */\n/* 74:\tlw\ta0,24(s0) */\n/* 78:\tlw\ta1,32(s0) */\n/* 7c:\tjal\t0 */\n/* 80:\tlh\ta2,46(s0) */\n/* 84:\tbeqz\tv0,108 */\n/* 88:\tmove\tv0,zero */\n/* 8c:\tlhu\tv0,80(s0) */\n/* 90:\tlbu\tv1,93(s0) */\n/* 94:\tsh\tv0,84(s0) */\n/* 98:\tli\tv0,5 */\n/* 9c:\tbnel\tv1,v0,ac */\n/* a0:\tsh\tzero,80(s0) */\n/* a4:\tli\tv0,33 */\n/* a8:\tsh\tv0,80(s0) */\n/* ac:\tlbu\tv1,94(s0) */\n/* b0:\tli\tv0,68 */\n/* b4:\tsb\tv0,94(s0) */\n/* b8:\tj\t104 */\n/* bc:\tsb\tv1,97(s0) */\n/* c0:\tjal\t0 */\n/* c4:\tmove\ta0,s0 */\n/* c8:\tbeqz\tv0,108 */\n/* cc:\tmove\tv0,zero */\n/* d0:\tlbu\tv0,94(s0) */\n/* d4:\tsb\tzero,94(s0) */\n/* d8:\tj\t104 */\n/* dc:\tsb\tv0,97(s0) */\n/* e0:\tjal\t0 */\n/* e4:\tmove\ta0,s0 */\n/* e8:\tbeqz\tv0,108 */\n/* ec:\tmove\tv0,zero */\n/* f0:\tlbu\tv0,94(s0) */\n/* f4:\tlhu\tv1,84(s0) */\n/* f8:\tsb\tzero,94(s0) */\n/* fc:\tsb\tv0,97(s0) */\n/* 100:\tsh\tv1,80(s0) */\n/* 104:\tmove\tv0,zero */\n/* 108:\tlw\tra,24(sp) */\n/* 10c:\tlw\ts1,20(sp) */\n/* 110:\tlw\ts0,16(sp) */\n/* 114:\tjr\tra */\n/* 118:\taddiu\tsp,sp,32 */\n/* 11c:\tnop */\nvoid func_8002A390_2AF90(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8002A390_2AF90': function call 'jal' at 0x10 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":80,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8002A390_2AF90': function call 'jal' at 0x10 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 func_8002A4AC_2B0AC(void *, u8); /* extern */\ns32 func_8002A7CC_2B3CC(void *); /* extern */\ns32 func_8002ACFC_2B8FC(s32, s32, s16); /* extern */\nvoid *getCurrentAllocation(); /* extern */\n\ns32 func_8002A390_2AF90(void *arg0) {\n s32 var_v0;\n u8 temp_v0;\n u8 temp_v0_2;\n u8 temp_v1;\n u8 temp_v1_2;\n void *temp_s1;\n\n temp_v1 = arg0->unk5E;\n temp_s1 = getCurrentAllocation();\n if ((s32) temp_v1 >= 5) {\n if (temp_v1 != 0x44) {\n return 0;\n }\n var_v0 = 0;\n if (func_8002A7CC_2B3CC(arg0) != 0) {\n temp_v0 = arg0->unk5E;\n arg0->unk5E = 0U;\n arg0->unk61 = temp_v0;\n arg0->unk50 = (u16) arg0->unk54;\n goto block_20;\n }\n /* Duplicate return node #21. Try simplifying control flow for better match */\n return var_v0;\n }\n if (temp_v1 == 0) {\n if (temp_v1 != 0) {\n return 0;\n }\n var_v0 = 1;\n if (func_8002A4AC_2B0AC(arg0 + 4, arg0->unk5D) == 0) {\n var_v0 = 0;\n if (temp_s1->unk421 == 0) {\n var_v0 = 0;\n if (func_8002ACFC_2B8FC(arg0->unk18, arg0->unk20, arg0->unk2E) != 0) {\n arg0->unk54 = (u16) arg0->unk50;\n if (arg0->unk5D != 5) {\n arg0->unk50 = 0U;\n } else {\n arg0->unk50 = 0x21U;\n }\n temp_v1_2 = arg0->unk5E;\n arg0->unk5E = 0x44U;\n arg0->unk61 = temp_v1_2;\n goto block_20;\n }\n }\n }\n /* Duplicate return node #21. Try simplifying control flow for better match */\n return var_v0;\n }\n var_v0 = 0;\n if (func_8002A7CC_2B3CC(arg0) != 0) {\n temp_v0_2 = arg0->unk5E;\n arg0->unk5E = 0U;\n arg0->unk61 = temp_v0_2;\nblock_20:\n var_v0 = 0;\n }\n return var_v0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":76,"lines":64,"gotos":2,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:2636: request for member `unk5E' in something not a structure or union","/c.i:2644: request for member `unk5E' in something not a structure or union","/c.i:2645: request for member `unk5E' in something not a structure or union","/c.i:2646: request for member `unk61' in something not a structure or union","/c.i:2647: request for member `unk50' in something not a structure or union"]},"note":"src/2AF90.c: state-machine step with fall-through switch cases over a mode byte","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8002A390_2AF90` — benchmark function snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002A390_2AF90\n addiu\t$sp, $sp, -32\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 24($sp)\n jal\tgetCurrentAllocation\n sw\t$s1, 20($sp)\n lbu\t$v1, 94($s0)\n move\t$s1, $v0\n slti\t$v0, $v1, 5\n beqzl\t$v0, .L44\n li\t$v0, 68\n bnez\t$v1, .Lc0\n nop\n beqz\t$v1, .L54\n move\t$v0, $zero\n j\t.L108\n nop\n.L44:\n beq\t$v1, $v0, .Le0\n move\t$v0, $zero\n j\t.L108\n nop\n.L54:\n lbu\t$a1, 93($s0)\n jal\tfunc_8002A4AC_2B0AC\n addiu\t$a0, $s0, 4\n bnez\t$v0, .L108\n li\t$v0, 1\n lbu\t$v0, 1057($s1)\n bnez\t$v0, .L108\n move\t$v0, $zero\n lw\t$a0, 24($s0)\n lw\t$a1, 32($s0)\n jal\tfunc_8002ACFC_2B8FC\n lh\t$a2, 46($s0)\n beqz\t$v0, .L108\n move\t$v0, $zero\n lhu\t$v0, 80($s0)\n lbu\t$v1, 93($s0)\n sh\t$v0, 84($s0)\n li\t$v0, 5\n bnel\t$v1, $v0, .Lac\n sh\t$zero, 80($s0)\n li\t$v0, 33\n sh\t$v0, 80($s0)\n.Lac:\n lbu\t$v1, 94($s0)\n li\t$v0, 68\n sb\t$v0, 94($s0)\n j\t.L104\n sb\t$v1, 97($s0)\n.Lc0:\n jal\tfunc_8002A7CC_2B3CC\n move\t$a0, $s0\n beqz\t$v0, .L108\n move\t$v0, $zero\n lbu\t$v0, 94($s0)\n sb\t$zero, 94($s0)\n j\t.L104\n sb\t$v0, 97($s0)\n.Le0:\n jal\tfunc_8002A7CC_2B3CC\n move\t$a0, $s0\n beqz\t$v0, .L108\n move\t$v0, $zero\n lbu\t$v0, 94($s0)\n lhu\t$v1, 84($s0)\n sb\t$zero, 94($s0)\n sb\t$v0, 97($s0)\n sh\t$v1, 80($s0)\n.L104:\n move\t$v0, $zero\n.L108:\n lw\t$ra, 24($sp)\n lw\t$s1, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 32\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002A390_2AF90 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002A390_2AF90` — benchmark function snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002A390_2AF90:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-32\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,24(sp)\n 10:\tjal\t0 \n 14:\tsw\ts1,20(sp)\n 18:\tlbu\tv1,94(s0)\n 1c:\tmove\ts1,v0\n 20:\tslti\tv0,v1,5\n 24:\tbeqzl\tv0,44 \n 28:\tli\tv0,68\n 2c:\tbnez\tv1,c0 \n 30:\tnop\n 34:\tbeqz\tv1,54 \n 38:\tmove\tv0,zero\n 3c:\tj\t108 \n 40:\tnop\n 44:\tbeq\tv1,v0,e0 \n 48:\tmove\tv0,zero\n 4c:\tj\t108 \n 50:\tnop\n 54:\tlbu\ta1,93(s0)\n 58:\tjal\t0 \n 5c:\taddiu\ta0,s0,4\n 60:\tbnez\tv0,108 \n 64:\tli\tv0,1\n 68:\tlbu\tv0,1057(s1)\n 6c:\tbnez\tv0,108 \n 70:\tmove\tv0,zero\n 74:\tlw\ta0,24(s0)\n 78:\tlw\ta1,32(s0)\n 7c:\tjal\t0 \n 80:\tlh\ta2,46(s0)\n 84:\tbeqz\tv0,108 \n 88:\tmove\tv0,zero\n 8c:\tlhu\tv0,80(s0)\n 90:\tlbu\tv1,93(s0)\n 94:\tsh\tv0,84(s0)\n 98:\tli\tv0,5\n 9c:\tbnel\tv1,v0,ac \n a0:\tsh\tzero,80(s0)\n a4:\tli\tv0,33\n a8:\tsh\tv0,80(s0)\n ac:\tlbu\tv1,94(s0)\n b0:\tli\tv0,68\n b4:\tsb\tv0,94(s0)\n b8:\tj\t104 \n bc:\tsb\tv1,97(s0)\n c0:\tjal\t0 \n c4:\tmove\ta0,s0\n c8:\tbeqz\tv0,108 \n cc:\tmove\tv0,zero\n d0:\tlbu\tv0,94(s0)\n d4:\tsb\tzero,94(s0)\n d8:\tj\t104 \n dc:\tsb\tv0,97(s0)\n e0:\tjal\t0 \n e4:\tmove\ta0,s0\n e8:\tbeqz\tv0,108 \n ec:\tmove\tv0,zero\n f0:\tlbu\tv0,94(s0)\n f4:\tlhu\tv1,84(s0)\n f8:\tsb\tzero,94(s0)\n fc:\tsb\tv0,97(s0)\n 100:\tsh\tv1,80(s0)\n 104:\tmove\tv0,zero\n 108:\tlw\tra,24(sp)\n 10c:\tlw\ts1,20(sp)\n 110:\tlw\ts0,16(sp)\n 114:\tjr\tra\n 118:\taddiu\tsp,sp,32\n 11c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e91a09b3f45124d2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000011c func_8002A390_2AF90\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8002A4AC_2B0AC\n00000000 *UND*\t00000000 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 func_8002A7CC_2B3CC\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 getCurrentAllocation\n0000003c R_MIPS_26 .text\n0000004c R_MIPS_26 .text\n00000058 R_MIPS_26 func_8002A4AC_2B0AC\n0000007c R_MIPS_26 func_8002ACFC_2B8FC\n000000b8 R_MIPS_26 .text\n000000c0 R_MIPS_26 func_8002A7CC_2B3CC\n000000d8 R_MIPS_26 .text\n000000e0 R_MIPS_26 func_8002A7CC_2B3CC\n\n\nContents of section .text:\n 0000 27bdffe0 afb00010 00808021 afbf0018 '..........!....\n 0010 0c000000 afb10014 9203005e 00408821 ...........^.@.!\n 0020 28620005 50400007 24020044 14600024 (b..P@..$..D.`.$\n 0030 00000000 10600007 00001021 08000042 .....`.....!...B\n 0040 00000000 10620026 00001021 08000042 .....b.&...!...B\n 0050 00000000 9205005d 0c000000 26040004 .......]....&...\n 0060 14400029 24020001 92220421 14400026 .@.)$....\".!.@.&\n 0070 00001021 8e040018 8e050020 0c000000 ...!....... ....\n 0080 8606002e 10400020 00001021 96020050 .....@. ...!...P\n 0090 9203005d a6020054 24020005 54620003 ...]...T$...Tb..\n 00a0 a6000050 24020021 a6020050 9203005e ...P$..!...P...^\n 00b0 24020044 a202005e 08000041 a2030061 $..D...^...A...a\n 00c0 0c000000 02002021 1040000f 00001021 ...... !.@.....!\n 00d0 9202005e a200005e 08000041 a2020061 ...^...^...A...a\n 00e0 0c000000 02002021 10400007 00001021 ...... !.@.....!\n 00f0 9202005e 96030054 a200005e a2020061 ...^...T...^...a\n 0100 a6030050 00001021 8fbf0018 8fb10014 ...P...!........\n 0110 8fb00010 03e00008 27bd0020 00000000 ........'.. ....\nContents of section .reginfo:\n 0000 a003007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002A390_2AF90 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc","sym":"func_8002ACFC_2B8FC","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["call","fixedpoint","branch","global"],"loc":14,"refSource":"s32 func_8002ACFC_2B8FC(s32 arg0, s32 arg1, s16 arg2) {\n GameState *state;\n s16 angle;\n\n state = getCurrentAllocation();\n angle = func_8006D21C_6DE1C(state->unk3EC, state->unk3F0, arg0, arg1);\n\n if (arg2 - 0x238 < angle && angle < arg2 + 0x238) {\n if (distance_2d(state->unk3EC - arg0, state->unk3F0 - arg1) <= 0x280000) {\n return 1;\n }\n }\n return 0;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L88-L101","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,24(sp)\n 8:\tmove\ts2,a0\n c:\tsw\ts3,28(sp)\n 10:\tmove\ts3,a1\n 14:\tsw\ts0,16(sp)\n 18:\tmove\ts0,a2\n 1c:\tsw\tra,32(sp)\n 20:\tjal\t0 \n 24:\tsw\ts1,20(sp)\n 28:\tmove\ts1,v0\n 2c:\tlw\ta0,1004(s1)\n 30:\tlw\ta1,1008(s1)\n 34:\tmove\ta2,s2\n 38:\tjal\t0 \n 3c:\tmove\ta3,s3\n 40:\tsll\ts0,s0,0x10\n 44:\tsra\ts0,s0,0x10\n 48:\taddiu\tv1,s0,-568\n 4c:\tsll\tv0,v0,0x10\n 50:\tsra\ta0,v0,0x10\n 54:\tslt\tv1,v1,a0\n 58:\tbeqz\tv1,98 \n 5c:\taddiu\tv0,s0,568\n 60:\tslt\tv0,a0,v0\n 64:\tbeqz\tv0,9c \n 68:\tmove\tv0,zero\n 6c:\tlw\ta0,1004(s1)\n 70:\tlw\ta1,1008(s1)\n 74:\tsubu\ta0,a0,s2\n 78:\tjal\t0 \n 7c:\tsubu\ta1,a1,s3\n 80:\tlui\tv1,0x28\n 84:\tslt\tv1,v1,v0\n 88:\tbnez\tv1,9c \n 8c:\tmove\tv0,zero\n 90:\tj\t9c \n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tlw\tra,32(sp)\n a0:\tlw\ts3,28(sp)\n a4:\tlw\ts2,24(sp)\n a8:\tlw\ts1,20(sp)\n ac:\tlw\ts0,16(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,40\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0e839e3e93bac188/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8006D21C_6DE1C\n00000000 *UND*\t00000000 distance_2d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 getCurrentAllocation\n00000038 R_MIPS_26 func_8006D21C_6DE1C\n00000078 R_MIPS_26 distance_2d\n00000090 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffd8 afb20018 00809021 afb3001c '..........!....\n 0010 00a09821 afb00010 00c08021 afbf0020 ...!.......!... \n 0020 0c000000 afb10014 00408821 8e2403ec .........@.!.$..\n 0030 8e2503f0 02403021 0c000000 02603821 .%...@0!.....`8!\n 0040 00108400 00108403 2603fdc8 00021400 ........&.......\n 0050 00022403 0064182a 1060000f 26020238 ..$..d.*.`..&..8\n 0060 0082102a 1040000d 00001021 8e2403ec ...*.@.....!.$..\n 0070 8e2503f0 00922023 0c000000 00b32823 .%.... #......(#\n 0080 3c030028 0062182a 14600004 00001021 <..(.b.*.`.....!\n 0090 08000027 24020001 00001021 8fbf0020 ...'$......!... \n 00a0 8fb3001c 8fb20018 8fb10014 8fb00010 ................\n 00b0 03e00008 27bd0028 00000000 00000000 ....'..(........\nContents of section .reginfo:\n 0000 a00f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8002ACFC_2B8FC' — lift: cannot lift 'func_8002ACFC_2B8FC': function call 'jal' at 0x20 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-40 */\n/* 4:\tsw\ts2,24(sp) */\n/* 8:\tmove\ts2,a0 */\n/* c:\tsw\ts3,28(sp) */\n/* 10:\tmove\ts3,a1 */\n/* 14:\tsw\ts0,16(sp) */\n/* 18:\tmove\ts0,a2 */\n/* 1c:\tsw\tra,32(sp) */\n/* 20:\tjal\t0 */\n/* 24:\tsw\ts1,20(sp) */\n/* 28:\tmove\ts1,v0 */\n/* 2c:\tlw\ta0,1004(s1) */\n/* 30:\tlw\ta1,1008(s1) */\n/* 34:\tmove\ta2,s2 */\n/* 38:\tjal\t0 */\n/* 3c:\tmove\ta3,s3 */\n/* 40:\tsll\ts0,s0,0x10 */\n/* 44:\tsra\ts0,s0,0x10 */\n/* 48:\taddiu\tv1,s0,-568 */\n/* 4c:\tsll\tv0,v0,0x10 */\n/* 50:\tsra\ta0,v0,0x10 */\n/* 54:\tslt\tv1,v1,a0 */\n/* 58:\tbeqz\tv1,98 */\n/* 5c:\taddiu\tv0,s0,568 */\n/* 60:\tslt\tv0,a0,v0 */\n/* 64:\tbeqz\tv0,9c */\n/* 68:\tmove\tv0,zero */\n/* 6c:\tlw\ta0,1004(s1) */\n/* 70:\tlw\ta1,1008(s1) */\n/* 74:\tsubu\ta0,a0,s2 */\n/* 78:\tjal\t0 */\n/* 7c:\tsubu\ta1,a1,s3 */\n/* 80:\tlui\tv1,0x28 */\n/* 84:\tslt\tv1,v1,v0 */\n/* 88:\tbnez\tv1,9c */\n/* 8c:\tmove\tv0,zero */\n/* 90:\tj\t9c */\n/* 94:\tli\tv0,1 */\n/* 98:\tmove\tv0,zero */\n/* 9c:\tlw\tra,32(sp) */\n/* a0:\tlw\ts3,28(sp) */\n/* a4:\tlw\ts2,24(sp) */\n/* a8:\tlw\ts1,20(sp) */\n/* ac:\tlw\ts0,16(sp) */\n/* b0:\tjr\tra */\n/* b4:\taddiu\tsp,sp,40 */\n/* \t... */\nvoid func_8002ACFC_2B8FC(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8002ACFC_2B8FC': function call 'jal' at 0x20 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":55,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8002ACFC_2B8FC': function call 'jal' at 0x20 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 distance_2d(s32, s32); /* extern */\ns16 func_8006D21C_6DE1C(s32, s32, s32, s32); /* extern */\nvoid *getCurrentAllocation(); /* extern */\n\ns32 func_8002ACFC_2B8FC(s32 arg0, s32 arg1, s16 arg2) {\n s16 temp_v0_2;\n void *temp_v0;\n\n temp_v0 = getCurrentAllocation();\n temp_v0_2 = func_8006D21C_6DE1C(temp_v0->unk3EC, temp_v0->unk3F0, arg0, arg1);\n if ((arg2 - 0x238) < temp_v0_2) {\n if ((temp_v0_2 < (arg2 + 0x238)) && (distance_2d(temp_v0->unk3EC - arg0, temp_v0->unk3F0 - arg1) <= 0x280000)) {\n return 1;\n }\n /* Duplicate return node #5. Try simplifying control flow for better match */\n return 0;\n }\n return 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:2610: request for member `unk3EC' in something not a structure or union","/c.i:2610: request for member `unk3F0' in something not a structure or union","/c.i:2612: request for member `unk3EC' in something not a structure or union","/c.i:2612: request for member `unk3F0' in something not a structure or union"]},"note":"src/2AF90.c: proximity/heading test against the player position; fixed-point distance check","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8002ACFC_2B8FC` — benchmark function snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002ACFC_2B8FC\n addiu\t$sp, $sp, -40\n sw\t$s2, 24($sp)\n move\t$s2, $a0\n sw\t$s3, 28($sp)\n move\t$s3, $a1\n sw\t$s0, 16($sp)\n move\t$s0, $a2\n sw\t$ra, 32($sp)\n jal\tgetCurrentAllocation\n sw\t$s1, 20($sp)\n move\t$s1, $v0\n lw\t$a0, 1004($s1)\n lw\t$a1, 1008($s1)\n move\t$a2, $s2\n jal\tfunc_8006D21C_6DE1C\n move\t$a3, $s3\n sll\t$s0, $s0, 0x10\n sra\t$s0, $s0, 0x10\n addiu\t$v1, $s0, -568\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n slt\t$v1, $v1, $a0\n beqz\t$v1, .L98\n addiu\t$v0, $s0, 568\n slt\t$v0, $a0, $v0\n beqz\t$v0, .L9c\n move\t$v0, $zero\n lw\t$a0, 1004($s1)\n lw\t$a1, 1008($s1)\n subu\t$a0, $a0, $s2\n jal\tdistance_2d\n subu\t$a1, $a1, $s3\n lui\t$v1, 0x28\n slt\t$v1, $v1, $v0\n bnez\t$v1, .L9c\n move\t$v0, $zero\n j\t.L9c\n li\t$v0, 1\n.L98:\n move\t$v0, $zero\n.L9c:\n lw\t$ra, 32($sp)\n lw\t$s3, 28($sp)\n lw\t$s2, 24($sp)\n lw\t$s1, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002ACFC_2B8FC # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002ACFC_2B8FC` — benchmark function snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002ACFC_2B8FC:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,24(sp)\n 8:\tmove\ts2,a0\n c:\tsw\ts3,28(sp)\n 10:\tmove\ts3,a1\n 14:\tsw\ts0,16(sp)\n 18:\tmove\ts0,a2\n 1c:\tsw\tra,32(sp)\n 20:\tjal\t0 \n 24:\tsw\ts1,20(sp)\n 28:\tmove\ts1,v0\n 2c:\tlw\ta0,1004(s1)\n 30:\tlw\ta1,1008(s1)\n 34:\tmove\ta2,s2\n 38:\tjal\t0 \n 3c:\tmove\ta3,s3\n 40:\tsll\ts0,s0,0x10\n 44:\tsra\ts0,s0,0x10\n 48:\taddiu\tv1,s0,-568\n 4c:\tsll\tv0,v0,0x10\n 50:\tsra\ta0,v0,0x10\n 54:\tslt\tv1,v1,a0\n 58:\tbeqz\tv1,98 \n 5c:\taddiu\tv0,s0,568\n 60:\tslt\tv0,a0,v0\n 64:\tbeqz\tv0,9c \n 68:\tmove\tv0,zero\n 6c:\tlw\ta0,1004(s1)\n 70:\tlw\ta1,1008(s1)\n 74:\tsubu\ta0,a0,s2\n 78:\tjal\t0 \n 7c:\tsubu\ta1,a1,s3\n 80:\tlui\tv1,0x28\n 84:\tslt\tv1,v1,v0\n 88:\tbnez\tv1,9c \n 8c:\tmove\tv0,zero\n 90:\tj\t9c \n 94:\tli\tv0,1\n 98:\tmove\tv0,zero\n 9c:\tlw\tra,32(sp)\n a0:\tlw\ts3,28(sp)\n a4:\tlw\ts2,24(sp)\n a8:\tlw\ts1,20(sp)\n ac:\tlw\ts0,16(sp)\n b0:\tjr\tra\n b4:\taddiu\tsp,sp,40\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0e839e3e93bac188/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000b8 func_8002ACFC_2B8FC\n00000000 *UND*\t00000000 getCurrentAllocation\n00000000 *UND*\t00000000 func_8006D21C_6DE1C\n00000000 *UND*\t00000000 distance_2d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 getCurrentAllocation\n00000038 R_MIPS_26 func_8006D21C_6DE1C\n00000078 R_MIPS_26 distance_2d\n00000090 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffd8 afb20018 00809021 afb3001c '..........!....\n 0010 00a09821 afb00010 00c08021 afbf0020 ...!.......!... \n 0020 0c000000 afb10014 00408821 8e2403ec .........@.!.$..\n 0030 8e2503f0 02403021 0c000000 02603821 .%...@0!.....`8!\n 0040 00108400 00108403 2603fdc8 00021400 ........&.......\n 0050 00022403 0064182a 1060000f 26020238 ..$..d.*.`..&..8\n 0060 0082102a 1040000d 00001021 8e2403ec ...*.@.....!.$..\n 0070 8e2503f0 00922023 0c000000 00b32823 .%.... #......(#\n 0080 3c030028 0062182a 14600004 00001021 <..(.b.*.`.....!\n 0090 08000027 24020001 00001021 8fbf0020 ...'$......!... \n 00a0 8fb3001c 8fb20018 8fb10014 8fb00010 ................\n 00b0 03e00008 27bd0028 00000000 00000000 ....'..(........\nContents of section .reginfo:\n 0000 a00f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002ACFC_2B8FC # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc","sym":"func_8002ADB4_2B9B4","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["fixedpoint","bitwise","branch","compare"],"loc":52,"refSource":"s16 func_8002ADB4_2B9B4(s16 arg0, s16 arg1) {\n s16 target;\n s16 current;\n s32 diff;\n s16 absDiff;\n s16 direction;\n\n target = arg0;\n current = arg1;\n\n if (arg0 == arg1) {\n goto done;\n }\n\n diff = arg0 - arg1;\n diff = ABS(diff);\n\n if ((s16)diff >= 0x1001) {\n if (arg1 < arg0) {\n current = arg1 + 0x2000;\n } else {\n target = arg0 + 0x2000;\n }\n }\n\n arg0 = target;\n arg1 = current;\n\n diff = arg0 - arg1;\n absDiff = ABS(diff);\n\n if (absDiff >= 0xAAB) {\n current += 0x1000;\n goto done;\n }\n\n if (arg1 < arg0) {\n direction = 1;\n } else {\n direction = -1;\n }\n\n if (absDiff >= 0x80) {\n current += direction << 7;\n goto done;\n }\n\n current = (current + absDiff * direction) & 0x1FFF;\n\ndone:\n return current;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L103-L162","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,a0\n 4:\tsll\tv0,a0,0x10\n 8:\tsra\ta2,v0,0x10\n c:\tsll\tv0,a1,0x10\n 10:\tsra\tv1,v0,0x10\n 14:\tbeq\ta2,v1,c0 \n 18:\tmove\ta3,a1\n 1c:\tsubu\tv0,a2,v1\n 20:\tbltzl\tv0,28 \n 24:\tnegu\tv0,v0\n 28:\tsll\tv0,v0,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tslti\tv0,v0,4097\n 34:\tbnez\tv0,50 \n 38:\tsll\tv0,t0,0x10\n 3c:\tslt\tv0,v1,a2\n 40:\tbeqzl\tv0,4c \n 44:\taddiu\tt0,a0,8192\n 48:\taddiu\ta3,a1,8192\n 4c:\tsll\tv0,t0,0x10\n 50:\tsra\ta1,v0,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tsra\tv1,v0,0x10\n 5c:\tsubu\tv0,a1,v1\n 60:\tbgez\tv0,6c \n 64:\tmove\ta2,v0\n 68:\tnegu\ta2,a2\n 6c:\tsll\tv0,a2,0x10\n 70:\tsra\ta0,v0,0x10\n 74:\tslti\tv0,a0,2731\n 78:\tbnezl\tv0,88 \n 7c:\tslt\tv0,v1,a1\n 80:\tj\tc0 \n 84:\taddiu\ta3,a3,4096\n 88:\txori\tv0,v0,0x1\n 8c:\tnegu\tv0,v0\n 90:\tori\tv1,v0,0x1\n 94:\tslti\tv0,a0,128\n 98:\tbnez\tv0,ac \n 9c:\tnop\n a0:\tsll\tv0,v1,0x7\n a4:\tj\tc0 \n a8:\taddu\ta3,a3,v0\n ac:\tnop\n b0:\tmult\ta2,v1\n b4:\tmflo\tv0\n b8:\taddu\tv0,a3,v0\n bc:\tandi\ta3,v0,0x1fff\n c0:\tsll\tv0,a3,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-032753bac235c323/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000cc func_8002ADB4_2B9B4\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000080 R_MIPS_26 .text\n000000a4 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00804021 00041400 00023403 00051400 ..@!......4.....\n 0010 00021c03 10c3002a 00a03821 00c31023 .......*..8!...#\n 0020 04420001 00021023 00021400 00021403 .B.....#........\n 0030 28421001 14400006 00081400 0066102a (B...@.......f.*\n 0040 50400002 24882000 24a72000 00081400 P@..$. .$. .....\n 0050 00022c03 00071400 00021c03 00a31023 ..,............#\n 0060 04410002 00403021 00063023 00061400 .A...@0!..0#....\n 0070 00022403 28820aab 54400003 0065102a ..$.(...T@...e.*\n 0080 08000030 24e71000 38420001 00021023 ...0$...8B.....#\n 0090 34430001 28820080 14400004 00000000 4C..(....@......\n 00a0 000311c0 08000030 00e23821 00000000 .......0..8!....\n 00b0 00c30018 00001012 00e21021 30471fff ...........!0G..\n 00c0 00071400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8002ADB4_2B9B4' — lift: cannot lift 'func_8002ADB4_2B9B4': unmodelled control transfer 'bltzl' at 0x20 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tt0,a0 */\n/* 4:\tsll\tv0,a0,0x10 */\n/* 8:\tsra\ta2,v0,0x10 */\n/* c:\tsll\tv0,a1,0x10 */\n/* 10:\tsra\tv1,v0,0x10 */\n/* 14:\tbeq\ta2,v1,c0 */\n/* 18:\tmove\ta3,a1 */\n/* 1c:\tsubu\tv0,a2,v1 */\n/* 20:\tbltzl\tv0,28 */\n/* 24:\tnegu\tv0,v0 */\n/* 28:\tsll\tv0,v0,0x10 */\n/* 2c:\tsra\tv0,v0,0x10 */\n/* 30:\tslti\tv0,v0,4097 */\n/* 34:\tbnez\tv0,50 */\n/* 38:\tsll\tv0,t0,0x10 */\n/* 3c:\tslt\tv0,v1,a2 */\n/* 40:\tbeqzl\tv0,4c */\n/* 44:\taddiu\tt0,a0,8192 */\n/* 48:\taddiu\ta3,a1,8192 */\n/* 4c:\tsll\tv0,t0,0x10 */\n/* 50:\tsra\ta1,v0,0x10 */\n/* 54:\tsll\tv0,a3,0x10 */\n/* 58:\tsra\tv1,v0,0x10 */\n/* 5c:\tsubu\tv0,a1,v1 */\n/* 60:\tbgez\tv0,6c */\n/* 64:\tmove\ta2,v0 */\n/* 68:\tnegu\ta2,a2 */\n/* 6c:\tsll\tv0,a2,0x10 */\n/* 70:\tsra\ta0,v0,0x10 */\n/* 74:\tslti\tv0,a0,2731 */\n/* 78:\tbnezl\tv0,88 */\n/* 7c:\tslt\tv0,v1,a1 */\n/* 80:\tj\tc0 */\n/* 84:\taddiu\ta3,a3,4096 */\n/* 88:\txori\tv0,v0,0x1 */\n/* 8c:\tnegu\tv0,v0 */\n/* 90:\tori\tv1,v0,0x1 */\n/* 94:\tslti\tv0,a0,128 */\n/* 98:\tbnez\tv0,ac */\n/* 9c:\tnop */\n/* a0:\tsll\tv0,v1,0x7 */\n/* a4:\tj\tc0 */\n/* a8:\taddu\ta3,a3,v0 */\n/* ac:\tnop */\n/* b0:\tmult\ta2,v1 */\n/* b4:\tmflo\tv0 */\n/* b8:\taddu\tv0,a3,v0 */\n/* bc:\tandi\ta3,v0,0x1fff */\n/* c0:\tsll\tv0,a3,0x10 */\n/* c4:\tjr\tra */\n/* c8:\tsra\tv0,v0,0x10 */\n/* cc:\tnop */\nvoid func_8002ADB4_2B9B4(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8002ADB4_2B9B4': unmodelled control transfer 'bltzl' at 0x20 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":60,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8002ADB4_2B9B4': unmodelled control transfer 'bltzl' at 0x20 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 func_8002ADB4_2B9B4(s16 arg0, s16 arg1) {\n s16 temp_v0;\n s16 var_a2;\n s16 var_a3;\n s16 var_t0;\n s16 var_v0;\n s32 temp_a1;\n s32 temp_v1;\n s32 var_v0_2;\n\n var_t0 = arg0;\n var_a3 = arg1;\n if (arg0 != arg1) {\n var_v0 = arg0 - arg1;\n if (var_v0 < 0) {\n var_v0 = -var_v0;\n }\n var_v0_2 = var_t0 << 0x10;\n if (var_v0 >= 0x1001) {\n if (arg1 >= arg0) {\n var_t0 = arg0 + 0x2000;\n } else {\n var_a3 = arg1 + 0x2000;\n }\n var_v0_2 = var_t0 << 0x10;\n }\n temp_a1 = var_v0_2 >> 0x10;\n temp_v0 = temp_a1 - var_a3;\n var_a2 = temp_v0;\n if (temp_v0 < 0) {\n var_a2 = -var_a2;\n }\n if (var_a2 < 0xAAB) {\n temp_v1 = -(var_a3 >= temp_a1) | 1;\n if (var_a2 >= 0x80) {\n var_a3 += temp_v1 << 7;\n } else {\n var_a3 = (var_a3 + (var_a2 * temp_v1)) & 0x1FFF;\n }\n } else {\n var_a3 += 0x1000;\n }\n }\n return var_a3;\n}\n","score":55,"maxScore":69,"compileErrors":null,"breakdown":{"insert":18,"delete":16,"replace":1,"opMismatch":0,"argMismatch":20},"quality":{"score":100,"lines":44,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/2AF90.c: angle interpolation with wrap handling; pure leaf, uses ABS macro","gapSize":{"decompiler":"m2c","score":55,"maxScore":69,"ratio":0.7971014492753623,"kinds":{"insert":18,"delete":16,"replace":1,"opMismatch":0,"argMismatch":20}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8002ADB4_2B9B4` — benchmark function snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002ADB4_2B9B4\n move\t$t0, $a0\n sll\t$v0, $a0, 0x10\n sra\t$a2, $v0, 0x10\n sll\t$v0, $a1, 0x10\n sra\t$v1, $v0, 0x10\n beq\t$a2, $v1, .Lc0\n move\t$a3, $a1\n subu\t$v0, $a2, $v1\n bltzl\t$v0, .L28\n negu\t$v0, $v0\n.L28:\n sll\t$v0, $v0, 0x10\n sra\t$v0, $v0, 0x10\n slti\t$v0, $v0, 4097\n bnez\t$v0, .L50\n sll\t$v0, $t0, 0x10\n slt\t$v0, $v1, $a2\n beqzl\t$v0, .L4c\n addiu\t$t0, $a0, 8192\n addiu\t$a3, $a1, 8192\n.L4c:\n sll\t$v0, $t0, 0x10\n.L50:\n sra\t$a1, $v0, 0x10\n sll\t$v0, $a3, 0x10\n sra\t$v1, $v0, 0x10\n subu\t$v0, $a1, $v1\n bgez\t$v0, .L6c\n move\t$a2, $v0\n negu\t$a2, $a2\n.L6c:\n sll\t$v0, $a2, 0x10\n sra\t$a0, $v0, 0x10\n slti\t$v0, $a0, 2731\n bnezl\t$v0, .L88\n slt\t$v0, $v1, $a1\n j\t.Lc0\n addiu\t$a3, $a3, 4096\n.L88:\n xori\t$v0, $v0, 0x1\n negu\t$v0, $v0\n ori\t$v1, $v0, 0x1\n slti\t$v0, $a0, 128\n bnez\t$v0, .Lac\n nop\n sll\t$v0, $v1, 0x7\n j\t.Lc0\n addu\t$a3, $a3, $v0\n.Lac:\n nop\n mult\t$a2, $v1\n mflo\t$v0\n addu\t$v0, $a3, $v0\n andi\t$a3, $v0, 0x1fff\n.Lc0:\n sll\t$v0, $a3, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002ADB4_2B9B4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002ADB4_2B9B4` — benchmark function snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002ADB4_2B9B4:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tt0,a0\n 4:\tsll\tv0,a0,0x10\n 8:\tsra\ta2,v0,0x10\n c:\tsll\tv0,a1,0x10\n 10:\tsra\tv1,v0,0x10\n 14:\tbeq\ta2,v1,c0 \n 18:\tmove\ta3,a1\n 1c:\tsubu\tv0,a2,v1\n 20:\tbltzl\tv0,28 \n 24:\tnegu\tv0,v0\n 28:\tsll\tv0,v0,0x10\n 2c:\tsra\tv0,v0,0x10\n 30:\tslti\tv0,v0,4097\n 34:\tbnez\tv0,50 \n 38:\tsll\tv0,t0,0x10\n 3c:\tslt\tv0,v1,a2\n 40:\tbeqzl\tv0,4c \n 44:\taddiu\tt0,a0,8192\n 48:\taddiu\ta3,a1,8192\n 4c:\tsll\tv0,t0,0x10\n 50:\tsra\ta1,v0,0x10\n 54:\tsll\tv0,a3,0x10\n 58:\tsra\tv1,v0,0x10\n 5c:\tsubu\tv0,a1,v1\n 60:\tbgez\tv0,6c \n 64:\tmove\ta2,v0\n 68:\tnegu\ta2,a2\n 6c:\tsll\tv0,a2,0x10\n 70:\tsra\ta0,v0,0x10\n 74:\tslti\tv0,a0,2731\n 78:\tbnezl\tv0,88 \n 7c:\tslt\tv0,v1,a1\n 80:\tj\tc0 \n 84:\taddiu\ta3,a3,4096\n 88:\txori\tv0,v0,0x1\n 8c:\tnegu\tv0,v0\n 90:\tori\tv1,v0,0x1\n 94:\tslti\tv0,a0,128\n 98:\tbnez\tv0,ac \n 9c:\tnop\n a0:\tsll\tv0,v1,0x7\n a4:\tj\tc0 \n a8:\taddu\ta3,a3,v0\n ac:\tnop\n b0:\tmult\ta2,v1\n b4:\tmflo\tv0\n b8:\taddu\tv0,a3,v0\n bc:\tandi\ta3,v0,0x1fff\n c0:\tsll\tv0,a3,0x10\n c4:\tjr\tra\n c8:\tsra\tv0,v0,0x10\n cc:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-032753bac235c323/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000cc func_8002ADB4_2B9B4\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000080 R_MIPS_26 .text\n000000a4 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00804021 00041400 00023403 00051400 ..@!......4.....\n 0010 00021c03 10c3002a 00a03821 00c31023 .......*..8!...#\n 0020 04420001 00021023 00021400 00021403 .B.....#........\n 0030 28421001 14400006 00081400 0066102a (B...@.......f.*\n 0040 50400002 24882000 24a72000 00081400 P@..$. .$. .....\n 0050 00022c03 00071400 00021c03 00a31023 ..,............#\n 0060 04410002 00403021 00063023 00061400 .A...@0!..0#....\n 0070 00022403 28820aab 54400003 0065102a ..$.(...T@...e.*\n 0080 08000030 24e71000 38420001 00021023 ...0$...8B.....#\n 0090 34430001 28820080 14400004 00000000 4C..(....@......\n 00a0 000311c0 08000030 00e23821 00000000 .......0..8!....\n 00b0 00c30018 00001012 00e21021 30471fff ...........!0G..\n 00c0 00071400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002ADB4_2B9B4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc","sym":"func_8002B4B8_2C0B8","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","branch","fixedpoint"],"loc":13,"refSource":"s16 func_8002B4B8_2C0B8(u16 arg0, u16 arg1) {\n s16 diff;\n\n arg0 &= 0x1FFF;\n arg1 &= 0x1FFF;\n diff = (arg1 - arg0) & 0x1FFF;\n\n if (diff >= 0x1001) {\n diff |= 0xE000;\n }\n\n return diff;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2AF90.c#L168-L180","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0x1fff\n 4:\tandi\ta1,a1,0x1fff\n 8:\tsubu\ta1,a1,a0\n c:\tandi\ta1,a1,0x1fff\n 10:\tslti\tv0,a1,4097\n 14:\tbnez\tv0,20 \n 18:\tmove\tv1,a1\n 1c:\tori\tv1,a1,0xe000\n 20:\tsll\tv0,v1,0x10\n 24:\tjr\tra\n 28:\tsra\tv0,v0,0x10\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e937fcabf56e4964/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_8002B4B8_2C0B8\n\n\nContents of section .text:\n 0000 30841fff 30a51fff 00a42823 30a51fff 0...0.....(#0...\n 0010 28a21001 14400002 00a01821 34a3e000 (....@.....!4...\n 0020 00031400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned/regcopy-ret","symbolsUsed":[],"outcome":"nonmatch","source":"s32 func_8002B4B8_2C0B8(u32 a0, u32 a1) {\n s32 v0;\n s32 w0;\n v0 = (a1 & 8191) - (a0 & 8191) & 8191;\n w0 = v0;\n if (w0 >= 4097) w0 = w0 | 57344;\n v0 = w0 << 16 >> 16;\n return v0;\n}\n","score":2,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 func_8002B4B8_2C0B8(s32 arg0, s32 arg1) {\n s16 temp_a1;\n s16 var_v1;\n\n temp_a1 = ((arg1 & 0x1FFF) - (arg0 & 0x1FFF)) & 0x1FFF;\n var_v1 = temp_a1;\n if (temp_a1 >= 0x1001) {\n var_v1 = temp_a1 | 0xE000;\n }\n return var_v1;\n}\n","score":2,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":10,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/2AF90.c: signed angle difference in 13-bit angle space; pure leaf","gapSize":{"decompiler":"asmlift","score":2,"maxScore":11,"ratio":0.18181818181818182,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8002B4B8_2C0B8` — benchmark function snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002B4B8_2C0B8\n andi\t$a0, $a0, 0x1fff\n andi\t$a1, $a1, 0x1fff\n subu\t$a1, $a1, $a0\n andi\t$a1, $a1, 0x1fff\n slti\t$v0, $a1, 4097\n bnez\t$v0, .L20\n move\t$v1, $a1\n ori\t$v1, $a1, 0xe000\n.L20:\n sll\t$v0, $v1, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002B4B8_2C0B8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002B4B8_2C0B8` — benchmark function snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002B4B8_2C0B8:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0x1fff\n 4:\tandi\ta1,a1,0x1fff\n 8:\tsubu\ta1,a1,a0\n c:\tandi\ta1,a1,0x1fff\n 10:\tslti\tv0,a1,4097\n 14:\tbnez\tv0,20 \n 18:\tmove\tv1,a1\n 1c:\tori\tv1,a1,0xe000\n 20:\tsll\tv0,v1,0x10\n 24:\tjr\tra\n 28:\tsra\tv0,v0,0x10\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-e937fcabf56e4964/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c func_8002B4B8_2C0B8\n\n\nContents of section .text:\n 0000 30841fff 30a51fff 00a42823 30a51fff 0...0.....(#0...\n 0010 28a21001 14400002 00a01821 34a3e000 (....@.....!4...\n 0020 00031400 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002B4B8_2C0B8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc","sym":"func_8002BE94_2CA94","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","struct","array","call"],"loc":7,"refSource":"void func_8002BE94_2CA94(Struct2C8F0 *arg0) {\n s32 i;\n\n for (i = 0; i < arg0->unkD5; i++) {\n arg0->elems[i].unk0 = destroySceneModel(arg0->elems[i].unk0);\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/2C8F0.c#L47-L53","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,32(sp)\n 8:\tmove\ts2,a0\n c:\tsw\tra,36(sp)\n 10:\tsw\ts1,28(sp)\n 14:\tsw\ts0,24(sp)\n 18:\tlbu\tv0,213(s2)\n 1c:\tblez\tv0,48 \n 20:\tmove\ts1,zero\n 24:\tmove\ts0,s2\n 28:\tlw\ta0,0(s0)\n 2c:\tjal\t0 \n 30:\taddiu\ts1,s1,1\n 34:\tsw\tv0,0(s0)\n 38:\tlbu\tv0,213(s2)\n 3c:\tslt\tv0,s1,v0\n 40:\tbnez\tv0,28 \n 44:\taddiu\ts0,s0,100\n 48:\tlw\tra,36(sp)\n 4c:\tlw\ts2,32(sp)\n 50:\tlw\ts1,28(sp)\n 54:\tlw\ts0,24(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,40\n","proto":{"func_8002BE94_2CA94":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-768f1f5763ffb52a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_8002BE94_2CA94\n00000000 *UND*\t00000000 destroySceneModel\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 destroySceneModel\n\n\nContents of section .text:\n 0000 27bdffd8 afb20020 00809021 afbf0024 '...... ...!...$\n 0010 afb1001c afb00018 924200d5 1840000a .........B...@..\n 0020 00008821 02408021 8e040000 0c000000 ...!.@.!........\n 0030 26310001 ae020000 924200d5 0222102a &1.......B...\".*\n 0040 1440fff9 26100064 8fbf0024 8fb20020 .@..&..d...$... \n 0050 8fb1001c 8fb00018 03e00008 27bd0028 ............'..(\nContents of section .reginfo:\n 0000 a0070014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_8002BE94_2CA94' — lift: cannot lift 'func_8002BE94_2CA94': function call 'jal' at 0x2c — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-40 */\n/* 4:\tsw\ts2,32(sp) */\n/* 8:\tmove\ts2,a0 */\n/* c:\tsw\tra,36(sp) */\n/* 10:\tsw\ts1,28(sp) */\n/* 14:\tsw\ts0,24(sp) */\n/* 18:\tlbu\tv0,213(s2) */\n/* 1c:\tblez\tv0,48 */\n/* 20:\tmove\ts1,zero */\n/* 24:\tmove\ts0,s2 */\n/* 28:\tlw\ta0,0(s0) */\n/* 2c:\tjal\t0 */\n/* 30:\taddiu\ts1,s1,1 */\n/* 34:\tsw\tv0,0(s0) */\n/* 38:\tlbu\tv0,213(s2) */\n/* 3c:\tslt\tv0,s1,v0 */\n/* 40:\tbnez\tv0,28 */\n/* 44:\taddiu\ts0,s0,100 */\n/* 48:\tlw\tra,36(sp) */\n/* 4c:\tlw\ts2,32(sp) */\n/* 50:\tlw\ts1,28(sp) */\n/* 54:\tlw\ts0,24(sp) */\n/* 58:\tjr\tra */\n/* 5c:\taddiu\tsp,sp,40 */\nvoid func_8002BE94_2CA94(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_8002BE94_2CA94': function call 'jal' at 0x2c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_8002BE94_2CA94': function call 'jal' at 0x2c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 destroySceneModel(s32); /* extern */\n\nvoid func_8002BE94_2CA94(s32 *arg0) {\n s32 *var_s0;\n s32 var_s1;\n\n var_s1 = 0;\n if ((s32) arg0->unkD5 > 0) {\n var_s0 = arg0;\n do {\n var_s1 += 1;\n *var_s0 = destroySceneModel(*var_s0);\n var_s0 += 0x64;\n } while (var_s1 < (s32) arg0->unkD5);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":98,"lines":14,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: kmc gcc (docker) failed: /c.i:2472: conflicting types for `destroySceneModel'","/c.i:2433: previous declaration of `destroySceneModel'","/c.i:2477: request for member `unkD5' in something not a structure or union","/c.i:2483: request for member `unkD5' in something not a structure or union"]},"note":"src/2C8F0.c: destroys each scene model in a fixed array up to a live count","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_8002BE94_2CA94` — benchmark function snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_8002BE94_2CA94\n addiu\t$sp, $sp, -40\n sw\t$s2, 32($sp)\n move\t$s2, $a0\n sw\t$ra, 36($sp)\n sw\t$s1, 28($sp)\n sw\t$s0, 24($sp)\n lbu\t$v0, 213($s2)\n blez\t$v0, .L48\n move\t$s1, $zero\n move\t$s0, $s2\n.L28:\n lw\t$a0, 0($s0)\n jal\tdestroySceneModel\n addiu\t$s1, $s1, 1\n sw\t$v0, 0($s0)\n lbu\t$v0, 213($s2)\n slt\t$v0, $s1, $v0\n bnez\t$v0, .L28\n addiu\t$s0, $s0, 100\n.L48:\n lw\t$ra, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_8002BE94_2CA94 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_8002BE94_2CA94` — benchmark function snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_8002BE94_2CA94:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts2,32(sp)\n 8:\tmove\ts2,a0\n c:\tsw\tra,36(sp)\n 10:\tsw\ts1,28(sp)\n 14:\tsw\ts0,24(sp)\n 18:\tlbu\tv0,213(s2)\n 1c:\tblez\tv0,48 \n 20:\tmove\ts1,zero\n 24:\tmove\ts0,s2\n 28:\tlw\ta0,0(s0)\n 2c:\tjal\t0 \n 30:\taddiu\ts1,s1,1\n 34:\tsw\tv0,0(s0)\n 38:\tlbu\tv0,213(s2)\n 3c:\tslt\tv0,s1,v0\n 40:\tbnez\tv0,28 \n 44:\taddiu\ts0,s0,100\n 48:\tlw\tra,36(sp)\n 4c:\tlw\ts2,32(sp)\n 50:\tlw\ts1,28(sp)\n 54:\tlw\ts0,24(sp)\n 58:\tjr\tra\n 5c:\taddiu\tsp,sp,40\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-768f1f5763ffb52a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000060 func_8002BE94_2CA94\n00000000 *UND*\t00000000 destroySceneModel\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 destroySceneModel\n\n\nContents of section .text:\n 0000 27bdffd8 afb20020 00809021 afbf0024 '...... ...!...$\n 0010 afb1001c afb00018 924200d5 1840000a .........B...@..\n 0020 00008821 02408021 8e040000 0c000000 ...!.@.!........\n 0030 26310001 ae020000 924200d5 0222102a &1.......B...\".*\n 0040 1440fff9 26100064 8fbf0024 8fb20020 .@..&..d...$... \n 0050 8fb1001c 8fb00018 03e00008 27bd0028 ............'..(\nContents of section .reginfo:\n 0000 a0070014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"func_8002BE94_2CA94\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_8002BE94_2CA94 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc","sym":"func_80035F80_36B80","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","call","cast","return"],"loc":7,"refSource":"void *func_80035F80_36B80(s32 arg0) {\n if ((u8)arg0 != 1) {\n return loadCompressedData(&_3F6950_ROM_START, &_3F6950_ROM_END, 0x508);\n } else {\n return loadCompressedData(&_459E00_ROM_START, &_459E00_ROM_END, 0x22E8);\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/36B80.c#L8-L14","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tandi\ta0,a0,0xff\n 8:\tli\tv0,1\n c:\tbne\ta0,v0,2c \n 10:\tsw\tra,16(sp)\n 14:\tlui\ta0,0x0\n 18:\taddiu\ta0,a0,0\n 1c:\tlui\ta1,0x0\n 20:\taddiu\ta1,a1,0\n 24:\tj\t40 \n 28:\tli\ta2,8936\n 2c:\tlui\ta0,0x0\n 30:\taddiu\ta0,a0,0\n 34:\tlui\ta1,0x0\n 38:\taddiu\ta1,a1,0\n 3c:\tli\ta2,1288\n 40:\tjal\t0 \n 44:\tnop\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-cd71a6e037df.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-307c44b8cf52b911/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80035F80_36B80\n00000000 *UND*\t00000000 _459E00_ROM_START\n00000000 *UND*\t00000000 _459E00_ROM_END\n00000000 *UND*\t00000000 _3F6950_ROM_START\n00000000 *UND*\t00000000 _3F6950_ROM_END\n00000000 *UND*\t00000000 loadCompressedData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_HI16 _459E00_ROM_START\n00000018 R_MIPS_LO16 _459E00_ROM_START\n0000001c R_MIPS_HI16 _459E00_ROM_END\n00000020 R_MIPS_LO16 _459E00_ROM_END\n00000024 R_MIPS_26 .text\n0000002c R_MIPS_HI16 _3F6950_ROM_START\n00000030 R_MIPS_LO16 _3F6950_ROM_START\n00000034 R_MIPS_HI16 _3F6950_ROM_END\n00000038 R_MIPS_LO16 _3F6950_ROM_END\n00000040 R_MIPS_26 loadCompressedData\n\n\nContents of section .text:\n 0000 27bdffe8 308400ff 24020001 14820007 '...0...$.......\n 0010 afbf0010 3c040000 24840000 3c050000 ....<...$...<...\n 0020 24a50000 08000010 240622e8 3c040000 $.......$.\".<...\n 0030 24840000 3c050000 24a50000 24060508 $...<...$...$...\n 0040 0c000000 00000000 8fbf0010 03e00008 ................\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80035F80_36B80' — lift: cannot lift 'func_80035F80_36B80': function call 'jal' at 0x40 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tandi\ta0,a0,0xff */\n/* 8:\tli\tv0,1 */\n/* c:\tbne\ta0,v0,2c */\n/* 10:\tsw\tra,16(sp) */\n/* 14:\tlui\ta0,0x0 */\n/* 18:\taddiu\ta0,a0,0 */\n/* 1c:\tlui\ta1,0x0 */\n/* 20:\taddiu\ta1,a1,0 */\n/* 24:\tj\t40 */\n/* 28:\tli\ta2,8936 */\n/* 2c:\tlui\ta0,0x0 */\n/* 30:\taddiu\ta0,a0,0 */\n/* 34:\tlui\ta1,0x0 */\n/* 38:\taddiu\ta1,a1,0 */\n/* 3c:\tli\ta2,1288 */\n/* 40:\tjal\t0 */\n/* 44:\tnop */\n/* 48:\tlw\tra,16(sp) */\n/* 4c:\tjr\tra */\n/* 50:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid func_80035F80_36B80(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80035F80_36B80': function call 'jal' at 0x40 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":30,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80035F80_36B80': function call 'jal' at 0x40 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void *func_80035F80_36B80(s32 arg0) {\n s32 var_a2;\n u32 **var_a0;\n u32 **var_a1;\n\n if ((arg0 & 0xFF) == 1) {\n var_a0 = &_459E00_ROM_START;\n var_a1 = &_459E00_ROM_END;\n var_a2 = 0x22E8;\n } else {\n var_a0 = &_3F6950_ROM_START;\n var_a1 = &_3F6950_ROM_END;\n var_a2 = 0x508;\n }\n return loadCompressedData(var_a0, var_a1, var_a2);\n}\n","score":0,"maxScore":21,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/36B80.c: selects one of two compressed assets to load","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80035F80_36B80` — benchmark function snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80035F80_36B80\n addiu\t$sp, $sp, -24\n andi\t$a0, $a0, 0xff\n li\t$v0, 1\n bne\t$a0, $v0, .L2c\n sw\t$ra, 16($sp)\n lui\t$a0, %hi(_459E00_ROM_START)\n addiu\t$a0, $a0, %lo(_459E00_ROM_START)\n lui\t$a1, %hi(_459E00_ROM_END)\n addiu\t$a1, $a1, %lo(_459E00_ROM_END)\n j\t.L40\n li\t$a2, 8936\n.L2c:\n lui\t$a0, %hi(_3F6950_ROM_START)\n addiu\t$a0, $a0, %lo(_3F6950_ROM_START)\n lui\t$a1, %hi(_3F6950_ROM_END)\n addiu\t$a1, $a1, %lo(_3F6950_ROM_END)\n li\t$a2, 1288\n.L40:\n jal\tloadCompressedData\n nop\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-cd71a6e037df.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid *func_80035F80_36B80(s32 arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80035F80_36B80 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80035F80_36B80` — benchmark function snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80035F80_36B80:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tandi\ta0,a0,0xff\n 8:\tli\tv0,1\n c:\tbne\ta0,v0,2c \n 10:\tsw\tra,16(sp)\n 14:\tlui\ta0,0x0\n 18:\taddiu\ta0,a0,0\n 1c:\tlui\ta1,0x0\n 20:\taddiu\ta1,a1,0\n 24:\tj\t40 \n 28:\tli\ta2,8936\n 2c:\tlui\ta0,0x0\n 30:\taddiu\ta0,a0,0\n 34:\tlui\ta1,0x0\n 38:\taddiu\ta1,a1,0\n 3c:\tli\ta2,1288\n 40:\tjal\t0 \n 44:\tnop\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-307c44b8cf52b911/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 func_80035F80_36B80\n00000000 *UND*\t00000000 _459E00_ROM_START\n00000000 *UND*\t00000000 _459E00_ROM_END\n00000000 *UND*\t00000000 _3F6950_ROM_START\n00000000 *UND*\t00000000 _3F6950_ROM_END\n00000000 *UND*\t00000000 loadCompressedData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000014 R_MIPS_HI16 _459E00_ROM_START\n00000018 R_MIPS_LO16 _459E00_ROM_START\n0000001c R_MIPS_HI16 _459E00_ROM_END\n00000020 R_MIPS_LO16 _459E00_ROM_END\n00000024 R_MIPS_26 .text\n0000002c R_MIPS_HI16 _3F6950_ROM_START\n00000030 R_MIPS_LO16 _3F6950_ROM_START\n00000034 R_MIPS_HI16 _3F6950_ROM_END\n00000038 R_MIPS_LO16 _3F6950_ROM_END\n00000040 R_MIPS_26 loadCompressedData\n\n\nContents of section .text:\n 0000 27bdffe8 308400ff 24020001 14820007 '...0...$.......\n 0010 afbf0010 3c040000 24840000 3c050000 ....<...$...<...\n 0020 24a50000 08000010 240622e8 3c040000 $.......$.\".<...\n 0030 24840000 3c050000 24a50000 24060508 $...<...$...$...\n 0040 0c000000 00000000 8fbf0010 03e00008 ................\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80035F80_36B80 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc","sym":"func_80037FE0_38BE0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["array","global","compare"],"loc":3,"refSource":"s32 func_80037FE0_38BE0(u8 arg0) {\n return EepromSaveData->save_slot_status[arg0] == 1;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/38BE0.c#L4-L6","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlw\tv0,0(v0)\n 8:\tandi\ta0,a0,0xff\n c:\taddu\tv0,v0,a0\n 10:\tlbu\tv0,16(v0)\n 14:\txori\tv0,v0,0x1\n 18:\tjr\tra\n 1c:\tsltiu\tv0,v0,1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ce80f7f2e88c6fb7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 func_80037FE0_38BE0\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 EepromSaveData\n00000004 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 3c020000 8c420000 308400ff 00441021 <....B..0....D.!\n 0010 90420010 38420001 03e00008 2c420001 .B..8B......,B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"EepromSaveData","shape":"pointer"}],"outcome":"match","source":"u32 func_80037FE0_38BE0(u32 a0) {\n return (((u8 *)EepromSaveData + (a0 & 255))[16] ^ 1) < 1;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern s32 EepromSaveData;\n\ns32 func_80037FE0_38BE0(s32 arg0) {\n return (EepromSaveData + (arg0 & 0xFF))->unk10 == 1;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: kmc gcc (docker) failed: /c.i:1846: conflicting types for `EepromSaveData'","/c.i:1845: previous declaration of `EepromSaveData'","/c.i:1848: invalid type argument of `->'"]},"note":"src/38BE0.c: save-slot-in-use predicate; leaf","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80037FE0_38BE0` — benchmark function snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80037FE0_38BE0\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n andi\t$a0, $a0, 0xff\n addu\t$v0, $v0, $a0\n lbu\t$v0, 16($v0)\n xori\t$v0, $v0, 0x1\n jr\t$ra\n sltiu\t$v0, $v0, 1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80037FE0_38BE0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80037FE0_38BE0` — benchmark function snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80037FE0_38BE0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x0\n 4:\tlw\tv0,0(v0)\n 8:\tandi\ta0,a0,0xff\n c:\taddu\tv0,v0,a0\n 10:\tlbu\tv0,16(v0)\n 14:\txori\tv0,v0,0x1\n 18:\tjr\tra\n 1c:\tsltiu\tv0,v0,1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ce80f7f2e88c6fb7/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 func_80037FE0_38BE0\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_HI16 EepromSaveData\n00000004 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 3c020000 8c420000 308400ff 00441021 <....B..0....D.!\n 0010 90420010 38420001 03e00008 2c420001 .B..8B......,B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80037FE0_38BE0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80038000_38C00:gcc2.7.2kmc","sym":"func_80038000_38C00","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","global","struct","field"],"loc":13,"refSource":"u8 func_80038000_38C00(u8 arg0) {\n arg0 &= 0xFF;\n if (arg0 < 6) {\n return 1;\n }\n if (arg0 == 6) {\n return EepromSaveData->setting_4E;\n }\n if (arg0 == 7) {\n return EepromSaveData->setting_4F;\n }\n return EepromSaveData->setting_50;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/38BE0.c#L8-L20","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0xff\n 4:\tsltiu\tv0,a0,6\n 8:\tbnez\tv0,50 \n c:\tli\tv0,1\n 10:\tli\tv0,6\n 14:\tbne\ta0,v0,2c \n 18:\tli\tv0,7\n 1c:\tlui\tv0,0x0\n 20:\tlw\tv0,0(v0)\n 24:\tj\t50 \n 28:\tlbu\tv0,78(v0)\n 2c:\tbeq\ta0,v0,44 \n 30:\tnop\n 34:\tlui\tv0,0x0\n 38:\tlw\tv0,0(v0)\n 3c:\tj\t50 \n 40:\tlbu\tv0,80(v0)\n 44:\tlui\tv0,0x0\n 48:\tlw\tv0,0(v0)\n 4c:\tlbu\tv0,79(v0)\n 50:\tjr\tra\n 54:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-deab83b78ab9ef69/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80038000_38C00\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 EepromSaveData\n00000020 R_MIPS_LO16 EepromSaveData\n00000024 R_MIPS_26 .text\n00000034 R_MIPS_HI16 EepromSaveData\n00000038 R_MIPS_LO16 EepromSaveData\n0000003c R_MIPS_26 .text\n00000044 R_MIPS_HI16 EepromSaveData\n00000048 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 308400ff 2c820006 14400011 24020001 0...,....@..$...\n 0010 24020006 14820005 24020007 3c020000 $.......$...<...\n 0020 8c420000 08000014 9042004e 10820005 .B.......B.N....\n 0030 00000000 3c020000 8c420000 08000014 ....<....B......\n 0040 90420050 3c020000 8c420000 9042004f .B.P<....B...B.O\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[{"name":"EepromSaveData","shape":"pointer"}],"outcome":"nonmatch","source":"s32 func_80038000_38C00(u32 a0) {\n s32 v0;\n if ((a0 & 255) < 6) {\n v0 = 1;\n } else {\n switch (a0 & 255) {\n case 6:\n v0 = EepromSaveData->setting_4E;\n break;\n case 7:\n v0 = EepromSaveData->setting_4F;\n break;\n default:\n v0 = EepromSaveData->setting_50;\n }\n }\n return v0;\n}\n","score":9,"maxScore":26,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":96,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"extern void *EepromSaveData;\n\nu8 func_80038000_38C00(s32 arg0) {\n u32 temp_a0;\n u8 var_v0;\n\n temp_a0 = arg0 & 0xFF;\n var_v0 = 1;\n if (temp_a0 >= 6U) {\n switch (temp_a0) { /* irregular */\n case 6:\n return EepromSaveData->unk4E;\n case 7:\n var_v0 = EepromSaveData->unk4F;\n /* Duplicate return node #6. Try simplifying control flow for better match */\n return var_v0;\n default:\n return EepromSaveData->unk50;\n }\n } else {\n return var_v0;\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":96,"lines":21,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: kmc gcc (docker) failed: /c.i:1846: conflicting types for `EepromSaveData'","/c.i:1845: previous declaration of `EepromSaveData'","/c.i:1855: request for member `unk4E' in something not a structure or union","/c.i:1857: request for member `unk4F' in something not a structure or union","/c.i:1860: request for member `unk50' in something not a structure or union"]},"note":"src/38BE0.c: settings getter with if-chain over a global struct; leaf","gapSize":{"decompiler":"asmlift","score":9,"maxScore":26,"ratio":0.34615384615384615,"kinds":{"insert":4,"delete":2,"replace":1,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80038000_38C00` — benchmark function snowboardkids2:func_80038000_38C00:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80038000_38C00\n andi\t$a0, $a0, 0xff\n sltiu\t$v0, $a0, 6\n bnez\t$v0, .L50\n li\t$v0, 1\n li\t$v0, 6\n bne\t$a0, $v0, .L2c\n li\t$v0, 7\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n j\t.L50\n lbu\t$v0, 78($v0)\n.L2c:\n beq\t$a0, $v0, .L44\n nop\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n j\t.L50\n lbu\t$v0, 80($v0)\n.L44:\n lui\t$v0, %hi(EepromSaveData)\n lw\t$v0, %lo(EepromSaveData)($v0)\n lbu\t$v0, 79($v0)\n.L50:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80038000_38C00 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80038000_38C00` — benchmark function snowboardkids2:func_80038000_38C00:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80038000_38C00:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0xff\n 4:\tsltiu\tv0,a0,6\n 8:\tbnez\tv0,50 \n c:\tli\tv0,1\n 10:\tli\tv0,6\n 14:\tbne\ta0,v0,2c \n 18:\tli\tv0,7\n 1c:\tlui\tv0,0x0\n 20:\tlw\tv0,0(v0)\n 24:\tj\t50 \n 28:\tlbu\tv0,78(v0)\n 2c:\tbeq\ta0,v0,44 \n 30:\tnop\n 34:\tlui\tv0,0x0\n 38:\tlw\tv0,0(v0)\n 3c:\tj\t50 \n 40:\tlbu\tv0,80(v0)\n 44:\tlui\tv0,0x0\n 48:\tlw\tv0,0(v0)\n 4c:\tlbu\tv0,79(v0)\n 50:\tjr\tra\n 54:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-deab83b78ab9ef69/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 func_80038000_38C00\n00000000 *UND*\t00000000 EepromSaveData\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_HI16 EepromSaveData\n00000020 R_MIPS_LO16 EepromSaveData\n00000024 R_MIPS_26 .text\n00000034 R_MIPS_HI16 EepromSaveData\n00000038 R_MIPS_LO16 EepromSaveData\n0000003c R_MIPS_26 .text\n00000044 R_MIPS_HI16 EepromSaveData\n00000048 R_MIPS_LO16 EepromSaveData\n\n\nContents of section .text:\n 0000 308400ff 2c820006 14400011 24020001 0...,....@..$...\n 0010 24020006 14820005 24020007 3c020000 $.......$...<...\n 0020 8c420000 08000014 9042004e 10820005 .B.......B.N....\n 0030 00000000 3c020000 8c420000 08000014 ....<....B......\n 0040 90420050 3c020000 8c420000 9042004f .B.P<....B...B.O\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80038000_38C00 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_80051C80_52880:gcc2.7.2kmc","sym":"func_80051C80_52880","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","call","array"],"loc":22,"refSource":"void func_80051C80_52880(s32 *arg0, s32 arg1) {\n s32 dist;\n\n dist = distance_2d(arg0[0], arg0[2]);\n\n if (!(dist >= 0x20000)) {\n if (dist != 0) {\n arg0[0] = (s64)((s64)arg0[0] * 0x20000) / dist;\n arg0[2] = (s64)((s64)arg0[2] * 0x20000) / dist;\n } else {\n arg0[2] = 0x20000;\n }\n }\n\n dist = distance_3d(arg0[0], arg0[1], arg0[2]);\n\n if (dist != 0) {\n arg0[0] = (s64)((s64)arg0[0] * arg1) / dist;\n arg0[1] = (s64)((s64)arg0[1] * arg1) / dist;\n arg0[2] = (s64)((s64)arg0[2] * arg1) / dist;\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/52880.c#L137-L158","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\ts3,52(sp)\n 8:\tmove\ts3,a0\n c:\tsw\ts4,56(sp)\n 10:\tmove\ts4,a1\n 14:\tsw\tra,60(sp)\n 18:\tsw\ts2,48(sp)\n 1c:\tsw\ts1,44(sp)\n 20:\tsw\ts0,40(sp)\n 24:\tlw\ta0,0(s3)\n 28:\tjal\t0 \n 2c:\tlw\ta1,8(s3)\n 30:\tmove\tv1,v0\n 34:\tlui\tv0,0x1\n 38:\tori\tv0,v0,0xffff\n 3c:\tslt\tv0,v0,v1\n 40:\tbnez\tv0,b4 \n 44:\tnop\n 48:\tbeqz\tv1,ac \n 4c:\tlui\ts2,0x2\n 50:\tlw\tv0,0(s3)\n 54:\tmult\tv0,s2\n 58:\tmove\ts1,v1\n 5c:\tsra\ts0,v1,0x1f\n 60:\tmove\ta2,s0\n 64:\tmfhi\ta0\n 68:\tmflo\ta1\n\t...\n 74:\tjal\t0 \n 78:\tmove\ta3,s1\n 7c:\tlw\ta0,8(s3)\n 80:\tmult\ta0,s2\n 84:\tmove\ta2,s0\n 88:\tmove\ta3,s1\n 8c:\tmfhi\ta0\n 90:\tmflo\ta1\n\t...\n 9c:\tjal\t0 \n a0:\tsw\tv1,0(s3)\n a4:\tj\tb4 \n a8:\tsw\tv1,8(s3)\n ac:\tlui\tv0,0x2\n b0:\tsw\tv0,8(s3)\n b4:\tlw\ta0,0(s3)\n b8:\tlw\ta1,4(s3)\n bc:\tjal\t0 \n c0:\tlw\ta2,8(s3)\n c4:\tmove\tv1,v0\n c8:\tbeqz\tv1,14c \n cc:\tmove\ts1,v1\n d0:\tlw\tv0,0(s3)\n d4:\tmult\tv0,s4\n d8:\tsra\ts0,v1,0x1f\n dc:\tmove\ta2,s0\n e0:\tmfhi\ta0\n e4:\tmflo\ta1\n\t...\n f0:\tjal\t0 \n f4:\tmove\ta3,s1\n f8:\tlw\ta0,4(s3)\n fc:\tmult\ta0,s4\n 100:\tmove\ta2,s0\n 104:\tmove\ta3,s1\n 108:\tmfhi\ta0\n 10c:\tmflo\ta1\n\t...\n 118:\tjal\t0 \n 11c:\tsw\tv1,0(s3)\n 120:\tlw\ta0,8(s3)\n 124:\tmult\ta0,s4\n 128:\tmove\ta2,s0\n 12c:\tmove\ta3,s1\n 130:\tmfhi\ta0\n 134:\tmflo\ta1\n\t...\n 140:\tjal\t0 \n 144:\tsw\tv1,4(s3)\n 148:\tsw\tv1,8(s3)\n 14c:\tlw\tra,60(sp)\n 150:\tlw\ts4,56(sp)\n 154:\tlw\ts3,52(sp)\n 158:\tlw\ts2,48(sp)\n 15c:\tlw\ts1,44(sp)\n 160:\tlw\ts0,40(sp)\n 164:\tjr\tra\n 168:\taddiu\tsp,sp,64\n 16c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dab5be0e70b1fe00/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 *UND*\t00000000 __divdi3\n00000000 g F .text\t0000016c func_80051C80_52880\n00000000 *UND*\t00000000 distance_2d\n00000000 *UND*\t00000000 distance_3d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000028 R_MIPS_26 distance_2d\n00000074 R_MIPS_26 __divdi3\n0000009c R_MIPS_26 __divdi3\n000000a4 R_MIPS_26 .text\n000000bc R_MIPS_26 distance_3d\n000000f0 R_MIPS_26 __divdi3\n00000118 R_MIPS_26 __divdi3\n00000140 R_MIPS_26 __divdi3\n\n\nContents of section .text:\n 0000 27bdffc0 afb30034 00809821 afb40038 '......4...!...8\n 0010 00a0a021 afbf003c afb20030 afb1002c ...!...<...0...,\n 0020 afb00028 8e640000 0c000000 8e650008 ...(.d.......e..\n 0030 00401821 3c020001 3442ffff 0043102a .@.!<...4B...C.*\n 0040 1440001c 00000000 10600018 3c120002 .@.......`..<...\n 0050 8e620000 00520018 00608821 000387c3 .b...R...`.!....\n 0060 02003021 00002010 00002812 00000000 ..0!.. ...(.....\n 0070 00000000 0c000000 02203821 8e640008 ......... 8!.d..\n 0080 00920018 02003021 02203821 00002010 ......0!. 8!.. .\n 0090 00002812 00000000 00000000 0c000000 ..(.............\n 00a0 ae630000 0800002d ae630008 3c020002 .c.....-.c..<...\n 00b0 ae620008 8e640000 8e650004 0c000000 .b...d...e......\n 00c0 8e660008 00401821 10600020 00608821 .f...@.!.`. .`.!\n 00d0 8e620000 00540018 000387c3 02003021 .b...T........0!\n 00e0 00002010 00002812 00000000 00000000 .. ...(.........\n 00f0 0c000000 02203821 8e640004 00940018 ..... 8!.d......\n 0100 02003021 02203821 00002010 00002812 ..0!. 8!.. ...(.\n 0110 00000000 00000000 0c000000 ae630000 .............c..\n 0120 8e640008 00940018 02003021 02203821 .d........0!. 8!\n 0130 00002010 00002812 00000000 00000000 .. ...(.........\n 0140 0c000000 ae630004 ae630008 8fbf003c .....c...c.....<\n 0150 8fb40038 8fb30034 8fb20030 8fb1002c ...8...4...0...,\n 0160 8fb00028 03e00008 27bd0040 00000000 ...(....'..@....\nContents of section .reginfo:\n 0000 a01f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_80051C80_52880' — lift: cannot lift 'func_80051C80_52880': function call 'jal' at 0x28 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-64 */\n/* 4:\tsw\ts3,52(sp) */\n/* 8:\tmove\ts3,a0 */\n/* c:\tsw\ts4,56(sp) */\n/* 10:\tmove\ts4,a1 */\n/* 14:\tsw\tra,60(sp) */\n/* 18:\tsw\ts2,48(sp) */\n/* 1c:\tsw\ts1,44(sp) */\n/* 20:\tsw\ts0,40(sp) */\n/* 24:\tlw\ta0,0(s3) */\n/* 28:\tjal\t0 */\n/* 2c:\tlw\ta1,8(s3) */\n/* 30:\tmove\tv1,v0 */\n/* 34:\tlui\tv0,0x1 */\n/* 38:\tori\tv0,v0,0xffff */\n/* 3c:\tslt\tv0,v0,v1 */\n/* 40:\tbnez\tv0,b4 */\n/* 44:\tnop */\n/* 48:\tbeqz\tv1,ac */\n/* 4c:\tlui\ts2,0x2 */\n/* 50:\tlw\tv0,0(s3) */\n/* 54:\tmult\tv0,s2 */\n/* 58:\tmove\ts1,v1 */\n/* 5c:\tsra\ts0,v1,0x1f */\n/* 60:\tmove\ta2,s0 */\n/* 64:\tmfhi\ta0 */\n/* 68:\tmflo\ta1 */\n/* \t... */\n/* 74:\tjal\t0 */\n/* 78:\tmove\ta3,s1 */\n/* 7c:\tlw\ta0,8(s3) */\n/* 80:\tmult\ta0,s2 */\n/* 84:\tmove\ta2,s0 */\n/* 88:\tmove\ta3,s1 */\n/* 8c:\tmfhi\ta0 */\n/* 90:\tmflo\ta1 */\n/* \t... */\n/* 9c:\tjal\t0 */\n/* a0:\tsw\tv1,0(s3) */\n/* a4:\tj\tb4 */\n/* a8:\tsw\tv1,8(s3) */\n/* ac:\tlui\tv0,0x2 */\n/* b0:\tsw\tv0,8(s3) */\n/* b4:\tlw\ta0,0(s3) */\n/* b8:\tlw\ta1,4(s3) */\n/* bc:\tjal\t0 */\n/* c0:\tlw\ta2,8(s3) */\n/* c4:\tmove\tv1,v0 */\n/* c8:\tbeqz\tv1,14c */\n/* cc:\tmove\ts1,v1 */\n/* d0:\tlw\tv0,0(s3) */\n/* d4:\tmult\tv0,s4 */\n/* d8:\tsra\ts0,v1,0x1f */\n/* dc:\tmove\ta2,s0 */\n/* e0:\tmfhi\ta0 */\n/* e4:\tmflo\ta1 */\n/* \t... */\n/* f0:\tjal\t0 */\n/* f4:\tmove\ta3,s1 */\n/* f8:\tlw\ta0,4(s3) */\n/* fc:\tmult\ta0,s4 */\n/* 100:\tmove\ta2,s0 */\n/* 104:\tmove\ta3,s1 */\n/* 108:\tmfhi\ta0 */\n/* 10c:\tmflo\ta1 */\n/* \t... */\n/* 118:\tjal\t0 */\n/* 11c:\tsw\tv1,0(s3) */\n/* 120:\tlw\ta0,8(s3) */\n/* 124:\tmult\ta0,s4 */\n/* 128:\tmove\ta2,s0 */\n/* 12c:\tmove\ta3,s1 */\n/* 130:\tmfhi\ta0 */\n/* 134:\tmflo\ta1 */\n/* \t... */\n/* 140:\tjal\t0 */\n/* 144:\tsw\tv1,4(s3) */\n/* 148:\tsw\tv1,8(s3) */\n/* 14c:\tlw\tra,60(sp) */\n/* 150:\tlw\ts4,56(sp) */\n/* 154:\tlw\ts3,52(sp) */\n/* 158:\tlw\ts2,48(sp) */\n/* 15c:\tlw\ts1,44(sp) */\n/* 160:\tlw\ts0,40(sp) */\n/* 164:\tjr\tra */\n/* 168:\taddiu\tsp,sp,64 */\n/* 16c:\tnop */\nvoid func_80051C80_52880(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_80051C80_52880': function call 'jal' at 0x28 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":95,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_80051C80_52880': function call 'jal' at 0x28 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u64 __divdi3(s32, s32, s32, s32); /* extern */\ns32 distance_2d(u32, u32); /* extern */\ns32 distance_3d(u32, u32, u32); /* extern */\n\nvoid func_80051C80_52880(void *arg0, s32 arg1) {\n s32 temp_s0;\n s32 temp_s0_2;\n s32 temp_v0;\n s32 temp_v0_2;\n u32 temp_a0;\n u32 temp_a0_2;\n u32 temp_v0_3;\n\n temp_v0 = distance_2d(arg0->unk0, arg0->unk8);\n if (temp_v0 <= 0x1FFFF) {\n if (temp_v0 != 0) {\n temp_s0 = temp_v0 >> 0x1F;\n arg0->unk0 = (u32) __divdi3(arg0->unk0 / 32768, arg0->unk0 * 0x20000, temp_s0, temp_v0);\n arg0->unk8 = (u32) __divdi3(arg0->unk8 / 32768, arg0->unk8 * 0x20000, temp_s0, temp_v0);\n } else {\n arg0->unk8 = 0x20000U;\n }\n }\n temp_v0_2 = distance_3d(arg0->unk0, arg0->unk4, arg0->unk8);\n if (temp_v0_2 != 0) {\n temp_v0_3 = arg0->unk0;\n temp_s0_2 = temp_v0_2 >> 0x1F;\n temp_a0 = arg0->unk4;\n arg0->unk0 = (u32) __divdi3(MULT_HI(temp_v0_3, arg1), temp_v0_3 * arg1, temp_s0_2, temp_v0_2);\n temp_a0_2 = arg0->unk8;\n arg0->unk4 = (u32) __divdi3(MULT_HI(temp_a0, arg1), temp_a0 * arg1, temp_s0_2, temp_v0_2);\n arg0->unk8 = (u32) __divdi3(MULT_HI(temp_a0_2, arg1), temp_a0_2 * arg1, temp_s0_2, temp_v0_2);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":94,"lines":32,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:1839: request for member `unk0' in something not a structure or union","/c.i:1839: request for member `unk8' in something not a structure or union","/c.i:1843: request for member `unk0' in something not a structure or union","/c.i:1844: request for member `unk8' in something not a structure or union","/c.i:1846: request for member `unk8' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_80051C80_52880` — benchmark function snowboardkids2:func_80051C80_52880:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_80051C80_52880\n addiu\t$sp, $sp, -64\n sw\t$s3, 52($sp)\n move\t$s3, $a0\n sw\t$s4, 56($sp)\n move\t$s4, $a1\n sw\t$ra, 60($sp)\n sw\t$s2, 48($sp)\n sw\t$s1, 44($sp)\n sw\t$s0, 40($sp)\n lw\t$a0, 0($s3)\n jal\tdistance_2d\n lw\t$a1, 8($s3)\n move\t$v1, $v0\n lui\t$v0, 0x1\n ori\t$v0, $v0, 0xffff\n slt\t$v0, $v0, $v1\n bnez\t$v0, .Lb4\n nop\n beqz\t$v1, .Lac\n lui\t$s2, 0x2\n lw\t$v0, 0($s3)\n mult\t$v0, $s2\n move\t$s1, $v1\n sra\t$s0, $v1, 0x1f\n move\t$a2, $s0\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n move\t$a3, $s1\n lw\t$a0, 8($s3)\n mult\t$a0, $s2\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 0($s3)\n j\t.Lb4\n sw\t$v1, 8($s3)\n.Lac:\n lui\t$v0, 0x2\n sw\t$v0, 8($s3)\n.Lb4:\n lw\t$a0, 0($s3)\n lw\t$a1, 4($s3)\n jal\tdistance_3d\n lw\t$a2, 8($s3)\n move\t$v1, $v0\n beqz\t$v1, .L14c\n move\t$s1, $v1\n lw\t$v0, 0($s3)\n mult\t$v0, $s4\n sra\t$s0, $v1, 0x1f\n move\t$a2, $s0\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n move\t$a3, $s1\n lw\t$a0, 4($s3)\n mult\t$a0, $s4\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 0($s3)\n lw\t$a0, 8($s3)\n mult\t$a0, $s4\n move\t$a2, $s0\n move\t$a3, $s1\n mfhi\t$a0\n mflo\t$a1\n jal\t__divdi3\n sw\t$v1, 4($s3)\n sw\t$v1, 8($s3)\n.L14c:\n lw\t$ra, 60($sp)\n lw\t$s4, 56($sp)\n lw\t$s3, 52($sp)\n lw\t$s2, 48($sp)\n lw\t$s1, 44($sp)\n lw\t$s0, 40($sp)\n jr\t$ra\n addiu\t$sp, $sp, 64\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_80051C80_52880 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_80051C80_52880` — benchmark function snowboardkids2:func_80051C80_52880:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_80051C80_52880:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-64\n 4:\tsw\ts3,52(sp)\n 8:\tmove\ts3,a0\n c:\tsw\ts4,56(sp)\n 10:\tmove\ts4,a1\n 14:\tsw\tra,60(sp)\n 18:\tsw\ts2,48(sp)\n 1c:\tsw\ts1,44(sp)\n 20:\tsw\ts0,40(sp)\n 24:\tlw\ta0,0(s3)\n 28:\tjal\t0 \n 2c:\tlw\ta1,8(s3)\n 30:\tmove\tv1,v0\n 34:\tlui\tv0,0x1\n 38:\tori\tv0,v0,0xffff\n 3c:\tslt\tv0,v0,v1\n 40:\tbnez\tv0,b4 \n 44:\tnop\n 48:\tbeqz\tv1,ac \n 4c:\tlui\ts2,0x2\n 50:\tlw\tv0,0(s3)\n 54:\tmult\tv0,s2\n 58:\tmove\ts1,v1\n 5c:\tsra\ts0,v1,0x1f\n 60:\tmove\ta2,s0\n 64:\tmfhi\ta0\n 68:\tmflo\ta1\n\t...\n 74:\tjal\t0 \n 78:\tmove\ta3,s1\n 7c:\tlw\ta0,8(s3)\n 80:\tmult\ta0,s2\n 84:\tmove\ta2,s0\n 88:\tmove\ta3,s1\n 8c:\tmfhi\ta0\n 90:\tmflo\ta1\n\t...\n 9c:\tjal\t0 \n a0:\tsw\tv1,0(s3)\n a4:\tj\tb4 \n a8:\tsw\tv1,8(s3)\n ac:\tlui\tv0,0x2\n b0:\tsw\tv0,8(s3)\n b4:\tlw\ta0,0(s3)\n b8:\tlw\ta1,4(s3)\n bc:\tjal\t0 \n c0:\tlw\ta2,8(s3)\n c4:\tmove\tv1,v0\n c8:\tbeqz\tv1,14c \n cc:\tmove\ts1,v1\n d0:\tlw\tv0,0(s3)\n d4:\tmult\tv0,s4\n d8:\tsra\ts0,v1,0x1f\n dc:\tmove\ta2,s0\n e0:\tmfhi\ta0\n e4:\tmflo\ta1\n\t...\n f0:\tjal\t0 \n f4:\tmove\ta3,s1\n f8:\tlw\ta0,4(s3)\n fc:\tmult\ta0,s4\n 100:\tmove\ta2,s0\n 104:\tmove\ta3,s1\n 108:\tmfhi\ta0\n 10c:\tmflo\ta1\n\t...\n 118:\tjal\t0 \n 11c:\tsw\tv1,0(s3)\n 120:\tlw\ta0,8(s3)\n 124:\tmult\ta0,s4\n 128:\tmove\ta2,s0\n 12c:\tmove\ta3,s1\n 130:\tmfhi\ta0\n 134:\tmflo\ta1\n\t...\n 140:\tjal\t0 \n 144:\tsw\tv1,4(s3)\n 148:\tsw\tv1,8(s3)\n 14c:\tlw\tra,60(sp)\n 150:\tlw\ts4,56(sp)\n 154:\tlw\ts3,52(sp)\n 158:\tlw\ts2,48(sp)\n 15c:\tlw\ts1,44(sp)\n 160:\tlw\ts0,40(sp)\n 164:\tjr\tra\n 168:\taddiu\tsp,sp,64\n 16c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-dab5be0e70b1fe00/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 *UND*\t00000000 __divdi3\n00000000 g F .text\t0000016c func_80051C80_52880\n00000000 *UND*\t00000000 distance_2d\n00000000 *UND*\t00000000 distance_3d\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000028 R_MIPS_26 distance_2d\n00000074 R_MIPS_26 __divdi3\n0000009c R_MIPS_26 __divdi3\n000000a4 R_MIPS_26 .text\n000000bc R_MIPS_26 distance_3d\n000000f0 R_MIPS_26 __divdi3\n00000118 R_MIPS_26 __divdi3\n00000140 R_MIPS_26 __divdi3\n\n\nContents of section .text:\n 0000 27bdffc0 afb30034 00809821 afb40038 '......4...!...8\n 0010 00a0a021 afbf003c afb20030 afb1002c ...!...<...0...,\n 0020 afb00028 8e640000 0c000000 8e650008 ...(.d.......e..\n 0030 00401821 3c020001 3442ffff 0043102a .@.!<...4B...C.*\n 0040 1440001c 00000000 10600018 3c120002 .@.......`..<...\n 0050 8e620000 00520018 00608821 000387c3 .b...R...`.!....\n 0060 02003021 00002010 00002812 00000000 ..0!.. ...(.....\n 0070 00000000 0c000000 02203821 8e640008 ......... 8!.d..\n 0080 00920018 02003021 02203821 00002010 ......0!. 8!.. .\n 0090 00002812 00000000 00000000 0c000000 ..(.............\n 00a0 ae630000 0800002d ae630008 3c020002 .c.....-.c..<...\n 00b0 ae620008 8e640000 8e650004 0c000000 .b...d...e......\n 00c0 8e660008 00401821 10600020 00608821 .f...@.!.`. .`.!\n 00d0 8e620000 00540018 000387c3 02003021 .b...T........0!\n 00e0 00002010 00002812 00000000 00000000 .. ...(.........\n 00f0 0c000000 02203821 8e640004 00940018 ..... 8!.d......\n 0100 02003021 02203821 00002010 00002812 ..0!. 8!.. ...(.\n 0110 00000000 00000000 0c000000 ae630000 .............c..\n 0120 8e640008 00940018 02003021 02203821 .d........0!. 8!\n 0130 00002010 00002812 00000000 00000000 .. ...(.........\n 0140 0c000000 ae630004 ae630008 8fbf003c .....c...c.....<\n 0150 8fb40038 8fb30034 8fb20030 8fb1002c ...8...4...0...,\n 0160 8fb00028 03e00008 27bd0040 00000000 ...(....'..@....\nContents of section .reginfo:\n 0000 a01f00fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_80051C80_52880 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc","sym":"func_800B0DC0_1DCF60","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["pointer","struct","cast","memory"],"loc":3,"refSource":"s32 func_800B0DC0_1DCF60(TableHeader *table) {\n return *(s32 *)(table->countOffset + (s32)table);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1DCF60.c#L14-L16","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,4(a0)\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tlw\tv0,0(v0)\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-b8ee1bad664b02b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_800B0DC0_1DCF60\n\n\nContents of section .text:\n 0000 8c820004 00441021 03e00008 8c420000 .....D.!.....B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"s32 func_800B0DC0_1DCF60(s32 * a0) {\n return *(a0[1] + a0);\n}\n","score":1,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 func_800B0DC0_1DCF60(void *arg0) {\n return *(arg0->unk4 + arg0);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:1828: request for member `unk4' in something not a structure or union"]},"note":"src/1DCF60.c: reads a count field via base-relative offset; pure leaf","gapSize":{"decompiler":"asmlift","score":1,"maxScore":5,"ratio":0.2,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B0DC0_1DCF60` — benchmark function snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B0DC0_1DCF60\n lw\t$v0, 4($a0)\n addu\t$v0, $v0, $a0\n jr\t$ra\n lw\t$v0, 0($v0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B0DC0_1DCF60 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B0DC0_1DCF60` — benchmark function snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B0DC0_1DCF60:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,4(a0)\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tlw\tv0,0(v0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-b8ee1bad664b02b2/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 func_800B0DC0_1DCF60\n\n\nContents of section .text:\n 0000 8c820004 00441021 03e00008 8c420000 .....D.!.....B..\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B0DC0_1DCF60 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc","sym":"func_800B4B30_1E1BE0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","call"],"loc":11,"refSource":"void func_800B4B30_1E1BE0(s16 arg0, s16 arg1, s16 arg2, s16 arg3) {\n s16 temp;\n\n if (arg3 <= 0) {\n temp = func_800B4AFC_1E1BAC(arg0);\n func_80058360_58F60(temp, arg1, arg2 + 0x80, 0);\n } else {\n temp = func_800B4AFC_1E1BAC(arg0);\n func_80057DF0_589F0(temp, arg1, arg2 + 0x80, 0, arg3);\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E1BA0.c#L40-L50","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts1,28(sp)\n 8:\tmove\ts1,a1\n c:\tsw\ts2,32(sp)\n 10:\tmove\ts2,a2\n 14:\tsll\ta3,a3,0x10\n 18:\tsw\ts0,24(sp)\n 1c:\tsra\ts0,a3,0x10\n 20:\tbgtz\ts0,60 \n 24:\tsw\tra,36(sp)\n 28:\tsll\ta0,a0,0x10\n 2c:\tjal\t0 \n 30:\tsra\ta0,a0,0x10\n 34:\tsll\tv0,v0,0x10\n 38:\tsra\ta0,v0,0x10\n 3c:\tsll\ta1,s1,0x10\n 40:\tsra\ta1,a1,0x10\n 44:\tsll\ta2,s2,0x10\n 48:\tsra\ta2,a2,0x10\n 4c:\taddiu\ta2,a2,128\n 50:\tjal\t0 \n 54:\tmove\ta3,zero\n 58:\tj\t94 \n 5c:\tnop\n 60:\tsll\ta0,a0,0x10\n 64:\tjal\t0 \n 68:\tsra\ta0,a0,0x10\n 6c:\tsw\ts0,16(sp)\n 70:\tsll\tv0,v0,0x10\n 74:\tsra\ta0,v0,0x10\n 78:\tsll\ta1,s1,0x10\n 7c:\tsra\ta1,a1,0x10\n 80:\tsll\ta2,s2,0x10\n 84:\tsra\ta2,a2,0x10\n 88:\taddiu\ta2,a2,128\n 8c:\tjal\t0 \n 90:\tmove\ta3,zero\n 94:\tlw\tra,36(sp)\n 98:\tlw\ts2,32(sp)\n 9c:\tlw\ts1,28(sp)\n a0:\tlw\ts0,24(sp)\n a4:\tjr\tra\n a8:\taddiu\tsp,sp,40\n ac:\tnop\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-7a362db8d24a.i.gz","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-12749b0eb3179cef/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000ac func_800B4B30_1E1BE0\n00000000 *UND*\t00000000 func_800B4AFC_1E1BAC\n00000000 *UND*\t00000000 func_80058360_58F60\n00000000 *UND*\t00000000 func_80057DF0_589F0\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 func_800B4AFC_1E1BAC\n00000050 R_MIPS_26 func_80058360_58F60\n00000058 R_MIPS_26 .text\n00000064 R_MIPS_26 func_800B4AFC_1E1BAC\n0000008c R_MIPS_26 func_80057DF0_589F0\n\n\nContents of section .text:\n 0000 27bdffd8 afb1001c 00a08821 afb20020 '..........!... \n 0010 00c09021 00073c00 afb00018 00078403 ...!..<.........\n 0020 1e00000f afbf0024 00042400 0c000000 .......$..$.....\n 0030 00042403 00021400 00022403 00112c00 ..$.......$...,.\n 0040 00052c03 00123400 00063403 24c60080 ..,...4...4.$...\n 0050 0c000000 00003821 08000025 00000000 ......8!...%....\n 0060 00042400 0c000000 00042403 afb00010 ..$.......$.....\n 0070 00021400 00022403 00112c00 00052c03 ......$...,...,.\n 0080 00123400 00063403 24c60080 0c000000 ..4...4.$.......\n 0090 00003821 8fbf0024 8fb20020 8fb1001c ..8!...$... ....\n 00a0 8fb00018 03e00008 27bd0028 00000000 ........'..(....\nContents of section .reginfo:\n 0000 a00700f4 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800B4B30_1E1BE0' — lift: cannot lift 'func_800B4B30_1E1BE0': function call 'jal' at 0x2c — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-40 */\n/* 4:\tsw\ts1,28(sp) */\n/* 8:\tmove\ts1,a1 */\n/* c:\tsw\ts2,32(sp) */\n/* 10:\tmove\ts2,a2 */\n/* 14:\tsll\ta3,a3,0x10 */\n/* 18:\tsw\ts0,24(sp) */\n/* 1c:\tsra\ts0,a3,0x10 */\n/* 20:\tbgtz\ts0,60 */\n/* 24:\tsw\tra,36(sp) */\n/* 28:\tsll\ta0,a0,0x10 */\n/* 2c:\tjal\t0 */\n/* 30:\tsra\ta0,a0,0x10 */\n/* 34:\tsll\tv0,v0,0x10 */\n/* 38:\tsra\ta0,v0,0x10 */\n/* 3c:\tsll\ta1,s1,0x10 */\n/* 40:\tsra\ta1,a1,0x10 */\n/* 44:\tsll\ta2,s2,0x10 */\n/* 48:\tsra\ta2,a2,0x10 */\n/* 4c:\taddiu\ta2,a2,128 */\n/* 50:\tjal\t0 */\n/* 54:\tmove\ta3,zero */\n/* 58:\tj\t94 */\n/* 5c:\tnop */\n/* 60:\tsll\ta0,a0,0x10 */\n/* 64:\tjal\t0 */\n/* 68:\tsra\ta0,a0,0x10 */\n/* 6c:\tsw\ts0,16(sp) */\n/* 70:\tsll\tv0,v0,0x10 */\n/* 74:\tsra\ta0,v0,0x10 */\n/* 78:\tsll\ta1,s1,0x10 */\n/* 7c:\tsra\ta1,a1,0x10 */\n/* 80:\tsll\ta2,s2,0x10 */\n/* 84:\tsra\ta2,a2,0x10 */\n/* 88:\taddiu\ta2,a2,128 */\n/* 8c:\tjal\t0 */\n/* 90:\tmove\ta3,zero */\n/* 94:\tlw\tra,36(sp) */\n/* 98:\tlw\ts2,32(sp) */\n/* 9c:\tlw\ts1,28(sp) */\n/* a0:\tlw\ts0,24(sp) */\n/* a4:\tjr\tra */\n/* a8:\taddiu\tsp,sp,40 */\n/* ac:\tnop */\nvoid func_800B4B30_1E1BE0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B4B30_1E1BE0': function call 'jal' at 0x2c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":52,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B4B30_1E1BE0': function call 'jal' at 0x2c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s16 func_800B4AFC_1E1BAC(s16, s32); /* extern */\n\nvoid func_800B4B30_1E1BE0(s16 arg0, s16 arg1, s16 arg2, s16 arg3) {\n s32 temp_a3;\n\n temp_a3 = arg3 << 0x10;\n if (arg3 <= 0) {\n func_80058360_58F60((s32) func_800B4AFC_1E1BAC(arg0, temp_a3), (s32) arg1, arg2 + 0x80, 0);\n return;\n }\n func_80057DF0_589F0((s32) func_800B4AFC_1E1BAC(arg0, temp_a3), (s32) arg1, arg2 + 0x80, 0, (s32) arg3);\n}\n","score":1,"maxScore":44,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":94,"lines":10,"gotos":0,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":1,"maxScore":44,"ratio":0.022727272727272728,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B4B30_1E1BE0` — benchmark function snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B4B30_1E1BE0\n addiu\t$sp, $sp, -40\n sw\t$s1, 28($sp)\n move\t$s1, $a1\n sw\t$s2, 32($sp)\n move\t$s2, $a2\n sll\t$a3, $a3, 0x10\n sw\t$s0, 24($sp)\n sra\t$s0, $a3, 0x10\n bgtz\t$s0, .L60\n sw\t$ra, 36($sp)\n sll\t$a0, $a0, 0x10\n jal\tfunc_800B4AFC_1E1BAC\n sra\t$a0, $a0, 0x10\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n sll\t$a1, $s1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$a2, $s2, 0x10\n sra\t$a2, $a2, 0x10\n addiu\t$a2, $a2, 128\n jal\tfunc_80058360_58F60\n move\t$a3, $zero\n j\t.L94\n nop\n.L60:\n sll\t$a0, $a0, 0x10\n jal\tfunc_800B4AFC_1E1BAC\n sra\t$a0, $a0, 0x10\n sw\t$s0, 16($sp)\n sll\t$v0, $v0, 0x10\n sra\t$a0, $v0, 0x10\n sll\t$a1, $s1, 0x10\n sra\t$a1, $a1, 0x10\n sll\t$a2, $s2, 0x10\n sra\t$a2, $a2, 0x10\n addiu\t$a2, $a2, 128\n jal\tfunc_80057DF0_589F0\n move\t$a3, $zero\n.L94:\n lw\t$ra, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 40\n nop\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-7a362db8d24a.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid func_800B4B30_1E1BE0(s16 arg0, s16 arg1, s16 arg2, s16 arg3);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B4B30_1E1BE0 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B4B30_1E1BE0` — benchmark function snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B4B30_1E1BE0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-40\n 4:\tsw\ts1,28(sp)\n 8:\tmove\ts1,a1\n c:\tsw\ts2,32(sp)\n 10:\tmove\ts2,a2\n 14:\tsll\ta3,a3,0x10\n 18:\tsw\ts0,24(sp)\n 1c:\tsra\ts0,a3,0x10\n 20:\tbgtz\ts0,60 \n 24:\tsw\tra,36(sp)\n 28:\tsll\ta0,a0,0x10\n 2c:\tjal\t0 \n 30:\tsra\ta0,a0,0x10\n 34:\tsll\tv0,v0,0x10\n 38:\tsra\ta0,v0,0x10\n 3c:\tsll\ta1,s1,0x10\n 40:\tsra\ta1,a1,0x10\n 44:\tsll\ta2,s2,0x10\n 48:\tsra\ta2,a2,0x10\n 4c:\taddiu\ta2,a2,128\n 50:\tjal\t0 \n 54:\tmove\ta3,zero\n 58:\tj\t94 \n 5c:\tnop\n 60:\tsll\ta0,a0,0x10\n 64:\tjal\t0 \n 68:\tsra\ta0,a0,0x10\n 6c:\tsw\ts0,16(sp)\n 70:\tsll\tv0,v0,0x10\n 74:\tsra\ta0,v0,0x10\n 78:\tsll\ta1,s1,0x10\n 7c:\tsra\ta1,a1,0x10\n 80:\tsll\ta2,s2,0x10\n 84:\tsra\ta2,a2,0x10\n 88:\taddiu\ta2,a2,128\n 8c:\tjal\t0 \n 90:\tmove\ta3,zero\n 94:\tlw\tra,36(sp)\n 98:\tlw\ts2,32(sp)\n 9c:\tlw\ts1,28(sp)\n a0:\tlw\ts0,24(sp)\n a4:\tjr\tra\n a8:\taddiu\tsp,sp,40\n ac:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-12749b0eb3179cef/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000ac func_800B4B30_1E1BE0\n00000000 *UND*\t00000000 func_800B4AFC_1E1BAC\n00000000 *UND*\t00000000 func_80058360_58F60\n00000000 *UND*\t00000000 func_80057DF0_589F0\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 func_800B4AFC_1E1BAC\n00000050 R_MIPS_26 func_80058360_58F60\n00000058 R_MIPS_26 .text\n00000064 R_MIPS_26 func_800B4AFC_1E1BAC\n0000008c R_MIPS_26 func_80057DF0_589F0\n\n\nContents of section .text:\n 0000 27bdffd8 afb1001c 00a08821 afb20020 '..........!... \n 0010 00c09021 00073c00 afb00018 00078403 ...!..<.........\n 0020 1e00000f afbf0024 00042400 0c000000 .......$..$.....\n 0030 00042403 00021400 00022403 00112c00 ..$.......$...,.\n 0040 00052c03 00123400 00063403 24c60080 ..,...4...4.$...\n 0050 0c000000 00003821 08000025 00000000 ......8!...%....\n 0060 00042400 0c000000 00042403 afb00010 ..$.......$.....\n 0070 00021400 00022403 00112c00 00052c03 ......$...,...,.\n 0080 00123400 00063403 24c60080 0c000000 ..4...4.$.......\n 0090 00003821 8fbf0024 8fb20020 8fb1001c ..8!...$... ....\n 00a0 8fb00018 03e00008 27bd0028 00000000 ........'..(....\nContents of section .reginfo:\n 0000 a00700f4 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B4B30_1E1BE0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc","sym":"func_800B5B7C_1E2C2C","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct"],"loc":33,"refSource":"void func_800B5B7C_1E2C2C(func_800B5E64_1E2F14_arg0 *arg0, u16 arg1) {\n arg0->unk20 = 0;\n arg0->unk22 = 0;\n arg0->unk24 = 0;\n arg0->unk26 = 0;\n arg0->unk28 = 0;\n arg0->unk2A = 0;\n arg0->unk2C = 0;\n arg0->unk2E = 0;\n arg0->unk30 = 0;\n arg0->unk32 = 0;\n arg0->unk34 = 0;\n arg0->unk38 = 0;\n arg0->unk3C = 0;\n arg0->unk40 = 0;\n arg0->unk44 = 0;\n arg0->unk48 = 0;\n arg0->unk4C = 0;\n arg0->unk50 = 0;\n arg0->unk54 = 0;\n arg0->unk58 = 0;\n arg0->unk5A = 0;\n arg0->unk5C = 0;\n arg0->unk5E = 0;\n arg0->unk60 = 0;\n arg0->unk62 = 0;\n arg0->unk64 = 0;\n arg0->unk68 = 0;\n arg0->unk6C = 0;\n arg0->unk6E = arg1;\n arg0->unk70 = 0;\n arg0->unk71 = 0;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E2BE0.c#L21-L53","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsh\tzero,32(a0)\n 4:\tsh\tzero,34(a0)\n 8:\tsh\tzero,36(a0)\n c:\tsh\tzero,38(a0)\n 10:\tsh\tzero,40(a0)\n 14:\tsh\tzero,42(a0)\n 18:\tsh\tzero,44(a0)\n 1c:\tsh\tzero,46(a0)\n 20:\tsh\tzero,48(a0)\n 24:\tsh\tzero,50(a0)\n 28:\tsw\tzero,52(a0)\n 2c:\tsw\tzero,56(a0)\n 30:\tsw\tzero,60(a0)\n 34:\tsw\tzero,64(a0)\n 38:\tsw\tzero,68(a0)\n 3c:\tsw\tzero,72(a0)\n 40:\tsw\tzero,76(a0)\n 44:\tsw\tzero,80(a0)\n 48:\tsw\tzero,84(a0)\n 4c:\tsh\tzero,88(a0)\n 50:\tsh\tzero,90(a0)\n 54:\tsh\tzero,92(a0)\n 58:\tsh\tzero,94(a0)\n 5c:\tsh\tzero,96(a0)\n 60:\tsh\tzero,98(a0)\n 64:\tsw\tzero,100(a0)\n 68:\tsw\tzero,104(a0)\n 6c:\tsh\tzero,108(a0)\n 70:\tsh\ta1,110(a0)\n 74:\tsb\tzero,112(a0)\n 78:\tjr\tra\n 7c:\tsb\tzero,113(a0)\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0fd05b0dfbce2e59/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000080 func_800B5B7C_1E2C2C\n\n\nContents of section .text:\n 0000 a4800020 a4800022 a4800024 a4800026 ... ...\"...$...&\n 0010 a4800028 a480002a a480002c a480002e ...(...*...,....\n 0020 a4800030 a4800032 ac800034 ac800038 ...0...2...4...8\n 0030 ac80003c ac800040 ac800044 ac800048 ...<...@...D...H\n 0040 ac80004c ac800050 ac800054 a4800058 ...L...P...T...X\n 0050 a480005a a480005c a480005e a4800060 ...Z...\\...^...`\n 0060 a4800062 ac800064 ac800068 a480006c ...b...d...h...l\n 0070 a485006e a0800070 03e00008 a0800071 ...n...p.......q\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"struct Struct0 { u8 _pad0[32]; u16 field_32; u16 field_34; u16 field_36; u16 field_38; u16 field_40; u16 field_42; u16 field_44; u16 field_46; u16 field_48; u16 field_50; s32 field_52; s32 field_56; s32 field_60; s32 field_64; s32 field_68; s32 field_72; s32 field_76; s32 field_80; s32 field_84; u16 field_88; u16 field_90; u16 field_92; u16 field_94; u16 field_96; u16 field_98; s32 field_100; s32 field_104; u16 field_108; u16 field_110; u8 field_112; u8 field_113; };\ns32 func_800B5B7C_1E2C2C(struct Struct0 * a0, u32 a1) {\n a0->field_32 = 0;\n a0->field_34 = 0;\n a0->field_36 = 0;\n a0->field_38 = 0;\n a0->field_40 = 0;\n a0->field_42 = 0;\n a0->field_44 = 0;\n a0->field_46 = 0;\n a0->field_48 = 0;\n a0->field_50 = 0;\n a0->field_52 = 0;\n a0->field_56 = 0;\n a0->field_60 = 0;\n a0->field_64 = 0;\n a0->field_68 = 0;\n a0->field_72 = 0;\n a0->field_76 = 0;\n a0->field_80 = 0;\n a0->field_84 = 0;\n a0->field_88 = 0;\n a0->field_90 = 0;\n a0->field_92 = 0;\n a0->field_94 = 0;\n a0->field_96 = 0;\n a0->field_98 = 0;\n a0->field_100 = 0;\n a0->field_104 = 0;\n a0->field_108 = 0;\n a0->field_110 = a1;\n a0->field_112 = 0;\n a0->field_113 = 0;\n return;\n}\n","score":0,"maxScore":32,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":35,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_800B5B7C_1E2C2C(void *arg0, s16 arg1) {\n arg0->unk20 = 0;\n arg0->unk22 = 0;\n arg0->unk24 = 0;\n arg0->unk26 = 0;\n arg0->unk28 = 0;\n arg0->unk2A = 0;\n arg0->unk2C = 0;\n arg0->unk2E = 0;\n arg0->unk30 = 0;\n arg0->unk32 = 0;\n arg0->unk34 = 0;\n arg0->unk38 = 0;\n arg0->unk3C = 0;\n arg0->unk40 = 0;\n arg0->unk44 = 0;\n arg0->unk48 = 0;\n arg0->unk4C = 0;\n arg0->unk50 = 0;\n arg0->unk54 = 0;\n arg0->unk58 = 0;\n arg0->unk5A = 0;\n arg0->unk5C = 0;\n arg0->unk5E = 0;\n arg0->unk60 = 0;\n arg0->unk62 = 0;\n arg0->unk64 = 0;\n arg0->unk68 = 0;\n arg0->unk6C = 0;\n arg0->unk6E = arg1;\n arg0->unk70 = 0;\n arg0->unk71 = 0;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":33,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:1879: request for member `unk20' in something not a structure or union","/c.i:1880: request for member `unk22' in something not a structure or union","/c.i:1881: request for member `unk24' in something not a structure or union","/c.i:1882: request for member `unk26' in something not a structure or union","/c.i:1883: request for member `unk28' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B5B7C_1E2C2C` — benchmark function snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B5B7C_1E2C2C\n sh\t$zero, 32($a0)\n sh\t$zero, 34($a0)\n sh\t$zero, 36($a0)\n sh\t$zero, 38($a0)\n sh\t$zero, 40($a0)\n sh\t$zero, 42($a0)\n sh\t$zero, 44($a0)\n sh\t$zero, 46($a0)\n sh\t$zero, 48($a0)\n sh\t$zero, 50($a0)\n sw\t$zero, 52($a0)\n sw\t$zero, 56($a0)\n sw\t$zero, 60($a0)\n sw\t$zero, 64($a0)\n sw\t$zero, 68($a0)\n sw\t$zero, 72($a0)\n sw\t$zero, 76($a0)\n sw\t$zero, 80($a0)\n sw\t$zero, 84($a0)\n sh\t$zero, 88($a0)\n sh\t$zero, 90($a0)\n sh\t$zero, 92($a0)\n sh\t$zero, 94($a0)\n sh\t$zero, 96($a0)\n sh\t$zero, 98($a0)\n sw\t$zero, 100($a0)\n sw\t$zero, 104($a0)\n sh\t$zero, 108($a0)\n sh\t$a1, 110($a0)\n sb\t$zero, 112($a0)\n jr\t$ra\n sb\t$zero, 113($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B5B7C_1E2C2C # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B5B7C_1E2C2C` — benchmark function snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B5B7C_1E2C2C:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsh\tzero,32(a0)\n 4:\tsh\tzero,34(a0)\n 8:\tsh\tzero,36(a0)\n c:\tsh\tzero,38(a0)\n 10:\tsh\tzero,40(a0)\n 14:\tsh\tzero,42(a0)\n 18:\tsh\tzero,44(a0)\n 1c:\tsh\tzero,46(a0)\n 20:\tsh\tzero,48(a0)\n 24:\tsh\tzero,50(a0)\n 28:\tsw\tzero,52(a0)\n 2c:\tsw\tzero,56(a0)\n 30:\tsw\tzero,60(a0)\n 34:\tsw\tzero,64(a0)\n 38:\tsw\tzero,68(a0)\n 3c:\tsw\tzero,72(a0)\n 40:\tsw\tzero,76(a0)\n 44:\tsw\tzero,80(a0)\n 48:\tsw\tzero,84(a0)\n 4c:\tsh\tzero,88(a0)\n 50:\tsh\tzero,90(a0)\n 54:\tsh\tzero,92(a0)\n 58:\tsh\tzero,94(a0)\n 5c:\tsh\tzero,96(a0)\n 60:\tsh\tzero,98(a0)\n 64:\tsw\tzero,100(a0)\n 68:\tsw\tzero,104(a0)\n 6c:\tsh\tzero,108(a0)\n 70:\tsh\ta1,110(a0)\n 74:\tsb\tzero,112(a0)\n 78:\tjr\tra\n 7c:\tsb\tzero,113(a0)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-0fd05b0dfbce2e59/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000080 func_800B5B7C_1E2C2C\n\n\nContents of section .text:\n 0000 a4800020 a4800022 a4800024 a4800026 ... ...\"...$...&\n 0010 a4800028 a480002a a480002c a480002e ...(...*...,....\n 0020 a4800030 a4800032 ac800034 ac800038 ...0...2...4...8\n 0030 ac80003c ac800040 ac800044 ac800048 ...<...@...D...H\n 0040 ac80004c ac800050 ac800054 a4800058 ...L...P...T...X\n 0050 a480005a a480005c a480005e a4800060 ...Z...\\...^...`\n 0060 a4800062 ac800064 ac800068 a480006c ...b...d...h...l\n 0070 a485006e a0800070 03e00008 a0800071 ...n...p.......q\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B5B7C_1E2C2C # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc","sym":"func_800B68F4_1E39A4","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct"],"loc":8,"refSource":"void func_800B68F4_1E39A4(unk_func_800B68F4_1E39A4 *arg0, s32 arg1, s32 arg2, s32 arg3) {\n arg0->unk60 = arg1;\n arg0->unk54 = arg1;\n arg0->unk64 = arg2;\n arg0->unk58 = arg2;\n arg0->unk68 = arg3;\n arg0->unk5C = arg3;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L134-L141","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,96(a0)\n 4:\tsw\ta1,84(a0)\n 8:\tsw\ta2,100(a0)\n c:\tsw\ta2,88(a0)\n 10:\tsw\ta3,104(a0)\n 14:\tjr\tra\n 18:\tsw\ta3,92(a0)\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-025493b1a49c21ff/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_800B68F4_1E39A4\n\n\nContents of section .text:\n 0000 ac850060 ac850054 ac860064 ac860058 ...`...T...d...X\n 0010 ac870068 03e00008 ac87005c 00000000 ...h.......\\....\nContents of section .reginfo:\n 0000 800000f0 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"match","source":"s32 func_800B68F4_1E39A4(s32 * a0, u32 a1, u32 a2, u32 a3) {\n a0[24] = a1;\n a0[21] = a1;\n a0[25] = a2;\n a0[22] = a2;\n a0[26] = a3;\n a0[23] = a3;\n return;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_800B68F4_1E39A4(void *arg0, s32 arg1, s32 arg2, s32 arg3) {\n arg0->unk60 = arg1;\n arg0->unk54 = arg1;\n arg0->unk64 = arg2;\n arg0->unk58 = arg2;\n arg0->unk68 = arg3;\n arg0->unk5C = arg3;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:3444: request for member `unk60' in something not a structure or union","/c.i:3445: request for member `unk54' in something not a structure or union","/c.i:3446: request for member `unk64' in something not a structure or union","/c.i:3447: request for member `unk58' in something not a structure or union","/c.i:3448: request for member `unk68' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B68F4_1E39A4` — benchmark function snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B68F4_1E39A4\n sw\t$a1, 96($a0)\n sw\t$a1, 84($a0)\n sw\t$a2, 100($a0)\n sw\t$a2, 88($a0)\n sw\t$a3, 104($a0)\n jr\t$ra\n sw\t$a3, 92($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B68F4_1E39A4 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B68F4_1E39A4` — benchmark function snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B68F4_1E39A4:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,96(a0)\n 4:\tsw\ta1,84(a0)\n 8:\tsw\ta2,100(a0)\n c:\tsw\ta2,88(a0)\n 10:\tsw\ta3,104(a0)\n 14:\tjr\tra\n 18:\tsw\ta3,92(a0)\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-025493b1a49c21ff/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c func_800B68F4_1E39A4\n\n\nContents of section .text:\n 0000 ac850060 ac850054 ac860064 ac860058 ...`...T...d...X\n 0010 ac870068 03e00008 ac87005c 00000000 ...h.......\\....\nContents of section .reginfo:\n 0000 800000f0 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B68F4_1E39A4 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc","sym":"func_800B7620_1E46D0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","bitwise","branch","call"],"loc":31,"refSource":"void func_800B7620_1E46D0(CutsceneSlotData *arg0, s32 arg1, s16 arg2, s16 arg3) {\n s32 temp_a0;\n s32 temp_v0;\n s32 temp_v1;\n s32 var_v0;\n s32 var_v1;\n\n arg0->unk0.Two = 6;\n arg0->unk94 = arg1;\n arg0->unk92 = arg3;\n arg0->unk84 = arg2;\n arg0->unk86 = arg2;\n temp_a0 = ((s16)atan2Fixed(arg0->unk20_u.unk20_s32, arg0->unk2C) + 0x1000) & 0x1FFF;\n arg0->unk9C_u.unk9C_s32 = temp_a0;\n temp_v1 = approximateCos(temp_a0) << 2;\n if (temp_v1 == 0) {\n var_v1 = (arg0->unk20_u.unk20_s32 << 8) / ((approximateSin(arg0->unk9C_u.s.unk9E) << 2) >> 8);\n var_v1 = (var_v1 > 0) ? var_v1 : -var_v1;\n arg0->unk98 = var_v1;\n } else {\n var_v0 = (arg0->unk2C << 8) / (temp_v1 >> 8);\n var_v0 = (var_v0 > 0) ? var_v0 : -var_v0;\n arg0->unk98 = var_v0;\n }\n temp_v0 = arg0->unk94;\n if (temp_v0 > 0) {\n arg0->unk7A = (arg0->unk9C_u.unk9C_s32 + 0x800) & 0x1FFF;\n } else if (temp_v0 < 0) {\n arg0->unk7A = (arg0->unk9C_u.unk9C_s32 - 0x800) & 0x1FFF;\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L576-L606","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tlw\ta0,36(s0)\n 14:\tsw\ta1,148(s0)\n 18:\tlw\ta1,44(s0)\n 1c:\tli\tv0,6\n 20:\tsb\tv0,0(s0)\n 24:\tsh\ta3,146(s0)\n 28:\tsh\ta2,132(s0)\n 2c:\tjal\t0 \n 30:\tsh\ta2,134(s0)\n 34:\tsll\ta0,v0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\taddiu\ta0,a0,4096\n 40:\tandi\ta0,a0,0x1fff\n 44:\tjal\t0 \n 48:\tsw\ta0,156(s0)\n 4c:\tsll\tv1,v0,0x2\n 50:\tbnez\tv1,b8 \n 54:\tsra\tv1,v1,0x8\n 58:\tlh\ta0,158(s0)\n 5c:\tjal\t0 \n 60:\tnop\n 64:\tlw\tv1,36(s0)\n 68:\tsll\tv0,v0,0x2\n 6c:\tsra\tv0,v0,0x8\n 70:\tsll\tv1,v1,0x8\n 74:\tdiv\tzero,v1,v0\n 78:\tbnez\tv0,84 \n 7c:\tnop\n 80:\tbreak\t0x7\n 84:\tli\tat,-1\n 88:\tbne\tv0,at,9c \n 8c:\tlui\tat,0x8000\n 90:\tbne\tv1,at,9c \n 94:\tnop\n 98:\tbreak\t0x6\n 9c:\tmflo\tv1\n\t...\n a8:\tbltzl\tv1,b0 \n ac:\tnegu\tv1,v1\n b0:\tj\t100 \n b4:\tsw\tv1,152(s0)\n b8:\tlw\tv0,44(s0)\n bc:\tsll\tv0,v0,0x8\n c0:\tdiv\tzero,v0,v1\n c4:\tbnez\tv1,d0 \n c8:\tnop\n cc:\tbreak\t0x7\n d0:\tli\tat,-1\n d4:\tbne\tv1,at,e8 \n d8:\tlui\tat,0x8000\n dc:\tbne\tv0,at,e8 \n e0:\tnop\n e4:\tbreak\t0x6\n e8:\tmflo\tv0\n\t...\n f4:\tbltzl\tv0,fc \n f8:\tnegu\tv0,v0\n fc:\tsw\tv0,152(s0)\n 100:\tlw\tv0,148(s0)\n 104:\tblez\tv0,118 \n 108:\tnop\n 10c:\tlw\tv0,156(s0)\n 110:\tj\t128 \n 114:\taddiu\tv0,v0,2048\n 118:\tbgez\tv0,130 \n 11c:\tnop\n 120:\tlw\tv0,156(s0)\n 124:\taddiu\tv0,v0,-2048\n 128:\tandi\tv0,v0,0x1fff\n 12c:\tsh\tv0,122(s0)\n 130:\tlw\tra,20(sp)\n 134:\tlw\ts0,16(sp)\n 138:\tjr\tra\n 13c:\taddiu\tsp,sp,24\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-73e26b51fe075bc1/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000140 func_800B7620_1E46D0\n00000000 *UND*\t00000000 atan2Fixed\n00000000 *UND*\t00000000 approximateCos\n00000000 *UND*\t00000000 approximateSin\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 atan2Fixed\n00000044 R_MIPS_26 approximateCos\n0000005c R_MIPS_26 approximateSin\n000000b0 R_MIPS_26 .text\n00000110 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 8e040024 ae050094 8e05002c 24020006 ...$.......,$...\n 0020 a2020000 a6070092 a6060084 0c000000 ................\n 0030 a6060086 00022400 00042403 24841000 ......$...$.$...\n 0040 30841fff 0c000000 ae04009c 00021880 0...............\n 0050 14600019 00031a03 8604009e 0c000000 .`..............\n 0060 00000000 8e030024 00021080 00021203 .......$........\n 0070 00031a00 0062001a 14400002 00000000 .....b...@......\n 0080 0007000d 2401ffff 14410004 3c018000 ....$....A..<...\n 0090 14610002 00000000 0006000d 00001812 .a..............\n 00a0 00000000 00000000 04620001 00031823 .........b.....#\n 00b0 08000040 ae030098 8e02002c 00021200 ...@.......,....\n 00c0 0043001a 14600002 00000000 0007000d .C...`..........\n 00d0 2401ffff 14610004 3c018000 14410002 $....a..<....A..\n 00e0 00000000 0006000d 00001012 00000000 ................\n 00f0 00000000 04420001 00021023 ae020098 .....B.....#....\n 0100 8e020094 18400004 00000000 8e02009c .....@..........\n 0110 0800004a 24420800 04410005 00000000 ...J$B...A......\n 0120 8e02009c 2442f800 30421fff a602007a ....$B..0B.....z\n 0130 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a00100fe 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800B7620_1E46D0' — lift: cannot lift 'func_800B7620_1E46D0': function call 'jal' at 0x2c — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tlw\ta0,36(s0) */\n/* 14:\tsw\ta1,148(s0) */\n/* 18:\tlw\ta1,44(s0) */\n/* 1c:\tli\tv0,6 */\n/* 20:\tsb\tv0,0(s0) */\n/* 24:\tsh\ta3,146(s0) */\n/* 28:\tsh\ta2,132(s0) */\n/* 2c:\tjal\t0 */\n/* 30:\tsh\ta2,134(s0) */\n/* 34:\tsll\ta0,v0,0x10 */\n/* 38:\tsra\ta0,a0,0x10 */\n/* 3c:\taddiu\ta0,a0,4096 */\n/* 40:\tandi\ta0,a0,0x1fff */\n/* 44:\tjal\t0 */\n/* 48:\tsw\ta0,156(s0) */\n/* 4c:\tsll\tv1,v0,0x2 */\n/* 50:\tbnez\tv1,b8 */\n/* 54:\tsra\tv1,v1,0x8 */\n/* 58:\tlh\ta0,158(s0) */\n/* 5c:\tjal\t0 */\n/* 60:\tnop */\n/* 64:\tlw\tv1,36(s0) */\n/* 68:\tsll\tv0,v0,0x2 */\n/* 6c:\tsra\tv0,v0,0x8 */\n/* 70:\tsll\tv1,v1,0x8 */\n/* 74:\tdiv\tzero,v1,v0 */\n/* 78:\tbnez\tv0,84 */\n/* 7c:\tnop */\n/* 80:\tbreak\t0x7 */\n/* 84:\tli\tat,-1 */\n/* 88:\tbne\tv0,at,9c */\n/* 8c:\tlui\tat,0x8000 */\n/* 90:\tbne\tv1,at,9c */\n/* 94:\tnop */\n/* 98:\tbreak\t0x6 */\n/* 9c:\tmflo\tv1 */\n/* \t... */\n/* a8:\tbltzl\tv1,b0 */\n/* ac:\tnegu\tv1,v1 */\n/* b0:\tj\t100 */\n/* b4:\tsw\tv1,152(s0) */\n/* b8:\tlw\tv0,44(s0) */\n/* bc:\tsll\tv0,v0,0x8 */\n/* c0:\tdiv\tzero,v0,v1 */\n/* c4:\tbnez\tv1,d0 */\n/* c8:\tnop */\n/* cc:\tbreak\t0x7 */\n/* d0:\tli\tat,-1 */\n/* d4:\tbne\tv1,at,e8 */\n/* d8:\tlui\tat,0x8000 */\n/* dc:\tbne\tv0,at,e8 */\n/* e0:\tnop */\n/* e4:\tbreak\t0x6 */\n/* e8:\tmflo\tv0 */\n/* \t... */\n/* f4:\tbltzl\tv0,fc */\n/* f8:\tnegu\tv0,v0 */\n/* fc:\tsw\tv0,152(s0) */\n/* 100:\tlw\tv0,148(s0) */\n/* 104:\tblez\tv0,118 */\n/* 108:\tnop */\n/* 10c:\tlw\tv0,156(s0) */\n/* 110:\tj\t128 */\n/* 114:\taddiu\tv0,v0,2048 */\n/* 118:\tbgez\tv0,130 */\n/* 11c:\tnop */\n/* 120:\tlw\tv0,156(s0) */\n/* 124:\taddiu\tv0,v0,-2048 */\n/* 128:\tandi\tv0,v0,0x1fff */\n/* 12c:\tsh\tv0,122(s0) */\n/* 130:\tlw\tra,20(sp) */\n/* 134:\tlw\ts0,16(sp) */\n/* 138:\tjr\tra */\n/* 13c:\taddiu\tsp,sp,24 */\nvoid func_800B7620_1E46D0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B7620_1E46D0': function call 'jal' at 0x2c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":86,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B7620_1E46D0': function call 'jal' at 0x2c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 approximateCos(s32); /* extern */\ns32 approximateSin(s16); /* extern */\ns16 atan2Fixed(s32, s32); /* extern */\n\nvoid func_800B7620_1E46D0(void *arg0, s32 arg1, s16 arg2, s16 arg3) {\n s32 temp_a0;\n s32 temp_v0;\n s32 temp_v1;\n s32 var_v0;\n s32 var_v0_2;\n s32 var_v1;\n\n arg0->unk94 = arg1;\n arg0->unk0 = 6;\n arg0->unk92 = arg3;\n arg0->unk84 = arg2;\n arg0->unk86 = arg2;\n temp_a0 = (atan2Fixed(arg0->unk24, arg0->unk2C) + 0x1000) & 0x1FFF;\n arg0->unk9C = temp_a0;\n temp_v1 = approximateCos(temp_a0) * 4;\n if (temp_v1 == 0) {\n var_v1 = (s32) (arg0->unk24 << 8) / (s32) ((s32) (approximateSin(arg0->unk9E) * 4) >> 8);\n if (var_v1 < 0) {\n var_v1 = -var_v1;\n }\n arg0->unk98 = var_v1;\n } else {\n var_v0 = (s32) (arg0->unk2C << 8) / (s32) (temp_v1 >> 8);\n if (var_v0 < 0) {\n var_v0 = -var_v0;\n }\n arg0->unk98 = var_v0;\n }\n temp_v0 = arg0->unk94;\n if (temp_v0 > 0) {\n var_v0_2 = arg0->unk9C + 0x800;\n goto block_11;\n }\n if (temp_v0 < 0) {\n var_v0_2 = arg0->unk9C - 0x800;\nblock_11:\n arg0->unk7A = (s16) (var_v0_2 & 0x1FFF);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":76,"lines":42,"gotos":1,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: kmc gcc (docker) failed: /c.i:3443: conflicting types for `approximateCos'","/c.i:1870: previous declaration of `approximateCos'","/c.i:3445: conflicting types for `atan2Fixed'","/c.i:1868: previous declaration of `atan2Fixed'","/c.i:3453: request for member `unk94' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B7620_1E46D0` — benchmark function snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B7620_1E46D0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n lw\t$a0, 36($s0)\n sw\t$a1, 148($s0)\n lw\t$a1, 44($s0)\n li\t$v0, 6\n sb\t$v0, 0($s0)\n sh\t$a3, 146($s0)\n sh\t$a2, 132($s0)\n jal\tatan2Fixed\n sh\t$a2, 134($s0)\n sll\t$a0, $v0, 0x10\n sra\t$a0, $a0, 0x10\n addiu\t$a0, $a0, 4096\n andi\t$a0, $a0, 0x1fff\n jal\tapproximateCos\n sw\t$a0, 156($s0)\n sll\t$v1, $v0, 0x2\n bnez\t$v1, .Lb8\n sra\t$v1, $v1, 0x8\n lh\t$a0, 158($s0)\n jal\tapproximateSin\n nop\n lw\t$v1, 36($s0)\n sll\t$v0, $v0, 0x2\n sra\t$v0, $v0, 0x8\n sll\t$v1, $v1, 0x8\n div\t$zero, $v1, $v0\n bnez\t$v0, .L84\n nop\n break\t0x7\n.L84:\n li\t$at, -1\n bne\t$v0, $at, .L9c\n lui\t$at, 0x8000\n bne\t$v1, $at, .L9c\n nop\n break\t0x6\n.L9c:\n mflo\t$v1\n bltzl\t$v1, .Lb0\n negu\t$v1, $v1\n.Lb0:\n j\t.L100\n sw\t$v1, 152($s0)\n.Lb8:\n lw\t$v0, 44($s0)\n sll\t$v0, $v0, 0x8\n div\t$zero, $v0, $v1\n bnez\t$v1, .Ld0\n nop\n break\t0x7\n.Ld0:\n li\t$at, -1\n bne\t$v1, $at, .Le8\n lui\t$at, 0x8000\n bne\t$v0, $at, .Le8\n nop\n break\t0x6\n.Le8:\n mflo\t$v0\n bltzl\t$v0, .Lfc\n negu\t$v0, $v0\n.Lfc:\n sw\t$v0, 152($s0)\n.L100:\n lw\t$v0, 148($s0)\n blez\t$v0, .L118\n nop\n lw\t$v0, 156($s0)\n j\t.L128\n addiu\t$v0, $v0, 2048\n.L118:\n bgez\t$v0, .L130\n nop\n lw\t$v0, 156($s0)\n addiu\t$v0, $v0, -2048\n.L128:\n andi\t$v0, $v0, 0x1fff\n sh\t$v0, 122($s0)\n.L130:\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B7620_1E46D0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B7620_1E46D0` — benchmark function snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B7620_1E46D0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tlw\ta0,36(s0)\n 14:\tsw\ta1,148(s0)\n 18:\tlw\ta1,44(s0)\n 1c:\tli\tv0,6\n 20:\tsb\tv0,0(s0)\n 24:\tsh\ta3,146(s0)\n 28:\tsh\ta2,132(s0)\n 2c:\tjal\t0 \n 30:\tsh\ta2,134(s0)\n 34:\tsll\ta0,v0,0x10\n 38:\tsra\ta0,a0,0x10\n 3c:\taddiu\ta0,a0,4096\n 40:\tandi\ta0,a0,0x1fff\n 44:\tjal\t0 \n 48:\tsw\ta0,156(s0)\n 4c:\tsll\tv1,v0,0x2\n 50:\tbnez\tv1,b8 \n 54:\tsra\tv1,v1,0x8\n 58:\tlh\ta0,158(s0)\n 5c:\tjal\t0 \n 60:\tnop\n 64:\tlw\tv1,36(s0)\n 68:\tsll\tv0,v0,0x2\n 6c:\tsra\tv0,v0,0x8\n 70:\tsll\tv1,v1,0x8\n 74:\tdiv\tzero,v1,v0\n 78:\tbnez\tv0,84 \n 7c:\tnop\n 80:\tbreak\t0x7\n 84:\tli\tat,-1\n 88:\tbne\tv0,at,9c \n 8c:\tlui\tat,0x8000\n 90:\tbne\tv1,at,9c \n 94:\tnop\n 98:\tbreak\t0x6\n 9c:\tmflo\tv1\n\t...\n a8:\tbltzl\tv1,b0 \n ac:\tnegu\tv1,v1\n b0:\tj\t100 \n b4:\tsw\tv1,152(s0)\n b8:\tlw\tv0,44(s0)\n bc:\tsll\tv0,v0,0x8\n c0:\tdiv\tzero,v0,v1\n c4:\tbnez\tv1,d0 \n c8:\tnop\n cc:\tbreak\t0x7\n d0:\tli\tat,-1\n d4:\tbne\tv1,at,e8 \n d8:\tlui\tat,0x8000\n dc:\tbne\tv0,at,e8 \n e0:\tnop\n e4:\tbreak\t0x6\n e8:\tmflo\tv0\n\t...\n f4:\tbltzl\tv0,fc \n f8:\tnegu\tv0,v0\n fc:\tsw\tv0,152(s0)\n 100:\tlw\tv0,148(s0)\n 104:\tblez\tv0,118 \n 108:\tnop\n 10c:\tlw\tv0,156(s0)\n 110:\tj\t128 \n 114:\taddiu\tv0,v0,2048\n 118:\tbgez\tv0,130 \n 11c:\tnop\n 120:\tlw\tv0,156(s0)\n 124:\taddiu\tv0,v0,-2048\n 128:\tandi\tv0,v0,0x1fff\n 12c:\tsh\tv0,122(s0)\n 130:\tlw\tra,20(sp)\n 134:\tlw\ts0,16(sp)\n 138:\tjr\tra\n 13c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-73e26b51fe075bc1/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000140 func_800B7620_1E46D0\n00000000 *UND*\t00000000 atan2Fixed\n00000000 *UND*\t00000000 approximateCos\n00000000 *UND*\t00000000 approximateSin\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_26 atan2Fixed\n00000044 R_MIPS_26 approximateCos\n0000005c R_MIPS_26 approximateSin\n000000b0 R_MIPS_26 .text\n00000110 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 8e040024 ae050094 8e05002c 24020006 ...$.......,$...\n 0020 a2020000 a6070092 a6060084 0c000000 ................\n 0030 a6060086 00022400 00042403 24841000 ......$...$.$...\n 0040 30841fff 0c000000 ae04009c 00021880 0...............\n 0050 14600019 00031a03 8604009e 0c000000 .`..............\n 0060 00000000 8e030024 00021080 00021203 .......$........\n 0070 00031a00 0062001a 14400002 00000000 .....b...@......\n 0080 0007000d 2401ffff 14410004 3c018000 ....$....A..<...\n 0090 14610002 00000000 0006000d 00001812 .a..............\n 00a0 00000000 00000000 04620001 00031823 .........b.....#\n 00b0 08000040 ae030098 8e02002c 00021200 ...@.......,....\n 00c0 0043001a 14600002 00000000 0007000d .C...`..........\n 00d0 2401ffff 14610004 3c018000 14410002 $....a..<....A..\n 00e0 00000000 0006000d 00001012 00000000 ................\n 00f0 00000000 04420001 00021023 ae020098 .....B.....#....\n 0100 8e020094 18400004 00000000 8e02009c .....@..........\n 0110 0800004a 24420800 04410005 00000000 ...J$B...A......\n 0120 8e02009c 2442f800 30421fff a602007a ....$B..0B.....z\n 0130 8fbf0014 8fb00010 03e00008 27bd0018 ............'...\nContents of section .reginfo:\n 0000 a00100fe 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B7620_1E46D0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc","sym":"func_800B7760_1E4810","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","branch","call"],"loc":15,"refSource":"void func_800B7760_1E4810(CutsceneSlotData *arg0, s32 arg1, s16 arg2) {\n s32 diff;\n s32 delta;\n\n if (arg2 > 0) {\n diff = arg1 - arg0->unk54;\n delta = diff / arg2;\n arg0->unk60 = arg1;\n arg0->unk6C = delta;\n } else {\n arg0->unk54 = arg1;\n arg0->unk60 = arg1;\n arg0->unk6C = 0;\n }\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E36C0.c#L608-L622","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta2,a2,0x10\n 4:\tsra\ta2,a2,0x10\n 8:\tblezl\ta2,54 \n c:\tsw\ta1,84(a0)\n 10:\tlw\tv0,84(a0)\n 14:\tsubu\tv0,a1,v0\n 18:\tdiv\tzero,v0,a2\n 1c:\tbnez\ta2,28 \n 20:\tnop\n 24:\tbreak\t0x7\n 28:\tli\tat,-1\n 2c:\tbne\ta2,at,40 \n 30:\tlui\tat,0x8000\n 34:\tbne\tv0,at,40 \n 38:\tnop\n 3c:\tbreak\t0x6\n 40:\tmflo\tv0\n 44:\tsw\ta1,96(a0)\n 48:\tnop\n 4c:\tj\t5c \n 50:\tsw\tv0,108(a0)\n 54:\tsw\ta1,96(a0)\n 58:\tsw\tzero,108(a0)\n 5c:\tjr\tra\n 60:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-7077fb1721cb5369/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000064 func_800B7760_1E4810\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000004c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00063400 00063403 58c00012 ac850054 ..4...4.X......T\n 0010 8c820054 00a21023 0046001a 14c00002 ...T...#.F......\n 0020 00000000 0007000d 2401ffff 14c10004 ........$.......\n 0030 3c018000 14410002 00000000 0006000d <....A..........\n 0040 00001012 ac850060 00000000 08000017 .......`........\n 0050 ac82006c ac850060 ac80006c 03e00008 ...l...`...l....\n 0060 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800B7760_1E4810' — lift: cannot lift 'func_800B7760_1E4810': unmodelled control transfer 'blezl' at 0x8 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsll\ta2,a2,0x10 */\n/* 4:\tsra\ta2,a2,0x10 */\n/* 8:\tblezl\ta2,54 */\n/* c:\tsw\ta1,84(a0) */\n/* 10:\tlw\tv0,84(a0) */\n/* 14:\tsubu\tv0,a1,v0 */\n/* 18:\tdiv\tzero,v0,a2 */\n/* 1c:\tbnez\ta2,28 */\n/* 20:\tnop */\n/* 24:\tbreak\t0x7 */\n/* 28:\tli\tat,-1 */\n/* 2c:\tbne\ta2,at,40 */\n/* 30:\tlui\tat,0x8000 */\n/* 34:\tbne\tv0,at,40 */\n/* 38:\tnop */\n/* 3c:\tbreak\t0x6 */\n/* 40:\tmflo\tv0 */\n/* 44:\tsw\ta1,96(a0) */\n/* 48:\tnop */\n/* 4c:\tj\t5c */\n/* 50:\tsw\tv0,108(a0) */\n/* 54:\tsw\ta1,96(a0) */\n/* 58:\tsw\tzero,108(a0) */\n/* 5c:\tjr\tra */\n/* 60:\tnop */\n/* \t... */\nvoid func_800B7760_1E4810(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B7760_1E4810': unmodelled control transfer 'blezl' at 0x8 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":34,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B7760_1E4810': unmodelled control transfer 'blezl' at 0x8 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void func_800B7760_1E4810(void *arg0, s32 arg1, s16 arg2) {\n if (arg2 <= 0) {\n arg0->unk54 = arg1;\n arg0->unk60 = arg1;\n arg0->unk6C = 0;\n return;\n }\n arg0->unk60 = arg1;\n arg0->unk6C = (s32) ((s32) (arg1 - arg0->unk54) / arg2);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":10,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:3445: request for member `unk54' in something not a structure or union","/c.i:3446: request for member `unk60' in something not a structure or union","/c.i:3447: request for member `unk6C' in something not a structure or union","/c.i:3450: request for member `unk60' in something not a structure or union","/c.i:3451: request for member `unk6C' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B7760_1E4810` — benchmark function snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B7760_1E4810\n sll\t$a2, $a2, 0x10\n sra\t$a2, $a2, 0x10\n blezl\t$a2, .L54\n sw\t$a1, 84($a0)\n lw\t$v0, 84($a0)\n subu\t$v0, $a1, $v0\n div\t$zero, $v0, $a2\n bnez\t$a2, .L28\n nop\n break\t0x7\n.L28:\n li\t$at, -1\n bne\t$a2, $at, .L40\n lui\t$at, 0x8000\n bne\t$v0, $at, .L40\n nop\n break\t0x6\n.L40:\n mflo\t$v0\n sw\t$a1, 96($a0)\n nop\n j\t.L5c\n sw\t$v0, 108($a0)\n.L54:\n sw\t$a1, 96($a0)\n sw\t$zero, 108($a0)\n.L5c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B7760_1E4810 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B7760_1E4810` — benchmark function snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B7760_1E4810:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta2,a2,0x10\n 4:\tsra\ta2,a2,0x10\n 8:\tblezl\ta2,54 \n c:\tsw\ta1,84(a0)\n 10:\tlw\tv0,84(a0)\n 14:\tsubu\tv0,a1,v0\n 18:\tdiv\tzero,v0,a2\n 1c:\tbnez\ta2,28 \n 20:\tnop\n 24:\tbreak\t0x7\n 28:\tli\tat,-1\n 2c:\tbne\ta2,at,40 \n 30:\tlui\tat,0x8000\n 34:\tbne\tv0,at,40 \n 38:\tnop\n 3c:\tbreak\t0x6\n 40:\tmflo\tv0\n 44:\tsw\ta1,96(a0)\n 48:\tnop\n 4c:\tj\t5c \n 50:\tsw\tv0,108(a0)\n 54:\tsw\ta1,96(a0)\n 58:\tsw\tzero,108(a0)\n 5c:\tjr\tra\n 60:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-7077fb1721cb5369/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000064 func_800B7760_1E4810\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000004c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 00063400 00063403 58c00012 ac850054 ..4...4.X......T\n 0010 8c820054 00a21023 0046001a 14c00002 ...T...#.F......\n 0020 00000000 0007000d 2401ffff 14c10004 ........$.......\n 0030 3c018000 14410002 00000000 0006000d <....A..........\n 0040 00001012 ac850060 00000000 08000017 .......`........\n 0050 ac82006c ac850060 ac80006c 03e00008 ...l...`...l....\n 0060 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B7760_1E4810 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc","sym":"func_800B93F0_1E64A0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","call"],"loc":15,"refSource":"s32 func_800B93F0_1E64A0(s32 arg0) {\n s32 result;\n\n if (arg0 == 0) {\n arg0 = 1;\n }\n\n result = 0x4000000 / arg0;\n\n if (result >= 0x4000) {\n result = 0x4000;\n }\n\n return result;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E64A0.c#L16-L30","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqzl\ta0,8 \n 4:\tli\ta0,1\n 8:\tlui\tv0,0x400\n c:\tdiv\tzero,v0,a0\n 10:\tbnez\ta0,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta0,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\tv0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmflo\ta0\n 38:\tslti\tv0,a0,16384\n 3c:\tnop\n 40:\tbeqzl\tv0,48 \n 44:\tli\ta0,16384\n 48:\tjr\tra\n 4c:\tmove\tv0,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-224f646ab8fe4f42/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 func_800B93F0_1E64A0\n\n\nContents of section .text:\n 0000 50800001 24040001 3c020400 0044001a P...$...<....D..\n 0010 14800002 00000000 0007000d 2401ffff ............$...\n 0020 14810004 3c018000 14410002 00000000 ....<....A......\n 0030 0006000d 00002012 28824000 00000000 ...... .(.@.....\n 0040 50400001 24044000 03e00008 00801021 P@..$.@........!\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800B93F0_1E64A0' — lift: cannot lift 'func_800B93F0_1E64A0': unmodelled control transfer 'beqzl' at 0x0 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tbeqzl\ta0,8 */\n/* 4:\tli\ta0,1 */\n/* 8:\tlui\tv0,0x400 */\n/* c:\tdiv\tzero,v0,a0 */\n/* 10:\tbnez\ta0,1c */\n/* 14:\tnop */\n/* 18:\tbreak\t0x7 */\n/* 1c:\tli\tat,-1 */\n/* 20:\tbne\ta0,at,34 */\n/* 24:\tlui\tat,0x8000 */\n/* 28:\tbne\tv0,at,34 */\n/* 2c:\tnop */\n/* 30:\tbreak\t0x6 */\n/* 34:\tmflo\ta0 */\n/* 38:\tslti\tv0,a0,16384 */\n/* 3c:\tnop */\n/* 40:\tbeqzl\tv0,48 */\n/* 44:\tli\ta0,16384 */\n/* 48:\tjr\tra */\n/* 4c:\tmove\tv0,a0 */\nvoid func_800B93F0_1E64A0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B93F0_1E64A0': unmodelled control transfer 'beqzl' at 0x0 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":28,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B93F0_1E64A0': unmodelled control transfer 'beqzl' at 0x0 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 func_800B93F0_1E64A0(s32 arg0) {\n s32 var_a0;\n s32 var_a0_2;\n\n var_a0_2 = arg0;\n if (var_a0_2 == 0) {\n var_a0_2 = 1;\n }\n var_a0 = 0x04000000 / var_a0_2;\n if (var_a0 >= 0x4000) {\n var_a0 = 0x4000;\n }\n return var_a0;\n}\n","score":0,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B93F0_1E64A0` — benchmark function snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B93F0_1E64A0\n beqzl\t$a0, .L8\n li\t$a0, 1\n.L8:\n lui\t$v0, 0x400\n div\t$zero, $v0, $a0\n bnez\t$a0, .L1c\n nop\n break\t0x7\n.L1c:\n li\t$at, -1\n bne\t$a0, $at, .L34\n lui\t$at, 0x8000\n bne\t$v0, $at, .L34\n nop\n break\t0x6\n.L34:\n mflo\t$a0\n slti\t$v0, $a0, 16384\n nop\n beqzl\t$v0, .L48\n li\t$a0, 16384\n.L48:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B93F0_1E64A0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B93F0_1E64A0` — benchmark function snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B93F0_1E64A0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqzl\ta0,8 \n 4:\tli\ta0,1\n 8:\tlui\tv0,0x400\n c:\tdiv\tzero,v0,a0\n 10:\tbnez\ta0,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta0,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\tv0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmflo\ta0\n 38:\tslti\tv0,a0,16384\n 3c:\tnop\n 40:\tbeqzl\tv0,48 \n 44:\tli\ta0,16384\n 48:\tjr\tra\n 4c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-224f646ab8fe4f42/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 func_800B93F0_1E64A0\n\n\nContents of section .text:\n 0000 50800001 24040001 3c020400 0044001a P...$...<....D..\n 0010 14800002 00000000 0007000d 2401ffff ............$...\n 0020 14810004 3c018000 14410002 00000000 ....<....A......\n 0030 0006000d 00002012 28824000 00000000 ...... .(.@.....\n 0040 50400001 24044000 03e00008 00801021 P@..$.@........!\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B93F0_1E64A0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc","sym":"func_800B9C20_1E6CD0","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","call"],"loc":5,"refSource":"void func_800B9C20_1E6CD0(cutsceneSys2Wait_exec_asset *arg0) {\n arg0->unkA0 = freeNodeMemory(arg0->unkA0);\n arg0->unk8 = freeNodeMemory(arg0->unk8);\n arg0->unkC = freeNodeMemory(arg0->unkC);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/1E64A0.c#L201-L205","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tjal\t0 \n 14:\tlw\ta0,160(s0)\n 18:\tlw\ta0,8(s0)\n 1c:\tjal\t0 \n 20:\tsw\tv0,160(s0)\n 24:\tlw\ta0,12(s0)\n 28:\tjal\t0 \n 2c:\tsw\tv0,8(s0)\n 30:\tsw\tv0,12(s0)\n 34:\tlw\tra,20(sp)\n 38:\tlw\ts0,16(sp)\n 3c:\tjr\tra\n 40:\taddiu\tsp,sp,24\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-089cd7a701ec1012/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000044 func_800B9C20_1E6CD0\n00000000 *UND*\t00000000 freeNodeMemory\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 freeNodeMemory\n0000001c R_MIPS_26 freeNodeMemory\n00000028 R_MIPS_26 freeNodeMemory\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 0c000000 8e0400a0 8e040008 0c000000 ................\n 0020 ae0200a0 8e04000c 0c000000 ae020008 ................\n 0030 ae02000c 8fbf0014 8fb00010 03e00008 ................\n 0040 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'func_800B9C20_1E6CD0' — lift: cannot lift 'func_800B9C20_1E6CD0': function call 'jal' at 0x10 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\tsw\tra,20(sp) */\n/* 10:\tjal\t0 */\n/* 14:\tlw\ta0,160(s0) */\n/* 18:\tlw\ta0,8(s0) */\n/* 1c:\tjal\t0 */\n/* 20:\tsw\tv0,160(s0) */\n/* 24:\tlw\ta0,12(s0) */\n/* 28:\tjal\t0 */\n/* 2c:\tsw\tv0,8(s0) */\n/* 30:\tsw\tv0,12(s0) */\n/* 34:\tlw\tra,20(sp) */\n/* 38:\tlw\ts0,16(sp) */\n/* 3c:\tjr\tra */\n/* 40:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid func_800B9C20_1E6CD0(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'func_800B9C20_1E6CD0': function call 'jal' at 0x10 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":26,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'func_800B9C20_1E6CD0': function call 'jal' at 0x10 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 freeNodeMemory(s32); /* extern */\n\nvoid func_800B9C20_1E6CD0(void *arg0) {\n arg0->unkA0 = freeNodeMemory(arg0->unkA0);\n arg0->unk8 = freeNodeMemory(arg0->unk8);\n arg0->unkC = freeNodeMemory(arg0->unkC);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":6,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:3410: request for member `unkA0' in something not a structure or union","/c.i:3411: request for member `unk8' in something not a structure or union","/c.i:3412: request for member `unkC' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `func_800B9C20_1E6CD0` — benchmark function snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel func_800B9C20_1E6CD0\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n sw\t$ra, 20($sp)\n jal\tfreeNodeMemory\n lw\t$a0, 160($s0)\n lw\t$a0, 8($s0)\n jal\tfreeNodeMemory\n sw\t$v0, 160($s0)\n lw\t$a0, 12($s0)\n jal\tfreeNodeMemory\n sw\t$v0, 8($s0)\n sw\t$v0, 12($s0)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function func_800B9C20_1E6CD0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `func_800B9C20_1E6CD0` — benchmark function snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:func_800B9C20_1E6CD0:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\tsw\tra,20(sp)\n 10:\tjal\t0 \n 14:\tlw\ta0,160(s0)\n 18:\tlw\ta0,8(s0)\n 1c:\tjal\t0 \n 20:\tsw\tv0,160(s0)\n 24:\tlw\ta0,12(s0)\n 28:\tjal\t0 \n 2c:\tsw\tv0,8(s0)\n 30:\tsw\tv0,12(s0)\n 34:\tlw\tra,20(sp)\n 38:\tlw\ts0,16(sp)\n 3c:\tjr\tra\n 40:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-089cd7a701ec1012/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000044 func_800B9C20_1E6CD0\n00000000 *UND*\t00000000 freeNodeMemory\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 freeNodeMemory\n0000001c R_MIPS_26 freeNodeMemory\n00000028 R_MIPS_26 freeNodeMemory\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 afbf0014 '..........!....\n 0010 0c000000 8e0400a0 8e040008 0c000000 ................\n 0020 ae0200a0 8e04000c 0c000000 ae020008 ................\n 0030 ae02000c 8fbf0014 8fb00010 03e00008 ................\n 0040 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name func_800B9C20_1E6CD0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:GenericTriggerInit:gcc2.7.2kmc","sym":"GenericTriggerInit","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field","call","global"],"loc":9,"refSource":"void GenericTriggerInit(EventTrigger *arg0) {\n u8 eventId = arg0->eventId;\n arg0->unk1 = 0;\n arg0->unk4 = 0;\n arg0->unk6 = -0x68;\n arg0->unk8 = 0;\n arg0->unkC = &D_8008D714_8E314[eventId * 20];\n setCallback(GenericTriggerCheck);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/198B0.c#L10-L18","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tlbu\tv1,0(a0)\n c:\tli\tv0,-104\n 10:\tsb\tzero,1(a0)\n 14:\tsh\tzero,4(a0)\n 18:\tsh\tv0,6(a0)\n 1c:\tsh\tzero,8(a0)\n 20:\tsll\tv0,v1,0x2\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\tv0,v0,v1\n 38:\tsw\tv0,12(a0)\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-179f8d5e0521.i.gz","proto":{"GenericTriggerInit":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-17b75d3a9e5de8d3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 GenericTriggerInit\n00000000 *UND*\t00000000 D_8008D714_8E314\n00000000 *UND*\t00000000 GenericTriggerCheck\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 D_8008D714_8E314\n00000030 R_MIPS_LO16 D_8008D714_8E314\n0000003c R_MIPS_HI16 GenericTriggerCheck\n00000044 R_MIPS_LO16 GenericTriggerCheck\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 90830000 2402ff98 '...........$...\n 0010 a0800001 a4800004 a4820006 a4800008 ................\n 0020 00031080 00431021 00021080 3c030000 .....C.!....<...\n 0030 24630000 00431021 ac82000c 3c040000 $c...C.!....<...\n 0040 0c000000 24840000 8fbf0010 03e00008 ....$...........\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'GenericTriggerInit' — lift: cannot lift 'GenericTriggerInit': function call 'jal' at 0x40 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tlbu\tv1,0(a0) */\n/* c:\tli\tv0,-104 */\n/* 10:\tsb\tzero,1(a0) */\n/* 14:\tsh\tzero,4(a0) */\n/* 18:\tsh\tv0,6(a0) */\n/* 1c:\tsh\tzero,8(a0) */\n/* 20:\tsll\tv0,v1,0x2 */\n/* 24:\taddu\tv0,v0,v1 */\n/* 28:\tsll\tv0,v0,0x2 */\n/* 2c:\tlui\tv1,0x0 */\n/* 30:\taddiu\tv1,v1,0 */\n/* 34:\taddu\tv0,v0,v1 */\n/* 38:\tsw\tv0,12(a0) */\n/* 3c:\tlui\ta0,0x0 */\n/* 40:\tjal\t0 */\n/* 44:\taddiu\ta0,a0,0 */\n/* 48:\tlw\tra,16(sp) */\n/* 4c:\tjr\tra */\n/* 50:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid GenericTriggerInit(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'GenericTriggerInit': function call 'jal' at 0x40 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":30,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'GenericTriggerInit': function call 'jal' at 0x40 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void GenericTriggerInit(EventTrigger *arg0) {\n arg0->unk1 = 0;\n arg0->unk4 = 0;\n arg0->unk6 = -0x68;\n arg0->unk8 = 0;\n arg0->unkC = ((u8) arg0->eventId * 0x14) + D_8008D714_8E314;\n setCallback(GenericTriggerCheck);\n}\n","score":0,"maxScore":21,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/198B0.c: initializes an event trigger struct and registers its check callback","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `GenericTriggerInit` — benchmark function snowboardkids2:GenericTriggerInit:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel GenericTriggerInit\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n lbu\t$v1, 0($a0)\n li\t$v0, -104\n sb\t$zero, 1($a0)\n sh\t$zero, 4($a0)\n sh\t$v0, 6($a0)\n sh\t$zero, 8($a0)\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(D_8008D714_8E314)\n addiu\t$v1, $v1, %lo(D_8008D714_8E314)\n addu\t$v0, $v0, $v1\n sw\t$v0, 12($a0)\n lui\t$a0, %hi(GenericTriggerCheck)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(GenericTriggerCheck)\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-179f8d5e0521.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid GenericTriggerInit(EventTrigger *arg0);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function GenericTriggerInit # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `GenericTriggerInit` — benchmark function snowboardkids2:GenericTriggerInit:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:GenericTriggerInit:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tlbu\tv1,0(a0)\n c:\tli\tv0,-104\n 10:\tsb\tzero,1(a0)\n 14:\tsh\tzero,4(a0)\n 18:\tsh\tv0,6(a0)\n 1c:\tsh\tzero,8(a0)\n 20:\tsll\tv0,v1,0x2\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\tv0,v0,v1\n 38:\tsw\tv0,12(a0)\n 3c:\tlui\ta0,0x0\n 40:\tjal\t0 \n 44:\taddiu\ta0,a0,0\n 48:\tlw\tra,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-17b75d3a9e5de8d3/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 GenericTriggerInit\n00000000 *UND*\t00000000 D_8008D714_8E314\n00000000 *UND*\t00000000 GenericTriggerCheck\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 D_8008D714_8E314\n00000030 R_MIPS_LO16 D_8008D714_8E314\n0000003c R_MIPS_HI16 GenericTriggerCheck\n00000044 R_MIPS_LO16 GenericTriggerCheck\n00000040 R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 90830000 2402ff98 '...........$...\n 0010 a0800001 a4800004 a4820006 a4800008 ................\n 0020 00031080 00431021 00021080 3c030000 .....C.!....<...\n 0030 24630000 00431021 ac82000c 3c040000 $c...C.!....<...\n 0040 0c000000 24840000 8fbf0010 03e00008 ....$...........\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"GenericTriggerInit\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name GenericTriggerInit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc","sym":"getTableEntryByU16Index","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","array","field","pointer"],"loc":15,"refSource":"void getTableEntryByU16Index(DataTable_19E80 *arg0, u16 arg1, OutputStruct_19E80 *arg2) {\n u16 index_offset;\n TableEntry_19E80 *entry_ptr;\n TableEntry_19E80 *index_table;\n TableEntry_19E80 *entry;\n\n entry_ptr = arg0->entries;\n index_table = &entry_ptr[arg0->index_table_offset];\n entry_ptr = &entry_ptr[arg1];\n\n arg2->data_ptr = &arg0->header[entry_ptr->data_offset];\n arg2->index_ptr = &index_table[entry_ptr->index_offset * 2];\n arg2->field1 = entry_ptr->field1;\n arg2->field2 = entry_ptr->field2;\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/19E80.c#L3-L17","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,4(a0)\n 4:\taddiu\ta3,a0,8\n 8:\tandi\ta1,a1,0xffff\n c:\tsll\ta1,a1,0x4\n 10:\tsll\tv1,v1,0x4\n 14:\taddu\tv1,a3,v1\n 18:\taddu\ta3,a3,a1\n 1c:\tlw\tv0,0(a3)\n 20:\taddu\ta0,a0,v0\n 24:\tsw\ta0,0(a2)\n 28:\tlhu\tv0,4(a3)\n 2c:\tsll\tv0,v0,0x5\n 30:\taddu\tv1,v1,v0\n 34:\tsw\tv1,4(a2)\n 38:\tlhu\tv0,6(a3)\n 3c:\tsh\tv0,8(a2)\n 40:\tlhu\tv0,8(a3)\n 44:\tjr\tra\n 48:\tsh\tv0,10(a2)\n 4c:\tnop\n","proto":{"getTableEntryByU16Index":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-38e285a16bb25525/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c getTableEntryByU16Index\n\n\nContents of section .text:\n 0000 8c830004 24870008 30a5ffff 00052900 ....$...0.....).\n 0010 00031900 00e31821 00e53821 8ce20000 .......!..8!....\n 0020 00822021 acc40000 94e20004 00021140 .. !...........@\n 0030 00621821 acc30004 94e20006 a4c20008 .b.!............\n 0040 94e20008 03e00008 a4c2000a 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"candidateLabel":"unsigned","symbolsUsed":[],"outcome":"nonmatch","source":"struct Struct0 { s32 field_0; u16 field_4; u16 field_6; u16 field_8; };\nstruct Struct1 { s32 field_0; s32 field_4; u16 field_8; u16 field_10; };\nvoid getTableEntryByU16Index(s32 * a0, u32 a1, struct Struct1 * a2) {\n s32 v0;\n v0 = a0[1];\n a2->field_0 = a0 + ((struct Struct0 *)(a0 + 2 + ((a1 & 65535) << 4)))->field_0;\n a2->field_4 = a0 + 2 + (v0 << 4) + (((struct Struct0 *)(a0 + 2 + ((a1 & 65535) << 4)))->field_4 << 5);\n a2->field_8 = ((struct Struct0 *)(a0 + 2 + ((a1 & 65535) << 4)))->field_6;\n a2->field_10 = ((struct Struct0 *)(a0 + 2 + ((a1 & 65535) << 4)))->field_8;\n return;\n}\n","score":25,"maxScore":28,"compileErrors":null,"breakdown":{"insert":9,"delete":8,"replace":0,"opMismatch":0,"argMismatch":8},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void getTableEntryByU16Index(void *arg0, s32 arg1, void *arg2) {\n void *temp_a3;\n void *temp_a3_2;\n\n temp_a3 = arg0 + 8;\n temp_a3_2 = temp_a3 + ((arg1 & 0xFFFF) * 0x10);\n arg2->unk0 = (void *) (arg0 + temp_a3_2->unk0);\n arg2->unk4 = (void *) (temp_a3 + (arg0->unk4 * 0x10) + (temp_a3_2->unk4 << 5));\n arg2->unk8 = (u16) temp_a3_2->unk6;\n arg2->unkA = (u16) temp_a3_2->unk8;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":96,"lines":10,"gotos":0,"casts":4,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["kmc gcc failed: /c.i:1846: request for member `unk0' in something not a structure or union","/c.i:1847: request for member `unk4' in something not a structure or union","/c.i:1848: request for member `unk8' in something not a structure or union","/c.i:1848: request for member `unk6' in something not a structure or union","/c.i:1849: request for member `unkA' in something not a structure or union"]},"note":"src/19E80.c: table lookup, pointer/array arithmetic, no calls","gapSize":{"decompiler":"asmlift","score":25,"maxScore":28,"ratio":0.8928571428571429,"kinds":{"insert":9,"delete":8,"replace":0,"opMismatch":0,"argMismatch":8}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `getTableEntryByU16Index` — benchmark function snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel getTableEntryByU16Index\n lw\t$v1, 4($a0)\n addiu\t$a3, $a0, 8\n andi\t$a1, $a1, 0xffff\n sll\t$a1, $a1, 0x4\n sll\t$v1, $v1, 0x4\n addu\t$v1, $a3, $v1\n addu\t$a3, $a3, $a1\n lw\t$v0, 0($a3)\n addu\t$a0, $a0, $v0\n sw\t$a0, 0($a2)\n lhu\t$v0, 4($a3)\n sll\t$v0, $v0, 0x5\n addu\t$v1, $v1, $v0\n sw\t$v1, 4($a2)\n lhu\t$v0, 6($a3)\n sh\t$v0, 8($a2)\n lhu\t$v0, 8($a3)\n jr\t$ra\n sh\t$v0, 10($a2)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function getTableEntryByU16Index # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `getTableEntryByU16Index` — benchmark function snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:getTableEntryByU16Index:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv1,4(a0)\n 4:\taddiu\ta3,a0,8\n 8:\tandi\ta1,a1,0xffff\n c:\tsll\ta1,a1,0x4\n 10:\tsll\tv1,v1,0x4\n 14:\taddu\tv1,a3,v1\n 18:\taddu\ta3,a3,a1\n 1c:\tlw\tv0,0(a3)\n 20:\taddu\ta0,a0,v0\n 24:\tsw\ta0,0(a2)\n 28:\tlhu\tv0,4(a3)\n 2c:\tsll\tv0,v0,0x5\n 30:\taddu\tv1,v1,v0\n 34:\tsw\tv1,4(a2)\n 38:\tlhu\tv0,6(a3)\n 3c:\tsh\tv0,8(a2)\n 40:\tlhu\tv0,8(a3)\n 44:\tjr\tra\n 48:\tsh\tv0,10(a2)\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-38e285a16bb25525/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c getTableEntryByU16Index\n\n\nContents of section .text:\n 0000 8c830004 24870008 30a5ffff 00052900 ....$...0.....).\n 0010 00031900 00e31821 00e53821 8ce20000 .......!..8!....\n 0020 00822021 acc40000 94e20004 00021140 .. !...........@\n 0030 00621821 acc30004 94e20006 a4c20008 .b.!............\n 0040 94e20008 03e00008 a4c2000a 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"getTableEntryByU16Index\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name getTableEntryByU16Index # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc","sym":"initSteppedMatrixController","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","call","memory","global"],"loc":7,"refSource":"void initSteppedMatrixController(SteppedMatrixState *state) {\n memcpy(&state->matrix, identityMatrix, 0x20);\n state->frameDelay = 0;\n state->stepIndex = 0;\n setCleanupCallback(cleanupSteppedMatrixController);\n setCallback(updateSteppedMatrixController);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/76B0.c#L30-L36","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\taddiu\ta0,s0,4\n 10:\tlui\ta1,0x0\n 14:\taddiu\ta1,a1,0\n 18:\tsw\tra,20(sp)\n 1c:\tjal\t0 \n 20:\tli\ta2,32\n 24:\tlui\ta0,0x0\n 28:\taddiu\ta0,a0,0\n 2c:\tsh\tzero,36(s0)\n 30:\tjal\t0 \n 34:\tsh\tzero,40(s0)\n 38:\tlui\ta0,0x0\n 3c:\tjal\t0 \n 40:\taddiu\ta0,a0,0\n 44:\tlw\tra,20(sp)\n 48:\tlw\ts0,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-1f4f9d8c2067.i.gz","proto":{"initSteppedMatrixController":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1f9fb46d4e427117/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 initSteppedMatrixController\n00000000 *UND*\t00000000 identityMatrix\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 cleanupSteppedMatrixController\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 updateSteppedMatrixController\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 identityMatrix\n00000014 R_MIPS_LO16 identityMatrix\n0000001c R_MIPS_26 memcpy\n00000024 R_MIPS_HI16 cleanupSteppedMatrixController\n00000028 R_MIPS_LO16 cleanupSteppedMatrixController\n00000030 R_MIPS_26 setCleanupCallback\n00000038 R_MIPS_HI16 updateSteppedMatrixController\n00000040 R_MIPS_LO16 updateSteppedMatrixController\n0000003c R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 26040004 '..........!&...\n 0010 3c050000 24a50000 afbf0014 0c000000 <...$...........\n 0020 24060020 3c040000 24840000 a6000024 $.. <...$......$\n 0030 0c000000 a6000028 3c040000 0c000000 .......(<.......\n 0040 24840000 8fbf0014 8fb00010 03e00008 $...............\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'initSteppedMatrixController' — lift: cannot lift 'initSteppedMatrixController': function call 'jal' at 0x1c — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\ts0,16(sp) */\n/* 8:\tmove\ts0,a0 */\n/* c:\taddiu\ta0,s0,4 */\n/* 10:\tlui\ta1,0x0 */\n/* 14:\taddiu\ta1,a1,0 */\n/* 18:\tsw\tra,20(sp) */\n/* 1c:\tjal\t0 */\n/* 20:\tli\ta2,32 */\n/* 24:\tlui\ta0,0x0 */\n/* 28:\taddiu\ta0,a0,0 */\n/* 2c:\tsh\tzero,36(s0) */\n/* 30:\tjal\t0 */\n/* 34:\tsh\tzero,40(s0) */\n/* 38:\tlui\ta0,0x0 */\n/* 3c:\tjal\t0 */\n/* 40:\taddiu\ta0,a0,0 */\n/* 44:\tlw\tra,20(sp) */\n/* 48:\tlw\ts0,16(sp) */\n/* 4c:\tjr\tra */\n/* 50:\taddiu\tsp,sp,24 */\n/* \t... */\nvoid initSteppedMatrixController(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'initSteppedMatrixController': function call 'jal' at 0x1c — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":30,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'initSteppedMatrixController': function call 'jal' at 0x1c — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void initSteppedMatrixController(SteppedMatrixState *state) {\n memcpy(&state->matrix, identityMatrix, 0x20U);\n state->frameDelay = 0;\n state->stepIndex = 0;\n setCleanupCallback(cleanupSteppedMatrixController);\n setCallback(updateSteppedMatrixController);\n}\n","score":0,"maxScore":21,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/76B0.c: copies identity matrix into task state, registers callbacks","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `initSteppedMatrixController` — benchmark function snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel initSteppedMatrixController\n addiu\t$sp, $sp, -24\n sw\t$s0, 16($sp)\n move\t$s0, $a0\n addiu\t$a0, $s0, 4\n lui\t$a1, %hi(identityMatrix)\n addiu\t$a1, $a1, %lo(identityMatrix)\n sw\t$ra, 20($sp)\n jal\tmemcpy\n li\t$a2, 32\n lui\t$a0, %hi(cleanupSteppedMatrixController)\n addiu\t$a0, $a0, %lo(cleanupSteppedMatrixController)\n sh\t$zero, 36($s0)\n jal\tsetCleanupCallback\n sh\t$zero, 40($s0)\n lui\t$a0, %hi(updateSteppedMatrixController)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(updateSteppedMatrixController)\n lw\t$ra, 20($sp)\n lw\t$s0, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-1f4f9d8c2067.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid initSteppedMatrixController(SteppedMatrixState *state);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function initSteppedMatrixController # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `initSteppedMatrixController` — benchmark function snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:initSteppedMatrixController:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\ts0,16(sp)\n 8:\tmove\ts0,a0\n c:\taddiu\ta0,s0,4\n 10:\tlui\ta1,0x0\n 14:\taddiu\ta1,a1,0\n 18:\tsw\tra,20(sp)\n 1c:\tjal\t0 \n 20:\tli\ta2,32\n 24:\tlui\ta0,0x0\n 28:\taddiu\ta0,a0,0\n 2c:\tsh\tzero,36(s0)\n 30:\tjal\t0 \n 34:\tsh\tzero,40(s0)\n 38:\tlui\ta0,0x0\n 3c:\tjal\t0 \n 40:\taddiu\ta0,a0,0\n 44:\tlw\tra,20(sp)\n 48:\tlw\ts0,16(sp)\n 4c:\tjr\tra\n 50:\taddiu\tsp,sp,24\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-1f9fb46d4e427117/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 initSteppedMatrixController\n00000000 *UND*\t00000000 identityMatrix\n00000000 *UND*\t00000000 memcpy\n00000000 *UND*\t00000000 cleanupSteppedMatrixController\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 updateSteppedMatrixController\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 identityMatrix\n00000014 R_MIPS_LO16 identityMatrix\n0000001c R_MIPS_26 memcpy\n00000024 R_MIPS_HI16 cleanupSteppedMatrixController\n00000028 R_MIPS_LO16 cleanupSteppedMatrixController\n00000030 R_MIPS_26 setCleanupCallback\n00000038 R_MIPS_HI16 updateSteppedMatrixController\n00000040 R_MIPS_LO16 updateSteppedMatrixController\n0000003c R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffe8 afb00010 00808021 26040004 '..........!&...\n 0010 3c050000 24a50000 afbf0014 0c000000 <...$...........\n 0020 24060020 3c040000 24840000 a6000024 $.. <...$......$\n 0030 0c000000 a6000028 3c040000 0c000000 .......(<.......\n 0040 24840000 8fbf0014 8fb00010 03e00008 $...............\n 0050 27bd0018 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a0010070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"initSteppedMatrixController\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name initSteppedMatrixController # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc","sym":"loadAssetGroupResources","project":"snowboardkids2","tier":"real","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","struct","array","call","cast"],"loc":22,"refSource":"void loadAssetGroupResources(AssetGroupTaskData *taskData) {\n AssetGroupTableEntry *entry;\n AssetEntry *assetList;\n s32 i;\n\n entry = &assetGroupTable[taskData->groupIndex];\n assetList = entry->assetList;\n\n setCleanupCallback(freeAssetGroupResources);\n i = 0;\n\n taskData->unk10 = NULL;\n taskData->unkC = NULL;\n\n taskData->loadedAssets = allocateNodeMemory(entry->assetCount * 4);\n\n for (i = 0; i < entry->assetCount; i++) {\n taskData->loadedAssets[i] = loadCompressedData(assetList[i].unk0, assetList[i].unk4, assetList[i].unk8);\n }\n\n setCallback(func_80003184_3D84);\n}","sourceUrl":"https://github.com/macabeus/snowboardkids2-decomp/blob/66e9f600be2b82dc08c87ccf0d2c6ed14509e489/src/3B80.c#L80-L101","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-48\n 4:\tsw\ts3,36(sp)\n 8:\tmove\ts3,a0\n c:\tsw\tra,40(sp)\n 10:\tsw\ts2,32(sp)\n 14:\tsw\ts1,28(sp)\n 18:\tsw\ts0,24(sp)\n 1c:\tlbu\tv1,196(s3)\n 20:\tsll\tv0,v1,0x1\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\ts2,v0,v1\n 38:\tlw\ts0,0(s2)\n 3c:\tlui\ta0,0x0\n 40:\taddiu\ta0,a0,0\n 44:\tjal\t0 \n 48:\tmove\ts1,zero\n 4c:\tsw\tzero,16(s3)\n 50:\tsw\tzero,12(s3)\n 54:\tlbu\ta0,8(s2)\n 58:\tjal\t0 \n 5c:\tsll\ta0,a0,0x2\n 60:\tsw\tv0,4(s3)\n 64:\tlbu\tv0,8(s2)\n 68:\tblez\tv0,a8 \n 6c:\tnop\n 70:\tlw\ta0,0(s0)\n 74:\tlw\ta1,4(s0)\n 78:\tlw\ta2,8(s0)\n 7c:\tjal\t0 \n 80:\taddiu\ts0,s0,12\n 84:\tlw\tv1,4(s3)\n 88:\tsll\ta0,s1,0x2\n 8c:\taddu\ta0,a0,v1\n 90:\tsw\tv0,0(a0)\n 94:\tlbu\tv0,8(s2)\n 98:\taddiu\ts1,s1,1\n 9c:\tslt\tv0,s1,v0\n a0:\tbnez\tv0,70 \n a4:\tnop\n a8:\tlui\ta0,0x0\n ac:\tjal\t0 \n b0:\taddiu\ta0,a0,0\n b4:\tlw\tra,40(sp)\n b8:\tlw\ts3,36(sp)\n bc:\tlw\ts2,32(sp)\n c0:\tlw\ts1,28(sp)\n c4:\tlw\ts0,24(sp)\n c8:\tjr\tra\n cc:\taddiu\tsp,sp,48\n","ctxRef":"apps/benchmark/dataset/real/tu/snowboardkids2/ctx-96e61b4ff9f1.i.gz","proto":{"loadAssetGroupResources":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ea902f2bbc2f0c1a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000d0 loadAssetGroupResources\n00000000 *UND*\t00000000 assetGroupTable\n00000000 *UND*\t00000000 freeAssetGroupResources\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 allocateNodeMemory\n00000000 *UND*\t00000000 loadCompressedData\n00000000 *UND*\t00000000 func_80003184_3D84\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 assetGroupTable\n00000030 R_MIPS_LO16 assetGroupTable\n0000003c R_MIPS_HI16 freeAssetGroupResources\n00000040 R_MIPS_LO16 freeAssetGroupResources\n00000044 R_MIPS_26 setCleanupCallback\n00000058 R_MIPS_26 allocateNodeMemory\n0000007c R_MIPS_26 loadCompressedData\n000000a8 R_MIPS_HI16 func_80003184_3D84\n000000b0 R_MIPS_LO16 func_80003184_3D84\n000000ac R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffd0 afb30024 00809821 afbf0028 '......$...!...(\n 0010 afb20020 afb1001c afb00018 926300c4 ... .........c..\n 0020 00031040 00431021 00021080 3c030000 ...@.C.!....<...\n 0030 24630000 00439021 8e500000 3c040000 $c...C.!.P..<...\n 0040 24840000 0c000000 00008821 ae600010 $..........!.`..\n 0050 ae60000c 92440008 0c000000 00042080 .`...D........ .\n 0060 ae620004 92420008 1840000f 00000000 .b...B...@......\n 0070 8e040000 8e050004 8e060008 0c000000 ................\n 0080 2610000c 8e630004 00112080 00832021 &....c.... ... !\n 0090 ac820000 92420008 26310001 0222102a .....B..&1...\".*\n 00a0 1440fff3 00000000 3c040000 0c000000 .@......<.......\n 00b0 24840000 8fbf0028 8fb30024 8fb20020 $......(...$... \n 00c0 8fb1001c 8fb00018 03e00008 27bd0030 ............'..0\nContents of section .reginfo:\n 0000 a00f007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","symbolMap":true,"outcome":"declined","source":"/* asmlift could not decompile 'loadAssetGroupResources' — lift: cannot lift 'loadAssetGroupResources': function call 'jal' at 0x44 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-48 */\n/* 4:\tsw\ts3,36(sp) */\n/* 8:\tmove\ts3,a0 */\n/* c:\tsw\tra,40(sp) */\n/* 10:\tsw\ts2,32(sp) */\n/* 14:\tsw\ts1,28(sp) */\n/* 18:\tsw\ts0,24(sp) */\n/* 1c:\tlbu\tv1,196(s3) */\n/* 20:\tsll\tv0,v1,0x1 */\n/* 24:\taddu\tv0,v0,v1 */\n/* 28:\tsll\tv0,v0,0x2 */\n/* 2c:\tlui\tv1,0x0 */\n/* 30:\taddiu\tv1,v1,0 */\n/* 34:\taddu\ts2,v0,v1 */\n/* 38:\tlw\ts0,0(s2) */\n/* 3c:\tlui\ta0,0x0 */\n/* 40:\taddiu\ta0,a0,0 */\n/* 44:\tjal\t0 */\n/* 48:\tmove\ts1,zero */\n/* 4c:\tsw\tzero,16(s3) */\n/* 50:\tsw\tzero,12(s3) */\n/* 54:\tlbu\ta0,8(s2) */\n/* 58:\tjal\t0 */\n/* 5c:\tsll\ta0,a0,0x2 */\n/* 60:\tsw\tv0,4(s3) */\n/* 64:\tlbu\tv0,8(s2) */\n/* 68:\tblez\tv0,a8 */\n/* 6c:\tnop */\n/* 70:\tlw\ta0,0(s0) */\n/* 74:\tlw\ta1,4(s0) */\n/* 78:\tlw\ta2,8(s0) */\n/* 7c:\tjal\t0 */\n/* 80:\taddiu\ts0,s0,12 */\n/* 84:\tlw\tv1,4(s3) */\n/* 88:\tsll\ta0,s1,0x2 */\n/* 8c:\taddu\ta0,a0,v1 */\n/* 90:\tsw\tv0,0(a0) */\n/* 94:\tlbu\tv0,8(s2) */\n/* 98:\taddiu\ts1,s1,1 */\n/* 9c:\tslt\tv0,s1,v0 */\n/* a0:\tbnez\tv0,70 */\n/* a4:\tnop */\n/* a8:\tlui\ta0,0x0 */\n/* ac:\tjal\t0 */\n/* b0:\taddiu\ta0,a0,0 */\n/* b4:\tlw\tra,40(sp) */\n/* b8:\tlw\ts3,36(sp) */\n/* bc:\tlw\ts2,32(sp) */\n/* c0:\tlw\ts1,28(sp) */\n/* c4:\tlw\ts0,24(sp) */\n/* c8:\tjr\tra */\n/* cc:\taddiu\tsp,sp,48 */\nvoid loadAssetGroupResources(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'loadAssetGroupResources': function call 'jal' at 0x44 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":60,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'loadAssetGroupResources': function call 'jal' at 0x44 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void loadAssetGroupResources(AssetGroupTaskData *taskData) {\n AssetEntry *var_s0;\n AssetGroupTableEntry *temp_s2;\n s32 temp_a2;\n s32 var_s1;\n void *temp_a0;\n void *temp_a1;\n\n temp_s2 = &assetGroupTable[taskData->groupIndex];\n var_s0 = temp_s2->assetList;\n var_s1 = 0;\n setCleanupCallback(freeAssetGroupResources);\n taskData->unk10 = NULL;\n taskData->unkC = NULL;\n taskData->loadedAssets = allocateNodeMemory(temp_s2->assetCount * 4);\n if ((s32) temp_s2->assetCount > 0) {\n do {\n temp_a0 = var_s0->unk0;\n temp_a1 = var_s0->unk4;\n temp_a2 = var_s0->unk8;\n var_s0 += 0xC;\n taskData->loadedAssets[var_s1] = loadCompressedData(temp_a0, temp_a1, temp_a2);\n var_s1 += 1;\n } while (var_s1 < (s32) temp_s2->assetCount);\n }\n setCallback(func_80003184_3D84);\n}\n","score":30,"maxScore":55,"compileErrors":null,"breakdown":{"insert":3,"delete":0,"replace":2,"opMismatch":0,"argMismatch":25},"quality":{"score":100,"lines":26,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"note":"src/3B80.c: loads each compressed asset in a group into a freshly allocated pointer array","gapSize":{"decompiler":"m2c","score":30,"maxScore":55,"ratio":0.5454545454545454,"kinds":{"insert":3,"delete":0,"replace":2,"opMismatch":0,"argMismatch":25}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loadAssetGroupResources` — benchmark function snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n# asmlift checkout — this function's context is the project's own vendored headers, stored in\n# the repo (referenced, not embedded — it is ~10–260 KB):\nASMLIFT_PATH='/path/to/asmlift'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loadAssetGroupResources\n addiu\t$sp, $sp, -48\n sw\t$s3, 36($sp)\n move\t$s3, $a0\n sw\t$ra, 40($sp)\n sw\t$s2, 32($sp)\n sw\t$s1, 28($sp)\n sw\t$s0, 24($sp)\n lbu\t$v1, 196($s3)\n sll\t$v0, $v1, 0x1\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x2\n lui\t$v1, %hi(assetGroupTable)\n addiu\t$v1, $v1, %lo(assetGroupTable)\n addu\t$s2, $v0, $v1\n lw\t$s0, 0($s2)\n lui\t$a0, %hi(freeAssetGroupResources)\n addiu\t$a0, $a0, %lo(freeAssetGroupResources)\n jal\tsetCleanupCallback\n move\t$s1, $zero\n sw\t$zero, 16($s3)\n sw\t$zero, 12($s3)\n lbu\t$a0, 8($s2)\n jal\tallocateNodeMemory\n sll\t$a0, $a0, 0x2\n sw\t$v0, 4($s3)\n lbu\t$v0, 8($s2)\n blez\t$v0, .La8\n nop\n.L70:\n lw\t$a0, 0($s0)\n lw\t$a1, 4($s0)\n lw\t$a2, 8($s0)\n jal\tloadCompressedData\n addiu\t$s0, $s0, 12\n lw\t$v1, 4($s3)\n sll\t$a0, $s1, 0x2\n addu\t$a0, $a0, $v1\n sw\t$v0, 0($a0)\n lbu\t$v0, 8($s2)\n addiu\t$s1, $s1, 1\n slt\t$v0, $s1, $v0\n bnez\t$v0, .L70\n nop\n.La8:\n lui\t$a0, %hi(func_80003184_3D84)\n jal\tsetCallback\n addiu\t$a0, $a0, %lo(func_80003184_3D84)\n lw\t$ra, 40($sp)\n lw\t$s3, 36($sp)\n lw\t$s2, 32($sp)\n lw\t$s1, 28($sp)\n lw\t$s0, 24($sp)\n jr\t$ra\n addiu\t$sp, $sp, 48\nASM_INPUT\n\n# The project context the benchmark passed via --context, exactly as its real workflow would —\n# GCC attributes stripped (m2c's C parser cannot read them; same expression the harness uses),\n# plus the function's own prototype (the TU-derived context never forward-declares it).\ngunzip -kc \"$ASMLIFT_PATH/apps/benchmark/dataset/real/tu/snowboardkids2/ctx-96e61b4ff9f1.i.gz\" | perl -pe 's/__attribute__\\s*\\(\\((?:[^()]|\\((?:[^()]|\\([^()]*\\))*\\))*\\)\\)//g' > ctx.h\ncat >> ctx.h <<'CTX_PROTO'\nvoid loadAssetGroupResources(AssetGroupTaskData *taskData);\nCTX_PROTO\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loadAssetGroupResources # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loadAssetGroupResources` — benchmark function snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# This function's decomp project — the PINNED benchmark branch (provenance base + one\n# integration commit). Not needed to run this script (inputs are embedded/vendored); to\n# rebuild the project itself:\n# git clone --branch asmlift-benchmark https://github.com/macabeus/snowboardkids2-decomp.git snowboardkids2-decomp\n# make -C snowboardkids2-decomp\n# make -C snowboardkids2-decomp asmlift-elf # derive the symbols ELF (DWARF types-sidecar)\n# SYMBOLS: this row ran WITH the project's symbol map (names + declaration shapes derived\n# from the ELF its decomp.yaml names), vendored at apps/benchmark/dataset/real/tu/snowboardkids2/symbols.json.gz\n# sha256 of the decompressed map JSON: 4d765490a2f31cb671de3f40c8e4db2adef2fe77856e827a1a9025d82a0f6685\n# Set PROJECT_PATH to your BUILT checkout of the project above (clone recipe in the comments);\n# step 1 then points the scoring config at the checkout's decomp.yaml (tools.asmlift.elf) —\n# the CLI loads the same map, so this run reproduces the row's named spellings. A missing\n# checkout/ELF warns and runs map-less (output may then differ from the row).\nPROJECT_PATH='/path/to/snowboardkids2-decomp'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# --project-root grafts the checkout's tools.asmlift.elf (the symbol map) into that decomp.yaml.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target snowboardkids2:loadAssetGroupResources:gcc2.7.2kmc --out \"$PWD\" --project-root \"$PROJECT_PATH\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-48\n 4:\tsw\ts3,36(sp)\n 8:\tmove\ts3,a0\n c:\tsw\tra,40(sp)\n 10:\tsw\ts2,32(sp)\n 14:\tsw\ts1,28(sp)\n 18:\tsw\ts0,24(sp)\n 1c:\tlbu\tv1,196(s3)\n 20:\tsll\tv0,v1,0x1\n 24:\taddu\tv0,v0,v1\n 28:\tsll\tv0,v0,0x2\n 2c:\tlui\tv1,0x0\n 30:\taddiu\tv1,v1,0\n 34:\taddu\ts2,v0,v1\n 38:\tlw\ts0,0(s2)\n 3c:\tlui\ta0,0x0\n 40:\taddiu\ta0,a0,0\n 44:\tjal\t0 \n 48:\tmove\ts1,zero\n 4c:\tsw\tzero,16(s3)\n 50:\tsw\tzero,12(s3)\n 54:\tlbu\ta0,8(s2)\n 58:\tjal\t0 \n 5c:\tsll\ta0,a0,0x2\n 60:\tsw\tv0,4(s3)\n 64:\tlbu\tv0,8(s2)\n 68:\tblez\tv0,a8 \n 6c:\tnop\n 70:\tlw\ta0,0(s0)\n 74:\tlw\ta1,4(s0)\n 78:\tlw\ta2,8(s0)\n 7c:\tjal\t0 \n 80:\taddiu\ts0,s0,12\n 84:\tlw\tv1,4(s3)\n 88:\tsll\ta0,s1,0x2\n 8c:\taddu\ta0,a0,v1\n 90:\tsw\tv0,0(a0)\n 94:\tlbu\tv0,8(s2)\n 98:\taddiu\ts1,s1,1\n 9c:\tslt\tv0,s1,v0\n a0:\tbnez\tv0,70 \n a4:\tnop\n a8:\tlui\ta0,0x0\n ac:\tjal\t0 \n b0:\taddiu\ta0,a0,0\n b4:\tlw\tra,40(sp)\n b8:\tlw\ts3,36(sp)\n bc:\tlw\ts2,32(sp)\n c0:\tlw\ts1,28(sp)\n c4:\tlw\ts0,24(sp)\n c8:\tjr\tra\n cc:\taddiu\tsp,sp,48\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/bench-real-gcc-ea902f2bbc2f0c1a/u.i\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t000000d0 loadAssetGroupResources\n00000000 *UND*\t00000000 assetGroupTable\n00000000 *UND*\t00000000 freeAssetGroupResources\n00000000 *UND*\t00000000 setCleanupCallback\n00000000 *UND*\t00000000 allocateNodeMemory\n00000000 *UND*\t00000000 loadCompressedData\n00000000 *UND*\t00000000 func_80003184_3D84\n00000000 *UND*\t00000000 setCallback\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000002c R_MIPS_HI16 assetGroupTable\n00000030 R_MIPS_LO16 assetGroupTable\n0000003c R_MIPS_HI16 freeAssetGroupResources\n00000040 R_MIPS_LO16 freeAssetGroupResources\n00000044 R_MIPS_26 setCleanupCallback\n00000058 R_MIPS_26 allocateNodeMemory\n0000007c R_MIPS_26 loadCompressedData\n000000a8 R_MIPS_HI16 func_80003184_3D84\n000000b0 R_MIPS_LO16 func_80003184_3D84\n000000ac R_MIPS_26 setCallback\n\n\nContents of section .text:\n 0000 27bdffd0 afb30024 00809821 afbf0028 '......$...!...(\n 0010 afb20020 afb1001c afb00018 926300c4 ... .........c..\n 0020 00031040 00431021 00021080 3c030000 ...@.C.!....<...\n 0030 24630000 00439021 8e500000 3c040000 $c...C.!.P..<...\n 0040 24840000 0c000000 00008821 ae600010 $..........!.`..\n 0050 ae60000c 92440008 0c000000 00042080 .`...D........ .\n 0060 ae620004 92420008 1840000f 00000000 .b...B...@......\n 0070 8e040000 8e050004 8e060008 0c000000 ................\n 0080 2610000c 8e630004 00112080 00832021 &....c.... ... !\n 0090 ac820000 92420008 26310001 0222102a .....B..&1...\".*\n 00a0 1440fff3 00000000 3c040000 0c000000 .@......<.......\n 00b0 24840000 8fbf0028 8fb30024 8fb20020 $......(...$... \n 00c0 8fb1001c 8fb00018 03e00008 27bd0030 ............'..0\nContents of section .reginfo:\n 0000 a00f007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"loadAssetGroupResources\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\n# (real tier: candidates are scored INSIDE the project's own context — step 1 materializes the\n# row's vendored context next to target.o as ctx.i, and the generated decomp.yaml concatenates\n# it ahead of every candidate, so this scores in the same world the benchmark did)\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name loadAssetGroupResources # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absdiff:agbcc","sym":"absdiff","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absdiff(int a,int b){ return a>b?a-b:b-a; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tabsdiff\n\t.type\t absdiff,function\n\t.thumb_func\nabsdiff:\n\tsub\tr2, r1, r0\n\tcmp\tr0, r1\n\tble\t.L3\t@cond_branch\n\tsub\tr2, r0, r1\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t absdiff,.Lfe1-absdiff\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 absdiff(u32 a0, u32 a1) {\n s32 v0;\n if (a0 <= a1) {\n v0 = a1 - a0;\n } else {\n v0 = a0 - a1;\n }\n return v0;\n}\n","score":3,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 absdiff(s32 arg0, s32 arg1) {\n s32 var_r2;\n\n var_r2 = arg1 - arg0;\n if (arg0 > arg1) {\n var_r2 = arg0 - arg1;\n }\n return var_r2;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absdiff` — benchmark function synthetic:absdiff:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tabsdiff\n\t.type\t absdiff,function\n\t.thumb_func\nabsdiff:\n\tsub\tr2, r1, r0\n\tcmp\tr0, r1\n\tble\t.L3\t@cond_branch\n\tsub\tr2, r0, r1\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t absdiff,.Lfe1-absdiff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absdiff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absdiff` — benchmark function synthetic:absdiff:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absdiff:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tabsdiff\n\t.type\t absdiff,function\n\t.thumb_func\nabsdiff:\n\tsub\tr2, r1, r0\n\tcmp\tr0, r1\n\tble\t.L3\t@cond_branch\n\tsub\tr2, r0, r1\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t absdiff,.Lfe1-absdiff\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name absdiff # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absdiff:gcc2.7.2kmc","sym":"absdiff","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absdiff(int a,int b){ return a>b?a-b:b-a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a1,a0\n 4:\tbnez\tv0,10 \n 8:\tsubu\tv0,a0,a1\n c:\tsubu\tv0,a1,a0\n 10:\tjr\tra\n 14:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-463517d84d0cef9e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 absdiff\n\n\nContents of section .text:\n 0000 00a4102a 14400002 00851023 00a41023 ...*.@.....#...#\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 absdiff(s32 a0, s32 a1) {\n s32 v0;\n if (a1 < a0) {\n v0 = a0 - a1;\n } else {\n v0 = a1 - a0;\n }\n return v0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 absdiff(s32 arg0, s32 arg1) {\n s32 var_v0;\n\n var_v0 = arg0 - arg1;\n if (arg1 >= arg0) {\n var_v0 = arg1 - arg0;\n }\n return var_v0;\n}\n","score":3,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absdiff` — benchmark function synthetic:absdiff:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel absdiff\n slt\t$v0, $a1, $a0\n bnez\t$v0, .L10\n subu\t$v0, $a0, $a1\n subu\t$v0, $a1, $a0\n.L10:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absdiff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absdiff` — benchmark function synthetic:absdiff:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absdiff:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a1,a0\n 4:\tbnez\tv0,10 \n 8:\tsubu\tv0,a0,a1\n c:\tsubu\tv0,a1,a0\n 10:\tjr\tra\n 14:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-463517d84d0cef9e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 absdiff\n\n\nContents of section .text:\n 0000 00a4102a 14400002 00851023 00a41023 ...*.@.....#...#\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name absdiff # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absdiff:ido7.1","sym":"absdiff","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absdiff(int a,int b){ return a>b?a-b:b-a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a1,a0\n 4:\tbeqz\tat,14 \n 8:\tsubu\tv1,a1,a0\n c:\tjr\tra\n 10:\tsubu\tv0,a0,a1\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c absdiff\n\n\nContents of section .text:\n 0000 00a4082a 10200003 00a41823 03e00008 ...*. .....#....\n 0010 00851023 03e00008 00601025 00000000 ...#.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000003e 00000000 . .........>....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003e 00000000 00000000 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 36333531 37643834 64306365 ef-463517d84d0ce\n 0130 6639652f 7265662e 63006162 73646966 f9e/ref.c.absdif\n 0140 66000000 61627364 69666600 00000000 f...absdiff.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000007 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 absdiff(s32 a0, s32 a1) {\n if (a1 < a0) {\n return a0 - a1;\n } else {\n return a1 - a0;\n }\n}\n","score":2,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 absdiff(s32 arg0, s32 arg1) {\n if (arg1 < arg0) {\n return arg0 - arg1;\n }\n return arg1 - arg0;\n}\n","score":2,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":7,"ratio":0.2857142857142857,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absdiff` — benchmark function synthetic:absdiff:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel absdiff\n slt\t$at, $a1, $a0\n beqz\t$at, .L14\n subu\t$v1, $a1, $a0\n jr\t$ra\n subu\t$v0, $a0, $a1\n.L14:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absdiff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absdiff` — benchmark function synthetic:absdiff:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absdiff:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a1,a0\n 4:\tbeqz\tat,14 \n 8:\tsubu\tv1,a1,a0\n c:\tjr\tra\n 10:\tsubu\tv0,a0,a1\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c absdiff\n\n\nContents of section .text:\n 0000 00a4082a 10200003 00a41823 03e00008 ...*. .....#....\n 0010 00851023 03e00008 00601025 00000000 ...#.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000003e 00000000 . .........>....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003e 00000000 00000000 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 36333531 37643834 64306365 ef-463517d84d0ce\n 0130 6639652f 7265662e 63006162 73646966 f9e/ref.c.absdif\n 0140 66000000 61627364 69666600 00000000 f...absdiff.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000007 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name absdiff # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absdiff:mwcc_242_81","sym":"absdiff","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absdiff(int a,int b){ return a>b?a-b:b-a; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tsubf r0,r3,r4\n 8:\tble 10 \n c:\tsubf r0,r4,r3\n 10:\tmr r3,r0\n 14:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 absdiff\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 absdiff\n\n\nContents of section .text:\n 0000 7c032000 7c032050 40810008 7c041850 |. .|. P@...|..P\n 0010 7c030378 4e800020 |..xN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 absdiff(s32 a0, s32 a1) {\n s32 v0;\n if (a0 <= a1) {\n v0 = a1 - a0;\n } else {\n v0 = a0 - a1;\n }\n return v0;\n}\n","score":3,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 absdiff(s32 arg0, s32 arg1) {\n s32 var_r0;\n\n var_r0 = arg1 - arg0;\n if (arg0 > arg1) {\n var_r0 = arg0 - arg1;\n }\n return var_r0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absdiff` — benchmark function synthetic:absdiff:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel absdiff\n cmpw r3,r4\n subf r0,r3,r4\n ble .L10\n subf r0,r4,r3\n.L10:\n mr r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absdiff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absdiff` — benchmark function synthetic:absdiff:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absdiff:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tsubf r0,r3,r4\n 8:\tble 10 \n c:\tsubf r0,r4,r3\n 10:\tmr r3,r0\n 14:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 absdiff\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 absdiff\n\n\nContents of section .text:\n 0000 7c032000 7c032050 40810008 7c041850 |. .|. P@...|..P\n 0010 7c030378 4e800020 |..xN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name absdiff # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absi:agbcc","sym":"absi","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absi(int x){ return x<0?-x:x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tabsi\n\t.type\t absi,function\n\t.thumb_func\nabsi:\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr0, r0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t absi,.Lfe1-absi\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 absi(s32 a0) {\n if (a0 < 0) a0 = -a0;\n return a0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 absi(s32 arg0) {\n s32 var_r0;\n\n var_r0 = arg0;\n if (var_r0 < 0) {\n var_r0 = 0 - var_r0;\n }\n return var_r0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absi` — benchmark function synthetic:absi:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tabsi\n\t.type\t absi,function\n\t.thumb_func\nabsi:\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr0, r0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t absi,.Lfe1-absi\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absi` — benchmark function synthetic:absi:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absi:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tabsi\n\t.type\t absi,function\n\t.thumb_func\nabsi:\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tneg\tr0, r0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t absi,.Lfe1-absi\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name absi # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absi:gcc2.7.2kmc","sym":"absi","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absi(int x){ return x<0?-x:x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,a0\n 4:\tbltzl\tv0,c \n 8:\tnegu\tv0,v0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d5a2469bd227d9c3/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 absi\n\n\nContents of section .text:\n 0000 00801021 04420001 00021023 03e00008 ...!.B.....#....\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'absi' — lift: cannot lift 'absi': unmodelled control transfer 'bltzl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv0,a0 */\n/* 4:\tbltzl\tv0,c */\n/* 8:\tnegu\tv0,v0 */\n/* c:\tjr\tra */\n/* 10:\tnop */\n/* \t... */\nvoid absi(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'absi': unmodelled control transfer 'bltzl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":14,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'absi': unmodelled control transfer 'bltzl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 absi(s32 arg0) {\n s32 var_v0;\n\n var_v0 = arg0;\n if (var_v0 < 0) {\n var_v0 = -var_v0;\n }\n return var_v0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absi` — benchmark function synthetic:absi:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel absi\n move\t$v0, $a0\n bltzl\t$v0, .Lc\n negu\t$v0, $v0\n.Lc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absi` — benchmark function synthetic:absi:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absi:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,a0\n 4:\tbltzl\tv0,c \n 8:\tnegu\tv0,v0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d5a2469bd227d9c3/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 absi\n\n\nContents of section .text:\n 0000 00801021 04420001 00021023 03e00008 ...!.B.....#....\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name absi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absi:ido7.1","sym":"absi","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absi(int x){ return x<0?-x:x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tmove\tv1,a0\n 8:\tjr\tra\n c:\tnegu\tv0,a0\n 10:\tjr\tra\n 14:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 absi\n\n\nContents of section .text:\n 0000 04810003 00801825 03e00008 00041023 .......%.......#\n 0010 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 35613234 36396264 32323764 ef-d5a2469bd227d\n 0130 3963332f 7265662e 63006162 73690000 9c3/ref.c.absi..\n 0140 61627369 00000000 00000000 00000001 absi............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 absi(s32 a0) {\n if (a0 < 0) {\n return -a0;\n } else {\n return a0;\n }\n}\n","score":2,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 absi(s32 arg0) {\n if (arg0 < 0) {\n return -arg0;\n }\n return arg0;\n}\n","score":2,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":6,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absi` — benchmark function synthetic:absi:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel absi\n bgez\t$a0, .L10\n move\t$v1, $a0\n jr\t$ra\n negu\t$v0, $a0\n.L10:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absi` — benchmark function synthetic:absi:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absi:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tmove\tv1,a0\n 8:\tjr\tra\n c:\tnegu\tv0,a0\n 10:\tjr\tra\n 14:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 absi\n\n\nContents of section .text:\n 0000 04810003 00801825 03e00008 00041023 .......%.......#\n 0010 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 35613234 36396264 32323764 ef-d5a2469bd227d\n 0130 3963332f 7265662e 63006162 73690000 9c3/ref.c.absi..\n 0140 61627369 00000000 00000000 00000001 absi............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name absi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:absi:mwcc_242_81","sym":"absi","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int absi(int x){ return x<0?-x:x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrawi r4,r3,31\n 4:\txor r0,r4,r3\n 8:\tsubf r3,r4,r0\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 absi\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 absi\n\n\nContents of section .text:\n 0000 7c64fe70 7c801a78 7c640050 4e800020 |d.p|..x|d.PN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 absi(s32 a0) {\n return (a0 >> 31 ^ a0) - (a0 >> 31);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 absi(s32 arg0) {\n s32 temp_r4;\n\n temp_r4 = arg0 >> 0x1F;\n return (temp_r4 ^ arg0) - temp_r4;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `absi` — benchmark function synthetic:absi:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel absi\n srawi r4,r3,31\n xor r0,r4,r3\n subf r3,r4,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function absi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `absi` — benchmark function synthetic:absi:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:absi:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrawi r4,r3,31\n 4:\txor r0,r4,r3\n 8:\tsubf r3,r4,r0\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 absi\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 absi\n\n\nContents of section .text:\n 0000 7c64fe70 7c801a78 7c640050 4e800020 |d.p|..x|d.PN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name absi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:add:agbcc","sym":"add","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int add(int a,int b){ return a+b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tadd\n\t.type\t add,function\n\t.thumb_func\nadd:\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t add,.Lfe1-add\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 add(u32 a0, u32 a1) {\n return a0 + a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 add(s32 arg0, s32 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add` — benchmark function synthetic:add:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tadd\n\t.type\t add,function\n\t.thumb_func\nadd:\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t add,.Lfe1-add\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add` — benchmark function synthetic:add:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:add:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tadd\n\t.type\t add,function\n\t.thumb_func\nadd:\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t add,.Lfe1-add\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name add # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:add:gcc2.7.2kmc","sym":"add","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int add(int a,int b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddu\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-133ae1fb7cf38ace/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 add\n\n\nContents of section .text:\n 0000 03e00008 00851021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 add(u32 a0, u32 a1) {\n return a0 + a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 add(s32 arg0, s32 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add` — benchmark function synthetic:add:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add\n jr\t$ra\n addu\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add` — benchmark function synthetic:add:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:add:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddu\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-133ae1fb7cf38ace/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 add\n\n\nContents of section .text:\n 0000 03e00008 00851021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name add # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:add:ido7.1","sym":"add","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic"],"loc":1,"refSource":"int add(int a,int b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddu\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 add\n\n\nContents of section .text:\n 0000 03e00008 00851021 00000000 00000000 .......!........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 33336165 31666237 63663338 ef-133ae1fb7cf38\n 0130 6163652f 7265662e 63006164 64000000 ace/ref.c.add...\n 0140 61646400 00000000 00000001 00000000 add.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 add(u32 a0, u32 a1) {\n return a0 + a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 add(s32 arg0, s32 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add` — benchmark function synthetic:add:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add\n jr\t$ra\n addu\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add` — benchmark function synthetic:add:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:add:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\taddu\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 add\n\n\nContents of section .text:\n 0000 03e00008 00851021 00000000 00000000 .......!........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 33336165 31666237 63663338 ef-133ae1fb7cf38\n 0130 6163652f 7265662e 63006164 64000000 ace/ref.c.add...\n 0140 61646400 00000000 00000001 00000000 add.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:add:mwcc_242_81","sym":"add","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int add(int a,int b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tadd r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 add\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 add\n\n\nContents of section .text:\n 0000 7c632214 4e800020 |c\".N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 add(u32 a0, u32 a1) {\n return a0 + a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 add(s32 arg0, s32 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `add` — benchmark function synthetic:add:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel add\n add r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function add # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `add` — benchmark function synthetic:add:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:add:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tadd r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 add\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 add\n\n\nContents of section .text:\n 0000 7c632214 4e800020 |c\".N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name add # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:addu8:agbcc","sym":"addu8","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"u8 addu8(u8 a,u8 b){ return a+b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\taddu8\n\t.type\t addu8,function\n\t.thumb_func\naddu8:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t addu8,.Lfe1-addu8\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 addu8(u32 a0, u32 a1) {\n return (u8)((u8)a0 + (u8)a1);\n}\n","score":4,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":98,"lines":3,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u8 addu8(u8 arg0, u8 arg1) {\n return (u8) (arg0 + arg1);\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `addu8` — benchmark function synthetic:addu8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\taddu8\n\t.type\t addu8,function\n\t.thumb_func\naddu8:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t addu8,.Lfe1-addu8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function addu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `addu8` — benchmark function synthetic:addu8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:addu8:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\taddu8\n\t.type\t addu8,function\n\t.thumb_func\naddu8:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tlsl\tr1, r1, #0x18\n\tlsr\tr1, r1, #0x18\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t addu8,.Lfe1-addu8\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name addu8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:addu8:gcc2.7.2kmc","sym":"addu8","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"u8 addu8(u8 a,u8 b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0xff\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-58d9a3ec3194e30b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c addu8\n\n\nContents of section .text:\n 0000 00851021 03e00008 304200ff 00000000 ...!....0B......\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 addu8(u32 a0, u32 a1) {\n return a0 + a1 & 255;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 addu8(s32 arg0, s32 arg1) {\n return (arg0 + arg1) & 0xFF;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `addu8` — benchmark function synthetic:addu8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel addu8\n addu\t$v0, $a0, $a1\n jr\t$ra\n andi\t$v0, $v0, 0xff\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function addu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `addu8` — benchmark function synthetic:addu8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:addu8:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0xff\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-58d9a3ec3194e30b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c addu8\n\n\nContents of section .text:\n 0000 00851021 03e00008 304200ff 00000000 ...!....0B......\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name addu8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:addu8:ido7.1","sym":"addu8","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"u8 addu8(u8 a,u8 b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tandi\tv0,v0,0xff\n 8:\tsw\ta0,0(sp)\n c:\tjr\tra\n 10:\tsw\ta1,4(sp)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 addu8\n\n\nContents of section .text:\n 0000 00851021 304200ff afa40000 03e00008 ...!0B..........\n 0010 afa50004 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 38643961 33656333 31393465 ef-58d9a3ec3194e\n 0130 3330622f 7265662e 63006164 64753800 30b/ref.c.addu8.\n 0140 61646475 38000000 00000000 00000001 addu8...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 addu8(u32 a0, u32 a1) {\n return a0 + a1 & 255;\n}\n","score":4,"maxScore":6,"compileErrors":null,"breakdown":{"insert":1,"delete":3,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 addu8(s32 arg0, s32 arg1) {\n return (arg0 + arg1) & 0xFF;\n}\n","score":4,"maxScore":6,"compileErrors":null,"breakdown":{"insert":1,"delete":3,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":4,"maxScore":6,"ratio":0.6666666666666666,"kinds":{"insert":1,"delete":3,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `addu8` — benchmark function synthetic:addu8:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel addu8\n addu\t$v0, $a0, $a1\n andi\t$v0, $v0, 0xff\n sw\t$a0, 0($sp)\n jr\t$ra\n sw\t$a1, 4($sp)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function addu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `addu8` — benchmark function synthetic:addu8:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:addu8:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tandi\tv0,v0,0xff\n 8:\tsw\ta0,0(sp)\n c:\tjr\tra\n 10:\tsw\ta1,4(sp)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 addu8\n\n\nContents of section .text:\n 0000 00851021 304200ff afa40000 03e00008 ...!0B..........\n 0010 afa50004 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 38643961 33656333 31393465 ef-58d9a3ec3194e\n 0130 3330622f 7265662e 63006164 64753800 30b/ref.c.addu8.\n 0140 61646475 38000000 00000000 00000001 addu8...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name addu8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:addu8:mwcc_242_81","sym":"addu8","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"u8 addu8(u8 a,u8 b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tadd r0,r3,r4\n 4:\tclrlwi r3,r0,24\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c addu8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 addu8\n\n\nContents of section .text:\n 0000 7c032214 5403063e 4e800020 |.\".T..>N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 addu8(u32 a0, u32 a1) {\n return a0 + a1 & 255;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u8 addu8(s32 arg0, s32 arg1) {\n return (u8) (arg0 + arg1);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `addu8` — benchmark function synthetic:addu8:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel addu8\n add r0,r3,r4\n clrlwi r3,r0,24\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function addu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `addu8` — benchmark function synthetic:addu8:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:addu8:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tadd r0,r3,r4\n 4:\tclrlwi r3,r0,24\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c addu8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 addu8\n\n\nContents of section .text:\n 0000 7c032214 5403063e 4e800020 |.\".T..>N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name addu8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:aidx:agbcc","sym":"aidx","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","array","variable-index"],"loc":1,"refSource":"int aidx(int *p,int i){ return p[i]; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\taidx\n\t.type\t aidx,function\n\t.thumb_func\naidx:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t aidx,.Lfe1-aidx\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 aidx(s32 * a0, u32 a1) {\n return a0[a1];\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 aidx(s32 arg0, s32 arg1) {\n return *((arg1 * 4) + arg0);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:3: invalid type argument of `unary *'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `aidx` — benchmark function synthetic:aidx:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\taidx\n\t.type\t aidx,function\n\t.thumb_func\naidx:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t aidx,.Lfe1-aidx\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function aidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `aidx` — benchmark function synthetic:aidx:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:aidx:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\taidx\n\t.type\t aidx,function\n\t.thumb_func\naidx:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tldr\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t aidx,.Lfe1-aidx\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name aidx # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:aidx:gcc2.7.2kmc","sym":"aidx","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","array","variable-index"],"loc":1,"refSource":"int aidx(int *p,int i){ return p[i]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta1,a1,0x2\n 4:\taddu\ta1,a1,a0\n 8:\tjr\tra\n c:\tlw\tv0,0(a1)\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b19b8a8ca21876a7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 aidx\n\n\nContents of section .text:\n 0000 00052880 00a42821 03e00008 8ca20000 ..(...(!........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 aidx(s32 * a0, u32 a1) {\n return a0[a1];\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 aidx(s32 arg0, s32 arg1) {\n return *((arg1 * 4) + arg0);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: invalid type argument of `unary *'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `aidx` — benchmark function synthetic:aidx:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel aidx\n sll\t$a1, $a1, 0x2\n addu\t$a1, $a1, $a0\n jr\t$ra\n lw\t$v0, 0($a1)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function aidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `aidx` — benchmark function synthetic:aidx:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:aidx:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta1,a1,0x2\n 4:\taddu\ta1,a1,a0\n 8:\tjr\tra\n c:\tlw\tv0,0(a1)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b19b8a8ca21876a7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 aidx\n\n\nContents of section .text:\n 0000 00052880 00a42821 03e00008 8ca20000 ..(...(!........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name aidx # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:aidx:ido7.1","sym":"aidx","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","array","variable-index"],"loc":1,"refSource":"int aidx(int *p,int i){ return p[i]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x2\n 4:\taddu\tt7,a0,t6\n 8:\tjr\tra\n c:\tlw\tv0,0(t7)\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 aidx\n\n\nContents of section .text:\n 0000 00057080 008e7821 03e00008 8de20000 ..p...x!........\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 31396238 61386361 32313837 ef-b19b8a8ca2187\n 0130 3661372f 7265662e 63006169 64780000 6a7/ref.c.aidx..\n 0140 61696478 00000000 00000000 00000001 aidx............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 aidx(s32 * a0, u32 a1) {\n return a0[a1];\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 aidx(s32 arg0, s32 arg1) {\n return *(arg0 + (arg1 * 4));\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: Dereferenced a non-pointer."]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `aidx` — benchmark function synthetic:aidx:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel aidx\n sll\t$t6, $a1, 0x2\n addu\t$t7, $a0, $t6\n jr\t$ra\n lw\t$v0, 0($t7)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function aidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `aidx` — benchmark function synthetic:aidx:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:aidx:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x2\n 4:\taddu\tt7,a0,t6\n 8:\tjr\tra\n c:\tlw\tv0,0(t7)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 aidx\n\n\nContents of section .text:\n 0000 00057080 008e7821 03e00008 8de20000 ..p...x!........\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 31396238 61386361 32313837 ef-b19b8a8ca2187\n 0130 3661372f 7265662e 63006169 64780000 6a7/ref.c.aidx..\n 0140 61696478 00000000 00000000 00000001 aidx............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name aidx # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:aidx:mwcc_242_81","sym":"aidx","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","array","variable-index"],"loc":1,"refSource":"int aidx(int *p,int i){ return p[i]; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,2\n 4:\tlwzx r3,r3,r0\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c aidx\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 aidx\n\n\nContents of section .text:\n 0000 5480103a 7c63002e 4e800020 T..:|c..N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 aidx(s32 * a0, u32 a1) {\n return a0[a1];\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 aidx(s32 arg0, s32 arg1) {\n return *(arg0 + (arg1 * 4));\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^","# pointer/array required"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `aidx` — benchmark function synthetic:aidx:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel aidx\n slwi r0,r4,2\n lwzx r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function aidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `aidx` — benchmark function synthetic:aidx:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:aidx:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,2\n 4:\tlwzx r3,r3,r0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c aidx\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 aidx\n\n\nContents of section .text:\n 0000 5480103a 7c63002e 4e800020 T..:|c..N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name aidx # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:arraysum:agbcc","sym":"arraysum","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for","memory","array"],"loc":1,"refSource":"int arraysum(int *a,int n){ int s=0,i; for(i=0;i= a1) {\n v1 = 0;\n } else {\n v0 = a0;\n v1 = 0;\n v2 = a1;\n do {\n v1 = v1 + *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":10,"maxScore":14,"compileErrors":null,"breakdown":{"insert":3,"delete":1,"replace":0,"opMismatch":1,"argMismatch":5},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 arraysum(s32 *arg0, s32 arg1) {\n s32 *var_r3;\n s32 temp_r0;\n s32 var_r1;\n s32 var_r2;\n\n var_r1 = arg1;\n var_r2 = 0;\n if (var_r1 > 0) {\n var_r3 = arg0;\n do {\n temp_r0 = *var_r3;\n var_r3 += 4;\n var_r2 += temp_r0;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n return var_r2;\n}\n","score":8,"maxScore":12,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":1,"opMismatch":1,"argMismatch":5},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":8,"maxScore":12,"ratio":0.6666666666666666,"kinds":{"insert":1,"delete":0,"replace":1,"opMismatch":1,"argMismatch":5}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `arraysum` — benchmark function synthetic:arraysum:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tarraysum\n\t.type\t arraysum,function\n\t.thumb_func\narraysum:\n\tmov\tr2, #0x0\n\tcmp\tr2, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr3, r0, #0\n.L6:\n\tldmia\tr3!, {r0}\n\tadd\tr2, r2, r0\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t arraysum,.Lfe1-arraysum\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function arraysum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `arraysum` — benchmark function synthetic:arraysum:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:arraysum:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tarraysum\n\t.type\t arraysum,function\n\t.thumb_func\narraysum:\n\tmov\tr2, #0x0\n\tcmp\tr2, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr3, r0, #0\n.L6:\n\tldmia\tr3!, {r0}\n\tadd\tr2, r2, r0\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t arraysum,.Lfe1-arraysum\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name arraysum # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:arraysum:gcc2.7.2kmc","sym":"arraysum","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for","memory","array"],"loc":1,"refSource":"int arraysum(int *a,int n){ int s=0,i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,28 \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\taddiu\ta2,a2,1\n 18:\taddu\tv1,v1,v0\n 1c:\tslt\tv0,a2,a1\n 20:\tbnez\tv0,10 \n 24:\taddiu\ta0,a0,4\n 28:\tmove\tv0,v1\n 2c:\tjr\tra\n 30:\taddiu\tsp,sp,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-18db9a7b8961e02d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 arraysum\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00007 00001821 '.....0!.......!\n 0010 8c820000 24c60001 00621821 00c5102a ....$....b.!...*\n 0020 1440fffb 24840004 00601021 03e00008 .@..$....`.!....\n 0030 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 arraysum(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n v0 = a0;\n v1 = 0;\n v2 = 0;\n while (v1 < a1) {\n v1 = v1 + 1;\n v2 = v2 + *v0;\n v0 = v0 + 1;\n }\n return v2;\n}\n","score":6,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 arraysum(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 var_a2;\n s32 var_v1;\n\n var_a0 = arg0;\n var_a2 = 0;\n var_v1 = 0;\n if (arg1 > 0) {\n do {\n var_a2 += 1;\n var_v1 += *var_a0;\n var_a0 += 4;\n } while (var_a2 < arg1);\n }\n return var_v1;\n}\n","score":9,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":13,"ratio":0.46153846153846156,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `arraysum` — benchmark function synthetic:arraysum:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel arraysum\n addiu\t$sp, $sp, -8\n move\t$a2, $zero\n blez\t$a1, .L28\n move\t$v1, $zero\n.L10:\n lw\t$v0, 0($a0)\n addiu\t$a2, $a2, 1\n addu\t$v1, $v1, $v0\n slt\t$v0, $a2, $a1\n bnez\t$v0, .L10\n addiu\t$a0, $a0, 4\n.L28:\n move\t$v0, $v1\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function arraysum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `arraysum` — benchmark function synthetic:arraysum:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:arraysum:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,28 \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\taddiu\ta2,a2,1\n 18:\taddu\tv1,v1,v0\n 1c:\tslt\tv0,a2,a1\n 20:\tbnez\tv0,10 \n 24:\taddiu\ta0,a0,4\n 28:\tmove\tv0,v1\n 2c:\tjr\tra\n 30:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-18db9a7b8961e02d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 arraysum\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00007 00001821 '.....0!.......!\n 0010 8c820000 24c60001 00621821 00c5102a ....$....b.!...*\n 0020 1440fffb 24840004 00601021 03e00008 .@..$....`.!....\n 0030 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name arraysum # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:arraysum:ido7.1","sym":"arraysum","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for","memory","array"],"loc":1,"refSource":"int arraysum(int *a,int n){ int s=0,i; for(i=0;i:\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,70 \n 8:\tmove\tv0,zero\n c:\tandi\tt0,a1,0x3\n 10:\tbeqz\tt0,38 \n 14:\tmove\ta3,t0\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\tt7,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\taddiu\ta2,a2,4\n 2c:\tbne\ta3,v0,20 \n 30:\taddu\tv1,v1,t7\n 34:\tbeq\tv0,a1,70 \n 38:\tsll\tt8,v0,0x2\n 3c:\tsll\tt9,a1,0x2\n 40:\taddu\ta3,t9,a0\n 44:\taddu\ta2,a0,t8\n 48:\tlw\tt1,0(a2)\n 4c:\tlw\tt2,4(a2)\n 50:\tlw\tt3,8(a2)\n 54:\taddu\tv1,v1,t1\n 58:\tlw\tt4,12(a2)\n 5c:\taddu\tv1,v1,t2\n 60:\taddiu\ta2,a2,16\n 64:\taddu\tv1,v1,t3\n 68:\tbne\ta2,a3,48 \n 6c:\taddu\tv1,v1,t4\n 70:\tjr\tra\n 74:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 arraysum\n\n\nContents of section .text:\n 0000 00001825 18a0001a 00001025 30a80003 ...%.......%0...\n 0010 11000009 01003825 00007080 008e3021 ......8%..p...0!\n 0020 8ccf0000 24420001 24c60004 14e2fffc ....$B..$.......\n 0030 006f1821 1045000e 0002c080 0005c880 .o.!.E..........\n 0040 03243821 00983021 8cc90000 8cca0004 .$8!..0!........\n 0050 8ccb0008 00691821 8ccc000c 006a1821 .....i.!.....j.!\n 0060 24c60010 006b1821 14c7fff7 006c1821 $....k.!.....l.!\n 0070 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8300dffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300dffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000004 000001e8 p...............\n 0010 00000005 00000330 00000001 000001ec .......0........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000038 00000294 .......P...8....\n 0040 0000000c 000002cc 00000001 000002d8 ................\n 0050 00000000 00000000 00000001 00000320 ............... \n 0060 08080802 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000078 20200001 00000001 .......x ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 38646239 61376238 39363165 ef-18db9a7b8961e\n 0130 3032642f 7265662e 63006172 72617973 02d/ref.c.arrays\n 0140 756d0000 61727261 7973756d 00000000 um..arraysum....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 0000001e ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000004 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'arraysum' — lift: cannot lift 'arraysum': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tblez\ta1,70 */\n/* 8:\tmove\tv0,zero */\n/* c:\tandi\tt0,a1,0x3 */\n/* 10:\tbeqz\tt0,38 */\n/* 14:\tmove\ta3,t0 */\n/* 18:\tsll\tt6,zero,0x2 */\n/* 1c:\taddu\ta2,a0,t6 */\n/* 20:\tlw\tt7,0(a2) */\n/* 24:\taddiu\tv0,v0,1 */\n/* 28:\taddiu\ta2,a2,4 */\n/* 2c:\tbne\ta3,v0,20 */\n/* 30:\taddu\tv1,v1,t7 */\n/* 34:\tbeq\tv0,a1,70 */\n/* 38:\tsll\tt8,v0,0x2 */\n/* 3c:\tsll\tt9,a1,0x2 */\n/* 40:\taddu\ta3,t9,a0 */\n/* 44:\taddu\ta2,a0,t8 */\n/* 48:\tlw\tt1,0(a2) */\n/* 4c:\tlw\tt2,4(a2) */\n/* 50:\tlw\tt3,8(a2) */\n/* 54:\taddu\tv1,v1,t1 */\n/* 58:\tlw\tt4,12(a2) */\n/* 5c:\taddu\tv1,v1,t2 */\n/* 60:\taddiu\ta2,a2,16 */\n/* 64:\taddu\tv1,v1,t3 */\n/* 68:\tbne\ta2,a3,48 */\n/* 6c:\taddu\tv1,v1,t4 */\n/* 70:\tjr\tra */\n/* 74:\tmove\tv0,v1 */\n/* \t... */\nvoid arraysum(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'arraysum': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":39,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'arraysum': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 arraysum(s32 arg0, s32 arg1) {\n s32 *var_a2;\n s32 temp_t0;\n s32 temp_t3;\n s32 temp_t4;\n s32 temp_t7;\n s32 temp_v1;\n s32 var_v0;\n s32 var_v1;\n void *var_a2_2;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg1 > 0) {\n temp_t0 = arg1 & 3;\n if (temp_t0 != 0) {\n var_a2 = arg0 + (0 * 4);\n do {\n temp_t7 = *var_a2;\n var_v0 += 1;\n var_a2 += 4;\n var_v1 += temp_t7;\n } while (temp_t0 != var_v0);\n if (var_v0 != arg1) {\n goto block_5;\n }\n } else {\nblock_5:\n var_a2_2 = arg0 + (var_v0 * 4);\n do {\n temp_t3 = var_a2_2->unk8;\n temp_t4 = var_a2_2->unkC;\n temp_v1 = var_v1 + var_a2_2->unk0 + var_a2_2->unk4;\n var_a2_2 += 0x10;\n var_v1 = temp_v1 + temp_t3 + temp_t4;\n } while (var_a2_2 != ((arg1 * 4) + arg0));\n }\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":88,"lines":39,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 32: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 33: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 34: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 35: Bad operand type for += or -=","cfe: Error: /cand.c, line 37: Unacceptable operand of == or !="]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `arraysum` — benchmark function synthetic:arraysum:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel arraysum\n move\t$v1, $zero\n blez\t$a1, .L70\n move\t$v0, $zero\n andi\t$t0, $a1, 0x3\n beqz\t$t0, .L38\n move\t$a3, $t0\n sll\t$t6, $zero, 0x2\n addu\t$a2, $a0, $t6\n.L20:\n lw\t$t7, 0($a2)\n addiu\t$v0, $v0, 1\n addiu\t$a2, $a2, 4\n bne\t$a3, $v0, .L20\n addu\t$v1, $v1, $t7\n beq\t$v0, $a1, .L70\n.L38:\n sll\t$t8, $v0, 0x2\n sll\t$t9, $a1, 0x2\n addu\t$a3, $t9, $a0\n addu\t$a2, $a0, $t8\n.L48:\n lw\t$t1, 0($a2)\n lw\t$t2, 4($a2)\n lw\t$t3, 8($a2)\n addu\t$v1, $v1, $t1\n lw\t$t4, 12($a2)\n addu\t$v1, $v1, $t2\n addiu\t$a2, $a2, 16\n addu\t$v1, $v1, $t3\n bne\t$a2, $a3, .L48\n addu\t$v1, $v1, $t4\n.L70:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function arraysum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `arraysum` — benchmark function synthetic:arraysum:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:arraysum:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,70 \n 8:\tmove\tv0,zero\n c:\tandi\tt0,a1,0x3\n 10:\tbeqz\tt0,38 \n 14:\tmove\ta3,t0\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\tt7,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\taddiu\ta2,a2,4\n 2c:\tbne\ta3,v0,20 \n 30:\taddu\tv1,v1,t7\n 34:\tbeq\tv0,a1,70 \n 38:\tsll\tt8,v0,0x2\n 3c:\tsll\tt9,a1,0x2\n 40:\taddu\ta3,t9,a0\n 44:\taddu\ta2,a0,t8\n 48:\tlw\tt1,0(a2)\n 4c:\tlw\tt2,4(a2)\n 50:\tlw\tt3,8(a2)\n 54:\taddu\tv1,v1,t1\n 58:\tlw\tt4,12(a2)\n 5c:\taddu\tv1,v1,t2\n 60:\taddiu\ta2,a2,16\n 64:\taddu\tv1,v1,t3\n 68:\tbne\ta2,a3,48 \n 6c:\taddu\tv1,v1,t4\n 70:\tjr\tra\n 74:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 arraysum\n\n\nContents of section .text:\n 0000 00001825 18a0001a 00001025 30a80003 ...%.......%0...\n 0010 11000009 01003825 00007080 008e3021 ......8%..p...0!\n 0020 8ccf0000 24420001 24c60004 14e2fffc ....$B..$.......\n 0030 006f1821 1045000e 0002c080 0005c880 .o.!.E..........\n 0040 03243821 00983021 8cc90000 8cca0004 .$8!..0!........\n 0050 8ccb0008 00691821 8ccc000c 006a1821 .....i.!.....j.!\n 0060 24c60010 006b1821 14c7fff7 006c1821 $....k.!.....l.!\n 0070 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8300dffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300dffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000004 000001e8 p...............\n 0010 00000005 00000330 00000001 000001ec .......0........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000038 00000294 .......P...8....\n 0040 0000000c 000002cc 00000001 000002d8 ................\n 0050 00000000 00000000 00000001 00000320 ............... \n 0060 08080802 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000078 20200001 00000001 .......x ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 38646239 61376238 39363165 ef-18db9a7b8961e\n 0130 3032642f 7265662e 63006172 72617973 02d/ref.c.arrays\n 0140 756d0000 61727261 7973756d 00000000 um..arraysum....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 0000001e ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000004 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name arraysum # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:arraysum:mwcc_242_81","sym":"arraysum","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for","memory","array"],"loc":1,"refSource":"int arraysum(int *a,int n){ int s=0,i; for(i=0;i:\n 0:\tcmpwi r4,0\n 4:\tli r7,0\n 8:\tli r8,0\n c:\tble a8 \n 10:\tcmpwi r4,8\n 14:\taddi r5,r4,-8\n 18:\tble 80 \n 1c:\taddi r0,r5,7\n 20:\tmr r6,r3\n 24:\tsrwi r0,r0,3\n 28:\tmtctr r0\n 2c:\tcmpwi r5,0\n 30:\tble 80 \n 34:\tlwz r5,0(r6)\n 38:\taddi r8,r8,8\n 3c:\tlwz r0,4(r6)\n 40:\tadd r7,r7,r5\n 44:\tlwz r5,8(r6)\n 48:\tadd r7,r7,r0\n 4c:\tlwz r0,12(r6)\n 50:\tadd r7,r7,r5\n 54:\tlwz r5,16(r6)\n 58:\tadd r7,r7,r0\n 5c:\tlwz r0,20(r6)\n 60:\tadd r7,r7,r5\n 64:\tlwz r5,24(r6)\n 68:\tadd r7,r7,r0\n 6c:\tlwz r0,28(r6)\n 70:\tadd r7,r7,r5\n 74:\taddi r6,r6,32\n 78:\tadd r7,r7,r0\n 7c:\tbdnz 34 \n 80:\tslwi r5,r8,2\n 84:\tsubf r0,r8,r4\n 88:\tadd r3,r3,r5\n 8c:\tmtctr r0\n 90:\tcmpw r8,r4\n 94:\tbge a8 \n 98:\tlwz r0,0(r3)\n 9c:\taddi r3,r3,4\n a0:\tadd r7,r7,r0\n a4:\tbdnz 98 \n a8:\tmr r3,r7\n ac:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000b0 arraysum\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 arraysum\n\n\nContents of section .text:\n 0000 2c040000 38e00000 39000000 4081009c ,...8...9...@...\n 0010 2c040008 38a4fff8 40810068 38050007 ,...8...@..h8...\n 0020 7c661b78 5400e8fe 7c0903a6 2c050000 |f.xT...|...,...\n 0030 40810050 80a60000 39080008 80060004 @..P....9.......\n 0040 7ce72a14 80a60008 7ce70214 8006000c |.*.....|.......\n 0050 7ce72a14 80a60010 7ce70214 80060014 |.*.....|.......\n 0060 7ce72a14 80a60018 7ce70214 8006001c |.*.....|.......\n 0070 7ce72a14 38c60020 7ce70214 4200ffb8 |.*.8.. |...B...\n 0080 5505103a 7c082050 7c632a14 7c0903a6 U..:|. P|c*.|...\n 0090 7c082000 40800014 80030000 38630004 |. .@.......8c..\n 00a0 7ce70214 4200fff4 7ce33b78 4e800020 |...B...|.;xN.. \nContents of section .mwcats.text:\n 0000 020000b0 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 arraysum(s32 * a0, u32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 * v4;\n s32 v5;\n s32 v6;\n if (a1 <= 0) {\n v2 = 0;\n } else {\n if (a1 <= 8) {\n v1 = 0;\n v2 = 0;\n } else {\n v0 = a0;\n v1 = 0;\n v2 = 0;\n for (v3 = a1 + -8 + 7 >> 3; v3 != 0; v3 = v3 - 1) {\n v1 = v1 + 8;\n v2 = v2 + *v0 + v0[1] + v0[2] + v0[3] + v0[4] + v0[5] + v0[6] + v0[7];\n v0 = v0 + 8;\n }\n }\n v5 = v2;\n v6 = a1 - v1;\n v4 = a0 + (v1 << 2);\n while (v6 != 0) {\n v5 = v5 + *v4;\n v4 = v4 + 1;\n v6 = v6 - 1;\n }\n v2 = v5;\n }\n return v2;\n}\n","score":113,"maxScore":120,"compileErrors":null,"breakdown":{"insert":76,"delete":3,"replace":6,"opMismatch":6,"argMismatch":22},"quality":{"score":100,"lines":36,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 arraysum(void *arg0, s32 arg1) {\n s32 *var_r3;\n s32 temp_r0;\n s32 temp_r0_2;\n s32 temp_r5;\n s32 temp_r7;\n s32 var_ctr_2;\n s32 var_r7;\n s32 var_r8;\n u32 var_ctr;\n void *var_r6;\n\n var_r7 = 0;\n var_r8 = 0;\n if (arg1 > 0) {\n temp_r5 = arg1 - 8;\n if (arg1 > 8) {\n var_r6 = arg0;\n var_ctr = (u32) (temp_r5 + 7) >> 3U;\n if (temp_r5 > 0) {\n do {\n var_r8 += 8;\n temp_r0 = var_r6->unk1C;\n temp_r7 = var_r7 + var_r6->unk0 + var_r6->unk4 + var_r6->unk8 + var_r6->unkC + var_r6->unk10 + var_r6->unk14 + var_r6->unk18;\n var_r6 += 0x20;\n var_r7 = temp_r7 + temp_r0;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r3 = arg0 + (var_r8 * 4);\n var_ctr_2 = arg1 - var_r8;\n if (var_r8 < arg1) {\n do {\n temp_r0_2 = *var_r3;\n var_r3 += 4;\n var_r7 += temp_r0_2;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r7;\n}\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":100,"lines":42,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class","# Error: ^^","# Error: ^","# illegal type"]},"gapSize":{"decompiler":"asmlift","score":113,"maxScore":120,"ratio":0.9416666666666667,"kinds":{"insert":76,"delete":3,"replace":6,"opMismatch":6,"argMismatch":22}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `arraysum` — benchmark function synthetic:arraysum:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel arraysum\n cmpwi r4,0\n li r7,0\n li r8,0\n ble .La8\n cmpwi r4,8\n addi r5,r4,-8\n ble .L80\n addi r0,r5,7\n mr r6,r3\n srwi r0,r0,3\n mtctr r0\n cmpwi r5,0\n ble .L80\n.L34:\n lwz r5,0(r6)\n addi r8,r8,8\n lwz r0,4(r6)\n add r7,r7,r5\n lwz r5,8(r6)\n add r7,r7,r0\n lwz r0,12(r6)\n add r7,r7,r5\n lwz r5,16(r6)\n add r7,r7,r0\n lwz r0,20(r6)\n add r7,r7,r5\n lwz r5,24(r6)\n add r7,r7,r0\n lwz r0,28(r6)\n add r7,r7,r5\n addi r6,r6,32\n add r7,r7,r0\n bdnz .L34\n.L80:\n slwi r5,r8,2\n subf r0,r8,r4\n add r3,r3,r5\n mtctr r0\n cmpw r8,r4\n bge .La8\n.L98:\n lwz r0,0(r3)\n addi r3,r3,4\n add r7,r7,r0\n bdnz .L98\n.La8:\n mr r3,r7\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function arraysum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `arraysum` — benchmark function synthetic:arraysum:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:arraysum:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r4,0\n 4:\tli r7,0\n 8:\tli r8,0\n c:\tble a8 \n 10:\tcmpwi r4,8\n 14:\taddi r5,r4,-8\n 18:\tble 80 \n 1c:\taddi r0,r5,7\n 20:\tmr r6,r3\n 24:\tsrwi r0,r0,3\n 28:\tmtctr r0\n 2c:\tcmpwi r5,0\n 30:\tble 80 \n 34:\tlwz r5,0(r6)\n 38:\taddi r8,r8,8\n 3c:\tlwz r0,4(r6)\n 40:\tadd r7,r7,r5\n 44:\tlwz r5,8(r6)\n 48:\tadd r7,r7,r0\n 4c:\tlwz r0,12(r6)\n 50:\tadd r7,r7,r5\n 54:\tlwz r5,16(r6)\n 58:\tadd r7,r7,r0\n 5c:\tlwz r0,20(r6)\n 60:\tadd r7,r7,r5\n 64:\tlwz r5,24(r6)\n 68:\tadd r7,r7,r0\n 6c:\tlwz r0,28(r6)\n 70:\tadd r7,r7,r5\n 74:\taddi r6,r6,32\n 78:\tadd r7,r7,r0\n 7c:\tbdnz 34 \n 80:\tslwi r5,r8,2\n 84:\tsubf r0,r8,r4\n 88:\tadd r3,r3,r5\n 8c:\tmtctr r0\n 90:\tcmpw r8,r4\n 94:\tbge a8 \n 98:\tlwz r0,0(r3)\n 9c:\taddi r3,r3,4\n a0:\tadd r7,r7,r0\n a4:\tbdnz 98 \n a8:\tmr r3,r7\n ac:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000b0 arraysum\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 arraysum\n\n\nContents of section .text:\n 0000 2c040000 38e00000 39000000 4081009c ,...8...9...@...\n 0010 2c040008 38a4fff8 40810068 38050007 ,...8...@..h8...\n 0020 7c661b78 5400e8fe 7c0903a6 2c050000 |f.xT...|...,...\n 0030 40810050 80a60000 39080008 80060004 @..P....9.......\n 0040 7ce72a14 80a60008 7ce70214 8006000c |.*.....|.......\n 0050 7ce72a14 80a60010 7ce70214 80060014 |.*.....|.......\n 0060 7ce72a14 80a60018 7ce70214 8006001c |.*.....|.......\n 0070 7ce72a14 38c60020 7ce70214 4200ffb8 |.*.8.. |...B...\n 0080 5505103a 7c082050 7c632a14 7c0903a6 U..:|. P|c*.|...\n 0090 7c082000 40800014 80030000 38630004 |. .@.......8c..\n 00a0 7ce70214 4200fff4 7ce33b78 4e800020 |...B...|.;xN.. \nContents of section .mwcats.text:\n 0000 020000b0 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name arraysum # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:astore:agbcc","sym":"astore","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","array","store"],"loc":1,"refSource":"void astore(int *p,int i,int v){ p[i]=v; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tastore\n\t.type\t astore,function\n\t.thumb_func\nastore:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t astore,.Lfe1-astore\n","ctx":"void astore(int*,int,int);","proto":{"astore":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void astore(s32 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void astore(s32 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = arg2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `astore` — benchmark function synthetic:astore:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tastore\n\t.type\t astore,function\n\t.thumb_func\nastore:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t astore,.Lfe1-astore\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid astore(int*,int,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function astore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `astore` — benchmark function synthetic:astore:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:astore:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tastore\n\t.type\t astore,function\n\t.thumb_func\nastore:\n\tlsl\tr1, r1, #0x2\n\tadd\tr1, r1, r0\n\tstr\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t astore,.Lfe1-astore\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"astore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name astore # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:astore:gcc2.7.2kmc","sym":"astore","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","array","store"],"loc":1,"refSource":"void astore(int *p,int i,int v){ p[i]=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta1,a1,0x2\n 4:\taddu\ta1,a1,a0\n 8:\tjr\tra\n c:\tsw\ta2,0(a1)\n","ctx":"void astore(int*,int,int);","proto":{"astore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-9b130275db981c73/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 astore\n\n\nContents of section .text:\n 0000 00052880 00a42821 03e00008 aca60000 ..(...(!........\nContents of section .reginfo:\n 0000 80000070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void astore(s32 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void astore(s32 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = arg2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `astore` — benchmark function synthetic:astore:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel astore\n sll\t$a1, $a1, 0x2\n addu\t$a1, $a1, $a0\n jr\t$ra\n sw\t$a2, 0($a1)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid astore(int*,int,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function astore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `astore` — benchmark function synthetic:astore:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:astore:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta1,a1,0x2\n 4:\taddu\ta1,a1,a0\n 8:\tjr\tra\n c:\tsw\ta2,0(a1)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-9b130275db981c73/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 astore\n\n\nContents of section .text:\n 0000 00052880 00a42821 03e00008 aca60000 ..(...(!........\nContents of section .reginfo:\n 0000 80000070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"astore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name astore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:astore:ido7.1","sym":"astore","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","array","store"],"loc":1,"refSource":"void astore(int *p,int i,int v){ p[i]=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x2\n 4:\taddu\tt7,a0,t6\n 8:\tjr\tra\n c:\tsw\ta2,0(t7)\n","ctx":"void astore(int*,int,int);","proto":{"astore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 astore\n\n\nContents of section .text:\n 0000 00057080 008e7821 03e00008 ade60000 ..p...x!........\nContents of section .options:\n 0000 01200000 00000000 8000c070 00000000 . .........p....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c070 00000000 00000000 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 62313330 32373564 62393831 ef-9b130275db981\n 0130 6337332f 7265662e 63006173 746f7265 c73/ref.c.astore\n 0140 00000000 6173746f 72650000 00000000 ....astore......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void astore(s32 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void astore(s32 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = arg2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `astore` — benchmark function synthetic:astore:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel astore\n sll\t$t6, $a1, 0x2\n addu\t$t7, $a0, $t6\n jr\t$ra\n sw\t$a2, 0($t7)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid astore(int*,int,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function astore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `astore` — benchmark function synthetic:astore:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:astore:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x2\n 4:\taddu\tt7,a0,t6\n 8:\tjr\tra\n c:\tsw\ta2,0(t7)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 astore\n\n\nContents of section .text:\n 0000 00057080 008e7821 03e00008 ade60000 ..p...x!........\nContents of section .options:\n 0000 01200000 00000000 8000c070 00000000 . .........p....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c070 00000000 00000000 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 62313330 32373564 62393831 ef-9b130275db981\n 0130 6337332f 7265662e 63006173 746f7265 c73/ref.c.astore\n 0140 00000000 6173746f 72650000 00000000 ....astore......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"astore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name astore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:astore:mwcc_242_81","sym":"astore","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","array","store"],"loc":1,"refSource":"void astore(int *p,int i,int v){ p[i]=v; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,2\n 4:\tstwx r5,r3,r0\n 8:\tblr\n","ctx":"void astore(int*,int,int);","proto":{"astore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c astore\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 astore\n\n\nContents of section .text:\n 0000 5480103a 7ca3012e 4e800020 T..:|...N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void astore(s32 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void astore(s32 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = arg2;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `astore` — benchmark function synthetic:astore:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel astore\n slwi r0,r4,2\n stwx r5,r3,r0\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid astore(int*,int,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function astore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `astore` — benchmark function synthetic:astore:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:astore:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,2\n 4:\tstwx r5,r3,r0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c astore\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 astore\n\n\nContents of section .text:\n 0000 5480103a 7ca3012e 4e800020 T..:|...N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"astore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name astore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:avg2:agbcc","sym":"avg2","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int avg2(int a,int b){ return (a+b)/2; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tavg2\n\t.type\t avg2,function\n\t.thumb_func\navg2:\n\tadd\tr0, r0, r1\n\tlsr\tr1, r0, #0x1f\n\tadd\tr0, r0, r1\n\tasr\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t avg2,.Lfe1-avg2\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 avg2(s32 a0, s32 a1) {\n return (a0 + a1) / 2;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 avg2(s32 arg0, s32 arg1) {\n u32 temp_r0;\n\n temp_r0 = arg0 + arg1;\n return (s32) (temp_r0 + (temp_r0 >> 0x1F)) >> 1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `avg2` — benchmark function synthetic:avg2:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tavg2\n\t.type\t avg2,function\n\t.thumb_func\navg2:\n\tadd\tr0, r0, r1\n\tlsr\tr1, r0, #0x1f\n\tadd\tr0, r0, r1\n\tasr\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t avg2,.Lfe1-avg2\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function avg2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `avg2` — benchmark function synthetic:avg2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:avg2:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tavg2\n\t.type\t avg2,function\n\t.thumb_func\navg2:\n\tadd\tr0, r0, r1\n\tlsr\tr1, r0, #0x1f\n\tadd\tr0, r0, r1\n\tasr\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t avg2,.Lfe1-avg2\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name avg2 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:avg2:gcc2.7.2kmc","sym":"avg2","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int avg2(int a,int b){ return (a+b)/2; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tsrl\tv1,v0,0x1f\n 8:\taddu\tv0,v0,v1\n c:\tjr\tra\n 10:\tsra\tv0,v0,0x1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1c63b47c226d2034/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 avg2\n\n\nContents of section .text:\n 0000 00851021 00021fc2 00431021 03e00008 ...!.....C.!....\n 0010 00021043 00000000 00000000 00000000 ...C............\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 avg2(s32 a0, s32 a1) {\n return (a0 + a1) / 2;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 avg2(s32 arg0, s32 arg1) {\n u32 temp_v0;\n\n temp_v0 = arg0 + arg1;\n return (s32) (temp_v0 + (temp_v0 >> 0x1F)) >> 1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `avg2` — benchmark function synthetic:avg2:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel avg2\n addu\t$v0, $a0, $a1\n srl\t$v1, $v0, 0x1f\n addu\t$v0, $v0, $v1\n jr\t$ra\n sra\t$v0, $v0, 0x1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function avg2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `avg2` — benchmark function synthetic:avg2:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:avg2:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tsrl\tv1,v0,0x1f\n 8:\taddu\tv0,v0,v1\n c:\tjr\tra\n 10:\tsra\tv0,v0,0x1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1c63b47c226d2034/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 avg2\n\n\nContents of section .text:\n 0000 00851021 00021fc2 00431021 03e00008 ...!.....C.!....\n 0010 00021043 00000000 00000000 00000000 ...C............\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name avg2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:avg2:ido7.1","sym":"avg2","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int avg2(int a,int b){ return (a+b)/2; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tbgez\tv0,10 \n 8:\tmove\tat,v0\n c:\taddiu\tat,v0,1\n 10:\tsra\tv0,at,0x1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c avg2\n\n\nContents of section .text:\n 0000 00851021 04410002 00400821 24410001 ...!.A...@.!$A..\n 0010 00011043 03e00008 00000000 00000000 ...C............\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 63363362 34376332 32366432 ef-1c63b47c226d2\n 0130 3033342f 7265662e 63006176 67320000 034/ref.c.avg2..\n 0140 61766732 00000000 00000000 00000001 avg2............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned/regcopy","outcome":"nonmatch","source":"s32 avg2(u32 a0, u32 a1) {\n s32 v0;\n s32 w0;\n v0 = a0 + a1;\n w0 = v0;\n if (w0 < 0) w0 = w0 + 1;\n return w0 >> 1;\n}\n","score":4,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 avg2(s32 arg0, s32 arg1) {\n return (s32) (arg0 + arg1) / 2;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `avg2` — benchmark function synthetic:avg2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel avg2\n addu\t$v0, $a0, $a1\n bgez\t$v0, .L10\n move\t$at, $v0\n addiu\t$at, $v0, 1\n.L10:\n sra\t$v0, $at, 0x1\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function avg2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `avg2` — benchmark function synthetic:avg2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:avg2:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv0,a0,a1\n 4:\tbgez\tv0,10 \n 8:\tmove\tat,v0\n c:\taddiu\tat,v0,1\n 10:\tsra\tv0,at,0x1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c avg2\n\n\nContents of section .text:\n 0000 00851021 04410002 00400821 24410001 ...!.A...@.!$A..\n 0010 00011043 03e00008 00000000 00000000 ...C............\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 63363362 34376332 32366432 ef-1c63b47c226d2\n 0130 3033342f 7265662e 63006176 67320000 034/ref.c.avg2..\n 0140 61766732 00000000 00000000 00000001 avg2............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name avg2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:avg2:mwcc_242_81","sym":"avg2","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int avg2(int a,int b){ return (a+b)/2; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tadd r3,r3,r4\n 4:\tsrwi r0,r3,31\n 8:\tadd r0,r0,r3\n c:\tsrawi r3,r0,1\n 10:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 avg2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 avg2\n\n\nContents of section .text:\n 0000 7c632214 54600ffe 7c001a14 7c030e70 |c\".T`..|...|..p\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 avg2(u32 a0, u32 a1) {\n return (s32)((a0 + a1 >> 31) + (a0 + a1)) >> 1;\n}\n","score":1,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 avg2(s32 arg0, s32 arg1) {\n u32 temp_r3;\n\n temp_r3 = arg0 + arg1;\n return (s32) ((temp_r3 >> 0x1FU) + temp_r3) >> 1;\n}\n","score":1,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":5,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":5,"ratio":0.2,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `avg2` — benchmark function synthetic:avg2:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel avg2\n add r3,r3,r4\n srwi r0,r3,31\n add r0,r0,r3\n srawi r3,r0,1\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function avg2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `avg2` — benchmark function synthetic:avg2:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:avg2:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tadd r3,r3,r4\n 4:\tsrwi r0,r3,31\n 8:\tadd r0,r0,r3\n c:\tsrawi r3,r0,1\n 10:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 avg2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 avg2\n\n\nContents of section .text:\n 0000 7c632214 54600ffe 7c001a14 7c030e70 |c\".T`..|...|..p\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name avg2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:band:agbcc","sym":"band","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int band(int a,int b){ return a&b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tband\n\t.type\t band,function\n\t.thumb_func\nband:\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t band,.Lfe1-band\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 band(u32 a0, u32 a1) {\n return a0 & a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 band(s32 arg0, s32 arg1) {\n return arg0 & arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `band` — benchmark function synthetic:band:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tband\n\t.type\t band,function\n\t.thumb_func\nband:\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t band,.Lfe1-band\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function band # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `band` — benchmark function synthetic:band:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:band:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tband\n\t.type\t band,function\n\t.thumb_func\nband:\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t band,.Lfe1-band\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name band # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:band:gcc2.7.2kmc","sym":"band","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int band(int a,int b){ return a&b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tand\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b0bc44488a7f6329/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 band\n\n\nContents of section .text:\n 0000 03e00008 00851024 00000000 00000000 .......$........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 band(u32 a0, u32 a1) {\n return a0 & a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 band(s32 arg0, s32 arg1) {\n return arg0 & arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `band` — benchmark function synthetic:band:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel band\n jr\t$ra\n and\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function band # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `band` — benchmark function synthetic:band:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:band:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tand\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b0bc44488a7f6329/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 band\n\n\nContents of section .text:\n 0000 03e00008 00851024 00000000 00000000 .......$........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name band # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:band:ido7.1","sym":"band","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise"],"loc":1,"refSource":"int band(int a,int b){ return a&b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tand\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 band\n\n\nContents of section .text:\n 0000 03e00008 00851024 00000000 00000000 .......$........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 30626334 34343838 61376636 ef-b0bc44488a7f6\n 0130 3332392f 7265662e 63006261 6e640000 329/ref.c.band..\n 0140 62616e64 00000000 00000000 00000001 band............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 band(u32 a0, u32 a1) {\n return a0 & a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 band(s32 arg0, s32 arg1) {\n return arg0 & arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `band` — benchmark function synthetic:band:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel band\n jr\t$ra\n and\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function band # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `band` — benchmark function synthetic:band:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:band:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tand\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 band\n\n\nContents of section .text:\n 0000 03e00008 00851024 00000000 00000000 .......$........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 30626334 34343838 61376636 ef-b0bc44488a7f6\n 0130 3332392f 7265662e 63006261 6e640000 329/ref.c.band..\n 0140 62616e64 00000000 00000000 00000001 band............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name band # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:band:mwcc_242_81","sym":"band","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int band(int a,int b){ return a&b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tand r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 band\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 band\n\n\nContents of section .text:\n 0000 7c632038 4e800020 |c 8N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 band(u32 a0, u32 a1) {\n return a0 & a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 band(s32 arg0, s32 arg1) {\n return arg0 & arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `band` — benchmark function synthetic:band:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel band\n and r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function band # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `band` — benchmark function synthetic:band:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:band:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tand r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 band\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 band\n\n\nContents of section .text:\n 0000 7c632038 4e800020 |c 8N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name band # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bittest:agbcc","sym":"bittest","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"int bittest(int x,int n){ return (x>>n)&1; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbittest\n\t.type\t bittest,function\n\t.thumb_func\nbittest:\n\tadd\tr2, r0, #0\n\tasr\tr2, r2, r1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t bittest,.Lfe1-bittest\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 bittest(s32 a0, s32 a1) {\n return 1 & a0 >> a1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bittest(s32 arg0, s32 arg1) {\n return 1 & (arg0 >> arg1);\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bittest` — benchmark function synthetic:bittest:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbittest\n\t.type\t bittest,function\n\t.thumb_func\nbittest:\n\tadd\tr2, r0, #0\n\tasr\tr2, r2, r1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t bittest,.Lfe1-bittest\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bittest # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bittest` — benchmark function synthetic:bittest:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bittest:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbittest\n\t.type\t bittest,function\n\t.thumb_func\nbittest:\n\tadd\tr2, r0, #0\n\tasr\tr2, r2, r1\n\tmov\tr0, #0x1\n\tand\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t bittest,.Lfe1-bittest\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bittest # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bittest:gcc2.7.2kmc","sym":"bittest","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"int bittest(int x,int n){ return (x>>n)&1; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrav\tv0,a0,a1\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0x1\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2d92365ec0ecd7e5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c bittest\n\n\nContents of section .text:\n 0000 00a41007 03e00008 30420001 00000000 ........0B......\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 bittest(s32 a0, s32 a1) {\n return a0 >> a1 & 1;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bittest(s32 arg0, s32 arg1) {\n return (arg0 >> arg1) & 1;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bittest` — benchmark function synthetic:bittest:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bittest\n srav\t$v0, $a0, $a1\n jr\t$ra\n andi\t$v0, $v0, 0x1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bittest # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bittest` — benchmark function synthetic:bittest:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bittest:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrav\tv0,a0,a1\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0x1\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2d92365ec0ecd7e5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c bittest\n\n\nContents of section .text:\n 0000 00a41007 03e00008 30420001 00000000 ........0B......\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bittest # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bittest:ido7.1","sym":"bittest","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"int bittest(int x,int n){ return (x>>n)&1; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrav\tv0,a0,a1\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0x1\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c bittest\n\n\nContents of section .text:\n 0000 00a41007 03e00008 30420001 00000000 ........0B......\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 64393233 36356563 30656364 ef-2d92365ec0ecd\n 0130 3765352f 7265662e 63006269 74746573 7e5/ref.c.bittes\n 0140 74000000 62697474 65737400 00000000 t...bittest.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000003 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 bittest(s32 a0, s32 a1) {\n return a0 >> a1 & 1;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bittest(s32 arg0, s32 arg1) {\n return (arg0 >> arg1) & 1;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bittest` — benchmark function synthetic:bittest:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bittest\n srav\t$v0, $a0, $a1\n jr\t$ra\n andi\t$v0, $v0, 0x1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bittest # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bittest` — benchmark function synthetic:bittest:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bittest:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrav\tv0,a0,a1\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0x1\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c bittest\n\n\nContents of section .text:\n 0000 00a41007 03e00008 30420001 00000000 ........0B......\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 64393233 36356563 30656364 ef-2d92365ec0ecd\n 0130 3765352f 7265662e 63006269 74746573 7e5/ref.c.bittes\n 0140 74000000 62697474 65737400 00000000 t...bittest.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000003 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bittest # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bittest:mwcc_242_81","sym":"bittest","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"int bittest(int x,int n){ return (x>>n)&1; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsraw r0,r3,r4\n 4:\tclrlwi r3,r0,31\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c bittest\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bittest\n\n\nContents of section .text:\n 0000 7c602630 540307fe 4e800020 |`&0T...N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 bittest(s32 a0, s32 a1) {\n return a0 >> a1 & 1;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bittest(s32 arg0, s32 arg1) {\n return (arg0 >> arg1) & 1;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bittest` — benchmark function synthetic:bittest:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bittest\n sraw r0,r3,r4\n clrlwi r3,r0,31\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bittest # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bittest` — benchmark function synthetic:bittest:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bittest:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsraw r0,r3,r4\n 4:\tclrlwi r3,r0,31\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c bittest\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bittest\n\n\nContents of section .text:\n 0000 7c602630 540307fe 4e800020 |`&0T...N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bittest # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bnot:agbcc","sym":"bnot","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bnot(int a){ return ~a; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbnot\n\t.type\t bnot,function\n\t.thumb_func\nbnot:\n\tmvn\tr0, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t bnot,.Lfe1-bnot\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bnot(u32 a0) {\n return ~a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bnot(s32 arg0) {\n return ~arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bnot` — benchmark function synthetic:bnot:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbnot\n\t.type\t bnot,function\n\t.thumb_func\nbnot:\n\tmvn\tr0, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t bnot,.Lfe1-bnot\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bnot # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bnot` — benchmark function synthetic:bnot:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bnot:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbnot\n\t.type\t bnot,function\n\t.thumb_func\nbnot:\n\tmvn\tr0, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t bnot,.Lfe1-bnot\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bnot # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bnot:gcc2.7.2kmc","sym":"bnot","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bnot(int a){ return ~a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnor\tv0,zero,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c1b5fb7d6632a6b2/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 bnot\n\n\nContents of section .text:\n 0000 03e00008 00041027 00000000 00000000 .......'........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bnot(u32 a0) {\n return ~a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bnot(s32 arg0) {\n return ~arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bnot` — benchmark function synthetic:bnot:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bnot\n jr\t$ra\n nor\t$v0, $zero, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bnot # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bnot` — benchmark function synthetic:bnot:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bnot:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnor\tv0,zero,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c1b5fb7d6632a6b2/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 bnot\n\n\nContents of section .text:\n 0000 03e00008 00041027 00000000 00000000 .......'........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bnot # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bnot:ido7.1","sym":"bnot","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise"],"loc":1,"refSource":"int bnot(int a){ return ~a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnor\tv0,a0,zero\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 bnot\n\n\nContents of section .text:\n 0000 03e00008 00801027 00000000 00000000 .......'........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 31623566 62376436 36333261 ef-c1b5fb7d6632a\n 0130 3662322f 7265662e 6300626e 6f740000 6b2/ref.c.bnot..\n 0140 626e6f74 00000000 00000000 00000001 bnot............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bnot(u32 a0) {\n return ~a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bnot(s32 arg0) {\n return ~arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bnot` — benchmark function synthetic:bnot:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bnot\n jr\t$ra\n nor\t$v0, $a0, $zero\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bnot # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bnot` — benchmark function synthetic:bnot:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bnot:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnor\tv0,a0,zero\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 bnot\n\n\nContents of section .text:\n 0000 03e00008 00801027 00000000 00000000 .......'........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 31623566 62376436 36333261 ef-c1b5fb7d6632a\n 0130 3662322f 7265662e 6300626e 6f740000 6b2/ref.c.bnot..\n 0140 626e6f74 00000000 00000000 00000001 bnot............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bnot # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bnot:mwcc_242_81","sym":"bnot","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bnot(int a){ return ~a; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnot r3,r3\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 bnot\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bnot\n\n\nContents of section .text:\n 0000 7c6318f8 4e800020 |c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bnot(u32 a0) {\n return ~a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bnot(s32 arg0) {\n return ~arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bnot` — benchmark function synthetic:bnot:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bnot\n not r3,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bnot # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bnot` — benchmark function synthetic:bnot:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bnot:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnot r3,r3\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 bnot\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bnot\n\n\nContents of section .text:\n 0000 7c6318f8 4e800020 |c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bnot # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bor:agbcc","sym":"bor","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bor(int a,int b){ return a|b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbor\n\t.type\t bor,function\n\t.thumb_func\nbor:\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t bor,.Lfe1-bor\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bor(u32 a0, u32 a1) {\n return a0 | a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bor(s32 arg0, s32 arg1) {\n return arg0 | arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bor` — benchmark function synthetic:bor:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbor\n\t.type\t bor,function\n\t.thumb_func\nbor:\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t bor,.Lfe1-bor\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bor` — benchmark function synthetic:bor:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bor:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbor\n\t.type\t bor,function\n\t.thumb_func\nbor:\n\torr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t bor,.Lfe1-bor\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bor # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bor:gcc2.7.2kmc","sym":"bor","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bor(int a,int b){ return a|b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tor\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-266486f82fb4444f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 bor\n\n\nContents of section .text:\n 0000 03e00008 00851025 00000000 00000000 .......%........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bor(u32 a0, u32 a1) {\n return a0 | a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bor(s32 arg0, s32 arg1) {\n return arg0 | arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bor` — benchmark function synthetic:bor:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bor\n jr\t$ra\n or\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bor` — benchmark function synthetic:bor:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bor:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tor\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-266486f82fb4444f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 bor\n\n\nContents of section .text:\n 0000 03e00008 00851025 00000000 00000000 .......%........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bor:ido7.1","sym":"bor","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise"],"loc":1,"refSource":"int bor(int a,int b){ return a|b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tor\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 bor\n\n\nContents of section .text:\n 0000 03e00008 00851025 00000000 00000000 .......%........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 36363438 36663832 66623434 ef-266486f82fb44\n 0130 3434662f 7265662e 6300626f 72000000 44f/ref.c.bor...\n 0140 626f7200 00000000 00000001 00000000 bor.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bor(u32 a0, u32 a1) {\n return a0 | a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bor(s32 arg0, s32 arg1) {\n return arg0 | arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bor` — benchmark function synthetic:bor:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bor\n jr\t$ra\n or\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bor` — benchmark function synthetic:bor:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bor:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tor\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 bor\n\n\nContents of section .text:\n 0000 03e00008 00851025 00000000 00000000 .......%........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 36363438 36663832 66623434 ef-266486f82fb44\n 0130 3434662f 7265662e 6300626f 72000000 44f/ref.c.bor...\n 0140 626f7200 00000000 00000001 00000000 bor.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bor:mwcc_242_81","sym":"bor","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bor(int a,int b){ return a|b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tor r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 bor\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bor\n\n\nContents of section .text:\n 0000 7c632378 4e800020 |c#xN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bor(u32 a0, u32 a1) {\n return a0 | a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bor(s32 arg0, s32 arg1) {\n return arg0 | arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bor` — benchmark function synthetic:bor:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bor\n or r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bor` — benchmark function synthetic:bor:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bor:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tor r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 bor\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bor\n\n\nContents of section .text:\n 0000 7c632378 4e800020 |c#xN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:breakloop:agbcc","sym":"breakloop","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for","break","memory"],"loc":1,"refSource":"int breakloop(int *a,int n){ int i; for(i=0;i= 0)) {\n var_r2 += 4;\n var_r3 += 1;\n goto loop_2;\n }\n return var_r3;\n}\n","score":7,"maxScore":15,"compileErrors":null,"breakdown":{"insert":3,"delete":3,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":88,"lines":13,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":7,"maxScore":15,"ratio":0.4666666666666667,"kinds":{"insert":3,"delete":3,"replace":0,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `breakloop` — benchmark function synthetic:breakloop:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbreakloop\n\t.type\t breakloop,function\n\t.thumb_func\nbreakloop:\n\tadd\tr2, r0, #0\n\tmov\tr3, #0x0\n\tb\t.L9\n.L5:\n\tadd\tr2, r2, #0x4\n\tadd\tr3, r3, #0x1\n.L9:\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n\tldr\tr0, [r2]\n\tcmp\tr0, #0\n\tbge\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t breakloop,.Lfe1-breakloop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function breakloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `breakloop` — benchmark function synthetic:breakloop:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:breakloop:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbreakloop\n\t.type\t breakloop,function\n\t.thumb_func\nbreakloop:\n\tadd\tr2, r0, #0\n\tmov\tr3, #0x0\n\tb\t.L9\n.L5:\n\tadd\tr2, r2, #0x4\n\tadd\tr3, r3, #0x1\n.L9:\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n\tldr\tr0, [r2]\n\tcmp\tr0, #0\n\tbge\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t breakloop,.Lfe1-breakloop\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name breakloop # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:breakloop:gcc2.7.2kmc","sym":"breakloop","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for","break","memory"],"loc":1,"refSource":"int breakloop(int *a,int n){ int i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tblez\ta1,28 \n 8:\tmove\tv1,zero\n c:\tlw\tv0,0(a0)\n 10:\tbltz\tv0,2c \n 14:\tmove\tv0,v1\n 18:\taddiu\tv1,v1,1\n 1c:\tslt\tv0,v1,a1\n 20:\tbnez\tv0,c \n 24:\taddiu\ta0,a0,4\n 28:\tmove\tv0,v1\n 2c:\tjr\tra\n 30:\taddiu\tsp,sp,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-45bfaf5f61d09bac/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 breakloop\n\n\nContents of section .text:\n 0000 27bdfff8 18a00008 00001821 8c820000 '..........!....\n 0010 04400006 00601021 24630001 0065102a .@...`.!$c...e.*\n 0020 1440fffa 24840004 00601021 03e00008 .@..$....`.!....\n 0030 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 breakloop(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n if (a1 > 0) {\n v0 = a0;\n v1 = 0;\n while (*v0 >= 0) {\n v1 = v1 + 1;\n v0 = v0 + 1;\n if (v1 >= a1) return v1;\n }\n return v1;\n } else {\n v1 = 0;\n return v1;\n }\n}\n","score":11,"maxScore":16,"compileErrors":null,"breakdown":{"insert":3,"delete":1,"replace":2,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 breakloop(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 var_v0;\n s32 var_v1;\n\n var_a0 = arg0;\n var_v1 = 0;\n if (arg1 > 0) {\nloop_1:\n var_v0 = var_v1;\n if (*var_a0 >= 0) {\n var_v1 += 1;\n var_a0 += 4;\n if (var_v1 >= arg1) {\n goto block_3;\n }\n goto loop_1;\n }\n } else {\nblock_3:\n var_v0 = var_v1;\n }\n return var_v0;\n}\n","score":5,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":76,"lines":23,"gotos":2,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":5,"maxScore":13,"ratio":0.38461538461538464,"kinds":{"insert":0,"delete":2,"replace":2,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `breakloop` — benchmark function synthetic:breakloop:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel breakloop\n addiu\t$sp, $sp, -8\n blez\t$a1, .L28\n move\t$v1, $zero\n.Lc:\n lw\t$v0, 0($a0)\n bltz\t$v0, .L2c\n move\t$v0, $v1\n addiu\t$v1, $v1, 1\n slt\t$v0, $v1, $a1\n bnez\t$v0, .Lc\n addiu\t$a0, $a0, 4\n.L28:\n move\t$v0, $v1\n.L2c:\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function breakloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `breakloop` — benchmark function synthetic:breakloop:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:breakloop:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tblez\ta1,28 \n 8:\tmove\tv1,zero\n c:\tlw\tv0,0(a0)\n 10:\tbltz\tv0,2c \n 14:\tmove\tv0,v1\n 18:\taddiu\tv1,v1,1\n 1c:\tslt\tv0,v1,a1\n 20:\tbnez\tv0,c \n 24:\taddiu\ta0,a0,4\n 28:\tmove\tv0,v1\n 2c:\tjr\tra\n 30:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-45bfaf5f61d09bac/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 breakloop\n\n\nContents of section .text:\n 0000 27bdfff8 18a00008 00001821 8c820000 '..........!....\n 0010 04400006 00601021 24630001 0065102a .@...`.!$c...e.*\n 0020 1440fffa 24840004 00601021 03e00008 .@..$....`.!....\n 0030 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name breakloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:breakloop:ido7.1","sym":"breakloop","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for","break","memory"],"loc":1,"refSource":"int breakloop(int *a,int n){ int i; for(i=0;i:\n 0:\tblez\ta1,24 \n 4:\tmove\tv1,zero\n 8:\tmove\tv0,a0\n c:\tlw\tt6,0(v0)\n 10:\tbltz\tt6,24 \n 14:\tnop\n 18:\taddiu\tv1,v1,1\n 1c:\tbne\tv1,a1,c \n 20:\taddiu\tv0,v0,4\n 24:\tjr\tra\n 28:\tmove\tv0,v1\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c breakloop\n\n\nContents of section .text:\n 0000 18a00008 00001825 00801025 8c4e0000 .......%...%.N..\n 0010 05c00004 00000000 24630001 1465fffb ........$c...e..\n 0020 24420004 03e00008 00601025 00000000 $B.......`.%....\nContents of section .options:\n 0000 01200000 00000000 8000403c 00000000 . ........@<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000403c 00000000 00000000 00000000 ..@<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000004 00000198 p...............\n 0010 00000005 000002e0 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 0000000c 0000027c 00000001 00000288 .......|........\n 0050 00000000 00000000 00000001 000002d0 ................\n 0060 08010000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000002c 20200001 00000001 ......., ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 35626661 66356636 31643039 ef-45bfaf5f61d09\n 0130 6261632f 7265662e 63006272 65616b6c bac/ref.c.breakl\n 0140 6f6f7000 62726561 6b6c6f6f 70000000 oop.breakloop...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 0000000b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000002 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 breakloop(s32 * a0, u32 a1) {\n s32 v0;\n if (a1 <= 0) {\n v0 = 0;\n } else {\n v0 = 0;\n while (*a0 >= 0) {\n v0 = v0 + 1;\n a0 = a0 + 1;\n if (v0 == a1) break;\n }\n }\n return v0;\n}\n","score":11,"maxScore":16,"compileErrors":null,"breakdown":{"insert":5,"delete":0,"replace":3,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 breakloop(s32 *arg0, s32 arg1) {\n s32 *var_v0;\n s32 var_v1;\n\n var_v1 = 0;\n if (arg1 > 0) {\n var_v0 = arg0;\nloop_2:\n if (*var_v0 >= 0) {\n var_v1 += 1;\n var_v0 += 4;\n if (var_v1 != arg1) {\n goto loop_2;\n }\n }\n }\n return var_v1;\n}\n","score":1,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":88,"lines":17,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":1,"maxScore":11,"ratio":0.09090909090909091,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `breakloop` — benchmark function synthetic:breakloop:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel breakloop\n blez\t$a1, .L24\n move\t$v1, $zero\n move\t$v0, $a0\n.Lc:\n lw\t$t6, 0($v0)\n bltz\t$t6, .L24\n nop\n addiu\t$v1, $v1, 1\n bne\t$v1, $a1, .Lc\n addiu\t$v0, $v0, 4\n.L24:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function breakloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `breakloop` — benchmark function synthetic:breakloop:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:breakloop:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta1,24 \n 4:\tmove\tv1,zero\n 8:\tmove\tv0,a0\n c:\tlw\tt6,0(v0)\n 10:\tbltz\tt6,24 \n 14:\tnop\n 18:\taddiu\tv1,v1,1\n 1c:\tbne\tv1,a1,c \n 20:\taddiu\tv0,v0,4\n 24:\tjr\tra\n 28:\tmove\tv0,v1\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c breakloop\n\n\nContents of section .text:\n 0000 18a00008 00001825 00801025 8c4e0000 .......%...%.N..\n 0010 05c00004 00000000 24630001 1465fffb ........$c...e..\n 0020 24420004 03e00008 00601025 00000000 $B.......`.%....\nContents of section .options:\n 0000 01200000 00000000 8000403c 00000000 . ........@<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000403c 00000000 00000000 00000000 ..@<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000004 00000198 p...............\n 0010 00000005 000002e0 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 0000000c 0000027c 00000001 00000288 .......|........\n 0050 00000000 00000000 00000001 000002d0 ................\n 0060 08010000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000002c 20200001 00000001 ......., ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 35626661 66356636 31643039 ef-45bfaf5f61d09\n 0130 6261632f 7265662e 63006272 65616b6c bac/ref.c.breakl\n 0140 6f6f7000 62726561 6b6c6f6f 70000000 oop.breakloop...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 0000000b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000002 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name breakloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:breakloop:mwcc_242_81","sym":"breakloop","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for","break","memory"],"loc":1,"refSource":"int breakloop(int *a,int n){ int i; for(i=0;i:\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r0,0(r3)\n 14:\tcmpwi r0,0\n 18:\tblt 28 \n 1c:\taddi r3,r3,4\n 20:\taddi r5,r5,1\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 breakloop\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 breakloop\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80030000 2c000000 41800010 38630004 ....,...A...8c..\n 0020 38a50001 4200ffec 7ca32b78 4e800020 8...B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 breakloop(s32 * a0, u32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 <= 0) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n while (*v0 >= 0) {\n v0 = v0 + 1;\n v1 = v1 + 1;\n v2 = v2 - 1;\n if (v2 == 0) break;\n }\n }\n return v1;\n}\n","score":16,"maxScore":20,"compileErrors":null,"breakdown":{"insert":8,"delete":5,"replace":1,"opMismatch":2,"argMismatch":0},"quality":{"score":100,"lines":19,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 breakloop(s32 *arg0, s32 arg1) {\n s32 *var_r3;\n s32 var_ctr;\n s32 var_r5;\n\n var_r3 = arg0;\n var_r5 = 0;\n var_ctr = arg1;\n if (arg1 > 0) {\nloop_1:\n if ((s32) *var_r3 >= 0) {\n var_r3 += 4;\n var_r5 += 1;\n var_ctr -= 1;\n if (var_ctr != 0) {\n goto loop_1;\n }\n }\n }\n return var_r5;\n}\n","score":6,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":88,"lines":20,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":14,"ratio":0.42857142857142855,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `breakloop` — benchmark function synthetic:breakloop:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel breakloop\n li r5,0\n mtctr r4\n cmpwi r4,0\n ble .L28\n.L10:\n lwz r0,0(r3)\n cmpwi r0,0\n blt .L28\n addi r3,r3,4\n addi r5,r5,1\n bdnz .L10\n.L28:\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function breakloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `breakloop` — benchmark function synthetic:breakloop:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:breakloop:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r0,0(r3)\n 14:\tcmpwi r0,0\n 18:\tblt 28 \n 1c:\taddi r3,r3,4\n 20:\taddi r5,r5,1\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 breakloop\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 breakloop\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80030000 2c000000 41800010 38630004 ....,...A...8c..\n 0020 38a50001 4200ffec 7ca32b78 4e800020 8...B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name breakloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bxor:agbcc","sym":"bxor","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bxor(int a,int b){ return a^b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbxor\n\t.type\t bxor,function\n\t.thumb_func\nbxor:\n\teor\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t bxor,.Lfe1-bxor\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bxor(u32 a0, u32 a1) {\n return a0 ^ a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bxor(s32 arg0, s32 arg1) {\n return arg0 ^ arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bxor` — benchmark function synthetic:bxor:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbxor\n\t.type\t bxor,function\n\t.thumb_func\nbxor:\n\teor\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t bxor,.Lfe1-bxor\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bxor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bxor` — benchmark function synthetic:bxor:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bxor:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbxor\n\t.type\t bxor,function\n\t.thumb_func\nbxor:\n\teor\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t bxor,.Lfe1-bxor\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bxor # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bxor:gcc2.7.2kmc","sym":"bxor","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bxor(int a,int b){ return a^b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\txor\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-51c0e01b7c069610/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 bxor\n\n\nContents of section .text:\n 0000 03e00008 00851026 00000000 00000000 .......&........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bxor(u32 a0, u32 a1) {\n return a0 ^ a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bxor(s32 arg0, s32 arg1) {\n return arg0 ^ arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bxor` — benchmark function synthetic:bxor:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bxor\n jr\t$ra\n xor\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bxor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bxor` — benchmark function synthetic:bxor:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bxor:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\txor\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-51c0e01b7c069610/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 bxor\n\n\nContents of section .text:\n 0000 03e00008 00851026 00000000 00000000 .......&........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name bxor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bxor:ido7.1","sym":"bxor","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise"],"loc":1,"refSource":"int bxor(int a,int b){ return a^b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\txor\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 bxor\n\n\nContents of section .text:\n 0000 03e00008 00851026 00000000 00000000 .......&........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 31633065 30316237 63303639 ef-51c0e01b7c069\n 0130 3631302f 7265662e 63006278 6f720000 610/ref.c.bxor..\n 0140 62786f72 00000000 00000000 00000001 bxor............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bxor(u32 a0, u32 a1) {\n return a0 ^ a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bxor(s32 arg0, s32 arg1) {\n return arg0 ^ arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bxor` — benchmark function synthetic:bxor:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bxor\n jr\t$ra\n xor\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bxor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bxor` — benchmark function synthetic:bxor:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bxor:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\txor\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 bxor\n\n\nContents of section .text:\n 0000 03e00008 00851026 00000000 00000000 .......&........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 31633065 30316237 63303639 ef-51c0e01b7c069\n 0130 3631302f 7265662e 63006278 6f720000 610/ref.c.bxor..\n 0140 62786f72 00000000 00000000 00000001 bxor............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bxor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:bxor:mwcc_242_81","sym":"bxor","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise"],"loc":1,"refSource":"int bxor(int a,int b){ return a^b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\txor r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 bxor\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bxor\n\n\nContents of section .text:\n 0000 7c632278 4e800020 |c\"xN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 bxor(u32 a0, u32 a1) {\n return a0 ^ a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 bxor(s32 arg0, s32 arg1) {\n return arg0 ^ arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `bxor` — benchmark function synthetic:bxor:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel bxor\n xor r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function bxor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `bxor` — benchmark function synthetic:bxor:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:bxor:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\txor r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 bxor\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 bxor\n\n\nContents of section .text:\n 0000 7c632278 4e800020 |c\"xN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name bxor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:byteidx:agbcc","sym":"byteidx","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","array","byte"],"loc":1,"refSource":"u8 byteidx(u8 *p,int i){ return p[i]; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbyteidx\n\t.type\t byteidx,function\n\t.thumb_func\nbyteidx:\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t byteidx,.Lfe1-byteidx\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 byteidx(u32 a0, u32 a1) {\n return *(u8 *)(a0 + a1);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 byteidx(s32 arg0, s32 arg1) {\n return *(arg0 + arg1);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:3: invalid type argument of `unary *'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `byteidx` — benchmark function synthetic:byteidx:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbyteidx\n\t.type\t byteidx,function\n\t.thumb_func\nbyteidx:\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t byteidx,.Lfe1-byteidx\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function byteidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `byteidx` — benchmark function synthetic:byteidx:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:byteidx:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tbyteidx\n\t.type\t byteidx,function\n\t.thumb_func\nbyteidx:\n\tadd\tr0, r0, r1\n\tldrb\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t byteidx,.Lfe1-byteidx\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name byteidx # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:byteidx:gcc2.7.2kmc","sym":"byteidx","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","array","byte"],"loc":1,"refSource":"u8 byteidx(u8 *p,int i){ return p[i]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\ta0,a0,a1\n 4:\tjr\tra\n 8:\tlbu\tv0,0(a0)\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3bae94321a85d4ab/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c byteidx\n\n\nContents of section .text:\n 0000 00852021 03e00008 90820000 00000000 .. !............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 byteidx(u32 a0, u32 a1) {\n return *(u8 *)(a0 + a1);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 byteidx(s32 arg0, s32 arg1) {\n return *(arg0 + arg1);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: invalid type argument of `unary *'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `byteidx` — benchmark function synthetic:byteidx:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel byteidx\n addu\t$a0, $a0, $a1\n jr\t$ra\n lbu\t$v0, 0($a0)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function byteidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `byteidx` — benchmark function synthetic:byteidx:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:byteidx:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\ta0,a0,a1\n 4:\tjr\tra\n 8:\tlbu\tv0,0(a0)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3bae94321a85d4ab/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c byteidx\n\n\nContents of section .text:\n 0000 00852021 03e00008 90820000 00000000 .. !............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name byteidx # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:byteidx:ido7.1","sym":"byteidx","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","array","byte"],"loc":1,"refSource":"u8 byteidx(u8 *p,int i){ return p[i]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tt6,a0,a1\n 4:\tjr\tra\n 8:\tlbu\tv0,0(t6)\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c byteidx\n\n\nContents of section .text:\n 0000 00857021 03e00008 91c20000 00000000 ..p!............\nContents of section .options:\n 0000 01200000 00000000 80004034 00000000 . ........@4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004034 00000000 00000000 00000000 ..@4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 62616539 34333231 61383564 ef-3bae94321a85d\n 0130 3461622f 7265662e 63006279 74656964 4ab/ref.c.byteid\n 0140 78000000 62797465 69647800 00000000 x...byteidx.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000003 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 byteidx(u32 a0, u32 a1) {\n return *(u8 *)(a0 + a1);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 byteidx(s32 arg0, s32 arg1) {\n return *(arg0 + arg1);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: Dereferenced a non-pointer."]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `byteidx` — benchmark function synthetic:byteidx:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel byteidx\n addu\t$t6, $a0, $a1\n jr\t$ra\n lbu\t$v0, 0($t6)\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function byteidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `byteidx` — benchmark function synthetic:byteidx:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:byteidx:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tt6,a0,a1\n 4:\tjr\tra\n 8:\tlbu\tv0,0(t6)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c byteidx\n\n\nContents of section .text:\n 0000 00857021 03e00008 91c20000 00000000 ..p!............\nContents of section .options:\n 0000 01200000 00000000 80004034 00000000 . ........@4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004034 00000000 00000000 00000000 ..@4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 62616539 34333231 61383564 ef-3bae94321a85d\n 0130 3461622f 7265662e 63006279 74656964 4ab/ref.c.byteid\n 0140 78000000 62797465 69647800 00000000 x...byteidx.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000003 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name byteidx # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:byteidx:mwcc_242_81","sym":"byteidx","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","array","byte"],"loc":1,"refSource":"u8 byteidx(u8 *p,int i){ return p[i]; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbzx r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 byteidx\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 byteidx\n\n\nContents of section .text:\n 0000 7c6320ae 4e800020 |c .N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 byteidx(u32 a0, u32 a1) {\n return *(u8 *)(a0 + a1);\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"u8 byteidx(s32 arg0, s32 arg1) {\n return *(arg0 + arg1);\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^","# pointer/array required"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `byteidx` — benchmark function synthetic:byteidx:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel byteidx\n lbzx r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function byteidx # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `byteidx` — benchmark function synthetic:byteidx:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:byteidx:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbzx r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 byteidx\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 byteidx\n\n\nContents of section .text:\n 0000 7c6320ae 4e800020 |c .N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name byteidx # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:call1:agbcc","sym":"call1","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["call"],"loc":2,"refSource":"int helper(int);\nint call1(int x){ return helper(x)+1; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcall1\n\t.type\t call1,function\n\t.thumb_func\ncall1:\n\tpush\t{lr}\n\tbl\thelper\n\tadd\tr0, r0, #0x1\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t call1,.Lfe1-call1\n","ctx":"int helper(int);","proto":{"helper":{"params":1}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 call1(u32 a0) {\n return helper(a0) + 1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 call1(s32 arg0) {\n return helper(arg0) + 1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `call1` — benchmark function synthetic:call1:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcall1\n\t.type\t call1,function\n\t.thumb_func\ncall1:\n\tpush\t{lr}\n\tbl\thelper\n\tadd\tr0, r0, #0x1\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t call1,.Lfe1-call1\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint helper(int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function call1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `call1` — benchmark function synthetic:call1:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:call1:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcall1\n\t.type\t call1,function\n\t.thumb_func\ncall1:\n\tpush\t{lr}\n\tbl\thelper\n\tadd\tr0, r0, #0x1\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t call1,.Lfe1-call1\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"helper\": {\n \"params\": 1\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name call1 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:call1:gcc2.7.2kmc","sym":"call1","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["call"],"loc":2,"refSource":"int helper(int);\nint call1(int x){ return helper(x)+1; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tlw\tra,16(sp)\n 14:\taddiu\tv0,v0,1\n 18:\tjr\tra\n 1c:\taddiu\tsp,sp,24\n","ctx":"int helper(int);","proto":{"helper":{"params":1}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4d0f99dd30f96a0c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 call1\n00000000 *UND*\t00000000 helper\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 helper\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 8fbf0010 24420001 03e00008 27bd0018 ....$B......'...\nContents of section .reginfo:\n 0000 a0000004 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'call1' — lift: cannot lift 'call1': function call 'jal' at 0x8 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tjal\t0 */\n/* c:\tnop */\n/* 10:\tlw\tra,16(sp) */\n/* 14:\taddiu\tv0,v0,1 */\n/* 18:\tjr\tra */\n/* 1c:\taddiu\tsp,sp,24 */\nvoid call1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'call1': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'call1': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 call1(s32 arg0) {\n return helper(arg0) + 1;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `call1` — benchmark function synthetic:call1:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel call1\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\thelper\n nop\n lw\t$ra, 16($sp)\n addiu\t$v0, $v0, 1\n jr\t$ra\n addiu\t$sp, $sp, 24\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint helper(int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function call1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `call1` — benchmark function synthetic:call1:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:call1:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tlw\tra,16(sp)\n 14:\taddiu\tv0,v0,1\n 18:\tjr\tra\n 1c:\taddiu\tsp,sp,24\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4d0f99dd30f96a0c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 call1\n00000000 *UND*\t00000000 helper\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 helper\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 8fbf0010 24420001 03e00008 27bd0018 ....$B......'...\nContents of section .reginfo:\n 0000 a0000004 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"helper\": {\n \"params\": 1\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name call1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:call1:mwcc_242_81","sym":"call1","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["call"],"loc":2,"refSource":"int helper(int);\nint call1(int x){ return helper(x)+1; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\thelper\n 10:\tlwz r0,20(r1)\n 14:\taddi r3,r3,1\n 18:\tmtlr r0\n 1c:\taddi r1,r1,16\n 20:\tblr\n","ctx":"int helper(int);","proto":{"helper":{"params":1}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 helper\n00000000 g F .text\t00000024 call1\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 helper\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 call1\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 38630001 7c0803a6 38210010 ....8c..|...8!..\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000004 00000000 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 call1(u32 a0) {\n return helper(a0) + 1;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 call1(s32 arg0) {\n return helper(arg0) + 1;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `call1` — benchmark function synthetic:call1:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel call1\n stwu r1,-16(r1)\n mflr r0\n stw r0,20(r1)\n bl helper\n lwz r0,20(r1)\n addi r3,r3,1\n mtlr r0\n addi r1,r1,16\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint helper(int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function call1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `call1` — benchmark function synthetic:call1:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:call1:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\thelper\n 10:\tlwz r0,20(r1)\n 14:\taddi r3,r3,1\n 18:\tmtlr r0\n 1c:\taddi r1,r1,16\n 20:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 helper\n00000000 g F .text\t00000024 call1\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 helper\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 call1\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 38630001 7c0803a6 38210010 ....8c..|...8!..\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000004 00000000 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"helper\": {\n \"params\": 1\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name call1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:call2:agbcc","sym":"call2","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["call","multi-arg"],"loc":2,"refSource":"int add3(int,int,int);\nint call2(int a,int b){ return add3(a,b,a+b); }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcall2\n\t.type\t call2,function\n\t.thumb_func\ncall2:\n\tpush\t{lr}\n\tadd\tr2, r0, r1\n\tbl\tadd3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t call2,.Lfe1-call2\n","ctx":"int add3(int,int,int);","proto":{"add3":{"params":3}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 call2(u32 a0, u32 a1) {\n return add3(a0, a1, a0 + a1);\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void call2(s32 arg0, s32 arg1) {\n add3(arg0, arg1, arg0 + arg1);\n}\n","score":2,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `call2` — benchmark function synthetic:call2:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcall2\n\t.type\t call2,function\n\t.thumb_func\ncall2:\n\tpush\t{lr}\n\tadd\tr2, r0, r1\n\tbl\tadd3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t call2,.Lfe1-call2\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint add3(int,int,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function call2 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `call2` — benchmark function synthetic:call2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:call2:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcall2\n\t.type\t call2,function\n\t.thumb_func\ncall2:\n\tpush\t{lr}\n\tadd\tr2, r0, r1\n\tbl\tadd3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t call2,.Lfe1-call2\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add3\": {\n \"params\": 3\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name call2 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:call2:gcc2.7.2kmc","sym":"call2","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["call","multi-arg"],"loc":2,"refSource":"int add3(int,int,int);\nint call2(int a,int b){ return add3(a,b,a+b); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\taddu\ta2,a0,a1\n 10:\tlw\tra,16(sp)\n 14:\tjr\tra\n 18:\taddiu\tsp,sp,24\n 1c:\tnop\n","ctx":"int add3(int,int,int);","proto":{"add3":{"params":3}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-57adb8eccd0715dd/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c call2\n00000000 *UND*\t00000000 add3\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 add3\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00853021 '.............0!\n 0010 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a0000070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'call2' — lift: cannot lift 'call2': function call 'jal' at 0x8 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tjal\t0 */\n/* c:\taddu\ta2,a0,a1 */\n/* 10:\tlw\tra,16(sp) */\n/* 14:\tjr\tra */\n/* 18:\taddiu\tsp,sp,24 */\n/* 1c:\tnop */\nvoid call2(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'call2': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'call2': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void call2(s32 arg0, s32 arg1) {\n add3(arg0, arg1, arg0 + arg1);\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `call2` — benchmark function synthetic:call2:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel call2\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tadd3\n addu\t$a2, $a0, $a1\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint add3(int,int,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function call2 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `call2` — benchmark function synthetic:call2:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:call2:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\taddu\ta2,a0,a1\n 10:\tlw\tra,16(sp)\n 14:\tjr\tra\n 18:\taddiu\tsp,sp,24\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-57adb8eccd0715dd/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c call2\n00000000 *UND*\t00000000 add3\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 add3\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00853021 '.............0!\n 0010 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a0000070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add3\": {\n \"params\": 3\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name call2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:call2:mwcc_242_81","sym":"call2","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["call","multi-arg"],"loc":2,"refSource":"int add3(int,int,int);\nint call2(int a,int b){ return add3(a,b,a+b); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tadd r5,r3,r4\n c:\tstw r0,20(r1)\n 10:\tbl 10 \n\t\t\t10: R_PPC_REL24\tadd3\n 14:\tlwz r0,20(r1)\n 18:\tmtlr r0\n 1c:\taddi r1,r1,16\n 20:\tblr\n","ctx":"int add3(int,int,int);","proto":{"add3":{"params":3}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 add3\n00000000 g F .text\t00000024 call2\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_PPC_REL24 add3\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 call2\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 7ca32214 90010014 .!..|...|.\".....\n 0010 48000001 80010014 7c0803a6 38210010 H.......|...8!..\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000004 00000000 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 call2(u32 a0, u32 a1) {\n return add3(a0, a1, a0 + a1);\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void call2(s32 arg0, s32 arg1) {\n add3(arg0, arg1, arg0 + arg1);\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `call2` — benchmark function synthetic:call2:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel call2\n stwu r1,-16(r1)\n mflr r0\n add r5,r3,r4\n stw r0,20(r1)\n bl add3\n lwz r0,20(r1)\n mtlr r0\n addi r1,r1,16\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint add3(int,int,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function call2 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `call2` — benchmark function synthetic:call2:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:call2:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tadd r5,r3,r4\n c:\tstw r0,20(r1)\n 10:\tbl 10 \n\t\t\t10: R_PPC_REL24\tadd3\n 14:\tlwz r0,20(r1)\n 18:\tmtlr r0\n 1c:\taddi r1,r1,16\n 20:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 add3\n00000000 g F .text\t00000024 call2\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_PPC_REL24 add3\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 call2\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 7ca32214 90010014 .!..|...|.\".....\n 0010 48000001 80010014 7c0803a6 38210010 H.......|...8!..\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000004 00000000 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"add3\": {\n \"params\": 3\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name call2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clamp0:agbcc","sym":"clamp0","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","branch"],"loc":1,"refSource":"int clamp0(int x){ if(x<0) return 0; return x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclamp0\n\t.type\t clamp0,function\n\t.thumb_func\nclamp0:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t clamp0,.Lfe1-clamp0\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 clamp0(s32 a0) {\n if (a0 < 0) a0 = 0;\n return a0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clamp0(s32 arg0) {\n s32 var_r0;\n\n var_r0 = arg0;\n if (var_r0 < 0) {\n var_r0 = 0;\n }\n return var_r0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clamp0` — benchmark function synthetic:clamp0:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclamp0\n\t.type\t clamp0,function\n\t.thumb_func\nclamp0:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t clamp0,.Lfe1-clamp0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clamp0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clamp0` — benchmark function synthetic:clamp0:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clamp0:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclamp0\n\t.type\t clamp0,function\n\t.thumb_func\nclamp0:\n\tcmp\tr0, #0\n\tbge\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t clamp0,.Lfe1-clamp0\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clamp0 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clamp0:gcc2.7.2kmc","sym":"clamp0","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","branch"],"loc":1,"refSource":"int clamp0(int x){ if(x<0) return 0; return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnor\tv0,zero,a0\n 4:\tsra\tv0,v0,0x1f\n 8:\tjr\tra\n c:\tand\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-31f15d35e4cb0535/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 clamp0\n\n\nContents of section .text:\n 0000 00041027 000217c3 03e00008 00821024 ...'...........$\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 clamp0(s32 a0) {\n return a0 & ~a0 >> 31;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clamp0(s32 arg0) {\n return arg0 & ((s32) ~arg0 >> 0x1F);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clamp0` — benchmark function synthetic:clamp0:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clamp0\n nor\t$v0, $zero, $a0\n sra\t$v0, $v0, 0x1f\n jr\t$ra\n and\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clamp0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clamp0` — benchmark function synthetic:clamp0:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clamp0:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnor\tv0,zero,a0\n 4:\tsra\tv0,v0,0x1f\n 8:\tjr\tra\n c:\tand\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-31f15d35e4cb0535/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 clamp0\n\n\nContents of section .text:\n 0000 00041027 000217c3 03e00008 00821024 ...'...........$\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clamp0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clamp0:ido7.1","sym":"clamp0","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","branch"],"loc":1,"refSource":"int clamp0(int x){ if(x<0) return 0; return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tmove\tv0,a0\n 8:\tjr\tra\n c:\tmove\tv0,zero\n 10:\tjr\tra\n 14:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 clamp0\n\n\nContents of section .text:\n 0000 04810003 00801025 03e00008 00001025 .......%.......%\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 31663135 64333565 34636230 ef-31f15d35e4cb0\n 0130 3533352f 7265662e 6300636c 616d7030 535/ref.c.clamp0\n 0140 00000000 636c616d 70300000 00000000 ....clamp0......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000006 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 clamp0(s32 a0) {\n if (a0 < 0) {\n return 0;\n } else {\n return a0;\n }\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clamp0(s32 arg0) {\n if (arg0 < 0) {\n return 0;\n }\n return arg0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clamp0` — benchmark function synthetic:clamp0:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clamp0\n bgez\t$a0, .L10\n move\t$v0, $a0\n jr\t$ra\n move\t$v0, $zero\n.L10:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clamp0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clamp0` — benchmark function synthetic:clamp0:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clamp0:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tmove\tv0,a0\n 8:\tjr\tra\n c:\tmove\tv0,zero\n 10:\tjr\tra\n 14:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 clamp0\n\n\nContents of section .text:\n 0000 04810003 00801025 03e00008 00001025 .......%.......%\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 31663135 64333565 34636230 ef-31f15d35e4cb0\n 0130 3533352f 7265662e 6300636c 616d7030 535/ref.c.clamp0\n 0140 00000000 636c616d 70300000 00000000 ....clamp0......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000006 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clamp0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clamp0:mwcc_242_81","sym":"clamp0","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","branch"],"loc":1,"refSource":"int clamp0(int x){ if(x<0) return 0; return x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrawi r0,r3,31\n 4:\tandc r3,r3,r0\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c clamp0\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clamp0\n\n\nContents of section .text:\n 0000 7c60fe70 7c630078 4e800020 |`.p|c.xN.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 clamp0(s32 a0) {\n return a0 & ~(a0 >> 31);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clamp0(s32 arg0) {\n return arg0 & ~(arg0 >> 0x1F);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clamp0` — benchmark function synthetic:clamp0:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clamp0\n srawi r0,r3,31\n andc r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clamp0 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clamp0` — benchmark function synthetic:clamp0:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clamp0:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrawi r0,r3,31\n 4:\tandc r3,r3,r0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c clamp0\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clamp0\n\n\nContents of section .text:\n 0000 7c60fe70 7c630078 4e800020 |`.p|c.xN.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clamp0 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampr:agbcc","sym":"clampr","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampr(int x,int lo,int hi){ if(xhi)x=hi; return x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclampr\n\t.type\t clampr,function\n\t.thumb_func\nclampr:\n\tcmp\tr0, r1\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r1, #0\n.L3:\n\tcmp\tr0, r2\n\tble\t.L4\t@cond_branch\n\tadd\tr0, r2, #0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t clampr,.Lfe1-clampr\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 clampr(s32 a0, s32 a1, s32 a2) {\n if (a0 < a1) a0 = a1;\n if (a0 > a2) a0 = a2;\n return a0;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clampr(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r0;\n\n var_r0 = arg0;\n if (var_r0 < arg1) {\n var_r0 = arg1;\n }\n if (var_r0 > arg2) {\n var_r0 = arg2;\n }\n return var_r0;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampr` — benchmark function synthetic:clampr:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclampr\n\t.type\t clampr,function\n\t.thumb_func\nclampr:\n\tcmp\tr0, r1\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r1, #0\n.L3:\n\tcmp\tr0, r2\n\tble\t.L4\t@cond_branch\n\tadd\tr0, r2, #0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t clampr,.Lfe1-clampr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampr` — benchmark function synthetic:clampr:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampr:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclampr\n\t.type\t clampr,function\n\t.thumb_func\nclampr:\n\tcmp\tr0, r1\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r1, #0\n.L3:\n\tcmp\tr0, r2\n\tble\t.L4\t@cond_branch\n\tadd\tr0, r2, #0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t clampr,.Lfe1-clampr\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampr # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampr:gcc2.7.2kmc","sym":"clampr","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampr(int x,int lo,int hi){ if(xhi)x=hi; return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tslt\tv0,a2,a0\n 10:\tbnezl\tv0,18 \n 14:\tmove\ta0,a2\n 18:\tjr\tra\n 1c:\tmove\tv0,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-83ad7d8b72cf4215/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 clampr\n\n\nContents of section .text:\n 0000 0085102a 54400001 00a02021 00c4102a ...*T@.... !...*\n 0010 54400001 00c02021 03e00008 00801021 T@.... !.......!\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'clampr' — lift: cannot lift 'clampr': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tslt\tv0,a0,a1 */\n/* 4:\tbnezl\tv0,c */\n/* 8:\tmove\ta0,a1 */\n/* c:\tslt\tv0,a2,a0 */\n/* 10:\tbnezl\tv0,18 */\n/* 14:\tmove\ta0,a2 */\n/* 18:\tjr\tra */\n/* 1c:\tmove\tv0,a0 */\nvoid clampr(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'clampr': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'clampr': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clampr(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_a0;\n\n var_a0 = arg0;\n if (var_a0 < arg1) {\n var_a0 = arg1;\n }\n if (arg2 < var_a0) {\n var_a0 = arg2;\n }\n return var_a0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampr` — benchmark function synthetic:clampr:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clampr\n slt\t$v0, $a0, $a1\n bnezl\t$v0, .Lc\n move\t$a0, $a1\n.Lc:\n slt\t$v0, $a2, $a0\n bnezl\t$v0, .L18\n move\t$a0, $a2\n.L18:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampr` — benchmark function synthetic:clampr:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampr:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tslt\tv0,a2,a0\n 10:\tbnezl\tv0,18 \n 14:\tmove\ta0,a2\n 18:\tjr\tra\n 1c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-83ad7d8b72cf4215/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 clampr\n\n\nContents of section .text:\n 0000 0085102a 54400001 00a02021 00c4102a ...*T@.... !...*\n 0010 54400001 00c02021 03e00008 00801021 T@.... !.......!\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampr:ido7.1","sym":"clampr","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampr(int x,int lo,int hi){ if(xhi)x=hi; return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a0,a1\n 4:\tbeqzl\tat,14 \n 8:\tslt\tat,a2,a0\n c:\tmove\ta0,a1\n 10:\tslt\tat,a2,a0\n 14:\tbeqz\tat,20 \n 18:\tnop\n 1c:\tmove\ta0,a2\n 20:\tjr\tra\n 24:\tmove\tv0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 clampr\n\n\nContents of section .text:\n 0000 0085082a 50200003 00c4082a 00a02025 ...*P .....*.. %\n 0010 00c4082a 10200002 00000000 00c02025 ...*. ........ %\n 0020 03e00008 00801025 00000000 00000000 .......%........\nContents of section .options:\n 0000 01200000 00000000 80000076 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002dc 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 00000008 0000027c 00000001 00000284 .......|........\n 0050 00000000 00000000 00000001 000002cc ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 33616437 64386237 32636634 ef-83ad7d8b72cf4\n 0130 3231352f 7265662e 6300636c 616d7072 215/ref.c.clampr\n 0140 00000000 636c616d 70720000 00000000 ....clampr......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 0000000a 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'clampr' — lift: cannot lift 'clampr': unmodelled control transfer 'beqzl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tslt\tat,a0,a1 */\n/* 4:\tbeqzl\tat,14 */\n/* 8:\tslt\tat,a2,a0 */\n/* c:\tmove\ta0,a1 */\n/* 10:\tslt\tat,a2,a0 */\n/* 14:\tbeqz\tat,20 */\n/* 18:\tnop */\n/* 1c:\tmove\ta0,a2 */\n/* 20:\tjr\tra */\n/* 24:\tmove\tv0,a0 */\n/* \t... */\nvoid clampr(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'clampr': unmodelled control transfer 'beqzl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":19,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'clampr': unmodelled control transfer 'beqzl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 clampr(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_a0;\n\n var_a0 = arg0;\n if (var_a0 < arg1) {\n var_a0 = arg1;\n }\n if (arg2 < var_a0) {\n var_a0 = arg2;\n }\n return var_a0;\n}\n","score":6,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":2,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":10,"ratio":0.6,"kinds":{"insert":0,"delete":0,"replace":2,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampr` — benchmark function synthetic:clampr:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clampr\n slt\t$at, $a0, $a1\n beqzl\t$at, .L14\n slt\t$at, $a2, $a0\n move\t$a0, $a1\n slt\t$at, $a2, $a0\n.L14:\n beqz\t$at, .L20\n nop\n move\t$a0, $a2\n.L20:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampr` — benchmark function synthetic:clampr:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampr:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a0,a1\n 4:\tbeqzl\tat,14 \n 8:\tslt\tat,a2,a0\n c:\tmove\ta0,a1\n 10:\tslt\tat,a2,a0\n 14:\tbeqz\tat,20 \n 18:\tnop\n 1c:\tmove\ta0,a2\n 20:\tjr\tra\n 24:\tmove\tv0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 clampr\n\n\nContents of section .text:\n 0000 0085082a 50200003 00c4082a 00a02025 ...*P .....*.. %\n 0010 00c4082a 10200002 00000000 00c02025 ...*. ........ %\n 0020 03e00008 00801025 00000000 00000000 .......%........\nContents of section .options:\n 0000 01200000 00000000 80000076 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002dc 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 00000008 0000027c 00000001 00000284 .......|........\n 0050 00000000 00000000 00000001 000002cc ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 33616437 64386237 32636634 ef-83ad7d8b72cf4\n 0130 3231352f 7265662e 6300636c 616d7072 215/ref.c.clampr\n 0140 00000000 636c616d 70720000 00000000 ....clampr......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 0000000a 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampr:mwcc_242_81","sym":"clampr","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampr(int x,int lo,int hi){ if(xhi)x=hi; return x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tbge c \n 8:\tmr r3,r4\n c:\tcmpw r3,r5\n 10:\tblelr\n 14:\tmr r3,r5\n 18:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c clampr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clampr\n\n\nContents of section .text:\n 0000 7c032000 40800008 7c832378 7c032800 |. .@...|.#x|.(.\n 0010 4c810020 7ca32b78 4e800020 L.. |.+xN.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 clampr(s32 a0, s32 a1, s32 a2) {\n if (a0 < a1) a0 = a1;\n if (a0 > a2) {\n return a2;\n } else {\n return a0;\n }\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clampr(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r3;\n\n var_r3 = arg0;\n if (var_r3 < arg1) {\n var_r3 = arg1;\n }\n if (var_r3 > arg2) {\n return arg2;\n }\n return var_r3;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampr` — benchmark function synthetic:clampr:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clampr\n cmpw r3,r4\n bge .Lc\n mr r3,r4\n.Lc:\n cmpw r3,r5\n blelr\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampr` — benchmark function synthetic:clampr:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampr:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tbge c \n 8:\tmr r3,r4\n c:\tcmpw r3,r5\n 10:\tblelr\n 14:\tmr r3,r5\n 18:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c clampr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clampr\n\n\nContents of section .text:\n 0000 7c032000 40800008 7c832378 7c032800 |. .@...|.#x|.(.\n 0010 4c810020 7ca32b78 4e800020 L.. |.+xN.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampu8:agbcc","sym":"clampu8","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampu8(int x){ if(x<0)return 0; if(x>255)return 255; return x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclampu8\n\t.type\t clampu8,function\n\t.thumb_func\nclampu8:\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L5\n.L3:\n\tcmp\tr0, #0xff\n\tble\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t clampu8,.Lfe1-clampu8\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 clampu8(u32 a0) {\n if (a0 >= 0) {\n if (a0 > 255) a0 = 255;\n } else {\n a0 = 0;\n }\n return a0;\n}\n","score":7,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clampu8(s32 arg0) {\n s32 var_r0;\n\n var_r0 = arg0;\n if (var_r0 < 0) {\n return 0;\n }\n if (var_r0 > 0xFF) {\n var_r0 = 0xFF;\n }\n return var_r0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampu8` — benchmark function synthetic:clampu8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclampu8\n\t.type\t clampu8,function\n\t.thumb_func\nclampu8:\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L5\n.L3:\n\tcmp\tr0, #0xff\n\tble\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t clampu8,.Lfe1-clampu8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampu8` — benchmark function synthetic:clampu8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampu8:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclampu8\n\t.type\t clampu8,function\n\t.thumb_func\nclampu8:\n\tcmp\tr0, #0\n\tbge\t.L3\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L5\n.L3:\n\tcmp\tr0, #0xff\n\tble\t.L5\t@cond_branch\n\tmov\tr0, #0xff\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t clampu8,.Lfe1-clampu8\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampu8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampu8:gcc2.7.2kmc","sym":"clampu8","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampu8(int x){ if(x<0)return 0; if(x>255)return 255; return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tslti\tv1,a0,256\n 8:\tj\t1c \n c:\tmove\tv0,zero\n 10:\tbeqz\tv1,1c \n 14:\tli\tv0,255\n 18:\tmove\tv0,a0\n 1c:\tjr\tra\n 20:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1e97c6c02fb6dc7f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 clampu8\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 04810003 28830100 08000007 00001021 ....(..........!\n 0010 10600002 240200ff 00801021 03e00008 .`..$......!....\n 0020 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 clampu8(u32 a0) {\n if (a0 >= 0) {\n if (a0 < 256 == 0) a0 = 255;\n } else {\n a0 = 0;\n }\n return a0;\n}\n","score":8,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":3,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 clampu8(s32 arg0) {\n s32 var_v0;\n\n if (arg0 < 0) {\n return 0;\n }\n var_v0 = 0xFF;\n if (arg0 < 0x100) {\n var_v0 = arg0;\n }\n return var_v0;\n}\n","score":5,"maxScore":10,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":5,"maxScore":10,"ratio":0.5,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampu8` — benchmark function synthetic:clampu8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clampu8\n bgez\t$a0, .L10\n slti\t$v1, $a0, 256\n j\t.L1c\n move\t$v0, $zero\n.L10:\n beqz\t$v1, .L1c\n li\t$v0, 255\n move\t$v0, $a0\n.L1c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampu8` — benchmark function synthetic:clampu8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampu8:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tslti\tv1,a0,256\n 8:\tj\t1c \n c:\tmove\tv0,zero\n 10:\tbeqz\tv1,1c \n 14:\tli\tv0,255\n 18:\tmove\tv0,a0\n 1c:\tjr\tra\n 20:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1e97c6c02fb6dc7f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 clampu8\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 04810003 28830100 08000007 00001021 ....(..........!\n 0010 10600002 240200ff 00801021 03e00008 .`..$......!....\n 0020 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampu8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampu8:ido7.1","sym":"clampu8","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampu8(int x){ if(x<0)return 0; if(x>255)return 255; return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tslti\tat,a0,256\n 8:\tjr\tra\n c:\tmove\tv0,zero\n 10:\tbnez\tat,20 \n 14:\tmove\tv0,a0\n 18:\tjr\tra\n 1c:\tli\tv0,255\n 20:\tjr\tra\n 24:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 clampu8\n\n\nContents of section .text:\n 0000 04810003 28810100 03e00008 00001025 ....(..........%\n 0010 14200003 00801025 03e00008 240200ff . .....%....$...\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002dc 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 00000008 0000027c 00000001 00000284 .......|........\n 0050 00000000 00000000 00000001 000002cc ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 65393763 36633032 66623664 ef-1e97c6c02fb6d\n 0130 6337662f 7265662e 6300636c 616d7075 c7f/ref.c.clampu\n 0140 38000000 636c616d 70753800 00000000 8...clampu8.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000a 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 clampu8(s32 a0) {\n if (a0 < 0) {\n return 0;\n } else {\n if (a0 < 256 == 0) {\n return 255;\n } else {\n return a0;\n }\n }\n}\n","score":2,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clampu8(s32 arg0) {\n if (arg0 < 0) {\n return 0;\n }\n if (arg0 >= 0x100) {\n return 0xFF;\n }\n return arg0;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampu8` — benchmark function synthetic:clampu8:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clampu8\n bgez\t$a0, .L10\n slti\t$at, $a0, 256\n jr\t$ra\n move\t$v0, $zero\n.L10:\n bnez\t$at, .L20\n move\t$v0, $a0\n jr\t$ra\n li\t$v0, 255\n.L20:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampu8` — benchmark function synthetic:clampu8:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampu8:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tslti\tat,a0,256\n 8:\tjr\tra\n c:\tmove\tv0,zero\n 10:\tbnez\tat,20 \n 14:\tmove\tv0,a0\n 18:\tjr\tra\n 1c:\tli\tv0,255\n 20:\tjr\tra\n 24:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 clampu8\n\n\nContents of section .text:\n 0000 04810003 28810100 03e00008 00001025 ....(..........%\n 0010 14200003 00801025 03e00008 240200ff . .....%....$...\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002dc 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 00000008 0000027c 00000001 00000284 .......|........\n 0050 00000000 00000000 00000001 000002cc ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 65393763 36633032 66623664 ef-1e97c6c02fb6d\n 0130 6337662f 7265662e 6300636c 616d7075 c7f/ref.c.clampu\n 0140 38000000 636c616d 70753800 00000000 8...clampu8.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000a 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampu8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clampu8:mwcc_242_81","sym":"clampu8","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int clampu8(int x){ if(x<0)return 0; if(x>255)return 255; return x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tbge 10 \n 8:\tli r3,0\n c:\tblr\n 10:\tcmpwi r3,255\n 14:\tli r0,255\n 18:\tbgt 20 \n 1c:\tmr r0,r3\n 20:\tmr r3,r0\n 24:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000028 clampu8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clampu8\n\n\nContents of section .text:\n 0000 2c030000 4080000c 38600000 4e800020 ,...@...8`..N.. \n 0010 2c0300ff 380000ff 41810008 7c601b78 ,...8...A...|`.x\n 0020 7c030378 4e800020 |..xN.. \nContents of section .mwcats.text:\n 0000 02000028 00000000 ...(.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 clampu8(s32 a0) {\n if (a0 < 0) {\n return 0;\n } else {\n if (a0 > 255) a0 = 255;\n return a0;\n }\n}\n","score":5,"maxScore":11,"compileErrors":null,"breakdown":{"insert":1,"delete":3,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clampu8(s32 arg0) {\n s32 var_r0;\n\n if (arg0 < 0) {\n return 0;\n }\n var_r0 = 0xFF;\n if (arg0 <= 0xFF) {\n var_r0 = arg0;\n }\n return var_r0;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clampu8` — benchmark function synthetic:clampu8:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clampu8\n cmpwi r3,0\n bge .L10\n li r3,0\n blr\n.L10:\n cmpwi r3,255\n li r0,255\n bgt .L20\n mr r0,r3\n.L20:\n mr r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clampu8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clampu8` — benchmark function synthetic:clampu8:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clampu8:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tbge 10 \n 8:\tli r3,0\n c:\tblr\n 10:\tcmpwi r3,255\n 14:\tli r0,255\n 18:\tbgt 20 \n 1c:\tmr r0,r3\n 20:\tmr r3,r0\n 24:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000028 clampu8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clampu8\n\n\nContents of section .text:\n 0000 2c030000 4080000c 38600000 4e800020 ,...@...8`..N.. \n 0010 2c0300ff 380000ff 41810008 7c601b78 ,...8...A...|`.x\n 0020 7c030378 4e800020 |..xN.. \nContents of section .mwcats.text:\n 0000 02000028 00000000 ...(.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clampu8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clearbit:agbcc","sym":"clearbit","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int clearbit(int x,int n){ return x & ~(1< in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclearbit\n\t.type\t clearbit,function\n\t.thumb_func\nclearbit:\n\tmov\tr2, #0x1\n\tlsl\tr2, r2, r1\n\tbic\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t clearbit,.Lfe1-clearbit\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clearbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clearbit` — benchmark function synthetic:clearbit:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clearbit:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tclearbit\n\t.type\t clearbit,function\n\t.thumb_func\nclearbit:\n\tmov\tr2, #0x1\n\tlsl\tr2, r2, r1\n\tbic\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t clearbit,.Lfe1-clearbit\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clearbit # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clearbit:gcc2.7.2kmc","sym":"clearbit","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int clearbit(int x,int n){ return x & ~(1<:\n 0:\tli\tv0,1\n 4:\tsllv\tv0,v0,a1\n 8:\tnor\tv0,zero,v0\n c:\tjr\tra\n 10:\tand\tv0,a0,v0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-60ad93e495830563/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 clearbit\n\n\nContents of section .text:\n 0000 24020001 00a21004 00021027 03e00008 $..........'....\n 0010 00821024 00000000 00000000 00000000 ...$............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 clearbit(u32 a0, u32 a1) {\n return a0 & ~(1 << a1);\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clearbit(s32 arg0, s32 arg1) {\n return arg0 & ~(1 << arg1);\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clearbit` — benchmark function synthetic:clearbit:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clearbit\n li\t$v0, 1\n sllv\t$v0, $v0, $a1\n nor\t$v0, $zero, $v0\n jr\t$ra\n and\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clearbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clearbit` — benchmark function synthetic:clearbit:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clearbit:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tsllv\tv0,v0,a1\n 8:\tnor\tv0,zero,v0\n c:\tjr\tra\n 10:\tand\tv0,a0,v0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-60ad93e495830563/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 clearbit\n\n\nContents of section .text:\n 0000 24020001 00a21004 00021027 03e00008 $..........'....\n 0010 00821024 00000000 00000000 00000000 ...$............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name clearbit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clearbit:ido7.1","sym":"clearbit","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int clearbit(int x,int n){ return x & ~(1<:\n 0:\tli\tt6,1\n 4:\tsllv\tt7,t6,a1\n 8:\tnor\tt8,t7,zero\n c:\tjr\tra\n 10:\tand\tv0,t8,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 clearbit\n\n\nContents of section .text:\n 0000 240e0001 00ae7804 01e0c027 03e00008 $.....x....'....\n 0010 03041024 00000000 00000000 00000000 ...$............\nContents of section .options:\n 0000 01200000 00000000 8100c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002d0 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 0000000c 0000026c 00000001 00000278 .......l.......x\n 0050 00000000 00000000 00000001 000002c0 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 30616439 33653439 35383330 ef-60ad93e495830\n 0130 3536332f 7265662e 6300636c 65617262 563/ref.c.clearb\n 0140 69740000 636c6561 72626974 00000000 it..clearbit....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 00000005 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 clearbit(u32 a0, u32 a1) {\n return ~(1 << a1) & a0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clearbit(s32 arg0, s32 arg1) {\n return ~(1 << arg1) & arg0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clearbit` — benchmark function synthetic:clearbit:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clearbit\n li\t$t6, 1\n sllv\t$t7, $t6, $a1\n nor\t$t8, $t7, $zero\n jr\t$ra\n and\t$v0, $t8, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clearbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clearbit` — benchmark function synthetic:clearbit:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clearbit:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tt6,1\n 4:\tsllv\tt7,t6,a1\n 8:\tnor\tt8,t7,zero\n c:\tjr\tra\n 10:\tand\tv0,t8,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 clearbit\n\n\nContents of section .text:\n 0000 240e0001 00ae7804 01e0c027 03e00008 $.....x....'....\n 0010 03041024 00000000 00000000 00000000 ...$............\nContents of section .options:\n 0000 01200000 00000000 8100c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002d0 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 0000000c 0000026c 00000001 00000278 .......l.......x\n 0050 00000000 00000000 00000001 000002c0 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 30616439 33653439 35383330 ef-60ad93e495830\n 0130 3536332f 7265662e 6300636c 65617262 563/ref.c.clearb\n 0140 69740000 636c6561 72626974 00000000 it..clearbit....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 00000005 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clearbit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:clearbit:mwcc_242_81","sym":"clearbit","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int clearbit(int x,int n){ return x & ~(1<:\n 0:\tli r0,1\n 4:\tslw r0,r0,r4\n 8:\tandc r3,r3,r0\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 clearbit\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clearbit\n\n\nContents of section .text:\n 0000 38000001 7c002030 7c630078 4e800020 8...|. 0|c.xN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 clearbit(u32 a0, u32 a1) {\n return a0 & ~(1 << a1);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 clearbit(s32 arg0, s32 arg1) {\n return arg0 & ~(1 << arg1);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `clearbit` — benchmark function synthetic:clearbit:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel clearbit\n li r0,1\n slw r0,r0,r4\n andc r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function clearbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `clearbit` — benchmark function synthetic:clearbit:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:clearbit:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r0,1\n 4:\tslw r0,r0,r4\n 8:\tandc r3,r3,r0\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 clearbit\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 clearbit\n\n\nContents of section .text:\n 0000 38000001 7c002030 7c630078 4e800020 8...|. 0|c.xN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name clearbit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:continueloop:agbcc","sym":"continueloop","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for","continue","memory"],"loc":1,"refSource":"int continueloop(int *a,int n){ int s=0,i; for(i=0;i= a1) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n do {\n if (*v0 >= 0) v1 = v1 + *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":5,"maxScore":16,"compileErrors":null,"breakdown":{"insert":3,"delete":1,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 continueloop(s32 *arg0, s32 arg1) {\n s32 *var_r0;\n s32 temp_r2;\n s32 var_r1;\n s32 var_r3;\n\n var_r0 = arg0;\n var_r1 = arg1;\n var_r3 = 0;\n if (var_r1 > 0) {\n do {\n temp_r2 = *var_r0;\n if (temp_r2 >= 0) {\n var_r3 += temp_r2;\n }\n var_r0 += 4;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n return var_r3;\n}\n","score":3,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":13,"ratio":0.23076923076923078,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `continueloop` — benchmark function synthetic:continueloop:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcontinueloop\n\t.type\t continueloop,function\n\t.thumb_func\ncontinueloop:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, #0\n\tblt\t.L5\t@cond_branch\n\tadd\tr3, r3, r2\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t continueloop,.Lfe1-continueloop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function continueloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `continueloop` — benchmark function synthetic:continueloop:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:continueloop:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcontinueloop\n\t.type\t continueloop,function\n\t.thumb_func\ncontinueloop:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, #0\n\tblt\t.L5\t@cond_branch\n\tadd\tr3, r3, r2\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t continueloop,.Lfe1-continueloop\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name continueloop # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:continueloop:gcc2.7.2kmc","sym":"continueloop","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for","continue","memory"],"loc":1,"refSource":"int continueloop(int *a,int n){ int s=0,i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,2c \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\tbgezl\tv0,1c \n 18:\taddu\tv1,v1,v0\n 1c:\taddiu\ta2,a2,1\n 20:\tslt\tv0,a2,a1\n 24:\tbnez\tv0,10 \n 28:\taddiu\ta0,a0,4\n 2c:\tmove\tv0,v1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5f5a6ee3e50ec73c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 continueloop\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00008 00001821 '.....0!.......!\n 0010 8c820000 04430001 00621821 24c60001 .....C...b.!$...\n 0020 00c5102a 1440fffa 24840004 00601021 ...*.@..$....`.!\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'continueloop' — lift: cannot lift 'continueloop': unmodelled control transfer 'bgezl' at 0x14 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-8 */\n/* 4:\tmove\ta2,zero */\n/* 8:\tblez\ta1,2c */\n/* c:\tmove\tv1,zero */\n/* 10:\tlw\tv0,0(a0) */\n/* 14:\tbgezl\tv0,1c */\n/* 18:\taddu\tv1,v1,v0 */\n/* 1c:\taddiu\ta2,a2,1 */\n/* 20:\tslt\tv0,a2,a1 */\n/* 24:\tbnez\tv0,10 */\n/* 28:\taddiu\ta0,a0,4 */\n/* 2c:\tmove\tv0,v1 */\n/* 30:\tjr\tra */\n/* 34:\taddiu\tsp,sp,8 */\n/* \t... */\nvoid continueloop(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'continueloop': unmodelled control transfer 'bgezl' at 0x14 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'continueloop': unmodelled control transfer 'bgezl' at 0x14 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 continueloop(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 temp_v0;\n s32 var_a2;\n s32 var_v1;\n\n var_a0 = arg0;\n var_a2 = 0;\n var_v1 = 0;\n if (arg1 > 0) {\n do {\n temp_v0 = *var_a0;\n if (temp_v0 >= 0) {\n var_v1 += temp_v0;\n }\n var_a2 += 1;\n var_a0 += 4;\n } while (var_a2 < arg1);\n }\n return var_v1;\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":9,"maxScore":14,"ratio":0.6428571428571429,"kinds":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `continueloop` — benchmark function synthetic:continueloop:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel continueloop\n addiu\t$sp, $sp, -8\n move\t$a2, $zero\n blez\t$a1, .L2c\n move\t$v1, $zero\n.L10:\n lw\t$v0, 0($a0)\n bgezl\t$v0, .L1c\n addu\t$v1, $v1, $v0\n.L1c:\n addiu\t$a2, $a2, 1\n slt\t$v0, $a2, $a1\n bnez\t$v0, .L10\n addiu\t$a0, $a0, 4\n.L2c:\n move\t$v0, $v1\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function continueloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `continueloop` — benchmark function synthetic:continueloop:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:continueloop:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,2c \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\tbgezl\tv0,1c \n 18:\taddu\tv1,v1,v0\n 1c:\taddiu\ta2,a2,1\n 20:\tslt\tv0,a2,a1\n 24:\tbnez\tv0,10 \n 28:\taddiu\ta0,a0,4\n 2c:\tmove\tv0,v1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5f5a6ee3e50ec73c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 continueloop\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00008 00001821 '.....0!.......!\n 0010 8c820000 04430001 00621821 24c60001 .....C...b.!$...\n 0020 00c5102a 1440fffa 24840004 00601021 ...*.@..$....`.!\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name continueloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:continueloop:ido7.1","sym":"continueloop","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for","continue","memory"],"loc":1,"refSource":"int continueloop(int *a,int n){ int s=0,i; for(i=0;i:\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,9c \n 8:\tmove\tv0,zero\n c:\tandi\ta3,a1,0x3\n 10:\tbeqz\ta3,40 \n 14:\tmove\tt0,a3\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\ta3,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\tbltz\ta3,34 \n 2c:\tnop\n 30:\taddu\tv1,v1,a3\n 34:\tbne\tt0,v0,20 \n 38:\taddiu\ta2,a2,4\n 3c:\tbeq\tv0,a1,9c \n 40:\tsll\tt7,v0,0x2\n 44:\tsll\tt8,a1,0x2\n 48:\taddu\tt0,t8,a0\n 4c:\taddu\ta2,a0,t7\n 50:\tlw\ta3,0(a2)\n 54:\tbltzl\ta3,64 \n 58:\tlw\tv0,4(a2)\n 5c:\taddu\tv1,v1,a3\n 60:\tlw\tv0,4(a2)\n 64:\tbltzl\tv0,74 \n 68:\tlw\tv0,8(a2)\n 6c:\taddu\tv1,v1,v0\n 70:\tlw\tv0,8(a2)\n 74:\tbltzl\tv0,84 \n 78:\tlw\tv0,12(a2)\n 7c:\taddu\tv1,v1,v0\n 80:\tlw\tv0,12(a2)\n 84:\taddiu\ta2,a2,16\n 88:\tbltz\tv0,94 \n 8c:\tnop\n 90:\taddu\tv1,v1,v0\n 94:\tbnel\ta2,t0,54 \n 98:\tlw\ta3,0(a2)\n 9c:\tjr\tra\n a0:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 continueloop\n\n\nContents of section .text:\n 0000 00001825 18a00025 00001025 30a70003 ...%...%...%0...\n 0010 10e0000b 00e04025 00007080 008e3021 ......@%..p...0!\n 0020 8cc70000 24420001 04e00002 00000000 ....$B..........\n 0030 00671821 1502fffa 24c60004 10450017 .g.!....$....E..\n 0040 00027880 0005c080 03044021 008f3021 ..x.......@!..0!\n 0050 8cc70000 04e20003 8cc20004 00671821 .............g.!\n 0060 8cc20004 04420003 8cc20008 00621821 .....B.......b.!\n 0070 8cc20008 04420003 8cc2000c 00621821 .....B.......b.!\n 0080 8cc2000c 24c60010 04400002 00000000 ....$....@......\n 0090 00621821 54c8ffef 8cc70000 03e00008 .b.!T...........\n 00a0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8100c1fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c1fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000008 00000228 p......).......(\n 0010 00000005 0000037c 00000001 00000230 .......|.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 0000003c 000002d8 ...........<....\n 0040 00000010 00000314 00000001 00000324 ...............$\n 0050 00000000 00000000 00000001 0000036c ...............l\n 0060 08080808 04000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000a4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d35 66356136 65653365 ps-ref-5f5a6ee3e\n 0130 35306563 3733632f 7265662e 6300636f 50ec73c/ref.c.co\n 0140 6e74696e 75656c6f 6f700000 636f6e74 ntinueloop..cont\n 0150 696e7565 6c6f6f70 00000000 00000000 inueloop........\n 0160 00000001 00000000 0000003b 00000000 ...........;....\n 0170 00000004 00000000 00000029 00000000 ...........)....\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000005 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'continueloop' — lift: cannot lift 'continueloop': unmodelled control transfer 'bltzl' at 0x54 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tblez\ta1,9c */\n/* 8:\tmove\tv0,zero */\n/* c:\tandi\ta3,a1,0x3 */\n/* 10:\tbeqz\ta3,40 */\n/* 14:\tmove\tt0,a3 */\n/* 18:\tsll\tt6,zero,0x2 */\n/* 1c:\taddu\ta2,a0,t6 */\n/* 20:\tlw\ta3,0(a2) */\n/* 24:\taddiu\tv0,v0,1 */\n/* 28:\tbltz\ta3,34 */\n/* 2c:\tnop */\n/* 30:\taddu\tv1,v1,a3 */\n/* 34:\tbne\tt0,v0,20 */\n/* 38:\taddiu\ta2,a2,4 */\n/* 3c:\tbeq\tv0,a1,9c */\n/* 40:\tsll\tt7,v0,0x2 */\n/* 44:\tsll\tt8,a1,0x2 */\n/* 48:\taddu\tt0,t8,a0 */\n/* 4c:\taddu\ta2,a0,t7 */\n/* 50:\tlw\ta3,0(a2) */\n/* 54:\tbltzl\ta3,64 */\n/* 58:\tlw\tv0,4(a2) */\n/* 5c:\taddu\tv1,v1,a3 */\n/* 60:\tlw\tv0,4(a2) */\n/* 64:\tbltzl\tv0,74 */\n/* 68:\tlw\tv0,8(a2) */\n/* 6c:\taddu\tv1,v1,v0 */\n/* 70:\tlw\tv0,8(a2) */\n/* 74:\tbltzl\tv0,84 */\n/* 78:\tlw\tv0,12(a2) */\n/* 7c:\taddu\tv1,v1,v0 */\n/* 80:\tlw\tv0,12(a2) */\n/* 84:\taddiu\ta2,a2,16 */\n/* 88:\tbltz\tv0,94 */\n/* 8c:\tnop */\n/* 90:\taddu\tv1,v1,v0 */\n/* 94:\tbnel\ta2,t0,54 */\n/* 98:\tlw\ta3,0(a2) */\n/* 9c:\tjr\tra */\n/* a0:\tmove\tv0,v1 */\n/* \t... */\nvoid continueloop(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'continueloop': unmodelled control transfer 'bltzl' at 0x54 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":50,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'continueloop': unmodelled control transfer 'bltzl' at 0x54 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 continueloop(s32 arg0, s32 arg1) {\n s32 *var_a2;\n s32 temp_a3;\n s32 temp_a3_2;\n s32 temp_a3_3;\n s32 temp_v0;\n s32 temp_v0_2;\n s32 temp_v0_3;\n s32 var_v0;\n s32 var_v1;\n void *var_a2_2;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg1 > 0) {\n temp_a3 = arg1 & 3;\n if (temp_a3 != 0) {\n var_a2 = arg0 + (0 * 4);\n do {\n temp_a3_2 = *var_a2;\n var_v0 += 1;\n if (temp_a3_2 >= 0) {\n var_v1 += temp_a3_2;\n }\n var_a2 += 4;\n } while (temp_a3 != var_v0);\n if (var_v0 != arg1) {\n goto block_7;\n }\n } else {\nblock_7:\n var_a2_2 = arg0 + (var_v0 * 4);\n do {\n temp_a3_3 = var_a2_2->unk0;\n if (temp_a3_3 >= 0) {\n var_v1 += temp_a3_3;\n }\n temp_v0 = var_a2_2->unk4;\n if (temp_v0 >= 0) {\n var_v1 += temp_v0;\n }\n temp_v0_2 = var_a2_2->unk8;\n if (temp_v0_2 >= 0) {\n var_v1 += temp_v0_2;\n }\n temp_v0_3 = var_a2_2->unkC;\n var_a2_2 += 0x10;\n if (temp_v0_3 >= 0) {\n var_v1 += temp_v0_3;\n }\n } while (var_a2_2 != ((arg1 * 4) + arg0));\n }\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":6,"quality":{"score":88,"lines":54,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 35: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 39: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 43: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 47: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 48: Bad operand type for += or -="]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `continueloop` — benchmark function synthetic:continueloop:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel continueloop\n move\t$v1, $zero\n blez\t$a1, .L9c\n move\t$v0, $zero\n andi\t$a3, $a1, 0x3\n beqz\t$a3, .L40\n move\t$t0, $a3\n sll\t$t6, $zero, 0x2\n addu\t$a2, $a0, $t6\n.L20:\n lw\t$a3, 0($a2)\n addiu\t$v0, $v0, 1\n bltz\t$a3, .L34\n nop\n addu\t$v1, $v1, $a3\n.L34:\n bne\t$t0, $v0, .L20\n addiu\t$a2, $a2, 4\n beq\t$v0, $a1, .L9c\n.L40:\n sll\t$t7, $v0, 0x2\n sll\t$t8, $a1, 0x2\n addu\t$t0, $t8, $a0\n addu\t$a2, $a0, $t7\n lw\t$a3, 0($a2)\n.L54:\n bltzl\t$a3, .L64\n lw\t$v0, 4($a2)\n addu\t$v1, $v1, $a3\n lw\t$v0, 4($a2)\n.L64:\n bltzl\t$v0, .L74\n lw\t$v0, 8($a2)\n addu\t$v1, $v1, $v0\n lw\t$v0, 8($a2)\n.L74:\n bltzl\t$v0, .L84\n lw\t$v0, 12($a2)\n addu\t$v1, $v1, $v0\n lw\t$v0, 12($a2)\n.L84:\n addiu\t$a2, $a2, 16\n bltz\t$v0, .L94\n nop\n addu\t$v1, $v1, $v0\n.L94:\n bnel\t$a2, $t0, .L54\n lw\t$a3, 0($a2)\n.L9c:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function continueloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `continueloop` — benchmark function synthetic:continueloop:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:continueloop:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,9c \n 8:\tmove\tv0,zero\n c:\tandi\ta3,a1,0x3\n 10:\tbeqz\ta3,40 \n 14:\tmove\tt0,a3\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\ta3,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\tbltz\ta3,34 \n 2c:\tnop\n 30:\taddu\tv1,v1,a3\n 34:\tbne\tt0,v0,20 \n 38:\taddiu\ta2,a2,4\n 3c:\tbeq\tv0,a1,9c \n 40:\tsll\tt7,v0,0x2\n 44:\tsll\tt8,a1,0x2\n 48:\taddu\tt0,t8,a0\n 4c:\taddu\ta2,a0,t7\n 50:\tlw\ta3,0(a2)\n 54:\tbltzl\ta3,64 \n 58:\tlw\tv0,4(a2)\n 5c:\taddu\tv1,v1,a3\n 60:\tlw\tv0,4(a2)\n 64:\tbltzl\tv0,74 \n 68:\tlw\tv0,8(a2)\n 6c:\taddu\tv1,v1,v0\n 70:\tlw\tv0,8(a2)\n 74:\tbltzl\tv0,84 \n 78:\tlw\tv0,12(a2)\n 7c:\taddu\tv1,v1,v0\n 80:\tlw\tv0,12(a2)\n 84:\taddiu\ta2,a2,16\n 88:\tbltz\tv0,94 \n 8c:\tnop\n 90:\taddu\tv1,v1,v0\n 94:\tbnel\ta2,t0,54 \n 98:\tlw\ta3,0(a2)\n 9c:\tjr\tra\n a0:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 continueloop\n\n\nContents of section .text:\n 0000 00001825 18a00025 00001025 30a70003 ...%...%...%0...\n 0010 10e0000b 00e04025 00007080 008e3021 ......@%..p...0!\n 0020 8cc70000 24420001 04e00002 00000000 ....$B..........\n 0030 00671821 1502fffa 24c60004 10450017 .g.!....$....E..\n 0040 00027880 0005c080 03044021 008f3021 ..x.......@!..0!\n 0050 8cc70000 04e20003 8cc20004 00671821 .............g.!\n 0060 8cc20004 04420003 8cc20008 00621821 .....B.......b.!\n 0070 8cc20008 04420003 8cc2000c 00621821 .....B.......b.!\n 0080 8cc2000c 24c60010 04400002 00000000 ....$....@......\n 0090 00621821 54c8ffef 8cc70000 03e00008 .b.!T...........\n 00a0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8100c1fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c1fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000008 00000228 p......).......(\n 0010 00000005 0000037c 00000001 00000230 .......|.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 0000003c 000002d8 ...........<....\n 0040 00000010 00000314 00000001 00000324 ...............$\n 0050 00000000 00000000 00000001 0000036c ...............l\n 0060 08080808 04000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000a4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d35 66356136 65653365 ps-ref-5f5a6ee3e\n 0130 35306563 3733632f 7265662e 6300636f 50ec73c/ref.c.co\n 0140 6e74696e 75656c6f 6f700000 636f6e74 ntinueloop..cont\n 0150 696e7565 6c6f6f70 00000000 00000000 inueloop........\n 0160 00000001 00000000 0000003b 00000000 ...........;....\n 0170 00000004 00000000 00000029 00000000 ...........)....\n 0180 00000000 00000001 00000000 00000011 ................\n 0190 00000000 00000000 01800000 00000000 ................\n 01a0 00000005 00000000 00000000 00000000 ................\n 01b0 18200001 00000000 00000000 00000000 . ..............\n 01c0 00000000 00000000 00000000 7fffffff ................\n 01d0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name continueloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:continueloop:mwcc_242_81","sym":"continueloop","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for","continue","memory"],"loc":1,"refSource":"int continueloop(int *a,int n){ int s=0,i; for(i=0;i:\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r4,0(r3)\n 14:\tsrwi. r0,r4,31\n 18:\tbne 20 \n 1c:\tadd r5,r5,r4\n 20:\taddi r3,r3,4\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 continueloop\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 continueloop\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80830000 54800fff 40820008 7ca52214 ....T...@...|.\".\n 0020 38630004 4200ffec 7ca32b78 4e800020 8c..B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 continueloop(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 <= 0) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n do {\n if ((u32)*v0 >> 31 == 0) v1 = v1 + *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":12,"maxScore":16,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":0,"opMismatch":2,"argMismatch":4},"quality":{"score":100,"lines":18,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 continueloop(u32 *arg0, s32 arg1) {\n s32 var_ctr;\n s32 var_r5;\n u32 *var_r3;\n u32 temp_r4;\n\n var_r3 = arg0;\n var_r5 = 0;\n var_ctr = arg1;\n if (arg1 > 0) {\n do {\n temp_r4 = *var_r3;\n if ((temp_r4 >> 0x1FU) == 0) {\n var_r5 += temp_r4;\n }\n var_r3 += 4;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n return var_r5;\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":4},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":9,"maxScore":14,"ratio":0.6428571428571429,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `continueloop` — benchmark function synthetic:continueloop:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel continueloop\n li r5,0\n mtctr r4\n cmpwi r4,0\n ble .L28\n.L10:\n lwz r4,0(r3)\n srwi. r0,r4,31\n bne .L20\n add r5,r5,r4\n.L20:\n addi r3,r3,4\n bdnz .L10\n.L28:\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function continueloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `continueloop` — benchmark function synthetic:continueloop:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:continueloop:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r4,0(r3)\n 14:\tsrwi. r0,r4,31\n 18:\tbne 20 \n 1c:\tadd r5,r5,r4\n 20:\taddi r3,r3,4\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 continueloop\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 continueloop\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80830000 54800fff 40820008 7ca52214 ....T...@...|.\".\n 0020 38630004 4200ffec 7ca32b78 4e800020 8c..B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name continueloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countdown:agbcc","sym":"countdown","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","while"],"loc":1,"refSource":"int countdown(int n){ int c=0; while(n>0){c++;n--;} return c; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcountdown\n\t.type\t countdown,function\n\t.thumb_func\ncountdown:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tble\t.L4\t@cond_branch\n.L5:\n\tadd\tr1, r1, #0x1\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0\n\tbgt\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t countdown,.Lfe1-countdown\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 countdown(u32 a0) {\n s32 v0;\n s32 v1;\n v1 = a0;\n v0 = 0;\n while (v1 > 0) {\n v0 = v0 + 1;\n v1 = v1 - 1;\n }\n return v0;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 countdown(s32 arg0) {\n s32 var_r0;\n s32 var_r1;\n\n var_r0 = arg0;\n var_r1 = 0;\n if (var_r0 > 0) {\n do {\n var_r1 += 1;\n var_r0 -= 1;\n } while (var_r0 > 0);\n }\n return var_r1;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countdown` — benchmark function synthetic:countdown:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcountdown\n\t.type\t countdown,function\n\t.thumb_func\ncountdown:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tble\t.L4\t@cond_branch\n.L5:\n\tadd\tr1, r1, #0x1\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0\n\tbgt\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t countdown,.Lfe1-countdown\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countdown # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countdown` — benchmark function synthetic:countdown:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countdown:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcountdown\n\t.type\t countdown,function\n\t.thumb_func\ncountdown:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tble\t.L4\t@cond_branch\n.L5:\n\tadd\tr1, r1, #0x1\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0\n\tbgt\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t countdown,.Lfe1-countdown\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name countdown # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countdown:gcc2.7.2kmc","sym":"countdown","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","while"],"loc":1,"refSource":"int countdown(int n){ int c=0; while(n>0){c++;n--;} return c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,14 \n 4:\tmove\tv0,zero\n 8:\taddiu\ta0,a0,-1\n c:\tbgtz\ta0,8 \n 10:\taddiu\tv0,v0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-0c202a2d2388253f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c countdown\n\n\nContents of section .text:\n 0000 18800004 00001021 2484ffff 1c80fffe .......!$.......\n 0010 24420001 03e00008 00000000 00000000 $B..............\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 countdown(u32 a0) {\n s32 v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n while (v0 > 0) {\n v0 = v0 + -1;\n v1 = v1 + 1;\n }\n return v1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void countdown(s32 arg0) {\n s32 var_a0;\n\n var_a0 = arg0;\n if (var_a0 > 0) {\n do {\n var_a0 -= 1;\n } while (var_a0 > 0);\n }\n}\n","score":3,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countdown` — benchmark function synthetic:countdown:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel countdown\n blez\t$a0, .L14\n move\t$v0, $zero\n.L8:\n addiu\t$a0, $a0, -1\n bgtz\t$a0, .L8\n addiu\t$v0, $v0, 1\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countdown # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countdown` — benchmark function synthetic:countdown:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countdown:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,14 \n 4:\tmove\tv0,zero\n 8:\taddiu\ta0,a0,-1\n c:\tbgtz\ta0,8 \n 10:\taddiu\tv0,v0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-0c202a2d2388253f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c countdown\n\n\nContents of section .text:\n 0000 18800004 00001021 2484ffff 1c80fffe .......!$.......\n 0010 24420001 03e00008 00000000 00000000 $B..............\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name countdown # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countdown:ido7.1","sym":"countdown","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","while"],"loc":1,"refSource":"int countdown(int n){ int c=0; while(n>0){c++;n--;} return c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,14 \n 4:\tmove\tv1,zero\n 8:\taddiu\ta0,a0,-1\n c:\tbgtz\ta0,8 \n 10:\taddiu\tv1,v1,1\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c countdown\n\n\nContents of section .text:\n 0000 18800004 00001825 2484ffff 1c80fffe .......%$.......\n 0010 24630001 03e00008 00601025 00000000 $c.......`.%....\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002d0 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 0000000c 0000026c 00000001 00000278 .......l.......x\n 0050 00000000 00000000 00000001 000002c0 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 63323032 61326432 33383832 ef-0c202a2d23882\n 0130 3533662f 7265662e 6300636f 756e7464 53f/ref.c.countd\n 0140 6f776e00 636f756e 74646f77 6e000000 own.countdown...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000007 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 countdown(s32 a0) {\n s32 v0;\n v0 = 0;\n while (a0 > 0) {\n a0 = a0 + -1;\n v0 = v0 + 1;\n }\n return v0;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 countdown(s32 arg0) {\n s32 var_a0;\n s32 var_v1;\n\n var_a0 = arg0;\n var_v1 = 0;\n if (var_a0 > 0) {\n do {\n var_a0 -= 1;\n var_v1 += 1;\n } while (var_a0 > 0);\n }\n return var_v1;\n}\n","score":12,"maxScore":16,"compileErrors":null,"breakdown":{"insert":9,"delete":0,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countdown` — benchmark function synthetic:countdown:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel countdown\n blez\t$a0, .L14\n move\t$v1, $zero\n.L8:\n addiu\t$a0, $a0, -1\n bgtz\t$a0, .L8\n addiu\t$v1, $v1, 1\n.L14:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countdown # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countdown` — benchmark function synthetic:countdown:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countdown:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,14 \n 4:\tmove\tv1,zero\n 8:\taddiu\ta0,a0,-1\n c:\tbgtz\ta0,8 \n 10:\taddiu\tv1,v1,1\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c countdown\n\n\nContents of section .text:\n 0000 18800004 00001825 2484ffff 1c80fffe .......%$.......\n 0010 24630001 03e00008 00601025 00000000 $c.......`.%....\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002d0 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 0000000c 0000026c 00000001 00000278 .......l.......x\n 0050 00000000 00000000 00000001 000002c0 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 63323032 61326432 33383832 ef-0c202a2d23882\n 0130 3533662f 7265662e 6300636f 756e7464 53f/ref.c.countd\n 0140 6f776e00 636f756e 74646f77 6e000000 own.countdown...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000007 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name countdown # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countdown:mwcc_242_81","sym":"countdown","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","while"],"loc":1,"refSource":"int countdown(int n){ int c=0; while(n>0){c++;n--;} return c; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r4,0\n 8:\tble 34 \n c:\tsrwi. r0,r3,3\n 10:\tmtctr r0\n 14:\tbeq 28 \n 18:\taddi r4,r4,8\n 1c:\tbdnz 18 \n 20:\tandi. r3,r3,7\n 24:\tbeq 34 \n 28:\tmtctr r3\n 2c:\taddi r4,r4,1\n 30:\tbdnz 2c \n 34:\tmr r3,r4\n 38:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000003c countdown\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 countdown\n\n\nContents of section .text:\n 0000 2c030000 38800000 4081002c 5460e8ff ,...8...@..,T`..\n 0010 7c0903a6 41820014 38840008 4200fffc |...A...8...B...\n 0020 70630007 41820010 7c6903a6 38840001 pc..A...|i..8...\n 0030 4200fffc 7c832378 4e800020 B...|.#xN.. \nContents of section .mwcats.text:\n 0000 0200003c 00000000 ...<.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 countdown(s32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n if ((u32)a0 >> 3 == 0) {\n v0 = 0;\n v2 = v0;\n v3 = a0;\n do {\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n v0 = v2;\n } else {\n v0 = 0;\n v1 = (u32)a0 >> 3;\n do {\n v0 = v0 + 8;\n v1 = v1 - 1;\n } while (v1 != 0);\n if ((a0 & 7) == 0) {\n v0 = v0;\n } else {\n v0 = v0;\n a0 = a0 & 7;\n v2 = v0;\n v3 = a0;\n do {\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n v0 = v2;\n }\n }\n }\n return v0;\n}\n","score":24,"maxScore":27,"compileErrors":null,"breakdown":{"insert":12,"delete":1,"replace":4,"opMismatch":4,"argMismatch":3},"quality":{"score":100,"lines":41,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 countdown(s32 arg0) {\n s32 var_ctr_2;\n s32 var_r3;\n s32 var_r4;\n u32 temp_r0;\n u32 var_ctr;\n\n var_r3 = arg0;\n var_r4 = 0;\n if (var_r3 > 0) {\n temp_r0 = (u32) var_r3 >> 3U;\n var_ctr = temp_r0;\n if (temp_r0 != 0) {\n do {\n var_r4 += 8;\n var_ctr -= 1;\n } while (var_ctr != 0);\n var_r3 &= 7;\n if (var_r3 != 0) {\n goto block_4;\n }\n } else {\nblock_4:\n var_ctr_2 = var_r3;\n do {\n var_r4 += 1;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r4;\n}\n","score":6,"maxScore":16,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":3,"opMismatch":2,"argMismatch":0},"quality":{"score":88,"lines":31,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":16,"ratio":0.375,"kinds":{"insert":1,"delete":0,"replace":3,"opMismatch":2,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countdown` — benchmark function synthetic:countdown:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel countdown\n cmpwi r3,0\n li r4,0\n ble .L34\n srwi. r0,r3,3\n mtctr r0\n beq .L28\n.L18:\n addi r4,r4,8\n bdnz .L18\n andi. r3,r3,7\n beq .L34\n.L28:\n mtctr r3\n.L2c:\n addi r4,r4,1\n bdnz .L2c\n.L34:\n mr r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countdown # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countdown` — benchmark function synthetic:countdown:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countdown:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r4,0\n 8:\tble 34 \n c:\tsrwi. r0,r3,3\n 10:\tmtctr r0\n 14:\tbeq 28 \n 18:\taddi r4,r4,8\n 1c:\tbdnz 18 \n 20:\tandi. r3,r3,7\n 24:\tbeq 34 \n 28:\tmtctr r3\n 2c:\taddi r4,r4,1\n 30:\tbdnz 2c \n 34:\tmr r3,r4\n 38:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000003c countdown\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 countdown\n\n\nContents of section .text:\n 0000 2c030000 38800000 4081002c 5460e8ff ,...8...@..,T`..\n 0010 7c0903a6 41820014 38840008 4200fffc |...A...8...B...\n 0020 70630007 41820010 7c6903a6 38840001 pc..A...|i..8...\n 0030 4200fffc 7c832378 4e800020 B...|.#xN.. \nContents of section .mwcats.text:\n 0000 0200003c 00000000 ...<.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name countdown # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:Counter__inc:mwcc_242_81","sym":"Counter__inc","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c++","features":["c++","method","mutate"],"loc":2,"refSource":"struct Counter{int n;void inc(){ n++; }};\nextern \"C\" void Counter__inc(Counter*c){ c->inc(); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r4,0(r3)\n 4:\taddi r0,r4,1\n 8:\tstw r0,0(r3)\n c:\tblr\n","ctx":"struct Counter; void Counter__inc(struct Counter*);","proto":{"Counter__inc":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.cp\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 Counter__inc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 Counter__inc\n\n\nContents of section .text:\n 0000 80830000 38040001 90030000 4e800020 ....8.......N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void Counter__inc(s32 * a0) {\n *a0 = *a0 + 1;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void Counter__inc(struct Counter *arg0) {\n *arg0 = (s32) (*arg0 + 1);\n}\n/* Warning: struct Counter is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^","# illegal operand"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Counter__inc` — benchmark function synthetic:Counter__inc:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel Counter__inc\n lwz r4,0(r3)\n addi r0,r4,1\n stw r0,0(r3)\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct Counter; void Counter__inc(struct Counter*);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c++ # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Counter__inc # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Counter__inc` — benchmark function synthetic:Counter__inc:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:Counter__inc:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r4,0(r3)\n 4:\taddi r0,r4,1\n 8:\tstw r0,0(r3)\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.cp\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 Counter__inc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 Counter__inc\n\n\nContents of section .text:\n 0000 80830000 38040001 90030000 4e800020 ....8.......N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"Counter__inc\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name Counter__inc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countpos:agbcc","sym":"countpos","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int countpos(int *a,int n){ int c=0,i; for(i=0;i0)c++; return c; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcountpos\n\t.type\t countpos,function\n\t.thumb_func\ncountpos:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tldr\tr0, [r2]\n\tcmp\tr0, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r3, #0x1\n.L5:\n\tadd\tr2, r2, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t countpos,.Lfe1-countpos\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 countpos(s32 * a0, u32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (0 >= a1) {\n v1 = 0;\n } else {\n v0 = a0;\n v1 = 0;\n v2 = a1;\n do {\n if (*v0 > 0) v1 = v1 + 1;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":5,"maxScore":17,"compileErrors":null,"breakdown":{"insert":3,"delete":1,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 countpos(s32 *arg0, s32 arg1) {\n s32 *var_r2;\n s32 var_r1;\n s32 var_r3;\n\n var_r1 = arg1;\n var_r3 = 0;\n if (var_r1 > 0) {\n var_r2 = arg0;\n do {\n if ((s32) *var_r2 > 0) {\n var_r3 += 1;\n }\n var_r2 += 4;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n return var_r3;\n}\n","score":3,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":18,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":14,"ratio":0.21428571428571427,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countpos` — benchmark function synthetic:countpos:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcountpos\n\t.type\t countpos,function\n\t.thumb_func\ncountpos:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tldr\tr0, [r2]\n\tcmp\tr0, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r3, #0x1\n.L5:\n\tadd\tr2, r2, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t countpos,.Lfe1-countpos\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countpos # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countpos` — benchmark function synthetic:countpos:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countpos:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tcountpos\n\t.type\t countpos,function\n\t.thumb_func\ncountpos:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tldr\tr0, [r2]\n\tcmp\tr0, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r3, #0x1\n.L5:\n\tadd\tr2, r2, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t countpos,.Lfe1-countpos\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name countpos # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countpos:gcc2.7.2kmc","sym":"countpos","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int countpos(int *a,int n){ int c=0,i; for(i=0;i0)c++; return c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,2c \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\taddiu\ta2,a2,1\n 18:\tslt\tv0,zero,v0\n 1c:\taddu\tv1,v1,v0\n 20:\tslt\tv0,a2,a1\n 24:\tbnez\tv0,10 \n 28:\taddiu\ta0,a0,4\n 2c:\tmove\tv0,v1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a9f5abff6fff98c5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 countpos\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00008 00001821 '.....0!.......!\n 0010 8c820000 24c60001 0002102a 00621821 ....$......*.b.!\n 0020 00c5102a 1440fffa 24840004 00601021 ...*.@..$....`.!\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 countpos(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n v0 = a0;\n v1 = 0;\n v2 = 0;\n while (v1 < a1) {\n v1 = v1 + 1;\n v2 = v2 + (0 < *v0);\n v0 = v0 + 1;\n }\n return v2;\n}\n","score":6,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 countpos(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 var_a2;\n s32 var_v1;\n\n var_a0 = arg0;\n var_a2 = 0;\n var_v1 = 0;\n if (arg1 > 0) {\n do {\n var_a2 += 1;\n var_v1 += *var_a0 > 0;\n var_a0 += 4;\n } while (var_a2 < arg1);\n }\n return var_v1;\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":14,"ratio":0.42857142857142855,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countpos` — benchmark function synthetic:countpos:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel countpos\n addiu\t$sp, $sp, -8\n move\t$a2, $zero\n blez\t$a1, .L2c\n move\t$v1, $zero\n.L10:\n lw\t$v0, 0($a0)\n addiu\t$a2, $a2, 1\n slt\t$v0, $zero, $v0\n addu\t$v1, $v1, $v0\n slt\t$v0, $a2, $a1\n bnez\t$v0, .L10\n addiu\t$a0, $a0, 4\n.L2c:\n move\t$v0, $v1\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countpos # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countpos` — benchmark function synthetic:countpos:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countpos:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,2c \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\taddiu\ta2,a2,1\n 18:\tslt\tv0,zero,v0\n 1c:\taddu\tv1,v1,v0\n 20:\tslt\tv0,a2,a1\n 24:\tbnez\tv0,10 \n 28:\taddiu\ta0,a0,4\n 2c:\tmove\tv0,v1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a9f5abff6fff98c5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 countpos\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00008 00001821 '.....0!.......!\n 0010 8c820000 24c60001 0002102a 00621821 ....$......*.b.!\n 0020 00c5102a 1440fffa 24840004 00601021 ...*.@..$....`.!\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name countpos # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countpos:ido7.1","sym":"countpos","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int countpos(int *a,int n){ int c=0,i; for(i=0;i0)c++; return c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,9c \n 8:\tmove\tv0,zero\n c:\tandi\tt0,a1,0x3\n 10:\tbeqz\tt0,40 \n 14:\tmove\ta3,t0\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\tt7,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\tblez\tt7,34 \n 2c:\tnop\n 30:\taddiu\tv1,v1,1\n 34:\tbne\ta3,v0,20 \n 38:\taddiu\ta2,a2,4\n 3c:\tbeq\tv0,a1,9c \n 40:\tsll\tt8,v0,0x2\n 44:\tsll\tt9,a1,0x2\n 48:\taddu\ta3,t9,a0\n 4c:\taddu\ta2,a0,t8\n 50:\tlw\tt1,0(a2)\n 54:\tblezl\tt1,64 \n 58:\tlw\tt2,4(a2)\n 5c:\taddiu\tv1,v1,1\n 60:\tlw\tt2,4(a2)\n 64:\tblezl\tt2,74 \n 68:\tlw\tt3,8(a2)\n 6c:\taddiu\tv1,v1,1\n 70:\tlw\tt3,8(a2)\n 74:\tblezl\tt3,84 \n 78:\tlw\tt4,12(a2)\n 7c:\taddiu\tv1,v1,1\n 80:\tlw\tt4,12(a2)\n 84:\taddiu\ta2,a2,16\n 88:\tblez\tt4,94 \n 8c:\tnop\n 90:\taddiu\tv1,v1,1\n 94:\tbnel\ta2,a3,54 \n 98:\tlw\tt1,0(a2)\n 9c:\tjr\tra\n a0:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 countpos\n\n\nContents of section .text:\n 0000 00001825 18a00025 00001025 30a80003 ...%...%...%0...\n 0010 1100000b 01003825 00007080 008e3021 ......8%..p...0!\n 0020 8ccf0000 24420001 19e00002 00000000 ....$B..........\n 0030 24630001 14e2fffa 24c60004 10450017 $c......$....E..\n 0040 0002c080 0005c880 03243821 00983021 .........$8!..0!\n 0050 8cc90000 59200003 8cca0004 24630001 ....Y ......$c..\n 0060 8cca0004 59400003 8ccb0008 24630001 ....Y@......$c..\n 0070 8ccb0008 59600003 8ccc000c 24630001 ....Y`......$c..\n 0080 8ccc000c 24c60010 19800002 00000000 ....$...........\n 0090 24630001 54c7ffef 8cc90000 03e00008 $c..T...........\n 00a0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8300dffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300dffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000008 00000218 p......)........\n 0010 00000005 00000364 00000001 00000220 .......d....... \n 0020 00000004 00000254 00000000 00000000 .......T........\n 0030 00000011 00000284 00000038 000002c8 ...........8....\n 0040 0000000c 00000300 00000001 0000030c ................\n 0050 00000000 00000000 00000001 00000354 ...............T\n 0060 08080808 04000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000a4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d61 39663561 62666636 ps-ref-a9f5abff6\n 0130 66666639 3863352f 7265662e 6300636f fff98c5/ref.c.co\n 0140 756e7470 6f730000 636f756e 74706f73 untpos..countpos\n 0150 00000000 00000000 00000001 00000000 ................\n 0160 00000037 00000000 00000004 00000000 ...7............\n 0170 00000029 00000000 00000000 00000001 ...)............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000005 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'countpos' — lift: cannot lift 'countpos': unmodelled control transfer 'blezl' at 0x54 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tblez\ta1,9c */\n/* 8:\tmove\tv0,zero */\n/* c:\tandi\tt0,a1,0x3 */\n/* 10:\tbeqz\tt0,40 */\n/* 14:\tmove\ta3,t0 */\n/* 18:\tsll\tt6,zero,0x2 */\n/* 1c:\taddu\ta2,a0,t6 */\n/* 20:\tlw\tt7,0(a2) */\n/* 24:\taddiu\tv0,v0,1 */\n/* 28:\tblez\tt7,34 */\n/* 2c:\tnop */\n/* 30:\taddiu\tv1,v1,1 */\n/* 34:\tbne\ta3,v0,20 */\n/* 38:\taddiu\ta2,a2,4 */\n/* 3c:\tbeq\tv0,a1,9c */\n/* 40:\tsll\tt8,v0,0x2 */\n/* 44:\tsll\tt9,a1,0x2 */\n/* 48:\taddu\ta3,t9,a0 */\n/* 4c:\taddu\ta2,a0,t8 */\n/* 50:\tlw\tt1,0(a2) */\n/* 54:\tblezl\tt1,64 */\n/* 58:\tlw\tt2,4(a2) */\n/* 5c:\taddiu\tv1,v1,1 */\n/* 60:\tlw\tt2,4(a2) */\n/* 64:\tblezl\tt2,74 */\n/* 68:\tlw\tt3,8(a2) */\n/* 6c:\taddiu\tv1,v1,1 */\n/* 70:\tlw\tt3,8(a2) */\n/* 74:\tblezl\tt3,84 */\n/* 78:\tlw\tt4,12(a2) */\n/* 7c:\taddiu\tv1,v1,1 */\n/* 80:\tlw\tt4,12(a2) */\n/* 84:\taddiu\ta2,a2,16 */\n/* 88:\tblez\tt4,94 */\n/* 8c:\tnop */\n/* 90:\taddiu\tv1,v1,1 */\n/* 94:\tbnel\ta2,a3,54 */\n/* 98:\tlw\tt1,0(a2) */\n/* 9c:\tjr\tra */\n/* a0:\tmove\tv0,v1 */\n/* \t... */\nvoid countpos(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'countpos': unmodelled control transfer 'blezl' at 0x54 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":50,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'countpos': unmodelled control transfer 'blezl' at 0x54 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 countpos(s32 arg0, s32 arg1) {\n s32 *var_a2;\n s32 temp_t0;\n s32 temp_t4;\n s32 var_v0;\n s32 var_v1;\n void *var_a2_2;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg1 > 0) {\n temp_t0 = arg1 & 3;\n if (temp_t0 != 0) {\n var_a2 = arg0 + (0 * 4);\n do {\n var_v0 += 1;\n if (*var_a2 > 0) {\n var_v1 += 1;\n }\n var_a2 += 4;\n } while (temp_t0 != var_v0);\n if (var_v0 != arg1) {\n goto block_7;\n }\n } else {\nblock_7:\n var_a2_2 = arg0 + (var_v0 * 4);\n do {\n if (var_a2_2->unk0 > 0) {\n var_v1 += 1;\n }\n if (var_a2_2->unk4 > 0) {\n var_v1 += 1;\n }\n if (var_a2_2->unk8 > 0) {\n var_v1 += 1;\n }\n temp_t4 = var_a2_2->unkC;\n var_a2_2 += 0x10;\n if (temp_t4 > 0) {\n var_v1 += 1;\n }\n } while (var_a2_2 != ((arg1 * 4) + arg0));\n }\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":6,"quality":{"score":88,"lines":46,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 30: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 33: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 36: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 39: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 40: Bad operand type for += or -="]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countpos` — benchmark function synthetic:countpos:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel countpos\n move\t$v1, $zero\n blez\t$a1, .L9c\n move\t$v0, $zero\n andi\t$t0, $a1, 0x3\n beqz\t$t0, .L40\n move\t$a3, $t0\n sll\t$t6, $zero, 0x2\n addu\t$a2, $a0, $t6\n.L20:\n lw\t$t7, 0($a2)\n addiu\t$v0, $v0, 1\n blez\t$t7, .L34\n nop\n addiu\t$v1, $v1, 1\n.L34:\n bne\t$a3, $v0, .L20\n addiu\t$a2, $a2, 4\n beq\t$v0, $a1, .L9c\n.L40:\n sll\t$t8, $v0, 0x2\n sll\t$t9, $a1, 0x2\n addu\t$a3, $t9, $a0\n addu\t$a2, $a0, $t8\n lw\t$t1, 0($a2)\n.L54:\n blezl\t$t1, .L64\n lw\t$t2, 4($a2)\n addiu\t$v1, $v1, 1\n lw\t$t2, 4($a2)\n.L64:\n blezl\t$t2, .L74\n lw\t$t3, 8($a2)\n addiu\t$v1, $v1, 1\n lw\t$t3, 8($a2)\n.L74:\n blezl\t$t3, .L84\n lw\t$t4, 12($a2)\n addiu\t$v1, $v1, 1\n lw\t$t4, 12($a2)\n.L84:\n addiu\t$a2, $a2, 16\n blez\t$t4, .L94\n nop\n addiu\t$v1, $v1, 1\n.L94:\n bnel\t$a2, $a3, .L54\n lw\t$t1, 0($a2)\n.L9c:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countpos # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countpos` — benchmark function synthetic:countpos:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countpos:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,9c \n 8:\tmove\tv0,zero\n c:\tandi\tt0,a1,0x3\n 10:\tbeqz\tt0,40 \n 14:\tmove\ta3,t0\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\tt7,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\tblez\tt7,34 \n 2c:\tnop\n 30:\taddiu\tv1,v1,1\n 34:\tbne\ta3,v0,20 \n 38:\taddiu\ta2,a2,4\n 3c:\tbeq\tv0,a1,9c \n 40:\tsll\tt8,v0,0x2\n 44:\tsll\tt9,a1,0x2\n 48:\taddu\ta3,t9,a0\n 4c:\taddu\ta2,a0,t8\n 50:\tlw\tt1,0(a2)\n 54:\tblezl\tt1,64 \n 58:\tlw\tt2,4(a2)\n 5c:\taddiu\tv1,v1,1\n 60:\tlw\tt2,4(a2)\n 64:\tblezl\tt2,74 \n 68:\tlw\tt3,8(a2)\n 6c:\taddiu\tv1,v1,1\n 70:\tlw\tt3,8(a2)\n 74:\tblezl\tt3,84 \n 78:\tlw\tt4,12(a2)\n 7c:\taddiu\tv1,v1,1\n 80:\tlw\tt4,12(a2)\n 84:\taddiu\ta2,a2,16\n 88:\tblez\tt4,94 \n 8c:\tnop\n 90:\taddiu\tv1,v1,1\n 94:\tbnel\ta2,a3,54 \n 98:\tlw\tt1,0(a2)\n 9c:\tjr\tra\n a0:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 countpos\n\n\nContents of section .text:\n 0000 00001825 18a00025 00001025 30a80003 ...%...%...%0...\n 0010 1100000b 01003825 00007080 008e3021 ......8%..p...0!\n 0020 8ccf0000 24420001 19e00002 00000000 ....$B..........\n 0030 24630001 14e2fffa 24c60004 10450017 $c......$....E..\n 0040 0002c080 0005c880 03243821 00983021 .........$8!..0!\n 0050 8cc90000 59200003 8cca0004 24630001 ....Y ......$c..\n 0060 8cca0004 59400003 8ccb0008 24630001 ....Y@......$c..\n 0070 8ccb0008 59600003 8ccc000c 24630001 ....Y`......$c..\n 0080 8ccc000c 24c60010 19800002 00000000 ....$...........\n 0090 24630001 54c7ffef 8cc90000 03e00008 $c..T...........\n 00a0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8300dffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300dffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000008 00000218 p......)........\n 0010 00000005 00000364 00000001 00000220 .......d....... \n 0020 00000004 00000254 00000000 00000000 .......T........\n 0030 00000011 00000284 00000038 000002c8 ...........8....\n 0040 0000000c 00000300 00000001 0000030c ................\n 0050 00000000 00000000 00000001 00000354 ...............T\n 0060 08080808 04000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000a4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d61 39663561 62666636 ps-ref-a9f5abff6\n 0130 66666639 3863352f 7265662e 6300636f fff98c5/ref.c.co\n 0140 756e7470 6f730000 636f756e 74706f73 untpos..countpos\n 0150 00000000 00000000 00000001 00000000 ................\n 0160 00000037 00000000 00000004 00000000 ...7............\n 0170 00000029 00000000 00000000 00000001 ...)............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000005 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name countpos # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:countpos:mwcc_242_81","sym":"countpos","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int countpos(int *a,int n){ int c=0,i; for(i=0;i0)c++; return c; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r0,0(r3)\n 14:\tcmpwi r0,0\n 18:\tble 20 \n 1c:\taddi r5,r5,1\n 20:\taddi r3,r3,4\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 countpos\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 countpos\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80030000 2c000000 40810008 38a50001 ....,...@...8...\n 0020 38630004 4200ffec 7ca32b78 4e800020 8c..B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 countpos(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 <= 0) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n do {\n if (*v0 > 0) v1 = v1 + 1;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":8,"maxScore":16,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":0,"opMismatch":2,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 countpos(s32 *arg0, s32 arg1) {\n s32 *var_r3;\n s32 var_ctr;\n s32 var_r5;\n\n var_r3 = arg0;\n var_r5 = 0;\n var_ctr = arg1;\n if (arg1 > 0) {\n do {\n if ((s32) *var_r3 > 0) {\n var_r5 += 1;\n }\n var_r3 += 4;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n return var_r5;\n}\n","score":6,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":18,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":14,"ratio":0.42857142857142855,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `countpos` — benchmark function synthetic:countpos:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel countpos\n li r5,0\n mtctr r4\n cmpwi r4,0\n ble .L28\n.L10:\n lwz r0,0(r3)\n cmpwi r0,0\n ble .L20\n addi r5,r5,1\n.L20:\n addi r3,r3,4\n bdnz .L10\n.L28:\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function countpos # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `countpos` — benchmark function synthetic:countpos:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:countpos:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r0,0(r3)\n 14:\tcmpwi r0,0\n 18:\tble 20 \n 1c:\taddi r5,r5,1\n 20:\taddi r3,r3,4\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 countpos\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 countpos\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80030000 2c000000 40810008 38a50001 ....,...@...8...\n 0020 38630004 4200ffec 7ca32b78 4e800020 8c..B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name countpos # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dadd:agbcc","sym":"dadd","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","double","arithmetic"],"loc":1,"refSource":"double dadd(double a,double b){ return a+b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdadd\n\t.type\t dadd,function\n\t.thumb_func\ndadd:\n\tpush\t{lr}\n\tbl\t__adddf3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t dadd,.Lfe1-dadd\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 dadd(void) {\n return __adddf3();\n}\n","score":2,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? __adddf3(); /* extern */\n\nvoid dadd(void) {\n __adddf3();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":4,"ratio":0.5,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dadd` — benchmark function synthetic:dadd:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdadd\n\t.type\t dadd,function\n\t.thumb_func\ndadd:\n\tpush\t{lr}\n\tbl\t__adddf3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t dadd,.Lfe1-dadd\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dadd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dadd` — benchmark function synthetic:dadd:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dadd:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdadd\n\t.type\t dadd,function\n\t.thumb_func\ndadd:\n\tpush\t{lr}\n\tbl\t__adddf3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t dadd,.Lfe1-dadd\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name dadd # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dadd:gcc2.7.2kmc","sym":"dadd","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","double","arithmetic"],"loc":1,"refSource":"double dadd(double a,double b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.d\t$f0,$f12,$f14\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f5925313b8b0efc5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 dadd\n\n\nContents of section .text:\n 0000 03e00008 462e6000 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'dadd' — lift: cannot lift 'dadd @0x4': unmodelled effect instruction 'add.d' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tadd.d\t$f0,$f12,$f14 */\n/* \t... */\nvoid dadd(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'dadd @0x4': unmodelled effect instruction 'add.d' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'dadd @0x4': unmodelled effect instruction 'add.d' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f64 dadd(f64 arg0, f64 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dadd` — benchmark function synthetic:dadd:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dadd\n jr\t$ra\n add.d\t$f0, $f12, $f14\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dadd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dadd` — benchmark function synthetic:dadd:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dadd:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.d\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f5925313b8b0efc5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 dadd\n\n\nContents of section .text:\n 0000 03e00008 462e6000 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name dadd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dadd:ido7.1","sym":"dadd","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","double","arithmetic"],"loc":1,"refSource":"double dadd(double a,double b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.d\t$f0,$f12,$f14\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 dadd\n\n\nContents of section .text:\n 0000 03e00008 462e6000 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 0000f003 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 0000f003 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 35393235 33313362 38623065 ef-f5925313b8b0e\n 0130 6663352f 7265662e 63006461 64640000 fc5/ref.c.dadd..\n 0140 64616464 00000000 00000000 00000001 dadd............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'dadd' — lift: cannot lift 'dadd @0x4': unmodelled effect instruction 'add.d' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tadd.d\t$f0,$f12,$f14 */\n/* \t... */\nvoid dadd(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'dadd @0x4': unmodelled effect instruction 'add.d' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'dadd @0x4': unmodelled effect instruction 'add.d' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f64 dadd(f64 arg0, f64 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dadd` — benchmark function synthetic:dadd:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dadd\n jr\t$ra\n add.d\t$f0, $f12, $f14\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dadd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dadd` — benchmark function synthetic:dadd:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dadd:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.d\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 dadd\n\n\nContents of section .text:\n 0000 03e00008 462e6000 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 0000f003 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 0000f003 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 35393235 33313362 38623065 ef-f5925313b8b0e\n 0130 6663352f 7265662e 63006461 64640000 fc5/ref.c.dadd..\n 0140 64616464 00000000 00000000 00000001 dadd............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name dadd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dadd:mwcc_242_81","sym":"dadd","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","double","arithmetic"],"loc":1,"refSource":"double dadd(double a,double b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfadd f1,f1,f2\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 dadd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 dadd\n\n\nContents of section .text:\n 0000 fc21102a 4e800020 .!.*N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'dadd' — lift: cannot lift 'dadd @0x0': unmodelled effect instruction 'fadd' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfadd f1,f1,f2 */\n/* 4:\tblr */\nvoid dadd(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'dadd @0x0': unmodelled effect instruction 'fadd' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":10,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'dadd @0x0': unmodelled effect instruction 'fadd' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f64 dadd(f64 farg0, f64 farg1) {\n return farg0 + farg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dadd` — benchmark function synthetic:dadd:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dadd\n fadd f1,f1,f2\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dadd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dadd` — benchmark function synthetic:dadd:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dadd:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfadd f1,f1,f2\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 dadd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 dadd\n\n\nContents of section .text:\n 0000 fc21102a 4e800020 .!.*N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name dadd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:deref:agbcc","sym":"deref","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","load"],"loc":1,"refSource":"int deref(int *p){ return *p; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tderef\n\t.type\t deref,function\n\t.thumb_func\nderef:\n\tldr\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t deref,.Lfe1-deref\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 deref(s32 * a0) {\n return *a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 deref(s32 *arg0) {\n return *arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `deref` — benchmark function synthetic:deref:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tderef\n\t.type\t deref,function\n\t.thumb_func\nderef:\n\tldr\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t deref,.Lfe1-deref\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function deref # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `deref` — benchmark function synthetic:deref:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:deref:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tderef\n\t.type\t deref,function\n\t.thumb_func\nderef:\n\tldr\tr0, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t deref,.Lfe1-deref\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name deref # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:deref:gcc2.7.2kmc","sym":"deref","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","load"],"loc":1,"refSource":"int deref(int *p){ return *p; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,0(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ddae348b93b32b1f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 deref\n\n\nContents of section .text:\n 0000 03e00008 8c820000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 deref(s32 * a0) {\n return *a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 deref(s32 *arg0) {\n return *arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `deref` — benchmark function synthetic:deref:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel deref\n jr\t$ra\n lw\t$v0, 0($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function deref # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `deref` — benchmark function synthetic:deref:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:deref:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,0(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ddae348b93b32b1f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 deref\n\n\nContents of section .text:\n 0000 03e00008 8c820000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name deref # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:deref:ido7.1","sym":"deref","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","load"],"loc":1,"refSource":"int deref(int *p){ return *p; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,0(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 deref\n\n\nContents of section .text:\n 0000 03e00008 8c820000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 64616533 34386239 33623332 ef-ddae348b93b32\n 0130 6231662f 7265662e 63006465 72656600 b1f/ref.c.deref.\n 0140 64657265 66000000 00000000 00000001 deref...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 deref(s32 * a0) {\n return *a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 deref(s32 *arg0) {\n return *arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `deref` — benchmark function synthetic:deref:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel deref\n jr\t$ra\n lw\t$v0, 0($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function deref # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `deref` — benchmark function synthetic:deref:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:deref:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,0(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 deref\n\n\nContents of section .text:\n 0000 03e00008 8c820000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 64616533 34386239 33623332 ef-ddae348b93b32\n 0130 6231662f 7265662e 63006465 72656600 b1f/ref.c.deref.\n 0140 64657265 66000000 00000000 00000001 deref...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name deref # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:deref:mwcc_242_81","sym":"deref","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","load"],"loc":1,"refSource":"int deref(int *p){ return *p; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r3,0(r3)\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 deref\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 deref\n\n\nContents of section .text:\n 0000 80630000 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 deref(s32 * a0) {\n return *a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 deref(s32 *arg0) {\n return *arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `deref` — benchmark function synthetic:deref:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel deref\n lwz r3,0(r3)\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function deref # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `deref` — benchmark function synthetic:deref:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:deref:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r3,0(r3)\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 deref\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 deref\n\n\nContents of section .text:\n 0000 80630000 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name deref # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:div2:agbcc","sym":"div2","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int div2(int a){ return a/2; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdiv2\n\t.type\t div2,function\n\t.thumb_func\ndiv2:\n\tlsr\tr1, r0, #0x1f\n\tadd\tr0, r0, r1\n\tasr\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t div2,.Lfe1-div2\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 div2(s32 a0) {\n return a0 / 2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 div2(u32 arg0) {\n return (s32) (arg0 + (arg0 >> 0x1F)) >> 1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `div2` — benchmark function synthetic:div2:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdiv2\n\t.type\t div2,function\n\t.thumb_func\ndiv2:\n\tlsr\tr1, r0, #0x1f\n\tadd\tr0, r0, r1\n\tasr\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t div2,.Lfe1-div2\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function div2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `div2` — benchmark function synthetic:div2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:div2:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdiv2\n\t.type\t div2,function\n\t.thumb_func\ndiv2:\n\tlsr\tr1, r0, #0x1f\n\tadd\tr0, r0, r1\n\tasr\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t div2,.Lfe1-div2\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name div2 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:div2:gcc2.7.2kmc","sym":"div2","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int div2(int a){ return a/2; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x1f\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tsra\tv0,v0,0x1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c4a8c16d086889e1/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 div2\n\n\nContents of section .text:\n 0000 000417c2 00441021 03e00008 00021043 .....D.!.......C\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 div2(s32 a0) {\n return a0 / 2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 div2(u32 arg0) {\n return (s32) ((arg0 >> 0x1F) + arg0) >> 1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `div2` — benchmark function synthetic:div2:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel div2\n srl\t$v0, $a0, 0x1f\n addu\t$v0, $v0, $a0\n jr\t$ra\n sra\t$v0, $v0, 0x1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function div2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `div2` — benchmark function synthetic:div2:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:div2:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x1f\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tsra\tv0,v0,0x1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c4a8c16d086889e1/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 div2\n\n\nContents of section .text:\n 0000 000417c2 00441021 03e00008 00021043 .....D.!.......C\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name div2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:div2:ido7.1","sym":"div2","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int div2(int a){ return a/2; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tsra\tv0,a0,0x1\n 8:\taddiu\tat,a0,1\n c:\tsra\tv0,at,0x1\n 10:\tjr\tra\n 14:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 div2\n\n\nContents of section .text:\n 0000 04810003 00041043 24810001 00011043 .......C$......C\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 34613863 31366430 38363838 ef-c4a8c16d08688\n 0130 3965312f 7265662e 63006469 76320000 9e1/ref.c.div2..\n 0140 64697632 00000000 00000000 00000001 div2............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 div2(u32 a0) {\n s32 v0;\n if (a0 >= 0) {\n v0 = (s32)a0 >> 1;\n } else {\n v0 = (s32)(a0 + 1) >> 1;\n }\n return v0;\n}\n","score":5,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 div2(s32 arg0) {\n return arg0 / 2;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `div2` — benchmark function synthetic:div2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel div2\n bgez\t$a0, .L10\n sra\t$v0, $a0, 0x1\n addiu\t$at, $a0, 1\n sra\t$v0, $at, 0x1\n.L10:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function div2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `div2` — benchmark function synthetic:div2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:div2:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,10 \n 4:\tsra\tv0,a0,0x1\n 8:\taddiu\tat,a0,1\n c:\tsra\tv0,at,0x1\n 10:\tjr\tra\n 14:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 div2\n\n\nContents of section .text:\n 0000 04810003 00041043 24810001 00011043 .......C$......C\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 34613863 31366430 38363838 ef-c4a8c16d08688\n 0130 3965312f 7265662e 63006469 76320000 9e1/ref.c.div2..\n 0140 64697632 00000000 00000000 00000001 div2............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name div2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:div2:mwcc_242_81","sym":"div2","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","signed-div-pow2"],"loc":1,"refSource":"int div2(int a){ return a/2; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrwi r0,r3,31\n 4:\tadd r0,r0,r3\n 8:\tsrawi r3,r0,1\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 div2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 div2\n\n\nContents of section .text:\n 0000 54600ffe 7c001a14 7c030e70 4e800020 T`..|...|..pN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 div2(u32 a0) {\n return (s32)((a0 >> 31) + a0) >> 1;\n}\n","score":1,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 div2(u32 arg0) {\n return (s32) ((arg0 >> 0x1FU) + arg0) >> 1;\n}\n","score":1,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":4,"ratio":0.25,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `div2` — benchmark function synthetic:div2:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel div2\n srwi r0,r3,31\n add r0,r0,r3\n srawi r3,r0,1\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function div2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `div2` — benchmark function synthetic:div2:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:div2:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrwi r0,r3,31\n 4:\tadd r0,r0,r3\n 8:\tsrawi r3,r0,1\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 div2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 div2\n\n\nContents of section .text:\n 0000 54600ffe 7c001a14 7c030e70 4e800020 T`..|...|..pN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name div2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc:agbcc","sym":"divc","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","signed-div-const"],"loc":1,"refSource":"int divc(int a){ return a/7; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc\n\t.type\t divc,function\n\t.thumb_func\ndivc:\n\tpush\t{lr}\n\tmov\tr1, #0x7\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc,.Lfe1-divc\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc(s32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc(s32 arg0) {\n return arg0 / 7;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc` — benchmark function synthetic:divc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc\n\t.type\t divc,function\n\t.thumb_func\ndivc:\n\tpush\t{lr}\n\tmov\tr1, #0x7\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc,.Lfe1-divc\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc` — benchmark function synthetic:divc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc\n\t.type\t divc,function\n\t.thumb_func\ndivc:\n\tpush\t{lr}\n\tmov\tr1, #0x7\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc,.Lfe1-divc\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc:gcc2.7.2kmc","sym":"divc","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","signed-div-const"],"loc":1,"refSource":"int divc(int a){ return a/7; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x9249\n 4:\tori\tv0,v0,0x2493\n 8:\tmult\ta0,v0\n c:\tmfhi\tv1\n 10:\taddu\tv0,v1,a0\n 14:\tsra\tv0,v0,0x2\n 18:\tsra\ta0,a0,0x1f\n 1c:\tjr\tra\n 20:\tsubu\tv0,v0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b75f16133d0fad70/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 divc\n\n\nContents of section .text:\n 0000 3c029249 34422493 00820018 00001810 <..I4B$.........\n 0010 00641021 00021083 000427c3 03e00008 .d.!......'.....\n 0020 00441023 00000000 00000000 00000000 .D.#............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc(s32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc(s32 arg0) {\n return arg0 / 7;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc` — benchmark function synthetic:divc:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc\n lui\t$v0, 0x9249\n ori\t$v0, $v0, 0x2493\n mult\t$a0, $v0\n mfhi\t$v1\n addu\t$v0, $v1, $a0\n sra\t$v0, $v0, 0x2\n sra\t$a0, $a0, 0x1f\n jr\t$ra\n subu\t$v0, $v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc` — benchmark function synthetic:divc:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x9249\n 4:\tori\tv0,v0,0x2493\n 8:\tmult\ta0,v0\n c:\tmfhi\tv1\n 10:\taddu\tv0,v1,a0\n 14:\tsra\tv0,v0,0x2\n 18:\tsra\ta0,a0,0x1f\n 1c:\tjr\tra\n 20:\tsubu\tv0,v0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b75f16133d0fad70/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 divc\n\n\nContents of section .text:\n 0000 3c029249 34422493 00820018 00001810 <..I4B$.........\n 0010 00641021 00021083 000427c3 03e00008 .d.!......'.....\n 0020 00441023 00000000 00000000 00000000 .D.#............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc:ido7.1","sym":"divc","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","signed-div-const"],"loc":1,"refSource":"int divc(int a){ return a/7; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,7\n 4:\tdiv\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 divc\n\n\nContents of section .text:\n 0000 24010007 0081001a 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 37356631 36313333 64306661 ef-b75f16133d0fa\n 0130 6437302f 7265662e 63006469 76630000 d70/ref.c.divc..\n 0140 64697663 00000000 00000000 00000001 divc............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc(s32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc(s32 arg0) {\n return arg0 / 7;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc` — benchmark function synthetic:divc:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc\n li\t$at, 7\n div\t$zero, $a0, $at\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc` — benchmark function synthetic:divc:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,7\n 4:\tdiv\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 divc\n\n\nContents of section .text:\n 0000 24010007 0081001a 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 37356631 36313333 64306661 ef-b75f16133d0fa\n 0130 6437302f 7265662e 63006469 76630000 d70/ref.c.divc..\n 0140 64697663 00000000 00000000 00000001 divc............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc:mwcc_242_81","sym":"divc","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","signed-div-const"],"loc":1,"refSource":"int divc(int a){ return a/7; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,-28087\n 4:\taddi r0,r4,9363\n 8:\tmulhw r0,r0,r3\n c:\tadd r0,r0,r3\n 10:\tsrawi r0,r0,2\n 14:\tsrwi r3,r0,31\n 18:\tadd r3,r0,r3\n 1c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 divc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divc\n\n\nContents of section .text:\n 0000 3c809249 38042493 7c001896 7c001a14 <..I8.$.|...|...\n 0010 7c001670 54030ffe 7c601a14 4e800020 |..pT...|`..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc(s32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 divc(s32 arg0) {\n return arg0 / 7;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc` — benchmark function synthetic:divc:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc\n lis r4,-28087\n addi r0,r4,9363\n mulhw r0,r0,r3\n add r0,r0,r3\n srawi r0,r0,2\n srwi r3,r0,31\n add r3,r0,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc` — benchmark function synthetic:divc:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,-28087\n 4:\taddi r0,r4,9363\n 8:\tmulhw r0,r0,r3\n c:\tadd r0,r0,r3\n 10:\tsrawi r0,r0,2\n 14:\tsrwi r3,r0,31\n 18:\tadd r3,r0,r3\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 divc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divc\n\n\nContents of section .text:\n 0000 3c809249 38042493 7c001896 7c001a14 <..I8.$.|...|...\n 0010 7c001670 54030ffe 7c601a14 4e800020 |..pT...|`..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc10:agbcc","sym":"divc10","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc10(int a){ return a/10; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc10\n\t.type\t divc10,function\n\t.thumb_func\ndivc10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc10,.Lfe1-divc10\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc10(s32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc10(s32 arg0) {\n return arg0 / 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc10` — benchmark function synthetic:divc10:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc10\n\t.type\t divc10,function\n\t.thumb_func\ndivc10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc10,.Lfe1-divc10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc10` — benchmark function synthetic:divc10:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc10:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc10\n\t.type\t divc10,function\n\t.thumb_func\ndivc10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc10,.Lfe1-divc10\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc10 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc10:gcc2.7.2kmc","sym":"divc10","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc10(int a){ return a/10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x6666\n 4:\tori\tv0,v0,0x6667\n 8:\tmult\ta0,v0\n c:\tsra\ta0,a0,0x1f\n 10:\tmfhi\tv1\n 14:\tsra\tv0,v1,0x2\n 18:\tnop\n 1c:\tjr\tra\n 20:\tsubu\tv0,v0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-050afe56ee48148d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 divc10\n\n\nContents of section .text:\n 0000 3c026666 34426667 00820018 000427c3 <.ff4Bfg......'.\n 0010 00001810 00031083 00000000 03e00008 ................\n 0020 00441023 00000000 00000000 00000000 .D.#............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc10(s32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc10(s32 arg0) {\n return arg0 / 10;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc10` — benchmark function synthetic:divc10:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc10\n lui\t$v0, 0x6666\n ori\t$v0, $v0, 0x6667\n mult\t$a0, $v0\n sra\t$a0, $a0, 0x1f\n mfhi\t$v1\n sra\t$v0, $v1, 0x2\n nop\n jr\t$ra\n subu\t$v0, $v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc10` — benchmark function synthetic:divc10:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc10:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x6666\n 4:\tori\tv0,v0,0x6667\n 8:\tmult\ta0,v0\n c:\tsra\ta0,a0,0x1f\n 10:\tmfhi\tv1\n 14:\tsra\tv0,v1,0x2\n 18:\tnop\n 1c:\tjr\tra\n 20:\tsubu\tv0,v0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-050afe56ee48148d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 divc10\n\n\nContents of section .text:\n 0000 3c026666 34426667 00820018 000427c3 <.ff4Bfg......'.\n 0010 00001810 00031083 00000000 03e00008 ................\n 0020 00441023 00000000 00000000 00000000 .D.#............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc10:ido7.1","sym":"divc10","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc10(int a){ return a/10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdiv\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 divc10\n\n\nContents of section .text:\n 0000 2401000a 0081001a 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 35306166 65353665 65343831 ef-050afe56ee481\n 0130 3438642f 7265662e 63006469 76633130 48d/ref.c.divc10\n 0140 00000000 64697663 31300000 00000000 ....divc10......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc10(s32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc10(s32 arg0) {\n return arg0 / 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc10` — benchmark function synthetic:divc10:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc10\n li\t$at, 10\n div\t$zero, $a0, $at\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc10` — benchmark function synthetic:divc10:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc10:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdiv\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 divc10\n\n\nContents of section .text:\n 0000 2401000a 0081001a 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 35306166 65353665 65343831 ef-050afe56ee481\n 0130 3438642f 7265662e 63006469 76633130 48d/ref.c.divc10\n 0140 00000000 64697663 31300000 00000000 ....divc10......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc10:mwcc_242_81","sym":"divc10","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc10(int a){ return a/10; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,26214\n 4:\taddi r0,r4,26215\n 8:\tmulhw r0,r0,r3\n c:\tsrawi r0,r0,2\n 10:\tsrwi r3,r0,31\n 14:\tadd r3,r0,r3\n 18:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c divc10\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divc10\n\n\nContents of section .text:\n 0000 3c806666 38046667 7c001896 7c001670 <.ff8.fg|...|..p\n 0010 54030ffe 7c601a14 4e800020 T...|`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc10(s32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 divc10(s32 arg0) {\n return arg0 / 10;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc10` — benchmark function synthetic:divc10:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc10\n lis r4,26214\n addi r0,r4,26215\n mulhw r0,r0,r3\n srawi r0,r0,2\n srwi r3,r0,31\n add r3,r0,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc10` — benchmark function synthetic:divc10:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc10:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,26214\n 4:\taddi r0,r4,26215\n 8:\tmulhw r0,r0,r3\n c:\tsrawi r0,r0,2\n 10:\tsrwi r3,r0,31\n 14:\tadd r3,r0,r3\n 18:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c divc10\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divc10\n\n\nContents of section .text:\n 0000 3c806666 38046667 7c001896 7c001670 <.ff8.fg|...|..p\n 0010 54030ffe 7c601a14 4e800020 T...|`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc100:agbcc","sym":"divc100","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc100(int a){ return a/100; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc100\n\t.type\t divc100,function\n\t.thumb_func\ndivc100:\n\tpush\t{lr}\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc100,.Lfe1-divc100\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc100(s32 a0) {\n return a0 / 100;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc100(s32 arg0) {\n return arg0 / 100;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc100` — benchmark function synthetic:divc100:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc100\n\t.type\t divc100,function\n\t.thumb_func\ndivc100:\n\tpush\t{lr}\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc100,.Lfe1-divc100\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc100 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc100` — benchmark function synthetic:divc100:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc100:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivc100\n\t.type\t divc100,function\n\t.thumb_func\ndivc100:\n\tpush\t{lr}\n\tmov\tr1, #0x64\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divc100,.Lfe1-divc100\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc100 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc100:gcc2.7.2kmc","sym":"divc100","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc100(int a){ return a/100; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x51eb\n 4:\tori\tv0,v0,0x851f\n 8:\tmult\ta0,v0\n c:\tsra\ta0,a0,0x1f\n 10:\tmfhi\tv1\n 14:\tsra\tv0,v1,0x5\n 18:\tnop\n 1c:\tjr\tra\n 20:\tsubu\tv0,v0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f8af8551f41dcd5f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 divc100\n\n\nContents of section .text:\n 0000 3c0251eb 3442851f 00820018 000427c3 <.Q.4B........'.\n 0010 00001810 00031143 00000000 03e00008 .......C........\n 0020 00441023 00000000 00000000 00000000 .D.#............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc100(s32 a0) {\n return a0 / 100;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc100(s32 arg0) {\n return arg0 / 100;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc100` — benchmark function synthetic:divc100:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc100\n lui\t$v0, 0x51eb\n ori\t$v0, $v0, 0x851f\n mult\t$a0, $v0\n sra\t$a0, $a0, 0x1f\n mfhi\t$v1\n sra\t$v0, $v1, 0x5\n nop\n jr\t$ra\n subu\t$v0, $v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc100 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc100` — benchmark function synthetic:divc100:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc100:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x51eb\n 4:\tori\tv0,v0,0x851f\n 8:\tmult\ta0,v0\n c:\tsra\ta0,a0,0x1f\n 10:\tmfhi\tv1\n 14:\tsra\tv0,v1,0x5\n 18:\tnop\n 1c:\tjr\tra\n 20:\tsubu\tv0,v0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f8af8551f41dcd5f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 divc100\n\n\nContents of section .text:\n 0000 3c0251eb 3442851f 00820018 000427c3 <.Q.4B........'.\n 0010 00001810 00031143 00000000 03e00008 .......C........\n 0020 00441023 00000000 00000000 00000000 .D.#............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc100 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc100:ido7.1","sym":"divc100","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc100(int a){ return a/100; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,100\n 4:\tdiv\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 divc100\n\n\nContents of section .text:\n 0000 24010064 0081001a 00001012 03e00008 $..d............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 38616638 35353166 34316463 ef-f8af8551f41dc\n 0130 6435662f 7265662e 63006469 76633130 d5f/ref.c.divc10\n 0140 30000000 64697663 31303000 00000000 0...divc100.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc100(s32 a0) {\n return a0 / 100;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divc100(s32 arg0) {\n return arg0 / 100;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc100` — benchmark function synthetic:divc100:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc100\n li\t$at, 100\n div\t$zero, $a0, $at\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc100 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc100` — benchmark function synthetic:divc100:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc100:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,100\n 4:\tdiv\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 divc100\n\n\nContents of section .text:\n 0000 24010064 0081001a 00001012 03e00008 $..d............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 38616638 35353166 34316463 ef-f8af8551f41dc\n 0130 6435662f 7265662e 63006469 76633130 d5f/ref.c.divc10\n 0140 30000000 64697663 31303000 00000000 0...divc100.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc100 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divc100:mwcc_242_81","sym":"divc100","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","signed-div-const","magic-div"],"loc":1,"refSource":"int divc100(int a){ return a/100; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,20972\n 4:\taddi r0,r4,-31457\n 8:\tmulhw r0,r0,r3\n c:\tsrawi r0,r0,5\n 10:\tsrwi r3,r0,31\n 14:\tadd r3,r0,r3\n 18:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c divc100\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divc100\n\n\nContents of section .text:\n 0000 3c8051ec 3804851f 7c001896 7c002e70 <.Q.8...|...|..p\n 0010 54030ffe 7c601a14 4e800020 T...|`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divc100(s32 a0) {\n return a0 / 100;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 divc100(s32 arg0) {\n return arg0 / 100;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divc100` — benchmark function synthetic:divc100:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divc100\n lis r4,20972\n addi r0,r4,-31457\n mulhw r0,r0,r3\n srawi r0,r0,5\n srwi r3,r0,31\n add r3,r0,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divc100 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divc100` — benchmark function synthetic:divc100:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divc100:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,20972\n 4:\taddi r0,r4,-31457\n 8:\tmulhw r0,r0,r3\n c:\tsrawi r0,r0,5\n 10:\tsrwi r3,r0,31\n 14:\tadd r3,r0,r3\n 18:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c divc100\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divc100\n\n\nContents of section .text:\n 0000 3c8051ec 3804851f 7c001896 7c002e70 <.Q.8...|...|..p\n 0010 54030ffe 7c601a14 4e800020 T...|`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divc100 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divv:agbcc","sym":"divv","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","div-reg","signed"],"loc":1,"refSource":"int divv(int a,int b){ return a/b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivv\n\t.type\t divv,function\n\t.thumb_func\ndivv:\n\tpush\t{lr}\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divv,.Lfe1-divv\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divv(s32 a0, s32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divv(s32 arg0, s32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divv` — benchmark function synthetic:divv:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivv\n\t.type\t divv,function\n\t.thumb_func\ndivv:\n\tpush\t{lr}\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divv,.Lfe1-divv\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divv` — benchmark function synthetic:divv:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divv:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdivv\n\t.type\t divv,function\n\t.thumb_func\ndivv:\n\tpush\t{lr}\n\tbl\t__divsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t divv,.Lfe1-divv\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divv # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divv:gcc2.7.2kmc","sym":"divv","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","div-reg","signed"],"loc":1,"refSource":"int divv(int a,int b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tbnez\ta1,10 \n 8:\tnop\n c:\tbreak\t0x7\n 10:\tli\tat,-1\n 14:\tbne\ta1,at,28 \n 18:\tlui\tat,0x8000\n 1c:\tbne\ta0,at,28 \n 20:\tnop\n 24:\tbreak\t0x6\n 28:\tmflo\tv0\n 2c:\tjr\tra\n 30:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-624a65548825e4af/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 divv\n\n\nContents of section .text:\n 0000 0085001a 14a00002 00000000 0007000d ................\n 0010 2401ffff 14a10004 3c018000 14810002 $.......<.......\n 0020 00000000 0006000d 00001012 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divv(s32 a0, s32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divv(s32 arg0, s32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divv` — benchmark function synthetic:divv:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divv\n div\t$zero, $a0, $a1\n bnez\t$a1, .L10\n nop\n break\t0x7\n.L10:\n li\t$at, -1\n bne\t$a1, $at, .L28\n lui\t$at, 0x8000\n bne\t$a0, $at, .L28\n nop\n break\t0x6\n.L28:\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divv` — benchmark function synthetic:divv:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divv:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tbnez\ta1,10 \n 8:\tnop\n c:\tbreak\t0x7\n 10:\tli\tat,-1\n 14:\tbne\ta1,at,28 \n 18:\tlui\tat,0x8000\n 1c:\tbne\ta0,at,28 \n 20:\tnop\n 24:\tbreak\t0x6\n 28:\tmflo\tv0\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-624a65548825e4af/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 divv\n\n\nContents of section .text:\n 0000 0085001a 14a00002 00000000 0007000d ................\n 0010 2401ffff 14a10004 3c018000 14810002 $.......<.......\n 0020 00000000 0006000d 00001012 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name divv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divv:ido7.1","sym":"divv","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","div-reg","signed"],"loc":1,"refSource":"int divv(int a,int b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tmflo\tv0\n 8:\tbnez\ta1,14 \n c:\tnop\n 10:\tbreak\t0x7\n 14:\tli\tat,-1\n 18:\tbne\ta1,at,2c \n 1c:\tlui\tat,0x8000\n 20:\tbne\ta0,at,2c \n 24:\tnop\n 28:\tbreak\t0x6\n 2c:\tjr\tra\n 30:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 divv\n\n\nContents of section .text:\n 0000 0085001a 00001012 14a00002 00000000 ................\n 0010 0007000d 2401ffff 14a10004 3c018000 ....$.......<...\n 0020 14810002 00000000 0006000d 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001a8 p...............\n 0010 00000005 000002e8 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000034 00000254 ...........4...T\n 0040 00000008 00000288 00000001 00000290 ................\n 0050 00000000 00000000 00000001 000002d8 ................\n 0060 08030000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000034 20200001 00000001 .......4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 32346136 35353438 38323565 ef-624a65548825e\n 0130 3461662f 7265662e 63006469 76760000 4af/ref.c.divv..\n 0140 64697676 00000000 00000000 00000001 divv............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000d 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divv(s32 a0, s32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divv(s32 arg0, s32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divv` — benchmark function synthetic:divv:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divv\n div\t$zero, $a0, $a1\n mflo\t$v0\n bnez\t$a1, .L14\n nop\n break\t0x7\n.L14:\n li\t$at, -1\n bne\t$a1, $at, .L2c\n lui\t$at, 0x8000\n bne\t$a0, $at, .L2c\n nop\n break\t0x6\n.L2c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divv` — benchmark function synthetic:divv:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divv:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tmflo\tv0\n 8:\tbnez\ta1,14 \n c:\tnop\n 10:\tbreak\t0x7\n 14:\tli\tat,-1\n 18:\tbne\ta1,at,2c \n 1c:\tlui\tat,0x8000\n 20:\tbne\ta0,at,2c \n 24:\tnop\n 28:\tbreak\t0x6\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 divv\n\n\nContents of section .text:\n 0000 0085001a 00001012 14a00002 00000000 ................\n 0010 0007000d 2401ffff 14a10004 3c018000 ....$.......<...\n 0020 14810002 00000000 0006000d 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001a8 p...............\n 0010 00000005 000002e8 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000034 00000254 ...........4...T\n 0040 00000008 00000288 00000001 00000290 ................\n 0050 00000000 00000000 00000001 000002d8 ................\n 0060 08030000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000034 20200001 00000001 .......4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 32346136 35353438 38323565 ef-624a65548825e\n 0130 3461662f 7265662e 63006469 76760000 4af/ref.c.divv..\n 0140 64697676 00000000 00000000 00000001 divv............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000d 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:divv:mwcc_242_81","sym":"divv","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","div-reg","signed"],"loc":1,"refSource":"int divv(int a,int b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivw r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 divv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divv\n\n\nContents of section .text:\n 0000 7c6323d6 4e800020 |c#.N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 divv(s32 a0, s32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 divv(s32 arg0, s32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `divv` — benchmark function synthetic:divv:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel divv\n divw r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function divv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `divv` — benchmark function synthetic:divv:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:divv:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivw r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 divv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 divv\n\n\nContents of section .text:\n 0000 7c6323d6 4e800020 |c#.N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name divv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dotprod:agbcc","sym":"dotprod","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","memory","arithmetic"],"loc":1,"refSource":"int dotprod(int *a,int *b,int n){ int s=0,i; for(i=0;i= a2) {\n v2 = 0;\n } else {\n v0 = a0;\n v1 = a1;\n v2 = 0;\n v3 = a2;\n do {\n v2 = v2 + *v0 * *v1;\n v0 = v0 + 1;\n v1 = v1 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n }\n return v2;\n}\n","score":9,"maxScore":20,"compileErrors":null,"breakdown":{"insert":3,"delete":1,"replace":0,"opMismatch":1,"argMismatch":4},"quality":{"score":100,"lines":21,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 dotprod(s32 *arg0, s32 *arg1, s32 arg2) {\n s32 *var_r4;\n s32 *var_r5;\n s32 temp_r0;\n s32 temp_r1;\n s32 var_r2;\n s32 var_r3;\n\n var_r2 = arg2;\n var_r3 = 0;\n if (var_r2 > 0) {\n var_r5 = arg1;\n var_r4 = arg0;\n do {\n temp_r0 = *var_r4;\n var_r4 += 4;\n temp_r1 = *var_r5;\n var_r5 += 4;\n var_r3 += temp_r0 * temp_r1;\n var_r2 -= 1;\n } while (var_r2 != 0);\n }\n return var_r3;\n}\n","score":11,"maxScore":19,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":2,"opMismatch":1,"argMismatch":6},"quality":{"score":100,"lines":23,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":9,"maxScore":20,"ratio":0.45,"kinds":{"insert":3,"delete":1,"replace":0,"opMismatch":1,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dotprod` — benchmark function synthetic:dotprod:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdotprod\n\t.type\t dotprod,function\n\t.thumb_func\ndotprod:\n\tpush\t{r4, r5, lr}\n\tmov\tr3, #0x0\n\tcmp\tr3, r2\n\tbge\t.L4\t@cond_branch\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n.L6:\n\tldmia\tr4!, {r0}\n\tldmia\tr5!, {r1}\n\tmul\tr0, r0, r1\n\tadd\tr3, r3, r0\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t dotprod,.Lfe1-dotprod\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint dotprod(int*,int*,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dotprod # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dotprod` — benchmark function synthetic:dotprod:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dotprod:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdotprod\n\t.type\t dotprod,function\n\t.thumb_func\ndotprod:\n\tpush\t{r4, r5, lr}\n\tmov\tr3, #0x0\n\tcmp\tr3, r2\n\tbge\t.L4\t@cond_branch\n\tadd\tr5, r1, #0\n\tadd\tr4, r0, #0\n.L6:\n\tldmia\tr4!, {r0}\n\tldmia\tr5!, {r1}\n\tmul\tr0, r0, r1\n\tadd\tr3, r3, r0\n\tsub\tr2, r2, #0x1\n\tcmp\tr2, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t dotprod,.Lfe1-dotprod\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name dotprod # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dotprod:gcc2.7.2kmc","sym":"dotprod","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","memory","arithmetic"],"loc":1,"refSource":"int dotprod(int *a,int *b,int n){ int s=0,i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\tt0,zero\n 8:\tblez\ta2,38 \n c:\tmove\ta3,zero\n 10:\tlw\tv1,0(a0)\n 14:\tlw\tv0,0(a1)\n 18:\tmult\tv1,v0\n 1c:\tmflo\tv1\n 20:\taddiu\ta1,a1,4\n 24:\taddiu\ta0,a0,4\n 28:\taddiu\tt0,t0,1\n 2c:\tslt\tv0,t0,a2\n 30:\tbnez\tv0,10 \n 34:\taddu\ta3,a3,v1\n 38:\tmove\tv0,a3\n 3c:\tjr\tra\n 40:\taddiu\tsp,sp,8\n\t...\n","ctx":"int dotprod(int*,int*,int);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-bb273c3cb661c234/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000044 dotprod\n\n\nContents of section .text:\n 0000 27bdfff8 00004021 18c0000b 00003821 '.....@!......8!\n 0010 8c830000 8ca20000 00620018 00001812 .........b......\n 0020 24a50004 24840004 25080001 0106102a $...$...%......*\n 0030 1440fff7 00e33821 00e01021 03e00008 .@....8!...!....\n 0040 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 dotprod(s32 * a0, s32 * a1, s32 a2) {\n s32 * v0;\n s32 * v1;\n s32 v2;\n s32 v3;\n v0 = a0;\n v1 = a1;\n v2 = 0;\n v3 = 0;\n while (v2 < a2) {\n v2 = v2 + 1;\n v3 = v3 + *v0 * *v1;\n v1 = v1 + 1;\n v0 = v0 + 1;\n }\n return v3;\n}\n","score":8,"maxScore":17,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":8},"quality":{"score":100,"lines":17,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 dotprod(s32 *arg0, s32 *arg1, s32 arg2) {\n s32 *var_a0;\n s32 *var_a1;\n s32 temp_v1;\n s32 var_a3;\n s32 var_t0;\n\n var_a0 = arg0;\n var_a1 = arg1;\n var_t0 = 0;\n var_a3 = 0;\n if (arg2 > 0) {\n do {\n temp_v1 = *var_a0 * *var_a1;\n var_a1 += 4;\n var_a0 += 4;\n var_t0 += 1;\n var_a3 += temp_v1;\n } while (var_t0 < arg2);\n }\n return var_a3;\n}\n","score":10,"maxScore":17,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":7},"quality":{"score":100,"lines":21,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":8,"maxScore":17,"ratio":0.47058823529411764,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":8}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dotprod` — benchmark function synthetic:dotprod:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dotprod\n addiu\t$sp, $sp, -8\n move\t$t0, $zero\n blez\t$a2, .L38\n move\t$a3, $zero\n.L10:\n lw\t$v1, 0($a0)\n lw\t$v0, 0($a1)\n mult\t$v1, $v0\n mflo\t$v1\n addiu\t$a1, $a1, 4\n addiu\t$a0, $a0, 4\n addiu\t$t0, $t0, 1\n slt\t$v0, $t0, $a2\n bnez\t$v0, .L10\n addu\t$a3, $a3, $v1\n.L38:\n move\t$v0, $a3\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint dotprod(int*,int*,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dotprod # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dotprod` — benchmark function synthetic:dotprod:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dotprod:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\tt0,zero\n 8:\tblez\ta2,38 \n c:\tmove\ta3,zero\n 10:\tlw\tv1,0(a0)\n 14:\tlw\tv0,0(a1)\n 18:\tmult\tv1,v0\n 1c:\tmflo\tv1\n 20:\taddiu\ta1,a1,4\n 24:\taddiu\ta0,a0,4\n 28:\taddiu\tt0,t0,1\n 2c:\tslt\tv0,t0,a2\n 30:\tbnez\tv0,10 \n 34:\taddu\ta3,a3,v1\n 38:\tmove\tv0,a3\n 3c:\tjr\tra\n 40:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-bb273c3cb661c234/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000044 dotprod\n\n\nContents of section .text:\n 0000 27bdfff8 00004021 18c0000b 00003821 '.....@!......8!\n 0010 8c830000 8ca20000 00620018 00001812 .........b......\n 0020 24a50004 24840004 25080001 0106102a $...$...%......*\n 0030 1440fff7 00e33821 00e01021 03e00008 .@....8!...!....\n 0040 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name dotprod # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dotprod:ido7.1","sym":"dotprod","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","memory","arithmetic"],"loc":1,"refSource":"int dotprod(int *a,int *b,int n){ int s=0,i; for(i=0;i:\n 0:\tsw\ta1,4(sp)\n 4:\tmove\tv1,zero\n 8:\tblez\ta2,dc \n c:\tmove\tv0,zero\n 10:\tandi\tt2,a2,0x3\n 14:\tbeqz\tt2,5c \n 18:\tmove\tt1,t2\n 1c:\tlw\tt6,4(sp)\n 20:\tsll\ta1,zero,0x2\n 24:\taddu\ta3,a0,a1\n 28:\taddu\tt0,t6,a1\n 2c:\tlw\tt7,0(a3)\n 30:\tlw\tt8,0(t0)\n 34:\taddiu\tv0,v0,1\n 38:\taddiu\ta3,a3,4\n 3c:\tmultu\tt7,t8\n 40:\taddiu\tt0,t0,4\n 44:\tmflo\tt9\n 48:\taddu\tv1,v1,t9\n 4c:\tbnel\tt1,v0,30 \n 50:\tlw\tt7,0(a3)\n 54:\tbeq\tv0,a2,dc \n 58:\tnop\n 5c:\tlw\tt3,4(sp)\n 60:\tsll\ta1,v0,0x2\n 64:\tsll\tt4,a2,0x2\n 68:\taddu\ta3,a0,a1\n 6c:\taddu\tt1,t4,t3\n 70:\taddu\tt0,t3,a1\n 74:\tlw\tt5,0(a3)\n 78:\tlw\tt6,0(t0)\n 7c:\tlw\tt8,4(a3)\n 80:\tlw\tt9,4(t0)\n 84:\tmultu\tt5,t6\n 88:\tlw\tt5,8(t0)\n 8c:\tlw\tt3,8(a3)\n 90:\taddiu\tt0,t0,16\n 94:\taddiu\ta3,a3,16\n 98:\tmflo\tt7\n 9c:\taddu\tv1,v1,t7\n a0:\tlw\tt7,-4(a3)\n a4:\tmultu\tt8,t9\n a8:\tlw\tt8,-4(t0)\n ac:\tmflo\tt4\n b0:\taddu\tv1,v1,t4\n b4:\tnop\n b8:\tmultu\tt3,t5\n bc:\tmflo\tt6\n c0:\taddu\tv1,v1,t6\n c4:\tnop\n c8:\tmultu\tt7,t8\n cc:\tmflo\tt9\n d0:\taddu\tv1,v1,t9\n d4:\tbnel\tt0,t1,78 \n d8:\tlw\tt5,0(a3)\n dc:\tjr\tra\n e0:\tmove\tv0,v1\n\t...\n","ctx":"int dotprod(int*,int*,int);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000f0 .text\n00000000 g F .text\t000000e4 dotprod\n\n\nContents of section .text:\n 0000 afa50004 00001825 18c00034 00001025 .......%...4...%\n 0010 30ca0003 11400011 01404825 8fae0004 0....@...@H%....\n 0020 00002880 00853821 01c54021 8cef0000 ..(...8!..@!....\n 0030 8d180000 24420001 24e70004 01f80019 ....$B..$.......\n 0040 25080004 0000c812 00791821 5522fff8 %........y.!U\"..\n 0050 8cef0000 10460021 00000000 8fab0004 .....F.!........\n 0060 00022880 00066080 00853821 018b4821 ..(...`...8!..H!\n 0070 01654021 8ced0000 8d0e0000 8cf80004 .e@!............\n 0080 8d190004 01ae0019 8d0d0008 8ceb0008 ................\n 0090 25080010 24e70010 00007812 006f1821 %...$.....x..o.!\n 00a0 8ceffffc 03190019 8d18fffc 00006012 ..............`.\n 00b0 006c1821 00000000 016d0019 00007012 .l.!.....m....p.\n 00c0 006e1821 00000000 01f80019 0000c812 .n.!............\n 00d0 00791821 5509ffe8 8ced0000 03e00008 .y.!U...........\n 00e0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 a300fffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300fffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000039 00000008 00000258 p......9.......X\n 0010 00000005 000003a0 00000001 00000260 ...............`\n 0020 00000004 00000294 00000000 00000000 ................\n 0030 00000011 000002c4 00000038 00000308 ...........8....\n 0040 00000008 00000340 00000001 00000348 .......@.......H\n 0050 00000000 00000000 00000001 00000390 ................\n 0060 08080808 08080200 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000e4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d62 62323733 63336362 ps-ref-bb273c3cb\n 0130 36363163 3233342f 7265662e 6300646f 661c234/ref.c.do\n 0140 7470726f 64000000 646f7470 726f6400 tprod...dotprod.\n 0150 00000000 00000001 00000000 00000036 ...............6\n 0160 00000000 00000004 00000000 00000039 ...............9\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000007 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'dotprod' — lift: cannot lift 'dotprod': unmodelled control transfer 'bnel' at 0x4c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta1,4(sp) */\n/* 4:\tmove\tv1,zero */\n/* 8:\tblez\ta2,dc */\n/* c:\tmove\tv0,zero */\n/* 10:\tandi\tt2,a2,0x3 */\n/* 14:\tbeqz\tt2,5c */\n/* 18:\tmove\tt1,t2 */\n/* 1c:\tlw\tt6,4(sp) */\n/* 20:\tsll\ta1,zero,0x2 */\n/* 24:\taddu\ta3,a0,a1 */\n/* 28:\taddu\tt0,t6,a1 */\n/* 2c:\tlw\tt7,0(a3) */\n/* 30:\tlw\tt8,0(t0) */\n/* 34:\taddiu\tv0,v0,1 */\n/* 38:\taddiu\ta3,a3,4 */\n/* 3c:\tmultu\tt7,t8 */\n/* 40:\taddiu\tt0,t0,4 */\n/* 44:\tmflo\tt9 */\n/* 48:\taddu\tv1,v1,t9 */\n/* 4c:\tbnel\tt1,v0,30 */\n/* 50:\tlw\tt7,0(a3) */\n/* 54:\tbeq\tv0,a2,dc */\n/* 58:\tnop */\n/* 5c:\tlw\tt3,4(sp) */\n/* 60:\tsll\ta1,v0,0x2 */\n/* 64:\tsll\tt4,a2,0x2 */\n/* 68:\taddu\ta3,a0,a1 */\n/* 6c:\taddu\tt1,t4,t3 */\n/* 70:\taddu\tt0,t3,a1 */\n/* 74:\tlw\tt5,0(a3) */\n/* 78:\tlw\tt6,0(t0) */\n/* 7c:\tlw\tt8,4(a3) */\n/* 80:\tlw\tt9,4(t0) */\n/* 84:\tmultu\tt5,t6 */\n/* 88:\tlw\tt5,8(t0) */\n/* 8c:\tlw\tt3,8(a3) */\n/* 90:\taddiu\tt0,t0,16 */\n/* 94:\taddiu\ta3,a3,16 */\n/* 98:\tmflo\tt7 */\n/* 9c:\taddu\tv1,v1,t7 */\n/* a0:\tlw\tt7,-4(a3) */\n/* a4:\tmultu\tt8,t9 */\n/* a8:\tlw\tt8,-4(t0) */\n/* ac:\tmflo\tt4 */\n/* b0:\taddu\tv1,v1,t4 */\n/* b4:\tnop */\n/* b8:\tmultu\tt3,t5 */\n/* bc:\tmflo\tt6 */\n/* c0:\taddu\tv1,v1,t6 */\n/* c4:\tnop */\n/* c8:\tmultu\tt7,t8 */\n/* cc:\tmflo\tt9 */\n/* d0:\taddu\tv1,v1,t9 */\n/* d4:\tbnel\tt0,t1,78 */\n/* d8:\tlw\tt5,0(a3) */\n/* dc:\tjr\tra */\n/* e0:\tmove\tv0,v1 */\n/* \t... */\nvoid dotprod(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'dotprod': unmodelled control transfer 'bnel' at 0x4c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":66,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'dotprod': unmodelled control transfer 'bnel' at 0x4c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 dotprod(s32 *arg0, s32 *arg1, s32 arg2) {\n s32 *var_a3;\n s32 *var_a3_2;\n s32 *var_t0;\n s32 *var_t0_2;\n s32 temp_lo;\n s32 temp_lo_2;\n s32 temp_t2;\n s32 temp_t3;\n s32 temp_t5;\n s32 temp_t7;\n s32 temp_t8;\n s32 temp_t9;\n s32 var_v0;\n s32 var_v1;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg2 > 0) {\n temp_t2 = arg2 & 3;\n if (temp_t2 != 0) {\n var_a3 = &arg0[0];\n var_t0 = &arg1[0];\n do {\n temp_t7 = *var_a3;\n var_v0 += 1;\n var_a3 += 4;\n temp_lo = temp_t7 * *var_t0;\n var_t0 += 4;\n var_v1 += temp_lo;\n } while (temp_t2 != var_v0);\n if (var_v0 != arg2) {\n goto block_5;\n }\n } else {\nblock_5:\n var_a3_2 = &arg0[var_v0];\n var_t0_2 = &arg1[var_v0];\n do {\n temp_t8 = var_a3_2->unk4;\n temp_t9 = var_t0_2->unk4;\n temp_lo_2 = var_a3_2->unk0 * var_t0_2->unk0;\n temp_t5 = var_t0_2->unk8;\n temp_t3 = var_a3_2->unk8;\n var_t0_2 += 0x10;\n var_a3_2 += 0x10;\n var_v1 = var_v1 + temp_lo_2 + (temp_t8 * temp_t9) + (temp_t3 * temp_t5) + (var_a3_2->unk-4 * var_t0_2->unk-4);\n } while (var_t0_2 != &arg1[arg2]);\n }\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":6,"quality":{"score":88,"lines":51,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 41: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 42: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 43: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 44: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 45: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dotprod` — benchmark function synthetic:dotprod:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dotprod\n sw\t$a1, 4($sp)\n move\t$v1, $zero\n blez\t$a2, .Ldc\n move\t$v0, $zero\n andi\t$t2, $a2, 0x3\n beqz\t$t2, .L5c\n move\t$t1, $t2\n lw\t$t6, 4($sp)\n sll\t$a1, $zero, 0x2\n addu\t$a3, $a0, $a1\n addu\t$t0, $t6, $a1\n lw\t$t7, 0($a3)\n.L30:\n lw\t$t8, 0($t0)\n addiu\t$v0, $v0, 1\n addiu\t$a3, $a3, 4\n multu\t$t7, $t8\n addiu\t$t0, $t0, 4\n mflo\t$t9\n addu\t$v1, $v1, $t9\n bnel\t$t1, $v0, .L30\n lw\t$t7, 0($a3)\n beq\t$v0, $a2, .Ldc\n nop\n.L5c:\n lw\t$t3, 4($sp)\n sll\t$a1, $v0, 0x2\n sll\t$t4, $a2, 0x2\n addu\t$a3, $a0, $a1\n addu\t$t1, $t4, $t3\n addu\t$t0, $t3, $a1\n lw\t$t5, 0($a3)\n.L78:\n lw\t$t6, 0($t0)\n lw\t$t8, 4($a3)\n lw\t$t9, 4($t0)\n multu\t$t5, $t6\n lw\t$t5, 8($t0)\n lw\t$t3, 8($a3)\n addiu\t$t0, $t0, 16\n addiu\t$a3, $a3, 16\n mflo\t$t7\n addu\t$v1, $v1, $t7\n lw\t$t7, -4($a3)\n multu\t$t8, $t9\n lw\t$t8, -4($t0)\n mflo\t$t4\n addu\t$v1, $v1, $t4\n nop\n multu\t$t3, $t5\n mflo\t$t6\n addu\t$v1, $v1, $t6\n nop\n multu\t$t7, $t8\n mflo\t$t9\n addu\t$v1, $v1, $t9\n bnel\t$t0, $t1, .L78\n lw\t$t5, 0($a3)\n.Ldc:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint dotprod(int*,int*,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dotprod # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dotprod` — benchmark function synthetic:dotprod:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dotprod:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,4(sp)\n 4:\tmove\tv1,zero\n 8:\tblez\ta2,dc \n c:\tmove\tv0,zero\n 10:\tandi\tt2,a2,0x3\n 14:\tbeqz\tt2,5c \n 18:\tmove\tt1,t2\n 1c:\tlw\tt6,4(sp)\n 20:\tsll\ta1,zero,0x2\n 24:\taddu\ta3,a0,a1\n 28:\taddu\tt0,t6,a1\n 2c:\tlw\tt7,0(a3)\n 30:\tlw\tt8,0(t0)\n 34:\taddiu\tv0,v0,1\n 38:\taddiu\ta3,a3,4\n 3c:\tmultu\tt7,t8\n 40:\taddiu\tt0,t0,4\n 44:\tmflo\tt9\n 48:\taddu\tv1,v1,t9\n 4c:\tbnel\tt1,v0,30 \n 50:\tlw\tt7,0(a3)\n 54:\tbeq\tv0,a2,dc \n 58:\tnop\n 5c:\tlw\tt3,4(sp)\n 60:\tsll\ta1,v0,0x2\n 64:\tsll\tt4,a2,0x2\n 68:\taddu\ta3,a0,a1\n 6c:\taddu\tt1,t4,t3\n 70:\taddu\tt0,t3,a1\n 74:\tlw\tt5,0(a3)\n 78:\tlw\tt6,0(t0)\n 7c:\tlw\tt8,4(a3)\n 80:\tlw\tt9,4(t0)\n 84:\tmultu\tt5,t6\n 88:\tlw\tt5,8(t0)\n 8c:\tlw\tt3,8(a3)\n 90:\taddiu\tt0,t0,16\n 94:\taddiu\ta3,a3,16\n 98:\tmflo\tt7\n 9c:\taddu\tv1,v1,t7\n a0:\tlw\tt7,-4(a3)\n a4:\tmultu\tt8,t9\n a8:\tlw\tt8,-4(t0)\n ac:\tmflo\tt4\n b0:\taddu\tv1,v1,t4\n b4:\tnop\n b8:\tmultu\tt3,t5\n bc:\tmflo\tt6\n c0:\taddu\tv1,v1,t6\n c4:\tnop\n c8:\tmultu\tt7,t8\n cc:\tmflo\tt9\n d0:\taddu\tv1,v1,t9\n d4:\tbnel\tt0,t1,78 \n d8:\tlw\tt5,0(a3)\n dc:\tjr\tra\n e0:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000f0 .text\n00000000 g F .text\t000000e4 dotprod\n\n\nContents of section .text:\n 0000 afa50004 00001825 18c00034 00001025 .......%...4...%\n 0010 30ca0003 11400011 01404825 8fae0004 0....@...@H%....\n 0020 00002880 00853821 01c54021 8cef0000 ..(...8!..@!....\n 0030 8d180000 24420001 24e70004 01f80019 ....$B..$.......\n 0040 25080004 0000c812 00791821 5522fff8 %........y.!U\"..\n 0050 8cef0000 10460021 00000000 8fab0004 .....F.!........\n 0060 00022880 00066080 00853821 018b4821 ..(...`...8!..H!\n 0070 01654021 8ced0000 8d0e0000 8cf80004 .e@!............\n 0080 8d190004 01ae0019 8d0d0008 8ceb0008 ................\n 0090 25080010 24e70010 00007812 006f1821 %...$.....x..o.!\n 00a0 8ceffffc 03190019 8d18fffc 00006012 ..............`.\n 00b0 006c1821 00000000 016d0019 00007012 .l.!.....m....p.\n 00c0 006e1821 00000000 01f80019 0000c812 .n.!............\n 00d0 00791821 5509ffe8 8ced0000 03e00008 .y.!U...........\n 00e0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 a300fffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a300fffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000039 00000008 00000258 p......9.......X\n 0010 00000005 000003a0 00000001 00000260 ...............`\n 0020 00000004 00000294 00000000 00000000 ................\n 0030 00000011 000002c4 00000038 00000308 ...........8....\n 0040 00000008 00000340 00000001 00000348 .......@.......H\n 0050 00000000 00000000 00000001 00000390 ................\n 0060 08080808 08080200 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000e4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d62 62323733 63336362 ps-ref-bb273c3cb\n 0130 36363163 3233342f 7265662e 6300646f 661c234/ref.c.do\n 0140 7470726f 64000000 646f7470 726f6400 tprod...dotprod.\n 0150 00000000 00000001 00000000 00000036 ...............6\n 0160 00000000 00000004 00000000 00000039 ...............9\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000007 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name dotprod # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dotprod:mwcc_242_81","sym":"dotprod","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","memory","arithmetic"],"loc":1,"refSource":"int dotprod(int *a,int *b,int n){ int s=0,i; for(i=0;i:\n 0:\tstwu r1,-48(r1)\n 4:\tmflr r0\n 8:\tstw r0,52(r1)\n c:\taddi r11,r1,48\n 10:\tbl 10 \n\t\t\t10: R_PPC_REL24\t_savegpr_25\n 14:\tcmpwi r5,0\n 18:\tli r0,0\n 1c:\tli r8,0\n 20:\tble 114 \n 24:\tcmpwi r5,8\n 28:\taddi r10,r5,-8\n 2c:\tble dc \n 30:\taddi r9,r10,7\n 34:\tmr r6,r4\n 38:\tsrwi r9,r9,3\n 3c:\tmr r7,r3\n 40:\tmtctr r9\n 44:\tcmpwi r10,0\n 48:\tble dc \n 4c:\tlwz r10,0(r7)\n 50:\taddi r8,r8,8\n 54:\tlwz r9,0(r6)\n 58:\tlwz r12,4(r7)\n 5c:\tmullw r25,r10,r9\n 60:\tlwz r11,4(r6)\n 64:\tlwz r10,8(r7)\n 68:\tlwz r9,8(r6)\n 6c:\tlwz r26,12(r7)\n 70:\tlwz r27,12(r6)\n 74:\tmullw r11,r12,r11\n 78:\tadd r0,r0,r25\n 7c:\tlwz r28,16(r7)\n 80:\tlwz r29,16(r6)\n 84:\tlwz r30,20(r7)\n 88:\tlwz r31,20(r6)\n 8c:\tmullw r25,r10,r9\n 90:\tadd r0,r0,r11\n 94:\tlwz r12,24(r7)\n 98:\tlwz r11,24(r6)\n 9c:\tlwz r10,28(r7)\n a0:\taddi r7,r7,32\n a4:\tlwz r9,28(r6)\n a8:\tmullw r27,r26,r27\n ac:\tadd r0,r0,r25\n b0:\taddi r6,r6,32\n b4:\tmullw r29,r28,r29\n b8:\tadd r0,r0,r27\n bc:\tmullw r31,r30,r31\n c0:\tadd r0,r0,r29\n c4:\tmullw r11,r12,r11\n c8:\tadd r0,r0,r31\n cc:\tmullw r9,r10,r9\n d0:\tadd r0,r0,r11\n d4:\tadd r0,r0,r9\n d8:\tbdnz 4c \n dc:\tslwi r9,r8,2\n e0:\tsubf r6,r8,r5\n e4:\tadd r7,r4,r9\n e8:\tadd r9,r3,r9\n ec:\tmtctr r6\n f0:\tcmpw r8,r5\n f4:\tbge 114 \n f8:\tlwz r4,0(r9)\n fc:\taddi r9,r9,4\n 100:\tlwz r3,0(r7)\n 104:\taddi r7,r7,4\n 108:\tmullw r3,r4,r3\n 10c:\tadd r0,r0,r3\n 110:\tbdnz f8 \n 114:\tmr r3,r0\n 118:\taddi r11,r1,48\n 11c:\tbl 11c \n\t\t\t11c: R_PPC_REL24\t_restgpr_25\n 120:\tlwz r0,52(r1)\n 124:\tmtlr r0\n 128:\taddi r1,r1,48\n 12c:\tblr\n","ctx":"int dotprod(int*,int*,int);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 _savegpr_25\n00000000 *UND*\t00000000 _restgpr_25\n00000000 g F .text\t00000130 dotprod\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_PPC_REL24 _savegpr_25\n0000011c R_PPC_REL24 _restgpr_25\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 dotprod\n\n\nContents of section .text:\n 0000 9421ffd0 7c0802a6 90010034 39610030 .!..|......49a.0\n 0010 48000001 2c050000 38000000 39000000 H...,...8...9...\n 0020 408100f4 2c050008 3945fff8 408100b0 @...,...9E..@...\n 0030 392a0007 7c862378 5529e8fe 7c671b78 9*..|.#xU)..|g.x\n 0040 7d2903a6 2c0a0000 40810094 81470000 })..,...@....G..\n 0050 39080008 81260000 81870004 7f2a49d6 9....&.......*I.\n 0060 81660004 81470008 81260008 8347000c .f...G...&...G..\n 0070 8366000c 7d6c59d6 7c00ca14 83870010 .f..}lY.|.......\n 0080 83a60010 83c70014 83e60014 7f2a49d6 .............*I.\n 0090 7c005a14 81870018 81660018 8147001c |.Z......f...G..\n 00a0 38e70020 8126001c 7f7ad9d6 7c00ca14 8.. .&...z..|...\n 00b0 38c60020 7fbce9d6 7c00da14 7ffef9d6 8.. ....|.......\n 00c0 7c00ea14 7d6c59d6 7c00fa14 7d2a49d6 |...}lY.|...}*I.\n 00d0 7c005a14 7c004a14 4200ff74 5509103a |.Z.|.J.B..tU..:\n 00e0 7cc82850 7ce44a14 7d234a14 7cc903a6 |.(P|.J.}#J.|...\n 00f0 7c082800 40800020 80890000 39290004 |.(.@.. ....9)..\n 0100 80670000 38e70004 7c6419d6 7c001a14 .g..8...|d..|...\n 0110 4200ffe8 7c030378 39610030 48000001 B...|..x9a.0H...\n 0120 80010034 7c0803a6 38210030 4e800020 ...4|...8!.0N.. \nContents of section .mwcats.text:\n 0000 02000130 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000000 00000000 00000004 ................\n 0060 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'dotprod' — lift: cannot lift 'dotprod': stack pointer r1 used as data (address-taken local / frame arithmetic) — not supported */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tstwu r1,-48(r1) */\n/* 4:\tmflr r0 */\n/* 8:\tstw r0,52(r1) */\n/* c:\taddi r11,r1,48 */\n/* 10:\tbl 10 */\n/* \t\t\t10: R_PPC_REL24\t_savegpr_25 */\n/* 14:\tcmpwi r5,0 */\n/* 18:\tli r0,0 */\n/* 1c:\tli r8,0 */\n/* 20:\tble 114 */\n/* 24:\tcmpwi r5,8 */\n/* 28:\taddi r10,r5,-8 */\n/* 2c:\tble dc */\n/* 30:\taddi r9,r10,7 */\n/* 34:\tmr r6,r4 */\n/* 38:\tsrwi r9,r9,3 */\n/* 3c:\tmr r7,r3 */\n/* 40:\tmtctr r9 */\n/* 44:\tcmpwi r10,0 */\n/* 48:\tble dc */\n/* 4c:\tlwz r10,0(r7) */\n/* 50:\taddi r8,r8,8 */\n/* 54:\tlwz r9,0(r6) */\n/* 58:\tlwz r12,4(r7) */\n/* 5c:\tmullw r25,r10,r9 */\n/* 60:\tlwz r11,4(r6) */\n/* 64:\tlwz r10,8(r7) */\n/* 68:\tlwz r9,8(r6) */\n/* 6c:\tlwz r26,12(r7) */\n/* 70:\tlwz r27,12(r6) */\n/* 74:\tmullw r11,r12,r11 */\n/* 78:\tadd r0,r0,r25 */\n/* 7c:\tlwz r28,16(r7) */\n/* 80:\tlwz r29,16(r6) */\n/* 84:\tlwz r30,20(r7) */\n/* 88:\tlwz r31,20(r6) */\n/* 8c:\tmullw r25,r10,r9 */\n/* 90:\tadd r0,r0,r11 */\n/* 94:\tlwz r12,24(r7) */\n/* 98:\tlwz r11,24(r6) */\n/* 9c:\tlwz r10,28(r7) */\n/* a0:\taddi r7,r7,32 */\n/* a4:\tlwz r9,28(r6) */\n/* a8:\tmullw r27,r26,r27 */\n/* ac:\tadd r0,r0,r25 */\n/* b0:\taddi r6,r6,32 */\n/* b4:\tmullw r29,r28,r29 */\n/* b8:\tadd r0,r0,r27 */\n/* bc:\tmullw r31,r30,r31 */\n/* c0:\tadd r0,r0,r29 */\n/* c4:\tmullw r11,r12,r11 */\n/* c8:\tadd r0,r0,r31 */\n/* cc:\tmullw r9,r10,r9 */\n/* d0:\tadd r0,r0,r11 */\n/* d4:\tadd r0,r0,r9 */\n/* d8:\tbdnz 4c */\n/* dc:\tslwi r9,r8,2 */\n/* e0:\tsubf r6,r8,r5 */\n/* e4:\tadd r7,r4,r9 */\n/* e8:\tadd r9,r3,r9 */\n/* ec:\tmtctr r6 */\n/* f0:\tcmpw r8,r5 */\n/* f4:\tbge 114 */\n/* f8:\tlwz r4,0(r9) */\n/* fc:\taddi r9,r9,4 */\n/* 100:\tlwz r3,0(r7) */\n/* 104:\taddi r7,r7,4 */\n/* 108:\tmullw r3,r4,r3 */\n/* 10c:\tadd r0,r0,r3 */\n/* 110:\tbdnz f8 */\n/* 114:\tmr r3,r0 */\n/* 118:\taddi r11,r1,48 */\n/* 11c:\tbl 11c */\n/* \t\t\t11c: R_PPC_REL24\t_restgpr_25 */\n/* 120:\tlwz r0,52(r1) */\n/* 124:\tmtlr r0 */\n/* 128:\taddi r1,r1,48 */\n/* 12c:\tblr */\nvoid dotprod(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'dotprod': stack pointer r1 used as data (address-taken local / frame arithmetic) — not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":86,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'dotprod': stack pointer r1 used as data (address-taken local / frame arithmetic) — not supported"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 dotprod(s32 *arg0, s32 *arg1, s32 arg2, ? arg_sp0) {\n s32 *var_r6;\n s32 *var_r7;\n s32 *var_r7_2;\n s32 *var_r9;\n s32 temp_r0;\n s32 temp_r10;\n s32 temp_r10_2;\n s32 temp_r11;\n s32 temp_r12;\n s32 temp_r25;\n s32 temp_r26;\n s32 temp_r27;\n s32 temp_r28;\n s32 temp_r29;\n s32 temp_r30;\n s32 temp_r31;\n s32 temp_r3;\n s32 temp_r4;\n s32 temp_r9;\n s32 var_ctr_2;\n s32 var_r0;\n s32 var_r8;\n u32 var_ctr;\n\n var_r0 = 0;\n var_r8 = 0;\n if (arg2 > 0) {\n temp_r10 = arg2 - 8;\n if (arg2 > 8) {\n var_r6 = arg1;\n var_r7 = arg0;\n var_ctr = (u32) (temp_r10 + 7) >> 3U;\n if (temp_r10 > 0) {\n do {\n var_r8 += 8;\n temp_r26 = var_r7->unkC;\n temp_r28 = var_r7->unk10;\n temp_r29 = var_r6->unk10;\n temp_r30 = var_r7->unk14;\n temp_r31 = var_r6->unk14;\n temp_r25 = var_r7->unk8 * var_r6->unk8;\n temp_r0 = var_r0 + (var_r7->unk0 * var_r6->unk0) + (var_r7->unk4 * var_r6->unk4);\n temp_r12 = var_r7->unk18;\n temp_r11 = var_r6->unk18;\n temp_r10_2 = var_r7->unk1C;\n var_r7 += 0x20;\n temp_r9 = var_r6->unk1C;\n temp_r27 = temp_r26 * var_r6->unkC;\n var_r6 += 0x20;\n var_r0 = temp_r0 + temp_r25 + temp_r27 + (temp_r28 * temp_r29) + (temp_r30 * temp_r31) + (temp_r12 * temp_r11) + (temp_r10_2 * temp_r9);\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r7_2 = &arg1[var_r8];\n var_r9 = &arg0[var_r8];\n var_ctr_2 = arg2 - var_r8;\n if (var_r8 < arg2) {\n do {\n temp_r4 = *var_r9;\n var_r9 += 4;\n temp_r3 = *var_r7_2;\n var_r7_2 += 4;\n var_r0 += temp_r4 * temp_r3;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r0;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":70,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dotprod` — benchmark function synthetic:dotprod:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dotprod\n stwu r1,-48(r1)\n mflr r0\n stw r0,52(r1)\n addi r11,r1,48\n bl _savegpr_25\n cmpwi r5,0\n li r0,0\n li r8,0\n ble .L114\n cmpwi r5,8\n addi r10,r5,-8\n ble .Ldc\n addi r9,r10,7\n mr r6,r4\n srwi r9,r9,3\n mr r7,r3\n mtctr r9\n cmpwi r10,0\n ble .Ldc\n.L4c:\n lwz r10,0(r7)\n addi r8,r8,8\n lwz r9,0(r6)\n lwz r12,4(r7)\n mullw r25,r10,r9\n lwz r11,4(r6)\n lwz r10,8(r7)\n lwz r9,8(r6)\n lwz r26,12(r7)\n lwz r27,12(r6)\n mullw r11,r12,r11\n add r0,r0,r25\n lwz r28,16(r7)\n lwz r29,16(r6)\n lwz r30,20(r7)\n lwz r31,20(r6)\n mullw r25,r10,r9\n add r0,r0,r11\n lwz r12,24(r7)\n lwz r11,24(r6)\n lwz r10,28(r7)\n addi r7,r7,32\n lwz r9,28(r6)\n mullw r27,r26,r27\n add r0,r0,r25\n addi r6,r6,32\n mullw r29,r28,r29\n add r0,r0,r27\n mullw r31,r30,r31\n add r0,r0,r29\n mullw r11,r12,r11\n add r0,r0,r31\n mullw r9,r10,r9\n add r0,r0,r11\n add r0,r0,r9\n bdnz .L4c\n.Ldc:\n slwi r9,r8,2\n subf r6,r8,r5\n add r7,r4,r9\n add r9,r3,r9\n mtctr r6\n cmpw r8,r5\n bge .L114\n.Lf8:\n lwz r4,0(r9)\n addi r9,r9,4\n lwz r3,0(r7)\n addi r7,r7,4\n mullw r3,r4,r3\n add r0,r0,r3\n bdnz .Lf8\n.L114:\n mr r3,r0\n addi r11,r1,48\n bl _restgpr_25\n lwz r0,52(r1)\n mtlr r0\n addi r1,r1,48\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint dotprod(int*,int*,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dotprod # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dotprod` — benchmark function synthetic:dotprod:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dotprod:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-48(r1)\n 4:\tmflr r0\n 8:\tstw r0,52(r1)\n c:\taddi r11,r1,48\n 10:\tbl 10 \n\t\t\t10: R_PPC_REL24\t_savegpr_25\n 14:\tcmpwi r5,0\n 18:\tli r0,0\n 1c:\tli r8,0\n 20:\tble 114 \n 24:\tcmpwi r5,8\n 28:\taddi r10,r5,-8\n 2c:\tble dc \n 30:\taddi r9,r10,7\n 34:\tmr r6,r4\n 38:\tsrwi r9,r9,3\n 3c:\tmr r7,r3\n 40:\tmtctr r9\n 44:\tcmpwi r10,0\n 48:\tble dc \n 4c:\tlwz r10,0(r7)\n 50:\taddi r8,r8,8\n 54:\tlwz r9,0(r6)\n 58:\tlwz r12,4(r7)\n 5c:\tmullw r25,r10,r9\n 60:\tlwz r11,4(r6)\n 64:\tlwz r10,8(r7)\n 68:\tlwz r9,8(r6)\n 6c:\tlwz r26,12(r7)\n 70:\tlwz r27,12(r6)\n 74:\tmullw r11,r12,r11\n 78:\tadd r0,r0,r25\n 7c:\tlwz r28,16(r7)\n 80:\tlwz r29,16(r6)\n 84:\tlwz r30,20(r7)\n 88:\tlwz r31,20(r6)\n 8c:\tmullw r25,r10,r9\n 90:\tadd r0,r0,r11\n 94:\tlwz r12,24(r7)\n 98:\tlwz r11,24(r6)\n 9c:\tlwz r10,28(r7)\n a0:\taddi r7,r7,32\n a4:\tlwz r9,28(r6)\n a8:\tmullw r27,r26,r27\n ac:\tadd r0,r0,r25\n b0:\taddi r6,r6,32\n b4:\tmullw r29,r28,r29\n b8:\tadd r0,r0,r27\n bc:\tmullw r31,r30,r31\n c0:\tadd r0,r0,r29\n c4:\tmullw r11,r12,r11\n c8:\tadd r0,r0,r31\n cc:\tmullw r9,r10,r9\n d0:\tadd r0,r0,r11\n d4:\tadd r0,r0,r9\n d8:\tbdnz 4c \n dc:\tslwi r9,r8,2\n e0:\tsubf r6,r8,r5\n e4:\tadd r7,r4,r9\n e8:\tadd r9,r3,r9\n ec:\tmtctr r6\n f0:\tcmpw r8,r5\n f4:\tbge 114 \n f8:\tlwz r4,0(r9)\n fc:\taddi r9,r9,4\n 100:\tlwz r3,0(r7)\n 104:\taddi r7,r7,4\n 108:\tmullw r3,r4,r3\n 10c:\tadd r0,r0,r3\n 110:\tbdnz f8 \n 114:\tmr r3,r0\n 118:\taddi r11,r1,48\n 11c:\tbl 11c \n\t\t\t11c: R_PPC_REL24\t_restgpr_25\n 120:\tlwz r0,52(r1)\n 124:\tmtlr r0\n 128:\taddi r1,r1,48\n 12c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 _savegpr_25\n00000000 *UND*\t00000000 _restgpr_25\n00000000 g F .text\t00000130 dotprod\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_PPC_REL24 _savegpr_25\n0000011c R_PPC_REL24 _restgpr_25\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 dotprod\n\n\nContents of section .text:\n 0000 9421ffd0 7c0802a6 90010034 39610030 .!..|......49a.0\n 0010 48000001 2c050000 38000000 39000000 H...,...8...9...\n 0020 408100f4 2c050008 3945fff8 408100b0 @...,...9E..@...\n 0030 392a0007 7c862378 5529e8fe 7c671b78 9*..|.#xU)..|g.x\n 0040 7d2903a6 2c0a0000 40810094 81470000 })..,...@....G..\n 0050 39080008 81260000 81870004 7f2a49d6 9....&.......*I.\n 0060 81660004 81470008 81260008 8347000c .f...G...&...G..\n 0070 8366000c 7d6c59d6 7c00ca14 83870010 .f..}lY.|.......\n 0080 83a60010 83c70014 83e60014 7f2a49d6 .............*I.\n 0090 7c005a14 81870018 81660018 8147001c |.Z......f...G..\n 00a0 38e70020 8126001c 7f7ad9d6 7c00ca14 8.. .&...z..|...\n 00b0 38c60020 7fbce9d6 7c00da14 7ffef9d6 8.. ....|.......\n 00c0 7c00ea14 7d6c59d6 7c00fa14 7d2a49d6 |...}lY.|...}*I.\n 00d0 7c005a14 7c004a14 4200ff74 5509103a |.Z.|.J.B..tU..:\n 00e0 7cc82850 7ce44a14 7d234a14 7cc903a6 |.(P|.J.}#J.|...\n 00f0 7c082800 40800020 80890000 39290004 |.(.@.. ....9)..\n 0100 80670000 38e70004 7c6419d6 7c001a14 .g..8...|d..|...\n 0110 4200ffe8 7c030378 39610030 48000001 B...|..x9a.0H...\n 0120 80010034 7c0803a6 38210030 4e800020 ...4|...8!.0N.. \nContents of section .mwcats.text:\n 0000 02000130 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000000 00000000 00000004 ................\n 0060 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name dotprod # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dowhile:agbcc","sym":"dowhile","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","do-while"],"loc":1,"refSource":"int dowhile(int n){ int s=0; do{s+=n;n--;}while(n>0); return s; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdowhile\n\t.type\t dowhile,function\n\t.thumb_func\ndowhile:\n\tmov\tr1, #0x0\n.L3:\n\tadd\tr1, r1, r0\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0\n\tbgt\t.L3\t@cond_branch\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t dowhile,.Lfe1-dowhile\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 dowhile(u32 a0) {\n s32 v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n do {\n v1 = v1 + v0;\n v0 = v0 - 1;\n } while (v0 > 0);\n return v1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 dowhile(s32 arg0) {\n s32 var_r0;\n s32 var_r1;\n\n var_r0 = arg0;\n var_r1 = 0;\n do {\n var_r1 += var_r0;\n var_r0 -= 1;\n } while (var_r0 > 0);\n return var_r1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dowhile` — benchmark function synthetic:dowhile:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdowhile\n\t.type\t dowhile,function\n\t.thumb_func\ndowhile:\n\tmov\tr1, #0x0\n.L3:\n\tadd\tr1, r1, r0\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0\n\tbgt\t.L3\t@cond_branch\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t dowhile,.Lfe1-dowhile\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dowhile # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dowhile` — benchmark function synthetic:dowhile:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dowhile:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tdowhile\n\t.type\t dowhile,function\n\t.thumb_func\ndowhile:\n\tmov\tr1, #0x0\n.L3:\n\tadd\tr1, r1, r0\n\tsub\tr0, r0, #0x1\n\tcmp\tr0, #0\n\tbgt\t.L3\t@cond_branch\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t dowhile,.Lfe1-dowhile\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name dowhile # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dowhile:gcc2.7.2kmc","sym":"dowhile","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","do-while"],"loc":1,"refSource":"int dowhile(int n){ int s=0; do{s+=n;n--;}while(n>0); return s; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,zero\n 4:\taddu\tv0,v0,a0\n 8:\taddiu\ta0,a0,-1\n c:\tbgtzl\ta0,8 \n 10:\taddu\tv0,v0,a0\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b217463f0db4075d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c dowhile\n\n\nContents of section .text:\n 0000 00001021 00441021 2484ffff 5c80fffe ...!.D.!$...\\...\n 0010 00441021 03e00008 00000000 00000000 .D.!............\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'dowhile' — lift: cannot lift 'dowhile': unmodelled control transfer 'bgtzl' at 0xc — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv0,zero */\n/* 4:\taddu\tv0,v0,a0 */\n/* 8:\taddiu\ta0,a0,-1 */\n/* c:\tbgtzl\ta0,8 */\n/* 10:\taddu\tv0,v0,a0 */\n/* 14:\tjr\tra */\n/* 18:\tnop */\n/* 1c:\tnop */\nvoid dowhile(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'dowhile': unmodelled control transfer 'bgtzl' at 0xc — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'dowhile': unmodelled control transfer 'bgtzl' at 0xc — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void dowhile(s32 arg0) {\n s32 var_a0;\n\n var_a0 = arg0;\n do {\n var_a0 -= 1;\n } while (var_a0 > 0);\n}\n","score":4,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":7,"ratio":0.5714285714285714,"kinds":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dowhile` — benchmark function synthetic:dowhile:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dowhile\n move\t$v0, $zero\n addu\t$v0, $v0, $a0\n.L8:\n addiu\t$a0, $a0, -1\n bgtzl\t$a0, .L8\n addu\t$v0, $v0, $a0\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dowhile # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dowhile` — benchmark function synthetic:dowhile:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dowhile:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,zero\n 4:\taddu\tv0,v0,a0\n 8:\taddiu\ta0,a0,-1\n c:\tbgtzl\ta0,8 \n 10:\taddu\tv0,v0,a0\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b217463f0db4075d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c dowhile\n\n\nContents of section .text:\n 0000 00001021 00441021 2484ffff 5c80fffe ...!.D.!$...\\...\n 0010 00441021 03e00008 00000000 00000000 .D.!............\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name dowhile # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dowhile:ido7.1","sym":"dowhile","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","do-while"],"loc":1,"refSource":"int dowhile(int n){ int s=0; do{s+=n;n--;}while(n>0); return s; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\taddu\tv1,v1,a0\n 8:\taddiu\ta0,a0,-1\n c:\tbgtzl\ta0,8 \n 10:\taddu\tv1,v1,a0\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c dowhile\n\n\nContents of section .text:\n 0000 00001825 00641821 2484ffff 5c80fffe ...%.d.!$...\\...\n 0010 00641821 03e00008 00601025 00000000 .d.!.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 32313734 36336630 64623430 ef-b217463f0db40\n 0130 3735642f 7265662e 6300646f 7768696c 75d/ref.c.dowhil\n 0140 65000000 646f7768 696c6500 00000000 e...dowhile.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000007 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'dowhile' — lift: cannot lift 'dowhile': unmodelled control transfer 'bgtzl' at 0xc — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\taddu\tv1,v1,a0 */\n/* 8:\taddiu\ta0,a0,-1 */\n/* c:\tbgtzl\ta0,8 */\n/* 10:\taddu\tv1,v1,a0 */\n/* 14:\tjr\tra */\n/* 18:\tmove\tv0,v1 */\n/* 1c:\tnop */\nvoid dowhile(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'dowhile': unmodelled control transfer 'bgtzl' at 0xc — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'dowhile': unmodelled control transfer 'bgtzl' at 0xc — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 dowhile(s32 arg0) {\n s32 var_a0;\n s32 var_v1;\n\n var_a0 = arg0;\n var_v1 = 0;\n do {\n var_v1 += var_a0;\n var_a0 -= 1;\n } while (var_a0 > 0);\n return var_v1;\n}\n","score":6,"maxScore":8,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":8,"ratio":0.75,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":5}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dowhile` — benchmark function synthetic:dowhile:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dowhile\n move\t$v1, $zero\n addu\t$v1, $v1, $a0\n.L8:\n addiu\t$a0, $a0, -1\n bgtzl\t$a0, .L8\n addu\t$v1, $v1, $a0\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dowhile # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dowhile` — benchmark function synthetic:dowhile:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dowhile:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\taddu\tv1,v1,a0\n 8:\taddiu\ta0,a0,-1\n c:\tbgtzl\ta0,8 \n 10:\taddu\tv1,v1,a0\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c dowhile\n\n\nContents of section .text:\n 0000 00001825 00641821 2484ffff 5c80fffe ...%.d.!$...\\...\n 0010 00641821 03e00008 00601025 00000000 .d.!.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 32313734 36336630 64623430 ef-b217463f0db40\n 0130 3735642f 7265662e 6300646f 7768696c 75d/ref.c.dowhil\n 0140 65000000 646f7768 696c6500 00000000 e...dowhile.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000007 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name dowhile # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:dowhile:mwcc_242_81","sym":"dowhile","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","do-while"],"loc":1,"refSource":"int dowhile(int n){ int s=0; do{s+=n;n--;}while(n>0); return s; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r0,0\n 4:\tadd r0,r0,r3\n 8:\taddic. r3,r3,-1\n c:\tbgt 4 \n 10:\tmr r3,r0\n 14:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 dowhile\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 dowhile\n\n\nContents of section .text:\n 0000 38000000 7c001a14 3463ffff 4181fff8 8...|...4c..A...\n 0010 7c030378 4e800020 |..xN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 dowhile(u32 a0) {\n s32 v0;\n s32 v1;\n v1 = a0;\n v0 = 0;\n do {\n v0 = v0 + v1;\n v1 = v1 + -1;\n } while (v1 > 0);\n return v0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 dowhile(s32 arg0) {\n s32 var_r0;\n s32 var_r3;\n\n var_r3 = arg0;\n var_r0 = 0;\n do {\n var_r0 += var_r3;\n var_r3 -= 1;\n } while (var_r3 > 0);\n return var_r0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `dowhile` — benchmark function synthetic:dowhile:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel dowhile\n li r0,0\n.L4:\n add r0,r0,r3\n addic. r3,r3,-1\n bgt .L4\n mr r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function dowhile # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `dowhile` — benchmark function synthetic:dowhile:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:dowhile:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r0,0\n 4:\tadd r0,r0,r3\n 8:\taddic. r3,r3,-1\n c:\tbgt 4 \n 10:\tmr r3,r0\n 14:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 dowhile\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 dowhile\n\n\nContents of section .text:\n 0000 38000000 7c001a14 3463ffff 4181fff8 8...|...4c..A...\n 0010 7c030378 4e800020 |..xN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name dowhile # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:expr1:agbcc","sym":"expr1","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","expr"],"loc":1,"refSource":"int expr1(int a,int b,int c){ return a*b + c - 3; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\texpr1\n\t.type\t expr1,function\n\t.thumb_func\nexpr1:\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tsub\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t expr1,.Lfe1-expr1\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 expr1(u32 a0, u32 a1, u32 a2) {\n return a0 * a1 + a2 - 3;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 expr1(s32 arg0, s32 arg1, s32 arg2) {\n return ((arg0 * arg1) + arg2) - 3;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `expr1` — benchmark function synthetic:expr1:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\texpr1\n\t.type\t expr1,function\n\t.thumb_func\nexpr1:\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tsub\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t expr1,.Lfe1-expr1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function expr1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `expr1` — benchmark function synthetic:expr1:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:expr1:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\texpr1\n\t.type\t expr1,function\n\t.thumb_func\nexpr1:\n\tmul\tr0, r0, r1\n\tadd\tr0, r0, r2\n\tsub\tr0, r0, #0x3\n\tbx\tlr\n.Lfe1:\n\t.size\t expr1,.Lfe1-expr1\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name expr1 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:expr1:gcc2.7.2kmc","sym":"expr1","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","expr"],"loc":1,"refSource":"int expr1(int a,int b,int c){ return a*b + c - 3; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmult\ta0,a1\n 8:\tmflo\tv0\n c:\taddu\tv0,v0,a2\n 10:\tnop\n 14:\tjr\tra\n 18:\taddiu\tv0,v0,-3\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-bf2c7e75346799d7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c expr1\n\n\nContents of section .text:\n 0000 00000000 00850018 00001012 00461021 .............F.!\n 0010 00000000 03e00008 2442fffd 00000000 ........$B......\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 expr1(u32 a0, u32 a1, u32 a2) {\n return a0 * a1 + a2 + -3;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 expr1(s32 arg0, s32 arg1, s32 arg2) {\n return ((arg0 * arg1) + arg2) - 3;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `expr1` — benchmark function synthetic:expr1:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel expr1\n nop\n mult\t$a0, $a1\n mflo\t$v0\n addu\t$v0, $v0, $a2\n nop\n jr\t$ra\n addiu\t$v0, $v0, -3\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function expr1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `expr1` — benchmark function synthetic:expr1:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:expr1:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmult\ta0,a1\n 8:\tmflo\tv0\n c:\taddu\tv0,v0,a2\n 10:\tnop\n 14:\tjr\tra\n 18:\taddiu\tv0,v0,-3\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-bf2c7e75346799d7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c expr1\n\n\nContents of section .text:\n 0000 00000000 00850018 00001012 00461021 .............F.!\n 0010 00000000 03e00008 2442fffd 00000000 ........$B......\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name expr1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:expr1:ido7.1","sym":"expr1","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","expr"],"loc":1,"refSource":"int expr1(int a,int b,int c){ return a*b + c - 3; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmultu\ta0,a1\n 4:\tmflo\tt6\n 8:\taddu\tv0,t6,a2\n c:\tjr\tra\n 10:\taddiu\tv0,v0,-3\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 expr1\n\n\nContents of section .text:\n 0000 00850019 00007012 01c61021 03e00008 ......p....!....\n 0010 2442fffd 00000000 00000000 00000000 $B..............\nContents of section .options:\n 0000 01200000 00000000 80004074 00000000 . ........@t....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004074 00000000 00000000 00000000 ..@t............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 66326337 65373533 34363739 ef-bf2c7e7534679\n 0130 3964372f 7265662e 63006578 70723100 9d7/ref.c.expr1.\n 0140 65787072 31000000 00000000 00000001 expr1...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 expr1(u32 a0, u32 a1, u32 a2) {\n return a0 * a1 + a2 + -3;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 expr1(s32 arg0, s32 arg1, s32 arg2) {\n return ((arg0 * arg1) + arg2) - 3;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `expr1` — benchmark function synthetic:expr1:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel expr1\n multu\t$a0, $a1\n mflo\t$t6\n addu\t$v0, $t6, $a2\n jr\t$ra\n addiu\t$v0, $v0, -3\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function expr1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `expr1` — benchmark function synthetic:expr1:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:expr1:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmultu\ta0,a1\n 4:\tmflo\tt6\n 8:\taddu\tv0,t6,a2\n c:\tjr\tra\n 10:\taddiu\tv0,v0,-3\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 expr1\n\n\nContents of section .text:\n 0000 00850019 00007012 01c61021 03e00008 ......p....!....\n 0010 2442fffd 00000000 00000000 00000000 $B..............\nContents of section .options:\n 0000 01200000 00000000 80004074 00000000 . ........@t....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004074 00000000 00000000 00000000 ..@t............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 66326337 65373533 34363739 ef-bf2c7e7534679\n 0130 3964372f 7265662e 63006578 70723100 9d7/ref.c.expr1.\n 0140 65787072 31000000 00000000 00000001 expr1...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name expr1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:expr1:mwcc_242_81","sym":"expr1","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","expr"],"loc":1,"refSource":"int expr1(int a,int b,int c){ return a*b + c - 3; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmullw r3,r3,r4\n 4:\taddi r3,r3,-3\n 8:\tadd r3,r5,r3\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 expr1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 expr1\n\n\nContents of section .text:\n 0000 7c6321d6 3863fffd 7c651a14 4e800020 |c!.8c..|e..N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 expr1(u32 a0, u32 a1, u32 a2) {\n return a2 + (a0 * a1 + -3);\n}\n","score":3,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 expr1(s32 arg0, s32 arg1, s32 arg2) {\n return arg2 + ((arg0 * arg1) - 3);\n}\n","score":3,"maxScore":5,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":3,"maxScore":5,"ratio":0.6,"kinds":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `expr1` — benchmark function synthetic:expr1:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel expr1\n mullw r3,r3,r4\n addi r3,r3,-3\n add r3,r5,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function expr1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `expr1` — benchmark function synthetic:expr1:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:expr1:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmullw r3,r3,r4\n 4:\taddi r3,r3,-3\n 8:\tadd r3,r5,r3\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 expr1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 expr1\n\n\nContents of section .text:\n 0000 7c6321d6 3863fffd 7c651a14 4e800020 |c!.8c..|e..N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name expr1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:extractbits:agbcc","sym":"extractbits","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"unsigned extractbits(unsigned x){ return (x>>4)&0xF; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\textractbits\n\t.type\t extractbits,function\n\t.thumb_func\nextractbits:\n\tlsr\tr0, r0, #0x4\n\tmov\tr1, #0xf\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t extractbits,.Lfe1-extractbits\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 extractbits(u32 a0) {\n return a0 >> 4 & 15;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 extractbits(u32 arg0) {\n return (arg0 >> 4) & 0xF;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `extractbits` — benchmark function synthetic:extractbits:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\textractbits\n\t.type\t extractbits,function\n\t.thumb_func\nextractbits:\n\tlsr\tr0, r0, #0x4\n\tmov\tr1, #0xf\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t extractbits,.Lfe1-extractbits\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function extractbits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `extractbits` — benchmark function synthetic:extractbits:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:extractbits:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\textractbits\n\t.type\t extractbits,function\n\t.thumb_func\nextractbits:\n\tlsr\tr0, r0, #0x4\n\tmov\tr1, #0xf\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t extractbits,.Lfe1-extractbits\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name extractbits # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:extractbits:gcc2.7.2kmc","sym":"extractbits","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"unsigned extractbits(unsigned x){ return (x>>4)&0xF; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x4\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0xf\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4883c477966a0050/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c extractbits\n\n\nContents of section .text:\n 0000 00041102 03e00008 3042000f 00000000 ........0B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 extractbits(u32 a0) {\n return a0 >> 4 & 15;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 extractbits(u32 arg0) {\n return (arg0 >> 4) & 0xF;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `extractbits` — benchmark function synthetic:extractbits:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel extractbits\n srl\t$v0, $a0, 0x4\n jr\t$ra\n andi\t$v0, $v0, 0xf\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function extractbits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `extractbits` — benchmark function synthetic:extractbits:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:extractbits:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x4\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0xf\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4883c477966a0050/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c extractbits\n\n\nContents of section .text:\n 0000 00041102 03e00008 3042000f 00000000 ........0B......\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name extractbits # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:extractbits:ido7.1","sym":"extractbits","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"unsigned extractbits(unsigned x){ return (x>>4)&0xF; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x4\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0xf\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c extractbits\n\n\nContents of section .text:\n 0000 00041102 03e00008 3042000f 00000000 ........0B......\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000188 p...............\n 0010 00000005 000002d4 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 0000003c 00000234 ...........<...4\n 0040 0000000c 00000270 00000001 0000027c .......p.......|\n 0050 00000000 00000000 00000001 000002c4 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 38383363 34373739 36366130 ef-4883c477966a0\n 0130 3035302f 7265662e 63006578 74726163 050/ref.c.extrac\n 0140 74626974 73000000 65787472 61637462 tbits...extractb\n 0150 69747300 00000000 00000001 00000000 its.............\n 0160 0000003a 00000000 00000004 00000000 ...:............\n 0170 00000003 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000001 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 extractbits(u32 a0) {\n return a0 >> 4 & 15;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 extractbits(u32 arg0) {\n return (arg0 >> 4) & 0xF;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `extractbits` — benchmark function synthetic:extractbits:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel extractbits\n srl\t$v0, $a0, 0x4\n jr\t$ra\n andi\t$v0, $v0, 0xf\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function extractbits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `extractbits` — benchmark function synthetic:extractbits:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:extractbits:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x4\n 4:\tjr\tra\n 8:\tandi\tv0,v0,0xf\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c extractbits\n\n\nContents of section .text:\n 0000 00041102 03e00008 3042000f 00000000 ........0B......\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000188 p...............\n 0010 00000005 000002d4 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 0000003c 00000234 ...........<...4\n 0040 0000000c 00000270 00000001 0000027c .......p.......|\n 0050 00000000 00000000 00000001 000002c4 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 38383363 34373739 36366130 ef-4883c477966a0\n 0130 3035302f 7265662e 63006578 74726163 050/ref.c.extrac\n 0140 74626974 73000000 65787472 61637462 tbits...extractb\n 0150 69747300 00000000 00000001 00000000 its.............\n 0160 0000003a 00000000 00000004 00000000 ...:............\n 0170 00000003 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000001 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name extractbits # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:extractbits:mwcc_242_81","sym":"extractbits","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift","mask"],"loc":1,"refSource":"unsigned extractbits(unsigned x){ return (x>>4)&0xF; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\trlwinm r3,r3,28,28,31\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 extractbits\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 extractbits\n\n\nContents of section .text:\n 0000 5463e73e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 extractbits(u32 a0) {\n return a0 >> 4 & 15;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 extractbits(u32 arg0) {\n return (arg0 >> 4U) & 0xF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `extractbits` — benchmark function synthetic:extractbits:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel extractbits\n rlwinm r3,r3,28,28,31\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function extractbits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `extractbits` — benchmark function synthetic:extractbits:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:extractbits:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\trlwinm r3,r3,28,28,31\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 extractbits\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 extractbits\n\n\nContents of section .text:\n 0000 5463e73e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name extractbits # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:f2i:agbcc","sym":"f2i","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","cast","float-to-int"],"loc":1,"refSource":"int f2i(float x){ return (int)x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tf2i\n\t.type\t f2i,function\n\t.thumb_func\nf2i:\n\tpush\t{lr}\n\tbl\t__fixsfsi\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t f2i,.Lfe1-f2i\n","ctx":"int f2i(float);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 f2i(void) {\n return __fixsfsi();\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 __fixsfsi(); /* extern */\n\ns32 f2i(f32 arg0) {\n return __fixsfsi();\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `f2i` — benchmark function synthetic:f2i:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tf2i\n\t.type\t f2i,function\n\t.thumb_func\nf2i:\n\tpush\t{lr}\n\tbl\t__fixsfsi\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t f2i,.Lfe1-f2i\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint f2i(float);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function f2i # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `f2i` — benchmark function synthetic:f2i:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:f2i:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tf2i\n\t.type\t f2i,function\n\t.thumb_func\nf2i:\n\tpush\t{lr}\n\tbl\t__fixsfsi\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t f2i,.Lfe1-f2i\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name f2i # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:f2i:gcc2.7.2kmc","sym":"f2i","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","cast","float-to-int"],"loc":1,"refSource":"int f2i(float x){ return (int)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\ttrunc.w.s\t$f0,$f12\n 4:\tmfc1\tv0,$f0\n 8:\tjr\tra\n c:\tnop\n","ctx":"int f2i(float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-de58cb91152c3fb9/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 f2i\n\n\nContents of section .text:\n 0000 4600600d 44020000 03e00008 00000000 F.`.D...........\nContents of section .reginfo:\n 0000 80000004 00000000 00001001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'f2i' — lift: cannot lift 'f2i @0x0': unmodelled effect instruction 'trunc.w.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\ttrunc.w.s\t$f0,$f12 */\n/* 4:\tmfc1\tv0,$f0 */\n/* 8:\tjr\tra */\n/* c:\tnop */\nvoid f2i(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'f2i @0x0': unmodelled effect instruction 'trunc.w.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":12,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'f2i @0x0': unmodelled effect instruction 'trunc.w.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 f2i(f32 arg0) {\n return (s32) arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `f2i` — benchmark function synthetic:f2i:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel f2i\n trunc.w.s\t$f0, $f12\n mfc1\t$v0, $f0\n jr\t$ra\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint f2i(float);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function f2i # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `f2i` — benchmark function synthetic:f2i:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:f2i:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\ttrunc.w.s\t$f0,$f12\n 4:\tmfc1\tv0,$f0\n 8:\tjr\tra\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-de58cb91152c3fb9/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 f2i\n\n\nContents of section .text:\n 0000 4600600d 44020000 03e00008 00000000 F.`.D...........\nContents of section .reginfo:\n 0000 80000004 00000000 00001001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name f2i # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:f2i:ido7.1","sym":"f2i","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","cast","float-to-int"],"loc":1,"refSource":"int f2i(float x){ return (int)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\ttrunc.w.s\t$f4,$f12\n 4:\tmfc1\tv0,$f4\n 8:\tjr\tra\n c:\tnop\n","ctx":"int f2i(float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 f2i\n\n\nContents of section .text:\n 0000 4600610d 44022000 03e00008 00000000 F.a.D. .........\nContents of section .options:\n 0000 01200000 00000000 80000004 00000000 . ..............\n 0010 00001030 00000000 00000000 00007ff0 ...0............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000004 00000000 00001030 00000000 ...........0....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 65353863 62393131 35326333 ef-de58cb91152c3\n 0130 6662392f 7265662e 63006632 69000000 fb9/ref.c.f2i...\n 0140 66326900 00000000 00000001 00000000 f2i.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000004 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'f2i' — lift: cannot lift 'f2i @0x0': unmodelled effect instruction 'trunc.w.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\ttrunc.w.s\t$f4,$f12 */\n/* 4:\tmfc1\tv0,$f4 */\n/* 8:\tjr\tra */\n/* c:\tnop */\nvoid f2i(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'f2i @0x0': unmodelled effect instruction 'trunc.w.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":12,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'f2i @0x0': unmodelled effect instruction 'trunc.w.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 f2i(f32 arg0) {\n return (s32) arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `f2i` — benchmark function synthetic:f2i:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel f2i\n trunc.w.s\t$f4, $f12\n mfc1\t$v0, $f4\n jr\t$ra\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint f2i(float);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function f2i # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `f2i` — benchmark function synthetic:f2i:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:f2i:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\ttrunc.w.s\t$f4,$f12\n 4:\tmfc1\tv0,$f4\n 8:\tjr\tra\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 f2i\n\n\nContents of section .text:\n 0000 4600610d 44022000 03e00008 00000000 F.a.D. .........\nContents of section .options:\n 0000 01200000 00000000 80000004 00000000 . ..............\n 0010 00001030 00000000 00000000 00007ff0 ...0............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000004 00000000 00001030 00000000 ...........0....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 65353863 62393131 35326333 ef-de58cb91152c3\n 0130 6662392f 7265662e 63006632 69000000 fb9/ref.c.f2i...\n 0140 66326900 00000000 00000001 00000000 f2i.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000004 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name f2i # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:f2i:mwcc_242_81","sym":"f2i","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","cast","float-to-int"],"loc":1,"refSource":"int f2i(float x){ return (int)x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfctiwz f0,f1\n 4:\tstwu r1,-16(r1)\n 8:\tstfd f0,8(r1)\n c:\tlwz r3,12(r1)\n 10:\taddi r1,r1,16\n 14:\tblr\n","ctx":"int f2i(float);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 f2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 f2i\n\n\nContents of section .text:\n 0000 fc00081e 9421fff0 d8010008 8061000c .....!.......a..\n 0010 38210010 4e800020 8!..N.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'f2i' — lift: cannot lift 'f2i @0x0': unmodelled effect instruction 'fctiwz' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfctiwz f0,f1 */\n/* 4:\tstwu r1,-16(r1) */\n/* 8:\tstfd f0,8(r1) */\n/* c:\tlwz r3,12(r1) */\n/* 10:\taddi r1,r1,16 */\n/* 14:\tblr */\nvoid f2i(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'f2i @0x0': unmodelled effect instruction 'fctiwz' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":14,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'f2i @0x0': unmodelled effect instruction 'fctiwz' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 f2i(f32 farg0) {\n return (s32) farg0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `f2i` — benchmark function synthetic:f2i:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel f2i\n fctiwz f0,f1\n stwu r1,-16(r1)\n stfd f0,8(r1)\n lwz r3,12(r1)\n addi r1,r1,16\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nint f2i(float);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function f2i # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `f2i` — benchmark function synthetic:f2i:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:f2i:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfctiwz f0,f1\n 4:\tstwu r1,-16(r1)\n 8:\tstfd f0,8(r1)\n c:\tlwz r3,12(r1)\n 10:\taddi r1,r1,16\n 14:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 f2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 f2i\n\n\nContents of section .text:\n 0000 fc00081e 9421fff0 d8010008 8061000c .....!.......a..\n 0010 38210010 4e800020 8!..N.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name f2i # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fadd:agbcc","sym":"fadd","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fadd(float a,float b){ return a+b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfadd\n\t.type\t fadd,function\n\t.thumb_func\nfadd:\n\tpush\t{lr}\n\tbl\t__addsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fadd,.Lfe1-fadd\n","ctx":"float fadd(float,float);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 fadd(void) {\n return __addsf3();\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 __addsf3(); /* extern */\n\nf32 fadd(f32 arg0, f32 arg1) {\n return (bitwise f32) __addsf3();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fadd` — benchmark function synthetic:fadd:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfadd\n\t.type\t fadd,function\n\t.thumb_func\nfadd:\n\tpush\t{lr}\n\tbl\t__addsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fadd,.Lfe1-fadd\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fadd(float,float);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fadd # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fadd` — benchmark function synthetic:fadd:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fadd:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfadd\n\t.type\t fadd,function\n\t.thumb_func\nfadd:\n\tpush\t{lr}\n\tbl\t__addsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fadd,.Lfe1-fadd\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fadd # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fadd:gcc2.7.2kmc","sym":"fadd","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fadd(float a,float b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fadd(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ca8bb36fb8485552/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fadd\n\n\nContents of section .text:\n 0000 03e00008 460e6000 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fadd' — lift: cannot lift 'fadd @0x4': unmodelled effect instruction 'add.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tadd.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fadd(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fadd @0x4': unmodelled effect instruction 'add.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fadd @0x4': unmodelled effect instruction 'add.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fadd(f32 arg0, f32 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fadd` — benchmark function synthetic:fadd:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fadd\n jr\t$ra\n add.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fadd(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fadd # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fadd` — benchmark function synthetic:fadd:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fadd:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ca8bb36fb8485552/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fadd\n\n\nContents of section .text:\n 0000 03e00008 460e6000 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fadd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fadd:ido7.1","sym":"fadd","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fadd(float a,float b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fadd(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fadd\n\n\nContents of section .text:\n 0000 03e00008 460e6000 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 61386262 33366662 38343835 ef-ca8bb36fb8485\n 0130 3535322f 7265662e 63006661 64640000 552/ref.c.fadd..\n 0140 66616464 00000000 00000000 00000001 fadd............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fadd' — lift: cannot lift 'fadd @0x4': unmodelled effect instruction 'add.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tadd.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fadd(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fadd @0x4': unmodelled effect instruction 'add.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fadd @0x4': unmodelled effect instruction 'add.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fadd(f32 arg0, f32 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fadd` — benchmark function synthetic:fadd:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fadd\n jr\t$ra\n add.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fadd(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fadd # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fadd` — benchmark function synthetic:fadd:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fadd:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tadd.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fadd\n\n\nContents of section .text:\n 0000 03e00008 460e6000 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 61386262 33366662 38343835 ef-ca8bb36fb8485\n 0130 3535322f 7265662e 63006661 64640000 552/ref.c.fadd..\n 0140 66616464 00000000 00000000 00000001 fadd............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fadd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fadd:mwcc_242_81","sym":"fadd","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fadd(float a,float b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfadds f1,f1,f2\n 4:\tblr\n","ctx":"float fadd(float,float);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fadd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fadd\n\n\nContents of section .text:\n 0000 ec21102a 4e800020 .!.*N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fadd' — lift: cannot lift 'fadd @0x0': unmodelled effect instruction 'fadds' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfadds f1,f1,f2 */\n/* 4:\tblr */\nvoid fadd(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fadd @0x0': unmodelled effect instruction 'fadds' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":10,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fadd @0x0': unmodelled effect instruction 'fadds' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fadd(f32 farg0, f32 farg1) {\n return farg0 + farg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fadd` — benchmark function synthetic:fadd:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fadd\n fadds f1,f1,f2\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fadd(float,float);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fadd # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fadd` — benchmark function synthetic:fadd:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fadd:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfadds f1,f1,f2\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fadd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fadd\n\n\nContents of section .text:\n 0000 ec21102a 4e800020 .!.*N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fadd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fcmp:agbcc","sym":"fcmp","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","compare"],"loc":1,"refSource":"int fcmp(float a,float b){ return a>b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfcmp\n\t.type\t fcmp,function\n\t.thumb_func\nfcmp:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tbl\t__gtsf2\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr4, #0x1\n.L3:\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fcmp,.Lfe1-fcmp\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 fcmp(void) {\n s32 v0;\n if (__gtsf2() <= 0) {\n v0 = 0;\n } else {\n v0 = 1;\n }\n return v0;\n}\n","score":8,"maxScore":11,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":1,"opMismatch":1,"argMismatch":3},"quality":{"score":100,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 __gtsf2(); /* extern */\n\ns32 fcmp(void) {\n s32 var_r4;\n\n var_r4 = 0;\n if (__gtsf2() > 0) {\n var_r4 = 1;\n }\n return var_r4;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fcmp` — benchmark function synthetic:fcmp:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfcmp\n\t.type\t fcmp,function\n\t.thumb_func\nfcmp:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tbl\t__gtsf2\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr4, #0x1\n.L3:\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fcmp,.Lfe1-fcmp\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fcmp` — benchmark function synthetic:fcmp:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fcmp:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfcmp\n\t.type\t fcmp,function\n\t.thumb_func\nfcmp:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tbl\t__gtsf2\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr4, #0x1\n.L3:\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fcmp,.Lfe1-fcmp\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fcmp # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fcmp:gcc2.7.2kmc","sym":"fcmp","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","compare"],"loc":1,"refSource":"int fcmp(float a,float b){ return a>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tc.lt.s\t$f14,$f12\n\t...\n c:\tbc1t\t18 \n 10:\tli\tv0,1\n 14:\tmove\tv0,zero\n 18:\tjr\tra\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a65615126cbb723e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 fcmp\n\n\nContents of section .text:\n 0000 460c703c 00000000 00000000 45010002 F.p<........E...\n 0010 24020001 00001021 03e00008 00000000 $......!........\nContents of section .reginfo:\n 0000 80000004 00000000 00005000 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fcmp' — lift: cannot lift 'fcmp': unmodelled control transfer 'bc1t' at 0xc — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tc.lt.s\t$f14,$f12 */\n/* \t... */\n/* c:\tbc1t\t18 */\n/* 10:\tli\tv0,1 */\n/* 14:\tmove\tv0,zero */\n/* 18:\tjr\tra */\n/* 1c:\tnop */\nvoid fcmp(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fcmp': unmodelled control transfer 'bc1t' at 0xc — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":15,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fcmp': unmodelled control transfer 'bc1t' at 0xc — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 fcmp(f32 arg0, f32 arg1) {\n s32 var_v0;\n\n var_v0 = 1;\n if (!(arg1 < arg0)) {\n var_v0 = 0;\n }\n return var_v0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fcmp` — benchmark function synthetic:fcmp:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fcmp\n c.lt.s\t$f14, $f12\n bc1t\t.L18\n li\t$v0, 1\n move\t$v0, $zero\n.L18:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fcmp` — benchmark function synthetic:fcmp:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fcmp:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tc.lt.s\t$f14,$f12\n\t...\n c:\tbc1t\t18 \n 10:\tli\tv0,1\n 14:\tmove\tv0,zero\n 18:\tjr\tra\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a65615126cbb723e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 fcmp\n\n\nContents of section .text:\n 0000 460c703c 00000000 00000000 45010002 F.p<........E...\n 0010 24020001 00001021 03e00008 00000000 $......!........\nContents of section .reginfo:\n 0000 80000004 00000000 00005000 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fcmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fcmp:ido7.1","sym":"fcmp","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","compare"],"loc":1,"refSource":"int fcmp(float a,float b){ return a>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tc.lt.s\t$f14,$f12\n 4:\tmove\tv0,zero\n 8:\tbc1f\t14 \n c:\tnop\n 10:\tli\tv0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c fcmp\n\n\nContents of section .text:\n 0000 460c703c 00001025 45000002 00000000 F.p<...%E.......\n 0010 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 80000004 00000000 . ..............\n 0010 00005000 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000004 00000000 00005000 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 36353631 35313236 63626237 ef-a65615126cbb7\n 0130 3233652f 7265662e 63006663 6d700000 23e/ref.c.fcmp..\n 0140 66636d70 00000000 00000000 00000001 fcmp............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fcmp' — lift: cannot lift 'fcmp': unmodelled control transfer 'bc1f' at 0x8 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tc.lt.s\t$f14,$f12 */\n/* 4:\tmove\tv0,zero */\n/* 8:\tbc1f\t14 */\n/* c:\tnop */\n/* 10:\tli\tv0,1 */\n/* 14:\tjr\tra */\n/* 18:\tnop */\n/* 1c:\tnop */\nvoid fcmp(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fcmp': unmodelled control transfer 'bc1f' at 0x8 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fcmp': unmodelled control transfer 'bc1f' at 0x8 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 fcmp(f32 arg0, f32 arg1) {\n s32 var_v0;\n\n var_v0 = 0;\n if (arg1 < arg0) {\n var_v0 = 1;\n }\n return var_v0;\n}\n","score":3,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":7,"ratio":0.42857142857142855,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fcmp` — benchmark function synthetic:fcmp:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fcmp\n c.lt.s\t$f14, $f12\n move\t$v0, $zero\n bc1f\t.L14\n nop\n li\t$v0, 1\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fcmp` — benchmark function synthetic:fcmp:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fcmp:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tc.lt.s\t$f14,$f12\n 4:\tmove\tv0,zero\n 8:\tbc1f\t14 \n c:\tnop\n 10:\tli\tv0,1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c fcmp\n\n\nContents of section .text:\n 0000 460c703c 00001025 45000002 00000000 F.p<...%E.......\n 0010 24020001 03e00008 00000000 00000000 $...............\nContents of section .options:\n 0000 01200000 00000000 80000004 00000000 . ..............\n 0010 00005000 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000004 00000000 00005000 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 36353631 35313236 63626237 ef-a65615126cbb7\n 0130 3233652f 7265662e 63006663 6d700000 23e/ref.c.fcmp..\n 0140 66636d70 00000000 00000000 00000001 fcmp............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fcmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fcmp:mwcc_242_81","sym":"fcmp","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","compare"],"loc":1,"refSource":"int fcmp(float a,float b){ return a>b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfcmpo cr0,f1,f2\n 4:\tmfcr r0\n 8:\trlwinm r3,r0,2,31,31\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 fcmp\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fcmp\n\n\nContents of section .text:\n 0000 fc011040 7c000026 540317fe 4e800020 ...@|..&T...N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fcmp' — lift: cannot lift 'fcmp @0x0': unmodelled effect instruction 'fcmpo' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfcmpo cr0,f1,f2 */\n/* 4:\tmfcr r0 */\n/* 8:\trlwinm r3,r0,2,31,31 */\n/* c:\tblr */\nvoid fcmp(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fcmp @0x0': unmodelled effect instruction 'fcmpo' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":12,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fcmp @0x0': unmodelled effect instruction 'fcmpo' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 fcmp(f32 farg0, f32 farg1) {\n return ((u32) M2C_ERROR(/* unknown instruction: mfcr $r0 */) >> 0x1EU) & 1;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":76,"lines":3,"gotos":0,"casts":1,"unkGlue":2,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_ERROR"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fcmp` — benchmark function synthetic:fcmp:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fcmp\n fcmpo cr0,f1,f2\n mfcr r0\n rlwinm r3,r0,2,31,31\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fcmp` — benchmark function synthetic:fcmp:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fcmp:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfcmpo cr0,f1,f2\n 4:\tmfcr r0\n 8:\trlwinm r3,r0,2,31,31\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 fcmp\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fcmp\n\n\nContents of section .text:\n 0000 fc011040 7c000026 540317fe 4e800020 ...@|..&T...N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fcmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fdiv:agbcc","sym":"fdiv","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fdiv(float a,float b){ return a/b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfdiv\n\t.type\t fdiv,function\n\t.thumb_func\nfdiv:\n\tpush\t{lr}\n\tbl\t__divsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fdiv,.Lfe1-fdiv\n","ctx":"float fdiv(float,float);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 fdiv(void) {\n return __divsf3();\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 __divsf3(); /* extern */\n\nf32 fdiv(f32 arg0, f32 arg1) {\n return (bitwise f32) __divsf3();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fdiv` — benchmark function synthetic:fdiv:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfdiv\n\t.type\t fdiv,function\n\t.thumb_func\nfdiv:\n\tpush\t{lr}\n\tbl\t__divsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fdiv,.Lfe1-fdiv\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fdiv(float,float);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fdiv # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fdiv` — benchmark function synthetic:fdiv:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fdiv:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfdiv\n\t.type\t fdiv,function\n\t.thumb_func\nfdiv:\n\tpush\t{lr}\n\tbl\t__divsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fdiv,.Lfe1-fdiv\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fdiv # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fdiv:gcc2.7.2kmc","sym":"fdiv","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fdiv(float a,float b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tdiv.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fdiv(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-241268db67a005de/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fdiv\n\n\nContents of section .text:\n 0000 03e00008 460e6003 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fdiv' — lift: cannot lift 'fdiv @0x4': unmodelled effect instruction 'div.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tdiv.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fdiv(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fdiv @0x4': unmodelled effect instruction 'div.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fdiv @0x4': unmodelled effect instruction 'div.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fdiv(f32 arg0, f32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fdiv` — benchmark function synthetic:fdiv:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fdiv\n jr\t$ra\n div.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fdiv(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fdiv # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fdiv` — benchmark function synthetic:fdiv:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fdiv:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tdiv.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-241268db67a005de/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fdiv\n\n\nContents of section .text:\n 0000 03e00008 460e6003 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fdiv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fdiv:ido7.1","sym":"fdiv","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fdiv(float a,float b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tdiv.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fdiv(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fdiv\n\n\nContents of section .text:\n 0000 03e00008 460e6003 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 34313236 38646236 37613030 ef-241268db67a00\n 0130 3564652f 7265662e 63006664 69760000 5de/ref.c.fdiv..\n 0140 66646976 00000000 00000000 00000001 fdiv............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fdiv' — lift: cannot lift 'fdiv @0x4': unmodelled effect instruction 'div.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tdiv.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fdiv(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fdiv @0x4': unmodelled effect instruction 'div.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fdiv @0x4': unmodelled effect instruction 'div.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fdiv(f32 arg0, f32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fdiv` — benchmark function synthetic:fdiv:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fdiv\n jr\t$ra\n div.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fdiv(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fdiv # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fdiv` — benchmark function synthetic:fdiv:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fdiv:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tdiv.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fdiv\n\n\nContents of section .text:\n 0000 03e00008 460e6003 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 34313236 38646236 37613030 ef-241268db67a00\n 0130 3564652f 7265662e 63006664 69760000 5de/ref.c.fdiv..\n 0140 66646976 00000000 00000000 00000001 fdiv............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fdiv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fdiv:mwcc_242_81","sym":"fdiv","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fdiv(float a,float b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfdivs f1,f1,f2\n 4:\tblr\n","ctx":"float fdiv(float,float);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fdiv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fdiv\n\n\nContents of section .text:\n 0000 ec211024 4e800020 .!.$N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fdiv' — lift: cannot lift 'fdiv @0x0': unmodelled effect instruction 'fdivs' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfdivs f1,f1,f2 */\n/* 4:\tblr */\nvoid fdiv(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fdiv @0x0': unmodelled effect instruction 'fdivs' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":10,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fdiv @0x0': unmodelled effect instruction 'fdivs' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fdiv(f32 farg0, f32 farg1) {\n return farg0 / farg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fdiv` — benchmark function synthetic:fdiv:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fdiv\n fdivs f1,f1,f2\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fdiv(float,float);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fdiv # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fdiv` — benchmark function synthetic:fdiv:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fdiv:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfdivs f1,f1,f2\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fdiv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fdiv\n\n\nContents of section .text:\n 0000 ec211024 4e800020 .!.$N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fdiv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fib:agbcc","sym":"fib","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for"],"loc":1,"refSource":"int fib(int n){ int a=0,b=1,i; for(i=0;i= a0) {\n v0 = 0;\n } else {\n v0 = 1;\n v1 = 0;\n v2 = a0;\n do {\n v2 = v2 - 1;\n t0 = v1;\n v1 = v0;\n v0 = t0 + v0;\n } while (v2 != 0);\n v0 = v1;\n }\n return v0;\n}\n","score":16,"maxScore":19,"compileErrors":null,"breakdown":{"insert":6,"delete":4,"replace":1,"opMismatch":1,"argMismatch":4},"quality":{"score":100,"lines":21,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 fib(s32 arg0) {\n s32 temp_r0;\n s32 var_r1;\n s32 var_r2;\n s32 var_r3;\n\n var_r3 = 0;\n var_r2 = 1;\n if (arg0 > 0) {\n var_r1 = arg0;\n do {\n temp_r0 = var_r3 + var_r2;\n var_r3 = var_r2;\n var_r2 = temp_r0;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n return var_r3;\n}\n","score":2,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":13,"ratio":0.15384615384615385,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fib` — benchmark function synthetic:fib:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfib\n\t.type\t fib,function\n\t.thumb_func\nfib:\n\tmov\tr3, #0x0\n\tmov\tr2, #0x1\n\tcmp\tr3, r0\n\tbge\t.L4\t@cond_branch\n\tadd\tr1, r0, #0\n.L6:\n\tadd\tr0, r3, r2\n\tadd\tr3, r2, #0\n\tadd\tr2, r0, #0\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t fib,.Lfe1-fib\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fib # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fib` — benchmark function synthetic:fib:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fib:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfib\n\t.type\t fib,function\n\t.thumb_func\nfib:\n\tmov\tr3, #0x0\n\tmov\tr2, #0x1\n\tcmp\tr3, r0\n\tbge\t.L4\t@cond_branch\n\tadd\tr1, r0, #0\n.L6:\n\tadd\tr0, r3, r2\n\tadd\tr3, r2, #0\n\tadd\tr2, r0, #0\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t fib,.Lfe1-fib\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fib # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fib:gcc2.7.2kmc","sym":"fib","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for"],"loc":1,"refSource":"int fib(int n){ int a=0,b=1,i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tli\ta2,1\n 8:\tmove\ta1,zero\n c:\tblez\ta0,30 \n 10:\tmove\tv1,zero\n 14:\taddu\tv0,v1,a2\n 18:\tmove\tv1,a2\n 1c:\tmove\ta2,v0\n 20:\taddiu\ta1,a1,1\n 24:\tslt\tv0,a1,a0\n 28:\tbnez\tv0,18 \n 2c:\taddu\tv0,v1,a2\n 30:\tmove\tv0,v1\n 34:\tjr\tra\n 38:\taddiu\tsp,sp,8\n 3c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a2c7f3f5c37567ff/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c fib\n\n\nContents of section .text:\n 0000 27bdfff8 24060001 00002821 18800008 '...$.....(!....\n 0010 00001821 00661021 00c01821 00403021 ...!.f.!...!.@0!\n 0020 24a50001 00a4102a 1440fffb 00661021 $......*.@...f.!\n 0030 00601021 03e00008 27bd0008 00000000 .`.!....'.......\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fib' — structure: cannot structure 'fib': do-while condition or a post-loop value reads a pre-update loop variable */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-8 */\n/* 4:\tli\ta2,1 */\n/* 8:\tmove\ta1,zero */\n/* c:\tblez\ta0,30 */\n/* 10:\tmove\tv1,zero */\n/* 14:\taddu\tv0,v1,a2 */\n/* 18:\tmove\tv1,a2 */\n/* 1c:\tmove\ta2,v0 */\n/* 20:\taddiu\ta1,a1,1 */\n/* 24:\tslt\tv0,a1,a0 */\n/* 28:\tbnez\tv0,18 */\n/* 2c:\taddu\tv0,v1,a2 */\n/* 30:\tmove\tv0,v1 */\n/* 34:\tjr\tra */\n/* 38:\taddiu\tsp,sp,8 */\n/* 3c:\tnop */\nvoid fib(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'fib': do-while condition or a post-loop value reads a pre-update loop variable\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":24,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'fib': do-while condition or a post-loop value reads a pre-update loop variable"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 fib(s32 arg0) {\n s32 var_a1;\n s32 var_a2;\n s32 var_v0;\n s32 var_v1;\n\n var_a2 = 1;\n var_a1 = 0;\n var_v1 = 0;\n if (arg0 > 0) {\n var_v0 = 1;\n do {\n var_v1 = var_a2;\n var_a2 = var_v0;\n var_a1 += 1;\n var_v0 = var_v1 + var_a2;\n } while (var_a1 < arg0);\n }\n return var_v1;\n}\n","score":9,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":2,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":19,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":9,"maxScore":15,"ratio":0.6,"kinds":{"insert":0,"delete":2,"replace":2,"opMismatch":0,"argMismatch":5}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fib` — benchmark function synthetic:fib:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fib\n addiu\t$sp, $sp, -8\n li\t$a2, 1\n move\t$a1, $zero\n blez\t$a0, .L30\n move\t$v1, $zero\n addu\t$v0, $v1, $a2\n.L18:\n move\t$v1, $a2\n move\t$a2, $v0\n addiu\t$a1, $a1, 1\n slt\t$v0, $a1, $a0\n bnez\t$v0, .L18\n addu\t$v0, $v1, $a2\n.L30:\n move\t$v0, $v1\n jr\t$ra\n addiu\t$sp, $sp, 8\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fib # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fib` — benchmark function synthetic:fib:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fib:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tli\ta2,1\n 8:\tmove\ta1,zero\n c:\tblez\ta0,30 \n 10:\tmove\tv1,zero\n 14:\taddu\tv0,v1,a2\n 18:\tmove\tv1,a2\n 1c:\tmove\ta2,v0\n 20:\taddiu\ta1,a1,1\n 24:\tslt\tv0,a1,a0\n 28:\tbnez\tv0,18 \n 2c:\taddu\tv0,v1,a2\n 30:\tmove\tv0,v1\n 34:\tjr\tra\n 38:\taddiu\tsp,sp,8\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a2c7f3f5c37567ff/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c fib\n\n\nContents of section .text:\n 0000 27bdfff8 24060001 00002821 18800008 '...$.....(!....\n 0010 00001821 00661021 00c01821 00403021 ...!.f.!...!.@0!\n 0020 24a50001 00a4102a 1440fffb 00661021 $......*.@...f.!\n 0030 00601021 03e00008 27bd0008 00000000 .`.!....'.......\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fib # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fib:ido7.1","sym":"fib","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for"],"loc":1,"refSource":"int fib(int n){ int a=0,b=1,i; for(i=0;i:\n 0:\tmove\tv1,zero\n 4:\tli\tv0,1\n 8:\tblez\ta0,6c \n c:\tmove\ta1,zero\n 10:\tandi\ta2,a0,0x3\n 14:\tbeqz\ta2,34 \n 18:\tmove\ta3,a2\n 1c:\taddu\ta2,v1,v0\n 20:\tmove\tv1,v0\n 24:\taddiu\ta1,a1,1\n 28:\tbne\ta3,a1,1c \n 2c:\tmove\tv0,a2\n 30:\tbeq\ta1,a0,6c \n 34:\taddu\ta2,v1,v0\n 38:\tmove\tv1,v0\n 3c:\tmove\tv0,a2\n 40:\taddu\ta2,v1,a2\n 44:\tmove\tv1,v0\n 48:\tmove\tv0,a2\n 4c:\taddu\ta2,v1,a2\n 50:\tmove\tv1,v0\n 54:\tmove\tv0,a2\n 58:\taddu\ta2,v1,a2\n 5c:\tmove\tv1,v0\n 60:\taddiu\ta1,a1,4\n 64:\tbne\ta1,a0,34 \n 68:\tmove\tv0,a2\n 6c:\tjr\tra\n 70:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000074 fib\n\n\nContents of section .text:\n 0000 00001825 24020001 18800018 00002825 ...%$.........(%\n 0010 30860003 10c00007 00c03825 00623021 0.........8%.b0!\n 0020 00401825 24a50001 14e5fffc 00c01025 .@.%$..........%\n 0030 10a4000e 00623021 00401825 00c01025 .....b0!.@.%...%\n 0040 00663021 00401825 00c01025 00663021 .f0!.@.%...%.f0!\n 0050 00401825 00c01025 00663021 00401825 .@.%...%.f0!.@.%\n 0060 24a50004 14a4fff3 00c01025 03e00008 $..........%....\n 0070 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 800000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001d 00000004 000001e8 p...............\n 0010 00000005 00000324 00000001 000001ec .......$........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000034 00000294 .......P...4....\n 0040 00000004 000002c8 00000001 000002cc ................\n 0050 00000000 00000000 00000001 00000314 ................\n 0060 08080801 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000074 20200001 00000001 .......t ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 32633766 33663563 33373536 ef-a2c7f3f5c3756\n 0130 3766662f 7265662e 63006669 62000000 7ff/ref.c.fib...\n 0140 66696200 00000000 00000001 00000000 fib.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 0000001d 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000004 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fib' — lift: cannot lift 'fib': branch to 0x34 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tli\tv0,1 */\n/* 8:\tblez\ta0,6c */\n/* c:\tmove\ta1,zero */\n/* 10:\tandi\ta2,a0,0x3 */\n/* 14:\tbeqz\ta2,34 */\n/* 18:\tmove\ta3,a2 */\n/* 1c:\taddu\ta2,v1,v0 */\n/* 20:\tmove\tv1,v0 */\n/* 24:\taddiu\ta1,a1,1 */\n/* 28:\tbne\ta3,a1,1c */\n/* 2c:\tmove\tv0,a2 */\n/* 30:\tbeq\ta1,a0,6c */\n/* 34:\taddu\ta2,v1,v0 */\n/* 38:\tmove\tv1,v0 */\n/* 3c:\tmove\tv0,a2 */\n/* 40:\taddu\ta2,v1,a2 */\n/* 44:\tmove\tv1,v0 */\n/* 48:\tmove\tv0,a2 */\n/* 4c:\taddu\ta2,v1,a2 */\n/* 50:\tmove\tv1,v0 */\n/* 54:\tmove\tv0,a2 */\n/* 58:\taddu\ta2,v1,a2 */\n/* 5c:\tmove\tv1,v0 */\n/* 60:\taddiu\ta1,a1,4 */\n/* 64:\tbne\ta1,a0,34 */\n/* 68:\tmove\tv0,a2 */\n/* 6c:\tjr\tra */\n/* 70:\tmove\tv0,v1 */\n/* \t... */\nvoid fib(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fib': branch to 0x34 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":38,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fib': branch to 0x34 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 fib(s32 arg0) {\n s32 temp_a2;\n s32 temp_a2_2;\n s32 temp_a2_3;\n s32 temp_a2_4;\n s32 temp_a2_5;\n s32 temp_a2_6;\n s32 var_a1;\n s32 var_v0;\n s32 var_v1;\n\n var_v1 = 0;\n var_v0 = 1;\n var_a1 = 0;\n if (arg0 > 0) {\n temp_a2 = arg0 & 3;\n if (temp_a2 != 0) {\n do {\n temp_a2_2 = var_v1 + var_v0;\n var_v1 = var_v0;\n var_a1 += 1;\n var_v0 = temp_a2_2;\n } while (temp_a2 != var_a1);\n if (var_a1 != arg0) {\n goto loop_4;\n }\n } else {\n do {\nloop_4:\n temp_a2_3 = var_v1 + var_v0;\n temp_a2_4 = var_v0 + temp_a2_3;\n temp_a2_5 = temp_a2_3 + temp_a2_4;\n temp_a2_6 = temp_a2_4 + temp_a2_5;\n var_v1 = temp_a2_5;\n var_a1 += 4;\n var_v0 = temp_a2_6;\n } while (var_a1 != arg0);\n }\n }\n return var_v1;\n}\n","score":26,"maxScore":39,"compileErrors":null,"breakdown":{"insert":10,"delete":0,"replace":0,"opMismatch":0,"argMismatch":16},"quality":{"score":88,"lines":40,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":26,"maxScore":39,"ratio":0.6666666666666666,"kinds":{"insert":10,"delete":0,"replace":0,"opMismatch":0,"argMismatch":16}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fib` — benchmark function synthetic:fib:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fib\n move\t$v1, $zero\n li\t$v0, 1\n blez\t$a0, .L6c\n move\t$a1, $zero\n andi\t$a2, $a0, 0x3\n beqz\t$a2, .L34\n move\t$a3, $a2\n.L1c:\n addu\t$a2, $v1, $v0\n move\t$v1, $v0\n addiu\t$a1, $a1, 1\n bne\t$a3, $a1, .L1c\n move\t$v0, $a2\n beq\t$a1, $a0, .L6c\n.L34:\n addu\t$a2, $v1, $v0\n move\t$v1, $v0\n move\t$v0, $a2\n addu\t$a2, $v1, $a2\n move\t$v1, $v0\n move\t$v0, $a2\n addu\t$a2, $v1, $a2\n move\t$v1, $v0\n move\t$v0, $a2\n addu\t$a2, $v1, $a2\n move\t$v1, $v0\n addiu\t$a1, $a1, 4\n bne\t$a1, $a0, .L34\n move\t$v0, $a2\n.L6c:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fib # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fib` — benchmark function synthetic:fib:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fib:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tli\tv0,1\n 8:\tblez\ta0,6c \n c:\tmove\ta1,zero\n 10:\tandi\ta2,a0,0x3\n 14:\tbeqz\ta2,34 \n 18:\tmove\ta3,a2\n 1c:\taddu\ta2,v1,v0\n 20:\tmove\tv1,v0\n 24:\taddiu\ta1,a1,1\n 28:\tbne\ta3,a1,1c \n 2c:\tmove\tv0,a2\n 30:\tbeq\ta1,a0,6c \n 34:\taddu\ta2,v1,v0\n 38:\tmove\tv1,v0\n 3c:\tmove\tv0,a2\n 40:\taddu\ta2,v1,a2\n 44:\tmove\tv1,v0\n 48:\tmove\tv0,a2\n 4c:\taddu\ta2,v1,a2\n 50:\tmove\tv1,v0\n 54:\tmove\tv0,a2\n 58:\taddu\ta2,v1,a2\n 5c:\tmove\tv1,v0\n 60:\taddiu\ta1,a1,4\n 64:\tbne\ta1,a0,34 \n 68:\tmove\tv0,a2\n 6c:\tjr\tra\n 70:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000074 fib\n\n\nContents of section .text:\n 0000 00001825 24020001 18800018 00002825 ...%$.........(%\n 0010 30860003 10c00007 00c03825 00623021 0.........8%.b0!\n 0020 00401825 24a50001 14e5fffc 00c01025 .@.%$..........%\n 0030 10a4000e 00623021 00401825 00c01025 .....b0!.@.%...%\n 0040 00663021 00401825 00c01025 00663021 .f0!.@.%...%.f0!\n 0050 00401825 00c01025 00663021 00401825 .@.%...%.f0!.@.%\n 0060 24a50004 14a4fff3 00c01025 03e00008 $..........%....\n 0070 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 800000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001d 00000004 000001e8 p...............\n 0010 00000005 00000324 00000001 000001ec .......$........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000034 00000294 .......P...4....\n 0040 00000004 000002c8 00000001 000002cc ................\n 0050 00000000 00000000 00000001 00000314 ................\n 0060 08080801 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000074 20200001 00000001 .......t ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 32633766 33663563 33373536 ef-a2c7f3f5c3756\n 0130 3766662f 7265662e 63006669 62000000 7ff/ref.c.fib...\n 0140 66696200 00000000 00000001 00000000 fib.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 0000001d 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000004 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fib # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fib:mwcc_242_81","sym":"fib","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for"],"loc":1,"refSource":"int fib(int n){ int a=0,b=1,i; for(i=0;i:\n 0:\tcmpwi r3,0\n 4:\tli r6,0\n 8:\tli r5,1\n c:\tli r7,0\n 10:\tble 7c \n 14:\tcmpwi r3,8\n 18:\taddi r4,r3,-8\n 1c:\tble 5c \n 20:\taddi r0,r4,7\n 24:\tsrwi r0,r0,3\n 28:\tmtctr r0\n 2c:\tcmpwi r4,0\n 30:\tble 5c \n 34:\tadd r4,r6,r5\n 38:\taddi r7,r7,8\n 3c:\tadd r0,r5,r4\n 40:\tadd r4,r4,r0\n 44:\tadd r0,r0,r4\n 48:\tadd r4,r4,r0\n 4c:\tadd r0,r0,r4\n 50:\tadd r6,r4,r0\n 54:\tadd r5,r0,r6\n 58:\tbdnz 34 \n 5c:\tsubf r0,r7,r3\n 60:\tmtctr r0\n 64:\tcmpw r7,r3\n 68:\tbge 7c \n 6c:\tadd r0,r6,r5\n 70:\tmr r6,r5\n 74:\tmr r5,r0\n 78:\tbdnz 6c \n 7c:\tmr r3,r6\n 80:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000084 fib\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fib\n\n\nContents of section .text:\n 0000 2c030000 38c00000 38a00001 38e00000 ,...8...8...8...\n 0010 4081006c 2c030008 3883fff8 40810040 @..l,...8...@..@\n 0020 38040007 5400e8fe 7c0903a6 2c040000 8...T...|...,...\n 0030 4081002c 7c862a14 38e70008 7c052214 @..,|.*.8...|.\".\n 0040 7c840214 7c002214 7c840214 7c002214 |...|.\".|...|.\".\n 0050 7cc40214 7ca03214 4200ffdc 7c071850 |...|.2.B...|..P\n 0060 7c0903a6 7c071800 40800014 7c062a14 |...|...@...|.*.\n 0070 7ca62b78 7c050378 4200fff4 7cc33378 |.+x|..xB...|.3x\n 0080 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000084 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 fib(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n s32 v6;\n s32 t0;\n s32 t1;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n if (a0 <= 8) {\n v2 = 0;\n v0 = 0;\n v1 = 1;\n } else {\n v0 = 0;\n v1 = 1;\n v2 = 0;\n v3 = a0 + -8 + 7 >> 3;\n while (v3 != 0) {\n v2 = v2 + 8;\n v3 = v3 - 1;\n t0 = v0;\n v0 = v0 + v1 + (v1 + (v0 + v1)) + (v1 + (v0 + v1) + (v0 + v1 + (v1 + (v0 + v1)))) + (v1 + (v0 + v1) + (v0 + v1 + (v1 + (v0 + v1))) + (v0 + v1 + (v1 + (v0 + v1)) + (v1 + (v0 + v1) + (v0 + v1 + (v1 + (v0 + v1))))));\n v1 = v1 + (t0 + v1) + (t0 + v1 + (v1 + (t0 + v1))) + (t0 + v1 + (v1 + (t0 + v1)) + (v1 + (t0 + v1) + (t0 + v1 + (v1 + (t0 + v1))))) + (t0 + v1 + (v1 + (t0 + v1)) + (v1 + (t0 + v1) + (t0 + v1 + (v1 + (t0 + v1)))) + (v1 + (t0 + v1) + (t0 + v1 + (v1 + (t0 + v1))) + (t0 + v1 + (v1 + (t0 + v1)) + (v1 + (t0 + v1) + (t0 + v1 + (v1 + (t0 + v1)))))));\n }\n }\n v4 = v0;\n v5 = v1;\n v6 = a0 - v2;\n while (v6 != 0) {\n v6 = v6 - 1;\n t1 = v4;\n v4 = v5;\n v5 = t1 + v5;\n }\n v0 = v4;\n }\n return v0;\n}\n","score":129,"maxScore":133,"compileErrors":null,"breakdown":{"insert":100,"delete":4,"replace":4,"opMismatch":4,"argMismatch":17},"quality":{"score":100,"lines":43,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 fib(s32 arg0) {\n s32 temp_r0;\n s32 temp_r0_2;\n s32 temp_r0_3;\n s32 temp_r0_4;\n s32 temp_r4;\n s32 temp_r4_2;\n s32 temp_r4_3;\n s32 temp_r4_4;\n s32 var_ctr_2;\n s32 var_r5;\n s32 var_r6;\n s32 var_r7;\n u32 var_ctr;\n\n var_r6 = 0;\n var_r5 = 1;\n var_r7 = 0;\n if (arg0 > 0) {\n temp_r4 = arg0 - 8;\n if (arg0 > 8) {\n var_ctr = (u32) (temp_r4 + 7) >> 3U;\n if (temp_r4 > 0) {\n do {\n temp_r4_2 = var_r6 + var_r5;\n var_r7 += 8;\n temp_r0 = var_r5 + temp_r4_2;\n temp_r4_3 = temp_r4_2 + temp_r0;\n temp_r0_2 = temp_r0 + temp_r4_3;\n temp_r4_4 = temp_r4_3 + temp_r0_2;\n temp_r0_3 = temp_r0_2 + temp_r4_4;\n var_r6 = temp_r4_4 + temp_r0_3;\n var_r5 = temp_r0_3 + var_r6;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_ctr_2 = arg0 - var_r7;\n if (var_r7 < arg0) {\n do {\n temp_r0_4 = var_r6 + var_r5;\n var_r6 = var_r5;\n var_r5 = temp_r0_4;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r6;\n}\n","score":15,"maxScore":38,"compileErrors":null,"breakdown":{"insert":5,"delete":5,"replace":0,"opMismatch":2,"argMismatch":3},"quality":{"score":100,"lines":48,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":15,"maxScore":38,"ratio":0.39473684210526316,"kinds":{"insert":5,"delete":5,"replace":0,"opMismatch":2,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fib` — benchmark function synthetic:fib:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fib\n cmpwi r3,0\n li r6,0\n li r5,1\n li r7,0\n ble .L7c\n cmpwi r3,8\n addi r4,r3,-8\n ble .L5c\n addi r0,r4,7\n srwi r0,r0,3\n mtctr r0\n cmpwi r4,0\n ble .L5c\n.L34:\n add r4,r6,r5\n addi r7,r7,8\n add r0,r5,r4\n add r4,r4,r0\n add r0,r0,r4\n add r4,r4,r0\n add r0,r0,r4\n add r6,r4,r0\n add r5,r0,r6\n bdnz .L34\n.L5c:\n subf r0,r7,r3\n mtctr r0\n cmpw r7,r3\n bge .L7c\n.L6c:\n add r0,r6,r5\n mr r6,r5\n mr r5,r0\n bdnz .L6c\n.L7c:\n mr r3,r6\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fib # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fib` — benchmark function synthetic:fib:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fib:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r6,0\n 8:\tli r5,1\n c:\tli r7,0\n 10:\tble 7c \n 14:\tcmpwi r3,8\n 18:\taddi r4,r3,-8\n 1c:\tble 5c \n 20:\taddi r0,r4,7\n 24:\tsrwi r0,r0,3\n 28:\tmtctr r0\n 2c:\tcmpwi r4,0\n 30:\tble 5c \n 34:\tadd r4,r6,r5\n 38:\taddi r7,r7,8\n 3c:\tadd r0,r5,r4\n 40:\tadd r4,r4,r0\n 44:\tadd r0,r0,r4\n 48:\tadd r4,r4,r0\n 4c:\tadd r0,r0,r4\n 50:\tadd r6,r4,r0\n 54:\tadd r5,r0,r6\n 58:\tbdnz 34 \n 5c:\tsubf r0,r7,r3\n 60:\tmtctr r0\n 64:\tcmpw r7,r3\n 68:\tbge 7c \n 6c:\tadd r0,r6,r5\n 70:\tmr r6,r5\n 74:\tmr r5,r0\n 78:\tbdnz 6c \n 7c:\tmr r3,r6\n 80:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000084 fib\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fib\n\n\nContents of section .text:\n 0000 2c030000 38c00000 38a00001 38e00000 ,...8...8...8...\n 0010 4081006c 2c030008 3883fff8 40810040 @..l,...8...@..@\n 0020 38040007 5400e8fe 7c0903a6 2c040000 8...T...|...,...\n 0030 4081002c 7c862a14 38e70008 7c052214 @..,|.*.8...|.\".\n 0040 7c840214 7c002214 7c840214 7c002214 |...|.\".|...|.\".\n 0050 7cc40214 7ca03214 4200ffdc 7c071850 |...|.2.B...|..P\n 0060 7c0903a6 7c071800 40800014 7c062a14 |...|...@...|.*.\n 0070 7ca62b78 7c050378 4200fff4 7cc33378 |.+x|..xB...|.3x\n 0080 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000084 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fib # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:findfirst:agbcc","sym":"findfirst","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for","branch","memory"],"loc":1,"refSource":"int findfirst(int *a,int n,int t){ int i; for(i=0;i= a1) return -1;\n }\n return v1;\n } else {\n return -1;\n }\n}\n","score":14,"maxScore":26,"compileErrors":null,"breakdown":{"insert":6,"delete":5,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 findfirst(s32 *arg0, s32 arg1, s32 arg2) {\n s32 *var_r3;\n s32 var_r1;\n\n var_r1 = 0;\n if (arg1 > 0) {\n var_r3 = arg0;\nloop_2:\n if (*var_r3 == arg2) {\n return var_r1;\n }\n var_r3 += 4;\n var_r1 += 1;\n if (var_r1 >= arg1) {\n goto block_5;\n }\n goto loop_2;\n }\nblock_5:\n return -1;\n}\n","score":3,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":76,"lines":20,"gotos":2,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":20,"ratio":0.15,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `findfirst` — benchmark function synthetic:findfirst:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfindfirst\n\t.type\t findfirst,function\n\t.thumb_func\nfindfirst:\n\tpush\t{r4, lr}\n\tadd\tr4, r1, #0\n\tmov\tr1, #0x0\n\tcmp\tr1, r4\n\tbge\t.L4\t@cond_branch\n\tadd\tr3, r0, #0\n.L6:\n\tldr\tr0, [r3]\n\tcmp\tr0, r2\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L9\n.L5:\n\tadd\tr3, r3, #0x4\n\tadd\tr1, r1, #0x1\n\tcmp\tr1, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L9:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t findfirst,.Lfe1-findfirst\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function findfirst # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `findfirst` — benchmark function synthetic:findfirst:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:findfirst:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfindfirst\n\t.type\t findfirst,function\n\t.thumb_func\nfindfirst:\n\tpush\t{r4, lr}\n\tadd\tr4, r1, #0\n\tmov\tr1, #0x0\n\tcmp\tr1, r4\n\tbge\t.L4\t@cond_branch\n\tadd\tr3, r0, #0\n.L6:\n\tldr\tr0, [r3]\n\tcmp\tr0, r2\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r1, #0\n\tb\t.L9\n.L5:\n\tadd\tr3, r3, #0x4\n\tadd\tr1, r1, #0x1\n\tcmp\tr1, r4\n\tblt\t.L6\t@cond_branch\n.L4:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L9:\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t findfirst,.Lfe1-findfirst\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name findfirst # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:findfirst:gcc2.7.2kmc","sym":"findfirst","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for","branch","memory"],"loc":1,"refSource":"int findfirst(int *a,int n,int t){ int i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tblez\ta1,2c \n 8:\tmove\tv1,zero\n c:\tlw\tv0,0(a0)\n 10:\tbnel\tv0,a2,20 \n 14:\taddiu\tv1,v1,1\n 18:\tj\t30 \n 1c:\tmove\tv0,v1\n 20:\tslt\tv0,v1,a1\n 24:\tbnez\tv0,c \n 28:\taddiu\ta0,a0,4\n 2c:\tli\tv0,-1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d8b1ef9fc32f0ac8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 findfirst\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdfff8 18a00009 00001821 8c820000 '..........!....\n 0010 54460003 24630001 0800000c 00601021 TF..$c.......`.!\n 0020 0065102a 1440fff9 24840004 2402ffff .e.*.@..$...$...\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'findfirst' — lift: cannot lift 'findfirst': unmodelled control transfer 'bnel' at 0x10 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-8 */\n/* 4:\tblez\ta1,2c */\n/* 8:\tmove\tv1,zero */\n/* c:\tlw\tv0,0(a0) */\n/* 10:\tbnel\tv0,a2,20 */\n/* 14:\taddiu\tv1,v1,1 */\n/* 18:\tj\t30 */\n/* 1c:\tmove\tv0,v1 */\n/* 20:\tslt\tv0,v1,a1 */\n/* 24:\tbnez\tv0,c */\n/* 28:\taddiu\ta0,a0,4 */\n/* 2c:\tli\tv0,-1 */\n/* 30:\tjr\tra */\n/* 34:\taddiu\tsp,sp,8 */\n/* \t... */\nvoid findfirst(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'findfirst': unmodelled control transfer 'bnel' at 0x10 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'findfirst': unmodelled control transfer 'bnel' at 0x10 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 findfirst(s32 *arg0, s32 arg1, s32 arg2) {\n s32 *var_a0;\n s32 var_v1;\n\n var_a0 = arg0;\n var_v1 = 0;\n if (arg1 > 0) {\nloop_1:\n if (*var_a0 != arg2) {\n var_v1 += 1;\n var_a0 += 4;\n if (var_v1 >= arg1) {\n goto block_6;\n }\n goto loop_1;\n }\n return var_v1;\n }\nblock_6:\n return -1;\n}\n","score":7,"maxScore":15,"compileErrors":null,"breakdown":{"insert":1,"delete":3,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":76,"lines":20,"gotos":2,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":7,"maxScore":15,"ratio":0.4666666666666667,"kinds":{"insert":1,"delete":3,"replace":2,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `findfirst` — benchmark function synthetic:findfirst:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel findfirst\n addiu\t$sp, $sp, -8\n blez\t$a1, .L2c\n move\t$v1, $zero\n.Lc:\n lw\t$v0, 0($a0)\n bnel\t$v0, $a2, .L20\n addiu\t$v1, $v1, 1\n j\t.L30\n move\t$v0, $v1\n.L20:\n slt\t$v0, $v1, $a1\n bnez\t$v0, .Lc\n addiu\t$a0, $a0, 4\n.L2c:\n li\t$v0, -1\n.L30:\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function findfirst # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `findfirst` — benchmark function synthetic:findfirst:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:findfirst:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tblez\ta1,2c \n 8:\tmove\tv1,zero\n c:\tlw\tv0,0(a0)\n 10:\tbnel\tv0,a2,20 \n 14:\taddiu\tv1,v1,1\n 18:\tj\t30 \n 1c:\tmove\tv0,v1\n 20:\tslt\tv0,v1,a1\n 24:\tbnez\tv0,c \n 28:\taddiu\ta0,a0,4\n 2c:\tli\tv0,-1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d8b1ef9fc32f0ac8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 findfirst\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 27bdfff8 18a00009 00001821 8c820000 '..........!....\n 0010 54460003 24630001 0800000c 00601021 TF..$c.......`.!\n 0020 0065102a 1440fff9 24840004 2402ffff .e.*.@..$...$...\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name findfirst # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:findfirst:ido7.1","sym":"findfirst","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for","branch","memory"],"loc":1,"refSource":"int findfirst(int *a,int n,int t){ int i; for(i=0;i:\n 0:\tblez\ta1,a4 \n 4:\tmove\tv1,zero\n 8:\tandi\tt0,a1,0x3\n c:\tbeqz\tt0,40 \n 10:\tmove\ta3,t0\n 14:\tsll\tt6,zero,0x2\n 18:\taddu\tv0,a0,t6\n 1c:\tlw\tt7,0(v0)\n 20:\tbnel\ta2,t7,34 \n 24:\taddiu\tv1,v1,1\n 28:\tjr\tra\n 2c:\tmove\tv0,v1\n 30:\taddiu\tv1,v1,1\n 34:\tbne\ta3,v1,1c \n 38:\taddiu\tv0,v0,4\n 3c:\tbeq\tv1,a1,a4 \n 40:\tsll\tt8,v1,0x2\n 44:\taddu\tv0,a0,t8\n 48:\tlw\tt9,0(v0)\n 4c:\tbnel\ta2,t9,60 \n 50:\tlw\tt1,4(v0)\n 54:\tjr\tra\n 58:\tmove\tv0,v1\n 5c:\tlw\tt1,4(v0)\n 60:\tbnel\ta2,t1,74 \n 64:\tlw\tt2,8(v0)\n 68:\tjr\tra\n 6c:\taddiu\tv0,v1,1\n 70:\tlw\tt2,8(v0)\n 74:\tbnel\ta2,t2,88 \n 78:\tlw\tt3,12(v0)\n 7c:\tjr\tra\n 80:\taddiu\tv0,v1,2\n 84:\tlw\tt3,12(v0)\n 88:\tbnel\ta2,t3,9c \n 8c:\taddiu\tv1,v1,4\n 90:\tjr\tra\n 94:\taddiu\tv0,v1,3\n 98:\taddiu\tv1,v1,4\n 9c:\tbne\tv1,a1,48 \n a0:\taddiu\tv0,v0,16\n a4:\tli\tv0,-1\n a8:\tjr\tra\n ac:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000b0 findfirst\n\n\nContents of section .text:\n 0000 18a00028 00001825 30a80003 1100000c ...(...%0.......\n 0010 01003825 00007080 008e1021 8c4f0000 ..8%..p....!.O..\n 0020 54cf0004 24630001 03e00008 00601025 T...$c.......`.%\n 0030 24630001 14e3fff9 24420004 10650019 $c......$B...e..\n 0040 0003c080 00981021 8c590000 54d90004 .......!.Y..T...\n 0050 8c490004 03e00008 00601025 8c490004 .I.......`.%.I..\n 0060 54c90004 8c4a0008 03e00008 24620001 T....J......$b..\n 0070 8c4a0008 54ca0004 8c4b000c 03e00008 .J..T....K......\n 0080 24620002 8c4b000c 54cb0004 24630004 $b...K..T...$c..\n 0090 03e00008 24620003 24630004 1465ffea ....$b..$c...e..\n 00a0 24420010 2402ffff 03e00008 00000000 $B..$...........\nContents of section .options:\n 0000 01200000 00000000 8300cffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300cffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002c 00000008 00000218 p......,........\n 0010 00000005 00000364 00000001 00000220 .......d....... \n 0020 00000004 00000254 00000000 00000000 .......T........\n 0030 00000011 00000284 00000038 000002c8 ...........8....\n 0040 0000000c 00000300 00000001 0000030c ................\n 0050 00000000 00000000 00000001 00000354 ...............T\n 0060 08080808 07000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000b0 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d64 38623165 66396663 ps-ref-d8b1ef9fc\n 0130 33326630 6163382f 7265662e 63006669 32f0ac8/ref.c.fi\n 0140 6e646669 72737400 66696e64 66697273 ndfirst.findfirs\n 0150 74000000 00000000 00000001 00000000 t...............\n 0160 00000038 00000000 00000004 00000000 ...8............\n 0170 0000002c 00000000 00000000 00000001 ...,............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000005 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'findfirst' — lift: cannot lift 'findfirst': unmodelled control transfer 'bnel' at 0x20 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tblez\ta1,a4 */\n/* 4:\tmove\tv1,zero */\n/* 8:\tandi\tt0,a1,0x3 */\n/* c:\tbeqz\tt0,40 */\n/* 10:\tmove\ta3,t0 */\n/* 14:\tsll\tt6,zero,0x2 */\n/* 18:\taddu\tv0,a0,t6 */\n/* 1c:\tlw\tt7,0(v0) */\n/* 20:\tbnel\ta2,t7,34 */\n/* 24:\taddiu\tv1,v1,1 */\n/* 28:\tjr\tra */\n/* 2c:\tmove\tv0,v1 */\n/* 30:\taddiu\tv1,v1,1 */\n/* 34:\tbne\ta3,v1,1c */\n/* 38:\taddiu\tv0,v0,4 */\n/* 3c:\tbeq\tv1,a1,a4 */\n/* 40:\tsll\tt8,v1,0x2 */\n/* 44:\taddu\tv0,a0,t8 */\n/* 48:\tlw\tt9,0(v0) */\n/* 4c:\tbnel\ta2,t9,60 */\n/* 50:\tlw\tt1,4(v0) */\n/* 54:\tjr\tra */\n/* 58:\tmove\tv0,v1 */\n/* 5c:\tlw\tt1,4(v0) */\n/* 60:\tbnel\ta2,t1,74 */\n/* 64:\tlw\tt2,8(v0) */\n/* 68:\tjr\tra */\n/* 6c:\taddiu\tv0,v1,1 */\n/* 70:\tlw\tt2,8(v0) */\n/* 74:\tbnel\ta2,t2,88 */\n/* 78:\tlw\tt3,12(v0) */\n/* 7c:\tjr\tra */\n/* 80:\taddiu\tv0,v1,2 */\n/* 84:\tlw\tt3,12(v0) */\n/* 88:\tbnel\ta2,t3,9c */\n/* 8c:\taddiu\tv1,v1,4 */\n/* 90:\tjr\tra */\n/* 94:\taddiu\tv0,v1,3 */\n/* 98:\taddiu\tv1,v1,4 */\n/* 9c:\tbne\tv1,a1,48 */\n/* a0:\taddiu\tv0,v0,16 */\n/* a4:\tli\tv0,-1 */\n/* a8:\tjr\tra */\n/* ac:\tnop */\nvoid findfirst(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'findfirst': unmodelled control transfer 'bnel' at 0x20 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":52,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'findfirst': unmodelled control transfer 'bnel' at 0x20 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 findfirst(s32 arg0, s32 arg1, s32 arg2) {\n s32 *var_v0;\n s32 temp_t0;\n s32 var_v1;\n void *var_v0_2;\n\n var_v1 = 0;\n if (arg1 > 0) {\n temp_t0 = arg1 & 3;\n if (temp_t0 != 0) {\n var_v0 = arg0 + (0 * 4);\nloop_3:\n if (arg2 == *var_v0) {\n return var_v1;\n }\n var_v1 += 1;\n var_v0 += 4;\n if (temp_t0 == var_v1) {\n if (var_v1 != arg1) {\n goto block_7;\n }\n /* Duplicate return node #17. Try simplifying control flow for better match */\n return -1;\n }\n goto loop_3;\n }\nblock_7:\n var_v0_2 = arg0 + (var_v1 * 4);\nloop_8:\n if (arg2 == var_v0_2->unk0) {\n return var_v1;\n }\n if (arg2 == var_v0_2->unk4) {\n return var_v1 + 1;\n }\n if (arg2 == var_v0_2->unk8) {\n return var_v1 + 2;\n }\n if (arg2 == var_v0_2->unkC) {\n return var_v1 + 3;\n }\n var_v1 += 4;\n var_v0_2 += 0x10;\n if (var_v1 == arg1) {\n /* Duplicate return node #17. Try simplifying control flow for better match */\n return -1;\n }\n goto loop_8;\n }\n return -1;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":64,"lines":50,"gotos":3,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 31: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 34: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 37: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 40: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 44: Bad operand type for += or -="]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `findfirst` — benchmark function synthetic:findfirst:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel findfirst\n blez\t$a1, .La4\n move\t$v1, $zero\n andi\t$t0, $a1, 0x3\n beqz\t$t0, .L40\n move\t$a3, $t0\n sll\t$t6, $zero, 0x2\n addu\t$v0, $a0, $t6\n.L1c:\n lw\t$t7, 0($v0)\n bnel\t$a2, $t7, .L34\n addiu\t$v1, $v1, 1\n jr\t$ra\n move\t$v0, $v1\n addiu\t$v1, $v1, 1\n.L34:\n bne\t$a3, $v1, .L1c\n addiu\t$v0, $v0, 4\n beq\t$v1, $a1, .La4\n.L40:\n sll\t$t8, $v1, 0x2\n addu\t$v0, $a0, $t8\n.L48:\n lw\t$t9, 0($v0)\n bnel\t$a2, $t9, .L60\n lw\t$t1, 4($v0)\n jr\t$ra\n move\t$v0, $v1\n lw\t$t1, 4($v0)\n.L60:\n bnel\t$a2, $t1, .L74\n lw\t$t2, 8($v0)\n jr\t$ra\n addiu\t$v0, $v1, 1\n lw\t$t2, 8($v0)\n.L74:\n bnel\t$a2, $t2, .L88\n lw\t$t3, 12($v0)\n jr\t$ra\n addiu\t$v0, $v1, 2\n lw\t$t3, 12($v0)\n.L88:\n bnel\t$a2, $t3, .L9c\n addiu\t$v1, $v1, 4\n jr\t$ra\n addiu\t$v0, $v1, 3\n addiu\t$v1, $v1, 4\n.L9c:\n bne\t$v1, $a1, .L48\n addiu\t$v0, $v0, 16\n.La4:\n li\t$v0, -1\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function findfirst # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `findfirst` — benchmark function synthetic:findfirst:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:findfirst:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta1,a4 \n 4:\tmove\tv1,zero\n 8:\tandi\tt0,a1,0x3\n c:\tbeqz\tt0,40 \n 10:\tmove\ta3,t0\n 14:\tsll\tt6,zero,0x2\n 18:\taddu\tv0,a0,t6\n 1c:\tlw\tt7,0(v0)\n 20:\tbnel\ta2,t7,34 \n 24:\taddiu\tv1,v1,1\n 28:\tjr\tra\n 2c:\tmove\tv0,v1\n 30:\taddiu\tv1,v1,1\n 34:\tbne\ta3,v1,1c \n 38:\taddiu\tv0,v0,4\n 3c:\tbeq\tv1,a1,a4 \n 40:\tsll\tt8,v1,0x2\n 44:\taddu\tv0,a0,t8\n 48:\tlw\tt9,0(v0)\n 4c:\tbnel\ta2,t9,60 \n 50:\tlw\tt1,4(v0)\n 54:\tjr\tra\n 58:\tmove\tv0,v1\n 5c:\tlw\tt1,4(v0)\n 60:\tbnel\ta2,t1,74 \n 64:\tlw\tt2,8(v0)\n 68:\tjr\tra\n 6c:\taddiu\tv0,v1,1\n 70:\tlw\tt2,8(v0)\n 74:\tbnel\ta2,t2,88 \n 78:\tlw\tt3,12(v0)\n 7c:\tjr\tra\n 80:\taddiu\tv0,v1,2\n 84:\tlw\tt3,12(v0)\n 88:\tbnel\ta2,t3,9c \n 8c:\taddiu\tv1,v1,4\n 90:\tjr\tra\n 94:\taddiu\tv0,v1,3\n 98:\taddiu\tv1,v1,4\n 9c:\tbne\tv1,a1,48 \n a0:\taddiu\tv0,v0,16\n a4:\tli\tv0,-1\n a8:\tjr\tra\n ac:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000b0 findfirst\n\n\nContents of section .text:\n 0000 18a00028 00001825 30a80003 1100000c ...(...%0.......\n 0010 01003825 00007080 008e1021 8c4f0000 ..8%..p....!.O..\n 0020 54cf0004 24630001 03e00008 00601025 T...$c.......`.%\n 0030 24630001 14e3fff9 24420004 10650019 $c......$B...e..\n 0040 0003c080 00981021 8c590000 54d90004 .......!.Y..T...\n 0050 8c490004 03e00008 00601025 8c490004 .I.......`.%.I..\n 0060 54c90004 8c4a0008 03e00008 24620001 T....J......$b..\n 0070 8c4a0008 54ca0004 8c4b000c 03e00008 .J..T....K......\n 0080 24620002 8c4b000c 54cb0004 24630004 $b...K..T...$c..\n 0090 03e00008 24620003 24630004 1465ffea ....$b..$c...e..\n 00a0 24420010 2402ffff 03e00008 00000000 $B..$...........\nContents of section .options:\n 0000 01200000 00000000 8300cffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300cffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000002c 00000008 00000218 p......,........\n 0010 00000005 00000364 00000001 00000220 .......d....... \n 0020 00000004 00000254 00000000 00000000 .......T........\n 0030 00000011 00000284 00000038 000002c8 ...........8....\n 0040 0000000c 00000300 00000001 0000030c ................\n 0050 00000000 00000000 00000001 00000354 ...............T\n 0060 08080808 07000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000b0 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d64 38623165 66396663 ps-ref-d8b1ef9fc\n 0130 33326630 6163382f 7265662e 63006669 32f0ac8/ref.c.fi\n 0140 6e646669 72737400 66696e64 66697273 ndfirst.findfirs\n 0150 74000000 00000000 00000001 00000000 t...............\n 0160 00000038 00000000 00000004 00000000 ...8............\n 0170 0000002c 00000000 00000000 00000001 ...,............\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000005 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 7fffffff 00000000 00000000 ................\n 01d0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name findfirst # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:findfirst:mwcc_242_81","sym":"findfirst","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for","branch","memory"],"loc":1,"refSource":"int findfirst(int *a,int n,int t){ int i; for(i=0;i:\n 0:\tli r6,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 30 \n 10:\tlwz r0,0(r3)\n 14:\tcmpw r5,r0\n 18:\tbne 24 \n 1c:\tmr r3,r6\n 20:\tblr\n 24:\taddi r3,r3,4\n 28:\taddi r6,r6,1\n 2c:\tbdnz 10 \n 30:\tli r3,-1\n 34:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000038 findfirst\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 findfirst\n\n\nContents of section .text:\n 0000 38c00000 7c8903a6 2c040000 40810024 8...|...,...@..$\n 0010 80030000 7c050000 4082000c 7cc33378 ....|...@...|.3x\n 0020 4e800020 38630004 38c60001 4200ffe4 N.. 8c..8...B...\n 0030 3860ffff 4e800020 8`..N.. \nContents of section .mwcats.text:\n 0000 02000038 00000000 ...8.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 findfirst(s32 * a0, s32 a1, s32 a2) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 > 0) {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n while (a2 != *v0) {\n v0 = v0 + 1;\n v1 = v1 + 1;\n v2 = v2 - 1;\n if (v2 == 0) return -1;\n }\n return v1;\n } else {\n return -1;\n }\n}\n","score":16,"maxScore":22,"compileErrors":null,"breakdown":{"insert":8,"delete":5,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":19,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 findfirst(s32 *arg0, s32 arg1, s32 arg2) {\n s32 *var_r3;\n s32 var_ctr;\n s32 var_r6;\n\n var_r3 = arg0;\n var_r6 = 0;\n var_ctr = arg1;\n if (arg1 > 0) {\nloop_1:\n if (arg2 == (s32) *var_r3) {\n return var_r6;\n }\n var_r3 += 4;\n var_r6 += 1;\n var_ctr -= 1;\n if (var_ctr == 0) {\n /* Duplicate return node #4. Try simplifying control flow for better match */\n return -1;\n }\n goto loop_1;\n }\n return -1;\n}\n","score":9,"maxScore":18,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":88,"lines":23,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":9,"maxScore":18,"ratio":0.5,"kinds":{"insert":4,"delete":2,"replace":0,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `findfirst` — benchmark function synthetic:findfirst:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel findfirst\n li r6,0\n mtctr r4\n cmpwi r4,0\n ble .L30\n.L10:\n lwz r0,0(r3)\n cmpw r5,r0\n bne .L24\n mr r3,r6\n blr\n.L24:\n addi r3,r3,4\n addi r6,r6,1\n bdnz .L10\n.L30:\n li r3,-1\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function findfirst # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `findfirst` — benchmark function synthetic:findfirst:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:findfirst:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r6,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 30 \n 10:\tlwz r0,0(r3)\n 14:\tcmpw r5,r0\n 18:\tbne 24 \n 1c:\tmr r3,r6\n 20:\tblr\n 24:\taddi r3,r3,4\n 28:\taddi r6,r6,1\n 2c:\tbdnz 10 \n 30:\tli r3,-1\n 34:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000038 findfirst\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 findfirst\n\n\nContents of section .text:\n 0000 38c00000 7c8903a6 2c040000 40810024 8...|...,...@..$\n 0010 80030000 7c050000 4082000c 7cc33378 ....|...@...|.3x\n 0020 4e800020 38630004 38c60001 4200ffe4 N.. 8c..8...B...\n 0030 3860ffff 4e800020 8`..N.. \nContents of section .mwcats.text:\n 0000 02000038 00000000 ...8.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name findfirst # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fma1:agbcc","sym":"fma1","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","arithmetic","expr"],"loc":1,"refSource":"float fma1(float a,float b,float c){ return a*b+c; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfma1\n\t.type\t fma1,function\n\t.thumb_func\nfma1:\n\tpush\t{r4, lr}\n\tadd\tr4, r2, #0\n\tbl\t__mulsf3\n\tadd\tr1, r4, #0\n\tbl\t__addsf3\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fma1,.Lfe1-fma1\n","ctx":"float fma1(float,float,float);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 fma1(u32 a0) {\n return __addsf3(__mulsf3(), a0, a0);\n}\n","score":2,"maxScore":9,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 __addsf3(s32, f32); /* extern */\ns32 __mulsf3(); /* extern */\n\nf32 fma1(f32 arg0, f32 arg1, f32 arg2) {\n return (bitwise f32) __addsf3(__mulsf3(), arg2);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C bitwise cast"]},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":9,"ratio":0.2222222222222222,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fma1` — benchmark function synthetic:fma1:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfma1\n\t.type\t fma1,function\n\t.thumb_func\nfma1:\n\tpush\t{r4, lr}\n\tadd\tr4, r2, #0\n\tbl\t__mulsf3\n\tadd\tr1, r4, #0\n\tbl\t__addsf3\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fma1,.Lfe1-fma1\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fma1(float,float,float);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fma1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fma1` — benchmark function synthetic:fma1:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fma1:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfma1\n\t.type\t fma1,function\n\t.thumb_func\nfma1:\n\tpush\t{r4, lr}\n\tadd\tr4, r2, #0\n\tbl\t__mulsf3\n\tadd\tr1, r4, #0\n\tbl\t__addsf3\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fma1,.Lfe1-fma1\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fma1 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fma1:gcc2.7.2kmc","sym":"fma1","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","arithmetic","expr"],"loc":1,"refSource":"float fma1(float a,float b,float c){ return a*b+c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmul.s\t$f0,$f12,$f14\n 8:\tmtc1\ta2,$f2\n c:\tnop\n 10:\tjr\tra\n 14:\tadd.s\t$f0,$f0,$f2\n\t...\n","ctx":"float fma1(float,float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c53da19510d2f191/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 fma1\n\n\nContents of section .text:\n 0000 00000000 460e6002 44861000 00000000 ....F.`.D.......\n 0010 03e00008 46020000 00000000 00000000 ....F...........\nContents of section .reginfo:\n 0000 80000040 00000000 00005005 00000000 ...@......P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fma1' — lift: cannot lift 'fma1 @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tnop */\n/* 4:\tmul.s\t$f0,$f12,$f14 */\n/* 8:\tmtc1\ta2,$f2 */\n/* c:\tnop */\n/* 10:\tjr\tra */\n/* 14:\tadd.s\t$f0,$f0,$f2 */\n/* \t... */\nvoid fma1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fma1 @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":15,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fma1 @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fma1(f32 arg0, f32 arg1, f32 arg2) {\n return (arg0 * arg1) + arg2;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fma1` — benchmark function synthetic:fma1:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fma1\n nop\n mul.s\t$f0, $f12, $f14\n mtc1\t$a2, $f2\n nop\n jr\t$ra\n add.s\t$f0, $f0, $f2\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fma1(float,float,float);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fma1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fma1` — benchmark function synthetic:fma1:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fma1:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmul.s\t$f0,$f12,$f14\n 8:\tmtc1\ta2,$f2\n c:\tnop\n 10:\tjr\tra\n 14:\tadd.s\t$f0,$f0,$f2\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c53da19510d2f191/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 fma1\n\n\nContents of section .text:\n 0000 00000000 460e6002 44861000 00000000 ....F.`.D.......\n 0010 03e00008 46020000 00000000 00000000 ....F...........\nContents of section .reginfo:\n 0000 80000040 00000000 00005005 00000000 ...@......P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fma1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fma1:ido7.1","sym":"fma1","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","arithmetic","expr"],"loc":1,"refSource":"float fma1(float a,float b,float c){ return a*b+c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmul.s\t$f4,$f12,$f14\n 4:\tsw\ta2,8(sp)\n 8:\tlwc1\t$f6,8(sp)\n c:\tjr\tra\n 10:\tadd.s\t$f0,$f4,$f6\n\t...\n","ctx":"float fma1(float,float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 fma1\n\n\nContents of section .text:\n 0000 460e6102 afa60008 c7a60008 03e00008 F.a.............\n 0010 46062000 00000000 00000000 00000000 F. .............\nContents of section .options:\n 0000 01200000 00000000 a0000040 00000000 . .........@....\n 0010 00005073 00000000 00000000 00007ff0 ..Ps............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000040 00000000 00005073 00000000 ...@......Ps....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 35336461 31393531 30643266 ef-c53da19510d2f\n 0130 3139312f 7265662e 6300666d 61310000 191/ref.c.fma1..\n 0140 666d6131 00000000 00000000 00000001 fma1............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fma1' — lift: cannot lift 'fma1 @0x0': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmul.s\t$f4,$f12,$f14 */\n/* 4:\tsw\ta2,8(sp) */\n/* 8:\tlwc1\t$f6,8(sp) */\n/* c:\tjr\tra */\n/* 10:\tadd.s\t$f0,$f4,$f6 */\n/* \t... */\nvoid fma1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fma1 @0x0': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":14,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fma1 @0x0': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fma1(f32 arg0, f32 arg1, f32 arg2) {\n return (arg0 * arg1) + arg2;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fma1` — benchmark function synthetic:fma1:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fma1\n mul.s\t$f4, $f12, $f14\n sw\t$a2, 8($sp)\n lwc1\t$f6, 8($sp)\n jr\t$ra\n add.s\t$f0, $f4, $f6\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fma1(float,float,float);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fma1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fma1` — benchmark function synthetic:fma1:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fma1:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmul.s\t$f4,$f12,$f14\n 4:\tsw\ta2,8(sp)\n 8:\tlwc1\t$f6,8(sp)\n c:\tjr\tra\n 10:\tadd.s\t$f0,$f4,$f6\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 fma1\n\n\nContents of section .text:\n 0000 460e6102 afa60008 c7a60008 03e00008 F.a.............\n 0010 46062000 00000000 00000000 00000000 F. .............\nContents of section .options:\n 0000 01200000 00000000 a0000040 00000000 . .........@....\n 0010 00005073 00000000 00000000 00007ff0 ..Ps............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000040 00000000 00005073 00000000 ...@......Ps....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 35336461 31393531 30643266 ef-c53da19510d2f\n 0130 3139312f 7265662e 6300666d 61310000 191/ref.c.fma1..\n 0140 666d6131 00000000 00000000 00000001 fma1............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fma1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fma1:mwcc_242_81","sym":"fma1","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","arithmetic","expr"],"loc":1,"refSource":"float fma1(float a,float b,float c){ return a*b+c; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfmuls f0,f1,f2\n 4:\tfadds f1,f3,f0\n 8:\tblr\n","ctx":"float fma1(float,float,float);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c fma1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fma1\n\n\nContents of section .text:\n 0000 ec0100b2 ec23002a 4e800020 .....#.*N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fma1' — lift: cannot lift 'fma1 @0x0': unmodelled effect instruction 'fmuls' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfmuls f0,f1,f2 */\n/* 4:\tfadds f1,f3,f0 */\n/* 8:\tblr */\nvoid fma1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fma1 @0x0': unmodelled effect instruction 'fmuls' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fma1 @0x0': unmodelled effect instruction 'fmuls' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fma1(f32 farg0, f32 farg1, f32 farg2) {\n return farg2 + (farg0 * farg1);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fma1` — benchmark function synthetic:fma1:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fma1\n fmuls f0,f1,f2\n fadds f1,f3,f0\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fma1(float,float,float);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fma1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fma1` — benchmark function synthetic:fma1:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fma1:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfmuls f0,f1,f2\n 4:\tfadds f1,f3,f0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c fma1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fma1\n\n\nContents of section .text:\n 0000 ec0100b2 ec23002a 4e800020 .....#.*N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fma1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fmul:agbcc","sym":"fmul","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fmul(float a,float b){ return a*b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfmul\n\t.type\t fmul,function\n\t.thumb_func\nfmul:\n\tpush\t{lr}\n\tbl\t__mulsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fmul,.Lfe1-fmul\n","ctx":"float fmul(float,float);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 fmul(void) {\n return __mulsf3();\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 __mulsf3(); /* extern */\n\nf32 fmul(f32 arg0, f32 arg1) {\n return (bitwise f32) __mulsf3();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fmul` — benchmark function synthetic:fmul:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfmul\n\t.type\t fmul,function\n\t.thumb_func\nfmul:\n\tpush\t{lr}\n\tbl\t__mulsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fmul,.Lfe1-fmul\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fmul(float,float);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fmul # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fmul` — benchmark function synthetic:fmul:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fmul:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfmul\n\t.type\t fmul,function\n\t.thumb_func\nfmul:\n\tpush\t{lr}\n\tbl\t__mulsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fmul,.Lfe1-fmul\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fmul # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fmul:gcc2.7.2kmc","sym":"fmul","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fmul(float a,float b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tmul.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fmul(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-eeb6517bc3ee945b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fmul\n\n\nContents of section .text:\n 0000 03e00008 460e6002 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fmul' — lift: cannot lift 'fmul @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tmul.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fmul(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fmul @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fmul @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fmul(f32 arg0, f32 arg1) {\n return arg0 * arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fmul` — benchmark function synthetic:fmul:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fmul\n jr\t$ra\n mul.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fmul(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fmul # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fmul` — benchmark function synthetic:fmul:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fmul:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tmul.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-eeb6517bc3ee945b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fmul\n\n\nContents of section .text:\n 0000 03e00008 460e6002 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fmul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fmul:ido7.1","sym":"fmul","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fmul(float a,float b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tmul.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fmul(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fmul\n\n\nContents of section .text:\n 0000 03e00008 460e6002 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 65623635 31376263 33656539 ef-eeb6517bc3ee9\n 0130 3435622f 7265662e 6300666d 756c0000 45b/ref.c.fmul..\n 0140 666d756c 00000000 00000000 00000001 fmul............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fmul' — lift: cannot lift 'fmul @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tmul.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fmul(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fmul @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fmul @0x4': unmodelled effect instruction 'mul.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fmul(f32 arg0, f32 arg1) {\n return arg0 * arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fmul` — benchmark function synthetic:fmul:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fmul\n jr\t$ra\n mul.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fmul(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fmul # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fmul` — benchmark function synthetic:fmul:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fmul:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tmul.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fmul\n\n\nContents of section .text:\n 0000 03e00008 460e6002 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 65623635 31376263 33656539 ef-eeb6517bc3ee9\n 0130 3435622f 7265662e 6300666d 756c0000 45b/ref.c.fmul..\n 0140 666d756c 00000000 00000000 00000001 fmul............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fmul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fmul:mwcc_242_81","sym":"fmul","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fmul(float a,float b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfmuls f1,f1,f2\n 4:\tblr\n","ctx":"float fmul(float,float);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fmul\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fmul\n\n\nContents of section .text:\n 0000 ec2100b2 4e800020 .!..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fmul' — lift: cannot lift 'fmul @0x0': unmodelled effect instruction 'fmuls' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfmuls f1,f1,f2 */\n/* 4:\tblr */\nvoid fmul(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fmul @0x0': unmodelled effect instruction 'fmuls' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":10,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fmul @0x0': unmodelled effect instruction 'fmuls' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fmul(f32 farg0, f32 farg1) {\n return farg0 * farg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fmul` — benchmark function synthetic:fmul:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fmul\n fmuls f1,f1,f2\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fmul(float,float);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fmul # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fmul` — benchmark function synthetic:fmul:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fmul:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfmuls f1,f1,f2\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fmul\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fmul\n\n\nContents of section .text:\n 0000 ec2100b2 4e800020 .!..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fmul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fsub:agbcc","sym":"fsub","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fsub(float a,float b){ return a-b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfsub\n\t.type\t fsub,function\n\t.thumb_func\nfsub:\n\tpush\t{lr}\n\tbl\t__subsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fsub,.Lfe1-fsub\n","ctx":"float fsub(float,float);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 fsub(void) {\n return __subsf3();\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 __subsf3(); /* extern */\n\nf32 fsub(f32 arg0, f32 arg1) {\n return (bitwise f32) __subsf3();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fsub` — benchmark function synthetic:fsub:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfsub\n\t.type\t fsub,function\n\t.thumb_func\nfsub:\n\tpush\t{lr}\n\tbl\t__subsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fsub,.Lfe1-fsub\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fsub(float,float);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fsub # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fsub` — benchmark function synthetic:fsub:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fsub:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tfsub\n\t.type\t fsub,function\n\t.thumb_func\nfsub:\n\tpush\t{lr}\n\tbl\t__subsf3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t fsub,.Lfe1-fsub\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fsub # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fsub:gcc2.7.2kmc","sym":"fsub","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fsub(float a,float b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsub.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fsub(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c32f6114ade25b45/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fsub\n\n\nContents of section .text:\n 0000 03e00008 460e6001 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fsub' — lift: cannot lift 'fsub @0x4': unmodelled effect instruction 'sub.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tsub.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fsub(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fsub @0x4': unmodelled effect instruction 'sub.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fsub @0x4': unmodelled effect instruction 'sub.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fsub(f32 arg0, f32 arg1) {\n return arg0 - arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fsub` — benchmark function synthetic:fsub:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fsub\n jr\t$ra\n sub.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fsub(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fsub # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fsub` — benchmark function synthetic:fsub:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fsub:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsub.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c32f6114ade25b45/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 fsub\n\n\nContents of section .text:\n 0000 03e00008 460e6001 00000000 00000000 ....F.`.........\nContents of section .reginfo:\n 0000 80000000 00000000 00005001 00000000 ..........P.....\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name fsub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fsub:ido7.1","sym":"fsub","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fsub(float a,float b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsub.s\t$f0,$f12,$f14\n\t...\n","ctx":"float fsub(float,float);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fsub\n\n\nContents of section .text:\n 0000 03e00008 460e6001 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 33326636 31313461 64653235 ef-c32f6114ade25\n 0130 6234352f 7265662e 63006673 75620000 b45/ref.c.fsub..\n 0140 66737562 00000000 00000000 00000001 fsub............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fsub' — lift: cannot lift 'fsub @0x4': unmodelled effect instruction 'sub.s' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tjr\tra */\n/* 4:\tsub.s\t$f0,$f12,$f14 */\n/* \t... */\nvoid fsub(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fsub @0x4': unmodelled effect instruction 'sub.s' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":11,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fsub @0x4': unmodelled effect instruction 'sub.s' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fsub(f32 arg0, f32 arg1) {\n return arg0 - arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fsub` — benchmark function synthetic:fsub:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fsub\n jr\t$ra\n sub.s\t$f0, $f12, $f14\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fsub(float,float);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fsub # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fsub` — benchmark function synthetic:fsub:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fsub:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsub.s\t$f0,$f12,$f14\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 fsub\n\n\nContents of section .text:\n 0000 03e00008 460e6001 00000000 00000000 ....F.`.........\nContents of section .options:\n 0000 01200000 00000000 80000000 00000000 . ..............\n 0010 00005003 00000000 00000000 00007ff0 ..P.............\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000000 00000000 00005003 00000000 ..........P.....\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 33326636 31313461 64653235 ef-c32f6114ade25\n 0130 6234352f 7265662e 63006673 75620000 b45/ref.c.fsub..\n 0140 66737562 00000000 00000000 00000001 fsub............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fsub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:fsub:mwcc_242_81","sym":"fsub","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","arithmetic"],"loc":1,"refSource":"float fsub(float a,float b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfsubs f1,f1,f2\n 4:\tblr\n","ctx":"float fsub(float,float);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fsub\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fsub\n\n\nContents of section .text:\n 0000 ec211028 4e800020 .!.(N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'fsub' — lift: cannot lift 'fsub @0x0': unmodelled effect instruction 'fsubs' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tfsubs f1,f1,f2 */\n/* 4:\tblr */\nvoid fsub(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'fsub @0x0': unmodelled effect instruction 'fsubs' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":10,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'fsub @0x0': unmodelled effect instruction 'fsubs' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 fsub(f32 farg0, f32 farg1) {\n return farg0 - farg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `fsub` — benchmark function synthetic:fsub:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel fsub\n fsubs f1,f1,f2\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat fsub(float,float);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function fsub # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `fsub` — benchmark function synthetic:fsub:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:fsub:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tfsubs f1,f1,f2\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 fsub\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 fsub\n\n\nContents of section .text:\n 0000 ec211028 4e800020 .!.(N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name fsub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:gcd:agbcc","sym":"gcd","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","while","mod-reg"],"loc":1,"refSource":"int gcd(int a,int b){ while(b){int t=b;b=a%b;a=t;} return a; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tgcd\n\t.type\t gcd,function\n\t.thumb_func\ngcd:\n\tpush\t{r4, lr}\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr4, r0, #0\n\tadd\tr0, r2, #0\n\tadd\tr1, r4, #0\n\tbl\t__modsi3\n\tadd\tr2, r4, #0\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t gcd,.Lfe1-gcd\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 gcd(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 t0;\n v0 = a1;\n v1 = a0;\n while (v0 != 0) {\n t0 = v1;\n v1 = v0;\n v0 = t0 % v0;\n }\n a0 = v1;\n return a0;\n}\n","score":10,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":8},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 gcd(s32 arg0, s32 arg1) {\n s32 temp_r4;\n s32 var_r0;\n s32 var_r2;\n\n var_r2 = arg0;\n var_r0 = arg1;\n if (var_r0 != 0) {\n do {\n temp_r4 = var_r0;\n var_r0 = var_r2 % temp_r4;\n var_r2 = temp_r4;\n } while (var_r0 != 0);\n }\n return var_r2;\n}\n","score":0,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `gcd` — benchmark function synthetic:gcd:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tgcd\n\t.type\t gcd,function\n\t.thumb_func\ngcd:\n\tpush\t{r4, lr}\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr4, r0, #0\n\tadd\tr0, r2, #0\n\tadd\tr1, r4, #0\n\tbl\t__modsi3\n\tadd\tr2, r4, #0\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t gcd,.Lfe1-gcd\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function gcd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `gcd` — benchmark function synthetic:gcd:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:gcd:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tgcd\n\t.type\t gcd,function\n\t.thumb_func\ngcd:\n\tpush\t{r4, lr}\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n.L5:\n\tadd\tr4, r0, #0\n\tadd\tr0, r2, #0\n\tadd\tr1, r4, #0\n\tbl\t__modsi3\n\tadd\tr2, r4, #0\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n.L4:\n\tadd\tr0, r2, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t gcd,.Lfe1-gcd\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name gcd # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:gcd:gcc2.7.2kmc","sym":"gcd","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","while","mod-reg"],"loc":1,"refSource":"int gcd(int a,int b){ while(b){int t=b;b=a%b;a=t;} return a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta1,48 \n 4:\tnop\n 8:\tmove\tv0,a1\n c:\tdiv\tzero,a0,a1\n 10:\tbnez\ta1,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta1,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\ta0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmfhi\ta1\n\t...\n 40:\tbnez\ta1,8 \n 44:\tmove\ta0,v0\n 48:\tjr\tra\n 4c:\tmove\tv0,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3ddd71640c03fc3b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 gcd\n\n\nContents of section .text:\n 0000 10a00011 00000000 00a01021 0085001a ...........!....\n 0010 14a00002 00000000 0007000d 2401ffff ............$...\n 0020 14a10004 3c018000 14810002 00000000 ....<...........\n 0030 0006000d 00002810 00000000 00000000 ......(.........\n 0040 14a0fff1 00402021 03e00008 00801021 .....@ !.......!\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 gcd(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 t0;\n if (a1 != 0) {\n v0 = a1;\n v1 = a0;\n do {\n t0 = v1;\n v1 = v0;\n v0 = t0 % v0;\n } while (v0 != 0);\n a0 = v1;\n }\n return a0;\n}\n","score":10,"maxScore":22,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 gcd(s32 arg0, s32 arg1) {\n s32 temp_v0;\n s32 var_a0;\n s32 var_a1;\n\n var_a0 = arg0;\n var_a1 = arg1;\n if (var_a1 != 0) {\n do {\n temp_v0 = var_a1;\n var_a1 = var_a0 % var_a1;\n var_a0 = temp_v0;\n } while (var_a1 != 0);\n }\n return var_a0;\n}\n","score":0,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `gcd` — benchmark function synthetic:gcd:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel gcd\n beqz\t$a1, .L48\n nop\n.L8:\n move\t$v0, $a1\n div\t$zero, $a0, $a1\n bnez\t$a1, .L1c\n nop\n break\t0x7\n.L1c:\n li\t$at, -1\n bne\t$a1, $at, .L34\n lui\t$at, 0x8000\n bne\t$a0, $at, .L34\n nop\n break\t0x6\n.L34:\n mfhi\t$a1\n bnez\t$a1, .L8\n move\t$a0, $v0\n.L48:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function gcd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `gcd` — benchmark function synthetic:gcd:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:gcd:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta1,48 \n 4:\tnop\n 8:\tmove\tv0,a1\n c:\tdiv\tzero,a0,a1\n 10:\tbnez\ta1,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta1,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\ta0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmfhi\ta1\n\t...\n 40:\tbnez\ta1,8 \n 44:\tmove\ta0,v0\n 48:\tjr\tra\n 4c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3ddd71640c03fc3b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 gcd\n\n\nContents of section .text:\n 0000 10a00011 00000000 00a01021 0085001a ...........!....\n 0010 14a00002 00000000 0007000d 2401ffff ............$...\n 0020 14a10004 3c018000 14810002 00000000 ....<...........\n 0030 0006000d 00002810 00000000 00000000 ......(.........\n 0040 14a0fff1 00402021 03e00008 00801021 .....@ !.......!\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name gcd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:gcd:ido7.1","sym":"gcd","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","while","mod-reg"],"loc":1,"refSource":"int gcd(int a,int b){ while(b){int t=b;b=a%b;a=t;} return a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta1,44 \n 4:\tnop\n 8:\tdiv\tzero,a0,a1\n c:\tmove\tv0,a1\n 10:\tbnez\ta1,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta1,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\ta0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmfhi\ta1\n 38:\tmove\ta0,v0\n 3c:\tbnez\ta1,8 \n 40:\tnop\n 44:\tjr\tra\n 48:\tmove\tv0,a0\n 4c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c gcd\n\n\nContents of section .text:\n 0000 10a00010 00000000 0085001a 00a01025 ...............%\n 0010 14a00002 00000000 0007000d 2401ffff ............$...\n 0020 14a10004 3c018000 14810002 00000000 ....<...........\n 0030 0006000d 00002810 00402025 14a0fff2 ......(..@ %....\n 0040 00000000 03e00008 00801025 00000000 ...........%....\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 00000004 000001b8 p...............\n 0010 00000005 000002f4 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000034 00000264 ....... ...4...d\n 0040 00000004 00000298 00000001 0000029c ................\n 0050 00000000 00000000 00000001 000002e4 ................\n 0060 08080000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000004c 20200001 00000001 .......L ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 64646437 31363430 63303366 ef-3ddd71640c03f\n 0130 6333622f 7265662e 63006763 64000000 c3b/ref.c.gcd...\n 0140 67636400 00000000 00000001 00000000 gcd.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000013 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000003 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 gcd(s32 a0, s32 a1) {\n s32 t0;\n if (a1 != 0) {\n do {\n t0 = a0;\n a0 = a1;\n a1 = t0 % a1;\n } while (a1 != 0);\n }\n return a0;\n}\n","score":8,"maxScore":20,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 gcd(s32 arg0, s32 arg1) {\n s32 temp_v0;\n s32 var_a0;\n s32 var_a1;\n\n var_a0 = arg0;\n var_a1 = arg1;\n if (var_a1 != 0) {\n do {\n temp_v0 = var_a1;\n var_a1 = var_a0 % var_a1;\n var_a0 = temp_v0;\n } while (var_a1 != 0);\n }\n return var_a0;\n}\n","score":11,"maxScore":20,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":1,"opMismatch":0,"argMismatch":9},"quality":{"score":100,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":8,"maxScore":20,"ratio":0.4,"kinds":{"insert":1,"delete":2,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `gcd` — benchmark function synthetic:gcd:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel gcd\n beqz\t$a1, .L44\n nop\n.L8:\n div\t$zero, $a0, $a1\n move\t$v0, $a1\n bnez\t$a1, .L1c\n nop\n break\t0x7\n.L1c:\n li\t$at, -1\n bne\t$a1, $at, .L34\n lui\t$at, 0x8000\n bne\t$a0, $at, .L34\n nop\n break\t0x6\n.L34:\n mfhi\t$a1\n move\t$a0, $v0\n bnez\t$a1, .L8\n nop\n.L44:\n jr\t$ra\n move\t$v0, $a0\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function gcd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `gcd` — benchmark function synthetic:gcd:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:gcd:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta1,44 \n 4:\tnop\n 8:\tdiv\tzero,a0,a1\n c:\tmove\tv0,a1\n 10:\tbnez\ta1,1c \n 14:\tnop\n 18:\tbreak\t0x7\n 1c:\tli\tat,-1\n 20:\tbne\ta1,at,34 \n 24:\tlui\tat,0x8000\n 28:\tbne\ta0,at,34 \n 2c:\tnop\n 30:\tbreak\t0x6\n 34:\tmfhi\ta1\n 38:\tmove\ta0,v0\n 3c:\tbnez\ta1,8 \n 40:\tnop\n 44:\tjr\tra\n 48:\tmove\tv0,a0\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c gcd\n\n\nContents of section .text:\n 0000 10a00010 00000000 0085001a 00a01025 ...............%\n 0010 14a00002 00000000 0007000d 2401ffff ............$...\n 0020 14a10004 3c018000 14810002 00000000 ....<...........\n 0030 0006000d 00002810 00402025 14a0fff2 ......(..@ %....\n 0040 00000000 03e00008 00801025 00000000 ...........%....\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 00000004 000001b8 p...............\n 0010 00000005 000002f4 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000034 00000264 ....... ...4...d\n 0040 00000004 00000298 00000001 0000029c ................\n 0050 00000000 00000000 00000001 000002e4 ................\n 0060 08080000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000004c 20200001 00000001 .......L ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 64646437 31363430 63303366 ef-3ddd71640c03f\n 0130 6333622f 7265662e 63006763 64000000 c3b/ref.c.gcd...\n 0140 67636400 00000000 00000001 00000000 gcd.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000013 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000003 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name gcd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:gcd:mwcc_242_81","sym":"gcd","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","while","mod-reg"],"loc":1,"refSource":"int gcd(int a,int b){ while(b){int t=b;b=a%b;a=t;} return a; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tb 18 \n 4:\tdivw r0,r3,r4\n 8:\tmr r5,r4\n c:\tmullw r0,r0,r4\n 10:\tsubf r4,r0,r3\n 14:\tmr r3,r5\n 18:\tcmpwi r4,0\n 1c:\tbne 4 \n 20:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000024 gcd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 gcd\n\n\nContents of section .text:\n 0000 48000018 7c0323d6 7c852378 7c0021d6 H...|.#.|.#x|.!.\n 0010 7c801850 7ca32b78 2c040000 4082ffe8 |..P|.+x,...@...\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 gcd(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 t0;\n v0 = a1;\n v1 = a0;\n while (v0 != 0) {\n t0 = v1;\n v1 = v0;\n v0 = t0 - t0 / v0 * v0;\n }\n return v1;\n}\n","score":7,"maxScore":11,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void gcd(s32 arg0, s32 arg1) {\n s32 temp_r5;\n s32 var_r3;\n s32 var_r4;\n\n var_r3 = arg0;\n var_r4 = arg1;\nloop_2:\n if (var_r4 != 0) {\n temp_r5 = var_r4;\n var_r4 = var_r3 % var_r4;\n var_r3 = temp_r5;\n goto loop_2;\n }\n}\n","score":4,"maxScore":10,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":2,"opMismatch":0,"argMismatch":0},"quality":{"score":88,"lines":14,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":10,"ratio":0.4,"kinds":{"insert":1,"delete":1,"replace":2,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `gcd` — benchmark function synthetic:gcd:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel gcd\n b .L18\n.L4:\n divw r0,r3,r4\n mr r5,r4\n mullw r0,r0,r4\n subf r4,r0,r3\n mr r3,r5\n.L18:\n cmpwi r4,0\n bne .L4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function gcd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `gcd` — benchmark function synthetic:gcd:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:gcd:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tb 18 \n 4:\tdivw r0,r3,r4\n 8:\tmr r5,r4\n c:\tmullw r0,r0,r4\n 10:\tsubf r4,r0,r3\n 14:\tmr r3,r5\n 18:\tcmpwi r4,0\n 1c:\tbne 4 \n 20:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000024 gcd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 gcd\n\n\nContents of section .text:\n 0000 48000018 7c0323d6 7c852378 7c0021d6 H...|.#.|.#x|.!.\n 0010 7c801850 7ca32b78 2c040000 4082ffe8 |..P|.+x,...@...\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name gcd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hi16:agbcc","sym":"hi16","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned hi16(unsigned x){ return x>>16; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\thi16\n\t.type\t hi16,function\n\t.thumb_func\nhi16:\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t hi16,.Lfe1-hi16\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 hi16(u32 a0) {\n return a0 >> 16;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 hi16(u32 arg0) {\n return arg0 >> 0x10;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hi16` — benchmark function synthetic:hi16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\thi16\n\t.type\t hi16,function\n\t.thumb_func\nhi16:\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t hi16,.Lfe1-hi16\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hi16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hi16` — benchmark function synthetic:hi16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hi16:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\thi16\n\t.type\t hi16,function\n\t.thumb_func\nhi16:\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t hi16,.Lfe1-hi16\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name hi16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hi16:gcc2.7.2kmc","sym":"hi16","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned hi16(unsigned x){ return x>>16; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrl\tv0,a0,0x10\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c869f1e512e43840/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 hi16\n\n\nContents of section .text:\n 0000 03e00008 00041402 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 hi16(u32 a0) {\n return a0 >> 16;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 hi16(u32 arg0) {\n return arg0 >> 0x10;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hi16` — benchmark function synthetic:hi16:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel hi16\n jr\t$ra\n srl\t$v0, $a0, 0x10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hi16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hi16` — benchmark function synthetic:hi16:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hi16:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrl\tv0,a0,0x10\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-c869f1e512e43840/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 hi16\n\n\nContents of section .text:\n 0000 03e00008 00041402 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name hi16 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hi16:ido7.1","sym":"hi16","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned hi16(unsigned x){ return x>>16; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrl\tv0,a0,0x10\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 hi16\n\n\nContents of section .text:\n 0000 03e00008 00041402 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 38363966 31653531 32653433 ef-c869f1e512e43\n 0130 3834302f 7265662e 63006869 31360000 840/ref.c.hi16..\n 0140 68693136 00000000 00000000 00000001 hi16............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 hi16(u32 a0) {\n return a0 >> 16;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 hi16(u32 arg0) {\n return arg0 >> 0x10;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hi16` — benchmark function synthetic:hi16:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel hi16\n jr\t$ra\n srl\t$v0, $a0, 0x10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hi16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hi16` — benchmark function synthetic:hi16:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hi16:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrl\tv0,a0,0x10\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 hi16\n\n\nContents of section .text:\n 0000 03e00008 00041402 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 38363966 31653531 32653433 ef-c869f1e512e43\n 0130 3834302f 7265662e 63006869 31360000 840/ref.c.hi16..\n 0140 68693136 00000000 00000000 00000001 hi16............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name hi16 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hi16:mwcc_242_81","sym":"hi16","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned hi16(unsigned x){ return x>>16; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrwi r3,r3,16\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 hi16\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 hi16\n\n\nContents of section .text:\n 0000 5463843e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 hi16(u32 a0) {\n return a0 >> 16;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 hi16(u32 arg0) {\n return arg0 >> 0x10U;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hi16` — benchmark function synthetic:hi16:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel hi16\n srwi r3,r3,16\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hi16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hi16` — benchmark function synthetic:hi16:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hi16:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrwi r3,r3,16\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 hi16\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 hi16\n\n\nContents of section .text:\n 0000 5463843e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name hi16 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hword:agbcc","sym":"hword","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","array","store","narrow"],"loc":1,"refSource":"void hword(u16 *p,int i,int v){ p[i]=(u16)v; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\thword\n\t.type\t hword,function\n\t.thumb_func\nhword:\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r0\n\tstrh\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t hword,.Lfe1-hword\n","ctx":"void hword(u16*,int,int);","proto":{"hword":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void hword(u16 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void hword(u16 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = (u16) arg2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hword` — benchmark function synthetic:hword:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\thword\n\t.type\t hword,function\n\t.thumb_func\nhword:\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r0\n\tstrh\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t hword,.Lfe1-hword\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid hword(u16*,int,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hword # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hword` — benchmark function synthetic:hword:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hword:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\thword\n\t.type\t hword,function\n\t.thumb_func\nhword:\n\tlsl\tr1, r1, #0x1\n\tadd\tr1, r1, r0\n\tstrh\tr2, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t hword,.Lfe1-hword\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"hword\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name hword # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hword:gcc2.7.2kmc","sym":"hword","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","array","store","narrow"],"loc":1,"refSource":"void hword(u16 *p,int i,int v){ p[i]=(u16)v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta1,a1,0x1\n 4:\taddu\ta1,a1,a0\n 8:\tjr\tra\n c:\tsh\ta2,0(a1)\n","ctx":"void hword(u16*,int,int);","proto":{"hword":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-6f36d8e5292b594f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 hword\n\n\nContents of section .text:\n 0000 00052840 00a42821 03e00008 a4a60000 ..(@..(!........\nContents of section .reginfo:\n 0000 80000070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void hword(u16 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void hword(u16 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = (u16) arg2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hword` — benchmark function synthetic:hword:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel hword\n sll\t$a1, $a1, 0x1\n addu\t$a1, $a1, $a0\n jr\t$ra\n sh\t$a2, 0($a1)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid hword(u16*,int,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hword # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hword` — benchmark function synthetic:hword:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hword:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta1,a1,0x1\n 4:\taddu\ta1,a1,a0\n 8:\tjr\tra\n c:\tsh\ta2,0(a1)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-6f36d8e5292b594f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 hword\n\n\nContents of section .text:\n 0000 00052840 00a42821 03e00008 a4a60000 ..(@..(!........\nContents of section .reginfo:\n 0000 80000070 00000000 00000000 00000000 ...p............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"hword\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name hword # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hword:ido7.1","sym":"hword","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","array","store","narrow"],"loc":1,"refSource":"void hword(u16 *p,int i,int v){ p[i]=(u16)v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x1\n 4:\taddu\tt7,a0,t6\n 8:\tjr\tra\n c:\tsh\ta2,0(t7)\n","ctx":"void hword(u16*,int,int);","proto":{"hword":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 hword\n\n\nContents of section .text:\n 0000 00057040 008e7821 03e00008 a5e60000 ..p@..x!........\nContents of section .options:\n 0000 01200000 00000000 8000c070 00000000 . .........p....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c070 00000000 00000000 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 66333664 38653532 39326235 ef-6f36d8e5292b5\n 0130 3934662f 7265662e 63006877 6f726400 94f/ref.c.hword.\n 0140 68776f72 64000000 00000000 00000001 hword...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void hword(u16 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void hword(u16 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = (u16) arg2;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hword` — benchmark function synthetic:hword:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel hword\n sll\t$t6, $a1, 0x1\n addu\t$t7, $a0, $t6\n jr\t$ra\n sh\t$a2, 0($t7)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid hword(u16*,int,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hword # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hword` — benchmark function synthetic:hword:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hword:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x1\n 4:\taddu\tt7,a0,t6\n 8:\tjr\tra\n c:\tsh\ta2,0(t7)\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 hword\n\n\nContents of section .text:\n 0000 00057040 008e7821 03e00008 a5e60000 ..p@..x!........\nContents of section .options:\n 0000 01200000 00000000 8000c070 00000000 . .........p....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c070 00000000 00000000 00000000 ...p............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 66333664 38653532 39326235 ef-6f36d8e5292b5\n 0130 3934662f 7265662e 63006877 6f726400 94f/ref.c.hword.\n 0140 68776f72 64000000 00000000 00000001 hword...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"hword\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name hword # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:hword:mwcc_242_81","sym":"hword","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","array","store","narrow"],"loc":1,"refSource":"void hword(u16 *p,int i,int v){ p[i]=(u16)v; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,1\n 4:\tsthx r5,r3,r0\n 8:\tblr\n","ctx":"void hword(u16*,int,int);","proto":{"hword":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c hword\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 hword\n\n\nContents of section .text:\n 0000 5480083c 7ca3032e 4e800020 T..<|...N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void hword(u16 * a0, u32 a1, u32 a2) {\n a0[a1] = a2;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void hword(u16 *arg0, s32 arg1, s32 arg2) {\n arg0[arg1] = (u16) arg2;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `hword` — benchmark function synthetic:hword:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel hword\n slwi r0,r4,1\n sthx r5,r3,r0\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid hword(u16*,int,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function hword # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `hword` — benchmark function synthetic:hword:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:hword:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,1\n 4:\tsthx r5,r3,r0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c hword\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 hword\n\n\nContents of section .text:\n 0000 5480083c 7ca3032e 4e800020 T..<|...N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"hword\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name hword # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2f:agbcc","sym":"i2f","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["float","cast","int-to-float"],"loc":1,"refSource":"float i2f(int x){ return (float)x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ti2f\n\t.type\t i2f,function\n\t.thumb_func\ni2f:\n\tpush\t{lr}\n\tbl\t__floatsisf\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t i2f,.Lfe1-i2f\n","ctx":"float i2f(int);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 i2f(void) {\n return __floatsisf();\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 __floatsisf(); /* extern */\n\nf32 i2f(s32 arg0) {\n return (bitwise f32) __floatsisf();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C bitwise cast"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2f` — benchmark function synthetic:i2f:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ti2f\n\t.type\t i2f,function\n\t.thumb_func\ni2f:\n\tpush\t{lr}\n\tbl\t__floatsisf\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t i2f,.Lfe1-i2f\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat i2f(int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2f # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2f` — benchmark function synthetic:i2f:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2f:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ti2f\n\t.type\t i2f,function\n\t.thumb_func\ni2f:\n\tpush\t{lr}\n\tbl\t__floatsisf\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t i2f,.Lfe1-i2f\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2f # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2f:gcc2.7.2kmc","sym":"i2f","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["float","cast","int-to-float"],"loc":1,"refSource":"float i2f(int x){ return (float)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta0,$f0\n 4:\tnop\n 8:\tjr\tra\n c:\tcvt.s.w\t$f0,$f0\n","ctx":"float i2f(int);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-07c0c4f3f784c974/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 i2f\n\n\nContents of section .text:\n 0000 44840000 00000000 03e00008 46800020 D...........F.. \nContents of section .reginfo:\n 0000 80000010 00000000 00000001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'i2f' — lift: cannot lift 'i2f @0xc': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta0,$f0 */\n/* 4:\tnop */\n/* 8:\tjr\tra */\n/* c:\tcvt.s.w\t$f0,$f0 */\nvoid i2f(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'i2f @0xc': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":12,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'i2f @0xc': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 i2f(s32 arg0) {\n return (f32) arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2f` — benchmark function synthetic:i2f:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel i2f\n mtc1\t$a0, $f0\n nop\n jr\t$ra\n cvt.s.w\t$f0, $f0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat i2f(int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2f # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2f` — benchmark function synthetic:i2f:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2f:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta0,$f0\n 4:\tnop\n 8:\tjr\tra\n c:\tcvt.s.w\t$f0,$f0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-07c0c4f3f784c974/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 i2f\n\n\nContents of section .text:\n 0000 44840000 00000000 03e00008 46800020 D...........F.. \nContents of section .reginfo:\n 0000 80000010 00000000 00000001 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2f # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2f:ido7.1","sym":"i2f","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["float","cast","int-to-float"],"loc":1,"refSource":"float i2f(int x){ return (float)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta0,$f4\n 4:\tjr\tra\n 8:\tcvt.s.w\t$f0,$f4\n c:\tnop\n","ctx":"float i2f(int);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c i2f\n\n\nContents of section .text:\n 0000 44842000 03e00008 46802020 00000000 D. .....F. ....\nContents of section .options:\n 0000 01200000 00000000 80000010 00000000 . ..............\n 0010 00000013 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000010 00000000 00000013 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 37633063 34663366 37383463 ef-07c0c4f3f784c\n 0130 3937342f 7265662e 63006932 66000000 974/ref.c.i2f...\n 0140 69326600 00000000 00000001 00000000 i2f.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000003 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'i2f' — lift: cannot lift 'i2f @0x8': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmtc1\ta0,$f4 */\n/* 4:\tjr\tra */\n/* 8:\tcvt.s.w\t$f0,$f4 */\n/* c:\tnop */\nvoid i2f(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'i2f @0x8': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":12,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'i2f @0x8': unmodelled effect instruction 'cvt.s.w' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 i2f(s32 arg0) {\n return (f32) arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2f` — benchmark function synthetic:i2f:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel i2f\n mtc1\t$a0, $f4\n jr\t$ra\n cvt.s.w\t$f0, $f4\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat i2f(int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2f # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2f` — benchmark function synthetic:i2f:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2f:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmtc1\ta0,$f4\n 4:\tjr\tra\n 8:\tcvt.s.w\t$f0,$f4\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c i2f\n\n\nContents of section .text:\n 0000 44842000 03e00008 46802020 00000000 D. .....F. ....\nContents of section .options:\n 0000 01200000 00000000 80000010 00000000 . ..............\n 0010 00000013 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000010 00000000 00000013 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 37633063 34663366 37383463 ef-07c0c4f3f784c\n 0130 3937342f 7265662e 63006932 66000000 974/ref.c.i2f...\n 0140 69326600 00000000 00000001 00000000 i2f.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000003 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2f # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2f:mwcc_242_81","sym":"i2f","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["float","cast","int-to-float"],"loc":1,"refSource":"float i2f(int x){ return (float)x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\txoris r3,r3,32768\n 8:\tlis r0,17200\n c:\tlfd f1,0(0)\n\t\t\tc: R_PPC_EMB_SDA21\t@6\n 10:\tstw r3,12(r1)\n 14:\tstw r0,8(r1)\n 18:\tlfd f0,8(r1)\n 1c:\tfsubs f1,f0,f1\n 20:\taddi r1,r1,16\n 24:\tblr\n","ctx":"float i2f(int);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .sdata2\t00000000 .sdata2\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 l O .sdata2\t00000008 @6\n00000000 g F .text\t00000028 i2f\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_EMB_SDA21 @6\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 i2f\n\n\nContents of section .text:\n 0000 9421fff0 6c638000 3c004330 c8200000 .!..lc..<.C0. ..\n 0010 9061000c 90010008 c8010008 ec200828 .a........... .(\n 0020 38210010 4e800020 8!..N.. \nContents of section .sdata2:\n 0000 43300000 80000000 C0...... \nContents of section .mwcats.text:\n 0000 02000028 00000000 ...(.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000008 00000000 00000004 ................\n 0050 00000000 00000008 00000000 00000004 ................\n 0060 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'i2f' — lift: cannot lift 'i2f @0xc': unmodelled effect instruction 'lfd' — no register destination to degrade, and skipping it would silently delete its effect */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tstwu r1,-16(r1) */\n/* 4:\txoris r3,r3,32768 */\n/* 8:\tlis r0,17200 */\n/* c:\tlfd f1,0(0) */\n/* \t\t\tc: R_PPC_EMB_SDA21\t@6 */\n/* 10:\tstw r3,12(r1) */\n/* 14:\tstw r0,8(r1) */\n/* 18:\tlfd f0,8(r1) */\n/* 1c:\tfsubs f1,f0,f1 */\n/* 20:\taddi r1,r1,16 */\n/* 24:\tblr */\nvoid i2f(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'i2f @0xc': unmodelled effect instruction 'lfd' — no register destination to degrade, and skipping it would silently delete its effect\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":19,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'i2f @0xc': unmodelled effect instruction 'lfd' — no register destination to degrade, and skipping it would silently delete its effect"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"f32 i2f(s32 arg0) {\n return (f32) arg0;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2f` — benchmark function synthetic:i2f:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel i2f\n stwu r1,-16(r1)\n xoris r3,r3,32768\n lis r0,17200\n lfd f1,data_6@sda21(r2)\n stw r3,12(r1)\n stw r0,8(r1)\n lfd f0,8(r1)\n fsubs f1,f0,f1\n addi r1,r1,16\n blr\n.rodata\nglabel data_6\n.word 0x43300000\n.word 0x80000000\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nfloat i2f(int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2f # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2f` — benchmark function synthetic:i2f:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2f:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\txoris r3,r3,32768\n 8:\tlis r0,17200\n c:\tlfd f1,0(0)\n\t\t\tc: R_PPC_EMB_SDA21\t@6\n 10:\tstw r3,12(r1)\n 14:\tstw r0,8(r1)\n 18:\tlfd f0,8(r1)\n 1c:\tfsubs f1,f0,f1\n 20:\taddi r1,r1,16\n 24:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .sdata2\t00000000 .sdata2\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 l O .sdata2\t00000008 @6\n00000000 g F .text\t00000028 i2f\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_EMB_SDA21 @6\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 i2f\n\n\nContents of section .text:\n 0000 9421fff0 6c638000 3c004330 c8200000 .!..lc..<.C0. ..\n 0010 9061000c 90010008 c8010008 ec200828 .a........... .(\n 0020 38210010 4e800020 8!..N.. \nContents of section .sdata2:\n 0000 43300000 80000000 C0...... \nContents of section .mwcats.text:\n 0000 02000028 00000000 ...(.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000008 00000000 00000004 ................\n 0050 00000000 00000008 00000000 00000004 ................\n 0060 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2f # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2ll:agbcc","sym":"i2ll","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["s64","cast","sign-extend"],"loc":1,"refSource":"long long i2ll(int x){ return x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ti2ll\n\t.type\t i2ll,function\n\t.thumb_func\ni2ll:\n\tasr\tr1, r0, #0x1f\n\tbx\tlr\n.Lfe1:\n\t.size\t i2ll,.Lfe1-i2ll\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"u32 i2ll(u32 a0) {\n return a0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void i2ll(s32 arg0) {\n\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":2,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":2,"ratio":0.5,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2ll` — benchmark function synthetic:i2ll:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ti2ll\n\t.type\t i2ll,function\n\t.thumb_func\ni2ll:\n\tasr\tr1, r0, #0x1f\n\tbx\tlr\n.Lfe1:\n\t.size\t i2ll,.Lfe1-i2ll\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2ll # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2ll` — benchmark function synthetic:i2ll:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2ll:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ti2ll\n\t.type\t i2ll,function\n\t.thumb_func\ni2ll:\n\tasr\tr1, r0, #0x1f\n\tbx\tlr\n.Lfe1:\n\t.size\t i2ll,.Lfe1-i2ll\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2ll # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2ll:gcc2.7.2kmc","sym":"i2ll","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["s64","cast","sign-extend"],"loc":1,"refSource":"long long i2ll(int x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,a0\n 4:\tmove\tv1,v0\n 8:\tjr\tra\n c:\tsra\tv0,v0,0x1f\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-98282641ffdcb40b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 i2ll\n\n\nContents of section .text:\n 0000 00801021 00401821 03e00008 000217c3 ...!.@.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 i2ll(s32 a0) {\n return a0 >> 31;\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 i2ll(s32 arg0) {\n return arg0 >> 0x1F;\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":3,"maxScore":4,"ratio":0.75,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2ll` — benchmark function synthetic:i2ll:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel i2ll\n move\t$v0, $a0\n move\t$v1, $v0\n jr\t$ra\n sra\t$v0, $v0, 0x1f\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2ll # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2ll` — benchmark function synthetic:i2ll:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2ll:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,a0\n 4:\tmove\tv1,v0\n 8:\tjr\tra\n c:\tsra\tv0,v0,0x1f\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-98282641ffdcb40b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 i2ll\n\n\nContents of section .text:\n 0000 00801021 00401821 03e00008 000217c3 ...!.@.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2ll # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2ll:ido7.1","sym":"i2ll","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["s64","cast","sign-extend"],"loc":1,"refSource":"long long i2ll(int x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tjr\tra\n 8:\tsra\tv0,a0,0x1f\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c i2ll\n\n\nContents of section .text:\n 0000 00801825 03e00008 000417c3 00000000 ...%............\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 38323832 36343166 66646362 ef-98282641ffdcb\n 0130 3430622f 7265662e 63006932 6c6c0000 40b/ref.c.i2ll..\n 0140 69326c6c 00000000 00000000 00000001 i2ll............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000003 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 i2ll(s32 a0) {\n return a0 >> 31;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 i2ll(s32 arg0) {\n return arg0 >> 0x1F;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":3,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2ll` — benchmark function synthetic:i2ll:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel i2ll\n move\t$v1, $a0\n jr\t$ra\n sra\t$v0, $a0, 0x1f\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2ll # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2ll` — benchmark function synthetic:i2ll:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2ll:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,a0\n 4:\tjr\tra\n 8:\tsra\tv0,a0,0x1f\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c i2ll\n\n\nContents of section .text:\n 0000 00801825 03e00008 000417c3 00000000 ...%............\nContents of section .options:\n 0000 01200000 00000000 8000001c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 38323832 36343166 66646362 ef-98282641ffdcb\n 0130 3430622f 7265662e 63006932 6c6c0000 40b/ref.c.i2ll..\n 0140 69326c6c 00000000 00000000 00000001 i2ll............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000003 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2ll # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:i2ll:mwcc_242_81","sym":"i2ll","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["s64","cast","sign-extend"],"loc":1,"refSource":"long long i2ll(int x){ return x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmr r4,r3\n 4:\tsrawi r3,r3,31\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c i2ll\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 i2ll\n\n\nContents of section .text:\n 0000 7c641b78 7c63fe70 4e800020 |d.x|c.pN.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 i2ll(s32 a0) {\n return a0 >> 31;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 i2ll(s32 arg0) {\n return arg0 >> 0x1F;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":3,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `i2ll` — benchmark function synthetic:i2ll:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel i2ll\n mr r4,r3\n srawi r3,r3,31\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function i2ll # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `i2ll` — benchmark function synthetic:i2ll:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:i2ll:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmr r4,r3\n 4:\tsrawi r3,r3,31\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c i2ll\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 i2ll\n\n\nContents of section .text:\n 0000 7c641b78 7c63fe70 4e800020 |d.x|c.pN.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name i2ll # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:inrange:agbcc","sym":"inrange","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","logical-and","range"],"loc":1,"refSource":"int inrange(int x,int lo,int hi){ return x>=lo && x<=hi; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tinrange\n\t.type\t inrange,function\n\t.thumb_func\ninrange:\n\tmov\tr3, #0x0\n\tcmp\tr0, r1\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, r2\n\tbgt\t.L3\t@cond_branch\n\tmov\tr3, #0x1\n.L3:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t inrange,.Lfe1-inrange\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 inrange(s32 a0, s32 a1, s32 a2) {\n return a0 >= a1 && a0 <= a2;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 inrange(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r3;\n\n var_r3 = 0;\n if ((arg0 >= arg1) && (arg0 <= arg2)) {\n var_r3 = 1;\n }\n return var_r3;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `inrange` — benchmark function synthetic:inrange:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tinrange\n\t.type\t inrange,function\n\t.thumb_func\ninrange:\n\tmov\tr3, #0x0\n\tcmp\tr0, r1\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, r2\n\tbgt\t.L3\t@cond_branch\n\tmov\tr3, #0x1\n.L3:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t inrange,.Lfe1-inrange\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function inrange # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `inrange` — benchmark function synthetic:inrange:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:inrange:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tinrange\n\t.type\t inrange,function\n\t.thumb_func\ninrange:\n\tmov\tr3, #0x0\n\tcmp\tr0, r1\n\tblt\t.L3\t@cond_branch\n\tcmp\tr0, r2\n\tbgt\t.L3\t@cond_branch\n\tmov\tr3, #0x1\n.L3:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t inrange,.Lfe1-inrange\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name inrange # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:inrange:gcc2.7.2kmc","sym":"inrange","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","logical-and","range"],"loc":1,"refSource":"int inrange(int x,int lo,int hi){ return x>=lo && x<=hi; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\ta1,a0,a1\n 4:\txori\ta1,a1,0x1\n 8:\tslt\tv0,a2,a0\n c:\txori\tv0,v0,0x1\n 10:\tjr\tra\n 14:\tand\tv0,a1,v0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b557fcde007fe97c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 inrange\n\n\nContents of section .text:\n 0000 0085282a 38a50001 00c4102a 38420001 ..(*8......*8B..\n 0010 03e00008 00a21024 00000000 00000000 .......$........\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 inrange(s32 a0, s32 a1, s32 a2) {\n return (a0 < a1 ^ 1) & (a2 < a0 ^ 1);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 inrange(s32 arg0, s32 arg1, s32 arg2) {\n return (arg0 >= arg1) & (arg2 >= arg0);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `inrange` — benchmark function synthetic:inrange:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel inrange\n slt\t$a1, $a0, $a1\n xori\t$a1, $a1, 0x1\n slt\t$v0, $a2, $a0\n xori\t$v0, $v0, 0x1\n jr\t$ra\n and\t$v0, $a1, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function inrange # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `inrange` — benchmark function synthetic:inrange:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:inrange:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\ta1,a0,a1\n 4:\txori\ta1,a1,0x1\n 8:\tslt\tv0,a2,a0\n c:\txori\tv0,v0,0x1\n 10:\tjr\tra\n 14:\tand\tv0,a1,v0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b557fcde007fe97c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 inrange\n\n\nContents of section .text:\n 0000 0085282a 38a50001 00c4102a 38420001 ..(*8......*8B..\n 0010 03e00008 00a21024 00000000 00000000 .......$........\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name inrange # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:inrange:ido7.1","sym":"inrange","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","logical-and","range"],"loc":1,"refSource":"int inrange(int x,int lo,int hi){ return x>=lo && x<=hi; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\txori\tv0,v0,0x1\n 8:\tbeqz\tv0,18 \n c:\tnop\n 10:\tslt\tv0,a2,a0\n 14:\txori\tv0,v0,0x1\n 18:\tjr\tra\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 inrange\n\n\nContents of section .text:\n 0000 0085102a 38420001 10400003 00000000 ...*8B...@......\n 0010 00c4102a 38420001 03e00008 00000000 ...*8B..........\nContents of section .options:\n 0000 01200000 00000000 80000074 00000000 . .........t....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 07000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000020 20200001 00000001 ....... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 35353766 63646530 30376665 ef-b557fcde007fe\n 0130 3937632f 7265662e 6300696e 72616e67 97c/ref.c.inrang\n 0140 65000000 696e7261 6e676500 00000000 e...inrange.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000008 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 inrange(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n if (a0 >= a1) {\n v0 = a0 < a1 ^ 1;\n } else {\n v0 = a2 < a0 ^ 1;\n }\n return v0;\n}\n","score":9,"maxScore":10,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":3,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 inrange(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_v0;\n\n var_v0 = arg0 >= arg1;\n if (var_v0 != 0) {\n var_v0 = arg2 >= arg0;\n }\n return var_v0;\n}\n","score":5,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":5,"maxScore":8,"ratio":0.625,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `inrange` — benchmark function synthetic:inrange:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel inrange\n slt\t$v0, $a0, $a1\n xori\t$v0, $v0, 0x1\n beqz\t$v0, .L18\n nop\n slt\t$v0, $a2, $a0\n xori\t$v0, $v0, 0x1\n.L18:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function inrange # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `inrange` — benchmark function synthetic:inrange:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:inrange:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\txori\tv0,v0,0x1\n 8:\tbeqz\tv0,18 \n c:\tnop\n 10:\tslt\tv0,a2,a0\n 14:\txori\tv0,v0,0x1\n 18:\tjr\tra\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 inrange\n\n\nContents of section .text:\n 0000 0085102a 38420001 10400003 00000000 ...*8B...@......\n 0010 00c4102a 38420001 03e00008 00000000 ...*8B..........\nContents of section .options:\n 0000 01200000 00000000 80000074 00000000 . .........t....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 07000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000020 20200001 00000001 ....... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 35353766 63646530 30376665 ef-b557fcde007fe\n 0130 3937632f 7265662e 6300696e 72616e67 97c/ref.c.inrang\n 0140 65000000 696e7261 6e676500 00000000 e...inrange.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000008 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name inrange # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:inrange:mwcc_242_81","sym":"inrange","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","logical-and","range"],"loc":1,"refSource":"int inrange(int x,int lo,int hi){ return x>=lo && x<=hi; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tli r0,0\n 8:\tblt 18 \n c:\tcmpw r3,r5\n 10:\tbgt 18 \n 14:\tli r0,1\n 18:\tmr r3,r0\n 1c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 inrange\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 inrange\n\n\nContents of section .text:\n 0000 7c032000 38000000 41800010 7c032800 |. .8...A...|.(.\n 0010 41810008 38000001 7c030378 4e800020 A...8...|..xN.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 inrange(s32 a0, s32 a1, s32 a2) {\n return a0 >= a1 && a0 <= a2;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 inrange(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r0;\n\n var_r0 = 0;\n if ((arg0 >= arg1) && (arg0 <= arg2)) {\n var_r0 = 1;\n }\n return var_r0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `inrange` — benchmark function synthetic:inrange:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel inrange\n cmpw r3,r4\n li r0,0\n blt .L18\n cmpw r3,r5\n bgt .L18\n li r0,1\n.L18:\n mr r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function inrange # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `inrange` — benchmark function synthetic:inrange:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:inrange:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tli r0,0\n 8:\tblt 18 \n c:\tcmpw r3,r5\n 10:\tbgt 18 \n 14:\tli r0,1\n 18:\tmr r3,r0\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 inrange\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 inrange\n\n\nContents of section .text:\n 0000 7c032000 38000000 41800010 7c032800 |. .8...A...|.(.\n 0010 41810008 38000001 7c030378 4e800020 A...8...|..xN.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name inrange # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:iszero:agbcc","sym":"iszero","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","bool"],"loc":1,"refSource":"int iszero(int x){ return x==0; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tiszero\n\t.type\t iszero,function\n\t.thumb_func\niszero:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t iszero,.Lfe1-iszero\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 iszero(u32 a0) {\n s32 v0;\n if (a0 != 0) {\n v0 = 0;\n } else {\n v0 = 1;\n }\n return v0;\n}\n","score":3,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 iszero(s32 arg0) {\n s32 var_r1;\n\n var_r1 = 0;\n if (arg0 == 0) {\n var_r1 = 1;\n }\n return var_r1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `iszero` — benchmark function synthetic:iszero:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tiszero\n\t.type\t iszero,function\n\t.thumb_func\niszero:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t iszero,.Lfe1-iszero\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function iszero # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `iszero` — benchmark function synthetic:iszero:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:iszero:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tiszero\n\t.type\t iszero,function\n\t.thumb_func\niszero:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t iszero,.Lfe1-iszero\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name iszero # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:iszero:gcc2.7.2kmc","sym":"iszero","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","bool"],"loc":1,"refSource":"int iszero(int x){ return x==0; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-46546decb6675beb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 iszero\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 iszero(u32 a0) {\n return a0 < 1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 iszero(s32 arg0) {\n return arg0 == 0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `iszero` — benchmark function synthetic:iszero:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel iszero\n jr\t$ra\n sltiu\t$v0, $a0, 1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function iszero # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `iszero` — benchmark function synthetic:iszero:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:iszero:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-46546decb6675beb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 iszero\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name iszero # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:iszero:ido7.1","sym":"iszero","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","bool"],"loc":1,"refSource":"int iszero(int x){ return x==0; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 iszero\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 36353436 64656362 36363735 ef-46546decb6675\n 0130 6265622f 7265662e 63006973 7a65726f beb/ref.c.iszero\n 0140 00000000 69737a65 726f0000 00000000 ....iszero......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 iszero(u32 a0) {\n return a0 < 1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 iszero(s32 arg0) {\n return arg0 == 0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `iszero` — benchmark function synthetic:iszero:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel iszero\n jr\t$ra\n sltiu\t$v0, $a0, 1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function iszero # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `iszero` — benchmark function synthetic:iszero:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:iszero:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 iszero\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 36353436 64656362 36363735 ef-46546decb6675\n 0130 6265622f 7265662e 63006973 7a65726f beb/ref.c.iszero\n 0140 00000000 69737a65 726f0000 00000000 ....iszero......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name iszero # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:iszero:mwcc_242_81","sym":"iszero","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","bool"],"loc":1,"refSource":"int iszero(int x){ return x==0; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcntlzw r0,r3\n 4:\tsrwi r3,r0,5\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c iszero\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 iszero\n\n\nContents of section .text:\n 0000 7c600034 5403d97e 4e800020 |`.4T..~N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 iszero(u32 a0) {\n return a0 == 0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 iszero(s32 arg0) {\n return arg0 == 0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `iszero` — benchmark function synthetic:iszero:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel iszero\n cntlzw r0,r3\n srwi r3,r0,5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function iszero # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `iszero` — benchmark function synthetic:iszero:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:iszero:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcntlzw r0,r3\n 4:\tsrwi r3,r0,5\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c iszero\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 iszero\n\n\nContents of section .text:\n 0000 7c600034 5403d97e 4e800020 |`.4T..~N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name iszero # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:land:agbcc","sym":"land","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","logical-and"],"loc":1,"refSource":"int land(int a,int b){ return a && b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tland\n\t.type\t land,function\n\t.thumb_func\nland:\n\tmov\tr2, #0x0\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tlsr\tr2, r0, #0x1f\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t land,.Lfe1-land\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 land(u32 a0, u32 a1) {\n return a0 != 0 && a1 != 0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 land(s32 arg0, s32 arg1) {\n u32 var_r2;\n\n var_r2 = 0;\n if (arg0 != 0) {\n var_r2 = (u32) ((0 - arg1) | arg1) >> 0x1F;\n }\n return var_r2;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `land` — benchmark function synthetic:land:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tland\n\t.type\t land,function\n\t.thumb_func\nland:\n\tmov\tr2, #0x0\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tlsr\tr2, r0, #0x1f\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t land,.Lfe1-land\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function land # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `land` — benchmark function synthetic:land:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:land:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tland\n\t.type\t land,function\n\t.thumb_func\nland:\n\tmov\tr2, #0x0\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tneg\tr0, r1\n\torr\tr0, r0, r1\n\tlsr\tr2, r0, #0x1f\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t land,.Lfe1-land\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name land # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:land:gcc2.7.2kmc","sym":"land","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","logical-and"],"loc":1,"refSource":"int land(int a,int b){ return a && b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\ta0,zero,a0\n 4:\tsltu\tv0,zero,a1\n 8:\tjr\tra\n c:\tand\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2322f6506302af62/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 land\n\n\nContents of section .text:\n 0000 0004202b 0005102b 03e00008 00821024 .. +...+.......$\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 land(u32 a0, u32 a1) {\n return 0 < a0 & 0 < a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 land(s32 arg0, s32 arg1) {\n return (arg0 != 0) & (arg1 != 0);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `land` — benchmark function synthetic:land:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel land\n sltu\t$a0, $zero, $a0\n sltu\t$v0, $zero, $a1\n jr\t$ra\n and\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function land # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `land` — benchmark function synthetic:land:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:land:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\ta0,zero,a0\n 4:\tsltu\tv0,zero,a1\n 8:\tjr\tra\n c:\tand\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2322f6506302af62/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 land\n\n\nContents of section .text:\n 0000 0004202b 0005102b 03e00008 00821024 .. +...+.......$\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name land # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:land:ido7.1","sym":"land","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","logical-and"],"loc":1,"refSource":"int land(int a,int b){ return a && b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tv0,zero,a0\n 4:\tbeqz\tv0,10 \n 8:\tnop\n c:\tsltu\tv0,zero,a1\n 10:\tjr\tra\n 14:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 land\n\n\nContents of section .text:\n 0000 0004102b 10400002 00000000 0005102b ...+.@.........+\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 33323266 36353036 33303261 ef-2322f6506302a\n 0130 6636322f 7265662e 63006c61 6e640000 f62/ref.c.land..\n 0140 6c616e64 00000000 00000000 00000001 land............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 land(s32 a0, s32 a1) {\n s32 v0;\n if (0 >= a0) {\n v0 = 0 < a0;\n } else {\n v0 = 0 < a1;\n }\n return v0;\n}\n","score":5,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":5,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 land(s32 arg0, s32 arg1) {\n s32 var_v0;\n\n var_v0 = arg0 != 0;\n if (var_v0 != 0) {\n var_v0 = arg1 != 0;\n }\n return var_v0;\n}\n","score":4,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":6,"ratio":0.6666666666666666,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `land` — benchmark function synthetic:land:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel land\n sltu\t$v0, $zero, $a0\n beqz\t$v0, .L10\n nop\n sltu\t$v0, $zero, $a1\n.L10:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function land # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `land` — benchmark function synthetic:land:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:land:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tv0,zero,a0\n 4:\tbeqz\tv0,10 \n 8:\tnop\n c:\tsltu\tv0,zero,a1\n 10:\tjr\tra\n 14:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 land\n\n\nContents of section .text:\n 0000 0004102b 10400002 00000000 0005102b ...+.@.........+\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 33323266 36353036 33303261 ef-2322f6506302a\n 0130 6636322f 7265662e 63006c61 6e640000 f62/ref.c.land..\n 0140 6c616e64 00000000 00000000 00000001 land............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name land # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:land:mwcc_242_81","sym":"land","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","logical-and"],"loc":1,"refSource":"int land(int a,int b){ return a && b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r3,0\n 8:\tbeqlr\n c:\tcmpwi r4,0\n 10:\tbeqlr\n 14:\tli r3,1\n 18:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c land\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 land\n\n\nContents of section .text:\n 0000 2c030000 38600000 4d820020 2c040000 ,...8`..M.. ,...\n 0010 4d820020 38600001 4e800020 M.. 8`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed/flip-branch","outcome":"nonmatch","source":"s32 land(s32 a0, s32 a1) {\n if (a0 == 0) {\n return 0;\n } else {\n if (a1 == 0) {\n return 0;\n } else {\n return 1;\n }\n }\n}\n","score":5,"maxScore":8,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":3,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 land(s32 arg0, s32 arg1) {\n if ((arg0 != 0) && (arg1 != 0)) {\n return 1;\n }\n return 0;\n}\n","score":6,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":1,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":8,"ratio":0.625,"kinds":{"insert":1,"delete":0,"replace":3,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `land` — benchmark function synthetic:land:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel land\n cmpwi r3,0\n li r3,0\n beqlr\n cmpwi r4,0\n beqlr\n li r3,1\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function land # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `land` — benchmark function synthetic:land:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:land:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r3,0\n 8:\tbeqlr\n c:\tcmpwi r4,0\n 10:\tbeqlr\n 14:\tli r3,1\n 18:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c land\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 land\n\n\nContents of section .text:\n 0000 2c030000 38600000 4d820020 2c040000 ,...8`..M.. ,...\n 0010 4d820020 38600001 4e800020 M.. 8`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name land # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ll2i:agbcc","sym":"ll2i","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["s64","cast","narrow"],"loc":1,"refSource":"int ll2i(long long x){ return (int)x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tll2i\n\t.type\t ll2i,function\n\t.thumb_func\nll2i:\n\tbx\tlr\n.Lfe1:\n\t.size\t ll2i,.Lfe1-ll2i\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 ll2i(u32 a0) {\n return a0;\n}\n","score":0,"maxScore":1,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void ll2i(void) {\n\n}\n","score":0,"maxScore":1,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":2,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ll2i` — benchmark function synthetic:ll2i:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tll2i\n\t.type\t ll2i,function\n\t.thumb_func\nll2i:\n\tbx\tlr\n.Lfe1:\n\t.size\t ll2i,.Lfe1-ll2i\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ll2i # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ll2i` — benchmark function synthetic:ll2i:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ll2i:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tll2i\n\t.type\t ll2i,function\n\t.thumb_func\nll2i:\n\tbx\tlr\n.Lfe1:\n\t.size\t ll2i,.Lfe1-ll2i\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ll2i # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ll2i:gcc2.7.2kmc","sym":"ll2i","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["s64","cast","narrow"],"loc":1,"refSource":"int ll2i(long long x){ return (int)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tmove\tv0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1e47ea258fbd8acf/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 ll2i\n\n\nContents of section .text:\n 0000 03e00008 00a01021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 80000024 00000000 00000000 00000000 ...$............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"u32 ll2i(u32 a0) {\n return a0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 ll2i(s32 arg1) {\n return arg1;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":2,"ratio":0.5,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ll2i` — benchmark function synthetic:ll2i:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ll2i\n jr\t$ra\n move\t$v0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ll2i # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ll2i` — benchmark function synthetic:ll2i:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ll2i:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tmove\tv0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1e47ea258fbd8acf/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 ll2i\n\n\nContents of section .text:\n 0000 03e00008 00a01021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 80000024 00000000 00000000 00000000 ...$............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ll2i # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ll2i:ido7.1","sym":"ll2i","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["s64","cast","narrow"],"loc":1,"refSource":"int ll2i(long long x){ return (int)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tjr\tra\n c:\tmove\tv0,a1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ll2i\n\n\nContents of section .text:\n 0000 afa40000 afa50004 03e00008 00a01025 ...............%\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 65343765 61323538 66626438 ef-1e47ea258fbd8\n 0130 6163662f 7265662e 63006c6c 32690000 acf/ref.c.ll2i..\n 0140 6c6c3269 00000000 00000000 00000001 ll2i............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"u32 ll2i(u32 a0, u32 a1) {\n return a1;\n}\n","score":1,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 ll2i(s32 arg0, s32 arg1) {\n return arg1;\n}\n","score":1,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":4,"ratio":0.25,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ll2i` — benchmark function synthetic:ll2i:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ll2i\n sw\t$a0, 0($sp)\n sw\t$a1, 4($sp)\n jr\t$ra\n move\t$v0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ll2i # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ll2i` — benchmark function synthetic:ll2i:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ll2i:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tjr\tra\n c:\tmove\tv0,a1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 ll2i\n\n\nContents of section .text:\n 0000 afa40000 afa50004 03e00008 00a01025 ...............%\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 65343765 61323538 66626438 ef-1e47ea258fbd8\n 0130 6163662f 7265662e 63006c6c 32690000 acf/ref.c.ll2i..\n 0140 6c6c3269 00000000 00000000 00000001 ll2i............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ll2i # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ll2i:mwcc_242_81","sym":"ll2i","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["s64","cast","narrow"],"loc":1,"refSource":"int ll2i(long long x){ return (int)x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmr r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 ll2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ll2i\n\n\nContents of section .text:\n 0000 7c832378 4e800020 |.#xN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"u32 ll2i(u32 a0) {\n return a0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 ll2i(s32 arg1) {\n return arg1;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":2,"ratio":0.5,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ll2i` — benchmark function synthetic:ll2i:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ll2i\n mr r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ll2i # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ll2i` — benchmark function synthetic:ll2i:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ll2i:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmr r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 ll2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ll2i\n\n\nContents of section .text:\n 0000 7c832378 4e800020 |.#xN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ll2i # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lladd:agbcc","sym":"lladd","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long lladd(long long a,long long b){ return a+b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tlladd\n\t.type\t lladd,function\n\t.thumb_func\nlladd:\n\tadd\tr0, r0, r2\n\tadc\tr1, r1, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t lladd,.Lfe1-lladd\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 lladd(u32 a0, u32 a1, u32 a2, u32 a3) {\n return a0 + a2;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 lladd(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {\n return arg0 + arg2;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":3,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lladd` — benchmark function synthetic:lladd:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tlladd\n\t.type\t lladd,function\n\t.thumb_func\nlladd:\n\tadd\tr0, r0, r2\n\tadc\tr1, r1, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t lladd,.Lfe1-lladd\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lladd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lladd` — benchmark function synthetic:lladd:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lladd:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tlladd\n\t.type\t lladd,function\n\t.thumb_func\nlladd:\n\tadd\tr0, r0, r2\n\tadc\tr1, r1, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t lladd,.Lfe1-lladd\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name lladd # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lladd:gcc2.7.2kmc","sym":"lladd","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long lladd(long long a,long long b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv1,a1,a3\n 4:\tsltu\tt0,v1,a3\n 8:\taddu\tv0,a0,a2\n c:\tjr\tra\n 10:\taddu\tv0,v0,t0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-e73bcbddbb9e8885/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 lladd\n\n\nContents of section .text:\n 0000 00a71821 0067402b 00861021 03e00008 ...!.g@+...!....\n 0010 00481021 00000000 00000000 00000000 .H.!............\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 lladd(u32 a0, u32 a1, u32 a2, u32 a3) {\n return a0 + a2 + (a1 + a3 < a3);\n}\n","score":5,"maxScore":6,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 lladd(s32 arg0, s32 arg1, s32 arg2, u32 arg3) {\n return arg0 + arg2 + ((u32) (arg1 + arg3) < arg3);\n}\n","score":5,"maxScore":6,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":6,"ratio":0.8333333333333334,"kinds":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lladd` — benchmark function synthetic:lladd:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lladd\n addu\t$v1, $a1, $a3\n sltu\t$t0, $v1, $a3\n addu\t$v0, $a0, $a2\n jr\t$ra\n addu\t$v0, $v0, $t0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lladd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lladd` — benchmark function synthetic:lladd:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lladd:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv1,a1,a3\n 4:\tsltu\tt0,v1,a3\n 8:\taddu\tv0,a0,a2\n c:\tjr\tra\n 10:\taddu\tv0,v0,t0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-e73bcbddbb9e8885/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 lladd\n\n\nContents of section .text:\n 0000 00a71821 0067402b 00861021 03e00008 ...!.g@+...!....\n 0010 00481021 00000000 00000000 00000000 .H.!............\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name lladd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lladd:ido7.1","sym":"lladd","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long lladd(long long a,long long b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv1,a1,a3\n 4:\tsltu\tat,v1,a3\n 8:\taddu\tv0,at,a0\n c:\taddu\tv0,v0,a2\n 10:\tsw\ta0,0(sp)\n 14:\tsw\ta1,4(sp)\n 18:\tsw\ta2,8(sp)\n 1c:\tjr\tra\n 20:\tsw\ta3,12(sp)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 lladd\n\n\nContents of section .text:\n 0000 00a71821 0067082b 00241021 00461021 ...!.g.+.$.!.F.!\n 0010 afa40000 afa50004 afa60008 03e00008 ................\n 0020 afa7000c 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000024 20200001 00000001 .......$ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 37336263 62646462 62396538 ef-e73bcbddbb9e8\n 0130 3838352f 7265662e 63006c6c 61646400 885/ref.c.lladd.\n 0140 6c6c6164 64000000 00000000 00000001 lladd...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000009 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 lladd(u32 a0, u32 a1, u32 a2, u32 a3) {\n return (a1 + a3 < a3) + a0 + a2;\n}\n","score":8,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 lladd(s32 arg0, s32 arg1, s32 arg2, u32 arg3) {\n return ((u32) (arg1 + arg3) < arg3) + arg0 + arg2;\n}\n","score":8,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":8,"maxScore":9,"ratio":0.8888888888888888,"kinds":{"insert":0,"delete":4,"replace":1,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lladd` — benchmark function synthetic:lladd:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lladd\n addu\t$v1, $a1, $a3\n sltu\t$at, $v1, $a3\n addu\t$v0, $at, $a0\n addu\t$v0, $v0, $a2\n sw\t$a0, 0($sp)\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n jr\t$ra\n sw\t$a3, 12($sp)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lladd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lladd` — benchmark function synthetic:lladd:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lladd:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddu\tv1,a1,a3\n 4:\tsltu\tat,v1,a3\n 8:\taddu\tv0,at,a0\n c:\taddu\tv0,v0,a2\n 10:\tsw\ta0,0(sp)\n 14:\tsw\ta1,4(sp)\n 18:\tsw\ta2,8(sp)\n 1c:\tjr\tra\n 20:\tsw\ta3,12(sp)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 lladd\n\n\nContents of section .text:\n 0000 00a71821 0067082b 00241021 00461021 ...!.g.+.$.!.F.!\n 0010 afa40000 afa50004 afa60008 03e00008 ................\n 0020 afa7000c 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000024 20200001 00000001 .......$ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 37336263 62646462 62396538 ef-e73bcbddbb9e8\n 0130 3838352f 7265662e 63006c6c 61646400 885/ref.c.lladd.\n 0140 6c6c6164 64000000 00000000 00000001 lladd...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000009 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lladd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lladd:mwcc_242_81","sym":"lladd","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long lladd(long long a,long long b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddc r4,r4,r6\n 4:\tadde r3,r3,r5\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c lladd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 lladd\n\n\nContents of section .text:\n 0000 7c843014 7c632914 4e800020 |.0.|c).N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"s32 lladd(s32 a0, s32 a1, s32 a2, s32 a3) {\n return ASMLIFT_ERROR(\"unmodelled instruction 'adde'\", a0, a2);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":3,"gotos":0,"casts":0,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: unmodelled instruction 'adde'"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 lladd(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {\n return arg0 + arg2 + M2C_CARRY;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_CARRY"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lladd` — benchmark function synthetic:lladd:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lladd\n addc r4,r4,r6\n adde r3,r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lladd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lladd` — benchmark function synthetic:lladd:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lladd:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddc r4,r4,r6\n 4:\tadde r3,r3,r5\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c lladd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 lladd\n\n\nContents of section .text:\n 0000 7c843014 7c632914 4e800020 |.0.|c).N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lladd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llcmp:agbcc","sym":"llcmp","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["s64","compare"],"loc":1,"refSource":"int llcmp(long long a,long long b){ return a a1) {\n return 1;\n } else {\n if (a3 != a1) {\n v0 = 0;\n return v0;\n } else {\n if (a2 <= a0) {\n v0 = 0;\n return v0;\n } else {\n return 1;\n }\n }\n }\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":1,"delete":4,"replace":0,"opMismatch":1,"argMismatch":3},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 llcmp(u32 arg0, s32 arg1, u32 arg2, s32 arg3) {\n s32 var_r4;\n\n var_r4 = 0;\n if ((arg3 > arg1) || ((arg3 == arg1) && (arg2 > arg0))) {\n var_r4 = 1;\n }\n return var_r4;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llcmp` — benchmark function synthetic:llcmp:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllcmp\n\t.type\t llcmp,function\n\t.thumb_func\nllcmp:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tcmp\tr3, r1\n\tbgt\t.L4\t@cond_branch\n\tcmp\tr3, r1\n\tbne\t.L3\t@cond_branch\n\tcmp\tr2, r0\n\tbls\t.L3\t@cond_branch\n.L4:\n\tmov\tr4, #0x1\n.L3:\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t llcmp,.Lfe1-llcmp\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llcmp` — benchmark function synthetic:llcmp:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llcmp:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllcmp\n\t.type\t llcmp,function\n\t.thumb_func\nllcmp:\n\tpush\t{r4, lr}\n\tmov\tr4, #0x0\n\tcmp\tr3, r1\n\tbgt\t.L4\t@cond_branch\n\tcmp\tr3, r1\n\tbne\t.L3\t@cond_branch\n\tcmp\tr2, r0\n\tbls\t.L3\t@cond_branch\n.L4:\n\tmov\tr4, #0x1\n.L3:\n\tadd\tr0, r4, #0\n\tpop\t{r4}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t llcmp,.Lfe1-llcmp\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llcmp # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llcmp:gcc2.7.2kmc","sym":"llcmp","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["s64","compare"],"loc":1,"refSource":"int llcmp(long long a,long long b){ return a:\n 0:\tslt\tv0,a0,a2\n 4:\tbnez\tv0,20 \n 8:\tmove\tv1,zero\n c:\tbne\ta2,a0,24 \n 10:\tnop\n 14:\tsltu\tv0,a1,a3\n 18:\tbeqz\tv0,24 \n 1c:\tnop\n 20:\tli\tv1,1\n 24:\tjr\tra\n 28:\tmove\tv0,v1\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-87d3352b1f51be25/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c llcmp\n\n\nContents of section .text:\n 0000 0086102a 14400006 00001821 14c40005 ...*.@.....!....\n 0010 00000000 00a7102b 10400002 00000000 .......+.@......\n 0020 24030001 03e00008 00601021 00000000 $........`.!....\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 llcmp(s32 a0, s32 a1, s32 a2, s32 a3) {\n s32 v1;\n if (a0 >= a2) {\n if (a2 == a0) {\n if (a1 < a3) {\n return 1;\n } else {\n v1 = 0;\n return v1;\n }\n } else {\n v1 = 0;\n return v1;\n }\n } else {\n return 1;\n }\n}\n","score":12,"maxScore":14,"compileErrors":null,"breakdown":{"insert":3,"delete":6,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 llcmp(s32 arg0, u32 arg1, s32 arg2, u32 arg3) {\n s32 var_v1;\n\n var_v1 = 0;\n if ((arg0 < arg2) || ((arg2 == arg0) && (arg1 < arg3))) {\n var_v1 = 1;\n }\n return var_v1;\n}\n","score":7,"maxScore":12,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":2,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":7,"maxScore":12,"ratio":0.5833333333333334,"kinds":{"insert":1,"delete":0,"replace":2,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llcmp` — benchmark function synthetic:llcmp:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llcmp\n slt\t$v0, $a0, $a2\n bnez\t$v0, .L20\n move\t$v1, $zero\n bne\t$a2, $a0, .L24\n nop\n sltu\t$v0, $a1, $a3\n beqz\t$v0, .L24\n nop\n.L20:\n li\t$v1, 1\n.L24:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llcmp` — benchmark function synthetic:llcmp:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llcmp:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a2\n 4:\tbnez\tv0,20 \n 8:\tmove\tv1,zero\n c:\tbne\ta2,a0,24 \n 10:\tnop\n 14:\tsltu\tv0,a1,a3\n 18:\tbeqz\tv0,24 \n 1c:\tnop\n 20:\tli\tv1,1\n 24:\tjr\tra\n 28:\tmove\tv0,v1\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-87d3352b1f51be25/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c llcmp\n\n\nContents of section .text:\n 0000 0086102a 14400006 00001821 14c40005 ...*.@.....!....\n 0010 00000000 00a7102b 10400002 00000000 .......+.@......\n 0020 24030001 03e00008 00601021 00000000 $........`.!....\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llcmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llcmp:ido7.1","sym":"llcmp","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["s64","compare"],"loc":1,"refSource":"int llcmp(long long a,long long b){ return a:\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tsw\ta2,8(sp)\n c:\tsw\ta3,12(sp)\n 10:\tbne\ta0,a2,1c \n 14:\tslt\tv0,a0,a2\n 18:\tsltu\tv0,a1,a3\n 1c:\tjr\tra\n 20:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 llcmp\n\n\nContents of section .text:\n 0000 afa40000 afa50004 afa60008 afa7000c ................\n 0010 14860002 0086102a 00a7102b 03e00008 .......*...+....\n 0020 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000f4 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f4 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000024 20200001 00000001 .......$ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 37643333 35326231 66353162 ef-87d3352b1f51b\n 0130 6532352f 7265662e 63006c6c 636d7000 e25/ref.c.llcmp.\n 0140 6c6c636d 70000000 00000000 00000001 llcmp...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000009 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 llcmp(u32 a0, u32 a1, u32 a2, u32 a3) {\n s32 v0;\n if (a0 != a2) {\n v0 = a0 < a2;\n } else {\n v0 = a1 < a3;\n }\n return v0;\n}\n","score":10,"maxScore":11,"compileErrors":null,"breakdown":{"insert":2,"delete":5,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 llcmp(s32 arg0, u32 arg1, s32 arg2, u32 arg3) {\n s32 var_v0;\n\n var_v0 = arg0 < arg2;\n if (arg0 == arg2) {\n var_v0 = arg1 < arg3;\n }\n return var_v0;\n}\n","score":7,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":7,"maxScore":9,"ratio":0.7777777777777778,"kinds":{"insert":0,"delete":4,"replace":1,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llcmp` — benchmark function synthetic:llcmp:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llcmp\n sw\t$a0, 0($sp)\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n sw\t$a3, 12($sp)\n bne\t$a0, $a2, .L1c\n slt\t$v0, $a0, $a2\n sltu\t$v0, $a1, $a3\n.L1c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llcmp` — benchmark function synthetic:llcmp:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llcmp:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tsw\ta2,8(sp)\n c:\tsw\ta3,12(sp)\n 10:\tbne\ta0,a2,1c \n 14:\tslt\tv0,a0,a2\n 18:\tsltu\tv0,a1,a3\n 1c:\tjr\tra\n 20:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 llcmp\n\n\nContents of section .text:\n 0000 afa40000 afa50004 afa60008 afa7000c ................\n 0010 14860002 0086102a 00a7102b 03e00008 .......*...+....\n 0020 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a00000f4 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f4 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000024 20200001 00000001 .......$ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 37643333 35326231 66353162 ef-87d3352b1f51b\n 0130 6532352f 7265662e 63006c6c 636d7000 e25/ref.c.llcmp.\n 0140 6c6c636d 70000000 00000000 00000001 llcmp...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000009 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llcmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llcmp:mwcc_242_81","sym":"llcmp","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["s64","compare"],"loc":1,"refSource":"int llcmp(long long a,long long b){ return a:\n 0:\txoris r7,r3,32768\n 4:\txoris r3,r5,32768\n 8:\tsubfc r0,r6,r4\n c:\tsubfe r3,r3,r7\n 10:\tsubfe r3,r7,r7\n 14:\tneg r3,r3\n 18:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c llcmp\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llcmp\n\n\nContents of section .text:\n 0000 6c678000 6ca38000 7c062010 7c633910 lg..l...|. .|c9.\n 0010 7c673910 7c6300d0 4e800020 |g9.|c..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"s32 llcmp(s32 a0, s32 a1, s32 a2, s32 a3) {\n return -ASMLIFT_ERROR(\"unmodelled instruction 'subfe'\", ASMLIFT_ERROR(\"unmodelled instruction 'xoris'\", a0), ASMLIFT_ERROR(\"unmodelled instruction 'xoris'\", a0));\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":64,"lines":3,"gotos":0,"casts":0,"unkGlue":3,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: unmodelled instruction 'subfe'","structure: unmodelled instruction 'xoris'","structure: unmodelled instruction 'xoris'"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 llcmp(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {\n s32 temp_r7;\n\n temp_r7 = arg0 ^ 0x80000000;\n return -((temp_r7 - temp_r7) - !M2C_CARRY);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_CARRY"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llcmp` — benchmark function synthetic:llcmp:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llcmp\n xoris r7,r3,32768\n xoris r3,r5,32768\n subfc r0,r6,r4\n subfe r3,r3,r7\n subfe r3,r7,r7\n neg r3,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llcmp # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llcmp` — benchmark function synthetic:llcmp:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llcmp:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\txoris r7,r3,32768\n 4:\txoris r3,r5,32768\n 8:\tsubfc r0,r6,r4\n c:\tsubfe r3,r3,r7\n 10:\tsubfe r3,r7,r7\n 14:\tneg r3,r3\n 18:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c llcmp\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llcmp\n\n\nContents of section .text:\n 0000 6c678000 6ca38000 7c062010 7c633910 lg..l...|. .|c9.\n 0010 7c673910 7c6300d0 4e800020 |g9.|c..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llcmp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshl:agbcc","sym":"llshl","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["s64","shift"],"loc":1,"refSource":"long long llshl(long long a,int b){ return a< in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllshl\n\t.type\t llshl,function\n\t.thumb_func\nllshl:\n\tpush\t{lr}\n\tbl\t__ashldi3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t llshl,.Lfe1-llshl\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshl` — benchmark function synthetic:llshl:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshl:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllshl\n\t.type\t llshl,function\n\t.thumb_func\nllshl:\n\tpush\t{lr}\n\tbl\t__ashldi3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t llshl,.Lfe1-llshl\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshl # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshl:gcc2.7.2kmc","sym":"llshl","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["s64","shift"],"loc":1,"refSource":"long long llshl(long long a,int b){ return a<:\n 0:\tsll\ta3,a2,0x1a\n 4:\tbgez\ta3,18 \n 8:\tnop\n c:\tsllv\tv0,a1,a2\n 10:\tb\t30 \n 14:\tmove\tv1,zero\n 18:\tbeqz\ta3,2c \n 1c:\tsllv\tv0,a0,a2\n 20:\tnegu\ta3,a2\n 24:\tsrlv\ta3,a1,a3\n 28:\tor\tv0,v0,a3\n 2c:\tsllv\tv1,a1,a2\n 30:\tjr\tra\n 34:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4db236487d605d43/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 llshl\n\n\nContents of section .text:\n 0000 00063e80 04e10004 00000000 00c51004 ..>.............\n 0010 10000007 00001821 10e00004 00c41004 .......!........\n 0020 00063823 00e53806 00471025 00c51804 ..8#..8..G.%....\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 llshl(u32 a0, u32 a1, u32 a2) {\n s32 v0;\n if (a2 << 26 < 0) {\n return a1 << a2;\n } else {\n if (a2 << 26 == 0) {\n v0 = a0 << a2;\n } else {\n v0 = a0 << a2 | a1 >> -a2;\n }\n return v0;\n }\n}\n","score":11,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":2,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 llshl(s32 arg0, u32 arg1, s32 arg2) {\n s32 var_v0;\n\n if (arg2 & 0x20) {\n return arg1 << arg2;\n }\n var_v0 = arg0 << arg2;\n if ((arg2 << 0x1A) != 0) {\n var_v0 |= arg1 >> -arg2;\n }\n return var_v0;\n}\n","score":15,"maxScore":17,"compileErrors":null,"breakdown":{"insert":3,"delete":5,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":11,"maxScore":14,"ratio":0.7857142857142857,"kinds":{"insert":0,"delete":4,"replace":2,"opMismatch":0,"argMismatch":5}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llshl` — benchmark function synthetic:llshl:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llshl\n sll\t$a3, $a2, 0x1a\n bgez\t$a3, .L18\n nop\n sllv\t$v0, $a1, $a2\n b\t.L30\n move\t$v1, $zero\n.L18:\n beqz\t$a3, .L2c\n sllv\t$v0, $a0, $a2\n negu\t$a3, $a2\n srlv\t$a3, $a1, $a3\n or\t$v0, $v0, $a3\n.L2c:\n sllv\t$v1, $a1, $a2\n.L30:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshl` — benchmark function synthetic:llshl:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshl:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta3,a2,0x1a\n 4:\tbgez\ta3,18 \n 8:\tnop\n c:\tsllv\tv0,a1,a2\n 10:\tb\t30 \n 14:\tmove\tv1,zero\n 18:\tbeqz\ta3,2c \n 1c:\tsllv\tv0,a0,a2\n 20:\tnegu\ta3,a2\n 24:\tsrlv\ta3,a1,a3\n 28:\tor\tv0,v0,a3\n 2c:\tsllv\tv1,a1,a2\n 30:\tjr\tra\n 34:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4db236487d605d43/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 llshl\n\n\nContents of section .text:\n 0000 00063e80 04e10004 00000000 00c51004 ..>.............\n 0010 10000007 00001821 10e00004 00c41004 .......!........\n 0020 00063823 00e53806 00471025 00c51804 ..8#..8..G.%....\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshl:ido7.1","sym":"llshl","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["s64","shift"],"loc":1,"refSource":"long long llshl(long long a,int b){ return a<:\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tsw\ta2,32(sp)\n c:\tmove\ta3,a2\n 10:\tsra\ta2,a2,0x1f\n 14:\tsw\ta0,24(sp)\n 18:\tjal\t0 \n 1c:\tsw\ta1,28(sp)\n 20:\tlw\tra,20(sp)\n 24:\taddiu\tsp,sp,24\n 28:\tjr\tra\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000030 llshl\n00000000 F *UND*\t00000000 __ll_lshift\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 __ll_lshift\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 afa60020 00c03825 '.......... ..8%\n 0010 000637c3 afa40018 0c000000 afa5001c ..7.............\n 0020 8fbf0014 27bd0018 03e00008 00000000 ....'...........\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000c 00000004 000001d0 p...............\n 0010 00000006 0000032c 00000001 000001d4 .......,........\n 0020 00000004 00000208 00000000 00000000 ................\n 0030 00000011 00000238 00000034 0000027c .......8...4...|\n 0040 00000014 000002b0 00000001 000002c4 ................\n 0050 00000000 00000000 00000002 0000030c ................\n 0060 08020000 00000000 00000001 00000000 ................\n 0070 80000000 fffffffc ffffffff 00000000 ................\n 0080 00000000 00000018 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000030 20200001 00000001 .......0 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 64623233 36343837 64363035 ef-4db236487d605\n 0130 6434332f 7265662e 63006c6c 73686c00 d43/ref.c.llshl.\n 0140 6c6c7368 6c005f5f 6c6c5f6c 73686966 llshl.__ll_lshif\n 0150 74000000 00000000 00000001 00000000 t...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 0000000c 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000002 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000006 00000000 18cfffff 00000000 ................\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 7fffffff 00000000 7fffffff ................\n 01e0 00000001 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'llshl' — lift: cannot lift 'llshl': function call 'jal' at 0x18 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,20(sp) */\n/* 8:\tsw\ta2,32(sp) */\n/* c:\tmove\ta3,a2 */\n/* 10:\tsra\ta2,a2,0x1f */\n/* 14:\tsw\ta0,24(sp) */\n/* 18:\tjal\t0 */\n/* 1c:\tsw\ta1,28(sp) */\n/* 20:\tlw\tra,20(sp) */\n/* 24:\taddiu\tsp,sp,24 */\n/* 28:\tjr\tra */\n/* 2c:\tnop */\nvoid llshl(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'llshl': function call 'jal' at 0x18 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'llshl': function call 'jal' at 0x18 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? __ll_lshift(s32, s32); /* extern */\n\nvoid llshl(s32 arg0, ? arg1, s32 arg2) {\n __ll_lshift(arg2 >> 0x1F, arg2);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llshl` — benchmark function synthetic:llshl:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llshl\n addiu\t$sp, $sp, -24\n sw\t$ra, 20($sp)\n sw\t$a2, 32($sp)\n move\t$a3, $a2\n sra\t$a2, $a2, 0x1f\n sw\t$a0, 24($sp)\n jal\t__ll_lshift\n sw\t$a1, 28($sp)\n lw\t$ra, 20($sp)\n addiu\t$sp, $sp, 24\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshl` — benchmark function synthetic:llshl:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshl:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tsw\ta2,32(sp)\n c:\tmove\ta3,a2\n 10:\tsra\ta2,a2,0x1f\n 14:\tsw\ta0,24(sp)\n 18:\tjal\t0 \n 1c:\tsw\ta1,28(sp)\n 20:\tlw\tra,20(sp)\n 24:\taddiu\tsp,sp,24\n 28:\tjr\tra\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000030 llshl\n00000000 F *UND*\t00000000 __ll_lshift\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 __ll_lshift\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 afa60020 00c03825 '.......... ..8%\n 0010 000637c3 afa40018 0c000000 afa5001c ..7.............\n 0020 8fbf0014 27bd0018 03e00008 00000000 ....'...........\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000c 00000004 000001d0 p...............\n 0010 00000006 0000032c 00000001 000001d4 .......,........\n 0020 00000004 00000208 00000000 00000000 ................\n 0030 00000011 00000238 00000034 0000027c .......8...4...|\n 0040 00000014 000002b0 00000001 000002c4 ................\n 0050 00000000 00000000 00000002 0000030c ................\n 0060 08020000 00000000 00000001 00000000 ................\n 0070 80000000 fffffffc ffffffff 00000000 ................\n 0080 00000000 00000018 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000030 20200001 00000001 .......0 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 64623233 36343837 64363035 ef-4db236487d605\n 0130 6434332f 7265662e 63006c6c 73686c00 d43/ref.c.llshl.\n 0140 6c6c7368 6c005f5f 6c6c5f6c 73686966 llshl.__ll_lshif\n 0150 74000000 00000000 00000001 00000000 t...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 0000000c 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000002 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000006 00000000 18cfffff 00000000 ................\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 7fffffff 00000000 7fffffff ................\n 01e0 00000001 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshl:mwcc_242_81","sym":"llshl","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["s64","shift"],"loc":1,"refSource":"long long llshl(long long a,int b){ return a<:\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\t__shl2i\n 10:\tlwz r0,20(r1)\n 14:\tmtlr r0\n 18:\taddi r1,r1,16\n 1c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 llshl\n00000000 *UND*\t00000000 __shl2i\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 __shl2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llshl\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 7c0803a6 38210010 4e800020 ....|...8!..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 00000000 00000000 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 llshl(void) {\n return __shl2i();\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? __shl2i(); /* extern */\n\nvoid llshl(void) {\n __shl2i();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llshl` — benchmark function synthetic:llshl:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llshl\n stwu r1,-16(r1)\n mflr r0\n stw r0,20(r1)\n bl __shl2i\n lwz r0,20(r1)\n mtlr r0\n addi r1,r1,16\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshl` — benchmark function synthetic:llshl:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshl:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\t__shl2i\n 10:\tlwz r0,20(r1)\n 14:\tmtlr r0\n 18:\taddi r1,r1,16\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 llshl\n00000000 *UND*\t00000000 __shl2i\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 __shl2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llshl\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 7c0803a6 38210010 4e800020 ....|...8!..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 00000000 00000000 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshr:agbcc","sym":"llshr","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["s64","shift","signed"],"loc":1,"refSource":"long long llshr(long long a,int b){ return a>>b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllshr\n\t.type\t llshr,function\n\t.thumb_func\nllshr:\n\tpush\t{lr}\n\tbl\t__ashrdi3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t llshr,.Lfe1-llshr\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 llshr(void) {\n return __ashrdi3();\n}\n","score":2,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? __ashrdi3(); /* extern */\n\nvoid llshr(void) {\n __ashrdi3();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":4,"ratio":0.5,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llshr` — benchmark function synthetic:llshr:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllshr\n\t.type\t llshr,function\n\t.thumb_func\nllshr:\n\tpush\t{lr}\n\tbl\t__ashrdi3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t llshr,.Lfe1-llshr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshr` — benchmark function synthetic:llshr:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshr:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllshr\n\t.type\t llshr,function\n\t.thumb_func\nllshr:\n\tpush\t{lr}\n\tbl\t__ashrdi3\n\tpop\t{r2}\n\tbx\tr2\n.Lfe1:\n\t.size\t llshr,.Lfe1-llshr\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshr # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshr:gcc2.7.2kmc","sym":"llshr","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["s64","shift","signed"],"loc":1,"refSource":"long long llshr(long long a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta3,a2,0x1a\n 4:\tbgez\ta3,18 \n 8:\tnop\n c:\tsrav\tv1,a0,a2\n 10:\tb\t30 \n 14:\tsra\tv0,a0,0x1f\n 18:\tbeqz\ta3,2c \n 1c:\tsrlv\tv1,a1,a2\n 20:\tnegu\ta3,a2\n 24:\tsllv\ta3,a0,a3\n 28:\tor\tv1,v1,a3\n 2c:\tsrav\tv0,a0,a2\n 30:\tjr\tra\n 34:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f2ecd48c1bb7c741/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 llshr\n\n\nContents of section .text:\n 0000 00063e80 04e10004 00000000 00c41807 ..>.............\n 0010 10000007 000417c3 10e00004 00c51806 ................\n 0020 00063823 00e43804 00671825 00c41007 ..8#..8..g.%....\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 llshr(s32 a0, s32 a1, s32 a2) {\n if (a2 << 26 < 0) {\n return a0 >> 31;\n } else {\n return a0 >> a2;\n }\n}\n","score":11,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":8,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 llshr(s32 arg0, u32 arg1, s32 arg2) {\n if (arg2 & 0x20) {\n return arg0 >> 0x1F;\n }\n if ((arg2 << 0x1A) != 0) {\n\n }\n return arg0 >> arg2;\n}\n","score":10,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":8,"replace":2,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":10,"maxScore":14,"ratio":0.7142857142857143,"kinds":{"insert":0,"delete":8,"replace":2,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llshr` — benchmark function synthetic:llshr:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llshr\n sll\t$a3, $a2, 0x1a\n bgez\t$a3, .L18\n nop\n srav\t$v1, $a0, $a2\n b\t.L30\n sra\t$v0, $a0, 0x1f\n.L18:\n beqz\t$a3, .L2c\n srlv\t$v1, $a1, $a2\n negu\t$a3, $a2\n sllv\t$a3, $a0, $a3\n or\t$v1, $v1, $a3\n.L2c:\n srav\t$v0, $a0, $a2\n.L30:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshr` — benchmark function synthetic:llshr:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshr:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta3,a2,0x1a\n 4:\tbgez\ta3,18 \n 8:\tnop\n c:\tsrav\tv1,a0,a2\n 10:\tb\t30 \n 14:\tsra\tv0,a0,0x1f\n 18:\tbeqz\ta3,2c \n 1c:\tsrlv\tv1,a1,a2\n 20:\tnegu\ta3,a2\n 24:\tsllv\ta3,a0,a3\n 28:\tor\tv1,v1,a3\n 2c:\tsrav\tv0,a0,a2\n 30:\tjr\tra\n 34:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f2ecd48c1bb7c741/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 llshr\n\n\nContents of section .text:\n 0000 00063e80 04e10004 00000000 00c41807 ..>.............\n 0010 10000007 000417c3 10e00004 00c51806 ................\n 0020 00063823 00e43804 00671825 00c41007 ..8#..8..g.%....\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshr:ido7.1","sym":"llshr","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["s64","shift","signed"],"loc":1,"refSource":"long long llshr(long long a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tsw\ta2,32(sp)\n c:\tmove\ta3,a2\n 10:\tsra\ta2,a2,0x1f\n 14:\tsw\ta0,24(sp)\n 18:\tjal\t0 \n 1c:\tsw\ta1,28(sp)\n 20:\tlw\tra,20(sp)\n 24:\taddiu\tsp,sp,24\n 28:\tjr\tra\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000030 llshr\n00000000 F *UND*\t00000000 __ll_rshift\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 __ll_rshift\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 afa60020 00c03825 '.......... ..8%\n 0010 000637c3 afa40018 0c000000 afa5001c ..7.............\n 0020 8fbf0014 27bd0018 03e00008 00000000 ....'...........\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000c 00000004 000001d0 p...............\n 0010 00000006 0000032c 00000001 000001d4 .......,........\n 0020 00000004 00000208 00000000 00000000 ................\n 0030 00000011 00000238 00000034 0000027c .......8...4...|\n 0040 00000014 000002b0 00000001 000002c4 ................\n 0050 00000000 00000000 00000002 0000030c ................\n 0060 08020000 00000000 00000001 00000000 ................\n 0070 80000000 fffffffc ffffffff 00000000 ................\n 0080 00000000 00000018 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000030 20200001 00000001 .......0 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 32656364 34386331 62623763 ef-f2ecd48c1bb7c\n 0130 3734312f 7265662e 63006c6c 73687200 741/ref.c.llshr.\n 0140 6c6c7368 72005f5f 6c6c5f72 73686966 llshr.__ll_rshif\n 0150 74000000 00000000 00000001 00000000 t...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 0000000c 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000002 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000006 00000000 18cfffff 00000000 ................\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 7fffffff 00000000 7fffffff ................\n 01e0 00000001 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'llshr' — lift: cannot lift 'llshr': function call 'jal' at 0x18 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,20(sp) */\n/* 8:\tsw\ta2,32(sp) */\n/* c:\tmove\ta3,a2 */\n/* 10:\tsra\ta2,a2,0x1f */\n/* 14:\tsw\ta0,24(sp) */\n/* 18:\tjal\t0 */\n/* 1c:\tsw\ta1,28(sp) */\n/* 20:\tlw\tra,20(sp) */\n/* 24:\taddiu\tsp,sp,24 */\n/* 28:\tjr\tra */\n/* 2c:\tnop */\nvoid llshr(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'llshr': function call 'jal' at 0x18 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'llshr': function call 'jal' at 0x18 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? __ll_rshift(s32, s32); /* extern */\n\nvoid llshr(s32 arg0, ? arg1, s32 arg2) {\n __ll_rshift(arg2 >> 0x1F, arg2);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llshr` — benchmark function synthetic:llshr:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llshr\n addiu\t$sp, $sp, -24\n sw\t$ra, 20($sp)\n sw\t$a2, 32($sp)\n move\t$a3, $a2\n sra\t$a2, $a2, 0x1f\n sw\t$a0, 24($sp)\n jal\t__ll_rshift\n sw\t$a1, 28($sp)\n lw\t$ra, 20($sp)\n addiu\t$sp, $sp, 24\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshr` — benchmark function synthetic:llshr:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshr:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,20(sp)\n 8:\tsw\ta2,32(sp)\n c:\tmove\ta3,a2\n 10:\tsra\ta2,a2,0x1f\n 14:\tsw\ta0,24(sp)\n 18:\tjal\t0 \n 1c:\tsw\ta1,28(sp)\n 20:\tlw\tra,20(sp)\n 24:\taddiu\tsp,sp,24\n 28:\tjr\tra\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000030 llshr\n00000000 F *UND*\t00000000 __ll_rshift\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000018 R_MIPS_26 __ll_rshift\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0014 afa60020 00c03825 '.......... ..8%\n 0010 000637c3 afa40018 0c000000 afa5001c ..7.............\n 0020 8fbf0014 27bd0018 03e00008 00000000 ....'...........\nContents of section .options:\n 0000 01200000 00000000 a00000f0 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000f0 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000c 00000004 000001d0 p...............\n 0010 00000006 0000032c 00000001 000001d4 .......,........\n 0020 00000004 00000208 00000000 00000000 ................\n 0030 00000011 00000238 00000034 0000027c .......8...4...|\n 0040 00000014 000002b0 00000001 000002c4 ................\n 0050 00000000 00000000 00000002 0000030c ................\n 0060 08020000 00000000 00000001 00000000 ................\n 0070 80000000 fffffffc ffffffff 00000000 ................\n 0080 00000000 00000018 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000030 20200001 00000001 .......0 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 32656364 34386331 62623763 ef-f2ecd48c1bb7c\n 0130 3734312f 7265662e 63006c6c 73687200 741/ref.c.llshr.\n 0140 6c6c7368 72005f5f 6c6c5f72 73686966 llshr.__ll_rshif\n 0150 74000000 00000000 00000001 00000000 t...............\n 0160 00000034 00000000 00000004 00000000 ...4............\n 0170 0000000c 00000000 00000000 00000001 ................\n 0180 00000000 00000011 00000000 00000000 ................\n 0190 01800000 00000000 00000002 00000000 ................\n 01a0 00000000 00000000 18200001 00000000 ......... ......\n 01b0 00000006 00000000 18cfffff 00000000 ................\n 01c0 00000000 00000000 00000000 00000000 ................\n 01d0 00000000 7fffffff 00000000 7fffffff ................\n 01e0 00000001 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llshr:mwcc_242_81","sym":"llshr","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["s64","shift","signed"],"loc":1,"refSource":"long long llshr(long long a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\t__shr2i\n 10:\tlwz r0,20(r1)\n 14:\tmtlr r0\n 18:\taddi r1,r1,16\n 1c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 llshr\n00000000 *UND*\t00000000 __shr2i\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 __shr2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llshr\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 7c0803a6 38210010 4e800020 ....|...8!..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 00000000 00000000 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 llshr(void) {\n return __shr2i();\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"? __shr2i(); /* extern */\n\nvoid llshr(void) {\n __shr2i();\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":4,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["? placeholder"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llshr` — benchmark function synthetic:llshr:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llshr\n stwu r1,-16(r1)\n mflr r0\n stw r0,20(r1)\n bl __shr2i\n lwz r0,20(r1)\n mtlr r0\n addi r1,r1,16\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llshr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llshr` — benchmark function synthetic:llshr:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llshr:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\t__shr2i\n 10:\tlwz r0,20(r1)\n 14:\tmtlr r0\n 18:\taddi r1,r1,16\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 llshr\n00000000 *UND*\t00000000 __shr2i\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 __shr2i\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llshr\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 7c0803a6 38210010 4e800020 ....|...8!..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 00000000 00000000 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llshr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llsub:agbcc","sym":"llsub","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long llsub(long long a,long long b){ return a-b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllsub\n\t.type\t llsub,function\n\t.thumb_func\nllsub:\n\tsub\tr0, r0, r2\n\tsbc\tr1, r1, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t llsub,.Lfe1-llsub\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 llsub(u32 a0, u32 a1, u32 a2, u32 a3) {\n return a0 - a2;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 llsub(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {\n return arg0 - arg2;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":3,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llsub` — benchmark function synthetic:llsub:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllsub\n\t.type\t llsub,function\n\t.thumb_func\nllsub:\n\tsub\tr0, r0, r2\n\tsbc\tr1, r1, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t llsub,.Lfe1-llsub\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llsub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llsub` — benchmark function synthetic:llsub:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llsub:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tllsub\n\t.type\t llsub,function\n\t.thumb_func\nllsub:\n\tsub\tr0, r0, r2\n\tsbc\tr1, r1, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t llsub,.Lfe1-llsub\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llsub # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llsub:gcc2.7.2kmc","sym":"llsub","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long llsub(long long a,long long b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tt0,a1,a3\n 4:\tsubu\tv1,a1,a3\n 8:\tsubu\tv0,a0,a2\n c:\tjr\tra\n 10:\tsubu\tv0,v0,t0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-632f260ce4a0dc14/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 llsub\n\n\nContents of section .text:\n 0000 00a7402b 00a71823 00861023 03e00008 ..@+...#...#....\n 0010 00481023 00000000 00000000 00000000 .H.#............\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 llsub(u32 a0, u32 a1, u32 a2, u32 a3) {\n return a0 - a2 - (a1 < a3);\n}\n","score":5,"maxScore":6,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 llsub(s32 arg0, u32 arg1, s32 arg2, u32 arg3) {\n return (arg0 - arg2) - (arg1 < arg3);\n}\n","score":5,"maxScore":6,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":6,"ratio":0.8333333333333334,"kinds":{"insert":1,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llsub` — benchmark function synthetic:llsub:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llsub\n sltu\t$t0, $a1, $a3\n subu\t$v1, $a1, $a3\n subu\t$v0, $a0, $a2\n jr\t$ra\n subu\t$v0, $v0, $t0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llsub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llsub` — benchmark function synthetic:llsub:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llsub:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tt0,a1,a3\n 4:\tsubu\tv1,a1,a3\n 8:\tsubu\tv0,a0,a2\n c:\tjr\tra\n 10:\tsubu\tv0,v0,t0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-632f260ce4a0dc14/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 llsub\n\n\nContents of section .text:\n 0000 00a7402b 00a71823 00861023 03e00008 ..@+...#...#....\n 0010 00481023 00000000 00000000 00000000 .H.#............\nContents of section .reginfo:\n 0000 800001fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name llsub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llsub:ido7.1","sym":"llsub","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long llsub(long long a,long long b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tat,a1,a3\n 4:\tsubu\tv0,a0,a2\n 8:\tsubu\tv0,v0,at\n c:\tsw\ta0,0(sp)\n 10:\tsw\ta1,4(sp)\n 14:\tsw\ta2,8(sp)\n 18:\tsw\ta3,12(sp)\n 1c:\tjr\tra\n 20:\tsubu\tv1,a1,a3\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 llsub\n\n\nContents of section .text:\n 0000 00a7082b 00861023 00411023 afa40000 ...+...#.A.#....\n 0010 afa50004 afa60008 afa7000c 03e00008 ................\n 0020 00a71823 00000000 00000000 00000000 ...#............\nContents of section .options:\n 0000 01200000 00000000 a00000fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000024 20200001 00000001 .......$ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 33326632 36306365 34613064 ef-632f260ce4a0d\n 0130 6331342f 7265662e 63006c6c 73756200 c14/ref.c.llsub.\n 0140 6c6c7375 62000000 00000000 00000001 llsub...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000009 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 llsub(s32 a0, s32 a1, s32 a2, s32 a3) {\n return a0 - a2 - (a1 < a3);\n}\n","score":8,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":5,"replace":1,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 llsub(s32 arg0, u32 arg1, s32 arg2, u32 arg3) {\n return (arg0 - arg2) - (arg1 < arg3);\n}\n","score":9,"maxScore":10,"compileErrors":null,"breakdown":{"insert":1,"delete":6,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":8,"maxScore":9,"ratio":0.8888888888888888,"kinds":{"insert":0,"delete":5,"replace":1,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llsub` — benchmark function synthetic:llsub:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llsub\n sltu\t$at, $a1, $a3\n subu\t$v0, $a0, $a2\n subu\t$v0, $v0, $at\n sw\t$a0, 0($sp)\n sw\t$a1, 4($sp)\n sw\t$a2, 8($sp)\n sw\t$a3, 12($sp)\n jr\t$ra\n subu\t$v1, $a1, $a3\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llsub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llsub` — benchmark function synthetic:llsub:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llsub:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tat,a1,a3\n 4:\tsubu\tv0,a0,a2\n 8:\tsubu\tv0,v0,at\n c:\tsw\ta0,0(sp)\n 10:\tsw\ta1,4(sp)\n 14:\tsw\ta2,8(sp)\n 18:\tsw\ta3,12(sp)\n 1c:\tjr\tra\n 20:\tsubu\tv1,a1,a3\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000024 llsub\n\n\nContents of section .text:\n 0000 00a7082b 00861023 00411023 afa40000 ...+...#.A.#....\n 0010 afa50004 afa60008 afa7000c 03e00008 ................\n 0020 00a71823 00000000 00000000 00000000 ...#............\nContents of section .options:\n 0000 01200000 00000000 a00000fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00000fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000009 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000024 20200001 00000001 .......$ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 33326632 36306365 34613064 ef-632f260ce4a0d\n 0130 6331342f 7265662e 63006c6c 73756200 c14/ref.c.llsub.\n 0140 6c6c7375 62000000 00000000 00000001 llsub...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000009 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llsub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:llsub:mwcc_242_81","sym":"llsub","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["s64","arithmetic"],"loc":1,"refSource":"long long llsub(long long a,long long b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsubfc r4,r6,r4\n 4:\tsubfe r3,r5,r3\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c llsub\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llsub\n\n\nContents of section .text:\n 0000 7c862010 7c651910 4e800020 |. .|e..N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"s32 llsub(s32 a0, s32 a1, s32 a2, s32 a3) {\n return ASMLIFT_ERROR(\"unmodelled instruction 'subfe'\", a2, a0);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":3,"gotos":0,"casts":0,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: unmodelled instruction 'subfe'"]},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 llsub(s32 arg0, s32 arg1, s32 arg2, s32 arg3) {\n return (arg0 - arg2) - !M2C_CARRY;\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_CARRY"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `llsub` — benchmark function synthetic:llsub:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel llsub\n subfc r4,r6,r4\n subfe r3,r5,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function llsub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `llsub` — benchmark function synthetic:llsub:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:llsub:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsubfc r4,r6,r4\n 4:\tsubfe r3,r5,r3\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c llsub\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 llsub\n\n\nContents of section .text:\n 0000 7c862010 7c651910 4e800020 |. .|e..N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name llsub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loadoff:agbcc","sym":"loadoff","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","load","offset"],"loc":1,"refSource":"int loadoff(int *p){ return p[2]; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tloadoff\n\t.type\t loadoff,function\n\t.thumb_func\nloadoff:\n\tldr\tr0, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t loadoff,.Lfe1-loadoff\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 loadoff(s32 * a0) {\n return a0[2];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 loadoff(void *arg0) {\n return arg0->unk8;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:3: warning: dereferencing `void *' pointer","/cand.c.pp.c:3: request for member `unk8' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loadoff` — benchmark function synthetic:loadoff:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tloadoff\n\t.type\t loadoff,function\n\t.thumb_func\nloadoff:\n\tldr\tr0, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t loadoff,.Lfe1-loadoff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loadoff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loadoff` — benchmark function synthetic:loadoff:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loadoff:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tloadoff\n\t.type\t loadoff,function\n\t.thumb_func\nloadoff:\n\tldr\tr0, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t loadoff,.Lfe1-loadoff\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name loadoff # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loadoff:gcc2.7.2kmc","sym":"loadoff","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","load","offset"],"loc":1,"refSource":"int loadoff(int *p){ return p[2]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,8(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-6a1c213dc2f333f3/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 loadoff\n\n\nContents of section .text:\n 0000 03e00008 8c820008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 loadoff(s32 * a0) {\n return a0[2];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 loadoff(void *arg0) {\n return arg0->unk8;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: request for member `unk8' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loadoff` — benchmark function synthetic:loadoff:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loadoff\n jr\t$ra\n lw\t$v0, 8($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loadoff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loadoff` — benchmark function synthetic:loadoff:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loadoff:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,8(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-6a1c213dc2f333f3/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 loadoff\n\n\nContents of section .text:\n 0000 03e00008 8c820008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name loadoff # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loadoff:ido7.1","sym":"loadoff","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","load","offset"],"loc":1,"refSource":"int loadoff(int *p){ return p[2]; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,8(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 loadoff\n\n\nContents of section .text:\n 0000 03e00008 8c820008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 61316332 31336463 32663333 ef-6a1c213dc2f33\n 0130 3366332f 7265662e 63006c6f 61646f66 3f3/ref.c.loadof\n 0140 66000000 6c6f6164 6f666600 00000000 f...loadoff.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 loadoff(s32 * a0) {\n return a0[2];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 loadoff(void *arg0) {\n return arg0->unk8;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loadoff` — benchmark function synthetic:loadoff:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loadoff\n jr\t$ra\n lw\t$v0, 8($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loadoff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loadoff` — benchmark function synthetic:loadoff:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loadoff:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,8(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 loadoff\n\n\nContents of section .text:\n 0000 03e00008 8c820008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 61316332 31336463 32663333 ef-6a1c213dc2f33\n 0130 3366332f 7265662e 63006c6f 61646f66 3f3/ref.c.loadof\n 0140 66000000 6c6f6164 6f666600 00000000 f...loadoff.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name loadoff # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loadoff:mwcc_242_81","sym":"loadoff","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","load","offset"],"loc":1,"refSource":"int loadoff(int *p){ return p[2]; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r3,8(r3)\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 loadoff\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 loadoff\n\n\nContents of section .text:\n 0000 80630008 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 loadoff(s32 * a0) {\n return a0[2];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 loadoff(void *arg0) {\n return arg0->unk8;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loadoff` — benchmark function synthetic:loadoff:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loadoff\n lwz r3,8(r3)\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loadoff # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loadoff` — benchmark function synthetic:loadoff:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loadoff:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r3,8(r3)\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 loadoff\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 loadoff\n\n\nContents of section .text:\n 0000 80630008 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name loadoff # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loopif:agbcc","sym":"loopif","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","branch","memory"],"loc":1,"refSource":"int loopif(int *a,int n){ int s=0,i; for(i=0;i0) s+=a[i]; } return s; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tloopif\n\t.type\t loopif,function\n\t.thumb_func\nloopif:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r3, r2\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t loopif,.Lfe1-loopif\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 loopif(s32 * a0, u32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (0 >= a1) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n do {\n if (*v0 > 0) v1 = v1 + *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":5,"maxScore":16,"compileErrors":null,"breakdown":{"insert":3,"delete":1,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 loopif(s32 *arg0, s32 arg1) {\n s32 *var_r0;\n s32 temp_r2;\n s32 var_r1;\n s32 var_r3;\n\n var_r0 = arg0;\n var_r1 = arg1;\n var_r3 = 0;\n if (var_r1 > 0) {\n do {\n temp_r2 = *var_r0;\n if (temp_r2 > 0) {\n var_r3 += temp_r2;\n }\n var_r0 += 4;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n return var_r3;\n}\n","score":3,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":13,"ratio":0.23076923076923078,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loopif` — benchmark function synthetic:loopif:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tloopif\n\t.type\t loopif,function\n\t.thumb_func\nloopif:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r3, r2\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t loopif,.Lfe1-loopif\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loopif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loopif` — benchmark function synthetic:loopif:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loopif:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tloopif\n\t.type\t loopif,function\n\t.thumb_func\nloopif:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r3, r2\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t loopif,.Lfe1-loopif\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name loopif # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loopif:gcc2.7.2kmc","sym":"loopif","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","branch","memory"],"loc":1,"refSource":"int loopif(int *a,int n){ int s=0,i; for(i=0;i0) s+=a[i]; } return s; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,2c \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\tbgtzl\tv0,1c \n 18:\taddu\tv1,v1,v0\n 1c:\taddiu\ta2,a2,1\n 20:\tslt\tv0,a2,a1\n 24:\tbnez\tv0,10 \n 28:\taddiu\ta0,a0,4\n 2c:\tmove\tv0,v1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5e7394a3a37ff814/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 loopif\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00008 00001821 '.....0!.......!\n 0010 8c820000 5c400001 00621821 24c60001 ....\\@...b.!$...\n 0020 00c5102a 1440fffa 24840004 00601021 ...*.@..$....`.!\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'loopif' — lift: cannot lift 'loopif': unmodelled control transfer 'bgtzl' at 0x14 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-8 */\n/* 4:\tmove\ta2,zero */\n/* 8:\tblez\ta1,2c */\n/* c:\tmove\tv1,zero */\n/* 10:\tlw\tv0,0(a0) */\n/* 14:\tbgtzl\tv0,1c */\n/* 18:\taddu\tv1,v1,v0 */\n/* 1c:\taddiu\ta2,a2,1 */\n/* 20:\tslt\tv0,a2,a1 */\n/* 24:\tbnez\tv0,10 */\n/* 28:\taddiu\ta0,a0,4 */\n/* 2c:\tmove\tv0,v1 */\n/* 30:\tjr\tra */\n/* 34:\taddiu\tsp,sp,8 */\n/* \t... */\nvoid loopif(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'loopif': unmodelled control transfer 'bgtzl' at 0x14 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'loopif': unmodelled control transfer 'bgtzl' at 0x14 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 loopif(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 temp_v0;\n s32 var_a2;\n s32 var_v1;\n\n var_a0 = arg0;\n var_a2 = 0;\n var_v1 = 0;\n if (arg1 > 0) {\n do {\n temp_v0 = *var_a0;\n if (temp_v0 > 0) {\n var_v1 += temp_v0;\n }\n var_a2 += 1;\n var_a0 += 4;\n } while (var_a2 < arg1);\n }\n return var_v1;\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":9,"maxScore":14,"ratio":0.6428571428571429,"kinds":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loopif` — benchmark function synthetic:loopif:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loopif\n addiu\t$sp, $sp, -8\n move\t$a2, $zero\n blez\t$a1, .L2c\n move\t$v1, $zero\n.L10:\n lw\t$v0, 0($a0)\n bgtzl\t$v0, .L1c\n addu\t$v1, $v1, $v0\n.L1c:\n addiu\t$a2, $a2, 1\n slt\t$v0, $a2, $a1\n bnez\t$v0, .L10\n addiu\t$a0, $a0, 4\n.L2c:\n move\t$v0, $v1\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loopif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loopif` — benchmark function synthetic:loopif:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loopif:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,2c \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\tbgtzl\tv0,1c \n 18:\taddu\tv1,v1,v0\n 1c:\taddiu\ta2,a2,1\n 20:\tslt\tv0,a2,a1\n 24:\tbnez\tv0,10 \n 28:\taddiu\ta0,a0,4\n 2c:\tmove\tv0,v1\n 30:\tjr\tra\n 34:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5e7394a3a37ff814/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 loopif\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00008 00001821 '.....0!.......!\n 0010 8c820000 5c400001 00621821 24c60001 ....\\@...b.!$...\n 0020 00c5102a 1440fffa 24840004 00601021 ...*.@..$....`.!\n 0030 03e00008 27bd0008 00000000 00000000 ....'...........\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name loopif # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loopif:ido7.1","sym":"loopif","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","branch","memory"],"loc":1,"refSource":"int loopif(int *a,int n){ int s=0,i; for(i=0;i0) s+=a[i]; } return s; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,9c \n 8:\tmove\tv0,zero\n c:\tandi\ta3,a1,0x3\n 10:\tbeqz\ta3,40 \n 14:\tmove\tt0,a3\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\ta3,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\tblez\ta3,34 \n 2c:\tnop\n 30:\taddu\tv1,v1,a3\n 34:\tbne\tt0,v0,20 \n 38:\taddiu\ta2,a2,4\n 3c:\tbeq\tv0,a1,9c \n 40:\tsll\tt7,v0,0x2\n 44:\tsll\tt8,a1,0x2\n 48:\taddu\tt0,t8,a0\n 4c:\taddu\ta2,a0,t7\n 50:\tlw\ta3,0(a2)\n 54:\tblezl\ta3,64 \n 58:\tlw\tv0,4(a2)\n 5c:\taddu\tv1,v1,a3\n 60:\tlw\tv0,4(a2)\n 64:\tblezl\tv0,74 \n 68:\tlw\tv0,8(a2)\n 6c:\taddu\tv1,v1,v0\n 70:\tlw\tv0,8(a2)\n 74:\tblezl\tv0,84 \n 78:\tlw\tv0,12(a2)\n 7c:\taddu\tv1,v1,v0\n 80:\tlw\tv0,12(a2)\n 84:\taddiu\ta2,a2,16\n 88:\tblez\tv0,94 \n 8c:\tnop\n 90:\taddu\tv1,v1,v0\n 94:\tbnel\ta2,t0,54 \n 98:\tlw\ta3,0(a2)\n 9c:\tjr\tra\n a0:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 loopif\n\n\nContents of section .text:\n 0000 00001825 18a00025 00001025 30a70003 ...%...%...%0...\n 0010 10e0000b 00e04025 00007080 008e3021 ......@%..p...0!\n 0020 8cc70000 24420001 18e00002 00000000 ....$B..........\n 0030 00671821 1502fffa 24c60004 10450017 .g.!....$....E..\n 0040 00027880 0005c080 03044021 008f3021 ..x.......@!..0!\n 0050 8cc70000 58e00003 8cc20004 00671821 ....X........g.!\n 0060 8cc20004 58400003 8cc20008 00621821 ....X@.......b.!\n 0070 8cc20008 58400003 8cc2000c 00621821 ....X@.......b.!\n 0080 8cc2000c 24c60010 18400002 00000000 ....$....@......\n 0090 00621821 54c8ffef 8cc70000 03e00008 .b.!T...........\n 00a0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8100c1fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c1fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000008 00000218 p......)........\n 0010 00000005 00000360 00000001 00000220 .......`....... \n 0020 00000004 00000254 00000000 00000000 .......T........\n 0030 00000011 00000284 00000038 000002c8 ...........8....\n 0040 00000008 00000300 00000001 00000308 ................\n 0050 00000000 00000000 00000001 00000350 ...............P\n 0060 08080808 04000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000a4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d35 65373339 34613361 ps-ref-5e7394a3a\n 0130 33376666 3831342f 7265662e 63006c6f 37ff814/ref.c.lo\n 0140 6f706966 00000000 6c6f6f70 69660000 opif....loopif..\n 0150 00000000 00000001 00000000 00000035 ...............5\n 0160 00000000 00000004 00000000 00000029 ...............)\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'loopif' — lift: cannot lift 'loopif': unmodelled control transfer 'blezl' at 0x54 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tblez\ta1,9c */\n/* 8:\tmove\tv0,zero */\n/* c:\tandi\ta3,a1,0x3 */\n/* 10:\tbeqz\ta3,40 */\n/* 14:\tmove\tt0,a3 */\n/* 18:\tsll\tt6,zero,0x2 */\n/* 1c:\taddu\ta2,a0,t6 */\n/* 20:\tlw\ta3,0(a2) */\n/* 24:\taddiu\tv0,v0,1 */\n/* 28:\tblez\ta3,34 */\n/* 2c:\tnop */\n/* 30:\taddu\tv1,v1,a3 */\n/* 34:\tbne\tt0,v0,20 */\n/* 38:\taddiu\ta2,a2,4 */\n/* 3c:\tbeq\tv0,a1,9c */\n/* 40:\tsll\tt7,v0,0x2 */\n/* 44:\tsll\tt8,a1,0x2 */\n/* 48:\taddu\tt0,t8,a0 */\n/* 4c:\taddu\ta2,a0,t7 */\n/* 50:\tlw\ta3,0(a2) */\n/* 54:\tblezl\ta3,64 */\n/* 58:\tlw\tv0,4(a2) */\n/* 5c:\taddu\tv1,v1,a3 */\n/* 60:\tlw\tv0,4(a2) */\n/* 64:\tblezl\tv0,74 */\n/* 68:\tlw\tv0,8(a2) */\n/* 6c:\taddu\tv1,v1,v0 */\n/* 70:\tlw\tv0,8(a2) */\n/* 74:\tblezl\tv0,84 */\n/* 78:\tlw\tv0,12(a2) */\n/* 7c:\taddu\tv1,v1,v0 */\n/* 80:\tlw\tv0,12(a2) */\n/* 84:\taddiu\ta2,a2,16 */\n/* 88:\tblez\tv0,94 */\n/* 8c:\tnop */\n/* 90:\taddu\tv1,v1,v0 */\n/* 94:\tbnel\ta2,t0,54 */\n/* 98:\tlw\ta3,0(a2) */\n/* 9c:\tjr\tra */\n/* a0:\tmove\tv0,v1 */\n/* \t... */\nvoid loopif(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'loopif': unmodelled control transfer 'blezl' at 0x54 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":50,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'loopif': unmodelled control transfer 'blezl' at 0x54 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 loopif(s32 arg0, s32 arg1) {\n s32 *var_a2;\n s32 temp_a3;\n s32 temp_a3_2;\n s32 temp_a3_3;\n s32 temp_v0;\n s32 temp_v0_2;\n s32 temp_v0_3;\n s32 var_v0;\n s32 var_v1;\n void *var_a2_2;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg1 > 0) {\n temp_a3 = arg1 & 3;\n if (temp_a3 != 0) {\n var_a2 = arg0 + (0 * 4);\n do {\n temp_a3_2 = *var_a2;\n var_v0 += 1;\n if (temp_a3_2 > 0) {\n var_v1 += temp_a3_2;\n }\n var_a2 += 4;\n } while (temp_a3 != var_v0);\n if (var_v0 != arg1) {\n goto block_7;\n }\n } else {\nblock_7:\n var_a2_2 = arg0 + (var_v0 * 4);\n do {\n temp_a3_3 = var_a2_2->unk0;\n if (temp_a3_3 > 0) {\n var_v1 += temp_a3_3;\n }\n temp_v0 = var_a2_2->unk4;\n if (temp_v0 > 0) {\n var_v1 += temp_v0;\n }\n temp_v0_2 = var_a2_2->unk8;\n if (temp_v0_2 > 0) {\n var_v1 += temp_v0_2;\n }\n temp_v0_3 = var_a2_2->unkC;\n var_a2_2 += 0x10;\n if (temp_v0_3 > 0) {\n var_v1 += temp_v0_3;\n }\n } while (var_a2_2 != ((arg1 * 4) + arg0));\n }\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":6,"quality":{"score":88,"lines":54,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 35: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 39: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 43: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 47: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 48: Bad operand type for += or -="]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loopif` — benchmark function synthetic:loopif:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loopif\n move\t$v1, $zero\n blez\t$a1, .L9c\n move\t$v0, $zero\n andi\t$a3, $a1, 0x3\n beqz\t$a3, .L40\n move\t$t0, $a3\n sll\t$t6, $zero, 0x2\n addu\t$a2, $a0, $t6\n.L20:\n lw\t$a3, 0($a2)\n addiu\t$v0, $v0, 1\n blez\t$a3, .L34\n nop\n addu\t$v1, $v1, $a3\n.L34:\n bne\t$t0, $v0, .L20\n addiu\t$a2, $a2, 4\n beq\t$v0, $a1, .L9c\n.L40:\n sll\t$t7, $v0, 0x2\n sll\t$t8, $a1, 0x2\n addu\t$t0, $t8, $a0\n addu\t$a2, $a0, $t7\n lw\t$a3, 0($a2)\n.L54:\n blezl\t$a3, .L64\n lw\t$v0, 4($a2)\n addu\t$v1, $v1, $a3\n lw\t$v0, 4($a2)\n.L64:\n blezl\t$v0, .L74\n lw\t$v0, 8($a2)\n addu\t$v1, $v1, $v0\n lw\t$v0, 8($a2)\n.L74:\n blezl\t$v0, .L84\n lw\t$v0, 12($a2)\n addu\t$v1, $v1, $v0\n lw\t$v0, 12($a2)\n.L84:\n addiu\t$a2, $a2, 16\n blez\t$v0, .L94\n nop\n addu\t$v1, $v1, $v0\n.L94:\n bnel\t$a2, $t0, .L54\n lw\t$a3, 0($a2)\n.L9c:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loopif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loopif` — benchmark function synthetic:loopif:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loopif:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,9c \n 8:\tmove\tv0,zero\n c:\tandi\ta3,a1,0x3\n 10:\tbeqz\ta3,40 \n 14:\tmove\tt0,a3\n 18:\tsll\tt6,zero,0x2\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\ta3,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\tblez\ta3,34 \n 2c:\tnop\n 30:\taddu\tv1,v1,a3\n 34:\tbne\tt0,v0,20 \n 38:\taddiu\ta2,a2,4\n 3c:\tbeq\tv0,a1,9c \n 40:\tsll\tt7,v0,0x2\n 44:\tsll\tt8,a1,0x2\n 48:\taddu\tt0,t8,a0\n 4c:\taddu\ta2,a0,t7\n 50:\tlw\ta3,0(a2)\n 54:\tblezl\ta3,64 \n 58:\tlw\tv0,4(a2)\n 5c:\taddu\tv1,v1,a3\n 60:\tlw\tv0,4(a2)\n 64:\tblezl\tv0,74 \n 68:\tlw\tv0,8(a2)\n 6c:\taddu\tv1,v1,v0\n 70:\tlw\tv0,8(a2)\n 74:\tblezl\tv0,84 \n 78:\tlw\tv0,12(a2)\n 7c:\taddu\tv1,v1,v0\n 80:\tlw\tv0,12(a2)\n 84:\taddiu\ta2,a2,16\n 88:\tblez\tv0,94 \n 8c:\tnop\n 90:\taddu\tv1,v1,v0\n 94:\tbnel\ta2,t0,54 \n 98:\tlw\ta3,0(a2)\n 9c:\tjr\tra\n a0:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000b0 .text\n00000000 g F .text\t000000a4 loopif\n\n\nContents of section .text:\n 0000 00001825 18a00025 00001025 30a70003 ...%...%...%0...\n 0010 10e0000b 00e04025 00007080 008e3021 ......@%..p...0!\n 0020 8cc70000 24420001 18e00002 00000000 ....$B..........\n 0030 00671821 1502fffa 24c60004 10450017 .g.!....$....E..\n 0040 00027880 0005c080 03044021 008f3021 ..x.......@!..0!\n 0050 8cc70000 58e00003 8cc20004 00671821 ....X........g.!\n 0060 8cc20004 58400003 8cc20008 00621821 ....X@.......b.!\n 0070 8cc20008 58400003 8cc2000c 00621821 ....X@.......b.!\n 0080 8cc2000c 24c60010 18400002 00000000 ....$....@......\n 0090 00621821 54c8ffef 8cc70000 03e00008 .b.!T...........\n 00a0 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8100c1fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c1fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000029 00000008 00000218 p......)........\n 0010 00000005 00000360 00000001 00000220 .......`....... \n 0020 00000004 00000254 00000000 00000000 .......T........\n 0030 00000011 00000284 00000038 000002c8 ...........8....\n 0040 00000008 00000300 00000001 00000308 ................\n 0050 00000000 00000000 00000001 00000350 ...............P\n 0060 08080808 04000000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000a4 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d35 65373339 34613361 ps-ref-5e7394a3a\n 0130 33376666 3831342f 7265662e 63006c6f 37ff814/ref.c.lo\n 0140 6f706966 00000000 6c6f6f70 69660000 opif....loopif..\n 0150 00000000 00000001 00000000 00000035 ...............5\n 0160 00000000 00000004 00000000 00000029 ...............)\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000005 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name loopif # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:loopif:mwcc_242_81","sym":"loopif","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","branch","memory"],"loc":1,"refSource":"int loopif(int *a,int n){ int s=0,i; for(i=0;i0) s+=a[i]; } return s; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r0,0(r3)\n 14:\tcmpwi r0,0\n 18:\tble 20 \n 1c:\tadd r5,r5,r0\n 20:\taddi r3,r3,4\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 loopif\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 loopif\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80030000 2c000000 40810008 7ca50214 ....,...@...|...\n 0020 38630004 4200ffec 7ca32b78 4e800020 8c..B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 loopif(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 <= 0) {\n v1 = 0;\n } else {\n v0 = a0;\n v2 = a1;\n v1 = 0;\n do {\n if (*v0 > 0) v1 = v1 + *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":8,"maxScore":16,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":0,"opMismatch":2,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 loopif(s32 *arg0, s32 arg1) {\n s32 *var_r3;\n s32 temp_r0;\n s32 var_ctr;\n s32 var_r5;\n\n var_r3 = arg0;\n var_r5 = 0;\n var_ctr = arg1;\n if (arg1 > 0) {\n do {\n temp_r0 = *var_r3;\n if (temp_r0 > 0) {\n var_r5 += temp_r0;\n }\n var_r3 += 4;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n return var_r5;\n}\n","score":6,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":14,"ratio":0.42857142857142855,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `loopif` — benchmark function synthetic:loopif:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel loopif\n li r5,0\n mtctr r4\n cmpwi r4,0\n ble .L28\n.L10:\n lwz r0,0(r3)\n cmpwi r0,0\n ble .L20\n add r5,r5,r0\n.L20:\n addi r3,r3,4\n bdnz .L10\n.L28:\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function loopif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `loopif` — benchmark function synthetic:loopif:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:loopif:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r5,0\n 4:\tmtctr r4\n 8:\tcmpwi r4,0\n c:\tble 28 \n 10:\tlwz r0,0(r3)\n 14:\tcmpwi r0,0\n 18:\tble 20 \n 1c:\tadd r5,r5,r0\n 20:\taddi r3,r3,4\n 24:\tbdnz 10 \n 28:\tmr r3,r5\n 2c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000030 loopif\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 loopif\n\n\nContents of section .text:\n 0000 38a00000 7c8903a6 2c040000 4081001c 8...|...,...@...\n 0010 80030000 2c000000 40810008 7ca50214 ....,...@...|...\n 0020 38630004 4200ffec 7ca32b78 4e800020 8c..B...|.+xN.. \nContents of section .mwcats.text:\n 0000 02000030 00000000 ...0.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name loopif # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lor:agbcc","sym":"lor","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","logical-or"],"loc":1,"refSource":"int lor(int a,int b){ return a || b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tlor\n\t.type\t lor,function\n\t.thumb_func\nlor:\n\tmov\tr2, #0x0\n\tcmp\tr0, #0\n\tbne\t.L4\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n.L4:\n\tmov\tr2, #0x1\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t lor,.Lfe1-lor\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned/flip-branch","outcome":"nonmatch","source":"s32 lor(u32 a0, u32 a1) {\n s32 v0;\n if (a0 != 0) {\n return 1;\n } else {\n if (a1 == 0) {\n v0 = 0;\n return v0;\n } else {\n return 1;\n }\n }\n}\n","score":4,"maxScore":9,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 lor(s32 arg0, s32 arg1) {\n s32 var_r2;\n\n var_r2 = 0;\n if ((arg0 != 0) || (arg1 != 0)) {\n var_r2 = 1;\n }\n return var_r2;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lor` — benchmark function synthetic:lor:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tlor\n\t.type\t lor,function\n\t.thumb_func\nlor:\n\tmov\tr2, #0x0\n\tcmp\tr0, #0\n\tbne\t.L4\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n.L4:\n\tmov\tr2, #0x1\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t lor,.Lfe1-lor\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lor` — benchmark function synthetic:lor:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lor:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tlor\n\t.type\t lor,function\n\t.thumb_func\nlor:\n\tmov\tr2, #0x0\n\tcmp\tr0, #0\n\tbne\t.L4\t@cond_branch\n\tcmp\tr1, #0\n\tbeq\t.L3\t@cond_branch\n.L4:\n\tmov\tr2, #0x1\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t lor,.Lfe1-lor\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name lor # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lor:gcc2.7.2kmc","sym":"lor","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","logical-or"],"loc":1,"refSource":"int lor(int a,int b){ return a || b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\ta0,zero,a0\n 4:\tsltu\tv0,zero,a1\n 8:\tjr\tra\n c:\tor\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-eea8b5544eef90c8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 lor\n\n\nContents of section .text:\n 0000 0004202b 0005102b 03e00008 00821025 .. +...+.......%\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 lor(u32 a0, u32 a1) {\n return 0 < a0 | 0 < a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 lor(s32 arg0, s32 arg1) {\n return (arg0 != 0) | (arg1 != 0);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lor` — benchmark function synthetic:lor:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lor\n sltu\t$a0, $zero, $a0\n sltu\t$v0, $zero, $a1\n jr\t$ra\n or\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lor` — benchmark function synthetic:lor:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lor:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\ta0,zero,a0\n 4:\tsltu\tv0,zero,a1\n 8:\tjr\tra\n c:\tor\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-eea8b5544eef90c8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 lor\n\n\nContents of section .text:\n 0000 0004202b 0005102b 03e00008 00821025 .. +...+.......%\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name lor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lor:ido7.1","sym":"lor","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","logical-or"],"loc":1,"refSource":"int lor(int a,int b){ return a || b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tv0,zero,a0\n 4:\tbnez\tv0,10 \n 8:\tnop\n c:\tsltu\tv0,zero,a1\n 10:\tjr\tra\n 14:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 lor\n\n\nContents of section .text:\n 0000 0004102b 14400002 00000000 0005102b ...+.@.........+\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c4 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000004 00000268 00000001 0000026c .......h.......l\n 0050 00000000 00000000 00000001 000002b4 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 65613862 35353434 65656639 ef-eea8b5544eef9\n 0130 3063382f 7265662e 63006c6f 72000000 0c8/ref.c.lor...\n 0140 6c6f7200 00000000 00000001 00000000 lor.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000006 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 lor(s32 a0, s32 a1) {\n s32 v0;\n if (0 < a0) {\n v0 = 0 < a0;\n } else {\n v0 = 0 < a1;\n }\n return v0;\n}\n","score":6,"maxScore":8,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":3,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 lor(s32 arg0, s32 arg1) {\n s32 var_v0;\n\n var_v0 = arg0 != 0;\n if (var_v0 == 0) {\n var_v0 = arg1 != 0;\n }\n return var_v0;\n}\n","score":4,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":6,"ratio":0.6666666666666666,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lor` — benchmark function synthetic:lor:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lor\n sltu\t$v0, $zero, $a0\n bnez\t$v0, .L10\n nop\n sltu\t$v0, $zero, $a1\n.L10:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lor` — benchmark function synthetic:lor:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lor:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltu\tv0,zero,a0\n 4:\tbnez\tv0,10 \n 8:\tnop\n c:\tsltu\tv0,zero,a1\n 10:\tjr\tra\n 14:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 lor\n\n\nContents of section .text:\n 0000 0004102b 14400002 00000000 0005102b ...+.@.........+\n 0010 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c4 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000004 00000268 00000001 0000026c .......h.......l\n 0050 00000000 00000000 00000001 000002b4 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 65613862 35353434 65656639 ef-eea8b5544eef9\n 0130 3063382f 7265662e 63006c6f 72000000 0c8/ref.c.lor...\n 0140 6c6f7200 00000000 00000001 00000000 lor.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000006 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:lor:mwcc_242_81","sym":"lor","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","logical-or"],"loc":1,"refSource":"int lor(int a,int b){ return a || b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r3,0\n 8:\tbne 14 \n c:\tcmpwi r4,0\n 10:\tbeqlr\n 14:\tli r3,1\n 18:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c lor\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 lor\n\n\nContents of section .text:\n 0000 2c030000 38600000 4082000c 2c040000 ,...8`..@...,...\n 0010 4d820020 38600001 4e800020 M.. 8`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 lor(s32 a0, s32 a1) {\n if (a0 == 0) {\n if (a1 != 0) {\n return 1;\n } else {\n return 0;\n }\n } else {\n return 1;\n }\n}\n","score":5,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":1,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 lor(s32 arg0, s32 arg1) {\n if ((arg0 != 0) || (arg1 != 0)) {\n return 1;\n }\n return 0;\n}\n","score":5,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":5,"maxScore":9,"ratio":0.5555555555555556,"kinds":{"insert":2,"delete":1,"replace":1,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `lor` — benchmark function synthetic:lor:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel lor\n cmpwi r3,0\n li r3,0\n bne .L14\n cmpwi r4,0\n beqlr\n.L14:\n li r3,1\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function lor # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `lor` — benchmark function synthetic:lor:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:lor:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r3,0\n 8:\tbne 14 \n c:\tcmpwi r4,0\n 10:\tbeqlr\n 14:\tli r3,1\n 18:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c lor\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 lor\n\n\nContents of section .text:\n 0000 2c030000 38600000 4082000c 2c040000 ,...8`..@...,...\n 0010 4d820020 38600001 4e800020 M.. 8`..N.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name lor # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mask8:agbcc","sym":"mask8","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","mask"],"loc":1,"refSource":"unsigned mask8(unsigned x){ return x & 0xff; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmask8\n\t.type\t mask8,function\n\t.thumb_func\nmask8:\n\tadd\tr1, r0, #0\n\tmov\tr0, #0xff\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t mask8,.Lfe1-mask8\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mask8(u32 a0) {\n return 255 & a0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mask8(s32 arg0) {\n return 0xFF & arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mask8` — benchmark function synthetic:mask8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmask8\n\t.type\t mask8,function\n\t.thumb_func\nmask8:\n\tadd\tr1, r0, #0\n\tmov\tr0, #0xff\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t mask8,.Lfe1-mask8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mask8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mask8` — benchmark function synthetic:mask8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mask8:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmask8\n\t.type\t mask8,function\n\t.thumb_func\nmask8:\n\tadd\tr1, r0, #0\n\tmov\tr0, #0xff\n\tand\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t mask8,.Lfe1-mask8\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mask8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mask8:gcc2.7.2kmc","sym":"mask8","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","mask"],"loc":1,"refSource":"unsigned mask8(unsigned x){ return x & 0xff; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-077db2d7aa87cba7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 mask8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mask8(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mask8(s32 arg0) {\n return arg0 & 0xFF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mask8` — benchmark function synthetic:mask8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mask8\n jr\t$ra\n andi\t$v0, $a0, 0xff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mask8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mask8` — benchmark function synthetic:mask8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mask8:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-077db2d7aa87cba7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 mask8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mask8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mask8:ido7.1","sym":"mask8","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","mask"],"loc":1,"refSource":"unsigned mask8(unsigned x){ return x & 0xff; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 mask8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 37376462 32643761 61383763 ef-077db2d7aa87c\n 0130 6261372f 7265662e 63006d61 736b3800 ba7/ref.c.mask8.\n 0140 6d61736b 38000000 00000000 00000001 mask8...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mask8(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mask8(s32 arg0) {\n return arg0 & 0xFF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mask8` — benchmark function synthetic:mask8:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mask8\n jr\t$ra\n andi\t$v0, $a0, 0xff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mask8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mask8` — benchmark function synthetic:mask8:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mask8:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 mask8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 37376462 32643761 61383763 ef-077db2d7aa87c\n 0130 6261372f 7265662e 63006d61 736b3800 ba7/ref.c.mask8.\n 0140 6d61736b 38000000 00000000 00000001 mask8...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mask8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mask8:mwcc_242_81","sym":"mask8","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","mask"],"loc":1,"refSource":"unsigned mask8(unsigned x){ return x & 0xff; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,24\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 mask8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mask8\n\n\nContents of section .text:\n 0000 5463063e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mask8(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 mask8(u8 arg0) {\n return arg0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mask8` — benchmark function synthetic:mask8:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mask8\n clrlwi r3,r3,24\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mask8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mask8` — benchmark function synthetic:mask8:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mask8:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,24\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 mask8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mask8\n\n\nContents of section .text:\n 0000 5463063e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mask8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:max3:agbcc","sym":"max3","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int max3(int a,int b,int c){ int m=a>b?a:b; return m>c?m:c; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmax3\n\t.type\t max3,function\n\t.thumb_func\nmax3:\n\tcmp\tr1, r0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r0, #0\n.L3:\n\tadd\tr0, r2, #0\n\tcmp\tr0, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r1, #0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t max3,.Lfe1-max3\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 max3(s32 a0, s32 a1, s32 a2) {\n if (a1 < a0) a1 = a0;\n if (a2 < a1) a2 = a1;\n return a2;\n}\n","score":5,"maxScore":10,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 max3(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r0;\n s32 var_r1;\n\n var_r1 = arg1;\n if (var_r1 < arg0) {\n var_r1 = arg0;\n }\n var_r0 = arg2;\n if (var_r0 < var_r1) {\n var_r0 = var_r1;\n }\n return var_r0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `max3` — benchmark function synthetic:max3:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmax3\n\t.type\t max3,function\n\t.thumb_func\nmax3:\n\tcmp\tr1, r0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r0, #0\n.L3:\n\tadd\tr0, r2, #0\n\tcmp\tr0, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r1, #0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t max3,.Lfe1-max3\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function max3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `max3` — benchmark function synthetic:max3:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:max3:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmax3\n\t.type\t max3,function\n\t.thumb_func\nmax3:\n\tcmp\tr1, r0\n\tbge\t.L3\t@cond_branch\n\tadd\tr1, r0, #0\n.L3:\n\tadd\tr0, r2, #0\n\tcmp\tr0, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr0, r1, #0\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t max3,.Lfe1-max3\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name max3 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:max3:gcc2.7.2kmc","sym":"max3","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int max3(int a,int b,int c){ int m=a>b?a:b; return m>c?m:c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tslt\tv0,a0,a2\n 10:\tbnezl\tv0,18 \n 14:\tmove\ta0,a2\n 18:\tjr\tra\n 1c:\tmove\tv0,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ff3fefc9295fb039/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 max3\n\n\nContents of section .text:\n 0000 0085102a 54400001 00a02021 0086102a ...*T@.... !...*\n 0010 54400001 00c02021 03e00008 00801021 T@.... !.......!\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'max3' — lift: cannot lift 'max3': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tslt\tv0,a0,a1 */\n/* 4:\tbnezl\tv0,c */\n/* 8:\tmove\ta0,a1 */\n/* c:\tslt\tv0,a0,a2 */\n/* 10:\tbnezl\tv0,18 */\n/* 14:\tmove\ta0,a2 */\n/* 18:\tjr\tra */\n/* 1c:\tmove\tv0,a0 */\nvoid max3(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'max3': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'max3': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 max3(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_a0;\n\n var_a0 = arg0;\n if (var_a0 < arg1) {\n var_a0 = arg1;\n }\n if (var_a0 < arg2) {\n var_a0 = arg2;\n }\n return var_a0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `max3` — benchmark function synthetic:max3:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel max3\n slt\t$v0, $a0, $a1\n bnezl\t$v0, .Lc\n move\t$a0, $a1\n.Lc:\n slt\t$v0, $a0, $a2\n bnezl\t$v0, .L18\n move\t$a0, $a2\n.L18:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function max3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `max3` — benchmark function synthetic:max3:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:max3:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tslt\tv0,a0,a2\n 10:\tbnezl\tv0,18 \n 14:\tmove\ta0,a2\n 18:\tjr\tra\n 1c:\tmove\tv0,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ff3fefc9295fb039/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 max3\n\n\nContents of section .text:\n 0000 0085102a 54400001 00a02021 0086102a ...*T@.... !...*\n 0010 54400001 00c02021 03e00008 00801021 T@.... !.......!\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name max3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:max3:ido7.1","sym":"max3","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int max3(int a,int b,int c){ int m=a>b?a:b; return m>c?m:c; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a1,a0\n 4:\tbeqz\tat,14 \n 8:\tmove\tv0,a1\n c:\tb\t14 \n 10:\tmove\tv0,a0\n 14:\tslt\tat,a2,v0\n 18:\tbeqz\tat,28 \n 1c:\tmove\tv1,a2\n 20:\tjr\tra\n 24:\tnop\n 28:\tjr\tra\n 2c:\tmove\tv0,v1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000030 max3\n\n\nContents of section .text:\n 0000 00a4082a 10200003 00a01025 10000001 ...*. .....%....\n 0010 00801025 00c2082a 10200003 00c01825 ...%...*. .....%\n 0020 03e00008 00000000 03e00008 00601025 .............`.%\nContents of section .options:\n 0000 01200000 00000000 8000007e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000c 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08020000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000030 20200001 00000001 .......0 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 66336665 66633932 39356662 ef-ff3fefc9295fb\n 0130 3033392f 7265662e 63006d61 78330000 039/ref.c.max3..\n 0140 6d617833 00000000 00000000 00000001 max3............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000c 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 max3(s32 a0, s32 a1, s32 a2) {\n if (a1 < a0) a1 = a0;\n if (a2 < a1) {\n return a1;\n } else {\n return a2;\n }\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":3,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 max3(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_v0;\n\n var_v0 = arg1;\n if (arg1 < arg0) {\n var_v0 = arg0;\n }\n if (arg2 < var_v0) {\n return var_v0;\n }\n return arg2;\n}\n","score":9,"maxScore":14,"compileErrors":null,"breakdown":{"insert":2,"delete":3,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":9,"maxScore":14,"ratio":0.6428571428571429,"kinds":{"insert":2,"delete":3,"replace":0,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `max3` — benchmark function synthetic:max3:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel max3\n slt\t$at, $a1, $a0\n beqz\t$at, .L14\n move\t$v0, $a1\n b\t.L14\n move\t$v0, $a0\n.L14:\n slt\t$at, $a2, $v0\n beqz\t$at, .L28\n move\t$v1, $a2\n jr\t$ra\n nop\n.L28:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function max3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `max3` — benchmark function synthetic:max3:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:max3:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a1,a0\n 4:\tbeqz\tat,14 \n 8:\tmove\tv0,a1\n c:\tb\t14 \n 10:\tmove\tv0,a0\n 14:\tslt\tat,a2,v0\n 18:\tbeqz\tat,28 \n 1c:\tmove\tv1,a2\n 20:\tjr\tra\n 24:\tnop\n 28:\tjr\tra\n 2c:\tmove\tv0,v1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000030 max3\n\n\nContents of section .text:\n 0000 00a4082a 10200003 00a01025 10000001 ...*. .....%....\n 0010 00801025 00c2082a 10200003 00c01825 ...%...*. .....%\n 0020 03e00008 00000000 03e00008 00601025 .............`.%\nContents of section .options:\n 0000 01200000 00000000 8000007e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000c 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08020000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000030 20200001 00000001 .......0 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 66336665 66633932 39356662 ef-ff3fefc9295fb\n 0130 3033392f 7265662e 63006d61 78330000 039/ref.c.max3..\n 0140 6d617833 00000000 00000000 00000001 max3............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000c 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name max3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:max3:mwcc_242_81","sym":"max3","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int max3(int a,int b,int c){ int m=a>b?a:b; return m>c?m:c; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tble c \n 8:\tmr r4,r3\n c:\tcmpw r4,r5\n 10:\tble 18 \n 14:\tmr r5,r4\n 18:\tmr r3,r5\n 1c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 max3\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 max3\n\n\nContents of section .text:\n 0000 7c032000 40810008 7c641b78 7c042800 |. .@...|d.x|.(.\n 0010 40810008 7c852378 7ca32b78 4e800020 @...|.#x|.+xN.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 max3(s32 a0, s32 a1, s32 a2) {\n if (a0 > a1) a1 = a0;\n if (a1 > a2) a2 = a1;\n return a2;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 max3(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r4;\n s32 var_r5;\n\n var_r4 = arg1;\n var_r5 = arg2;\n if (arg0 > var_r4) {\n var_r4 = arg0;\n }\n if (var_r4 > var_r5) {\n var_r5 = var_r4;\n }\n return var_r5;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `max3` — benchmark function synthetic:max3:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel max3\n cmpw r3,r4\n ble .Lc\n mr r4,r3\n.Lc:\n cmpw r4,r5\n ble .L18\n mr r5,r4\n.L18:\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function max3 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `max3` — benchmark function synthetic:max3:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:max3:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tble c \n 8:\tmr r4,r3\n c:\tcmpw r4,r5\n 10:\tble 18 \n 14:\tmr r5,r4\n 18:\tmr r3,r5\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 max3\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 max3\n\n\nContents of section .text:\n 0000 7c032000 40810008 7c641b78 7c042800 |. .@...|d.x|.(.\n 0010 40810008 7c852378 7ca32b78 4e800020 @...|.#x|.+xN.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name max3 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxarr:agbcc","sym":"maxarr","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int maxarr(int *a,int n){ int m=a[0],i; for(i=1;im)m=a[i]; return m; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmaxarr\n\t.type\t maxarr,function\n\t.thumb_func\nmaxarr:\n\tldr\tr3, [r0]\n\tcmp\tr1, #0x1\n\tble\t.L4\t@cond_branch\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, r3\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r2, #0\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t maxarr,.Lfe1-maxarr\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 maxarr(s32 * a0, u32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n if (a1 <= 1) {\n v1 = *a0;\n } else {\n v1 = *a0;\n v0 = a0 + 1;\n v2 = a1 - 1;\n do {\n if (*v0 > v1) v1 = *v0;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":5,"maxScore":17,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":1,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 maxarr(s32 *arg0, s32 arg1) {\n s32 *var_r0;\n s32 temp_r2;\n s32 var_r1;\n s32 var_r3;\n\n var_r3 = *arg0;\n if (arg1 > 1) {\n var_r0 = arg0 + 4;\n var_r1 = arg1 - 1;\n do {\n temp_r2 = *var_r0;\n if (temp_r2 > var_r3) {\n var_r3 = temp_r2;\n }\n var_r0 += 4;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n return var_r3;\n}\n","score":2,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":15,"ratio":0.13333333333333333,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxarr` — benchmark function synthetic:maxarr:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmaxarr\n\t.type\t maxarr,function\n\t.thumb_func\nmaxarr:\n\tldr\tr3, [r0]\n\tcmp\tr1, #0x1\n\tble\t.L4\t@cond_branch\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, r3\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r2, #0\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t maxarr,.Lfe1-maxarr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxarr` — benchmark function synthetic:maxarr:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxarr:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmaxarr\n\t.type\t maxarr,function\n\t.thumb_func\nmaxarr:\n\tldr\tr3, [r0]\n\tcmp\tr1, #0x1\n\tble\t.L4\t@cond_branch\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n.L6:\n\tldr\tr2, [r0]\n\tcmp\tr2, r3\n\tble\t.L5\t@cond_branch\n\tadd\tr3, r2, #0\n.L5:\n\tadd\tr0, r0, #0x4\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t maxarr,.Lfe1-maxarr\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxarr # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxarr:gcc2.7.2kmc","sym":"maxarr","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int maxarr(int *a,int n){ int m=a[0],i; for(i=1;im)m=a[i]; return m; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\ta3,0(a0)\n 4:\tli\ta2,1\n 8:\tslt\tv0,a2,a1\n c:\tbeqz\tv0,38 \n 10:\tnop\n 14:\taddiu\ta0,a0,4\n 18:\tlw\tv1,0(a0)\n 1c:\tslt\tv0,a3,v1\n 20:\tbnezl\tv0,28 \n 24:\tmove\ta3,v1\n 28:\taddiu\ta2,a2,1\n 2c:\tslt\tv0,a2,a1\n 30:\tbnez\tv0,18 \n 34:\taddiu\ta0,a0,4\n 38:\tjr\tra\n 3c:\tmove\tv0,a3\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-653435ff52bb9ff8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 maxarr\n\n\nContents of section .text:\n 0000 8c870000 24060001 00c5102a 1040000a ....$......*.@..\n 0010 00000000 24840004 8c830000 00e3102a ....$..........*\n 0020 54400001 00603821 24c60001 00c5102a T@...`8!$......*\n 0030 1440fff9 24840004 03e00008 00e01021 .@..$..........!\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'maxarr' — lift: cannot lift 'maxarr': unmodelled control transfer 'bnezl' at 0x20 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlw\ta3,0(a0) */\n/* 4:\tli\ta2,1 */\n/* 8:\tslt\tv0,a2,a1 */\n/* c:\tbeqz\tv0,38 */\n/* 10:\tnop */\n/* 14:\taddiu\ta0,a0,4 */\n/* 18:\tlw\tv1,0(a0) */\n/* 1c:\tslt\tv0,a3,v1 */\n/* 20:\tbnezl\tv0,28 */\n/* 24:\tmove\ta3,v1 */\n/* 28:\taddiu\ta2,a2,1 */\n/* 2c:\tslt\tv0,a2,a1 */\n/* 30:\tbnez\tv0,18 */\n/* 34:\taddiu\ta0,a0,4 */\n/* 38:\tjr\tra */\n/* 3c:\tmove\tv0,a3 */\nvoid maxarr(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'maxarr': unmodelled control transfer 'bnezl' at 0x20 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":24,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'maxarr': unmodelled control transfer 'bnezl' at 0x20 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 maxarr(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 temp_v1;\n s32 var_a2;\n s32 var_a3;\n\n var_a3 = *arg0;\n var_a2 = 1;\n if (arg1 > 1) {\n var_a0 = arg0 + 4;\n do {\n temp_v1 = *var_a0;\n if (var_a3 < temp_v1) {\n var_a3 = temp_v1;\n }\n var_a2 += 1;\n var_a0 += 4;\n } while (var_a2 < arg1);\n }\n return var_a3;\n}\n","score":7,"maxScore":18,"compileErrors":null,"breakdown":{"insert":2,"delete":3,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":20,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":7,"maxScore":18,"ratio":0.3888888888888889,"kinds":{"insert":2,"delete":3,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxarr` — benchmark function synthetic:maxarr:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel maxarr\n lw\t$a3, 0($a0)\n li\t$a2, 1\n slt\t$v0, $a2, $a1\n beqz\t$v0, .L38\n nop\n addiu\t$a0, $a0, 4\n.L18:\n lw\t$v1, 0($a0)\n slt\t$v0, $a3, $v1\n bnezl\t$v0, .L28\n move\t$a3, $v1\n.L28:\n addiu\t$a2, $a2, 1\n slt\t$v0, $a2, $a1\n bnez\t$v0, .L18\n addiu\t$a0, $a0, 4\n.L38:\n jr\t$ra\n move\t$v0, $a3\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxarr` — benchmark function synthetic:maxarr:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxarr:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\ta3,0(a0)\n 4:\tli\ta2,1\n 8:\tslt\tv0,a2,a1\n c:\tbeqz\tv0,38 \n 10:\tnop\n 14:\taddiu\ta0,a0,4\n 18:\tlw\tv1,0(a0)\n 1c:\tslt\tv0,a3,v1\n 20:\tbnezl\tv0,28 \n 24:\tmove\ta3,v1\n 28:\taddiu\ta2,a2,1\n 2c:\tslt\tv0,a2,a1\n 30:\tbnez\tv0,18 \n 34:\taddiu\ta0,a0,4\n 38:\tjr\tra\n 3c:\tmove\tv0,a3\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-653435ff52bb9ff8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000040 maxarr\n\n\nContents of section .text:\n 0000 8c870000 24060001 00c5102a 1040000a ....$......*.@..\n 0010 00000000 24840004 8c830000 00e3102a ....$..........*\n 0020 54400001 00603821 24c60001 00c5102a T@...`8!$......*\n 0030 1440fff9 24840004 03e00008 00e01021 .@..$..........!\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxarr:ido7.1","sym":"maxarr","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int maxarr(int *a,int n){ int m=a[0],i; for(i=1;im)m=a[i]; return m; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslti\tat,a1,2\n 4:\tlw\tv1,0(a0)\n 8:\tbnez\tat,b8 \n c:\tli\tv0,1\n 10:\taddiu\ta3,a1,-1\n 14:\tandi\ta3,a3,0x3\n 18:\tbeqz\ta3,4c \n 1c:\taddiu\tt0,a3,1\n 20:\tsll\tt6,v0,0x2\n 24:\taddu\ta2,a0,t6\n 28:\tlw\ta3,0(a2)\n 2c:\taddiu\tv0,v0,1\n 30:\tslt\tat,v1,a3\n 34:\tbeqz\tat,40 \n 38:\tnop\n 3c:\tmove\tv1,a3\n 40:\tbne\tt0,v0,28 \n 44:\taddiu\ta2,a2,4\n 48:\tbeq\tv0,a1,b8 \n 4c:\tsll\tt7,v0,0x2\n 50:\tsll\tt8,a1,0x2\n 54:\taddu\tt0,t8,a0\n 58:\taddu\ta2,a0,t7\n 5c:\tlw\ta3,0(a2)\n 60:\tslt\tat,v1,a3\n 64:\tbeqzl\tat,74 \n 68:\tlw\tv0,4(a2)\n 6c:\tmove\tv1,a3\n 70:\tlw\tv0,4(a2)\n 74:\tslt\tat,v1,v0\n 78:\tbeqzl\tat,88 \n 7c:\tlw\tv0,8(a2)\n 80:\tmove\tv1,v0\n 84:\tlw\tv0,8(a2)\n 88:\tslt\tat,v1,v0\n 8c:\tbeqzl\tat,9c \n 90:\tlw\tv0,12(a2)\n 94:\tmove\tv1,v0\n 98:\tlw\tv0,12(a2)\n 9c:\taddiu\ta2,a2,16\n a0:\tslt\tat,v1,v0\n a4:\tbeqz\tat,b0 \n a8:\tnop\n ac:\tmove\tv1,v0\n b0:\tbnel\ta2,t0,60 \n b4:\tlw\ta3,0(a2)\n b8:\tjr\tra\n bc:\tmove\tv0,v1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000c0 .text\n00000000 g F .text\t000000c0 maxarr\n\n\nContents of section .text:\n 0000 28a10002 8c830000 1420002b 24020001 (........ .+$...\n 0010 24a7ffff 30e70003 10e0000c 24e80001 $...0.......$...\n 0020 00027080 008e3021 8cc70000 24420001 ..p...0!....$B..\n 0030 0067082a 10200002 00000000 00e01825 .g.*. .........%\n 0040 1502fff9 24c60004 1045001b 00027880 ....$....E....x.\n 0050 0005c080 03044021 008f3021 8cc70000 ......@!..0!....\n 0060 0067082a 50200003 8cc20004 00e01825 .g.*P .........%\n 0070 8cc20004 0062082a 50200003 8cc20008 .....b.*P ......\n 0080 00401825 8cc20008 0062082a 50200003 .@.%.....b.*P ..\n 0090 8cc2000c 00401825 8cc2000c 24c60010 .....@.%....$...\n 00a0 0062082a 10200002 00000000 00401825 .b.*. .......@.%\n 00b0 54c8ffeb 8cc70000 03e00008 00601025 T............`.%\nContents of section .options:\n 0000 01200000 00000000 8100c1fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c1fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000030 00000008 00000228 p......0.......(\n 0010 00000005 00000370 00000001 00000230 .......p.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 00000038 000002d8 ...........8....\n 0040 00000008 00000310 00000001 00000318 ................\n 0050 00000000 00000000 00000001 00000360 ...............`\n 0060 08080808 08020000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000c0 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d36 35333433 35666635 ps-ref-653435ff5\n 0130 32626239 6666382f 7265662e 63006d61 2bb9ff8/ref.c.ma\n 0140 78617272 00000000 6d617861 72720000 xarr....maxarr..\n 0150 00000000 00000001 00000000 00000035 ...............5\n 0160 00000000 00000004 00000000 00000030 ...............0\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000006 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'maxarr' — lift: cannot lift 'maxarr': unmodelled control transfer 'beqzl' at 0x64 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tslti\tat,a1,2 */\n/* 4:\tlw\tv1,0(a0) */\n/* 8:\tbnez\tat,b8 */\n/* c:\tli\tv0,1 */\n/* 10:\taddiu\ta3,a1,-1 */\n/* 14:\tandi\ta3,a3,0x3 */\n/* 18:\tbeqz\ta3,4c */\n/* 1c:\taddiu\tt0,a3,1 */\n/* 20:\tsll\tt6,v0,0x2 */\n/* 24:\taddu\ta2,a0,t6 */\n/* 28:\tlw\ta3,0(a2) */\n/* 2c:\taddiu\tv0,v0,1 */\n/* 30:\tslt\tat,v1,a3 */\n/* 34:\tbeqz\tat,40 */\n/* 38:\tnop */\n/* 3c:\tmove\tv1,a3 */\n/* 40:\tbne\tt0,v0,28 */\n/* 44:\taddiu\ta2,a2,4 */\n/* 48:\tbeq\tv0,a1,b8 */\n/* 4c:\tsll\tt7,v0,0x2 */\n/* 50:\tsll\tt8,a1,0x2 */\n/* 54:\taddu\tt0,t8,a0 */\n/* 58:\taddu\ta2,a0,t7 */\n/* 5c:\tlw\ta3,0(a2) */\n/* 60:\tslt\tat,v1,a3 */\n/* 64:\tbeqzl\tat,74 */\n/* 68:\tlw\tv0,4(a2) */\n/* 6c:\tmove\tv1,a3 */\n/* 70:\tlw\tv0,4(a2) */\n/* 74:\tslt\tat,v1,v0 */\n/* 78:\tbeqzl\tat,88 */\n/* 7c:\tlw\tv0,8(a2) */\n/* 80:\tmove\tv1,v0 */\n/* 84:\tlw\tv0,8(a2) */\n/* 88:\tslt\tat,v1,v0 */\n/* 8c:\tbeqzl\tat,9c */\n/* 90:\tlw\tv0,12(a2) */\n/* 94:\tmove\tv1,v0 */\n/* 98:\tlw\tv0,12(a2) */\n/* 9c:\taddiu\ta2,a2,16 */\n/* a0:\tslt\tat,v1,v0 */\n/* a4:\tbeqz\tat,b0 */\n/* a8:\tnop */\n/* ac:\tmove\tv1,v0 */\n/* b0:\tbnel\ta2,t0,60 */\n/* b4:\tlw\ta3,0(a2) */\n/* b8:\tjr\tra */\n/* bc:\tmove\tv0,v1 */\nvoid maxarr(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'maxarr': unmodelled control transfer 'beqzl' at 0x64 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":56,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'maxarr': unmodelled control transfer 'beqzl' at 0x64 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 maxarr(s32 *arg0, s32 arg1) {\n s32 *var_a2;\n s32 temp_a3;\n s32 temp_a3_2;\n s32 temp_a3_3;\n s32 temp_v0;\n s32 temp_v0_2;\n s32 temp_v0_3;\n s32 var_v0;\n s32 var_v1;\n void *var_a2_2;\n\n var_v1 = *arg0;\n var_v0 = 1;\n if (arg1 >= 2) {\n temp_a3 = (arg1 - 1) & 3;\n if (temp_a3 != 0) {\n var_a2 = arg0 + (1 * 4);\n do {\n temp_a3_2 = *var_a2;\n var_v0 += 1;\n if (var_v1 < temp_a3_2) {\n var_v1 = temp_a3_2;\n }\n var_a2 += 4;\n } while ((temp_a3 + 1) != var_v0);\n if (var_v0 != arg1) {\n goto block_7;\n }\n } else {\nblock_7:\n var_a2_2 = arg0 + (var_v0 * 4);\n do {\n temp_a3_3 = var_a2_2->unk0;\n if (var_v1 < temp_a3_3) {\n var_v1 = temp_a3_3;\n }\n temp_v0 = var_a2_2->unk4;\n if (var_v1 < temp_v0) {\n var_v1 = temp_v0;\n }\n temp_v0_2 = var_a2_2->unk8;\n if (var_v1 < temp_v0_2) {\n var_v1 = temp_v0_2;\n }\n temp_v0_3 = var_a2_2->unkC;\n var_a2_2 += 0x10;\n if (var_v1 < temp_v0_3) {\n var_v1 = temp_v0_3;\n }\n } while (var_a2_2 != ((arg1 * 4) + arg0));\n }\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":88,"lines":54,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 35: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 39: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 43: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 47: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 48: Bad operand type for += or -="]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxarr` — benchmark function synthetic:maxarr:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel maxarr\n slti\t$at, $a1, 2\n lw\t$v1, 0($a0)\n bnez\t$at, .Lb8\n li\t$v0, 1\n addiu\t$a3, $a1, -1\n andi\t$a3, $a3, 0x3\n beqz\t$a3, .L4c\n addiu\t$t0, $a3, 1\n sll\t$t6, $v0, 0x2\n addu\t$a2, $a0, $t6\n.L28:\n lw\t$a3, 0($a2)\n addiu\t$v0, $v0, 1\n slt\t$at, $v1, $a3\n beqz\t$at, .L40\n nop\n move\t$v1, $a3\n.L40:\n bne\t$t0, $v0, .L28\n addiu\t$a2, $a2, 4\n beq\t$v0, $a1, .Lb8\n.L4c:\n sll\t$t7, $v0, 0x2\n sll\t$t8, $a1, 0x2\n addu\t$t0, $t8, $a0\n addu\t$a2, $a0, $t7\n lw\t$a3, 0($a2)\n.L60:\n slt\t$at, $v1, $a3\n beqzl\t$at, .L74\n lw\t$v0, 4($a2)\n move\t$v1, $a3\n lw\t$v0, 4($a2)\n.L74:\n slt\t$at, $v1, $v0\n beqzl\t$at, .L88\n lw\t$v0, 8($a2)\n move\t$v1, $v0\n lw\t$v0, 8($a2)\n.L88:\n slt\t$at, $v1, $v0\n beqzl\t$at, .L9c\n lw\t$v0, 12($a2)\n move\t$v1, $v0\n lw\t$v0, 12($a2)\n.L9c:\n addiu\t$a2, $a2, 16\n slt\t$at, $v1, $v0\n beqz\t$at, .Lb0\n nop\n move\t$v1, $v0\n.Lb0:\n bnel\t$a2, $t0, .L60\n lw\t$a3, 0($a2)\n.Lb8:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxarr` — benchmark function synthetic:maxarr:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxarr:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslti\tat,a1,2\n 4:\tlw\tv1,0(a0)\n 8:\tbnez\tat,b8 \n c:\tli\tv0,1\n 10:\taddiu\ta3,a1,-1\n 14:\tandi\ta3,a3,0x3\n 18:\tbeqz\ta3,4c \n 1c:\taddiu\tt0,a3,1\n 20:\tsll\tt6,v0,0x2\n 24:\taddu\ta2,a0,t6\n 28:\tlw\ta3,0(a2)\n 2c:\taddiu\tv0,v0,1\n 30:\tslt\tat,v1,a3\n 34:\tbeqz\tat,40 \n 38:\tnop\n 3c:\tmove\tv1,a3\n 40:\tbne\tt0,v0,28 \n 44:\taddiu\ta2,a2,4\n 48:\tbeq\tv0,a1,b8 \n 4c:\tsll\tt7,v0,0x2\n 50:\tsll\tt8,a1,0x2\n 54:\taddu\tt0,t8,a0\n 58:\taddu\ta2,a0,t7\n 5c:\tlw\ta3,0(a2)\n 60:\tslt\tat,v1,a3\n 64:\tbeqzl\tat,74 \n 68:\tlw\tv0,4(a2)\n 6c:\tmove\tv1,a3\n 70:\tlw\tv0,4(a2)\n 74:\tslt\tat,v1,v0\n 78:\tbeqzl\tat,88 \n 7c:\tlw\tv0,8(a2)\n 80:\tmove\tv1,v0\n 84:\tlw\tv0,8(a2)\n 88:\tslt\tat,v1,v0\n 8c:\tbeqzl\tat,9c \n 90:\tlw\tv0,12(a2)\n 94:\tmove\tv1,v0\n 98:\tlw\tv0,12(a2)\n 9c:\taddiu\ta2,a2,16\n a0:\tslt\tat,v1,v0\n a4:\tbeqz\tat,b0 \n a8:\tnop\n ac:\tmove\tv1,v0\n b0:\tbnel\ta2,t0,60 \n b4:\tlw\ta3,0(a2)\n b8:\tjr\tra\n bc:\tmove\tv0,v1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000c0 .text\n00000000 g F .text\t000000c0 maxarr\n\n\nContents of section .text:\n 0000 28a10002 8c830000 1420002b 24020001 (........ .+$...\n 0010 24a7ffff 30e70003 10e0000c 24e80001 $...0.......$...\n 0020 00027080 008e3021 8cc70000 24420001 ..p...0!....$B..\n 0030 0067082a 10200002 00000000 00e01825 .g.*. .........%\n 0040 1502fff9 24c60004 1045001b 00027880 ....$....E....x.\n 0050 0005c080 03044021 008f3021 8cc70000 ......@!..0!....\n 0060 0067082a 50200003 8cc20004 00e01825 .g.*P .........%\n 0070 8cc20004 0062082a 50200003 8cc20008 .....b.*P ......\n 0080 00401825 8cc20008 0062082a 50200003 .@.%.....b.*P ..\n 0090 8cc2000c 00401825 8cc2000c 24c60010 .....@.%....$...\n 00a0 0062082a 10200002 00000000 00401825 .b.*. .......@.%\n 00b0 54c8ffeb 8cc70000 03e00008 00601025 T............`.%\nContents of section .options:\n 0000 01200000 00000000 8100c1fe 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c1fe 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000030 00000008 00000228 p......0.......(\n 0010 00000005 00000370 00000001 00000230 .......p.......0\n 0020 00000004 00000264 00000000 00000000 .......d........\n 0030 00000011 00000294 00000038 000002d8 ...........8....\n 0040 00000008 00000310 00000001 00000318 ................\n 0050 00000000 00000000 00000001 00000360 ...............`\n 0060 08080808 08020000 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000c0 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d36 35333433 35666635 ps-ref-653435ff5\n 0130 32626239 6666382f 7265662e 63006d61 2bb9ff8/ref.c.ma\n 0140 78617272 00000000 6d617861 72720000 xarr....maxarr..\n 0150 00000000 00000001 00000000 00000035 ...............5\n 0160 00000000 00000004 00000000 00000030 ...............0\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000006 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxarr:mwcc_242_81","sym":"maxarr","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","memory","branch"],"loc":1,"refSource":"int maxarr(int *a,int n){ int m=a[0],i; for(i=1;im)m=a[i]; return m; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddi r0,r4,-1\n 4:\taddi r5,r3,4\n 8:\tlwz r3,0(r3)\n c:\tmtctr r0\n 10:\tcmpwi r4,1\n 14:\tblelr\n 18:\tlwz r0,0(r5)\n 1c:\tcmpw r0,r3\n 20:\tble 28 \n 24:\tmr r3,r0\n 28:\taddi r5,r5,4\n 2c:\tbdnz 18 \n 30:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000034 maxarr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 maxarr\n\n\nContents of section .text:\n 0000 3804ffff 38a30004 80630000 7c0903a6 8...8....c..|...\n 0010 2c040001 4c810020 80050000 7c001800 ,...L.. ....|...\n 0020 40810008 7c030378 38a50004 4200ffec @...|..x8...B...\n 0030 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000034 00000000 ...4.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned/flip-branch","outcome":"nonmatch","source":"s32 maxarr(s32 * a0, u32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n s32 v3;\n if (a1 <= 1) {\n return *a0;\n } else {\n v2 = a1 + -1;\n v0 = a0 + 1;\n v1 = *a0;\n do {\n if (*v0 <= v1) {\n v3 = v1;\n } else {\n v3 = *v0;\n }\n v1 = v3;\n v0 = v0 + 1;\n v2 = v2 - 1;\n } while (v2 != 0);\n return v1;\n }\n}\n","score":15,"maxScore":18,"compileErrors":null,"breakdown":{"insert":5,"delete":2,"replace":2,"opMismatch":3,"argMismatch":3},"quality":{"score":100,"lines":24,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void maxarr(s32 *arg0, s32 arg1) {\n s32 *var_r5;\n s32 temp_r0;\n s32 var_ctr;\n s32 var_r3;\n\n var_r5 = arg0 + 4;\n var_r3 = *arg0;\n var_ctr = arg1 - 1;\n if (arg1 > 1) {\n do {\n temp_r0 = *var_r5;\n if (temp_r0 > var_r3) {\n var_r3 = temp_r0;\n }\n var_r5 += 4;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n}\n","score":13,"maxScore":17,"compileErrors":null,"breakdown":{"insert":4,"delete":4,"replace":0,"opMismatch":1,"argMismatch":4},"quality":{"score":100,"lines":19,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":13,"maxScore":17,"ratio":0.7647058823529411,"kinds":{"insert":4,"delete":4,"replace":0,"opMismatch":1,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxarr` — benchmark function synthetic:maxarr:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel maxarr\n addi r0,r4,-1\n addi r5,r3,4\n lwz r3,0(r3)\n mtctr r0\n cmpwi r4,1\n blelr\n.L18:\n lwz r0,0(r5)\n cmpw r0,r3\n ble .L28\n mr r3,r0\n.L28:\n addi r5,r5,4\n bdnz .L18\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxarr` — benchmark function synthetic:maxarr:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxarr:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddi r0,r4,-1\n 4:\taddi r5,r3,4\n 8:\tlwz r3,0(r3)\n c:\tmtctr r0\n 10:\tcmpwi r4,1\n 14:\tblelr\n 18:\tlwz r0,0(r5)\n 1c:\tcmpw r0,r3\n 20:\tble 28 \n 24:\tmr r3,r0\n 28:\taddi r5,r5,4\n 2c:\tbdnz 18 \n 30:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000034 maxarr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 maxarr\n\n\nContents of section .text:\n 0000 3804ffff 38a30004 80630000 7c0903a6 8...8....c..|...\n 0010 2c040001 4c810020 80050000 7c001800 ,...L.. ....|...\n 0020 40810008 7c030378 38a50004 4200ffec @...|..x8...B...\n 0030 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000034 00000000 ...4.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxi:agbcc","sym":"maxi","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int maxi(int a,int b){ return a>b?a:b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmaxi\n\t.type\t maxi,function\n\t.thumb_func\nmaxi:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, r2\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r2, #0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t maxi,.Lfe1-maxi\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 maxi(s32 a0, s32 a1) {\n if (a1 < a0) a1 = a0;\n return a1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 maxi(s32 arg0, s32 arg1) {\n s32 var_r0;\n\n var_r0 = arg1;\n if (var_r0 < arg0) {\n var_r0 = arg0;\n }\n return var_r0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxi` — benchmark function synthetic:maxi:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmaxi\n\t.type\t maxi,function\n\t.thumb_func\nmaxi:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, r2\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r2, #0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t maxi,.Lfe1-maxi\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxi` — benchmark function synthetic:maxi:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxi:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmaxi\n\t.type\t maxi,function\n\t.thumb_func\nmaxi:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, r2\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r2, #0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t maxi,.Lfe1-maxi\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxi # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxi:gcc2.7.2kmc","sym":"maxi","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int maxi(int a,int b){ return a>b?a:b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2d6a658a54f8f1e9/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 maxi\n\n\nContents of section .text:\n 0000 0085102a 54400001 00a02021 03e00008 ...*T@.... !....\n 0010 00801021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'maxi' — lift: cannot lift 'maxi': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tslt\tv0,a0,a1 */\n/* 4:\tbnezl\tv0,c */\n/* 8:\tmove\ta0,a1 */\n/* c:\tjr\tra */\n/* 10:\tmove\tv0,a0 */\n/* \t... */\nvoid maxi(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'maxi': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":14,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'maxi': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 maxi(s32 arg0, s32 arg1) {\n s32 var_a0;\n\n var_a0 = arg0;\n if (var_a0 < arg1) {\n var_a0 = arg1;\n }\n return var_a0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxi` — benchmark function synthetic:maxi:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel maxi\n slt\t$v0, $a0, $a1\n bnezl\t$v0, .Lc\n move\t$a0, $a1\n.Lc:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxi` — benchmark function synthetic:maxi:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxi:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a0,a1\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2d6a658a54f8f1e9/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 maxi\n\n\nContents of section .text:\n 0000 0085102a 54400001 00a02021 03e00008 ...*T@.... !....\n 0010 00801021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxi:ido7.1","sym":"maxi","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int maxi(int a,int b){ return a>b?a:b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a1,a0\n 4:\tbeqz\tat,14 \n 8:\tmove\tv1,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c maxi\n\n\nContents of section .text:\n 0000 00a4082a 10200003 00a01825 03e00008 ...*. .....%....\n 0010 00801025 03e00008 00601025 00000000 ...%.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000003e 00000000 . .........>....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003e 00000000 00000000 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 64366136 35386135 34663866 ef-2d6a658a54f8f\n 0130 3165392f 7265662e 63006d61 78690000 1e9/ref.c.maxi..\n 0140 6d617869 00000000 00000000 00000001 maxi............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 maxi(s32 a0, s32 a1) {\n if (a1 < a0) {\n return a0;\n } else {\n return a1;\n }\n}\n","score":2,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 maxi(s32 arg0, s32 arg1) {\n if (arg1 < arg0) {\n return arg0;\n }\n return arg1;\n}\n","score":2,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":7,"ratio":0.2857142857142857,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxi` — benchmark function synthetic:maxi:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel maxi\n slt\t$at, $a1, $a0\n beqz\t$at, .L14\n move\t$v1, $a1\n jr\t$ra\n move\t$v0, $a0\n.L14:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxi` — benchmark function synthetic:maxi:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxi:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a1,a0\n 4:\tbeqz\tat,14 \n 8:\tmove\tv1,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c maxi\n\n\nContents of section .text:\n 0000 00a4082a 10200003 00a01825 03e00008 ...*. .....%....\n 0010 00801025 03e00008 00601025 00000000 ...%.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000003e 00000000 . .........>....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003e 00000000 00000000 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 64366136 35386135 34663866 ef-2d6a658a54f8f\n 0130 3165392f 7265662e 63006d61 78690000 1e9/ref.c.maxi..\n 0140 6d617869 00000000 00000000 00000001 maxi............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:maxi:mwcc_242_81","sym":"maxi","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int maxi(int a,int b){ return a>b?a:b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tble c \n 8:\tmr r4,r3\n c:\tmr r3,r4\n 10:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 maxi\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 maxi\n\n\nContents of section .text:\n 0000 7c032000 40810008 7c641b78 7c832378 |. .@...|d.x|.#x\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 maxi(s32 a0, s32 a1) {\n if (a0 > a1) a1 = a0;\n return a1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 maxi(s32 arg0, s32 arg1) {\n s32 var_r4;\n\n var_r4 = arg1;\n if (arg0 > var_r4) {\n var_r4 = arg0;\n }\n return var_r4;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `maxi` — benchmark function synthetic:maxi:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel maxi\n cmpw r3,r4\n ble .Lc\n mr r4,r3\n.Lc:\n mr r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function maxi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `maxi` — benchmark function synthetic:maxi:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:maxi:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tble c \n 8:\tmr r4,r3\n c:\tmr r3,r4\n 10:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 maxi\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 maxi\n\n\nContents of section .text:\n 0000 7c032000 40810008 7c641b78 7c832378 |. .@...|d.x|.#x\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name maxi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memcpy1:agbcc","sym":"memcpy1","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","memory","store","load"],"loc":1,"refSource":"void memcpy1(u8 *d,u8 *s,int n){ int i; for(i=0;i 0) {\n do {\n arg0[var_r3] = arg1[var_r3];\n var_r3 += 1;\n } while (var_r3 < arg2);\n }\n}\n","score":2,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":10,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":16,"ratio":0.125,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memcpy1` — benchmark function synthetic:memcpy1:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmemcpy1\n\t.type\t memcpy1,function\n\t.thumb_func\nmemcpy1:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tadd\tr4, r1, #0\n\tmov\tr3, #0x0\n\tcmp\tr3, r2\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r5, r3\n\tadd\tr1, r4, r3\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r0]\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r2\n\tblt\t.L6\t@cond_branch\n.L4:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t memcpy1,.Lfe1-memcpy1\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memcpy1(u8*,u8*,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memcpy1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memcpy1` — benchmark function synthetic:memcpy1:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memcpy1:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmemcpy1\n\t.type\t memcpy1,function\n\t.thumb_func\nmemcpy1:\n\tpush\t{r4, r5, lr}\n\tadd\tr5, r0, #0\n\tadd\tr4, r1, #0\n\tmov\tr3, #0x0\n\tcmp\tr3, r2\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r5, r3\n\tadd\tr1, r4, r3\n\tldrb\tr1, [r1]\n\tstrb\tr1, [r0]\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r2\n\tblt\t.L6\t@cond_branch\n.L4:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t memcpy1,.Lfe1-memcpy1\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memcpy1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name memcpy1 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memcpy1:gcc2.7.2kmc","sym":"memcpy1","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","memory","store","load"],"loc":1,"refSource":"void memcpy1(u8 *d,u8 *s,int n){ int i; for(i=0;i:\n 0:\tblez\ta2,24 \n 4:\tnop\n 8:\taddu\ta2,a2,a0\n c:\tlbu\tv0,0(a1)\n 10:\tsb\tv0,0(a0)\n 14:\taddiu\ta0,a0,1\n 18:\tslt\tv0,a0,a2\n 1c:\tbnez\tv0,c \n 20:\taddiu\ta1,a1,1\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\n","ctx":"void memcpy1(u8*,u8*,int);","proto":{"memcpy1":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-820f10aa4bda9e53/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c memcpy1\n\n\nContents of section .text:\n 0000 18c00008 00000000 00c43021 90a20000 ..........0!....\n 0010 a0820000 24840001 0086102a 1440fffb ....$......*.@..\n 0020 24a50001 03e00008 00000000 00000000 $...............\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"void memcpy1(u32 a0, u32 a1, u8 * a2, u32 a3) {\n u8 * v0;\n u8 * v1;\n if (a3 > 0) {\n v0 = a2;\n v1 = (u8 *)a1;\n do {\n *v1 = *v0;\n v1 = v1 + 1;\n v0 = v0 + 1;\n } while (v1 < a3 + a1);\n a0 = v1 < a3 + a1;\n }\n return;\n}\n","score":7,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":2,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":15,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void memcpy1(u8 *arg0, u8 *arg1, s32 arg2) {\n u8 *temp_a2;\n u8 *var_a0;\n u8 *var_a1;\n\n var_a0 = arg0;\n var_a1 = arg1;\n if (arg2 > 0) {\n temp_a2 = &var_a0[arg2];\n do {\n *var_a0 = *var_a1;\n var_a0 += 1;\n var_a1 += 1;\n } while ((s32) var_a0 < (s32) temp_a2);\n }\n}\n","score":1,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":15,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":1,"maxScore":11,"ratio":0.09090909090909091,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memcpy1` — benchmark function synthetic:memcpy1:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel memcpy1\n blez\t$a2, .L24\n nop\n addu\t$a2, $a2, $a0\n.Lc:\n lbu\t$v0, 0($a1)\n sb\t$v0, 0($a0)\n addiu\t$a0, $a0, 1\n slt\t$v0, $a0, $a2\n bnez\t$v0, .Lc\n addiu\t$a1, $a1, 1\n.L24:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memcpy1(u8*,u8*,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memcpy1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memcpy1` — benchmark function synthetic:memcpy1:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memcpy1:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta2,24 \n 4:\tnop\n 8:\taddu\ta2,a2,a0\n c:\tlbu\tv0,0(a1)\n 10:\tsb\tv0,0(a0)\n 14:\taddiu\ta0,a0,1\n 18:\tslt\tv0,a0,a2\n 1c:\tbnez\tv0,c \n 20:\taddiu\ta1,a1,1\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-820f10aa4bda9e53/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c memcpy1\n\n\nContents of section .text:\n 0000 18c00008 00000000 00c43021 90a20000 ..........0!....\n 0010 a0820000 24840001 0086102a 1440fffb ....$......*.@..\n 0020 24a50001 03e00008 00000000 00000000 $...............\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memcpy1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name memcpy1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memcpy1:ido7.1","sym":"memcpy1","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","memory","store","load"],"loc":1,"refSource":"void memcpy1(u8 *d,u8 *s,int n){ int i; for(i=0;i:\n 0:\tblez\ta2,70 \n 4:\tmove\tv0,zero\n 8:\tandi\tt1,a2,0x3\n c:\tbeqz\tt1,38 \n 10:\tmove\tt0,t1\n 14:\tmove\tv1,a0\n 18:\tmove\ta3,a1\n 1c:\tlbu\tt6,0(a3)\n 20:\taddiu\tv0,v0,1\n 24:\taddiu\tv1,v1,1\n 28:\taddiu\ta3,a3,1\n 2c:\tbne\tt0,v0,1c \n 30:\tsb\tt6,-1(v1)\n 34:\tbeq\tv0,a2,70 \n 38:\taddu\tv1,a0,v0\n 3c:\taddu\ta3,a1,v0\n 40:\tlbu\tt7,0(a3)\n 44:\taddiu\tv0,v0,4\n 48:\taddiu\tv1,v1,4\n 4c:\tsb\tt7,-4(v1)\n 50:\tlbu\tt8,1(a3)\n 54:\taddiu\ta3,a3,4\n 58:\tsb\tt8,-3(v1)\n 5c:\tlbu\tt9,-2(a3)\n 60:\tsb\tt9,-2(v1)\n 64:\tlbu\tt2,-1(a3)\n 68:\tbne\tv0,a2,40 \n 6c:\tsb\tt2,-1(v1)\n 70:\tjr\tra\n 74:\tnop\n\t...\n","ctx":"void memcpy1(u8*,u8*,int);","proto":{"memcpy1":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 memcpy1\n\n\nContents of section .text:\n 0000 18c0001b 00001025 30c90003 1120000a .......%0.... ..\n 0010 01204025 00801821 00a03821 90ee0000 . @%...!..8!....\n 0020 24420001 24630001 24e70001 1502fffb $B..$c..$.......\n 0030 a06effff 1046000e 00821821 00a23821 .n...F.....!..8!\n 0040 90ef0000 24420004 24630004 a06ffffc ....$B..$c...o..\n 0050 90f80001 24e70004 a078fffd 90f9fffe ....$....x......\n 0060 a079fffe 90eaffff 1446fff5 a06affff .y.......F...j..\n 0070 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c7fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c7fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000004 000001e8 p...............\n 0010 00000005 0000032c 00000001 000001ec .......,........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000038 00000294 .......P...8....\n 0040 00000008 000002cc 00000001 000002d4 ................\n 0050 00000000 00000000 00000001 0000031c ................\n 0060 08080802 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000078 20200001 00000001 .......x ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 32306631 30616134 62646139 ef-820f10aa4bda9\n 0130 6535332f 7265662e 63006d65 6d637079 e53/ref.c.memcpy\n 0140 31000000 6d656d63 70793100 00000000 1...memcpy1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000001e 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000004 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'memcpy1' — lift: cannot lift 'memcpy1': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tblez\ta2,70 */\n/* 4:\tmove\tv0,zero */\n/* 8:\tandi\tt1,a2,0x3 */\n/* c:\tbeqz\tt1,38 */\n/* 10:\tmove\tt0,t1 */\n/* 14:\tmove\tv1,a0 */\n/* 18:\tmove\ta3,a1 */\n/* 1c:\tlbu\tt6,0(a3) */\n/* 20:\taddiu\tv0,v0,1 */\n/* 24:\taddiu\tv1,v1,1 */\n/* 28:\taddiu\ta3,a3,1 */\n/* 2c:\tbne\tt0,v0,1c */\n/* 30:\tsb\tt6,-1(v1) */\n/* 34:\tbeq\tv0,a2,70 */\n/* 38:\taddu\tv1,a0,v0 */\n/* 3c:\taddu\ta3,a1,v0 */\n/* 40:\tlbu\tt7,0(a3) */\n/* 44:\taddiu\tv0,v0,4 */\n/* 48:\taddiu\tv1,v1,4 */\n/* 4c:\tsb\tt7,-4(v1) */\n/* 50:\tlbu\tt8,1(a3) */\n/* 54:\taddiu\ta3,a3,4 */\n/* 58:\tsb\tt8,-3(v1) */\n/* 5c:\tlbu\tt9,-2(a3) */\n/* 60:\tsb\tt9,-2(v1) */\n/* 64:\tlbu\tt2,-1(a3) */\n/* 68:\tbne\tv0,a2,40 */\n/* 6c:\tsb\tt2,-1(v1) */\n/* 70:\tjr\tra */\n/* 74:\tnop */\n/* \t... */\nvoid memcpy1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'memcpy1': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":39,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'memcpy1': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void memcpy1(u8 *arg0, u8 *arg1, s32 arg2) {\n s32 temp_t1;\n s32 var_v0;\n u8 *var_a3;\n u8 *var_a3_2;\n u8 *var_v1;\n u8 *var_v1_2;\n u8 temp_t6;\n u8 temp_t8;\n\n var_v0 = 0;\n if (arg2 > 0) {\n temp_t1 = arg2 & 3;\n if (temp_t1 != 0) {\n var_v1 = arg0;\n var_a3 = arg1;\n do {\n temp_t6 = *var_a3;\n var_v0 += 1;\n var_v1 += 1;\n var_a3 += 1;\n var_v1->unk-1 = temp_t6;\n } while (temp_t1 != var_v0);\n if (var_v0 != arg2) {\n goto block_5;\n }\n } else {\nblock_5:\n var_v1_2 = &arg0[var_v0];\n var_a3_2 = &arg1[var_v0];\n do {\n var_v0 += 4;\n var_v1_2 += 4;\n var_v1_2->unk-4 = (u8) var_a3_2->unk0;\n temp_t8 = var_a3_2->unk1;\n var_a3_2 += 4;\n var_v1_2->unk-3 = temp_t8;\n var_v1_2->unk-2 = (u8) var_a3_2->unk-2;\n var_v1_2->unk-1 = (u8) var_a3_2->unk-1;\n } while (var_v0 != arg2);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":86,"lines":42,"gotos":1,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 23: Syntax Error","cfe: Error: /cand.c, line 35: Syntax Error","cfe: Error: /cand.c, line 38: Syntax Error","cfe: Error: /cand.c, line 39: Syntax Error","cfe: Error: /cand.c, line 40: Syntax Error"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memcpy1` — benchmark function synthetic:memcpy1:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel memcpy1\n blez\t$a2, .L70\n move\t$v0, $zero\n andi\t$t1, $a2, 0x3\n beqz\t$t1, .L38\n move\t$t0, $t1\n move\t$v1, $a0\n move\t$a3, $a1\n.L1c:\n lbu\t$t6, 0($a3)\n addiu\t$v0, $v0, 1\n addiu\t$v1, $v1, 1\n addiu\t$a3, $a3, 1\n bne\t$t0, $v0, .L1c\n sb\t$t6, -1($v1)\n beq\t$v0, $a2, .L70\n.L38:\n addu\t$v1, $a0, $v0\n addu\t$a3, $a1, $v0\n.L40:\n lbu\t$t7, 0($a3)\n addiu\t$v0, $v0, 4\n addiu\t$v1, $v1, 4\n sb\t$t7, -4($v1)\n lbu\t$t8, 1($a3)\n addiu\t$a3, $a3, 4\n sb\t$t8, -3($v1)\n lbu\t$t9, -2($a3)\n sb\t$t9, -2($v1)\n lbu\t$t2, -1($a3)\n bne\t$v0, $a2, .L40\n sb\t$t2, -1($v1)\n.L70:\n jr\t$ra\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memcpy1(u8*,u8*,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memcpy1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memcpy1` — benchmark function synthetic:memcpy1:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memcpy1:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta2,70 \n 4:\tmove\tv0,zero\n 8:\tandi\tt1,a2,0x3\n c:\tbeqz\tt1,38 \n 10:\tmove\tt0,t1\n 14:\tmove\tv1,a0\n 18:\tmove\ta3,a1\n 1c:\tlbu\tt6,0(a3)\n 20:\taddiu\tv0,v0,1\n 24:\taddiu\tv1,v1,1\n 28:\taddiu\ta3,a3,1\n 2c:\tbne\tt0,v0,1c \n 30:\tsb\tt6,-1(v1)\n 34:\tbeq\tv0,a2,70 \n 38:\taddu\tv1,a0,v0\n 3c:\taddu\ta3,a1,v0\n 40:\tlbu\tt7,0(a3)\n 44:\taddiu\tv0,v0,4\n 48:\taddiu\tv1,v1,4\n 4c:\tsb\tt7,-4(v1)\n 50:\tlbu\tt8,1(a3)\n 54:\taddiu\ta3,a3,4\n 58:\tsb\tt8,-3(v1)\n 5c:\tlbu\tt9,-2(a3)\n 60:\tsb\tt9,-2(v1)\n 64:\tlbu\tt2,-1(a3)\n 68:\tbne\tv0,a2,40 \n 6c:\tsb\tt2,-1(v1)\n 70:\tjr\tra\n 74:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 memcpy1\n\n\nContents of section .text:\n 0000 18c0001b 00001025 30c90003 1120000a .......%0.... ..\n 0010 01204025 00801821 00a03821 90ee0000 . @%...!..8!....\n 0020 24420001 24630001 24e70001 1502fffb $B..$c..$.......\n 0030 a06effff 1046000e 00821821 00a23821 .n...F.....!..8!\n 0040 90ef0000 24420004 24630004 a06ffffc ....$B..$c...o..\n 0050 90f80001 24e70004 a078fffd 90f9fffe ....$....x......\n 0060 a079fffe 90eaffff 1446fff5 a06affff .y.......F...j..\n 0070 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8300c7fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300c7fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000004 000001e8 p...............\n 0010 00000005 0000032c 00000001 000001ec .......,........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000038 00000294 .......P...8....\n 0040 00000008 000002cc 00000001 000002d4 ................\n 0050 00000000 00000000 00000001 0000031c ................\n 0060 08080802 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000078 20200001 00000001 .......x ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 32306631 30616134 62646139 ef-820f10aa4bda9\n 0130 6535332f 7265662e 63006d65 6d637079 e53/ref.c.memcpy\n 0140 31000000 6d656d63 70793100 00000000 1...memcpy1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000001e 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000004 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memcpy1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name memcpy1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memcpy1:mwcc_242_81","sym":"memcpy1","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","memory","store","load"],"loc":1,"refSource":"void memcpy1(u8 *d,u8 *s,int n){ int i; for(i=0;i:\n 0:\tcmpwi r5,0\n 4:\tli r8,0\n 8:\tblelr\n c:\tcmpwi r5,8\n 10:\taddi r6,r5,-8\n 14:\tble 7c \n 18:\taddi r0,r6,7\n 1c:\tsrwi r0,r0,3\n 20:\tmtctr r0\n 24:\tcmpwi r6,0\n 28:\tble 7c \n 2c:\tadd r6,r4,r8\n 30:\tadd r7,r3,r8\n 34:\tlbz r0,0(r6)\n 38:\taddi r8,r8,8\n 3c:\tstb r0,0(r7)\n 40:\tlbz r0,1(r6)\n 44:\tstb r0,1(r7)\n 48:\tlbz r0,2(r6)\n 4c:\tstb r0,2(r7)\n 50:\tlbz r0,3(r6)\n 54:\tstb r0,3(r7)\n 58:\tlbz r0,4(r6)\n 5c:\tstb r0,4(r7)\n 60:\tlbz r0,5(r6)\n 64:\tstb r0,5(r7)\n 68:\tlbz r0,6(r6)\n 6c:\tstb r0,6(r7)\n 70:\tlbz r0,7(r6)\n 74:\tstb r0,7(r7)\n 78:\tbdnz 2c \n 7c:\tsubf r0,r8,r5\n 80:\tadd r4,r4,r8\n 84:\tadd r3,r3,r8\n 88:\tmtctr r0\n 8c:\tcmpw r8,r5\n 90:\tbgelr\n 94:\tlbz r0,0(r4)\n 98:\taddi r4,r4,1\n 9c:\tstb r0,0(r3)\n a0:\taddi r3,r3,1\n a4:\tbdnz 94 \n a8:\tblr\n","ctx":"void memcpy1(u8*,u8*,int);","proto":{"memcpy1":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000ac memcpy1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 memcpy1\n\n\nContents of section .text:\n 0000 2c050000 39000000 4c810020 2c050008 ,...9...L.. ,...\n 0010 38c5fff8 40810068 38060007 5400e8fe 8...@..h8...T...\n 0020 7c0903a6 2c060000 40810054 7cc44214 |...,...@..T|.B.\n 0030 7ce34214 88060000 39080008 98070000 |.B.....9.......\n 0040 88060001 98070001 88060002 98070002 ................\n 0050 88060003 98070003 88060004 98070004 ................\n 0060 88060005 98070005 88060006 98070006 ................\n 0070 88060007 98070007 4200ffb4 7c082850 ........B...|.(P\n 0080 7c844214 7c634214 7c0903a6 7c082800 |.B.|cB.|...|.(.\n 0090 4c800020 88040000 38840001 98030000 L.. ....8.......\n 00a0 38630001 4200fff0 4e800020 8c..B...N.. \nContents of section .mwcats.text:\n 0000 020000ac 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"void memcpy1(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n s32 v1;\n u8 * v2;\n u8 * v3;\n s32 v4;\n if (a2 > 0) {\n if (a2 <= 8) {\n v0 = 0;\n } else {\n v0 = 0;\n for (v1 = (u32)(a2 + -8 + 7) >> 3; v1 != 0; v1 = v1 - 1) {\n *(u8 *)(a0 + v0) = *(u8 *)(a1 + v0);\n ((u8 *)(a0 + v0))[1] = ((u8 *)(a1 + v0))[1];\n ((u8 *)(a0 + v0))[2] = ((u8 *)(a1 + v0))[2];\n ((u8 *)(a0 + v0))[3] = ((u8 *)(a1 + v0))[3];\n ((u8 *)(a0 + v0))[4] = ((u8 *)(a1 + v0))[4];\n ((u8 *)(a0 + v0))[5] = ((u8 *)(a1 + v0))[5];\n ((u8 *)(a0 + v0))[6] = ((u8 *)(a1 + v0))[6];\n ((u8 *)(a0 + v0))[7] = ((u8 *)(a1 + v0))[7];\n v0 = v0 + 8;\n }\n }\n if (v0 < a2) {\n v4 = a2 - v0;\n v2 = (u8 *)(a1 + v0);\n v3 = (u8 *)(a0 + v0);\n do {\n *v3 = *v2;\n v2 = v2 + 1;\n v3 = v3 + 1;\n v4 = v4 - 1;\n } while (v4 != 0);\n return;\n } else {\n return;\n }\n } else {\n return;\n }\n}\n","score":80,"maxScore":91,"compileErrors":null,"breakdown":{"insert":48,"delete":3,"replace":3,"opMismatch":3,"argMismatch":23},"quality":{"score":80,"lines":41,"gotos":0,"casts":19,"unkGlue":0,"rawMem":2,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void memcpy1(u8 *arg0, u8 *arg1, s32 arg2) {\n s32 temp_r6;\n s32 var_ctr_2;\n s32 var_r8;\n u32 var_ctr;\n u8 *temp_r6_2;\n u8 *temp_r7;\n u8 *var_r3;\n u8 *var_r4;\n u8 temp_r0;\n u8 temp_r0_2;\n\n var_r8 = 0;\n if (arg2 > 0) {\n temp_r6 = arg2 - 8;\n if (arg2 > 8) {\n var_ctr = (u32) (temp_r6 + 7) >> 3U;\n if (temp_r6 > 0) {\n do {\n temp_r6_2 = &arg1[var_r8];\n temp_r7 = &arg0[var_r8];\n temp_r0 = temp_r6_2->unk0;\n var_r8 += 8;\n temp_r7->unk0 = temp_r0;\n temp_r7->unk1 = (u8) temp_r6_2->unk1;\n temp_r7->unk2 = (u8) temp_r6_2->unk2;\n temp_r7->unk3 = (u8) temp_r6_2->unk3;\n temp_r7->unk4 = (u8) temp_r6_2->unk4;\n temp_r7->unk5 = (u8) temp_r6_2->unk5;\n temp_r7->unk6 = (u8) temp_r6_2->unk6;\n temp_r7->unk7 = (u8) temp_r6_2->unk7;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r4 = &arg1[var_r8];\n var_r3 = &arg0[var_r8];\n var_ctr_2 = arg2 - var_r8;\n if (var_r8 < arg2) {\n do {\n temp_r0_2 = *var_r4;\n var_r4 += 1;\n *var_r3 = temp_r0_2;\n var_r3 += 1;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":9,"quality":{"score":88,"lines":48,"gotos":0,"casts":8,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class","# Error: ^^"]},"gapSize":{"decompiler":"asmlift","score":80,"maxScore":91,"ratio":0.8791208791208791,"kinds":{"insert":48,"delete":3,"replace":3,"opMismatch":3,"argMismatch":23}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memcpy1` — benchmark function synthetic:memcpy1:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel memcpy1\n cmpwi r5,0\n li r8,0\n blelr\n cmpwi r5,8\n addi r6,r5,-8\n ble .L7c\n addi r0,r6,7\n srwi r0,r0,3\n mtctr r0\n cmpwi r6,0\n ble .L7c\n.L2c:\n add r6,r4,r8\n add r7,r3,r8\n lbz r0,0(r6)\n addi r8,r8,8\n stb r0,0(r7)\n lbz r0,1(r6)\n stb r0,1(r7)\n lbz r0,2(r6)\n stb r0,2(r7)\n lbz r0,3(r6)\n stb r0,3(r7)\n lbz r0,4(r6)\n stb r0,4(r7)\n lbz r0,5(r6)\n stb r0,5(r7)\n lbz r0,6(r6)\n stb r0,6(r7)\n lbz r0,7(r6)\n stb r0,7(r7)\n bdnz .L2c\n.L7c:\n subf r0,r8,r5\n add r4,r4,r8\n add r3,r3,r8\n mtctr r0\n cmpw r8,r5\n bgelr\n.L94:\n lbz r0,0(r4)\n addi r4,r4,1\n stb r0,0(r3)\n addi r3,r3,1\n bdnz .L94\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memcpy1(u8*,u8*,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memcpy1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memcpy1` — benchmark function synthetic:memcpy1:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memcpy1:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r5,0\n 4:\tli r8,0\n 8:\tblelr\n c:\tcmpwi r5,8\n 10:\taddi r6,r5,-8\n 14:\tble 7c \n 18:\taddi r0,r6,7\n 1c:\tsrwi r0,r0,3\n 20:\tmtctr r0\n 24:\tcmpwi r6,0\n 28:\tble 7c \n 2c:\tadd r6,r4,r8\n 30:\tadd r7,r3,r8\n 34:\tlbz r0,0(r6)\n 38:\taddi r8,r8,8\n 3c:\tstb r0,0(r7)\n 40:\tlbz r0,1(r6)\n 44:\tstb r0,1(r7)\n 48:\tlbz r0,2(r6)\n 4c:\tstb r0,2(r7)\n 50:\tlbz r0,3(r6)\n 54:\tstb r0,3(r7)\n 58:\tlbz r0,4(r6)\n 5c:\tstb r0,4(r7)\n 60:\tlbz r0,5(r6)\n 64:\tstb r0,5(r7)\n 68:\tlbz r0,6(r6)\n 6c:\tstb r0,6(r7)\n 70:\tlbz r0,7(r6)\n 74:\tstb r0,7(r7)\n 78:\tbdnz 2c \n 7c:\tsubf r0,r8,r5\n 80:\tadd r4,r4,r8\n 84:\tadd r3,r3,r8\n 88:\tmtctr r0\n 8c:\tcmpw r8,r5\n 90:\tbgelr\n 94:\tlbz r0,0(r4)\n 98:\taddi r4,r4,1\n 9c:\tstb r0,0(r3)\n a0:\taddi r3,r3,1\n a4:\tbdnz 94 \n a8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000ac memcpy1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 memcpy1\n\n\nContents of section .text:\n 0000 2c050000 39000000 4c810020 2c050008 ,...9...L.. ,...\n 0010 38c5fff8 40810068 38060007 5400e8fe 8...@..h8...T...\n 0020 7c0903a6 2c060000 40810054 7cc44214 |...,...@..T|.B.\n 0030 7ce34214 88060000 39080008 98070000 |.B.....9.......\n 0040 88060001 98070001 88060002 98070002 ................\n 0050 88060003 98070003 88060004 98070004 ................\n 0060 88060005 98070005 88060006 98070006 ................\n 0070 88060007 98070007 4200ffb4 7c082850 ........B...|.(P\n 0080 7c844214 7c634214 7c0903a6 7c082800 |.B.|cB.|...|.(.\n 0090 4c800020 88040000 38840001 98030000 L.. ....8.......\n 00a0 38630001 4200fff0 4e800020 8c..B...N.. \nContents of section .mwcats.text:\n 0000 020000ac 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memcpy1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name memcpy1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memset1:agbcc","sym":"memset1","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for","memory","store"],"loc":1,"refSource":"void memset1(u8 *p,int n,u8 v){ int i; for(i=0;i 0) {\n do {\n arg0[var_r3] = arg2;\n var_r3 += 1;\n } while (var_r3 < arg1);\n }\n}\n","score":2,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":10,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":15,"ratio":0.13333333333333333,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memset1` — benchmark function synthetic:memset1:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmemset1\n\t.type\t memset1,function\n\t.thumb_func\nmemset1:\n\tpush\t{r4, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r4, r3\n\tstrb\tr2, [r0]\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r1\n\tblt\t.L6\t@cond_branch\n.L4:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t memset1,.Lfe1-memset1\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memset1(u8*,int,u8);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memset1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memset1` — benchmark function synthetic:memset1:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memset1:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmemset1\n\t.type\t memset1,function\n\t.thumb_func\nmemset1:\n\tpush\t{r4, lr}\n\tadd\tr4, r0, #0\n\tlsl\tr2, r2, #0x18\n\tlsr\tr2, r2, #0x18\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr0, r4, r3\n\tstrb\tr2, [r0]\n\tadd\tr3, r3, #0x1\n\tcmp\tr3, r1\n\tblt\t.L6\t@cond_branch\n.L4:\n\tpop\t{r4}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t memset1,.Lfe1-memset1\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memset1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name memset1 # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memset1:gcc2.7.2kmc","sym":"memset1","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for","memory","store"],"loc":1,"refSource":"void memset1(u8 *p,int n,u8 v){ int i; for(i=0;i:\n 0:\tblez\ta1,20 \n 4:\tnop\n 8:\taddu\ta1,a1,a0\n c:\tsb\ta2,0(a0)\n 10:\taddiu\ta0,a0,1\n 14:\tslt\tv0,a0,a1\n 18:\tbnezl\tv0,10 \n 1c:\tsb\ta2,0(a0)\n 20:\tjr\tra\n 24:\tnop\n\t...\n","ctx":"void memset1(u8*,int,u8);","proto":{"memset1":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-30ed35db3fd63330/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 memset1\n\n\nContents of section .text:\n 0000 18a00007 00000000 00a42821 a0860000 ..........(!....\n 0010 24840001 0085102a 5440fffd a0860000 $......*T@......\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'memset1' — lift: cannot lift 'memset1': unmodelled control transfer 'bnezl' at 0x18 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tblez\ta1,20 */\n/* 4:\tnop */\n/* 8:\taddu\ta1,a1,a0 */\n/* c:\tsb\ta2,0(a0) */\n/* 10:\taddiu\ta0,a0,1 */\n/* 14:\tslt\tv0,a0,a1 */\n/* 18:\tbnezl\tv0,10 */\n/* 1c:\tsb\ta2,0(a0) */\n/* 20:\tjr\tra */\n/* 24:\tnop */\n/* \t... */\nvoid memset1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'memset1': unmodelled control transfer 'bnezl' at 0x18 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":19,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'memset1': unmodelled control transfer 'bnezl' at 0x18 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void memset1(u8 *arg0, s32 arg1, u8 arg2) {\n u8 *temp_a1;\n u8 *var_a0;\n\n var_a0 = arg0;\n if (arg1 > 0) {\n temp_a1 = &var_a0[arg1];\n do {\n *var_a0 = arg2;\n var_a0 += 1;\n } while ((s32) var_a0 < (s32) temp_a1);\n }\n}\n","score":1,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":12,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":1,"maxScore":10,"ratio":0.1,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memset1` — benchmark function synthetic:memset1:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel memset1\n blez\t$a1, .L20\n nop\n addu\t$a1, $a1, $a0\n sb\t$a2, 0($a0)\n.L10:\n addiu\t$a0, $a0, 1\n slt\t$v0, $a0, $a1\n bnezl\t$v0, .L10\n sb\t$a2, 0($a0)\n.L20:\n jr\t$ra\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memset1(u8*,int,u8);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memset1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memset1` — benchmark function synthetic:memset1:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memset1:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta1,20 \n 4:\tnop\n 8:\taddu\ta1,a1,a0\n c:\tsb\ta2,0(a0)\n 10:\taddiu\ta0,a0,1\n 14:\tslt\tv0,a0,a1\n 18:\tbnezl\tv0,10 \n 1c:\tsb\ta2,0(a0)\n 20:\tjr\tra\n 24:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-30ed35db3fd63330/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 memset1\n\n\nContents of section .text:\n 0000 18a00007 00000000 00a42821 a0860000 ..........(!....\n 0010 24840001 0085102a 5440fffd a0860000 $......*T@......\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memset1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name memset1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memset1:ido7.1","sym":"memset1","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for","memory","store"],"loc":1,"refSource":"void memset1(u8 *p,int n,u8 v){ int i; for(i=0;i:\n 0:\tsw\ta2,8(sp)\n 4:\tandi\ta2,a2,0xff\n 8:\tblez\ta1,54 \n c:\tmove\tv0,zero\n 10:\tandi\tt0,a1,0x3\n 14:\tbeqz\tt0,34 \n 18:\tmove\ta3,t0\n 1c:\tmove\tv1,a0\n 20:\taddiu\tv0,v0,1\n 24:\tsb\ta2,0(v1)\n 28:\tbne\ta3,v0,20 \n 2c:\taddiu\tv1,v1,1\n 30:\tbeq\tv0,a1,54 \n 34:\taddu\tv1,a0,v0\n 38:\taddiu\tv0,v0,4\n 3c:\tsb\ta2,0(v1)\n 40:\tsb\ta2,1(v1)\n 44:\tsb\ta2,2(v1)\n 48:\tsb\ta2,3(v1)\n 4c:\tbne\tv0,a1,38 \n 50:\taddiu\tv1,v1,4\n 54:\tjr\tra\n 58:\tnop\n 5c:\tnop\n","ctx":"void memset1(u8*,int,u8);","proto":{"memset1":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t0000005c memset1\n\n\nContents of section .text:\n 0000 afa60008 30c600ff 18a00012 00001025 ....0..........%\n 0010 30a80003 11000007 01003825 00801821 0.........8%...!\n 0020 24420001 a0660000 14e2fffd 24630001 $B...f......$c..\n 0030 10450008 00821821 24420004 a0660000 .E.....!$B...f..\n 0040 a0660001 a0660002 a0660003 1445fffa .f...f...f...E..\n 0050 24630004 03e00008 00000000 00000000 $c..............\nContents of section .options:\n 0000 01200000 00000000 a00001fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000017 00000004 000001c8 p...............\n 0010 00000005 0000030c 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000038 00000274 .......0...8...t\n 0040 00000008 000002ac 00000001 000002b4 ................\n 0050 00000000 00000000 00000001 000002fc ................\n 0060 08080400 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000005c 20200001 00000001 .......\\ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 30656433 35646233 66643633 ef-30ed35db3fd63\n 0130 3333302f 7265662e 63006d65 6d736574 330/ref.c.memset\n 0140 31000000 6d656d73 65743100 00000000 1...memset1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000017 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000003 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'memset1' — lift: cannot lift 'memset1': branch to 0x34 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tsw\ta2,8(sp) */\n/* 4:\tandi\ta2,a2,0xff */\n/* 8:\tblez\ta1,54 */\n/* c:\tmove\tv0,zero */\n/* 10:\tandi\tt0,a1,0x3 */\n/* 14:\tbeqz\tt0,34 */\n/* 18:\tmove\ta3,t0 */\n/* 1c:\tmove\tv1,a0 */\n/* 20:\taddiu\tv0,v0,1 */\n/* 24:\tsb\ta2,0(v1) */\n/* 28:\tbne\ta3,v0,20 */\n/* 2c:\taddiu\tv1,v1,1 */\n/* 30:\tbeq\tv0,a1,54 */\n/* 34:\taddu\tv1,a0,v0 */\n/* 38:\taddiu\tv0,v0,4 */\n/* 3c:\tsb\ta2,0(v1) */\n/* 40:\tsb\ta2,1(v1) */\n/* 44:\tsb\ta2,2(v1) */\n/* 48:\tsb\ta2,3(v1) */\n/* 4c:\tbne\tv0,a1,38 */\n/* 50:\taddiu\tv1,v1,4 */\n/* 54:\tjr\tra */\n/* 58:\tnop */\n/* 5c:\tnop */\nvoid memset1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'memset1': branch to 0x34 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'memset1': branch to 0x34 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void memset1(u8 *arg0, s32 arg1, u8 arg2) {\n s32 temp_t0;\n s32 var_v0;\n u8 *var_v1;\n u8 *var_v1_2;\n u8 temp_a2;\n\n temp_a2 = arg2 & 0xFF;\n var_v0 = 0;\n if (arg1 > 0) {\n temp_t0 = arg1 & 3;\n if (temp_t0 != 0) {\n var_v1 = arg0;\n do {\n var_v0 += 1;\n *var_v1 = temp_a2;\n var_v1 += 1;\n } while (temp_t0 != var_v0);\n if (var_v0 != arg1) {\n goto block_5;\n }\n } else {\nblock_5:\n var_v1_2 = &arg0[var_v0];\n do {\n var_v0 += 4;\n var_v1_2->unk0 = temp_a2;\n var_v1_2->unk1 = temp_a2;\n var_v1_2->unk2 = temp_a2;\n var_v1_2->unk3 = temp_a2;\n var_v1_2 += 4;\n } while (var_v0 != arg1);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":88,"lines":34,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 28: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 29: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 30: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 31: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memset1` — benchmark function synthetic:memset1:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel memset1\n sw\t$a2, 8($sp)\n andi\t$a2, $a2, 0xff\n blez\t$a1, .L54\n move\t$v0, $zero\n andi\t$t0, $a1, 0x3\n beqz\t$t0, .L34\n move\t$a3, $t0\n move\t$v1, $a0\n.L20:\n addiu\t$v0, $v0, 1\n sb\t$a2, 0($v1)\n bne\t$a3, $v0, .L20\n addiu\t$v1, $v1, 1\n beq\t$v0, $a1, .L54\n.L34:\n addu\t$v1, $a0, $v0\n.L38:\n addiu\t$v0, $v0, 4\n sb\t$a2, 0($v1)\n sb\t$a2, 1($v1)\n sb\t$a2, 2($v1)\n sb\t$a2, 3($v1)\n bne\t$v0, $a1, .L38\n addiu\t$v1, $v1, 4\n.L54:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memset1(u8*,int,u8);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memset1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memset1` — benchmark function synthetic:memset1:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memset1:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta2,8(sp)\n 4:\tandi\ta2,a2,0xff\n 8:\tblez\ta1,54 \n c:\tmove\tv0,zero\n 10:\tandi\tt0,a1,0x3\n 14:\tbeqz\tt0,34 \n 18:\tmove\ta3,t0\n 1c:\tmove\tv1,a0\n 20:\taddiu\tv0,v0,1\n 24:\tsb\ta2,0(v1)\n 28:\tbne\ta3,v0,20 \n 2c:\taddiu\tv1,v1,1\n 30:\tbeq\tv0,a1,54 \n 34:\taddu\tv1,a0,v0\n 38:\taddiu\tv0,v0,4\n 3c:\tsb\ta2,0(v1)\n 40:\tsb\ta2,1(v1)\n 44:\tsb\ta2,2(v1)\n 48:\tsb\ta2,3(v1)\n 4c:\tbne\tv0,a1,38 \n 50:\taddiu\tv1,v1,4\n 54:\tjr\tra\n 58:\tnop\n 5c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t0000005c memset1\n\n\nContents of section .text:\n 0000 afa60008 30c600ff 18a00012 00001025 ....0..........%\n 0010 30a80003 11000007 01003825 00801821 0.........8%...!\n 0020 24420001 a0660000 14e2fffd 24630001 $B...f......$c..\n 0030 10450008 00821821 24420004 a0660000 .E.....!$B...f..\n 0040 a0660001 a0660002 a0660003 1445fffa .f...f...f...E..\n 0050 24630004 03e00008 00000000 00000000 $c..............\nContents of section .options:\n 0000 01200000 00000000 a00001fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a00001fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000017 00000004 000001c8 p...............\n 0010 00000005 0000030c 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000038 00000274 .......0...8...t\n 0040 00000008 000002ac 00000001 000002b4 ................\n 0050 00000000 00000000 00000001 000002fc ................\n 0060 08080400 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000005c 20200001 00000001 .......\\ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 30656433 35646233 66643633 ef-30ed35db3fd63\n 0130 3333302f 7265662e 63006d65 6d736574 330/ref.c.memset\n 0140 31000000 6d656d73 65743100 00000000 1...memset1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000017 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000003 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memset1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name memset1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:memset1:mwcc_242_81","sym":"memset1","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for","memory","store"],"loc":1,"refSource":"void memset1(u8 *p,int n,u8 v){ int i; for(i=0;i:\n 0:\tcmpwi r4,0\n 4:\tli r7,0\n 8:\tblelr\n c:\tcmpwi r4,8\n 10:\taddi r6,r4,-8\n 14:\tble 58 \n 18:\taddi r0,r6,7\n 1c:\tsrwi r0,r0,3\n 20:\tmtctr r0\n 24:\tcmpwi r6,0\n 28:\tble 58 \n 2c:\tadd r6,r3,r7\n 30:\taddi r7,r7,8\n 34:\tstb r5,0(r6)\n 38:\tstb r5,1(r6)\n 3c:\tstb r5,2(r6)\n 40:\tstb r5,3(r6)\n 44:\tstb r5,4(r6)\n 48:\tstb r5,5(r6)\n 4c:\tstb r5,6(r6)\n 50:\tstb r5,7(r6)\n 54:\tbdnz 2c \n 58:\tsubf r0,r7,r4\n 5c:\tadd r3,r3,r7\n 60:\tmtctr r0\n 64:\tcmpw r7,r4\n 68:\tbgelr\n 6c:\tstb r5,0(r3)\n 70:\taddi r3,r3,1\n 74:\tbdnz 6c \n 78:\tblr\n","ctx":"void memset1(u8*,int,u8);","proto":{"memset1":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000007c memset1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 memset1\n\n\nContents of section .text:\n 0000 2c040000 38e00000 4c810020 2c040008 ,...8...L.. ,...\n 0010 38c4fff8 40810044 38060007 5400e8fe 8...@..D8...T...\n 0020 7c0903a6 2c060000 40810030 7cc33a14 |...,...@..0|.:.\n 0030 38e70008 98a60000 98a60001 98a60002 8...............\n 0040 98a60003 98a60004 98a60005 98a60006 ................\n 0050 98a60007 4200ffd8 7c072050 7c633a14 ....B...|. P|c:.\n 0060 7c0903a6 7c072000 4c800020 98a30000 |...|. .L.. ....\n 0070 38630001 4200fff8 4e800020 8c..B...N.. \nContents of section .mwcats.text:\n 0000 0200007c 00000000 ...|.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"void memset1(s32 a0, s32 a1, s32 a2) {\n s32 v0;\n s32 v1;\n u8 * v2;\n s32 v3;\n if (a1 > 0) {\n if (a1 <= 8) {\n v0 = 0;\n } else {\n v0 = 0;\n for (v1 = (u32)(a1 + -8 + 7) >> 3; v1 != 0; v1 = v1 - 1) {\n *(u8 *)(a0 + v0) = a2;\n ((u8 *)(a0 + v0))[1] = a2;\n ((u8 *)(a0 + v0))[2] = a2;\n ((u8 *)(a0 + v0))[3] = a2;\n ((u8 *)(a0 + v0))[4] = a2;\n ((u8 *)(a0 + v0))[5] = a2;\n ((u8 *)(a0 + v0))[6] = a2;\n ((u8 *)(a0 + v0))[7] = a2;\n v0 = v0 + 8;\n }\n }\n if (v0 < a1) {\n v3 = a1 - v0;\n v2 = (u8 *)(a0 + v0);\n do {\n *v2 = a2;\n v2 = v2 + 1;\n v3 = v3 - 1;\n } while (v3 != 0);\n return;\n } else {\n return;\n }\n } else {\n return;\n }\n}\n","score":75,"maxScore":83,"compileErrors":null,"breakdown":{"insert":52,"delete":5,"replace":0,"opMismatch":5,"argMismatch":13},"quality":{"score":84,"lines":38,"gotos":0,"casts":10,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void memset1(u8 *arg0, s32 arg1, u8 arg2) {\n s32 temp_r6;\n s32 var_ctr_2;\n s32 var_r7;\n u32 var_ctr;\n u8 *temp_r6_2;\n u8 *var_r3;\n\n var_r7 = 0;\n if (arg1 > 0) {\n temp_r6 = arg1 - 8;\n if (arg1 > 8) {\n var_ctr = (u32) (temp_r6 + 7) >> 3U;\n if (temp_r6 > 0) {\n do {\n temp_r6_2 = &arg0[var_r7];\n var_r7 += 8;\n temp_r6_2->unk0 = arg2;\n temp_r6_2->unk1 = arg2;\n temp_r6_2->unk2 = arg2;\n temp_r6_2->unk3 = arg2;\n temp_r6_2->unk4 = arg2;\n temp_r6_2->unk5 = arg2;\n temp_r6_2->unk6 = arg2;\n temp_r6_2->unk7 = arg2;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r3 = &arg0[var_r7];\n var_ctr_2 = arg1 - var_r7;\n if (var_r7 < arg1) {\n do {\n *var_r3 = arg2;\n var_r3 += 1;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n}\n","score":null,"maxScore":null,"compileErrors":8,"quality":{"score":100,"lines":39,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class"]},"gapSize":{"decompiler":"asmlift","score":75,"maxScore":83,"ratio":0.9036144578313253,"kinds":{"insert":52,"delete":5,"replace":0,"opMismatch":5,"argMismatch":13}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `memset1` — benchmark function synthetic:memset1:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel memset1\n cmpwi r4,0\n li r7,0\n blelr\n cmpwi r4,8\n addi r6,r4,-8\n ble .L58\n addi r0,r6,7\n srwi r0,r0,3\n mtctr r0\n cmpwi r6,0\n ble .L58\n.L2c:\n add r6,r3,r7\n addi r7,r7,8\n stb r5,0(r6)\n stb r5,1(r6)\n stb r5,2(r6)\n stb r5,3(r6)\n stb r5,4(r6)\n stb r5,5(r6)\n stb r5,6(r6)\n stb r5,7(r6)\n bdnz .L2c\n.L58:\n subf r0,r7,r4\n add r3,r3,r7\n mtctr r0\n cmpw r7,r4\n bgelr\n.L6c:\n stb r5,0(r3)\n addi r3,r3,1\n bdnz .L6c\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid memset1(u8*,int,u8);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function memset1 # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `memset1` — benchmark function synthetic:memset1:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:memset1:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r4,0\n 4:\tli r7,0\n 8:\tblelr\n c:\tcmpwi r4,8\n 10:\taddi r6,r4,-8\n 14:\tble 58 \n 18:\taddi r0,r6,7\n 1c:\tsrwi r0,r0,3\n 20:\tmtctr r0\n 24:\tcmpwi r6,0\n 28:\tble 58 \n 2c:\tadd r6,r3,r7\n 30:\taddi r7,r7,8\n 34:\tstb r5,0(r6)\n 38:\tstb r5,1(r6)\n 3c:\tstb r5,2(r6)\n 40:\tstb r5,3(r6)\n 44:\tstb r5,4(r6)\n 48:\tstb r5,5(r6)\n 4c:\tstb r5,6(r6)\n 50:\tstb r5,7(r6)\n 54:\tbdnz 2c \n 58:\tsubf r0,r7,r4\n 5c:\tadd r3,r3,r7\n 60:\tmtctr r0\n 64:\tcmpw r7,r4\n 68:\tbgelr\n 6c:\tstb r5,0(r3)\n 70:\taddi r3,r3,1\n 74:\tbdnz 6c \n 78:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000007c memset1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 memset1\n\n\nContents of section .text:\n 0000 2c040000 38e00000 4c810020 2c040008 ,...8...L.. ,...\n 0010 38c4fff8 40810044 38060007 5400e8fe 8...@..D8...T...\n 0020 7c0903a6 2c060000 40810030 7cc33a14 |...,...@..0|.:.\n 0030 38e70008 98a60000 98a60001 98a60002 8...............\n 0040 98a60003 98a60004 98a60005 98a60006 ................\n 0050 98a60007 4200ffd8 7c072050 7c633a14 ....B...|. P|c:.\n 0060 7c0903a6 7c072000 4c800020 98a30000 |...|. .L.. ....\n 0070 38630001 4200fff8 4e800020 8c..B...N.. \nContents of section .mwcats.text:\n 0000 0200007c 00000000 ...|.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"memset1\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name memset1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mergebits:agbcc","sym":"mergebits","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","mask","shift"],"loc":1,"refSource":"unsigned mergebits(unsigned a,unsigned b){ return (a&0xFFFF)|(b<<16); }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmergebits\n\t.type\t mergebits,function\n\t.thumb_func\nmergebits:\n\tldr\tr2, .L3\n\tand\tr2, r2, r0\n\tlsl\tr1, r1, #0x10\n\torr\tr1, r1, r2\n\tadd\tr0, r1, #0\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t mergebits,.Lfe1-mergebits\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 mergebits(u32 a0, u32 a1) {\n return a1 << 16 | 65535 & a0;\n}\n","score":7,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 mergebits(s32 arg0, s32 arg1) {\n return (arg1 << 0x10) | (0xFFFF & arg0);\n}\n","score":7,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":7,"maxScore":9,"ratio":0.7777777777777778,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mergebits` — benchmark function synthetic:mergebits:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmergebits\n\t.type\t mergebits,function\n\t.thumb_func\nmergebits:\n\tldr\tr2, .L3\n\tand\tr2, r2, r0\n\tlsl\tr1, r1, #0x10\n\torr\tr1, r1, r2\n\tadd\tr0, r1, #0\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t mergebits,.Lfe1-mergebits\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mergebits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mergebits` — benchmark function synthetic:mergebits:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mergebits:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmergebits\n\t.type\t mergebits,function\n\t.thumb_func\nmergebits:\n\tldr\tr2, .L3\n\tand\tr2, r2, r0\n\tlsl\tr1, r1, #0x10\n\torr\tr1, r1, r2\n\tadd\tr0, r1, #0\n\tbx\tlr\n.L4:\n\t.align\t2, 0\n.L3:\n\t.word\t0xffff\n.Lfe1:\n\t.size\t mergebits,.Lfe1-mergebits\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mergebits # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mergebits:gcc2.7.2kmc","sym":"mergebits","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","mask","shift"],"loc":1,"refSource":"unsigned mergebits(unsigned a,unsigned b){ return (a&0xFFFF)|(b<<16); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0xffff\n 4:\tsll\tv0,a1,0x10\n 8:\tjr\tra\n c:\tor\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ac9825ba79f7ba68/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 mergebits\n\n\nContents of section .text:\n 0000 3084ffff 00051400 03e00008 00821025 0..............%\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mergebits(u32 a0, u32 a1) {\n return a0 & 65535 | a1 << 16;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mergebits(s32 arg0, s32 arg1) {\n return (arg0 & 0xFFFF) | (arg1 << 0x10);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mergebits` — benchmark function synthetic:mergebits:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mergebits\n andi\t$a0, $a0, 0xffff\n sll\t$v0, $a1, 0x10\n jr\t$ra\n or\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mergebits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mergebits` — benchmark function synthetic:mergebits:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mergebits:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\ta0,a0,0xffff\n 4:\tsll\tv0,a1,0x10\n 8:\tjr\tra\n c:\tor\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ac9825ba79f7ba68/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 mergebits\n\n\nContents of section .text:\n 0000 3084ffff 00051400 03e00008 00821025 0..............%\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mergebits # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mergebits:ido7.1","sym":"mergebits","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","mask","shift"],"loc":1,"refSource":"unsigned mergebits(unsigned a,unsigned b){ return (a&0xFFFF)|(b<<16); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\tt6,a0,0xffff\n 4:\tsll\tt7,a1,0x10\n 8:\tjr\tra\n c:\tor\tv0,t6,t7\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 mergebits\n\n\nContents of section .text:\n 0000 308effff 00057c00 03e00008 01cf1025 0.....|........%\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002c0 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 0000000c 0000025c 00000001 00000268 .......\\.......h\n 0050 00000000 00000000 00000001 000002b0 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 63393832 35626137 39663762 ef-ac9825ba79f7b\n 0130 6136382f 7265662e 63006d65 72676562 a68/ref.c.mergeb\n 0140 69747300 6d657267 65626974 73000000 its.mergebits...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000004 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mergebits(u32 a0, u32 a1) {\n return a0 & 65535 | a1 << 16;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mergebits(s32 arg0, s32 arg1) {\n return (arg0 & 0xFFFF) | (arg1 << 0x10);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mergebits` — benchmark function synthetic:mergebits:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mergebits\n andi\t$t6, $a0, 0xffff\n sll\t$t7, $a1, 0x10\n jr\t$ra\n or\t$v0, $t6, $t7\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mergebits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mergebits` — benchmark function synthetic:mergebits:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mergebits:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tandi\tt6,a0,0xffff\n 4:\tsll\tt7,a1,0x10\n 8:\tjr\tra\n c:\tor\tv0,t6,t7\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 mergebits\n\n\nContents of section .text:\n 0000 308effff 00057c00 03e00008 01cf1025 0.....|........%\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002c0 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 0000000c 0000025c 00000001 00000268 .......\\.......h\n 0050 00000000 00000000 00000001 000002b0 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 63393832 35626137 39663762 ef-ac9825ba79f7b\n 0130 6136382f 7265662e 63006d65 72676562 a68/ref.c.mergeb\n 0140 69747300 6d657267 65626974 73000000 its.mergebits...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000004 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mergebits # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mergebits:mwcc_242_81","sym":"mergebits","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","mask","shift"],"loc":1,"refSource":"unsigned mergebits(unsigned a,unsigned b){ return (a&0xFFFF)|(b<<16); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmr r0,r3\n 4:\tslwi r3,r4,16\n 8:\trlwimi r3,r0,0,16,31\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 mergebits\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mergebits\n\n\nContents of section .text:\n 0000 7c601b78 5483801e 5003043e 4e800020 |`.xT...P..>N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"s32 mergebits(s32 a0, s32 a1) {\n return ASMLIFT_ERROR(\"unmodelled instruction 'rlwimi'\", a0);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":3,"gotos":0,"casts":0,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: unmodelled instruction 'rlwimi'"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 mergebits(s32 arg0, s32 arg1) {\n return ((arg1 << 0x10) & ~0xFFFF) | (arg0 & 0xFFFF);\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":4,"ratio":0.75,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mergebits` — benchmark function synthetic:mergebits:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mergebits\n mr r0,r3\n slwi r3,r4,16\n rlwimi r3,r0,0,16,31\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mergebits # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mergebits` — benchmark function synthetic:mergebits:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mergebits:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmr r0,r3\n 4:\tslwi r3,r4,16\n 8:\trlwimi r3,r0,0,16,31\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 mergebits\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mergebits\n\n\nContents of section .text:\n 0000 7c601b78 5483801e 5003043e 4e800020 |`.xT...P..>N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mergebits # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mini:agbcc","sym":"mini","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int mini(int a,int b){ return a a0) a1 = a0;\n return a1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mini(s32 arg0, s32 arg1) {\n s32 var_r0;\n\n var_r0 = arg1;\n if (var_r0 > arg0) {\n var_r0 = arg0;\n }\n return var_r0;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mini` — benchmark function synthetic:mini:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmini\n\t.type\t mini,function\n\t.thumb_func\nmini:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, r2\n\tble\t.L3\t@cond_branch\n\tadd\tr0, r2, #0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t mini,.Lfe1-mini\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mini # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mini` — benchmark function synthetic:mini:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mini:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmini\n\t.type\t mini,function\n\t.thumb_func\nmini:\n\tadd\tr2, r0, #0\n\tadd\tr0, r1, #0\n\tcmp\tr0, r2\n\tble\t.L3\t@cond_branch\n\tadd\tr0, r2, #0\n.L3:\n\tbx\tlr\n.Lfe1:\n\t.size\t mini,.Lfe1-mini\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mini # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mini:gcc2.7.2kmc","sym":"mini","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int mini(int a,int b){ return a:\n 0:\tslt\tv0,a1,a0\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-e7fab7b49afd2fe2/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 mini\n\n\nContents of section .text:\n 0000 00a4102a 54400001 00a02021 03e00008 ...*T@.... !....\n 0010 00801021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'mini' — lift: cannot lift 'mini': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tslt\tv0,a1,a0 */\n/* 4:\tbnezl\tv0,c */\n/* 8:\tmove\ta0,a1 */\n/* c:\tjr\tra */\n/* 10:\tmove\tv0,a0 */\n/* \t... */\nvoid mini(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'mini': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":14,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'mini': unmodelled control transfer 'bnezl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mini(s32 arg0, s32 arg1) {\n s32 var_a0;\n\n var_a0 = arg0;\n if (arg1 < var_a0) {\n var_a0 = arg1;\n }\n return var_a0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mini` — benchmark function synthetic:mini:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mini\n slt\t$v0, $a1, $a0\n bnezl\t$v0, .Lc\n move\t$a0, $a1\n.Lc:\n jr\t$ra\n move\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mini # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mini` — benchmark function synthetic:mini:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mini:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tv0,a1,a0\n 4:\tbnezl\tv0,c \n 8:\tmove\ta0,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-e7fab7b49afd2fe2/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 mini\n\n\nContents of section .text:\n 0000 00a4102a 54400001 00a02021 03e00008 ...*T@.... !....\n 0010 00801021 00000000 00000000 00000000 ...!............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mini # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mini:ido7.1","sym":"mini","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int mini(int a,int b){ return a:\n 0:\tslt\tat,a0,a1\n 4:\tbeqz\tat,14 \n 8:\tmove\tv1,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c mini\n\n\nContents of section .text:\n 0000 0085082a 10200003 00a01825 03e00008 ...*. .....%....\n 0010 00801025 03e00008 00601025 00000000 ...%.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000003e 00000000 . .........>....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003e 00000000 00000000 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 37666162 37623439 61666432 ef-e7fab7b49afd2\n 0130 6665322f 7265662e 63006d69 6e690000 fe2/ref.c.mini..\n 0140 6d696e69 00000000 00000000 00000001 mini............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 mini(s32 a0, s32 a1) {\n if (a0 < a1) {\n return a0;\n } else {\n return a1;\n }\n}\n","score":2,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 mini(s32 arg0, s32 arg1) {\n if (arg0 < arg1) {\n return arg0;\n }\n return arg1;\n}\n","score":2,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":7,"ratio":0.2857142857142857,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mini` — benchmark function synthetic:mini:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mini\n slt\t$at, $a0, $a1\n beqz\t$at, .L14\n move\t$v1, $a1\n jr\t$ra\n move\t$v0, $a0\n.L14:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mini # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mini` — benchmark function synthetic:mini:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mini:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tat,a0,a1\n 4:\tbeqz\tat,14 \n 8:\tmove\tv1,a1\n c:\tjr\tra\n 10:\tmove\tv0,a0\n 14:\tjr\tra\n 18:\tmove\tv0,v1\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c mini\n\n\nContents of section .text:\n 0000 0085082a 10200003 00a01825 03e00008 ...*. .....%....\n 0010 00801025 03e00008 00601025 00000000 ...%.....`.%....\nContents of section .options:\n 0000 01200000 00000000 8000003e 00000000 . .........>....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003e 00000000 00000000 00000000 ...>............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 37666162 37623439 61666432 ef-e7fab7b49afd2\n 0130 6665322f 7265662e 63006d69 6e690000 fe2/ref.c.mini..\n 0140 6d696e69 00000000 00000000 00000001 mini............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mini # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mini:mwcc_242_81","sym":"mini","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","ternary"],"loc":1,"refSource":"int mini(int a,int b){ return a:\n 0:\tcmpw r3,r4\n 4:\tbge c \n 8:\tmr r4,r3\n c:\tmr r3,r4\n 10:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 mini\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mini\n\n\nContents of section .text:\n 0000 7c032000 40800008 7c641b78 7c832378 |. .@...|d.x|.#x\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 mini(s32 a0, s32 a1) {\n if (a0 < a1) a1 = a0;\n return a1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mini(s32 arg0, s32 arg1) {\n s32 var_r4;\n\n var_r4 = arg1;\n if (arg0 < var_r4) {\n var_r4 = arg0;\n }\n return var_r4;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mini` — benchmark function synthetic:mini:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mini\n cmpw r3,r4\n bge .Lc\n mr r4,r3\n.Lc:\n mr r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mini # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mini` — benchmark function synthetic:mini:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mini:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpw r3,r4\n 4:\tbge c \n 8:\tmr r4,r3\n c:\tmr r3,r4\n 10:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 mini\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mini\n\n\nContents of section .text:\n 0000 7c032000 40800008 7c641b78 7c832378 |. .@...|d.x|.#x\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mini # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modc:agbcc","sym":"modc","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","signed-mod-const"],"loc":1,"refSource":"int modc(int a){ return a%10; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodc\n\t.type\t modc,function\n\t.thumb_func\nmodc:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t modc,.Lfe1-modc\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 modc(s32 a0) {\n return a0 % 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modc(s32 arg0) {\n return arg0 % 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modc` — benchmark function synthetic:modc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodc\n\t.type\t modc,function\n\t.thumb_func\nmodc:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t modc,.Lfe1-modc\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modc` — benchmark function synthetic:modc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modc:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodc\n\t.type\t modc,function\n\t.thumb_func\nmodc:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__modsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t modc,.Lfe1-modc\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name modc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modc:gcc2.7.2kmc","sym":"modc","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","signed-mod-const"],"loc":1,"refSource":"int modc(int a){ return a%10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x6666\n 4:\tori\tv0,v0,0x6667\n 8:\tmult\ta0,v0\n c:\tsra\tv0,a0,0x1f\n 10:\tmfhi\ta1\n 14:\tsra\tv1,a1,0x2\n 18:\tsubu\tv1,v1,v0\n 1c:\tsll\tv0,v1,0x2\n 20:\taddu\tv0,v0,v1\n 24:\tsll\tv0,v0,0x1\n 28:\tjr\tra\n 2c:\tsubu\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-0e37d40ebdc10604/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 modc\n\n\nContents of section .text:\n 0000 3c026666 34426667 00820018 000417c3 <.ff4Bfg........\n 0010 00002810 00051883 00621823 00031080 ..(......b.#....\n 0020 00431021 00021040 03e00008 00821023 .C.!...@.......#\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 modc(s32 a0) {\n return a0 - a0 / 10 * 10;\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modc(s32 arg0) {\n return arg0 % 10;\n}\n","score":0,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modc` — benchmark function synthetic:modc:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modc\n lui\t$v0, 0x6666\n ori\t$v0, $v0, 0x6667\n mult\t$a0, $v0\n sra\t$v0, $a0, 0x1f\n mfhi\t$a1\n sra\t$v1, $a1, 0x2\n subu\t$v1, $v1, $v0\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x1\n jr\t$ra\n subu\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modc` — benchmark function synthetic:modc:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modc:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x6666\n 4:\tori\tv0,v0,0x6667\n 8:\tmult\ta0,v0\n c:\tsra\tv0,a0,0x1f\n 10:\tmfhi\ta1\n 14:\tsra\tv1,a1,0x2\n 18:\tsubu\tv1,v1,v0\n 1c:\tsll\tv0,v1,0x2\n 20:\taddu\tv0,v0,v1\n 24:\tsll\tv0,v0,0x1\n 28:\tjr\tra\n 2c:\tsubu\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-0e37d40ebdc10604/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 modc\n\n\nContents of section .text:\n 0000 3c026666 34426667 00820018 000417c3 <.ff4Bfg........\n 0010 00002810 00051883 00621823 00031080 ..(......b.#....\n 0020 00431021 00021040 03e00008 00821023 .C.!...@.......#\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name modc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modc:ido7.1","sym":"modc","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","signed-mod-const"],"loc":1,"refSource":"int modc(int a){ return a%10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdiv\tzero,a0,at\n 8:\tmfhi\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 modc\n\n\nContents of section .text:\n 0000 2401000a 0081001a 00001010 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 65333764 34306562 64633130 ef-0e37d40ebdc10\n 0130 3630342f 7265662e 63006d6f 64630000 604/ref.c.modc..\n 0140 6d6f6463 00000000 00000000 00000001 modc............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 modc(s32 a0) {\n return a0 % 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modc(s32 arg0) {\n return arg0 % 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modc` — benchmark function synthetic:modc:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modc\n li\t$at, 10\n div\t$zero, $a0, $at\n mfhi\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modc` — benchmark function synthetic:modc:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modc:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdiv\tzero,a0,at\n 8:\tmfhi\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 modc\n\n\nContents of section .text:\n 0000 2401000a 0081001a 00001010 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 65333764 34306562 64633130 ef-0e37d40ebdc10\n 0130 3630342f 7265662e 63006d6f 64630000 604/ref.c.modc..\n 0140 6d6f6463 00000000 00000000 00000001 modc............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name modc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modc:mwcc_242_81","sym":"modc","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","signed-mod-const"],"loc":1,"refSource":"int modc(int a){ return a%10; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,26214\n 4:\taddi r0,r4,26215\n 8:\tmulhw r0,r0,r3\n c:\tsrawi r0,r0,2\n 10:\tsrwi r4,r0,31\n 14:\tadd r0,r0,r4\n 18:\tmulli r0,r0,10\n 1c:\tsubf r3,r0,r3\n 20:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000024 modc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 modc\n\n\nContents of section .text:\n 0000 3c806666 38046667 7c001896 7c001670 <.ff8.fg|...|..p\n 0010 54040ffe 7c002214 1c00000a 7c601850 T...|.\".....|`.P\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 modc(s32 a0) {\n return a0 - a0 / 10 * 10;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modc(s32 arg0) {\n return arg0 % 10;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modc` — benchmark function synthetic:modc:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modc\n lis r4,26214\n addi r0,r4,26215\n mulhw r0,r0,r3\n srawi r0,r0,2\n srwi r4,r0,31\n add r0,r0,r4\n mulli r0,r0,10\n subf r3,r0,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modc` — benchmark function synthetic:modc:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modc:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,26214\n 4:\taddi r0,r4,26215\n 8:\tmulhw r0,r0,r3\n c:\tsrawi r0,r0,2\n 10:\tsrwi r4,r0,31\n 14:\tadd r0,r0,r4\n 18:\tmulli r0,r0,10\n 1c:\tsubf r3,r0,r3\n 20:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000024 modc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 modc\n\n\nContents of section .text:\n 0000 3c806666 38046667 7c001896 7c001670 <.ff8.fg|...|..p\n 0010 54040ffe 7c002214 1c00000a 7c601850 T...|.\".....|`.P\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name modc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modpow2:agbcc","sym":"modpow2","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","signed-mod-pow2"],"loc":1,"refSource":"int modpow2(int a){ return a%16; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodpow2\n\t.type\t modpow2,function\n\t.thumb_func\nmodpow2:\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xf\n.L3:\n\tasr\tr0, r0, #0x4\n\tlsl\tr0, r0, #0x4\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t modpow2,.Lfe1-modpow2\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed/regcopy","outcome":"match","source":"s32 modpow2(s32 a0) {\n s32 v0;\n s32 w0;\n v0 = a0;\n w0 = v0;\n if (w0 < 0) w0 = w0 + 15;\n return a0 - (w0 >> 4 << 4);\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modpow2(s32 arg0) {\n s32 temp_r1;\n s32 var_r0;\n\n var_r0 = arg0;\n temp_r1 = var_r0;\n if (temp_r1 < 0) {\n var_r0 += 0xF;\n }\n return temp_r1 - ((var_r0 >> 4) * 0x10);\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":10,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modpow2` — benchmark function synthetic:modpow2:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodpow2\n\t.type\t modpow2,function\n\t.thumb_func\nmodpow2:\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xf\n.L3:\n\tasr\tr0, r0, #0x4\n\tlsl\tr0, r0, #0x4\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t modpow2,.Lfe1-modpow2\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modpow2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modpow2` — benchmark function synthetic:modpow2:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modpow2:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodpow2\n\t.type\t modpow2,function\n\t.thumb_func\nmodpow2:\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0\n\tbge\t.L3\t@cond_branch\n\tadd\tr0, r0, #0xf\n.L3:\n\tasr\tr0, r0, #0x4\n\tlsl\tr0, r0, #0x4\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t modpow2,.Lfe1-modpow2\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name modpow2 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modpow2:gcc2.7.2kmc","sym":"modpow2","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","signed-mod-pow2"],"loc":1,"refSource":"int modpow2(int a){ return a%16; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,c \n 4:\tmove\tv0,a0\n 8:\taddiu\tv0,a0,15\n c:\tsra\tv0,v0,0x4\n 10:\tsll\tv0,v0,0x4\n 14:\tjr\tra\n 18:\tsubu\tv0,a0,v0\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2b24abd884db7bcb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c modpow2\n\n\nContents of section .text:\n 0000 04810002 00801021 2482000f 00021103 .......!$.......\n 0010 00021100 03e00008 00821023 00000000 ...........#....\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed/regcopy","outcome":"match","source":"s32 modpow2(s32 a0) {\n s32 v0;\n s32 w0;\n v0 = a0;\n w0 = v0;\n if (w0 < 0) w0 = w0 + 15;\n return a0 - (w0 >> 4 << 4);\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modpow2(s32 arg0) {\n s32 var_v0;\n\n var_v0 = arg0;\n if (arg0 < 0) {\n var_v0 = arg0 + 0xF;\n }\n return arg0 - ((var_v0 >> 4) * 0x10);\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modpow2` — benchmark function synthetic:modpow2:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modpow2\n bgez\t$a0, .Lc\n move\t$v0, $a0\n addiu\t$v0, $a0, 15\n.Lc:\n sra\t$v0, $v0, 0x4\n sll\t$v0, $v0, 0x4\n jr\t$ra\n subu\t$v0, $a0, $v0\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modpow2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modpow2` — benchmark function synthetic:modpow2:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modpow2:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,c \n 4:\tmove\tv0,a0\n 8:\taddiu\tv0,a0,15\n c:\tsra\tv0,v0,0x4\n 10:\tsll\tv0,v0,0x4\n 14:\tjr\tra\n 18:\tsubu\tv0,a0,v0\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2b24abd884db7bcb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c modpow2\n\n\nContents of section .text:\n 0000 04810002 00801021 2482000f 00021103 .......!$.......\n 0010 00021100 03e00008 00821023 00000000 ...........#....\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name modpow2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modpow2:ido7.1","sym":"modpow2","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","signed-mod-pow2"],"loc":1,"refSource":"int modpow2(int a){ return a%16; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,14 \n 4:\tandi\tv0,a0,0xf\n 8:\tbeqz\tv0,14 \n c:\tnop\n 10:\taddiu\tv0,v0,-16\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c modpow2\n\n\nContents of section .text:\n 0000 04810004 3082000f 10400002 00000000 ....0....@......\n 0010 2442fff0 03e00008 00000000 00000000 $B..............\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 62323461 62643838 34646237 ef-2b24abd884db7\n 0130 6263622f 7265662e 63006d6f 64706f77 bcb/ref.c.modpow\n 0140 32000000 6d6f6470 6f773200 00000000 2...modpow2.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000007 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 modpow2(u32 a0) {\n s32 v0;\n if (a0 >= 0) {\n v0 = a0 & 15;\n } else {\n if ((a0 & 15) == 0) {\n v0 = a0 & 15;\n } else {\n v0 = (a0 & 15) + -16;\n }\n }\n return v0;\n}\n","score":6,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":5,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modpow2(s32 arg0) {\n return arg0 % 16;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modpow2` — benchmark function synthetic:modpow2:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modpow2\n bgez\t$a0, .L14\n andi\t$v0, $a0, 0xf\n beqz\t$v0, .L14\n nop\n addiu\t$v0, $v0, -16\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modpow2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modpow2` — benchmark function synthetic:modpow2:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modpow2:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgez\ta0,14 \n 4:\tandi\tv0,a0,0xf\n 8:\tbeqz\tv0,14 \n c:\tnop\n 10:\taddiu\tv0,v0,-16\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c modpow2\n\n\nContents of section .text:\n 0000 04810004 3082000f 10400002 00000000 ....0....@......\n 0010 2442fff0 03e00008 00000000 00000000 $B..............\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 62323461 62643838 34646237 ef-2b24abd884db7\n 0130 6263622f 7265662e 63006d6f 64706f77 bcb/ref.c.modpow\n 0140 32000000 6d6f6470 6f773200 00000000 2...modpow2.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000007 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name modpow2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modpow2:mwcc_242_81","sym":"modpow2","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","signed-mod-pow2"],"loc":1,"refSource":"int modpow2(int a){ return a%16; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r3,28\n 4:\tsrwi r3,r3,31\n 8:\tsubf r0,r3,r0\n c:\trotlwi r0,r0,4\n 10:\tadd r3,r0,r3\n 14:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 modpow2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 modpow2\n\n\nContents of section .text:\n 0000 5460e006 54630ffe 7c030050 5400203e T`..Tc..|..PT. >\n 0010 7c601a14 4e800020 |`..N.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 modpow2(u32 a0) {\n return ((a0 << 28) - (a0 >> 31) << 4 | (a0 << 28) - (a0 >> 31) >> 28) + (a0 >> 31);\n}\n","score":6,"maxScore":7,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":3,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 modpow2(u32 arg0) {\n u32 temp_r0;\n u32 temp_r3;\n\n temp_r3 = arg0 >> 0x1FU;\n temp_r0 = (arg0 << 0x1C) - temp_r3;\n return ((temp_r0 << 4) | (temp_r0 >> 0x1CU)) + temp_r3;\n}\n","score":6,"maxScore":7,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":3,"argMismatch":2},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":7,"ratio":0.8571428571428571,"kinds":{"insert":1,"delete":0,"replace":0,"opMismatch":3,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modpow2` — benchmark function synthetic:modpow2:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modpow2\n slwi r0,r3,28\n srwi r3,r3,31\n subf r0,r3,r0\n rotlwi r0,r0,4\n add r3,r0,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modpow2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modpow2` — benchmark function synthetic:modpow2:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modpow2:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r3,28\n 4:\tsrwi r3,r3,31\n 8:\tsubf r0,r3,r0\n c:\trotlwi r0,r0,4\n 10:\tadd r3,r0,r3\n 14:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 modpow2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 modpow2\n\n\nContents of section .text:\n 0000 5460e006 54630ffe 7c030050 5400203e T`..Tc..|..PT. >\n 0010 7c601a14 4e800020 |`..N.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name modpow2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modv:agbcc","sym":"modv","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","mod-reg","signed"],"loc":1,"refSource":"int modv(int a,int b){ return a%b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodv\n\t.type\t modv,function\n\t.thumb_func\nmodv:\n\tpush\t{lr}\n\tbl\t__modsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t modv,.Lfe1-modv\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 modv(s32 a0, s32 a1) {\n return a0 % a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modv(s32 arg0, s32 arg1) {\n return arg0 % arg1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modv` — benchmark function synthetic:modv:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodv\n\t.type\t modv,function\n\t.thumb_func\nmodv:\n\tpush\t{lr}\n\tbl\t__modsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t modv,.Lfe1-modv\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modv` — benchmark function synthetic:modv:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modv:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmodv\n\t.type\t modv,function\n\t.thumb_func\nmodv:\n\tpush\t{lr}\n\tbl\t__modsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t modv,.Lfe1-modv\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name modv # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modv:gcc2.7.2kmc","sym":"modv","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","mod-reg","signed"],"loc":1,"refSource":"int modv(int a,int b){ return a%b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tbnez\ta1,10 \n 8:\tnop\n c:\tbreak\t0x7\n 10:\tli\tat,-1\n 14:\tbne\ta1,at,28 \n 18:\tlui\tat,0x8000\n 1c:\tbne\ta0,at,28 \n 20:\tnop\n 24:\tbreak\t0x6\n 28:\tmfhi\tv0\n 2c:\tjr\tra\n 30:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-8a3ca826933866f6/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 modv\n\n\nContents of section .text:\n 0000 0085001a 14a00002 00000000 0007000d ................\n 0010 2401ffff 14a10004 3c018000 14810002 $.......<.......\n 0020 00000000 0006000d 00001010 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 modv(s32 a0, s32 a1) {\n return a0 % a1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modv(s32 arg0, s32 arg1) {\n return arg0 % arg1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modv` — benchmark function synthetic:modv:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modv\n div\t$zero, $a0, $a1\n bnez\t$a1, .L10\n nop\n break\t0x7\n.L10:\n li\t$at, -1\n bne\t$a1, $at, .L28\n lui\t$at, 0x8000\n bne\t$a0, $at, .L28\n nop\n break\t0x6\n.L28:\n mfhi\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modv` — benchmark function synthetic:modv:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modv:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tbnez\ta1,10 \n 8:\tnop\n c:\tbreak\t0x7\n 10:\tli\tat,-1\n 14:\tbne\ta1,at,28 \n 18:\tlui\tat,0x8000\n 1c:\tbne\ta0,at,28 \n 20:\tnop\n 24:\tbreak\t0x6\n 28:\tmfhi\tv0\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-8a3ca826933866f6/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 modv\n\n\nContents of section .text:\n 0000 0085001a 14a00002 00000000 0007000d ................\n 0010 2401ffff 14a10004 3c018000 14810002 $.......<.......\n 0020 00000000 0006000d 00001010 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name modv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modv:ido7.1","sym":"modv","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","mod-reg","signed"],"loc":1,"refSource":"int modv(int a,int b){ return a%b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tmfhi\tv0\n 8:\tbnez\ta1,14 \n c:\tnop\n 10:\tbreak\t0x7\n 14:\tli\tat,-1\n 18:\tbne\ta1,at,2c \n 1c:\tlui\tat,0x8000\n 20:\tbne\ta0,at,2c \n 24:\tnop\n 28:\tbreak\t0x6\n 2c:\tjr\tra\n 30:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 modv\n\n\nContents of section .text:\n 0000 0085001a 00001010 14a00002 00000000 ................\n 0010 0007000d 2401ffff 14a10004 3c018000 ....$.......<...\n 0020 14810002 00000000 0006000d 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001a8 p...............\n 0010 00000005 000002e8 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000034 00000254 ...........4...T\n 0040 00000008 00000288 00000001 00000290 ................\n 0050 00000000 00000000 00000001 000002d8 ................\n 0060 08030000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000034 20200001 00000001 .......4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 61336361 38323639 33333836 ef-8a3ca82693386\n 0130 3666362f 7265662e 63006d6f 64760000 6f6/ref.c.modv..\n 0140 6d6f6476 00000000 00000000 00000001 modv............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000d 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 modv(s32 a0, s32 a1) {\n return a0 % a1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modv(s32 arg0, s32 arg1) {\n return arg0 % arg1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modv` — benchmark function synthetic:modv:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modv\n div\t$zero, $a0, $a1\n mfhi\t$v0\n bnez\t$a1, .L14\n nop\n break\t0x7\n.L14:\n li\t$at, -1\n bne\t$a1, $at, .L2c\n lui\t$at, 0x8000\n bne\t$a0, $at, .L2c\n nop\n break\t0x6\n.L2c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modv` — benchmark function synthetic:modv:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modv:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdiv\tzero,a0,a1\n 4:\tmfhi\tv0\n 8:\tbnez\ta1,14 \n c:\tnop\n 10:\tbreak\t0x7\n 14:\tli\tat,-1\n 18:\tbne\ta1,at,2c \n 1c:\tlui\tat,0x8000\n 20:\tbne\ta0,at,2c \n 24:\tnop\n 28:\tbreak\t0x6\n 2c:\tjr\tra\n 30:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 modv\n\n\nContents of section .text:\n 0000 0085001a 00001010 14a00002 00000000 ................\n 0010 0007000d 2401ffff 14a10004 3c018000 ....$.......<...\n 0020 14810002 00000000 0006000d 03e00008 ................\n 0030 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000036 00000000 . .........6....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000036 00000000 00000000 00000000 ...6............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001a8 p...............\n 0010 00000005 000002e8 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000034 00000254 ...........4...T\n 0040 00000008 00000288 00000001 00000290 ................\n 0050 00000000 00000000 00000001 000002d8 ................\n 0060 08030000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000034 20200001 00000001 .......4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 61336361 38323639 33333836 ef-8a3ca82693386\n 0130 3666362f 7265662e 63006d6f 64760000 6f6/ref.c.modv..\n 0140 6d6f6476 00000000 00000000 00000001 modv............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000d 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name modv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:modv:mwcc_242_81","sym":"modv","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","mod-reg","signed"],"loc":1,"refSource":"int modv(int a,int b){ return a%b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivw r0,r3,r4\n 4:\tmullw r0,r0,r4\n 8:\tsubf r3,r0,r3\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 modv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 modv\n\n\nContents of section .text:\n 0000 7c0323d6 7c0021d6 7c601850 4e800020 |.#.|.!.|`.PN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 modv(s32 a0, s32 a1) {\n return a0 - a0 / a1 * a1;\n}\n","score":1,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 modv(s32 arg0, s32 arg1) {\n return arg0 % arg1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `modv` — benchmark function synthetic:modv:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel modv\n divw r0,r3,r4\n mullw r0,r0,r4\n subf r3,r0,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function modv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `modv` — benchmark function synthetic:modv:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:modv:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivw r0,r3,r4\n 4:\tmullw r0,r0,r4\n 8:\tsubf r3,r0,r3\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 modv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 modv\n\n\nContents of section .text:\n 0000 7c0323d6 7c0021d6 7c601850 4e800020 |.#.|.!.|`.PN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name modv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mul:agbcc","sym":"mul","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int mul(int a,int b){ return a*b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmul\n\t.type\t mul,function\n\t.thumb_func\nmul:\n\tmul\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t mul,.Lfe1-mul\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mul(u32 a0, u32 a1) {\n return a0 * a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mul(s32 arg0, s32 arg1) {\n return arg0 * arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mul` — benchmark function synthetic:mul:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmul\n\t.type\t mul,function\n\t.thumb_func\nmul:\n\tmul\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t mul,.Lfe1-mul\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mul` — benchmark function synthetic:mul:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mul:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmul\n\t.type\t mul,function\n\t.thumb_func\nmul:\n\tmul\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t mul,.Lfe1-mul\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mul # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mul:gcc2.7.2kmc","sym":"mul","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int mul(int a,int b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmult\ta0,a1\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-7ecbf07003575a22/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 mul\n\n\nContents of section .text:\n 0000 00000000 00850018 00001012 03e00008 ................\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mul(u32 a0, u32 a1) {\n return a0 * a1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mul(s32 arg0, s32 arg1) {\n return arg0 * arg1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mul` — benchmark function synthetic:mul:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mul\n nop\n mult\t$a0, $a1\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mul` — benchmark function synthetic:mul:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mul:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmult\ta0,a1\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-7ecbf07003575a22/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 mul\n\n\nContents of section .text:\n 0000 00000000 00850018 00001012 03e00008 ................\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mul:ido7.1","sym":"mul","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic"],"loc":1,"refSource":"int mul(int a,int b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmultu\ta0,a1\n 4:\tmflo\tv0\n 8:\tjr\tra\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 mul\n\n\nContents of section .text:\n 0000 00850019 00001012 03e00008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 65636266 30373030 33353735 ef-7ecbf07003575\n 0130 6132322f 7265662e 63006d75 6c000000 a22/ref.c.mul...\n 0140 6d756c00 00000000 00000001 00000000 mul.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000004 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mul(u32 a0, u32 a1) {\n return a0 * a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mul(s32 arg0, s32 arg1) {\n return arg0 * arg1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mul` — benchmark function synthetic:mul:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mul\n multu\t$a0, $a1\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mul` — benchmark function synthetic:mul:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mul:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmultu\ta0,a1\n 4:\tmflo\tv0\n 8:\tjr\tra\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 mul\n\n\nContents of section .text:\n 0000 00850019 00001012 03e00008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 65636266 30373030 33353735 ef-7ecbf07003575\n 0130 6132322f 7265662e 63006d75 6c000000 a22/ref.c.mul...\n 0140 6d756c00 00000000 00000001 00000000 mul.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000004 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mul:mwcc_242_81","sym":"mul","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int mul(int a,int b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmullw r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 mul\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mul\n\n\nContents of section .text:\n 0000 7c6321d6 4e800020 |c!.N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mul(u32 a0, u32 a1) {\n return a0 * a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mul(s32 arg0, s32 arg1) {\n return arg0 * arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mul` — benchmark function synthetic:mul:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mul\n mullw r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mul` — benchmark function synthetic:mul:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mul:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmullw r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 mul\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mul\n\n\nContents of section .text:\n 0000 7c6321d6 4e800020 |c!.N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mulc:agbcc","sym":"mulc","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","strength-reduce"],"loc":1,"refSource":"int mulc(int a){ return a*10; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmulc\n\t.type\t mulc,function\n\t.thumb_func\nmulc:\n\tadd\tr1, r0, #0\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t mulc,.Lfe1-mulc\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mulc(u32 a0) {\n return a0 * 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mulc(s32 arg0) {\n return arg0 * 0xA;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mulc` — benchmark function synthetic:mulc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmulc\n\t.type\t mulc,function\n\t.thumb_func\nmulc:\n\tadd\tr1, r0, #0\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t mulc,.Lfe1-mulc\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mulc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mulc` — benchmark function synthetic:mulc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mulc:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tmulc\n\t.type\t mulc,function\n\t.thumb_func\nmulc:\n\tadd\tr1, r0, #0\n\tlsl\tr0, r1, #0x2\n\tadd\tr0, r0, r1\n\tlsl\tr0, r0, #0x1\n\tbx\tlr\n.Lfe1:\n\t.size\t mulc,.Lfe1-mulc\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mulc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mulc:gcc2.7.2kmc","sym":"mulc","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","strength-reduce"],"loc":1,"refSource":"int mulc(int a){ return a*10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x2\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tsll\tv0,v0,0x1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-554a87e2db088449/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 mulc\n\n\nContents of section .text:\n 0000 00041080 00441021 03e00008 00021040 .....D.!.......@\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mulc(u32 a0) {\n return a0 * 10;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mulc(s32 arg0) {\n return arg0 * 0xA;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mulc` — benchmark function synthetic:mulc:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mulc\n sll\t$v0, $a0, 0x2\n addu\t$v0, $v0, $a0\n jr\t$ra\n sll\t$v0, $v0, 0x1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mulc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mulc` — benchmark function synthetic:mulc:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mulc:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x2\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tsll\tv0,v0,0x1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-554a87e2db088449/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 mulc\n\n\nContents of section .text:\n 0000 00041080 00441021 03e00008 00021040 .....D.!.......@\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name mulc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mulc:ido7.1","sym":"mulc","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","strength-reduce"],"loc":1,"refSource":"int mulc(int a){ return a*10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x2\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tsll\tv0,v0,0x1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 mulc\n\n\nContents of section .text:\n 0000 00041080 00441021 03e00008 00021040 .....D.!.......@\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 35346138 37653264 62303838 ef-554a87e2db088\n 0130 3434392f 7265662e 63006d75 6c630000 449/ref.c.mulc..\n 0140 6d756c63 00000000 00000000 00000001 mulc............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mulc(u32 a0) {\n return a0 * 10;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mulc(s32 arg0) {\n return arg0 * 0xA;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mulc` — benchmark function synthetic:mulc:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mulc\n sll\t$v0, $a0, 0x2\n addu\t$v0, $v0, $a0\n jr\t$ra\n sll\t$v0, $v0, 0x1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mulc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mulc` — benchmark function synthetic:mulc:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mulc:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x2\n 4:\taddu\tv0,v0,a0\n 8:\tjr\tra\n c:\tsll\tv0,v0,0x1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 mulc\n\n\nContents of section .text:\n 0000 00041080 00441021 03e00008 00021040 .....D.!.......@\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 35346138 37653264 62303838 ef-554a87e2db088\n 0130 3434392f 7265662e 63006d75 6c630000 449/ref.c.mulc..\n 0140 6d756c63 00000000 00000000 00000001 mulc............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mulc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:mulc:mwcc_242_81","sym":"mulc","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","strength-reduce"],"loc":1,"refSource":"int mulc(int a){ return a*10; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmulli r3,r3,10\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 mulc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mulc\n\n\nContents of section .text:\n 0000 1c63000a 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 mulc(u32 a0) {\n return a0 * 10;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 mulc(s32 arg0) {\n return arg0 * 0xA;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `mulc` — benchmark function synthetic:mulc:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel mulc\n mulli r3,r3,10\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function mulc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `mulc` — benchmark function synthetic:mulc:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:mulc:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmulli r3,r3,10\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 mulc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 mulc\n\n\nContents of section .text:\n 0000 1c63000a 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name mulc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:narrow:agbcc","sym":"narrow","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","narrow","memory","store"],"loc":1,"refSource":"void narrow(u8 *p,int x){ *p=(u8)x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnarrow\n\t.type\t narrow,function\n\t.thumb_func\nnarrow:\n\tstrb\tr1, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t narrow,.Lfe1-narrow\n","ctx":"void narrow(u8*,int);","proto":{"narrow":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void narrow(u8 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void narrow(u8 *arg0, s32 arg1) {\n *arg0 = (u8) arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `narrow` — benchmark function synthetic:narrow:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnarrow\n\t.type\t narrow,function\n\t.thumb_func\nnarrow:\n\tstrb\tr1, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t narrow,.Lfe1-narrow\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid narrow(u8*,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function narrow # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `narrow` — benchmark function synthetic:narrow:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:narrow:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnarrow\n\t.type\t narrow,function\n\t.thumb_func\nnarrow:\n\tstrb\tr1, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t narrow,.Lfe1-narrow\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"narrow\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name narrow # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:narrow:gcc2.7.2kmc","sym":"narrow","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","narrow","memory","store"],"loc":1,"refSource":"void narrow(u8 *p,int x){ *p=(u8)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsb\ta1,0(a0)\n\t...\n","ctx":"void narrow(u8*,int);","proto":{"narrow":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ba8bd346ce1ed954/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 narrow\n\n\nContents of section .text:\n 0000 03e00008 a0850000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void narrow(u8 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void narrow(u8 *arg0, s32 arg1) {\n *arg0 = (u8) arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `narrow` — benchmark function synthetic:narrow:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel narrow\n jr\t$ra\n sb\t$a1, 0($a0)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid narrow(u8*,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function narrow # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `narrow` — benchmark function synthetic:narrow:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:narrow:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsb\ta1,0(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ba8bd346ce1ed954/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 narrow\n\n\nContents of section .text:\n 0000 03e00008 a0850000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"narrow\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name narrow # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:narrow:ido7.1","sym":"narrow","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","narrow","memory","store"],"loc":1,"refSource":"void narrow(u8 *p,int x){ *p=(u8)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsb\ta1,0(a0)\n\t...\n","ctx":"void narrow(u8*,int);","proto":{"narrow":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 narrow\n\n\nContents of section .text:\n 0000 03e00008 a0850000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 61386264 33343663 65316564 ef-ba8bd346ce1ed\n 0130 3935342f 7265662e 63006e61 72726f77 954/ref.c.narrow\n 0140 00000000 6e617272 6f770000 00000000 ....narrow......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void narrow(u8 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void narrow(u8 *arg0, s32 arg1) {\n *arg0 = (u8) arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `narrow` — benchmark function synthetic:narrow:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel narrow\n jr\t$ra\n sb\t$a1, 0($a0)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid narrow(u8*,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function narrow # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `narrow` — benchmark function synthetic:narrow:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:narrow:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsb\ta1,0(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 narrow\n\n\nContents of section .text:\n 0000 03e00008 a0850000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 61386264 33343663 65316564 ef-ba8bd346ce1ed\n 0130 3935342f 7265662e 63006e61 72726f77 954/ref.c.narrow\n 0140 00000000 6e617272 6f770000 00000000 ....narrow......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"narrow\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name narrow # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:narrow:mwcc_242_81","sym":"narrow","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","narrow","memory","store"],"loc":1,"refSource":"void narrow(u8 *p,int x){ *p=(u8)x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstb r4,0(r3)\n 4:\tblr\n","ctx":"void narrow(u8*,int);","proto":{"narrow":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 narrow\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 narrow\n\n\nContents of section .text:\n 0000 98830000 4e800020 ....N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void narrow(u8 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void narrow(u8 *arg0, s32 arg1) {\n *arg0 = (u8) arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `narrow` — benchmark function synthetic:narrow:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel narrow\n stb r4,0(r3)\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid narrow(u8*,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function narrow # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `narrow` — benchmark function synthetic:narrow:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:narrow:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstb r4,0(r3)\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 narrow\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 narrow\n\n\nContents of section .text:\n 0000 98830000 4e800020 ....N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"narrow\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name narrow # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:neg:agbcc","sym":"neg","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int neg(int a){ return -a; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tneg\n\t.type\t neg,function\n\t.thumb_func\nneg:\n\tneg\tr0, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t neg,.Lfe1-neg\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 neg(u32 a0) {\n return -a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 neg(s32 arg0) {\n return 0 - arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `neg` — benchmark function synthetic:neg:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tneg\n\t.type\t neg,function\n\t.thumb_func\nneg:\n\tneg\tr0, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t neg,.Lfe1-neg\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function neg # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `neg` — benchmark function synthetic:neg:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:neg:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tneg\n\t.type\t neg,function\n\t.thumb_func\nneg:\n\tneg\tr0, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t neg,.Lfe1-neg\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name neg # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:neg:gcc2.7.2kmc","sym":"neg","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int neg(int a){ return -a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnegu\tv0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b64a675c6e2f957e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 neg\n\n\nContents of section .text:\n 0000 03e00008 00041023 00000000 00000000 .......#........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 neg(u32 a0) {\n return -a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 neg(s32 arg0) {\n return -arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `neg` — benchmark function synthetic:neg:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel neg\n jr\t$ra\n negu\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function neg # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `neg` — benchmark function synthetic:neg:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:neg:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnegu\tv0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b64a675c6e2f957e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 neg\n\n\nContents of section .text:\n 0000 03e00008 00041023 00000000 00000000 .......#........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name neg # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:neg:ido7.1","sym":"neg","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic"],"loc":1,"refSource":"int neg(int a){ return -a; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnegu\tv0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 neg\n\n\nContents of section .text:\n 0000 03e00008 00041023 00000000 00000000 .......#........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 36346136 37356336 65326639 ef-b64a675c6e2f9\n 0130 3537652f 7265662e 63006e65 67000000 57e/ref.c.neg...\n 0140 6e656700 00000000 00000001 00000000 neg.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 neg(u32 a0) {\n return -a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 neg(s32 arg0) {\n return -arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `neg` — benchmark function synthetic:neg:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel neg\n jr\t$ra\n negu\t$v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function neg # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `neg` — benchmark function synthetic:neg:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:neg:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tnegu\tv0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 neg\n\n\nContents of section .text:\n 0000 03e00008 00041023 00000000 00000000 .......#........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 36346136 37356336 65326639 ef-b64a675c6e2f9\n 0130 3537652f 7265662e 63006e65 67000000 57e/ref.c.neg...\n 0140 6e656700 00000000 00000001 00000000 neg.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name neg # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:neg:mwcc_242_81","sym":"neg","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int neg(int a){ return -a; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg r3,r3\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 neg\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 neg\n\n\nContents of section .text:\n 0000 7c6300d0 4e800020 |c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 neg(u32 a0) {\n return -a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 neg(s32 arg0) {\n return -arg0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `neg` — benchmark function synthetic:neg:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel neg\n neg r3,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function neg # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `neg` — benchmark function synthetic:neg:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:neg:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg r3,r3\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 neg\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 neg\n\n\nContents of section .text:\n 0000 7c6300d0 4e800020 |c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name neg # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedif:agbcc","sym":"nestedif","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["branch","nested-if"],"loc":1,"refSource":"int nestedif(int a,int b){ if(a>0){ if(b>0) return a+b; return a; } return 0; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnestedif\n\t.type\t nestedif,function\n\t.thumb_func\nnestedif:\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tcmp\tr1, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr0, r0, r1\n\tb\t.L5\n.L3:\n\tmov\tr0, #0x0\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t nestedif,.Lfe1-nestedif\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 nestedif(u32 a0, u32 a1) {\n if (a0 <= 0) {\n a0 = 0;\n } else {\n if (a1 > 0) a0 = a0 + a1;\n }\n return a0;\n}\n","score":4,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":2,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 nestedif(s32 arg0, s32 arg1) {\n s32 var_r0;\n\n var_r0 = arg0;\n if (var_r0 > 0) {\n if (arg1 > 0) {\n return var_r0 + arg1;\n }\n /* Duplicate return node #4. Try simplifying control flow for better match */\n return var_r0;\n }\n var_r0 = 0;\n return var_r0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedif` — benchmark function synthetic:nestedif:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnestedif\n\t.type\t nestedif,function\n\t.thumb_func\nnestedif:\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tcmp\tr1, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr0, r0, r1\n\tb\t.L5\n.L3:\n\tmov\tr0, #0x0\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t nestedif,.Lfe1-nestedif\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedif` — benchmark function synthetic:nestedif:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedif:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnestedif\n\t.type\t nestedif,function\n\t.thumb_func\nnestedif:\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tcmp\tr1, #0\n\tble\t.L5\t@cond_branch\n\tadd\tr0, r0, r1\n\tb\t.L5\n.L3:\n\tmov\tr0, #0x0\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t nestedif,.Lfe1-nestedif\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedif # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedif:gcc2.7.2kmc","sym":"nestedif","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["branch","nested-if"],"loc":1,"refSource":"int nestedif(int a,int b){ if(a>0){ if(b>0) return a+b; return a; } return 0; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,a0\n 4:\tblezl\tv0,14 \n 8:\tmove\tv0,zero\n c:\tbgtzl\ta1,14 \n 10:\taddu\tv0,v0,a1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a7c170a6334f6c2a/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c nestedif\n\n\nContents of section .text:\n 0000 00801021 58400003 00001021 5ca00001 ...!X@.....!\\...\n 0010 00451021 03e00008 00000000 00000000 .E.!............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'nestedif' — lift: cannot lift 'nestedif': unmodelled control transfer 'blezl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv0,a0 */\n/* 4:\tblezl\tv0,14 */\n/* 8:\tmove\tv0,zero */\n/* c:\tbgtzl\ta1,14 */\n/* 10:\taddu\tv0,v0,a1 */\n/* 14:\tjr\tra */\n/* 18:\tnop */\n/* 1c:\tnop */\nvoid nestedif(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'nestedif': unmodelled control transfer 'blezl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'nestedif': unmodelled control transfer 'blezl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 nestedif(s32 arg0, s32 arg1) {\n s32 var_v0;\n\n var_v0 = arg0;\n if (var_v0 <= 0) {\n return 0;\n }\n if (arg1 > 0) {\n var_v0 += arg1;\n }\n return var_v0;\n}\n","score":3,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":9,"ratio":0.3333333333333333,"kinds":{"insert":2,"delete":0,"replace":1,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedif` — benchmark function synthetic:nestedif:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel nestedif\n move\t$v0, $a0\n blezl\t$v0, .L14\n move\t$v0, $zero\n bgtzl\t$a1, .L14\n addu\t$v0, $v0, $a1\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedif` — benchmark function synthetic:nestedif:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedif:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv0,a0\n 4:\tblezl\tv0,14 \n 8:\tmove\tv0,zero\n c:\tbgtzl\ta1,14 \n 10:\taddu\tv0,v0,a1\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a7c170a6334f6c2a/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c nestedif\n\n\nContents of section .text:\n 0000 00801021 58400003 00001021 5ca00001 ...!X@.....!\\...\n 0010 00451021 03e00008 00000000 00000000 .E.!............\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedif # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedif:ido7.1","sym":"nestedif","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["branch","nested-if"],"loc":1,"refSource":"int nestedif(int a,int b){ if(a>0){ if(b>0) return a+b; return a; } return 0; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,20 \n 4:\tmove\tv0,zero\n 8:\tblez\ta1,18 \n c:\tnop\n 10:\tjr\tra\n 14:\taddu\tv0,a0,a1\n 18:\tjr\tra\n 1c:\tmove\tv0,a0\n 20:\tjr\tra\n 24:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 nestedif\n\n\nContents of section .text:\n 0000 18800007 00001025 18a00003 00000000 .......%........\n 0010 03e00008 00851021 03e00008 00801025 .......!.......%\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002e0 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 0000000c 0000027c 00000001 00000288 .......|........\n 0050 00000000 00000000 00000001 000002d0 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 37633137 30613633 33346636 ef-a7c170a6334f6\n 0130 6332612f 7265662e 63006e65 73746564 c2a/ref.c.nested\n 0140 69660000 6e657374 65646966 00000000 if..nestedif....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 0000000a ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000002 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 nestedif(s32 a0, s32 a1) {\n if (a0 > 0) {\n if (a1 > 0) {\n return a0 + a1;\n } else {\n return a0;\n }\n } else {\n return 0;\n }\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 nestedif(s32 arg0, s32 arg1) {\n if (arg0 > 0) {\n if (arg1 > 0) {\n return arg0 + arg1;\n }\n return arg0;\n }\n return 0;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedif` — benchmark function synthetic:nestedif:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel nestedif\n blez\t$a0, .L20\n move\t$v0, $zero\n blez\t$a1, .L18\n nop\n jr\t$ra\n addu\t$v0, $a0, $a1\n.L18:\n jr\t$ra\n move\t$v0, $a0\n.L20:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedif` — benchmark function synthetic:nestedif:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedif:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,20 \n 4:\tmove\tv0,zero\n 8:\tblez\ta1,18 \n c:\tnop\n 10:\tjr\tra\n 14:\taddu\tv0,a0,a1\n 18:\tjr\tra\n 1c:\tmove\tv0,a0\n 20:\tjr\tra\n 24:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 nestedif\n\n\nContents of section .text:\n 0000 18800007 00001025 18a00003 00000000 .......%........\n 0010 03e00008 00851021 03e00008 00801025 .......!.......%\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002e0 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 0000000c 0000027c 00000001 00000288 .......|........\n 0050 00000000 00000000 00000001 000002d0 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 37633137 30613633 33346636 ef-a7c170a6334f6\n 0130 6332612f 7265662e 63006e65 73746564 c2a/ref.c.nested\n 0140 69660000 6e657374 65646966 00000000 if..nestedif....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 0000000a ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000002 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedif # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedif:mwcc_242_81","sym":"nestedif","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["branch","nested-if"],"loc":1,"refSource":"int nestedif(int a,int b){ if(a>0){ if(b>0) return a+b; return a; } return 0; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tble 18 \n 8:\tcmpwi r4,0\n c:\tblelr\n 10:\tadd r3,r3,r4\n 14:\tblr\n 18:\tli r3,0\n 1c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 nestedif\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 nestedif\n\n\nContents of section .text:\n 0000 2c030000 40810014 2c040000 4c810020 ,...@...,...L.. \n 0010 7c632214 4e800020 38600000 4e800020 |c\".N.. 8`..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 nestedif(s32 a0, s32 a1) {\n if (a0 > 0) {\n if (a1 > 0) {\n return a0 + a1;\n } else {\n return a0;\n }\n } else {\n return 0;\n }\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 nestedif(s32 arg0, s32 arg1) {\n if (arg0 > 0) {\n if (arg1 > 0) {\n return arg0 + arg1;\n }\n return arg0;\n }\n return 0;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedif` — benchmark function synthetic:nestedif:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel nestedif\n cmpwi r3,0\n ble .L18\n cmpwi r4,0\n blelr\n add r3,r3,r4\n blr\n.L18:\n li r3,0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedif # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedif` — benchmark function synthetic:nestedif:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedif:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tble 18 \n 8:\tcmpwi r4,0\n c:\tblelr\n 10:\tadd r3,r3,r4\n 14:\tblr\n 18:\tli r3,0\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 nestedif\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 nestedif\n\n\nContents of section .text:\n 0000 2c030000 40810014 2c040000 4c810020 ,...@...,...L.. \n 0010 7c632214 4e800020 38600000 4e800020 |c\".N.. 8`..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedif # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedloop:agbcc","sym":"nestedloop","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","nested-loop","arithmetic"],"loc":1,"refSource":"int nestedloop(int n){ int s=0,i,j; for(i=0;i= a0) {\n v1 = 0;\n } else {\n v1 = 0;\n v0 = 0;\n do {\n if (a0 > 0) {\n v3 = v1;\n v4 = a0;\n v2 = 0;\n do {\n v3 = v3 + v2;\n v2 = v2 + v0;\n v4 = v4 - 1;\n } while (v4 != 0);\n v1 = v3;\n }\n v0 = v0 + 1;\n } while (v0 < a0);\n }\n return v1;\n}\n","score":14,"maxScore":23,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":0,"opMismatch":1,"argMismatch":11},"quality":{"score":100,"lines":28,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 nestedloop(s32 arg0) {\n s32 var_r1;\n s32 var_r2;\n s32 var_r3;\n s32 var_r5;\n\n var_r5 = 0;\n var_r3 = 0;\n if (arg0 > 0) {\n do {\n if (arg0 > 0) {\n var_r2 = 0;\n var_r1 = arg0;\n do {\n var_r5 += var_r2;\n var_r2 += var_r3;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n var_r3 += 1;\n } while (var_r3 < arg0);\n }\n return var_r5;\n}\n","score":2,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":23,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":2,"maxScore":22,"ratio":0.09090909090909091,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedloop` — benchmark function synthetic:nestedloop:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnestedloop\n\t.type\t nestedloop,function\n\t.thumb_func\nnestedloop:\n\tpush\t{r4, r5, lr}\n\tmov\tr5, #0x0\n\tmov\tr3, #0x0\n\tcmp\tr5, r0\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr4, r3, #0x1\n\tcmp\tr0, #0\n\tble\t.L5\t@cond_branch\n\tmov\tr2, #0x0\n\tadd\tr1, r0, #0\n.L10:\n\tadd\tr5, r5, r2\n\tadd\tr2, r2, r3\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L10\t@cond_branch\n.L5:\n\tadd\tr3, r4, #0\n\tcmp\tr3, r0\n\tblt\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r5, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t nestedloop,.Lfe1-nestedloop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedloop` — benchmark function synthetic:nestedloop:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedloop:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnestedloop\n\t.type\t nestedloop,function\n\t.thumb_func\nnestedloop:\n\tpush\t{r4, r5, lr}\n\tmov\tr5, #0x0\n\tmov\tr3, #0x0\n\tcmp\tr5, r0\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr4, r3, #0x1\n\tcmp\tr0, #0\n\tble\t.L5\t@cond_branch\n\tmov\tr2, #0x0\n\tadd\tr1, r0, #0\n.L10:\n\tadd\tr5, r5, r2\n\tadd\tr2, r2, r3\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L10\t@cond_branch\n.L5:\n\tadd\tr3, r4, #0\n\tcmp\tr3, r0\n\tblt\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r5, #0\n\tpop\t{r4, r5}\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t nestedloop,.Lfe1-nestedloop\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedloop # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedloop:gcc2.7.2kmc","sym":"nestedloop","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","nested-loop","arithmetic"],"loc":1,"refSource":"int nestedloop(int n){ int s=0,i,j; for(i=0;i:\n 0:\taddiu\tsp,sp,-16\n 4:\tmove\ta2,zero\n 8:\tblez\ta0,40 \n c:\tmove\ta3,zero\n 10:\tblez\ta0,30 \n 14:\tmove\ta1,zero\n 18:\tmove\tv1,zero\n 1c:\taddu\ta3,a3,v1\n 20:\taddiu\ta1,a1,1\n 24:\tslt\tv0,a1,a0\n 28:\tbnez\tv0,1c \n 2c:\taddu\tv1,v1,a2\n 30:\taddiu\ta2,a2,1\n 34:\tslt\tv0,a2,a0\n 38:\tbnez\tv0,10 \n 3c:\tnop\n 40:\tmove\tv0,a3\n 44:\tjr\tra\n 48:\taddiu\tsp,sp,16\n 4c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-84c78a1282ec0a36/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c nestedloop\n\n\nContents of section .text:\n 0000 27bdfff0 00003021 1880000d 00003821 '.....0!......8!\n 0010 18800007 00002821 00001821 00e33821 ......(!...!..8!\n 0020 24a50001 00a4102a 1440fffc 00661821 $......*.@...f.!\n 0030 24c60001 00c4102a 1440fff5 00000000 $......*.@......\n 0040 00e01021 03e00008 27bd0010 00000000 ...!....'.......\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 nestedloop(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n v1 = 0;\n v0 = 0;\n do {\n if (a0 > 0) {\n v2 = v0;\n v4 = 0;\n v3 = 0;\n do {\n v2 = v2 + v3;\n v4 = v4 + 1;\n v3 = v3 + v1;\n } while (v4 < a0);\n v0 = v2;\n }\n v1 = v1 + 1;\n } while (v1 < a0);\n }\n return v0;\n}\n","score":16,"maxScore":23,"compileErrors":null,"breakdown":{"insert":4,"delete":2,"replace":5,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":28,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 nestedloop(s32 arg0) {\n s32 var_a1;\n s32 var_a2;\n s32 var_a3;\n s32 var_v1;\n\n var_a2 = 0;\n var_a3 = 0;\n if (arg0 > 0) {\n do {\n var_a1 = 0;\n if (arg0 > 0) {\n var_v1 = 0;\n do {\n var_a3 += var_v1;\n var_a1 += 1;\n var_v1 += var_a2;\n } while (var_a1 < arg0);\n }\n var_a2 += 1;\n } while (var_a2 < arg0);\n }\n return var_a3;\n}\n","score":3,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":23,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":19,"ratio":0.15789473684210525,"kinds":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedloop` — benchmark function synthetic:nestedloop:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel nestedloop\n addiu\t$sp, $sp, -16\n move\t$a2, $zero\n blez\t$a0, .L40\n move\t$a3, $zero\n.L10:\n blez\t$a0, .L30\n move\t$a1, $zero\n move\t$v1, $zero\n.L1c:\n addu\t$a3, $a3, $v1\n addiu\t$a1, $a1, 1\n slt\t$v0, $a1, $a0\n bnez\t$v0, .L1c\n addu\t$v1, $v1, $a2\n.L30:\n addiu\t$a2, $a2, 1\n slt\t$v0, $a2, $a0\n bnez\t$v0, .L10\n nop\n.L40:\n move\t$v0, $a3\n jr\t$ra\n addiu\t$sp, $sp, 16\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedloop` — benchmark function synthetic:nestedloop:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedloop:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-16\n 4:\tmove\ta2,zero\n 8:\tblez\ta0,40 \n c:\tmove\ta3,zero\n 10:\tblez\ta0,30 \n 14:\tmove\ta1,zero\n 18:\tmove\tv1,zero\n 1c:\taddu\ta3,a3,v1\n 20:\taddiu\ta1,a1,1\n 24:\tslt\tv0,a1,a0\n 28:\tbnez\tv0,1c \n 2c:\taddu\tv1,v1,a2\n 30:\taddiu\ta2,a2,1\n 34:\tslt\tv0,a2,a0\n 38:\tbnez\tv0,10 \n 3c:\tnop\n 40:\tmove\tv0,a3\n 44:\tjr\tra\n 48:\taddiu\tsp,sp,16\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-84c78a1282ec0a36/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c nestedloop\n\n\nContents of section .text:\n 0000 27bdfff0 00003021 1880000d 00003821 '.....0!......8!\n 0010 18800007 00002821 00001821 00e33821 ......(!...!..8!\n 0020 24a50001 00a4102a 1440fffc 00661821 $......*.@...f.!\n 0030 24c60001 00c4102a 1440fff5 00000000 $......*.@......\n 0040 00e01021 03e00008 27bd0010 00000000 ...!....'.......\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedloop:ido7.1","sym":"nestedloop","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","nested-loop","arithmetic"],"loc":1,"refSource":"int nestedloop(int n){ int s=0,i,j; for(i=0;i:\n 0:\tmove\tv1,zero\n 4:\tblez\ta0,e4 \n 8:\tmove\tv0,zero\n c:\tblez\ta0,d8 \n 10:\tmove\ta1,zero\n 14:\tandi\tt1,a0,0x3\n 18:\tbeqz\tt1,54 \n 1c:\tnop\n 20:\tmultu\tv0,zero\n 24:\tmove\tt0,t1\n 28:\tli\ta3,1\n 2c:\tmflo\ta2\n\t...\n 38:\tmove\ta1,a3\n 3c:\taddu\tv1,v1,a2\n 40:\taddu\ta2,a2,v0\n 44:\tbne\tt0,a3,38 \n 48:\taddiu\ta3,a3,1\n 4c:\tbeql\ta1,a0,dc \n 50:\taddiu\tv0,v0,1\n 54:\tmultu\tv0,a1\n 58:\taddiu\tt6,a1,1\n 5c:\taddiu\tt7,a1,2\n 60:\taddiu\tt8,a1,3\n 64:\tsll\tt2,v0,0x2\n 68:\tsll\tt3,v0,0x2\n 6c:\tsll\tt4,v0,0x2\n 70:\tsll\tt5,v0,0x2\n 74:\tmflo\ta2\n\t...\n 80:\tmultu\tv0,t6\n 84:\tmflo\ta3\n\t...\n 90:\tmultu\tv0,t7\n 94:\tmflo\tt0\n\t...\n a0:\tmultu\tv0,t8\n a4:\tmflo\tt1\n\t...\n b0:\taddu\tv1,v1,a2\n b4:\taddu\tv1,v1,a3\n b8:\taddu\tv1,v1,t0\n bc:\taddu\tv1,v1,t1\n c0:\taddiu\ta1,a1,4\n c4:\taddu\tt1,t1,t5\n c8:\taddu\tt0,t0,t4\n cc:\taddu\ta3,a3,t3\n d0:\tbne\ta1,a0,b0 \n d4:\taddu\ta2,a2,t2\n d8:\taddiu\tv0,v0,1\n dc:\tbne\tv0,a0,c \n e0:\tnop\n e4:\tjr\tra\n e8:\tmove\tv0,v1\n ec:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000f0 .text\n00000000 g F .text\t000000ec nestedloop\n\n\nContents of section .text:\n 0000 00001825 18800037 00001025 18800032 ...%...7...%...2\n 0010 00002825 30890003 1120000e 00000000 ..(%0.... ......\n 0020 00400019 01204025 24070001 00003012 .@... @%$.....0.\n 0030 00000000 00000000 00e02825 00661821 ..........(%.f.!\n 0040 00c23021 1507fffc 24e70001 50a40023 ..0!....$...P..#\n 0050 24420001 00450019 24ae0001 24af0002 $B...E..$...$...\n 0060 24b80003 00025080 00025880 00026080 $.....P...X...`.\n 0070 00026880 00003012 00000000 00000000 ..h...0.........\n 0080 004e0019 00003812 00000000 00000000 .N....8.........\n 0090 004f0019 00004012 00000000 00000000 .O....@.........\n 00a0 00580019 00004812 00000000 00000000 .X....H.........\n 00b0 00661821 00671821 00681821 00691821 .f.!.g.!.h.!.i.!\n 00c0 24a50004 012d4821 010c4021 00eb3821 $....-H!..@!..8!\n 00d0 14a4fff7 00ca3021 24420001 1444ffcb ......0!$B...D..\n 00e0 00000000 03e00008 00601025 00000000 .........`.%....\nContents of section .options:\n 0000 01200000 00000000 8100fffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100fffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000003b 00000008 00000268 p......;.......h\n 0010 00000005 000003b8 00000001 00000270 ...............p\n 0020 00000004 000002a4 00000000 00000000 ................\n 0030 00000011 000002d4 0000003c 00000318 ...........<....\n 0040 0000000c 00000354 00000001 00000360 .......T.......`\n 0050 00000000 00000000 00000001 000003a8 ................\n 0060 08080808 08080400 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000ec 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d38 34633738 61313238 ps-ref-84c78a128\n 0130 32656330 6133362f 7265662e 63006e65 2ec0a36/ref.c.ne\n 0140 73746564 6c6f6f70 00000000 6e657374 stedloop....nest\n 0150 65646c6f 6f700000 00000000 00000001 edloop..........\n 0160 00000000 00000039 00000000 00000004 .......9........\n 0170 00000000 0000003b 00000000 00000000 .......;........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000007 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'nestedloop' — lift: cannot lift 'nestedloop': unmodelled control transfer 'beql' at 0x4c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tblez\ta0,e4 */\n/* 8:\tmove\tv0,zero */\n/* c:\tblez\ta0,d8 */\n/* 10:\tmove\ta1,zero */\n/* 14:\tandi\tt1,a0,0x3 */\n/* 18:\tbeqz\tt1,54 */\n/* 1c:\tnop */\n/* 20:\tmultu\tv0,zero */\n/* 24:\tmove\tt0,t1 */\n/* 28:\tli\ta3,1 */\n/* 2c:\tmflo\ta2 */\n/* \t... */\n/* 38:\tmove\ta1,a3 */\n/* 3c:\taddu\tv1,v1,a2 */\n/* 40:\taddu\ta2,a2,v0 */\n/* 44:\tbne\tt0,a3,38 */\n/* 48:\taddiu\ta3,a3,1 */\n/* 4c:\tbeql\ta1,a0,dc */\n/* 50:\taddiu\tv0,v0,1 */\n/* 54:\tmultu\tv0,a1 */\n/* 58:\taddiu\tt6,a1,1 */\n/* 5c:\taddiu\tt7,a1,2 */\n/* 60:\taddiu\tt8,a1,3 */\n/* 64:\tsll\tt2,v0,0x2 */\n/* 68:\tsll\tt3,v0,0x2 */\n/* 6c:\tsll\tt4,v0,0x2 */\n/* 70:\tsll\tt5,v0,0x2 */\n/* 74:\tmflo\ta2 */\n/* \t... */\n/* 80:\tmultu\tv0,t6 */\n/* 84:\tmflo\ta3 */\n/* \t... */\n/* 90:\tmultu\tv0,t7 */\n/* 94:\tmflo\tt0 */\n/* \t... */\n/* a0:\tmultu\tv0,t8 */\n/* a4:\tmflo\tt1 */\n/* \t... */\n/* b0:\taddu\tv1,v1,a2 */\n/* b4:\taddu\tv1,v1,a3 */\n/* b8:\taddu\tv1,v1,t0 */\n/* bc:\taddu\tv1,v1,t1 */\n/* c0:\taddiu\ta1,a1,4 */\n/* c4:\taddu\tt1,t1,t5 */\n/* c8:\taddu\tt0,t0,t4 */\n/* cc:\taddu\ta3,a3,t3 */\n/* d0:\tbne\ta1,a0,b0 */\n/* d4:\taddu\ta2,a2,t2 */\n/* d8:\taddiu\tv0,v0,1 */\n/* dc:\tbne\tv0,a0,c */\n/* e0:\tnop */\n/* e4:\tjr\tra */\n/* e8:\tmove\tv0,v1 */\n/* ec:\tnop */\nvoid nestedloop(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'nestedloop': unmodelled control transfer 'beql' at 0x4c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":63,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'nestedloop': unmodelled control transfer 'beql' at 0x4c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 nestedloop(s32 arg0) {\n s32 temp_t1;\n s32 var_a1;\n s32 var_a2;\n s32 var_a2_2;\n s32 var_a3;\n s32 var_a3_2;\n s32 var_t0;\n s32 var_t1;\n s32 var_v0;\n s32 var_v1;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg0 > 0) {\n do {\n var_a1 = 0;\n if (arg0 > 0) {\n temp_t1 = arg0 & 3;\n if (temp_t1 != 0) {\n var_a3 = 1;\n var_a2 = var_v0 * 0;\n do {\n var_a1 = var_a3;\n var_v1 += var_a2;\n var_a2 += var_v0;\n var_a3 += 1;\n } while (temp_t1 != var_a3);\n if (var_a1 != arg0) {\n goto block_6;\n }\n } else {\nblock_6:\n var_a2_2 = var_v0 * var_a1;\n var_a3_2 = var_v0 * (var_a1 + 1);\n var_t0 = var_v0 * (var_a1 + 2);\n var_t1 = var_v0 * (var_a1 + 3);\n do {\n var_v1 = var_v1 + var_a2_2 + var_a3_2 + var_t0 + var_t1;\n var_a1 += 4;\n var_t1 += var_v0 * 4;\n var_t0 += var_v0 * 4;\n var_a3_2 += var_v0 * 4;\n var_a2_2 += var_v0 * 4;\n } while (var_a1 != arg0);\n }\n }\n var_v0 += 1;\n } while (var_v0 != arg0);\n }\n return var_v1;\n}\n","score":84,"maxScore":111,"compileErrors":null,"breakdown":{"insert":52,"delete":3,"replace":9,"opMismatch":0,"argMismatch":20},"quality":{"score":88,"lines":51,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":84,"maxScore":111,"ratio":0.7567567567567568,"kinds":{"insert":52,"delete":3,"replace":9,"opMismatch":0,"argMismatch":20}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedloop` — benchmark function synthetic:nestedloop:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel nestedloop\n move\t$v1, $zero\n blez\t$a0, .Le4\n move\t$v0, $zero\n.Lc:\n blez\t$a0, .Ld8\n move\t$a1, $zero\n andi\t$t1, $a0, 0x3\n beqz\t$t1, .L54\n nop\n multu\t$v0, $zero\n move\t$t0, $t1\n li\t$a3, 1\n mflo\t$a2\n.L38:\n move\t$a1, $a3\n addu\t$v1, $v1, $a2\n addu\t$a2, $a2, $v0\n bne\t$t0, $a3, .L38\n addiu\t$a3, $a3, 1\n beql\t$a1, $a0, .Ldc\n addiu\t$v0, $v0, 1\n.L54:\n multu\t$v0, $a1\n addiu\t$t6, $a1, 1\n addiu\t$t7, $a1, 2\n addiu\t$t8, $a1, 3\n sll\t$t2, $v0, 0x2\n sll\t$t3, $v0, 0x2\n sll\t$t4, $v0, 0x2\n sll\t$t5, $v0, 0x2\n mflo\t$a2\n multu\t$v0, $t6\n mflo\t$a3\n multu\t$v0, $t7\n mflo\t$t0\n multu\t$v0, $t8\n mflo\t$t1\n.Lb0:\n addu\t$v1, $v1, $a2\n addu\t$v1, $v1, $a3\n addu\t$v1, $v1, $t0\n addu\t$v1, $v1, $t1\n addiu\t$a1, $a1, 4\n addu\t$t1, $t1, $t5\n addu\t$t0, $t0, $t4\n addu\t$a3, $a3, $t3\n bne\t$a1, $a0, .Lb0\n addu\t$a2, $a2, $t2\n.Ld8:\n addiu\t$v0, $v0, 1\n.Ldc:\n bne\t$v0, $a0, .Lc\n nop\n.Le4:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedloop` — benchmark function synthetic:nestedloop:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedloop:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta0,e4 \n 8:\tmove\tv0,zero\n c:\tblez\ta0,d8 \n 10:\tmove\ta1,zero\n 14:\tandi\tt1,a0,0x3\n 18:\tbeqz\tt1,54 \n 1c:\tnop\n 20:\tmultu\tv0,zero\n 24:\tmove\tt0,t1\n 28:\tli\ta3,1\n 2c:\tmflo\ta2\n\t...\n 38:\tmove\ta1,a3\n 3c:\taddu\tv1,v1,a2\n 40:\taddu\ta2,a2,v0\n 44:\tbne\tt0,a3,38 \n 48:\taddiu\ta3,a3,1\n 4c:\tbeql\ta1,a0,dc \n 50:\taddiu\tv0,v0,1\n 54:\tmultu\tv0,a1\n 58:\taddiu\tt6,a1,1\n 5c:\taddiu\tt7,a1,2\n 60:\taddiu\tt8,a1,3\n 64:\tsll\tt2,v0,0x2\n 68:\tsll\tt3,v0,0x2\n 6c:\tsll\tt4,v0,0x2\n 70:\tsll\tt5,v0,0x2\n 74:\tmflo\ta2\n\t...\n 80:\tmultu\tv0,t6\n 84:\tmflo\ta3\n\t...\n 90:\tmultu\tv0,t7\n 94:\tmflo\tt0\n\t...\n a0:\tmultu\tv0,t8\n a4:\tmflo\tt1\n\t...\n b0:\taddu\tv1,v1,a2\n b4:\taddu\tv1,v1,a3\n b8:\taddu\tv1,v1,t0\n bc:\taddu\tv1,v1,t1\n c0:\taddiu\ta1,a1,4\n c4:\taddu\tt1,t1,t5\n c8:\taddu\tt0,t0,t4\n cc:\taddu\ta3,a3,t3\n d0:\tbne\ta1,a0,b0 \n d4:\taddu\ta2,a2,t2\n d8:\taddiu\tv0,v0,1\n dc:\tbne\tv0,a0,c \n e0:\tnop\n e4:\tjr\tra\n e8:\tmove\tv0,v1\n ec:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t000000f0 .text\n00000000 g F .text\t000000ec nestedloop\n\n\nContents of section .text:\n 0000 00001825 18800037 00001025 18800032 ...%...7...%...2\n 0010 00002825 30890003 1120000e 00000000 ..(%0.... ......\n 0020 00400019 01204025 24070001 00003012 .@... @%$.....0.\n 0030 00000000 00000000 00e02825 00661821 ..........(%.f.!\n 0040 00c23021 1507fffc 24e70001 50a40023 ..0!....$...P..#\n 0050 24420001 00450019 24ae0001 24af0002 $B...E..$...$...\n 0060 24b80003 00025080 00025880 00026080 $.....P...X...`.\n 0070 00026880 00003012 00000000 00000000 ..h...0.........\n 0080 004e0019 00003812 00000000 00000000 .N....8.........\n 0090 004f0019 00004012 00000000 00000000 .O....@.........\n 00a0 00580019 00004812 00000000 00000000 .X....H.........\n 00b0 00661821 00671821 00681821 00691821 .f.!.g.!.h.!.i.!\n 00c0 24a50004 012d4821 010c4021 00eb3821 $....-H!..@!..8!\n 00d0 14a4fff7 00ca3021 24420001 1444ffcb ......0!$B...D..\n 00e0 00000000 03e00008 00601025 00000000 .........`.%....\nContents of section .options:\n 0000 01200000 00000000 8100fffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100fffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000003b 00000008 00000268 p......;.......h\n 0010 00000005 000003b8 00000001 00000270 ...............p\n 0020 00000004 000002a4 00000000 00000000 ................\n 0030 00000011 000002d4 0000003c 00000318 ...........<....\n 0040 0000000c 00000354 00000001 00000360 .......T.......`\n 0050 00000000 00000000 00000001 000003a8 ................\n 0060 08080808 08080400 00000000 00000001 ................\n 0070 00000000 00000000 00000000 ffffffff ................\n 0080 00000000 00000000 00000000 001d001f ................\n 0090 00000002 00000002 00000000 00000001 ................\n 00a0 00000000 2c200004 0000002e 00000000 ...., ..........\n 00b0 1820000f 0000002e 000000ec 20200001 . .......... ..\n 00c0 00000001 00000000 20200000 02000000 ........ ......\n 00d0 03000000 04000000 05000000 06000000 ................\n 00e0 07000000 08000000 09000000 20000000 ............ ...\n 00f0 21000000 0a000000 0b000000 0b000000 !...............\n 0100 1a000000 00000000 00000003 06000000 ................\n 0110 002f746d 702f6173 6d6c6966 742d6d69 ./tmp/asmlift-mi\n 0120 70732d72 65662d38 34633738 61313238 ps-ref-84c78a128\n 0130 32656330 6133362f 7265662e 63006e65 2ec0a36/ref.c.ne\n 0140 73746564 6c6f6f70 00000000 6e657374 stedloop....nest\n 0150 65646c6f 6f700000 00000000 00000001 edloop..........\n 0160 00000000 00000039 00000000 00000004 .......9........\n 0170 00000000 0000003b 00000000 00000000 .......;........\n 0180 00000001 00000000 00000011 00000000 ................\n 0190 00000000 01800000 00000000 00000007 ................\n 01a0 00000000 00000000 00000000 18200001 ............. ..\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 00000000 00000000 7fffffff 00000000 ................\n 01d0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:nestedloop:mwcc_242_81","sym":"nestedloop","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","nested-loop","arithmetic"],"loc":1,"refSource":"int nestedloop(int n){ int s=0,i,j; for(i=0;i:\n 0:\tstwu r1,-16(r1)\n 4:\tli r12,0\n 8:\tli r11,0\n c:\tstw r31,12(r1)\n 10:\tli r31,0\n 14:\tstw r30,8(r1)\n 18:\tb dc \n 1c:\tcmpwi r3,0\n 20:\tli r30,0\n 24:\tble d4 \n 28:\tcmpwi r3,8\n 2c:\taddi r4,r3,-8\n 30:\tble b0 \n 34:\taddi r0,r4,7\n 38:\tli r10,0\n 3c:\tsrwi r0,r0,3\n 40:\tmtctr r0\n 44:\tcmpwi r4,0\n 48:\tble b0 \n 4c:\taddi r0,r30,1\n 50:\taddi r8,r30,2\n 54:\tmullw r9,r31,r0\n 58:\tadd r12,r12,r10\n 5c:\taddi r7,r30,3\n 60:\taddi r6,r30,4\n 64:\taddi r5,r30,5\n 68:\taddi r4,r30,6\n 6c:\taddi r0,r30,7\n 70:\tadd r12,r12,r9\n 74:\tmullw r8,r31,r8\n 78:\tadd r10,r10,r11\n 7c:\taddi r30,r30,8\n 80:\tmullw r7,r31,r7\n 84:\tadd r12,r12,r8\n 88:\tmullw r6,r31,r6\n 8c:\tadd r12,r12,r7\n 90:\tmullw r5,r31,r5\n 94:\tadd r12,r12,r6\n 98:\tmullw r4,r31,r4\n 9c:\tadd r12,r12,r5\n a0:\tmullw r0,r31,r0\n a4:\tadd r12,r12,r4\n a8:\tadd r12,r12,r0\n ac:\tbdnz 4c \n b0:\tmullw r4,r30,r31\n b4:\tsubf r0,r30,r3\n b8:\tmtctr r0\n bc:\tcmpw r30,r3\n c0:\tbge d4 \n c4:\tadd r12,r12,r4\n c8:\tadd r4,r4,r31\n cc:\taddi r30,r30,1\n d0:\tbdnz c4 \n d4:\taddi r11,r11,8\n d8:\taddi r31,r31,1\n dc:\tcmpw r31,r3\n e0:\tblt 1c \n e4:\tlwz r31,12(r1)\n e8:\tmr r3,r12\n ec:\tlwz r30,8(r1)\n f0:\taddi r1,r1,16\n f4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000f8 nestedloop\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 nestedloop\n\n\nContents of section .text:\n 0000 9421fff0 39800000 39600000 93e1000c .!..9...9`......\n 0010 3be00000 93c10008 480000c4 2c030000 ;.......H...,...\n 0020 3bc00000 408100b0 2c030008 3883fff8 ;...@...,...8...\n 0030 40810080 38040007 39400000 5400e8fe @...8...9@..T...\n 0040 7c0903a6 2c040000 40810068 381e0001 |...,...@..h8...\n 0050 391e0002 7d3f01d6 7d8c5214 38fe0003 9...}?..}.R.8...\n 0060 38de0004 38be0005 389e0006 381e0007 8...8...8...8...\n 0070 7d8c4a14 7d1f41d6 7d4a5a14 3bde0008 }.J.}.A.}JZ.;...\n 0080 7cff39d6 7d8c4214 7cdf31d6 7d8c3a14 |.9.}.B.|.1.}.:.\n 0090 7cbf29d6 7d8c3214 7c9f21d6 7d8c2a14 |.).}.2.|.!.}.*.\n 00a0 7c1f01d6 7d8c2214 7d8c0214 4200ffa0 |...}.\".}...B...\n 00b0 7c9ef9d6 7c1e1850 7c0903a6 7c1e1800 |...|..P|...|...\n 00c0 40800014 7d8c2214 7c84fa14 3bde0001 @...}.\".|...;...\n 00d0 4200fff4 396b0008 3bff0001 7c1f1800 B...9k..;...|...\n 00e0 4180ff3c 83e1000c 7d836378 83c10008 A..<....}.cx....\n 00f0 38210010 4e800020 8!..N.. \nContents of section .mwcats.text:\n 0000 020000f8 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 nestedloop(s32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n s32 v6;\n s32 v7;\n s32 v8;\n s32 v9;\n s32 v10;\n v9 = 0;\n v10 = 0;\n for (v8 = 0; v8 < a0; v8 = v8 + 1) {\n if (a0 > 0) {\n if (a0 <= 8) {\n v0 = 0;\n } else {\n v0 = 0;\n v1 = v9;\n v2 = 0;\n for (v3 = (u32)(a0 + -8 + 7) >> 3; v3 != 0; v3 = v3 - 1) {\n v1 = v1 + v2 + v8 * (v0 + 1) + v8 * (v0 + 2) + v8 * (v0 + 3) + v8 * (v0 + 4) + v8 * (v0 + 5) + v8 * (v0 + 6) + v8 * (v0 + 7);\n v2 = v2 + v10;\n v0 = v0 + 8;\n }\n v9 = v1;\n }\n v4 = v9;\n v6 = v0;\n v5 = v0 * v8;\n for (v7 = a0 - v0; v7 != 0; v7 = v7 - 1) {\n v4 = v4 + v5;\n v5 = v5 + v8;\n v6 = v6 + 1;\n }\n v9 = v4;\n }\n v10 = v10 + 8;\n }\n return v9;\n}\n","score":142,"maxScore":152,"compileErrors":null,"breakdown":{"insert":90,"delete":6,"replace":5,"opMismatch":5,"argMismatch":36},"quality":{"score":100,"lines":43,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 nestedloop(s32 arg0) {\n s32 temp_r0;\n s32 temp_r12;\n s32 temp_r4;\n s32 temp_r4_2;\n s32 temp_r5;\n s32 temp_r6;\n s32 temp_r7;\n s32 temp_r8;\n s32 var_ctr_2;\n s32 var_r10;\n s32 var_r11;\n s32 var_r12;\n s32 var_r30;\n s32 var_r31;\n s32 var_r4;\n u32 var_ctr;\n\n var_r12 = 0;\n var_r11 = 0;\n var_r31 = 0;\nloop_8:\n if (var_r31 < arg0) {\n var_r30 = 0;\n if (arg0 > 0) {\n temp_r4 = arg0 - 8;\n if (arg0 > 8) {\n var_r10 = 0;\n var_ctr = (u32) (temp_r4 + 7) >> 3U;\n if (temp_r4 > 0) {\n do {\n temp_r7 = var_r30 + 3;\n temp_r6 = var_r30 + 4;\n temp_r5 = var_r30 + 5;\n temp_r4_2 = var_r30 + 6;\n temp_r0 = var_r30 + 7;\n temp_r12 = var_r12 + var_r10 + (var_r31 * (var_r30 + 1));\n temp_r8 = var_r31 * (var_r30 + 2);\n var_r10 += var_r11;\n var_r30 += 8;\n var_r12 = temp_r12 + temp_r8 + (var_r31 * temp_r7) + (var_r31 * temp_r6) + (var_r31 * temp_r5) + (var_r31 * temp_r4_2) + (var_r31 * temp_r0);\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r4 = var_r30 * var_r31;\n var_ctr_2 = arg0 - var_r30;\n if (var_r30 < arg0) {\n do {\n var_r12 += var_r4;\n var_r4 += var_r31;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n var_r11 += 8;\n var_r31 += 1;\n goto loop_8;\n }\n return var_r12;\n}\n","score":63,"maxScore":74,"compileErrors":null,"breakdown":{"insert":12,"delete":9,"replace":6,"opMismatch":2,"argMismatch":34},"quality":{"score":88,"lines":60,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":63,"maxScore":74,"ratio":0.8513513513513513,"kinds":{"insert":12,"delete":9,"replace":6,"opMismatch":2,"argMismatch":34}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `nestedloop` — benchmark function synthetic:nestedloop:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel nestedloop\n stwu r1,-16(r1)\n li r12,0\n li r11,0\n stw r31,12(r1)\n li r31,0\n stw r30,8(r1)\n b .Ldc\n.L1c:\n cmpwi r3,0\n li r30,0\n ble .Ld4\n cmpwi r3,8\n addi r4,r3,-8\n ble .Lb0\n addi r0,r4,7\n li r10,0\n srwi r0,r0,3\n mtctr r0\n cmpwi r4,0\n ble .Lb0\n.L4c:\n addi r0,r30,1\n addi r8,r30,2\n mullw r9,r31,r0\n add r12,r12,r10\n addi r7,r30,3\n addi r6,r30,4\n addi r5,r30,5\n addi r4,r30,6\n addi r0,r30,7\n add r12,r12,r9\n mullw r8,r31,r8\n add r10,r10,r11\n addi r30,r30,8\n mullw r7,r31,r7\n add r12,r12,r8\n mullw r6,r31,r6\n add r12,r12,r7\n mullw r5,r31,r5\n add r12,r12,r6\n mullw r4,r31,r4\n add r12,r12,r5\n mullw r0,r31,r0\n add r12,r12,r4\n add r12,r12,r0\n bdnz .L4c\n.Lb0:\n mullw r4,r30,r31\n subf r0,r30,r3\n mtctr r0\n cmpw r30,r3\n bge .Ld4\n.Lc4:\n add r12,r12,r4\n add r4,r4,r31\n addi r30,r30,1\n bdnz .Lc4\n.Ld4:\n addi r11,r11,8\n addi r31,r31,1\n.Ldc:\n cmpw r31,r3\n blt .L1c\n lwz r31,12(r1)\n mr r3,r12\n lwz r30,8(r1)\n addi r1,r1,16\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function nestedloop # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `nestedloop` — benchmark function synthetic:nestedloop:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:nestedloop:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tli r12,0\n 8:\tli r11,0\n c:\tstw r31,12(r1)\n 10:\tli r31,0\n 14:\tstw r30,8(r1)\n 18:\tb dc \n 1c:\tcmpwi r3,0\n 20:\tli r30,0\n 24:\tble d4 \n 28:\tcmpwi r3,8\n 2c:\taddi r4,r3,-8\n 30:\tble b0 \n 34:\taddi r0,r4,7\n 38:\tli r10,0\n 3c:\tsrwi r0,r0,3\n 40:\tmtctr r0\n 44:\tcmpwi r4,0\n 48:\tble b0 \n 4c:\taddi r0,r30,1\n 50:\taddi r8,r30,2\n 54:\tmullw r9,r31,r0\n 58:\tadd r12,r12,r10\n 5c:\taddi r7,r30,3\n 60:\taddi r6,r30,4\n 64:\taddi r5,r30,5\n 68:\taddi r4,r30,6\n 6c:\taddi r0,r30,7\n 70:\tadd r12,r12,r9\n 74:\tmullw r8,r31,r8\n 78:\tadd r10,r10,r11\n 7c:\taddi r30,r30,8\n 80:\tmullw r7,r31,r7\n 84:\tadd r12,r12,r8\n 88:\tmullw r6,r31,r6\n 8c:\tadd r12,r12,r7\n 90:\tmullw r5,r31,r5\n 94:\tadd r12,r12,r6\n 98:\tmullw r4,r31,r4\n 9c:\tadd r12,r12,r5\n a0:\tmullw r0,r31,r0\n a4:\tadd r12,r12,r4\n a8:\tadd r12,r12,r0\n ac:\tbdnz 4c \n b0:\tmullw r4,r30,r31\n b4:\tsubf r0,r30,r3\n b8:\tmtctr r0\n bc:\tcmpw r30,r3\n c0:\tbge d4 \n c4:\tadd r12,r12,r4\n c8:\tadd r4,r4,r31\n cc:\taddi r30,r30,1\n d0:\tbdnz c4 \n d4:\taddi r11,r11,8\n d8:\taddi r31,r31,1\n dc:\tcmpw r31,r3\n e0:\tblt 1c \n e4:\tlwz r31,12(r1)\n e8:\tmr r3,r12\n ec:\tlwz r30,8(r1)\n f0:\taddi r1,r1,16\n f4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000f8 nestedloop\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 nestedloop\n\n\nContents of section .text:\n 0000 9421fff0 39800000 39600000 93e1000c .!..9...9`......\n 0010 3be00000 93c10008 480000c4 2c030000 ;.......H...,...\n 0020 3bc00000 408100b0 2c030008 3883fff8 ;...@...,...8...\n 0030 40810080 38040007 39400000 5400e8fe @...8...9@..T...\n 0040 7c0903a6 2c040000 40810068 381e0001 |...,...@..h8...\n 0050 391e0002 7d3f01d6 7d8c5214 38fe0003 9...}?..}.R.8...\n 0060 38de0004 38be0005 389e0006 381e0007 8...8...8...8...\n 0070 7d8c4a14 7d1f41d6 7d4a5a14 3bde0008 }.J.}.A.}JZ.;...\n 0080 7cff39d6 7d8c4214 7cdf31d6 7d8c3a14 |.9.}.B.|.1.}.:.\n 0090 7cbf29d6 7d8c3214 7c9f21d6 7d8c2a14 |.).}.2.|.!.}.*.\n 00a0 7c1f01d6 7d8c2214 7d8c0214 4200ffa0 |...}.\".}...B...\n 00b0 7c9ef9d6 7c1e1850 7c0903a6 7c1e1800 |...|..P|...|...\n 00c0 40800014 7d8c2214 7c84fa14 3bde0001 @...}.\".|...;...\n 00d0 4200fff4 396b0008 3bff0001 7c1f1800 B...9k..;...|...\n 00e0 4180ff3c 83e1000c 7d836378 83c10008 A..<....}.cx....\n 00f0 38210010 4e800020 8!..N.. \nContents of section .mwcats.text:\n 0000 020000f8 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name nestedloop # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:notb:agbcc","sym":"notb","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","bool"],"loc":1,"refSource":"int notb(int x){ return !x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnotb\n\t.type\t notb,function\n\t.thumb_func\nnotb:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t notb,.Lfe1-notb\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 notb(u32 a0) {\n s32 v0;\n if (a0 != 0) {\n v0 = 0;\n } else {\n v0 = 1;\n }\n return v0;\n}\n","score":3,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 notb(s32 arg0) {\n s32 var_r1;\n\n var_r1 = 0;\n if (arg0 == 0) {\n var_r1 = 1;\n }\n return var_r1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `notb` — benchmark function synthetic:notb:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnotb\n\t.type\t notb,function\n\t.thumb_func\nnotb:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t notb,.Lfe1-notb\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function notb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `notb` — benchmark function synthetic:notb:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:notb:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tnotb\n\t.type\t notb,function\n\t.thumb_func\nnotb:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t notb,.Lfe1-notb\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name notb # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:notb:gcc2.7.2kmc","sym":"notb","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","bool"],"loc":1,"refSource":"int notb(int x){ return !x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-7e372b1717a302d5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 notb\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 notb(u32 a0) {\n return a0 < 1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 notb(s32 arg0) {\n return arg0 == 0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `notb` — benchmark function synthetic:notb:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel notb\n jr\t$ra\n sltiu\t$v0, $a0, 1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function notb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `notb` — benchmark function synthetic:notb:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:notb:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-7e372b1717a302d5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 notb\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name notb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:notb:ido7.1","sym":"notb","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","bool"],"loc":1,"refSource":"int notb(int x){ return !x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 notb\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 65333732 62313731 37613330 ef-7e372b1717a30\n 0130 3264352f 7265662e 63006e6f 74620000 2d5/ref.c.notb..\n 0140 6e6f7462 00000000 00000000 00000001 notb............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 notb(u32 a0) {\n return a0 < 1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 notb(s32 arg0) {\n return arg0 == 0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `notb` — benchmark function synthetic:notb:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel notb\n jr\t$ra\n sltiu\t$v0, $a0, 1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function notb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `notb` — benchmark function synthetic:notb:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:notb:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsltiu\tv0,a0,1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 notb\n\n\nContents of section .text:\n 0000 03e00008 2c820001 00000000 00000000 ....,...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 65333732 62313731 37613330 ef-7e372b1717a30\n 0130 3264352f 7265662e 63006e6f 74620000 2d5/ref.c.notb..\n 0140 6e6f7462 00000000 00000000 00000001 notb............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name notb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:notb:mwcc_242_81","sym":"notb","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","bool"],"loc":1,"refSource":"int notb(int x){ return !x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcntlzw r0,r3\n 4:\tsrwi r3,r0,5\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c notb\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 notb\n\n\nContents of section .text:\n 0000 7c600034 5403d97e 4e800020 |`.4T..~N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 notb(u32 a0) {\n return a0 == 0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 notb(s32 arg0) {\n return arg0 == 0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `notb` — benchmark function synthetic:notb:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel notb\n cntlzw r0,r3\n srwi r3,r0,5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function notb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `notb` — benchmark function synthetic:notb:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:notb:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcntlzw r0,r3\n 4:\tsrwi r3,r0,5\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c notb\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 notb\n\n\nContents of section .text:\n 0000 7c600034 5403d97e 4e800020 |`.4T..~N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name notb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:powi:agbcc","sym":"powi","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for","arithmetic"],"loc":1,"refSource":"int powi(int base,int e){ int r=1,i; for(i=0;i 0) {\n do {\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n}\n","score":4,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":3,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":9,"ratio":0.1111111111111111,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `powi` — benchmark function synthetic:powi:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tpowi\n\t.type\t powi,function\n\t.thumb_func\npowi:\n\tadd\tr2, r0, #0\n\tmov\tr0, #0x1\n\tcmp\tr1, #0\n\tble\t.L4\t@cond_branch\n.L6:\n\tmul\tr0, r0, r2\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t powi,.Lfe1-powi\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function powi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `powi` — benchmark function synthetic:powi:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:powi:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tpowi\n\t.type\t powi,function\n\t.thumb_func\npowi:\n\tadd\tr2, r0, #0\n\tmov\tr0, #0x1\n\tcmp\tr1, #0\n\tble\t.L4\t@cond_branch\n.L6:\n\tmul\tr0, r0, r2\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tbx\tlr\n.Lfe1:\n\t.size\t powi,.Lfe1-powi\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name powi # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:powi:gcc2.7.2kmc","sym":"powi","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for","arithmetic"],"loc":1,"refSource":"int powi(int base,int e){ int r=1,i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tli\ta2,1\n 8:\tblez\ta1,30 \n c:\tmove\tv1,zero\n 10:\taddiu\tv1,v1,1\n 14:\tslt\tv0,v1,a1\n 18:\tmult\ta2,a0\n 1c:\tmflo\ta2\n\t...\n 28:\tbnezl\tv0,14 \n 2c:\taddiu\tv1,v1,1\n 30:\tmove\tv0,a2\n 34:\tjr\tra\n 38:\taddiu\tsp,sp,8\n 3c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2911ded927f4f46f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c powi\n\n\nContents of section .text:\n 0000 27bdfff8 24060001 18a00009 00001821 '...$..........!\n 0010 24630001 0065102a 00c40018 00003012 $c...e.*......0.\n 0020 00000000 00000000 5440fffa 24630001 ........T@..$c..\n 0030 00c01021 03e00008 27bd0008 00000000 ...!....'.......\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'powi' — lift: cannot lift 'powi': unmodelled control transfer 'bnezl' at 0x28 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-8 */\n/* 4:\tli\ta2,1 */\n/* 8:\tblez\ta1,30 */\n/* c:\tmove\tv1,zero */\n/* 10:\taddiu\tv1,v1,1 */\n/* 14:\tslt\tv0,v1,a1 */\n/* 18:\tmult\ta2,a0 */\n/* 1c:\tmflo\ta2 */\n/* \t... */\n/* 28:\tbnezl\tv0,14 */\n/* 2c:\taddiu\tv1,v1,1 */\n/* 30:\tmove\tv0,a2 */\n/* 34:\tjr\tra */\n/* 38:\taddiu\tsp,sp,8 */\n/* 3c:\tnop */\nvoid powi(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'powi': unmodelled control transfer 'bnezl' at 0x28 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'powi': unmodelled control transfer 'bnezl' at 0x28 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 powi(s32 arg0, s32 arg1) {\n s32 var_a2;\n s32 var_v1;\n\n var_a2 = 1;\n var_v1 = 0;\n if (arg1 > 0) {\n do {\n var_v1 += 1;\n var_a2 *= arg0;\n } while (var_v1 < arg1);\n }\n return var_a2;\n}\n","score":4,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":15,"ratio":0.26666666666666666,"kinds":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `powi` — benchmark function synthetic:powi:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel powi\n addiu\t$sp, $sp, -8\n li\t$a2, 1\n blez\t$a1, .L30\n move\t$v1, $zero\n addiu\t$v1, $v1, 1\n.L14:\n slt\t$v0, $v1, $a1\n mult\t$a2, $a0\n mflo\t$a2\n bnezl\t$v0, .L14\n addiu\t$v1, $v1, 1\n.L30:\n move\t$v0, $a2\n jr\t$ra\n addiu\t$sp, $sp, 8\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function powi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `powi` — benchmark function synthetic:powi:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:powi:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tli\ta2,1\n 8:\tblez\ta1,30 \n c:\tmove\tv1,zero\n 10:\taddiu\tv1,v1,1\n 14:\tslt\tv0,v1,a1\n 18:\tmult\ta2,a0\n 1c:\tmflo\ta2\n\t...\n 28:\tbnezl\tv0,14 \n 2c:\taddiu\tv1,v1,1\n 30:\tmove\tv0,a2\n 34:\tjr\tra\n 38:\taddiu\tsp,sp,8\n 3c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-2911ded927f4f46f/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000003c powi\n\n\nContents of section .text:\n 0000 27bdfff8 24060001 18a00009 00001821 '...$..........!\n 0010 24630001 0065102a 00c40018 00003012 $c...e.*......0.\n 0020 00000000 00000000 5440fffa 24630001 ........T@..$c..\n 0030 00c01021 03e00008 27bd0008 00000000 ...!....'.......\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name powi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:powi:ido7.1","sym":"powi","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for","arithmetic"],"loc":1,"refSource":"int powi(int base,int e){ int r=1,i; for(i=0;i:\n 0:\tli\tv1,1\n 4:\tblez\ta1,78 \n 8:\tmove\tv0,zero\n c:\tandi\ta3,a1,0x3\n 10:\tbeqz\ta3,34 \n 14:\tmove\ta2,a3\n 18:\tmultu\tv1,a0\n 1c:\taddiu\tv0,v0,1\n 20:\tmflo\tv1\n 24:\tbne\ta2,v0,18 \n 28:\tnop\n 2c:\tbeq\tv0,a1,78 \n 30:\tnop\n 34:\tmultu\tv1,a0\n 38:\taddiu\tv0,v0,4\n 3c:\tmflo\tv1\n\t...\n 48:\tmultu\tv1,a0\n 4c:\tmflo\tv1\n\t...\n 58:\tmultu\tv1,a0\n 5c:\tmflo\tv1\n\t...\n 68:\tmultu\tv1,a0\n 6c:\tmflo\tv1\n 70:\tbne\tv0,a1,34 \n 74:\tnop\n 78:\tjr\tra\n 7c:\tmove\tv0,v1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000080 powi\n\n\nContents of section .text:\n 0000 24030001 18a0001c 00001025 30a70003 $..........%0...\n 0010 10e00008 00e03025 00640019 24420001 ......0%.d..$B..\n 0020 00001812 14c2fffc 00000000 10450012 .............E..\n 0030 00000000 00640019 24420004 00001812 .....d..$B......\n 0040 00000000 00000000 00640019 00001812 .........d......\n 0050 00000000 00000000 00640019 00001812 .........d......\n 0060 00000000 00000000 00640019 00001812 .........d......\n 0070 1445fff0 00000000 03e00008 00601025 .E...........`.%\nContents of section .options:\n 0000 01200000 00000000 800000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000020 00000004 000001e8 p...... ........\n 0010 00000005 00000328 00000001 000001ec .......(........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000034 00000294 .......P...4....\n 0040 00000008 000002c8 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 08080804 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000080 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 39313164 65643932 37663466 ef-2911ded927f4f\n 0130 3436662f 7265662e 6300706f 77690000 46f/ref.c.powi..\n 0140 706f7769 00000000 00000000 00000001 powi............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000020 00000000 00000000 ....... ........\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000004 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'powi' — structure: cannot structure 'powi': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tli\tv1,1 */\n/* 4:\tblez\ta1,78 */\n/* 8:\tmove\tv0,zero */\n/* c:\tandi\ta3,a1,0x3 */\n/* 10:\tbeqz\ta3,34 */\n/* 14:\tmove\ta2,a3 */\n/* 18:\tmultu\tv1,a0 */\n/* 1c:\taddiu\tv0,v0,1 */\n/* 20:\tmflo\tv1 */\n/* 24:\tbne\ta2,v0,18 */\n/* 28:\tnop */\n/* 2c:\tbeq\tv0,a1,78 */\n/* 30:\tnop */\n/* 34:\tmultu\tv1,a0 */\n/* 38:\taddiu\tv0,v0,4 */\n/* 3c:\tmflo\tv1 */\n/* \t... */\n/* 48:\tmultu\tv1,a0 */\n/* 4c:\tmflo\tv1 */\n/* \t... */\n/* 58:\tmultu\tv1,a0 */\n/* 5c:\tmflo\tv1 */\n/* \t... */\n/* 68:\tmultu\tv1,a0 */\n/* 6c:\tmflo\tv1 */\n/* 70:\tbne\tv0,a1,34 */\n/* 74:\tnop */\n/* 78:\tjr\tra */\n/* 7c:\tmove\tv0,v1 */\nvoid powi(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'powi': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":37,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'powi': unrecovered back-edge into block #4 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 powi(s32 arg0, s32 arg1) {\n s32 temp_a3;\n s32 var_v0;\n s32 var_v1;\n\n var_v1 = 1;\n var_v0 = 0;\n if (arg1 > 0) {\n temp_a3 = arg1 & 3;\n if (temp_a3 != 0) {\n do {\n var_v0 += 1;\n var_v1 *= arg0;\n } while (temp_a3 != var_v0);\n if (var_v0 != arg1) {\n goto loop_4;\n }\n } else {\n do {\nloop_4:\n var_v0 += 4;\n var_v1 = var_v1 * arg0 * arg0 * arg0 * arg0;\n } while (var_v0 != arg1);\n }\n }\n return var_v1;\n}\n","score":34,"maxScore":55,"compileErrors":null,"breakdown":{"insert":23,"delete":0,"replace":0,"opMismatch":0,"argMismatch":11},"quality":{"score":88,"lines":26,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":34,"maxScore":55,"ratio":0.6181818181818182,"kinds":{"insert":23,"delete":0,"replace":0,"opMismatch":0,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `powi` — benchmark function synthetic:powi:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel powi\n li\t$v1, 1\n blez\t$a1, .L78\n move\t$v0, $zero\n andi\t$a3, $a1, 0x3\n beqz\t$a3, .L34\n move\t$a2, $a3\n.L18:\n multu\t$v1, $a0\n addiu\t$v0, $v0, 1\n mflo\t$v1\n bne\t$a2, $v0, .L18\n nop\n beq\t$v0, $a1, .L78\n nop\n.L34:\n multu\t$v1, $a0\n addiu\t$v0, $v0, 4\n mflo\t$v1\n multu\t$v1, $a0\n mflo\t$v1\n multu\t$v1, $a0\n mflo\t$v1\n multu\t$v1, $a0\n mflo\t$v1\n bne\t$v0, $a1, .L34\n nop\n.L78:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function powi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `powi` — benchmark function synthetic:powi:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:powi:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv1,1\n 4:\tblez\ta1,78 \n 8:\tmove\tv0,zero\n c:\tandi\ta3,a1,0x3\n 10:\tbeqz\ta3,34 \n 14:\tmove\ta2,a3\n 18:\tmultu\tv1,a0\n 1c:\taddiu\tv0,v0,1\n 20:\tmflo\tv1\n 24:\tbne\ta2,v0,18 \n 28:\tnop\n 2c:\tbeq\tv0,a1,78 \n 30:\tnop\n 34:\tmultu\tv1,a0\n 38:\taddiu\tv0,v0,4\n 3c:\tmflo\tv1\n\t...\n 48:\tmultu\tv1,a0\n 4c:\tmflo\tv1\n\t...\n 58:\tmultu\tv1,a0\n 5c:\tmflo\tv1\n\t...\n 68:\tmultu\tv1,a0\n 6c:\tmflo\tv1\n 70:\tbne\tv0,a1,34 \n 74:\tnop\n 78:\tjr\tra\n 7c:\tmove\tv0,v1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000080 powi\n\n\nContents of section .text:\n 0000 24030001 18a0001c 00001025 30a70003 $..........%0...\n 0010 10e00008 00e03025 00640019 24420001 ......0%.d..$B..\n 0020 00001812 14c2fffc 00000000 10450012 .............E..\n 0030 00000000 00640019 24420004 00001812 .....d..$B......\n 0040 00000000 00000000 00640019 00001812 .........d......\n 0050 00000000 00000000 00640019 00001812 .........d......\n 0060 00000000 00000000 00640019 00001812 .........d......\n 0070 1445fff0 00000000 03e00008 00601025 .E...........`.%\nContents of section .options:\n 0000 01200000 00000000 800000fc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 800000fc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000020 00000004 000001e8 p...... ........\n 0010 00000005 00000328 00000001 000001ec .......(........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000034 00000294 .......P...4....\n 0040 00000008 000002c8 00000001 000002d0 ................\n 0050 00000000 00000000 00000001 00000318 ................\n 0060 08080804 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000080 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 39313164 65643932 37663466 ef-2911ded927f4f\n 0130 3436662f 7265662e 6300706f 77690000 46f/ref.c.powi..\n 0140 706f7769 00000000 00000000 00000001 powi............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000020 00000000 00000000 ....... ........\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000004 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name powi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:powi:mwcc_242_81","sym":"powi","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for","arithmetic"],"loc":1,"refSource":"int powi(int base,int e){ int r=1,i; for(i=0;i:\n 0:\tcmpwi r4,0\n 4:\tli r6,1\n 8:\tli r7,0\n c:\tble 70 \n 10:\tcmpwi r4,8\n 14:\taddi r5,r4,-8\n 18:\tble 58 \n 1c:\taddi r0,r5,7\n 20:\tsrwi r0,r0,3\n 24:\tmtctr r0\n 28:\tcmpwi r5,0\n 2c:\tble 58 \n 30:\tmullw r6,r6,r3\n 34:\taddi r7,r7,8\n 38:\tmullw r6,r6,r3\n 3c:\tmullw r6,r6,r3\n 40:\tmullw r6,r6,r3\n 44:\tmullw r6,r6,r3\n 48:\tmullw r6,r6,r3\n 4c:\tmullw r6,r6,r3\n 50:\tmullw r6,r6,r3\n 54:\tbdnz 30 \n 58:\tsubf r0,r7,r4\n 5c:\tmtctr r0\n 60:\tcmpw r7,r4\n 64:\tbge 70 \n 68:\tmullw r6,r6,r3\n 6c:\tbdnz 68 \n 70:\tmr r3,r6\n 74:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000078 powi\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 powi\n\n\nContents of section .text:\n 0000 2c040000 38c00001 38e00000 40810064 ,...8...8...@..d\n 0010 2c040008 38a4fff8 40810040 38050007 ,...8...@..@8...\n 0020 5400e8fe 7c0903a6 2c050000 4081002c T...|...,...@..,\n 0030 7cc619d6 38e70008 7cc619d6 7cc619d6 |...8...|...|...\n 0040 7cc619d6 7cc619d6 7cc619d6 7cc619d6 |...|...|...|...\n 0050 7cc619d6 4200ffdc 7c072050 7c0903a6 |...B...|. P|...\n 0060 7c072000 4080000c 7cc619d6 4200fffc |. .@...|...B...\n 0070 7cc33378 4e800020 |.3xN.. \nContents of section .mwcats.text:\n 0000 02000078 00000000 ...x.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 powi(u32 a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n if (a1 <= 0) {\n v0 = 1;\n } else {\n if (a1 <= 8) {\n v1 = 0;\n v0 = 1;\n } else {\n v0 = 1;\n v1 = 0;\n for (v2 = a1 + -8 + 7 >> 3; v2 != 0; v2 = v2 - 1) {\n v1 = v1 + 8;\n v0 = v0 * a0 * a0 * a0 * a0 * a0 * a0 * a0 * a0;\n }\n }\n v3 = v0;\n for (v4 = a1 - v1; v4 != 0; v4 = v4 - 1) {\n v3 = v3 * a0;\n }\n v0 = v3;\n }\n return v0;\n}\n","score":87,"maxScore":92,"compileErrors":null,"breakdown":{"insert":62,"delete":4,"replace":3,"opMismatch":4,"argMismatch":14},"quality":{"score":100,"lines":28,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 powi(s32 arg0, s32 arg1) {\n s32 temp_r5;\n s32 var_ctr_2;\n s32 var_r6;\n s32 var_r7;\n u32 var_ctr;\n\n var_r6 = 1;\n var_r7 = 0;\n if (arg1 > 0) {\n temp_r5 = arg1 - 8;\n if (arg1 > 8) {\n var_ctr = (u32) (temp_r5 + 7) >> 3U;\n if (temp_r5 > 0) {\n do {\n var_r7 += 8;\n var_r6 = var_r6 * arg0 * arg0 * arg0 * arg0 * arg0 * arg0 * arg0 * arg0;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_ctr_2 = arg1 - var_r7;\n if (var_r7 < arg1) {\n do {\n var_r6 *= arg0;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r6;\n}\n","score":21,"maxScore":34,"compileErrors":null,"breakdown":{"insert":4,"delete":4,"replace":0,"opMismatch":2,"argMismatch":11},"quality":{"score":100,"lines":30,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":21,"maxScore":34,"ratio":0.6176470588235294,"kinds":{"insert":4,"delete":4,"replace":0,"opMismatch":2,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `powi` — benchmark function synthetic:powi:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel powi\n cmpwi r4,0\n li r6,1\n li r7,0\n ble .L70\n cmpwi r4,8\n addi r5,r4,-8\n ble .L58\n addi r0,r5,7\n srwi r0,r0,3\n mtctr r0\n cmpwi r5,0\n ble .L58\n.L30:\n mullw r6,r6,r3\n addi r7,r7,8\n mullw r6,r6,r3\n mullw r6,r6,r3\n mullw r6,r6,r3\n mullw r6,r6,r3\n mullw r6,r6,r3\n mullw r6,r6,r3\n mullw r6,r6,r3\n bdnz .L30\n.L58:\n subf r0,r7,r4\n mtctr r0\n cmpw r7,r4\n bge .L70\n.L68:\n mullw r6,r6,r3\n bdnz .L68\n.L70:\n mr r3,r6\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function powi # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `powi` — benchmark function synthetic:powi:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:powi:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r4,0\n 4:\tli r6,1\n 8:\tli r7,0\n c:\tble 70 \n 10:\tcmpwi r4,8\n 14:\taddi r5,r4,-8\n 18:\tble 58 \n 1c:\taddi r0,r5,7\n 20:\tsrwi r0,r0,3\n 24:\tmtctr r0\n 28:\tcmpwi r5,0\n 2c:\tble 58 \n 30:\tmullw r6,r6,r3\n 34:\taddi r7,r7,8\n 38:\tmullw r6,r6,r3\n 3c:\tmullw r6,r6,r3\n 40:\tmullw r6,r6,r3\n 44:\tmullw r6,r6,r3\n 48:\tmullw r6,r6,r3\n 4c:\tmullw r6,r6,r3\n 50:\tmullw r6,r6,r3\n 54:\tbdnz 30 \n 58:\tsubf r0,r7,r4\n 5c:\tmtctr r0\n 60:\tcmpw r7,r4\n 64:\tbge 70 \n 68:\tmullw r6,r6,r3\n 6c:\tbdnz 68 \n 70:\tmr r3,r6\n 74:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000078 powi\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 powi\n\n\nContents of section .text:\n 0000 2c040000 38c00001 38e00000 40810064 ,...8...8...@..d\n 0010 2c040008 38a4fff8 40810040 38050007 ,...8...@..@8...\n 0020 5400e8fe 7c0903a6 2c050000 4081002c T...|...,...@..,\n 0030 7cc619d6 38e70008 7cc619d6 7cc619d6 |...8...|...|...\n 0040 7cc619d6 7cc619d6 7cc619d6 7cc619d6 |...|...|...|...\n 0050 7cc619d6 4200ffdc 7c072050 7c0903a6 |...B...|. P|...\n 0060 7c072000 4080000c 7cc619d6 4200fffc |. .@...|...B...\n 0070 7cc33378 4e800020 |.3xN.. \nContents of section .mwcats.text:\n 0000 02000078 00000000 ...x.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name powi # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:promsh:agbcc","sym":"promsh","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","promotion","arithmetic"],"loc":1,"refSource":"int promsh(s16 a,s16 b){ return a+b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tpromsh\n\t.type\t promsh,function\n\t.thumb_func\npromsh:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t promsh,.Lfe1-promsh\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 promsh(u32 a0, u32 a1) {\n return (s16)a0 + (s16)a1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 promsh(s16 arg0, s16 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `promsh` — benchmark function synthetic:promsh:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tpromsh\n\t.type\t promsh,function\n\t.thumb_func\npromsh:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t promsh,.Lfe1-promsh\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function promsh # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `promsh` — benchmark function synthetic:promsh:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:promsh:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tpromsh\n\t.type\t promsh,function\n\t.thumb_func\npromsh:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t promsh,.Lfe1-promsh\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name promsh # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:promsh:gcc2.7.2kmc","sym":"promsh","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","promotion","arithmetic"],"loc":1,"refSource":"int promsh(s16 a,s16 b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a1,0x10\n c:\tsra\tv0,v0,0x10\n 10:\tjr\tra\n 14:\taddu\tv0,a0,v0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5086c31083528287/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 promsh\n\n\nContents of section .text:\n 0000 00042400 00042403 00051400 00021403 ..$...$.........\n 0010 03e00008 00821021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 promsh(s32 a0, s32 a1) {\n return (a0 << 16 >> 16) + (a1 << 16 >> 16);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 promsh(s16 arg0, s16 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `promsh` — benchmark function synthetic:promsh:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel promsh\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sll\t$v0, $a1, 0x10\n sra\t$v0, $v0, 0x10\n jr\t$ra\n addu\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function promsh # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `promsh` — benchmark function synthetic:promsh:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:promsh:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\ta0,a0,0x10\n 4:\tsra\ta0,a0,0x10\n 8:\tsll\tv0,a1,0x10\n c:\tsra\tv0,v0,0x10\n 10:\tjr\tra\n 14:\taddu\tv0,a0,v0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5086c31083528287/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 promsh\n\n\nContents of section .text:\n 0000 00042400 00042403 00051400 00021403 ..$...$.........\n 0010 03e00008 00821021 00000000 00000000 .......!........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name promsh # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:promsh:ido7.1","sym":"promsh","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","promotion","arithmetic"],"loc":1,"refSource":"int promsh(s16 a,s16 b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tsll\ta1,a1,0x10\n c:\tsll\ta0,a0,0x10\n 10:\tsra\ta0,a0,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tjr\tra\n 1c:\taddu\tv0,a0,a1\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 promsh\n\n\nContents of section .text:\n 0000 afa40000 afa50004 00052c00 00042400 ..........,...$.\n 0010 00042403 00052c03 03e00008 00851021 ..$...,........!\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 07000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000020 20200001 00000001 ....... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 30383663 33313038 33353238 ef-5086c31083528\n 0130 3238372f 7265662e 63007072 6f6d7368 287/ref.c.promsh\n 0140 00000000 70726f6d 73680000 00000000 ....promsh......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000008 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 promsh(s32 a0, s32 a1) {\n return (a0 << 16 >> 16) + (a1 << 16 >> 16);\n}\n","score":7,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 promsh(s16 arg0, s16 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `promsh` — benchmark function synthetic:promsh:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel promsh\n sw\t$a0, 0($sp)\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sra\t$a1, $a1, 0x10\n jr\t$ra\n addu\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function promsh # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `promsh` — benchmark function synthetic:promsh:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:promsh:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tsll\ta1,a1,0x10\n c:\tsll\ta0,a0,0x10\n 10:\tsra\ta0,a0,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tjr\tra\n 1c:\taddu\tv0,a0,a1\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000020 promsh\n\n\nContents of section .text:\n 0000 afa40000 afa50004 00052c00 00042400 ..........,...$.\n 0010 00042403 00052c03 03e00008 00851021 ..$...,........!\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000008 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 07000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000020 20200001 00000001 ....... ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 30383663 33313038 33353238 ef-5086c31083528\n 0130 3238372f 7265662e 63007072 6f6d7368 287/ref.c.promsh\n 0140 00000000 70726f6d 73680000 00000000 ....promsh......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000008 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name promsh # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:promsh:mwcc_242_81","sym":"promsh","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","promotion","arithmetic"],"loc":1,"refSource":"int promsh(s16 a,s16 b){ return a+b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\textsh r3,r3\n 4:\textsh r0,r4\n 8:\tadd r3,r3,r0\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 promsh\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 promsh\n\n\nContents of section .text:\n 0000 7c630734 7c800734 7c630214 4e800020 |c.4|..4|c..N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 promsh(u32 a0, u32 a1) {\n return (s16)a0 + (s16)a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 promsh(s16 arg0, s16 arg1) {\n return arg0 + arg1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `promsh` — benchmark function synthetic:promsh:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel promsh\n extsh r3,r3\n extsh r0,r4\n add r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function promsh # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `promsh` — benchmark function synthetic:promsh:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:promsh:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\textsh r3,r3\n 4:\textsh r0,r4\n 8:\tadd r3,r3,r0\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 promsh\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 promsh\n\n\nContents of section .text:\n 0000 7c630734 7c800734 7c630214 4e800020 |c.4|..4|c..N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name promsh # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ptradd:agbcc","sym":"ptradd","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","pointer-arith"],"loc":1,"refSource":"int *ptradd(int *p,int n){ return p+n; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tptradd\n\t.type\t ptradd,function\n\t.thumb_func\nptradd:\n\tlsl\tr1, r1, #0x2\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ptradd,.Lfe1-ptradd\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 ptradd(u32 a0, u32 a1) {\n return a0 + (a1 << 2);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 ptradd(s32 arg0, s32 arg1) {\n return arg0 + (arg1 * 4);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ptradd` — benchmark function synthetic:ptradd:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tptradd\n\t.type\t ptradd,function\n\t.thumb_func\nptradd:\n\tlsl\tr1, r1, #0x2\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ptradd,.Lfe1-ptradd\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ptradd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ptradd` — benchmark function synthetic:ptradd:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ptradd:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tptradd\n\t.type\t ptradd,function\n\t.thumb_func\nptradd:\n\tlsl\tr1, r1, #0x2\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t ptradd,.Lfe1-ptradd\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ptradd # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ptradd:gcc2.7.2kmc","sym":"ptradd","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","pointer-arith"],"loc":1,"refSource":"int *ptradd(int *p,int n){ return p+n; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a1,0x2\n 4:\tjr\tra\n 8:\taddu\tv0,a0,v0\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f4d5bcd911b5ff6b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c ptradd\n\n\nContents of section .text:\n 0000 00051080 03e00008 00821021 00000000 ...........!....\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 ptradd(u32 a0, u32 a1) {\n return a0 + (a1 << 2);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 ptradd(s32 arg0, s32 arg1) {\n return arg0 + (arg1 * 4);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ptradd` — benchmark function synthetic:ptradd:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ptradd\n sll\t$v0, $a1, 0x2\n jr\t$ra\n addu\t$v0, $a0, $v0\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ptradd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ptradd` — benchmark function synthetic:ptradd:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ptradd:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a1,0x2\n 4:\tjr\tra\n 8:\taddu\tv0,a0,v0\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f4d5bcd911b5ff6b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c ptradd\n\n\nContents of section .text:\n 0000 00051080 03e00008 00821021 00000000 ...........!....\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name ptradd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ptradd:ido7.1","sym":"ptradd","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","pointer-arith"],"loc":1,"refSource":"int *ptradd(int *p,int n){ return p+n; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x2\n 4:\tjr\tra\n 8:\taddu\tv0,t6,a0\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c ptradd\n\n\nContents of section .text:\n 0000 00057080 03e00008 01c41021 00000000 ..p........!....\nContents of section .options:\n 0000 01200000 00000000 80004034 00000000 . ........@4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004034 00000000 00000000 00000000 ..@4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 34643562 63643931 31623566 ef-f4d5bcd911b5f\n 0130 6636622f 7265662e 63007074 72616464 f6b/ref.c.ptradd\n 0140 00000000 70747261 64640000 00000000 ....ptradd......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000003 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 ptradd(u32 a0, u32 a1) {\n return (a1 << 2) + a0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 ptradd(s32 arg0, s32 arg1) {\n return (arg1 * 4) + arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ptradd` — benchmark function synthetic:ptradd:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ptradd\n sll\t$t6, $a1, 0x2\n jr\t$ra\n addu\t$v0, $t6, $a0\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ptradd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ptradd` — benchmark function synthetic:ptradd:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ptradd:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tt6,a1,0x2\n 4:\tjr\tra\n 8:\taddu\tv0,t6,a0\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c ptradd\n\n\nContents of section .text:\n 0000 00057080 03e00008 01c41021 00000000 ..p........!....\nContents of section .options:\n 0000 01200000 00000000 80004034 00000000 . ........@4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004034 00000000 00000000 00000000 ..@4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 34643562 63643931 31623566 ef-f4d5bcd911b5f\n 0130 6636622f 7265662e 63007074 72616464 f6b/ref.c.ptradd\n 0140 00000000 70747261 64640000 00000000 ....ptradd......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000003 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ptradd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:ptradd:mwcc_242_81","sym":"ptradd","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","pointer-arith"],"loc":1,"refSource":"int *ptradd(int *p,int n){ return p+n; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,2\n 4:\tadd r3,r3,r0\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c ptradd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ptradd\n\n\nContents of section .text:\n 0000 5480103a 7c630214 4e800020 T..:|c..N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 ptradd(u32 a0, u32 a1) {\n return a0 + (a1 << 2);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 ptradd(s32 arg0, s32 arg1) {\n return arg0 + (arg1 * 4);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `ptradd` — benchmark function synthetic:ptradd:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel ptradd\n slwi r0,r4,2\n add r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function ptradd # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `ptradd` — benchmark function synthetic:ptradd:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:ptradd:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslwi r0,r4,2\n 4:\tadd r3,r3,r0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c ptradd\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 ptradd\n\n\nContents of section .text:\n 0000 5480103a 7c630214 4e800020 T..:|c..N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name ptradd # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:revarr:agbcc","sym":"revarr","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","memory","store"],"loc":1,"refSource":"void revarr(int *a,int n){ int i,j,t; for(i=0,j=n-1;i 0) {\n var_r2 = &var_r4[var_r3];\n do {\n temp_r1 = *var_r4;\n *var_r4 = *var_r2;\n var_r4 += 4;\n *var_r2 = temp_r1;\n var_r5 += 1;\n var_r2 -= 4;\n var_r3 -= 1;\n } while (var_r5 < var_r3);\n }\n}\n","score":9,"maxScore":22,"compileErrors":null,"breakdown":{"insert":2,"delete":1,"replace":0,"opMismatch":1,"argMismatch":5},"quality":{"score":100,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":22,"ratio":0.2727272727272727,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":0,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `revarr` — benchmark function synthetic:revarr:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trevarr\n\t.type\t revarr,function\n\t.thumb_func\nrevarr:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tmov\tr5, #0x0\n\tsub\tr3, r1, #0x1\n\tcmp\tr5, r3\n\tbge\t.L4\t@cond_branch\n\tlsl\tr0, r3, #0x2\n\tadd\tr2, r0, r4\n.L6:\n\tldr\tr1, [r4]\n\tldr\tr0, [r2]\n\tstmia\tr4!, {r0}\n\tstr\tr1, [r2]\n\tadd\tr5, r5, #0x1\n\tsub\tr2, r2, #0x4\n\tsub\tr3, r3, #0x1\n\tcmp\tr5, r3\n\tblt\t.L6\t@cond_branch\n.L4:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t revarr,.Lfe1-revarr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid revarr(int*,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function revarr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `revarr` — benchmark function synthetic:revarr:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:revarr:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trevarr\n\t.type\t revarr,function\n\t.thumb_func\nrevarr:\n\tpush\t{r4, r5, lr}\n\tadd\tr4, r0, #0\n\tmov\tr5, #0x0\n\tsub\tr3, r1, #0x1\n\tcmp\tr5, r3\n\tbge\t.L4\t@cond_branch\n\tlsl\tr0, r3, #0x2\n\tadd\tr2, r0, r4\n.L6:\n\tldr\tr1, [r4]\n\tldr\tr0, [r2]\n\tstmia\tr4!, {r0}\n\tstr\tr1, [r2]\n\tadd\tr5, r5, #0x1\n\tsub\tr2, r2, #0x4\n\tsub\tr3, r3, #0x1\n\tcmp\tr5, r3\n\tblt\t.L6\t@cond_branch\n.L4:\n\tpop\t{r4, r5}\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t revarr,.Lfe1-revarr\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"revarr\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name revarr # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:revarr:gcc2.7.2kmc","sym":"revarr","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","memory","store"],"loc":1,"refSource":"void revarr(int *a,int n){ int i,j,t; for(i=0,j=n-1;i:\n 0:\taddiu\tsp,sp,-8\n 4:\taddiu\ta1,a1,-1\n 8:\tblez\ta1,40 \n c:\tmove\ta3,zero\n 10:\tsll\tv0,a1,0x2\n 14:\taddu\ta2,v0,a0\n 18:\tlw\tv1,0(a0)\n 1c:\tlw\tv0,0(a2)\n 20:\taddiu\ta3,a3,1\n 24:\taddiu\ta1,a1,-1\n 28:\tsw\tv0,0(a0)\n 2c:\taddiu\ta0,a0,4\n 30:\tsw\tv1,0(a2)\n 34:\tslt\tv0,a3,a1\n 38:\tbnez\tv0,18 \n 3c:\taddiu\ta2,a2,-4\n 40:\taddiu\tsp,sp,8\n 44:\tjr\tra\n 48:\tnop\n 4c:\tnop\n","ctx":"void revarr(int*,int);","proto":{"revarr":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4def56147e8e38f9/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c revarr\n\n\nContents of section .text:\n 0000 27bdfff8 24a5ffff 18a0000d 00003821 '...$.........8!\n 0010 00051080 00443021 8c830000 8cc20000 .....D0!........\n 0020 24e70001 24a5ffff ac820000 24840004 $...$.......$...\n 0030 acc30000 00e5102a 1440fff7 24c6fffc .......*.@..$...\n 0040 27bd0008 03e00008 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"void revarr(u32 a0, s32 * a1, u32 a2) {\n s32 v0;\n s32 * v1;\n s32 * v2;\n s32 v3;\n s32 v4;\n if (a2 + -1 > 0) {\n v1 = a1;\n v3 = 0;\n v4 = a2 + -1;\n v2 = (a2 + -1 << 2) + a1;\n do {\n v0 = *v1;\n *v1 = *v2;\n *v2 = v0;\n v3 = v3 + 1;\n v4 = v4 + -1;\n v1 = v1 + 1;\n v2 = v2 + -1;\n } while (v3 < v4);\n a0 = v3 < v4;\n }\n return;\n}\n","score":16,"maxScore":20,"compileErrors":null,"breakdown":{"insert":1,"delete":1,"replace":2,"opMismatch":0,"argMismatch":12},"quality":{"score":100,"lines":24,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void revarr(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 *var_a2;\n s32 temp_v1;\n s32 var_a1;\n s32 var_a3;\n\n var_a0 = arg0;\n var_a1 = arg1 - 1;\n var_a3 = 0;\n if (var_a1 > 0) {\n var_a2 = &var_a0[var_a1];\n do {\n temp_v1 = *var_a0;\n var_a3 += 1;\n var_a1 -= 1;\n *var_a0 = *var_a2;\n var_a0 += 4;\n *var_a2 = temp_v1;\n var_a2 -= 4;\n } while (var_a3 < var_a1);\n }\n}\n","score":6,"maxScore":19,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":19,"ratio":0.3157894736842105,"kinds":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `revarr` — benchmark function synthetic:revarr:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel revarr\n addiu\t$sp, $sp, -8\n addiu\t$a1, $a1, -1\n blez\t$a1, .L40\n move\t$a3, $zero\n sll\t$v0, $a1, 0x2\n addu\t$a2, $v0, $a0\n.L18:\n lw\t$v1, 0($a0)\n lw\t$v0, 0($a2)\n addiu\t$a3, $a3, 1\n addiu\t$a1, $a1, -1\n sw\t$v0, 0($a0)\n addiu\t$a0, $a0, 4\n sw\t$v1, 0($a2)\n slt\t$v0, $a3, $a1\n bnez\t$v0, .L18\n addiu\t$a2, $a2, -4\n.L40:\n addiu\t$sp, $sp, 8\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid revarr(int*,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function revarr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `revarr` — benchmark function synthetic:revarr:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:revarr:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\taddiu\ta1,a1,-1\n 8:\tblez\ta1,40 \n c:\tmove\ta3,zero\n 10:\tsll\tv0,a1,0x2\n 14:\taddu\ta2,v0,a0\n 18:\tlw\tv1,0(a0)\n 1c:\tlw\tv0,0(a2)\n 20:\taddiu\ta3,a3,1\n 24:\taddiu\ta1,a1,-1\n 28:\tsw\tv0,0(a0)\n 2c:\taddiu\ta0,a0,4\n 30:\tsw\tv1,0(a2)\n 34:\tslt\tv0,a3,a1\n 38:\tbnez\tv0,18 \n 3c:\taddiu\ta2,a2,-4\n 40:\taddiu\tsp,sp,8\n 44:\tjr\tra\n 48:\tnop\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4def56147e8e38f9/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000004c revarr\n\n\nContents of section .text:\n 0000 27bdfff8 24a5ffff 18a0000d 00003821 '...$.........8!\n 0010 00051080 00443021 8c830000 8cc20000 .....D0!........\n 0020 24e70001 24a5ffff ac820000 24840004 $...$.......$...\n 0030 acc30000 00e5102a 1440fff7 24c6fffc .......*.@..$...\n 0040 27bd0008 03e00008 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a00000fc 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"revarr\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name revarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:revarr:ido7.1","sym":"revarr","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","memory","store"],"loc":1,"refSource":"void revarr(int *a,int n){ int i,j,t; for(i=0,j=n-1;i:\n 0:\taddiu\ta2,a1,-1\n 4:\tmove\tv1,a2\n 8:\tblez\ta2,44 \n c:\tmove\tv0,zero\n 10:\tsll\tt6,a2,0x2\n 14:\taddu\ta2,a0,t6\n 18:\tmove\ta1,a0\n 1c:\tlw\tt7,0(a2)\n 20:\tlw\ta0,0(a1)\n 24:\taddiu\tv0,v0,1\n 28:\taddiu\tv1,v1,-1\n 2c:\tslt\tat,v0,v1\n 30:\tsw\tt7,0(a1)\n 34:\taddiu\ta1,a1,4\n 38:\taddiu\ta2,a2,-4\n 3c:\tbnez\tat,1c \n 40:\tsw\ta0,4(a2)\n 44:\tjr\tra\n 48:\tnop\n 4c:\tnop\n","ctx":"void revarr(int*,int);","proto":{"revarr":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c revarr\n\n\nContents of section .text:\n 0000 24a6ffff 00c01825 18c0000e 00001025 $......%.......%\n 0010 00067080 008e3021 00802825 8ccf0000 ..p...0!..(%....\n 0020 8ca40000 24420001 2463ffff 0043082a ....$B..$c...C.*\n 0030 acaf0000 24a50004 24c6fffc 1420fff7 ....$...$.... ..\n 0040 acc40004 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8000c07e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c07e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 00000004 000001b8 p...............\n 0010 00000005 000002fc 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000038 00000264 ....... ...8...d\n 0040 00000008 0000029c 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 08080000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000004c 20200001 00000001 .......L ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 64656635 36313437 65386533 ef-4def56147e8e3\n 0130 3866392f 7265662e 63007265 76617272 8f9/ref.c.revarr\n 0140 00000000 72657661 72720000 00000000 ....revarr......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000013 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000003 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"void revarr(s32 * a0, u32 a1) {\n s32 v0;\n s32 * v1;\n s32 v2;\n s32 v3;\n if (a1 + -1 > 0) {\n v2 = 0;\n v3 = a1 + -1;\n v1 = a0 + (a1 + -1 << 2);\n do {\n v0 = *a0;\n *a0 = *v1;\n (v1 + -1)[1] = v0;\n v2 = v2 + 1;\n v3 = v3 + -1;\n a0 = a0 + 1;\n v1 = v1 + -1;\n } while (v2 < v3);\n }\n return;\n}\n","score":18,"maxScore":21,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":1,"opMismatch":0,"argMismatch":13},"quality":{"score":100,"lines":21,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void revarr(s32 *arg0, s32 arg1) {\n s32 *var_a1;\n s32 *var_a2;\n s32 temp_a0;\n s32 temp_a2;\n s32 var_v0;\n s32 var_v1;\n\n temp_a2 = arg1 - 1;\n var_v1 = temp_a2;\n var_v0 = 0;\n if (temp_a2 > 0) {\n var_a2 = &arg0[temp_a2];\n var_a1 = arg0;\n do {\n temp_a0 = *var_a1;\n var_v0 += 1;\n var_v1 -= 1;\n *var_a1 = *var_a2;\n var_a1 += 4;\n var_a2 -= 4;\n var_a2->unk4 = temp_a0;\n } while (var_v0 < var_v1);\n }\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":24,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 23: Selector requires struct/union pointer as left hand side"]},"gapSize":{"decompiler":"asmlift","score":18,"maxScore":21,"ratio":0.8571428571428571,"kinds":{"insert":2,"delete":2,"replace":1,"opMismatch":0,"argMismatch":13}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `revarr` — benchmark function synthetic:revarr:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel revarr\n addiu\t$a2, $a1, -1\n move\t$v1, $a2\n blez\t$a2, .L44\n move\t$v0, $zero\n sll\t$t6, $a2, 0x2\n addu\t$a2, $a0, $t6\n move\t$a1, $a0\n.L1c:\n lw\t$t7, 0($a2)\n lw\t$a0, 0($a1)\n addiu\t$v0, $v0, 1\n addiu\t$v1, $v1, -1\n slt\t$at, $v0, $v1\n sw\t$t7, 0($a1)\n addiu\t$a1, $a1, 4\n addiu\t$a2, $a2, -4\n bnez\t$at, .L1c\n sw\t$a0, 4($a2)\n.L44:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid revarr(int*,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function revarr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `revarr` — benchmark function synthetic:revarr:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:revarr:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\ta2,a1,-1\n 4:\tmove\tv1,a2\n 8:\tblez\ta2,44 \n c:\tmove\tv0,zero\n 10:\tsll\tt6,a2,0x2\n 14:\taddu\ta2,a0,t6\n 18:\tmove\ta1,a0\n 1c:\tlw\tt7,0(a2)\n 20:\tlw\ta0,0(a1)\n 24:\taddiu\tv0,v0,1\n 28:\taddiu\tv1,v1,-1\n 2c:\tslt\tat,v0,v1\n 30:\tsw\tt7,0(a1)\n 34:\taddiu\ta1,a1,4\n 38:\taddiu\ta2,a2,-4\n 3c:\tbnez\tat,1c \n 40:\tsw\ta0,4(a2)\n 44:\tjr\tra\n 48:\tnop\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t0000004c revarr\n\n\nContents of section .text:\n 0000 24a6ffff 00c01825 18c0000e 00001025 $......%.......%\n 0010 00067080 008e3021 00802825 8ccf0000 ..p...0!..(%....\n 0020 8ca40000 24420001 2463ffff 0043082a ....$B..$c...C.*\n 0030 acaf0000 24a50004 24c6fffc 1420fff7 ....$...$.... ..\n 0040 acc40004 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8000c07e 00000000 . .........~....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c07e 00000000 00000000 00000000 ...~............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000013 00000004 000001b8 p...............\n 0010 00000005 000002fc 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000038 00000264 ....... ...8...d\n 0040 00000008 0000029c 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 08080000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000004c 20200001 00000001 .......L ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 64656635 36313437 65386533 ef-4def56147e8e3\n 0130 3866392f 7265662e 63007265 76617272 8f9/ref.c.revarr\n 0140 00000000 72657661 72720000 00000000 ....revarr......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000013 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000003 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"revarr\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name revarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:revarr:mwcc_242_81","sym":"revarr","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","memory","store"],"loc":1,"refSource":"void revarr(int *a,int n){ int i,j,t; for(i=0,j=n-1;i:\n 0:\taddi r6,r4,-1\n 4:\tli r5,0\n 8:\tslwi r0,r6,2\n c:\tadd r4,r3,r0\n 10:\tb 34 \n 14:\tlwz r7,0(r3)\n 18:\taddi r5,r5,1\n 1c:\tlwz r0,0(r4)\n 20:\taddi r6,r6,-1\n 24:\tstw r0,0(r3)\n 28:\taddi r3,r3,4\n 2c:\tstw r7,0(r4)\n 30:\taddi r4,r4,-4\n 34:\tcmpw r5,r6\n 38:\tblt 14 \n 3c:\tblr\n","ctx":"void revarr(int*,int);","proto":{"revarr":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000040 revarr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 revarr\n\n\nContents of section .text:\n 0000 38c4ffff 38a00000 54c0103a 7c830214 8...8...T..:|...\n 0010 48000024 80e30000 38a50001 80040000 H..$....8.......\n 0020 38c6ffff 90030000 38630004 90e40000 8.......8c......\n 0030 3884fffc 7c053000 4180ffdc 4e800020 8...|.0.A...N.. \nContents of section .mwcats.text:\n 0000 02000040 00000000 ...@.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"void revarr(s32 * a0, u32 a1) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 * v3;\n s32 * v4;\n v3 = a0;\n v1 = a1 + -1;\n v2 = 0;\n v4 = a0 + (a1 + -1 << 2);\n while (v2 < v1) {\n v0 = *v3;\n *v3 = *v4;\n *v4 = v0;\n v2 = v2 + 1;\n v1 = v1 + -1;\n v3 = v3 + 1;\n v4 = v4 + -1;\n }\n return;\n}\n","score":11,"maxScore":16,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":11},"quality":{"score":100,"lines":21,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void revarr(s32 *arg0, s32 arg1) {\n s32 *var_r3;\n s32 *var_r4;\n s32 temp_r7;\n s32 var_r5;\n s32 var_r6;\n\n var_r3 = arg0;\n var_r6 = arg1 - 1;\n var_r5 = 0;\n var_r4 = &var_r3[var_r6];\nloop_2:\n if (var_r5 < var_r6) {\n temp_r7 = *var_r3;\n var_r5 += 1;\n var_r6 -= 1;\n *var_r3 = *var_r4;\n var_r3 += 4;\n *var_r4 = temp_r7;\n var_r4 -= 4;\n goto loop_2;\n }\n}\n","score":24,"maxScore":26,"compileErrors":null,"breakdown":{"insert":10,"delete":10,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":88,"lines":22,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":11,"maxScore":16,"ratio":0.6875,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":11}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `revarr` — benchmark function synthetic:revarr:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel revarr\n addi r6,r4,-1\n li r5,0\n slwi r0,r6,2\n add r4,r3,r0\n b .L34\n.L14:\n lwz r7,0(r3)\n addi r5,r5,1\n lwz r0,0(r4)\n addi r6,r6,-1\n stw r0,0(r3)\n addi r3,r3,4\n stw r7,0(r4)\n addi r4,r4,-4\n.L34:\n cmpw r5,r6\n blt .L14\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid revarr(int*,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function revarr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `revarr` — benchmark function synthetic:revarr:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:revarr:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddi r6,r4,-1\n 4:\tli r5,0\n 8:\tslwi r0,r6,2\n c:\tadd r4,r3,r0\n 10:\tb 34 \n 14:\tlwz r7,0(r3)\n 18:\taddi r5,r5,1\n 1c:\tlwz r0,0(r4)\n 20:\taddi r6,r6,-1\n 24:\tstw r0,0(r3)\n 28:\taddi r3,r3,4\n 2c:\tstw r7,0(r4)\n 30:\taddi r4,r4,-4\n 34:\tcmpw r5,r6\n 38:\tblt 14 \n 3c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000040 revarr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 revarr\n\n\nContents of section .text:\n 0000 38c4ffff 38a00000 54c0103a 7c830214 8...8...T..:|...\n 0010 48000024 80e30000 38a50001 80040000 H..$....8.......\n 0020 38c6ffff 90030000 38630004 90e40000 8.......8c......\n 0030 3884fffc 7c053000 4180ffdc 4e800020 8...|.0.A...N.. \nContents of section .mwcats.text:\n 0000 02000040 00000000 ...@.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"revarr\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name revarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotl:agbcc","sym":"rotl","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotl(unsigned x,int n){ return (x<>(32-n)); }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trotl\n\t.type\t rotl,function\n\t.thumb_func\nrotl:\n\tadd\tr3, r0, #0\n\tlsl\tr0, r0, r1\n\tmov\tr2, #0x20\n\tsub\tr2, r2, r1\n\tlsr\tr3, r3, r2\n\torr\tr0, r0, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t rotl,.Lfe1-rotl\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 rotl(u32 a0, u32 a1) {\n return a0 << a1 | a0 >> 32 - a1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 rotl(u32 arg0, s32 arg1) {\n return (arg0 << arg1) | (arg0 >> (0x20 - arg1));\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotl` — benchmark function synthetic:rotl:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trotl\n\t.type\t rotl,function\n\t.thumb_func\nrotl:\n\tadd\tr3, r0, #0\n\tlsl\tr0, r0, r1\n\tmov\tr2, #0x20\n\tsub\tr2, r2, r1\n\tlsr\tr3, r3, r2\n\torr\tr0, r0, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t rotl,.Lfe1-rotl\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotl` — benchmark function synthetic:rotl:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotl:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trotl\n\t.type\t rotl,function\n\t.thumb_func\nrotl:\n\tadd\tr3, r0, #0\n\tlsl\tr0, r0, r1\n\tmov\tr2, #0x20\n\tsub\tr2, r2, r1\n\tlsr\tr3, r3, r2\n\torr\tr0, r0, r3\n\tbx\tlr\n.Lfe1:\n\t.size\t rotl,.Lfe1-rotl\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotl # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotl:gcc2.7.2kmc","sym":"rotl","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotl(unsigned x,int n){ return (x<>(32-n)); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsllv\tv0,a0,a1\n 4:\tli\tv1,32\n 8:\tsubu\tv1,v1,a1\n c:\tsrlv\ta0,a0,v1\n 10:\tjr\tra\n 14:\tor\tv0,v0,a0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ce379de8b26be403/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 rotl\n\n\nContents of section .text:\n 0000 00a41004 24030020 00651823 00642006 ....$.. .e.#.d .\n 0010 03e00008 00441025 00000000 00000000 .....D.%........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 rotl(u32 a0, u32 a1) {\n return a0 << a1 | a0 >> 32 - a1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 rotl(u32 arg0, s32 arg1) {\n return (arg0 << arg1) | (arg0 >> (0x20 - arg1));\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotl` — benchmark function synthetic:rotl:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rotl\n sllv\t$v0, $a0, $a1\n li\t$v1, 32\n subu\t$v1, $v1, $a1\n srlv\t$a0, $a0, $v1\n jr\t$ra\n or\t$v0, $v0, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotl` — benchmark function synthetic:rotl:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotl:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsllv\tv0,a0,a1\n 4:\tli\tv1,32\n 8:\tsubu\tv1,v1,a1\n c:\tsrlv\ta0,a0,v1\n 10:\tjr\tra\n 14:\tor\tv0,v0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ce379de8b26be403/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 rotl\n\n\nContents of section .text:\n 0000 00a41004 24030020 00651823 00642006 ....$.. .e.#.d .\n 0010 03e00008 00441025 00000000 00000000 .....D.%........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotl:ido7.1","sym":"rotl","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotl(unsigned x,int n){ return (x<>(32-n)); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnegu\tt7,a1\n 4:\tsrlv\tt8,a0,t7\n 8:\tsllv\tt6,a0,a1\n c:\tjr\tra\n 10:\tor\tv0,t6,t8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 rotl\n\n\nContents of section .text:\n 0000 00057823 01e4c006 00a47004 03e00008 ..x#......p.....\n 0010 01d81025 00000000 00000000 00000000 ...%............\nContents of section .options:\n 0000 01200000 00000000 8100c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 65333739 64653862 32366265 ef-ce379de8b26be\n 0130 3430332f 7265662e 6300726f 746c0000 403/ref.c.rotl..\n 0140 726f746c 00000000 00000000 00000001 rotl............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 rotl(u32 a0, u32 a1) {\n return a0 << a1 | a0 >> -a1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 rotl(u32 arg0, s32 arg1) {\n return (arg0 << arg1) | (arg0 >> -arg1);\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotl` — benchmark function synthetic:rotl:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rotl\n negu\t$t7, $a1\n srlv\t$t8, $a0, $t7\n sllv\t$t6, $a0, $a1\n jr\t$ra\n or\t$v0, $t6, $t8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotl` — benchmark function synthetic:rotl:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotl:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnegu\tt7,a1\n 4:\tsrlv\tt8,a0,t7\n 8:\tsllv\tt6,a0,a1\n c:\tjr\tra\n 10:\tor\tv0,t6,t8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 rotl\n\n\nContents of section .text:\n 0000 00057823 01e4c006 00a47004 03e00008 ..x#......p.....\n 0010 01d81025 00000000 00000000 00000000 ...%............\nContents of section .options:\n 0000 01200000 00000000 8100c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 65333739 64653862 32366265 ef-ce379de8b26be\n 0130 3430332f 7265662e 6300726f 746c0000 403/ref.c.rotl..\n 0140 726f746c 00000000 00000000 00000001 rotl............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotl:mwcc_242_81","sym":"rotl","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotl(unsigned x,int n){ return (x<>(32-n)); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\trotlw r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 rotl\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 rotl\n\n\nContents of section .text:\n 0000 5c63203e 4e800020 \\c >N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 rotl(u32 a0, u32 a1) {\n return a0 << a1 | a0 >> 32 - a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"s32 rotl(void) {\n return M2C_ERROR(/* unknown instruction: rotlw $r3, $r3, $r4 */);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":76,"lines":3,"gotos":0,"casts":1,"unkGlue":2,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_ERROR"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotl` — benchmark function synthetic:rotl:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rotl\n rotlw r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotl` — benchmark function synthetic:rotl:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotl:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\trotlw r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 rotl\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 rotl\n\n\nContents of section .text:\n 0000 5c63203e 4e800020 \\c >N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotr:agbcc","sym":"rotr","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotr(unsigned x,int n){ return (x>>n)|(x<<(32-n)); }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trotr\n\t.type\t rotr,function\n\t.thumb_func\nrotr:\n\tror\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t rotr,.Lfe1-rotr\n","ctx":"unsigned rotr(unsigned,int);","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"u32 rotr(u32 a0, u32 a1) {\n return a0 >> a1 | a0 << 32 - a1;\n}\n","score":6,"maxScore":7,"compileErrors":null,"breakdown":{"insert":5,"delete":0,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u32 rotr(u32 arg0, s32 arg1) {\n return ROTATE_RIGHT(arg0, arg1);\n}\n","score":4,"maxScore":4,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":4,"maxScore":4,"ratio":1,"kinds":{"insert":2,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotr` — benchmark function synthetic:rotr:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trotr\n\t.type\t rotr,function\n\t.thumb_func\nrotr:\n\tror\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t rotr,.Lfe1-rotr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nunsigned rotr(unsigned,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotr` — benchmark function synthetic:rotr:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotr:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\trotr\n\t.type\t rotr,function\n\t.thumb_func\nrotr:\n\tror\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t rotr,.Lfe1-rotr\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotr # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotr:gcc2.7.2kmc","sym":"rotr","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotr(unsigned x,int n){ return (x>>n)|(x<<(32-n)); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrlv\tv0,a0,a1\n 4:\tli\tv1,32\n 8:\tsubu\tv1,v1,a1\n c:\tsllv\ta0,a0,v1\n 10:\tjr\tra\n 14:\tor\tv0,v0,a0\n\t...\n","ctx":"unsigned rotr(unsigned,int);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-9e6aaa54407f049e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 rotr\n\n\nContents of section .text:\n 0000 00a41006 24030020 00651823 00642004 ....$.. .e.#.d .\n 0010 03e00008 00441025 00000000 00000000 .....D.%........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 rotr(u32 a0, u32 a1) {\n return a0 >> a1 | a0 << 32 - a1;\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 rotr(u32 arg0, s32 arg1) {\n return (arg0 >> arg1) | (arg0 << (0x20 - arg1));\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotr` — benchmark function synthetic:rotr:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rotr\n srlv\t$v0, $a0, $a1\n li\t$v1, 32\n subu\t$v1, $v1, $a1\n sllv\t$a0, $a0, $v1\n jr\t$ra\n or\t$v0, $v0, $a0\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nunsigned rotr(unsigned,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotr` — benchmark function synthetic:rotr:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotr:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrlv\tv0,a0,a1\n 4:\tli\tv1,32\n 8:\tsubu\tv1,v1,a1\n c:\tsllv\ta0,a0,v1\n 10:\tjr\tra\n 14:\tor\tv0,v0,a0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-9e6aaa54407f049e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000018 rotr\n\n\nContents of section .text:\n 0000 00a41006 24030020 00651823 00642004 ....$.. .e.#.d .\n 0010 03e00008 00441025 00000000 00000000 .....D.%........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotr:ido7.1","sym":"rotr","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotr(unsigned x,int n){ return (x>>n)|(x<<(32-n)); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnegu\tt7,a1\n 4:\tsllv\tt8,a0,t7\n 8:\tsrlv\tt6,a0,a1\n c:\tjr\tra\n 10:\tor\tv0,t6,t8\n\t...\n","ctx":"unsigned rotr(unsigned,int);","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 rotr\n\n\nContents of section .text:\n 0000 00057823 01e4c004 00a47006 03e00008 ..x#......p.....\n 0010 01d81025 00000000 00000000 00000000 ...%............\nContents of section .options:\n 0000 01200000 00000000 8100c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 65366161 61353434 30376630 ef-9e6aaa54407f0\n 0130 3439652f 7265662e 6300726f 74720000 49e/ref.c.rotr..\n 0140 726f7472 00000000 00000000 00000001 rotr............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 rotr(u32 a0, u32 a1) {\n return a0 >> a1 | a0 << -a1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 rotr(u32 arg0, s32 arg1) {\n return (arg0 >> arg1) | (arg0 << -arg1);\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotr` — benchmark function synthetic:rotr:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rotr\n negu\t$t7, $a1\n sllv\t$t8, $a0, $t7\n srlv\t$t6, $a0, $a1\n jr\t$ra\n or\t$v0, $t6, $t8\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nunsigned rotr(unsigned,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotr` — benchmark function synthetic:rotr:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotr:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnegu\tt7,a1\n 4:\tsllv\tt8,a0,t7\n 8:\tsrlv\tt6,a0,a1\n c:\tjr\tra\n 10:\tor\tv0,t6,t8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 rotr\n\n\nContents of section .text:\n 0000 00057823 01e4c004 00a47006 03e00008 ..x#......p.....\n 0010 01d81025 00000000 00000000 00000000 ...%............\nContents of section .options:\n 0000 01200000 00000000 8100c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 65366161 61353434 30376630 ef-9e6aaa54407f0\n 0130 3439652f 7265662e 6300726f 74720000 49e/ref.c.rotr..\n 0140 726f7472 00000000 00000000 00000001 rotr............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:rotr:mwcc_242_81","sym":"rotr","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","rotate","shift"],"loc":1,"refSource":"unsigned rotr(unsigned x,int n){ return (x>>n)|(x<<(32-n)); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsubfic r0,r4,32\n 4:\trotlw r3,r3,r0\n 8:\tblr\n","ctx":"unsigned rotr(unsigned,int);","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c rotr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 rotr\n\n\nContents of section .text:\n 0000 20040020 5c63003e 4e800020 .. \\c.>N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 rotr(u32 a0, u32 a1) {\n return a0 >> a1 | a0 << 32 - a1;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"declined","source":"u32 rotr(u32 arg0, s32 arg1) {\n return M2C_ERROR(/* unknown instruction: rotlw $r3, $r3, $r0 */);\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":76,"lines":3,"gotos":0,"casts":0,"unkGlue":2,"rawMem":0,"addrDeref":0},"errorMarkers":["M2C_ERROR"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `rotr` — benchmark function synthetic:rotr:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel rotr\n subfic r0,r4,32\n rotlw r3,r3,r0\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nunsigned rotr(unsigned,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function rotr # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `rotr` — benchmark function synthetic:rotr:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:rotr:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsubfic r0,r4,32\n 4:\trotlw r3,r3,r0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c rotr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 rotr\n\n\nContents of section .text:\n 0000 20040020 5c63003e 4e800020 .. \\c.>N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name rotr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:selnz:agbcc","sym":"selnz","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","ternary","select"],"loc":1,"refSource":"int selnz(int c,int a,int b){ return c?a:b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tselnz\n\t.type\t selnz,function\n\t.thumb_func\nselnz:\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr2, r1, #0\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t selnz,.Lfe1-selnz\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 selnz(u32 a0, u32 a1, u32 a2) {\n if (a0 != 0) a2 = a1;\n return a2;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 selnz(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r2;\n\n var_r2 = arg2;\n if (arg0 != 0) {\n var_r2 = arg1;\n }\n return var_r2;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `selnz` — benchmark function synthetic:selnz:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tselnz\n\t.type\t selnz,function\n\t.thumb_func\nselnz:\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr2, r1, #0\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t selnz,.Lfe1-selnz\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function selnz # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `selnz` — benchmark function synthetic:selnz:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:selnz:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tselnz\n\t.type\t selnz,function\n\t.thumb_func\nselnz:\n\tcmp\tr0, #0\n\tbeq\t.L3\t@cond_branch\n\tadd\tr2, r1, #0\n.L3:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t selnz,.Lfe1-selnz\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name selnz # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:selnz:gcc2.7.2kmc","sym":"selnz","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","ternary","select"],"loc":1,"refSource":"int selnz(int c,int a,int b){ return c?a:b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,c \n 4:\tmove\tv0,a2\n 8:\tmove\tv0,a1\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-38312a0ced0198e5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 selnz\n\n\nContents of section .text:\n 0000 10800002 00c01021 00a01021 03e00008 .......!...!....\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 selnz(u32 a0, u32 a1, u32 a2) {\n if (a0 != 0) a2 = a1;\n return a2;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 selnz(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_v0;\n\n var_v0 = arg2;\n if (arg0 != 0) {\n var_v0 = arg1;\n }\n return var_v0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `selnz` — benchmark function synthetic:selnz:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel selnz\n beqz\t$a0, .Lc\n move\t$v0, $a2\n move\t$v0, $a1\n.Lc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function selnz # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `selnz` — benchmark function synthetic:selnz:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:selnz:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,c \n 4:\tmove\tv0,a2\n 8:\tmove\tv0,a1\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-38312a0ced0198e5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 selnz\n\n\nContents of section .text:\n 0000 10800002 00c01021 00a01021 03e00008 .......!...!....\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name selnz # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:selnz:ido7.1","sym":"selnz","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","ternary","select"],"loc":1,"refSource":"int selnz(int c,int a,int b){ return c?a:b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,10 \n 4:\tmove\tv1,a2\n 8:\tjr\tra\n c:\tmove\tv0,a1\n 10:\tjr\tra\n 14:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 selnz\n\n\nContents of section .text:\n 0000 10800003 00c01825 03e00008 00a01025 .......%.......%\n 0010 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8000007c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 38333132 61306365 64303139 ef-38312a0ced019\n 0130 3865352f 7265662e 63007365 6c6e7a00 8e5/ref.c.selnz.\n 0140 73656c6e 7a000000 00000000 00000001 selnz...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"u32 selnz(u32 a0, u32 a1, u32 a2) {\n if (a0 != 0) {\n return a1;\n } else {\n return a2;\n }\n}\n","score":2,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 selnz(s32 arg0, s32 arg1, s32 arg2) {\n if (arg0 != 0) {\n return arg1;\n }\n return arg2;\n}\n","score":2,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":2,"maxScore":6,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":0,"replace":1,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `selnz` — benchmark function synthetic:selnz:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel selnz\n beqz\t$a0, .L10\n move\t$v1, $a2\n jr\t$ra\n move\t$v0, $a1\n.L10:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function selnz # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `selnz` — benchmark function synthetic:selnz:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:selnz:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,10 \n 4:\tmove\tv1,a2\n 8:\tjr\tra\n c:\tmove\tv0,a1\n 10:\tjr\tra\n 14:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000018 selnz\n\n\nContents of section .text:\n 0000 10800003 00c01825 03e00008 00a01025 .......%.......%\n 0010 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8000007c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000006 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 05000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000018 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 38333132 61306365 64303139 ef-38312a0ced019\n 0130 3865352f 7265662e 63007365 6c6e7a00 8e5/ref.c.selnz.\n 0140 73656c6e 7a000000 00000000 00000001 selnz...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000006 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name selnz # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:selnz:mwcc_242_81","sym":"selnz","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","ternary","select"],"loc":1,"refSource":"int selnz(int c,int a,int b){ return c?a:b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tbeq c \n 8:\tmr r5,r4\n c:\tmr r3,r5\n 10:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 selnz\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 selnz\n\n\nContents of section .text:\n 0000 2c030000 41820008 7c852378 7ca32b78 ,...A...|.#x|.+x\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 selnz(s32 a0, s32 a1, s32 a2) {\n if (a0 != 0) a2 = a1;\n return a2;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 selnz(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_r5;\n\n var_r5 = arg2;\n if (arg0 != 0) {\n var_r5 = arg1;\n }\n return var_r5;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `selnz` — benchmark function synthetic:selnz:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel selnz\n cmpwi r3,0\n beq .Lc\n mr r5,r4\n.Lc:\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function selnz # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `selnz` — benchmark function synthetic:selnz:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:selnz:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tbeq c \n 8:\tmr r5,r4\n c:\tmr r3,r5\n 10:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 selnz\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 selnz\n\n\nContents of section .text:\n 0000 2c030000 41820008 7c852378 7ca32b78 ,...A...|.#x|.+x\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name selnz # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setbit:agbcc","sym":"setbit","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int setbit(int x,int n){ return x | (1< in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsetbit\n\t.type\t setbit,function\n\t.thumb_func\nsetbit:\n\tadd\tr2, r0, #0\n\tmov\tr0, #0x1\n\tlsl\tr0, r0, r1\n\torr\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t setbit,.Lfe1-setbit\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setbit` — benchmark function synthetic:setbit:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setbit:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsetbit\n\t.type\t setbit,function\n\t.thumb_func\nsetbit:\n\tadd\tr2, r0, #0\n\tmov\tr0, #0x1\n\tlsl\tr0, r0, r1\n\torr\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t setbit,.Lfe1-setbit\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name setbit # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setbit:gcc2.7.2kmc","sym":"setbit","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int setbit(int x,int n){ return x | (1<:\n 0:\tli\tv0,1\n 4:\tsllv\tv0,v0,a1\n 8:\tjr\tra\n c:\tor\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-20b42231b2c3f921/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 setbit\n\n\nContents of section .text:\n 0000 24020001 00a21004 03e00008 00821025 $..............%\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 setbit(u32 a0, u32 a1) {\n return a0 | 1 << a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 setbit(s32 arg0, s32 arg1) {\n return arg0 | (1 << arg1);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `setbit` — benchmark function synthetic:setbit:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel setbit\n li\t$v0, 1\n sllv\t$v0, $v0, $a1\n jr\t$ra\n or\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setbit` — benchmark function synthetic:setbit:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setbit:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tsllv\tv0,v0,a1\n 8:\tjr\tra\n c:\tor\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-20b42231b2c3f921/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 setbit\n\n\nContents of section .text:\n 0000 24020001 00a21004 03e00008 00821025 $..............%\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name setbit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setbit:ido7.1","sym":"setbit","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int setbit(int x,int n){ return x | (1<:\n 0:\tli\tt6,1\n 4:\tsllv\tt7,t6,a1\n 8:\tjr\tra\n c:\tor\tv0,t7,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 setbit\n\n\nContents of section .text:\n 0000 240e0001 00ae7804 03e00008 01e41025 $.....x........%\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 30623432 32333162 32633366 ef-20b42231b2c3f\n 0130 3932312f 7265662e 63007365 74626974 921/ref.c.setbit\n 0140 00000000 73657462 69740000 00000000 ....setbit......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 setbit(u32 a0, u32 a1) {\n return 1 << a1 | a0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 setbit(s32 arg0, s32 arg1) {\n return (1 << arg1) | arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `setbit` — benchmark function synthetic:setbit:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel setbit\n li\t$t6, 1\n sllv\t$t7, $t6, $a1\n jr\t$ra\n or\t$v0, $t7, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setbit` — benchmark function synthetic:setbit:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setbit:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tt6,1\n 4:\tsllv\tt7,t6,a1\n 8:\tjr\tra\n c:\tor\tv0,t7,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 setbit\n\n\nContents of section .text:\n 0000 240e0001 00ae7804 03e00008 01e41025 $.....x........%\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 30623432 32333162 32633366 ef-20b42231b2c3f\n 0130 3932312f 7265662e 63007365 74626974 921/ref.c.setbit\n 0140 00000000 73657462 69740000 00000000 ....setbit......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name setbit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setbit:mwcc_242_81","sym":"setbit","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int setbit(int x,int n){ return x | (1<:\n 0:\tli r0,1\n 4:\tslw r0,r0,r4\n 8:\tor r3,r3,r0\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 setbit\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 setbit\n\n\nContents of section .text:\n 0000 38000001 7c002030 7c630378 4e800020 8...|. 0|c.xN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 setbit(u32 a0, u32 a1) {\n return a0 | 1 << a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 setbit(s32 arg0, s32 arg1) {\n return arg0 | (1 << arg1);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `setbit` — benchmark function synthetic:setbit:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel setbit\n li r0,1\n slw r0,r0,r4\n or r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setbit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setbit` — benchmark function synthetic:setbit:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setbit:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r0,1\n 4:\tslw r0,r0,r4\n 8:\tor r3,r3,r0\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 setbit\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 setbit\n\n\nContents of section .text:\n 0000 38000001 7c002030 7c630378 4e800020 8...|. 0|c.xN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name setbit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setfield:agbcc","sym":"setfield","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nvoid setfield(struct S *s,int v){ s->a=v; s->c=v; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsetfield\n\t.type\t setfield,function\n\t.thumb_func\nsetfield:\n\tstr\tr1, [r0]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t setfield,.Lfe1-setfield\n","ctx":"struct S; void setfield(struct S*,int);","proto":{"setfield":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void setfield(s32 * a0, u32 a1) {\n *a0 = a1;\n a0[2] = a1;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void setfield(struct S *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n arg0->unk8 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:2: warning: `struct S' declared inside parameter list","/cand.c.pp.c:2: warning: its scope is only this definition or declaration,","/cand.c.pp.c:2: warning: which is probably not what you want.","/cand.c.pp.c:3: dereferencing pointer to incomplete type","/cand.c.pp.c:4: dereferencing pointer to incomplete type"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `setfield` — benchmark function synthetic:setfield:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsetfield\n\t.type\t setfield,function\n\t.thumb_func\nsetfield:\n\tstr\tr1, [r0]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t setfield,.Lfe1-setfield\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void setfield(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setfield # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setfield` — benchmark function synthetic:setfield:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setfield:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsetfield\n\t.type\t setfield,function\n\t.thumb_func\nsetfield:\n\tstr\tr1, [r0]\n\tstr\tr1, [r0, #0x8]\n\tbx\tlr\n.Lfe1:\n\t.size\t setfield,.Lfe1-setfield\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"setfield\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name setfield # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setfield:gcc2.7.2kmc","sym":"setfield","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nvoid setfield(struct S *s,int v){ s->a=v; s->c=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\tjr\tra\n 8:\tsw\ta1,8(a0)\n c:\tnop\n","ctx":"struct S; void setfield(struct S*,int);","proto":{"setfield":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-7feb24c1adf349a2/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c setfield\n\n\nContents of section .text:\n 0000 ac850000 03e00008 ac850008 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void setfield(s32 * a0, u32 a1) {\n *a0 = a1;\n a0[2] = a1;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void setfield(struct S *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n arg0->unk8 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: dereferencing pointer to incomplete type","/cand.c:4: dereferencing pointer to incomplete type"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `setfield` — benchmark function synthetic:setfield:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel setfield\n sw\t$a1, 0($a0)\n jr\t$ra\n sw\t$a1, 8($a0)\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void setfield(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setfield # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setfield` — benchmark function synthetic:setfield:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setfield:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\tjr\tra\n 8:\tsw\ta1,8(a0)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-7feb24c1adf349a2/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c setfield\n\n\nContents of section .text:\n 0000 ac850000 03e00008 ac850008 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"setfield\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name setfield # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setfield:ido7.1","sym":"setfield","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nvoid setfield(struct S *s,int v){ s->a=v; s->c=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\tjr\tra\n 8:\tsw\ta1,8(a0)\n c:\tnop\n","ctx":"struct S; void setfield(struct S*,int);","proto":{"setfield":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c setfield\n\n\nContents of section .text:\n 0000 ac850000 03e00008 ac850008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002c0 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 0000000c 0000025c 00000001 00000268 .......\\.......h\n 0050 00000000 00000000 00000001 000002b0 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 66656232 34633161 64663334 ef-7feb24c1adf34\n 0130 3961322f 7265662e 63007365 74666965 9a2/ref.c.setfie\n 0140 6c640000 73657466 69656c64 00000000 ld..setfield....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 00000003 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void setfield(s32 * a0, u32 a1) {\n *a0 = a1;\n a0[2] = a1;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void setfield(struct S *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n arg0->unk8 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: 'unk0' undefined; reoccurrences will not be reported.","cfe: Error: /cand.c, line 3: member of structure or union required","cfe: Error: /cand.c, line 4: 'unk8' undefined; reoccurrences will not be reported.","cfe: Error: /cand.c, line 4: member of structure or union required"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `setfield` — benchmark function synthetic:setfield:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel setfield\n sw\t$a1, 0($a0)\n jr\t$ra\n sw\t$a1, 8($a0)\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void setfield(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setfield # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setfield` — benchmark function synthetic:setfield:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setfield:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta1,0(a0)\n 4:\tjr\tra\n 8:\tsw\ta1,8(a0)\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c setfield\n\n\nContents of section .text:\n 0000 ac850000 03e00008 ac850008 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002c0 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 0000000c 0000025c 00000001 00000268 .......\\.......h\n 0050 00000000 00000000 00000001 000002b0 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 66656232 34633161 64663334 ef-7feb24c1adf34\n 0130 3961322f 7265662e 63007365 74666965 9a2/ref.c.setfie\n 0140 6c640000 73657466 69656c64 00000000 ld..setfield....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 00000003 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"setfield\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name setfield # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:setfield:mwcc_242_81","sym":"setfield","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nvoid setfield(struct S *s,int v){ s->a=v; s->c=v; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,0(r3)\n 4:\tstw r4,8(r3)\n 8:\tblr\n","ctx":"struct S; void setfield(struct S*,int);","proto":{"setfield":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c setfield\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 setfield\n\n\nContents of section .text:\n 0000 90830000 90830008 4e800020 ........N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void setfield(s32 * a0, u32 a1) {\n *a0 = a1;\n a0[2] = a1;\n return;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void setfield(struct S *arg0, s32 arg1) {\n arg0->unk0 = arg1;\n arg0->unk8 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":5,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^^^","# illegal use of incomplete struct/union/class 'struct S'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `setfield` — benchmark function synthetic:setfield:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel setfield\n stw r4,0(r3)\n stw r4,8(r3)\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void setfield(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function setfield # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `setfield` — benchmark function synthetic:setfield:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:setfield:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,0(r3)\n 4:\tstw r4,8(r3)\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c setfield\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 setfield\n\n\nContents of section .text:\n 0000 90830000 90830008 4e800020 ........N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"setfield\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name setfield # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sextb:agbcc","sym":"sextb","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","sign-extend"],"loc":1,"refSource":"int sextb(s8 x){ return x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsextb\n\t.type\t sextb,function\n\t.thumb_func\nsextb:\n\tlsl\tr0, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t sextb,.Lfe1-sextb\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sextb(u32 a0) {\n return (s8)a0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 sextb(s8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sextb` — benchmark function synthetic:sextb:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsextb\n\t.type\t sextb,function\n\t.thumb_func\nsextb:\n\tlsl\tr0, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t sextb,.Lfe1-sextb\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sextb` — benchmark function synthetic:sextb:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sextb:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsextb\n\t.type\t sextb,function\n\t.thumb_func\nsextb:\n\tlsl\tr0, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t sextb,.Lfe1-sextb\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sextb # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sextb:gcc2.7.2kmc","sym":"sextb","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","sign-extend"],"loc":1,"refSource":"int sextb(s8 x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x18\n 4:\tjr\tra\n 8:\tsra\tv0,v0,0x18\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4332b5d6e0776f93/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c sextb\n\n\nContents of section .text:\n 0000 00041600 03e00008 00021603 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 sextb(s32 a0) {\n return a0 << 24 >> 24;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 sextb(s8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sextb` — benchmark function synthetic:sextb:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sextb\n sll\t$v0, $a0, 0x18\n jr\t$ra\n sra\t$v0, $v0, 0x18\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sextb` — benchmark function synthetic:sextb:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sextb:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x18\n 4:\tjr\tra\n 8:\tsra\tv0,v0,0x18\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-4332b5d6e0776f93/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c sextb\n\n\nContents of section .text:\n 0000 00041600 03e00008 00021603 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sextb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sextb:ido7.1","sym":"sextb","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","sign-extend"],"loc":1,"refSource":"int sextb(s8 x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsll\ta0,a0,0x18\n 8:\tjr\tra\n c:\tsra\tv0,a0,0x18\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 sextb\n\n\nContents of section .text:\n 0000 afa40000 00042600 03e00008 00041603 ......&.........\nContents of section .options:\n 0000 01200000 00000000 a0000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 33333262 35643665 30373736 ef-4332b5d6e0776\n 0130 6639332f 7265662e 63007365 78746200 f93/ref.c.sextb.\n 0140 73657874 62000000 00000000 00000001 sextb...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 sextb(s32 a0) {\n return a0 << 24 >> 24;\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 sextb(s8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sextb` — benchmark function synthetic:sextb:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sextb\n sw\t$a0, 0($sp)\n sll\t$a0, $a0, 0x18\n jr\t$ra\n sra\t$v0, $a0, 0x18\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sextb` — benchmark function synthetic:sextb:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sextb:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsll\ta0,a0,0x18\n 8:\tjr\tra\n c:\tsra\tv0,a0,0x18\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 sextb\n\n\nContents of section .text:\n 0000 afa40000 00042600 03e00008 00041603 ......&.........\nContents of section .options:\n 0000 01200000 00000000 a0000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 33333262 35643665 30373736 ef-4332b5d6e0776\n 0130 6639332f 7265662e 63007365 78746200 f93/ref.c.sextb.\n 0140 73657874 62000000 00000000 00000001 sextb...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000004 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sextb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sextb:mwcc_242_81","sym":"sextb","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","sign-extend"],"loc":1,"refSource":"int sextb(s8 x){ return x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\textsb r3,r3\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sextb\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sextb\n\n\nContents of section .text:\n 0000 7c630774 4e800020 |c.tN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sextb(u32 a0) {\n return (s8)a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s8 sextb(s8 arg0) {\n return arg0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sextb` — benchmark function synthetic:sextb:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sextb\n extsb r3,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sextb` — benchmark function synthetic:sextb:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sextb:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\textsb r3,r3\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sextb\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sextb\n\n\nContents of section .text:\n 0000 7c630774 4e800020 |c.tN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sextb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sfield:agbcc","sym":"sfield","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nint sfield(struct S*s){ return s->b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsfield\n\t.type\t sfield,function\n\t.thumb_func\nsfield:\n\tldr\tr0, [r0, #0x4]\n\tbx\tlr\n.Lfe1:\n\t.size\t sfield,.Lfe1-sfield\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sfield(s32 * a0) {\n return a0[1];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 sfield(void *arg0) {\n return arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:3: warning: dereferencing `void *' pointer","/cand.c.pp.c:3: request for member `unk4' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sfield` — benchmark function synthetic:sfield:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsfield\n\t.type\t sfield,function\n\t.thumb_func\nsfield:\n\tldr\tr0, [r0, #0x4]\n\tbx\tlr\n.Lfe1:\n\t.size\t sfield,.Lfe1-sfield\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sfield # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sfield` — benchmark function synthetic:sfield:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sfield:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsfield\n\t.type\t sfield,function\n\t.thumb_func\nsfield:\n\tldr\tr0, [r0, #0x4]\n\tbx\tlr\n.Lfe1:\n\t.size\t sfield,.Lfe1-sfield\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sfield # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sfield:gcc2.7.2kmc","sym":"sfield","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nint sfield(struct S*s){ return s->b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,4(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-efab4c56c3bcf6d0/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 sfield\n\n\nContents of section .text:\n 0000 03e00008 8c820004 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sfield(s32 * a0) {\n return a0[1];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 sfield(void *arg0) {\n return arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: request for member `unk4' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sfield` — benchmark function synthetic:sfield:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sfield\n jr\t$ra\n lw\t$v0, 4($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sfield # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sfield` — benchmark function synthetic:sfield:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sfield:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,4(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-efab4c56c3bcf6d0/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 sfield\n\n\nContents of section .text:\n 0000 03e00008 8c820004 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sfield # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sfield:ido7.1","sym":"sfield","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","field"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nint sfield(struct S*s){ return s->b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,4(a0)\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 sfield\n\n\nContents of section .text:\n 0000 03e00008 8c820004 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 66616234 63353663 33626366 ef-efab4c56c3bcf\n 0130 3664302f 7265662e 63007366 69656c64 6d0/ref.c.sfield\n 0140 00000000 73666965 6c640000 00000000 ....sfield......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sfield(s32 * a0) {\n return a0[1];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 sfield(void *arg0) {\n return arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sfield` — benchmark function synthetic:sfield:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sfield\n jr\t$ra\n lw\t$v0, 4($a0)\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sfield # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sfield` — benchmark function synthetic:sfield:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sfield:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tlw\tv0,4(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 sfield\n\n\nContents of section .text:\n 0000 03e00008 8c820004 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 66616234 63353663 33626366 ef-efab4c56c3bcf\n 0130 3664302f 7265662e 63007366 69656c64 6d0/ref.c.sfield\n 0140 00000000 73666965 6c640000 00000000 ....sfield......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sfield # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sfield:mwcc_242_81","sym":"sfield","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["struct","field"],"loc":2,"refSource":"struct S{int a;int b;int c;};\nint sfield(struct S*s){ return s->b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r3,4(r3)\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sfield\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sfield\n\n\nContents of section .text:\n 0000 80630004 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sfield(s32 * a0) {\n return a0[1];\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 sfield(void *arg0) {\n return arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sfield` — benchmark function synthetic:sfield:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sfield\n lwz r3,4(r3)\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sfield # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sfield` — benchmark function synthetic:sfield:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sfield:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r3,4(r3)\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sfield\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sfield\n\n\nContents of section .text:\n 0000 80630004 4e800020 .c..N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sfield # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shl:agbcc","sym":"shl","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int shl(int a,int b){ return a< in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshl\n\t.type\t shl,function\n\t.thumb_func\nshl:\n\tlsl\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shl,.Lfe1-shl\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shl` — benchmark function synthetic:shl:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shl:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshl\n\t.type\t shl,function\n\t.thumb_func\nshl:\n\tlsl\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shl,.Lfe1-shl\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name shl # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shl:gcc2.7.2kmc","sym":"shl","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int shl(int a,int b){ return a<:\n 0:\tjr\tra\n 4:\tsllv\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-60c219d8b2e26e95/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 shl\n\n\nContents of section .text:\n 0000 03e00008 00a41004 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 shl(u32 a0, u32 a1) {\n return a0 << a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 shl(s32 arg0, s32 arg1) {\n return arg0 << arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shl` — benchmark function synthetic:shl:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shl\n jr\t$ra\n sllv\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shl` — benchmark function synthetic:shl:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shl:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsllv\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-60c219d8b2e26e95/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 shl\n\n\nContents of section .text:\n 0000 03e00008 00a41004 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name shl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shl:ido7.1","sym":"shl","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int shl(int a,int b){ return a<:\n 0:\tjr\tra\n 4:\tsllv\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 shl\n\n\nContents of section .text:\n 0000 03e00008 00a41004 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 30633231 39643862 32653236 ef-60c219d8b2e26\n 0130 6539352f 7265662e 63007368 6c000000 e95/ref.c.shl...\n 0140 73686c00 00000000 00000001 00000000 shl.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 shl(u32 a0, u32 a1) {\n return a0 << a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 shl(s32 arg0, s32 arg1) {\n return arg0 << arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shl` — benchmark function synthetic:shl:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shl\n jr\t$ra\n sllv\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shl` — benchmark function synthetic:shl:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shl:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsllv\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 shl\n\n\nContents of section .text:\n 0000 03e00008 00a41004 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 30633231 39643862 32653236 ef-60c219d8b2e26\n 0130 6539352f 7265662e 63007368 6c000000 e95/ref.c.shl...\n 0140 73686c00 00000000 00000001 00000000 shl.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name shl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shl:mwcc_242_81","sym":"shl","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int shl(int a,int b){ return a<:\n 0:\tslw r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 shl\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 shl\n\n\nContents of section .text:\n 0000 7c632030 4e800020 |c 0N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 shl(u32 a0, u32 a1) {\n return a0 << a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 shl(s32 arg0, s32 arg1) {\n return arg0 << arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shl` — benchmark function synthetic:shl:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shl\n slw r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shl # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shl` — benchmark function synthetic:shl:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shl:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslw r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 shl\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 shl\n\n\nContents of section .text:\n 0000 7c632030 4e800020 |c 0N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name shl # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shrs:agbcc","sym":"shrs","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift","signed"],"loc":1,"refSource":"int shrs(int a,int b){ return a>>b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshrs\n\t.type\t shrs,function\n\t.thumb_func\nshrs:\n\tasr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shrs,.Lfe1-shrs\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 shrs(s32 a0, s32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 shrs(s32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shrs` — benchmark function synthetic:shrs:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshrs\n\t.type\t shrs,function\n\t.thumb_func\nshrs:\n\tasr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shrs,.Lfe1-shrs\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shrs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shrs` — benchmark function synthetic:shrs:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shrs:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshrs\n\t.type\t shrs,function\n\t.thumb_func\nshrs:\n\tasr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shrs,.Lfe1-shrs\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name shrs # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shrs:gcc2.7.2kmc","sym":"shrs","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift","signed"],"loc":1,"refSource":"int shrs(int a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrav\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1e7087ba08828cba/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 shrs\n\n\nContents of section .text:\n 0000 03e00008 00a41007 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 shrs(s32 a0, s32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 shrs(s32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shrs` — benchmark function synthetic:shrs:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shrs\n jr\t$ra\n srav\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shrs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shrs` — benchmark function synthetic:shrs:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shrs:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrav\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1e7087ba08828cba/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 shrs\n\n\nContents of section .text:\n 0000 03e00008 00a41007 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name shrs # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shrs:ido7.1","sym":"shrs","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift","signed"],"loc":1,"refSource":"int shrs(int a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrav\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 shrs\n\n\nContents of section .text:\n 0000 03e00008 00a41007 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 65373038 37626130 38383238 ef-1e7087ba08828\n 0130 6362612f 7265662e 63007368 72730000 cba/ref.c.shrs..\n 0140 73687273 00000000 00000000 00000001 shrs............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 shrs(s32 a0, s32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 shrs(s32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shrs` — benchmark function synthetic:shrs:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shrs\n jr\t$ra\n srav\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shrs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shrs` — benchmark function synthetic:shrs:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shrs:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrav\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 shrs\n\n\nContents of section .text:\n 0000 03e00008 00a41007 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 65373038 37626130 38383238 ef-1e7087ba08828\n 0130 6362612f 7265662e 63007368 72730000 cba/ref.c.shrs..\n 0140 73687273 00000000 00000000 00000001 shrs............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name shrs # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shrs:mwcc_242_81","sym":"shrs","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift","signed"],"loc":1,"refSource":"int shrs(int a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsraw r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 shrs\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 shrs\n\n\nContents of section .text:\n 0000 7c632630 4e800020 |c&0N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 shrs(s32 a0, s32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 shrs(s32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shrs` — benchmark function synthetic:shrs:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shrs\n sraw r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shrs # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shrs` — benchmark function synthetic:shrs:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shrs:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsraw r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 shrs\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 shrs\n\n\nContents of section .text:\n 0000 7c632630 4e800020 |c&0N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name shrs # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shru:agbcc","sym":"shru","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned shru(unsigned a,int b){ return a>>b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshru\n\t.type\t shru,function\n\t.thumb_func\nshru:\n\tlsr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shru,.Lfe1-shru\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 shru(u32 a0, u32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 shru(u32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shru` — benchmark function synthetic:shru:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshru\n\t.type\t shru,function\n\t.thumb_func\nshru:\n\tlsr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shru,.Lfe1-shru\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shru # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shru` — benchmark function synthetic:shru:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shru:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tshru\n\t.type\t shru,function\n\t.thumb_func\nshru:\n\tlsr\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t shru,.Lfe1-shru\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name shru # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shru:gcc2.7.2kmc","sym":"shru","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned shru(unsigned a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrlv\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-cf134ea7cde7356c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 shru\n\n\nContents of section .text:\n 0000 03e00008 00a41006 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 shru(u32 a0, u32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 shru(u32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shru` — benchmark function synthetic:shru:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shru\n jr\t$ra\n srlv\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shru # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shru` — benchmark function synthetic:shru:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shru:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrlv\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-cf134ea7cde7356c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 shru\n\n\nContents of section .text:\n 0000 03e00008 00a41006 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name shru # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shru:ido7.1","sym":"shru","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned shru(unsigned a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrlv\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 shru\n\n\nContents of section .text:\n 0000 03e00008 00a41006 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 66313334 65613763 64653733 ef-cf134ea7cde73\n 0130 3536632f 7265662e 63007368 72750000 56c/ref.c.shru..\n 0140 73687275 00000000 00000000 00000001 shru............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 shru(u32 a0, u32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 shru(u32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shru` — benchmark function synthetic:shru:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shru\n jr\t$ra\n srlv\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shru # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shru` — benchmark function synthetic:shru:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shru:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsrlv\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 shru\n\n\nContents of section .text:\n 0000 03e00008 00a41006 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 66313334 65613763 64653733 ef-cf134ea7cde73\n 0130 3536632f 7265662e 63007368 72750000 56c/ref.c.shru..\n 0140 73687275 00000000 00000000 00000001 shru............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name shru # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:shru:mwcc_242_81","sym":"shru","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"unsigned shru(unsigned a,int b){ return a>>b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrw r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 shru\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 shru\n\n\nContents of section .text:\n 0000 7c632430 4e800020 |c$0N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 shru(u32 a0, u32 a1) {\n return a0 >> a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 shru(u32 arg0, s32 arg1) {\n return arg0 >> arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `shru` — benchmark function synthetic:shru:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel shru\n srw r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function shru # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `shru` — benchmark function synthetic:shru:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:shru:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrw r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 shru\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 shru\n\n\nContents of section .text:\n 0000 7c632430 4e800020 |c$0N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name shru # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sign:agbcc","sym":"sign","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int sign(int x){ if(x>0)return 1; if(x<0)return -1; return 0; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsign\n\t.type\t sign,function\n\t.thumb_func\nsign:\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L5\n.L3:\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L5\n.L4:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t sign,.Lfe1-sign\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 sign(s32 a0) {\n s32 v0;\n if (a0 <= 0) {\n if (a0 < 0) {\n v0 = -1;\n } else {\n v0 = 0;\n }\n } else {\n v0 = 1;\n }\n return v0;\n}\n","score":8,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":2,"opMismatch":2,"argMismatch":3},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sign(s32 arg0) {\n if (arg0 > 0) {\n return 1;\n }\n if (arg0 >= 0) {\n return 0;\n }\n return -1;\n}\n","score":6,"maxScore":13,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":6,"maxScore":13,"ratio":0.46153846153846156,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sign` — benchmark function synthetic:sign:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsign\n\t.type\t sign,function\n\t.thumb_func\nsign:\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L5\n.L3:\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L5\n.L4:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t sign,.Lfe1-sign\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sign # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sign` — benchmark function synthetic:sign:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sign:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsign\n\t.type\t sign,function\n\t.thumb_func\nsign:\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr0, #0x1\n\tb\t.L5\n.L3:\n\tcmp\tr0, #0\n\tblt\t.L4\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L5\n.L4:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L5:\n\tbx\tlr\n.Lfe1:\n\t.size\t sign,.Lfe1-sign\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sign # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sign:gcc2.7.2kmc","sym":"sign","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int sign(int x){ if(x>0)return 1; if(x<0)return -1; return 0; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgtz\ta0,c \n 4:\tli\tv0,1\n 8:\tsra\tv0,a0,0x1f\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-cf4f7ce4ee5f0af0/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 sign\n\n\nContents of section .text:\n 0000 1c800002 24020001 000417c3 03e00008 ....$...........\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 sign(s32 a0) {\n s32 v0;\n if (a0 > 0) {\n v0 = 1;\n } else {\n v0 = a0 >> 31;\n }\n return v0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sign(s32 arg0) {\n s32 var_v0;\n\n var_v0 = 1;\n if (arg0 <= 0) {\n var_v0 = arg0 >> 0x1F;\n }\n return var_v0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sign` — benchmark function synthetic:sign:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sign\n bgtz\t$a0, .Lc\n li\t$v0, 1\n sra\t$v0, $a0, 0x1f\n.Lc:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sign # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sign` — benchmark function synthetic:sign:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sign:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbgtz\ta0,c \n 4:\tli\tv0,1\n 8:\tsra\tv0,a0,0x1f\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-cf4f7ce4ee5f0af0/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 sign\n\n\nContents of section .text:\n 0000 1c800002 24020001 000417c3 03e00008 ....$...........\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sign # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sign:ido7.1","sym":"sign","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int sign(int x){ if(x>0)return 1; if(x<0)return -1; return 0; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,10 \n 4:\tnop\n 8:\tjr\tra\n c:\tli\tv0,1\n 10:\tbgez\ta0,20 \n 14:\tmove\tv0,zero\n 18:\tjr\tra\n 1c:\tli\tv0,-1\n 20:\tjr\tra\n 24:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 sign\n\n\nContents of section .text:\n 0000 18800003 00000000 03e00008 24020001 ............$...\n 0010 04810003 00001025 03e00008 2402ffff .......%....$...\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 66346637 63653465 65356630 ef-cf4f7ce4ee5f0\n 0130 6166302f 7265662e 63007369 676e0000 af0/ref.c.sign..\n 0140 7369676e 00000000 00000000 00000001 sign............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000a 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 sign(s32 a0) {\n if (a0 > 0) {\n return 1;\n } else {\n if (a0 < 0) {\n return -1;\n } else {\n return 0;\n }\n }\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sign(s32 arg0) {\n if (arg0 > 0) {\n return 1;\n }\n if (arg0 < 0) {\n return -1;\n }\n return 0;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":9,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sign` — benchmark function synthetic:sign:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sign\n blez\t$a0, .L10\n nop\n jr\t$ra\n li\t$v0, 1\n.L10:\n bgez\t$a0, .L20\n move\t$v0, $zero\n jr\t$ra\n li\t$v0, -1\n.L20:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sign # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sign` — benchmark function synthetic:sign:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sign:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tblez\ta0,10 \n 4:\tnop\n 8:\tjr\tra\n c:\tli\tv0,1\n 10:\tbgez\ta0,20 \n 14:\tmove\tv0,zero\n 18:\tjr\tra\n 1c:\tli\tv0,-1\n 20:\tjr\tra\n 24:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t00000028 sign\n\n\nContents of section .text:\n 0000 18800003 00000000 03e00008 24020001 ............$...\n 0010 04810003 00001025 03e00008 2402ffff .......%....$...\n 0020 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000a 00000004 00000198 p...............\n 0010 00000005 000002d8 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000034 00000244 ...........4...D\n 0040 00000008 00000278 00000001 00000280 .......x........\n 0050 00000000 00000000 00000001 000002c8 ................\n 0060 08000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000028 20200001 00000001 .......( ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d63 66346637 63653465 65356630 ef-cf4f7ce4ee5f0\n 0130 6166302f 7265662e 63007369 676e0000 af0/ref.c.sign..\n 0140 7369676e 00000000 00000000 00000001 sign............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 0000000a 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000002 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sign # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sign:mwcc_242_81","sym":"sign","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","branch","multi-if"],"loc":1,"refSource":"int sign(int x){ if(x>0)return 1; if(x<0)return -1; return 0; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tble 10 \n 8:\tli r3,1\n c:\tblr\n 10:\tsrawi r3,r3,31\n 14:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 sign\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sign\n\n\nContents of section .text:\n 0000 2c030000 4081000c 38600001 4e800020 ,...@...8`..N.. \n 0010 7c63fe70 4e800020 |c.pN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 sign(s32 a0) {\n if (a0 > 0) {\n return 1;\n } else {\n return a0 >> 31;\n }\n}\n","score":6,"maxScore":8,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sign(s32 arg0) {\n if (arg0 > 0) {\n return 1;\n }\n return arg0 >> 0x1F;\n}\n","score":6,"maxScore":8,"compileErrors":null,"breakdown":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":8,"ratio":0.75,"kinds":{"insert":2,"delete":2,"replace":0,"opMismatch":1,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sign` — benchmark function synthetic:sign:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sign\n cmpwi r3,0\n ble .L10\n li r3,1\n blr\n.L10:\n srawi r3,r3,31\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sign # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sign` — benchmark function synthetic:sign:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sign:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tble 10 \n 8:\tli r3,1\n c:\tblr\n 10:\tsrawi r3,r3,31\n 14:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 sign\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sign\n\n\nContents of section .text:\n 0000 2c030000 4081000c 38600001 4e800020 ,...@...8`..N.. \n 0010 7c63fe70 4e800020 |c.pN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sign # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:signum:agbcc","sym":"signum","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["compare","branchless"],"loc":1,"refSource":"int signum(int x){ return (x>0)-(x<0); }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsignum\n\t.type\t signum,function\n\t.thumb_func\nsignum:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tlsr\tr0, r0, #0x1f\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t signum,.Lfe1-signum\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 signum(s32 a0) {\n s32 v0;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n v0 = 1;\n }\n return v0 - ((u32)a0 >> 31);\n}\n","score":3,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":9,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 signum(s32 arg0) {\n s32 var_r1;\n\n var_r1 = 0;\n if (arg0 > 0) {\n var_r1 = 1;\n }\n return var_r1 - ((u32) arg0 >> 0x1F);\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":8,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `signum` — benchmark function synthetic:signum:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsignum\n\t.type\t signum,function\n\t.thumb_func\nsignum:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tlsr\tr0, r0, #0x1f\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t signum,.Lfe1-signum\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function signum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `signum` — benchmark function synthetic:signum:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:signum:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsignum\n\t.type\t signum,function\n\t.thumb_func\nsignum:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0\n\tble\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L3:\n\tlsr\tr0, r0, #0x1f\n\tsub\tr0, r1, r0\n\tbx\tlr\n.Lfe1:\n\t.size\t signum,.Lfe1-signum\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name signum # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:signum:gcc2.7.2kmc","sym":"signum","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["compare","branchless"],"loc":1,"refSource":"int signum(int x){ return (x>0)-(x<0); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x1f\n 4:\tslt\ta0,zero,a0\n 8:\tjr\tra\n c:\tsubu\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3877c64dcddef86b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 signum\n\n\nContents of section .text:\n 0000 000417c2 0004202a 03e00008 00821023 ...... *.......#\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 signum(u32 a0) {\n return (0 < a0) - (a0 >> 31);\n}\n","score":7,"maxScore":8,"compileErrors":null,"breakdown":{"insert":4,"delete":0,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 signum(u32 arg0) {\n return ((s32) arg0 > 0) - (arg0 >> 0x1F);\n}\n","score":7,"maxScore":8,"compileErrors":null,"breakdown":{"insert":4,"delete":0,"replace":2,"opMismatch":0,"argMismatch":1},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":7,"maxScore":8,"ratio":0.875,"kinds":{"insert":4,"delete":0,"replace":2,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `signum` — benchmark function synthetic:signum:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel signum\n srl\t$v0, $a0, 0x1f\n slt\t$a0, $zero, $a0\n jr\t$ra\n subu\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function signum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `signum` — benchmark function synthetic:signum:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:signum:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsrl\tv0,a0,0x1f\n 4:\tslt\ta0,zero,a0\n 8:\tjr\tra\n c:\tsubu\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3877c64dcddef86b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 signum\n\n\nContents of section .text:\n 0000 000417c2 0004202a 03e00008 00821023 ...... *.......#\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name signum # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:signum:ido7.1","sym":"signum","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["compare","branchless"],"loc":1,"refSource":"int signum(int x){ return (x>0)-(x<0); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tt6,zero,a0\n 4:\tslti\tt7,a0,0\n 8:\tjr\tra\n c:\tsubu\tv0,t6,t7\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 signum\n\n\nContents of section .text:\n 0000 0004702a 288f0000 03e00008 01cf1023 ..p*(..........#\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 38373763 36346463 64646566 ef-3877c64dcddef\n 0130 3836622f 7265662e 63007369 676e756d 86b/ref.c.signum\n 0140 00000000 7369676e 756d0000 00000000 ....signum......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 signum(s32 a0) {\n return (0 < a0) - (a0 < 0);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 signum(s32 arg0) {\n return (arg0 > 0) - (arg0 < 0);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `signum` — benchmark function synthetic:signum:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel signum\n slt\t$t6, $zero, $a0\n slti\t$t7, $a0, 0\n jr\t$ra\n subu\t$v0, $t6, $t7\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function signum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `signum` — benchmark function synthetic:signum:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:signum:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tslt\tt6,zero,a0\n 4:\tslti\tt7,a0,0\n 8:\tjr\tra\n c:\tsubu\tv0,t6,t7\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 signum\n\n\nContents of section .text:\n 0000 0004702a 288f0000 03e00008 01cf1023 ..p*(..........#\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 38373763 36346463 64646566 ef-3877c64dcddef\n 0130 3836622f 7265662e 63007369 676e756d 86b/ref.c.signum\n 0140 00000000 7369676e 756d0000 00000000 ....signum......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name signum # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:signum:mwcc_242_81","sym":"signum","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["compare","branchless"],"loc":1,"refSource":"int signum(int x){ return (x>0)-(x<0); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg r0,r3\n 4:\tsrwi r4,r3,31\n 8:\tandc r0,r0,r3\n c:\tsrwi r0,r0,31\n 10:\tsubf r3,r4,r0\n 14:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 signum\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 signum\n\n\nContents of section .text:\n 0000 7c0300d0 54640ffe 7c001878 54000ffe |...Td..|..xT...\n 0010 7c640050 4e800020 |d.PN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 signum(u32 a0) {\n return ((-a0 & ~a0) >> 31) - (a0 >> 31);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 signum(u32 arg0) {\n return ((s32) arg0 > 0) - (arg0 >> 0x1FU);\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `signum` — benchmark function synthetic:signum:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel signum\n neg r0,r3\n srwi r4,r3,31\n andc r0,r0,r3\n srwi r0,r0,31\n subf r3,r4,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function signum # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `signum` — benchmark function synthetic:signum:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:signum:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tneg r0,r3\n 4:\tsrwi r4,r3,31\n 8:\tandc r0,r0,r3\n c:\tsrwi r0,r0,31\n 10:\tsubf r3,r4,r0\n 14:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 signum\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 signum\n\n\nContents of section .text:\n 0000 7c0300d0 54640ffe 7c001878 54000ffe |...Td..|..xT...\n 0010 7c640050 4e800020 |d.PN.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name signum # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:smixed:agbcc","sym":"smixed","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","mixed-width"],"loc":2,"refSource":"struct P{u8 hp;s16 x;int id;};\nint smixed(struct P*p){ return p->x + p->id; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsmixed\n\t.type\t smixed,function\n\t.thumb_func\nsmixed:\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r1, r2]\n\tldr\tr1, [r1, #0x4]\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t smixed,.Lfe1-smixed\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 smixed(s32 * a0) {\n return *(s16 *)(a0 + 2) + a0[1];\n}\n","score":1,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1},"quality":{"score":96,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":1,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 smixed(void *arg0) {\n return arg0->unk2 + arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:3: warning: dereferencing `void *' pointer","/cand.c.pp.c:3: request for member `unk2' in something not a structure or union","/cand.c.pp.c:3: request for member `unk4' in something not a structure or union"]},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":6,"ratio":0.16666666666666666,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":1}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `smixed` — benchmark function synthetic:smixed:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsmixed\n\t.type\t smixed,function\n\t.thumb_func\nsmixed:\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r1, r2]\n\tldr\tr1, [r1, #0x4]\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t smixed,.Lfe1-smixed\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function smixed # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `smixed` — benchmark function synthetic:smixed:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:smixed:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsmixed\n\t.type\t smixed,function\n\t.thumb_func\nsmixed:\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x2\n\tldrsh\tr0, [r1, r2]\n\tldr\tr1, [r1, #0x4]\n\tadd\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t smixed,.Lfe1-smixed\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name smixed # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:smixed:gcc2.7.2kmc","sym":"smixed","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field","mixed-width"],"loc":2,"refSource":"struct P{u8 hp;s16 x;int id;};\nint smixed(struct P*p){ return p->x + p->id; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tv1,2(a0)\n 4:\tlw\tv0,4(a0)\n 8:\tjr\tra\n c:\taddu\tv0,v1,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f184f70c99f7998a/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 smixed\n\n\nContents of section .text:\n 0000 84830002 8c820004 03e00008 00621021 .............b.!\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"struct Struct0 { u8 _pad0[2]; s16 field_2; s32 field_4; };\ns32 smixed(struct Struct0 * a0) {\n return a0->field_2 + a0->field_4;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 smixed(void *arg0) {\n return arg0->unk2 + arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: request for member `unk2' in something not a structure or union","/cand.c:3: request for member `unk4' in something not a structure or union"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `smixed` — benchmark function synthetic:smixed:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel smixed\n lh\t$v1, 2($a0)\n lw\t$v0, 4($a0)\n jr\t$ra\n addu\t$v0, $v1, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function smixed # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `smixed` — benchmark function synthetic:smixed:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:smixed:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tv1,2(a0)\n 4:\tlw\tv0,4(a0)\n 8:\tjr\tra\n c:\taddu\tv0,v1,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-f184f70c99f7998a/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 smixed\n\n\nContents of section .text:\n 0000 84830002 8c820004 03e00008 00621021 .............b.!\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name smixed # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:smixed:ido7.1","sym":"smixed","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","field","mixed-width"],"loc":2,"refSource":"struct P{u8 hp;s16 x;int id;};\nint smixed(struct P*p){ return p->x + p->id; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tt6,2(a0)\n 4:\tlw\tt7,4(a0)\n 8:\tjr\tra\n c:\taddu\tv0,t6,t7\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 smixed\n\n\nContents of section .text:\n 0000 848e0002 8c8f0004 03e00008 01cf1021 ...............!\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 31383466 37306339 39663739 ef-f184f70c99f79\n 0130 3938612f 7265662e 6300736d 69786564 98a/ref.c.smixed\n 0140 00000000 736d6978 65640000 00000000 ....smixed......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"struct Struct0 { u8 _pad0[2]; s16 field_2; s32 field_4; };\ns32 smixed(struct Struct0 * a0) {\n return a0->field_2 + a0->field_4;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 smixed(void *arg0) {\n return arg0->unk2 + arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `smixed` — benchmark function synthetic:smixed:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel smixed\n lh\t$t6, 2($a0)\n lw\t$t7, 4($a0)\n jr\t$ra\n addu\t$v0, $t6, $t7\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function smixed # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `smixed` — benchmark function synthetic:smixed:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:smixed:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlh\tt6,2(a0)\n 4:\tlw\tt7,4(a0)\n 8:\tjr\tra\n c:\taddu\tv0,t6,t7\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 smixed\n\n\nContents of section .text:\n 0000 848e0002 8c8f0004 03e00008 01cf1021 ...............!\nContents of section .options:\n 0000 01200000 00000000 8000c014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 31383466 37306339 39663739 ef-f184f70c99f79\n 0130 3938612f 7265662e 6300736d 69786564 98a/ref.c.smixed\n 0140 00000000 736d6978 65640000 00000000 ....smixed......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000004 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name smixed # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:smixed:mwcc_242_81","sym":"smixed","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["struct","field","mixed-width"],"loc":2,"refSource":"struct P{u8 hp;s16 x;int id;};\nint smixed(struct P*p){ return p->x + p->id; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlha r4,2(r3)\n 4:\tlwz r0,4(r3)\n 8:\tadd r3,r4,r0\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 smixed\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 smixed\n\n\nContents of section .text:\n 0000 a8830002 80030004 7c640214 4e800020 ........|d..N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"struct Struct0 { u8 _pad0[2]; s16 field_2; s32 field_4; };\ns32 smixed(struct Struct0 * a0) {\n return a0->field_2 + a0->field_4;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 smixed(void *arg0) {\n return arg0->unk2 + arg0->unk4;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `smixed` — benchmark function synthetic:smixed:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel smixed\n lha r4,2(r3)\n lwz r0,4(r3)\n add r3,r4,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function smixed # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `smixed` — benchmark function synthetic:smixed:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:smixed:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlha r4,2(r3)\n 4:\tlwz r0,4(r3)\n 8:\tadd r3,r4,r0\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 smixed\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 smixed\n\n\nContents of section .text:\n 0000 a8830002 80030004 7c640214 4e800020 ........|d..N.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name smixed # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sstore:agbcc","sym":"sstore","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;};\nvoid sstore(struct S*s,int v){ s->b=v; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsstore\n\t.type\t sstore,function\n\t.thumb_func\nsstore:\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.Lfe1:\n\t.size\t sstore,.Lfe1-sstore\n","ctx":"struct S; void sstore(struct S*,int);","proto":{"sstore":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void sstore(s32 * a0, u32 a1) {\n a0[1] = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sstore(struct S *arg0, s32 arg1) {\n arg0->unk4 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c.pp.c:2: warning: `struct S' declared inside parameter list","/cand.c.pp.c:2: warning: its scope is only this definition or declaration,","/cand.c.pp.c:2: warning: which is probably not what you want.","/cand.c.pp.c:3: dereferencing pointer to incomplete type"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sstore` — benchmark function synthetic:sstore:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsstore\n\t.type\t sstore,function\n\t.thumb_func\nsstore:\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.Lfe1:\n\t.size\t sstore,.Lfe1-sstore\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void sstore(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sstore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sstore` — benchmark function synthetic:sstore:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sstore:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsstore\n\t.type\t sstore,function\n\t.thumb_func\nsstore:\n\tstr\tr1, [r0, #0x4]\n\tbx\tlr\n.Lfe1:\n\t.size\t sstore,.Lfe1-sstore\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sstore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sstore # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sstore:gcc2.7.2kmc","sym":"sstore","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;};\nvoid sstore(struct S*s,int v){ s->b=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,4(a0)\n\t...\n","ctx":"struct S; void sstore(struct S*,int);","proto":{"sstore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-57efdacee8dfe43c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 sstore\n\n\nContents of section .text:\n 0000 03e00008 ac850004 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void sstore(s32 * a0, u32 a1) {\n a0[1] = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sstore(struct S *arg0, s32 arg1) {\n arg0->unk4 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["/cand.c:3: dereferencing pointer to incomplete type"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sstore` — benchmark function synthetic:sstore:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sstore\n jr\t$ra\n sw\t$a1, 4($a0)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void sstore(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sstore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sstore` — benchmark function synthetic:sstore:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sstore:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,4(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-57efdacee8dfe43c/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 sstore\n\n\nContents of section .text:\n 0000 03e00008 ac850004 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sstore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sstore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sstore:ido7.1","sym":"sstore","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;};\nvoid sstore(struct S*s,int v){ s->b=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,4(a0)\n\t...\n","ctx":"struct S; void sstore(struct S*,int);","proto":{"sstore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 sstore\n\n\nContents of section .text:\n 0000 03e00008 ac850004 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 37656664 61636565 38646665 ef-57efdacee8dfe\n 0130 3433632f 7265662e 63007373 746f7265 43c/ref.c.sstore\n 0140 00000000 7373746f 72650000 00000000 ....sstore......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void sstore(s32 * a0, u32 a1) {\n a0[1] = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sstore(struct S *arg0, s32 arg1) {\n arg0->unk4 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 3: 'unk4' undefined; reoccurrences will not be reported.","cfe: Error: /cand.c, line 3: member of structure or union required"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sstore` — benchmark function synthetic:sstore:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sstore\n jr\t$ra\n sw\t$a1, 4($a0)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void sstore(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sstore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sstore` — benchmark function synthetic:sstore:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sstore:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,4(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 sstore\n\n\nContents of section .text:\n 0000 03e00008 ac850004 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 37656664 61636565 38646665 ef-57efdacee8dfe\n 0130 3433632f 7265662e 63007373 746f7265 43c/ref.c.sstore\n 0140 00000000 7373746f 72650000 00000000 ....sstore......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sstore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sstore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sstore:mwcc_242_81","sym":"sstore","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["struct","field","store"],"loc":2,"refSource":"struct S{int a;int b;};\nvoid sstore(struct S*s,int v){ s->b=v; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,4(r3)\n 4:\tblr\n","ctx":"struct S; void sstore(struct S*,int);","proto":{"sstore":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sstore\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sstore\n\n\nContents of section .text:\n 0000 90830004 4e800020 ....N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void sstore(s32 * a0, u32 a1) {\n a0[1] = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"void sstore(struct S *arg0, s32 arg1) {\n arg0->unk4 = arg1;\n}\n/* Warning: struct S is not defined (only forward-declared) */\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^^^","# illegal use of incomplete struct/union/class 'struct S'"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sstore` — benchmark function synthetic:sstore:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sstore\n stw r4,4(r3)\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nstruct S; void sstore(struct S*,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sstore # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sstore` — benchmark function synthetic:sstore:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sstore:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,4(r3)\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sstore\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sstore\n\n\nContents of section .text:\n 0000 90830004 4e800020 ....N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sstore\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sstore # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:storep:agbcc","sym":"storep","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","store"],"loc":1,"refSource":"void storep(int *p,int v){ *p=v; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstorep\n\t.type\t storep,function\n\t.thumb_func\nstorep:\n\tstr\tr1, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t storep,.Lfe1-storep\n","ctx":"void storep(int*,int);","proto":{"storep":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void storep(s32 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void storep(s32 *arg0, s32 arg1) {\n *arg0 = arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `storep` — benchmark function synthetic:storep:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstorep\n\t.type\t storep,function\n\t.thumb_func\nstorep:\n\tstr\tr1, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t storep,.Lfe1-storep\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid storep(int*,int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function storep # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `storep` — benchmark function synthetic:storep:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:storep:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstorep\n\t.type\t storep,function\n\t.thumb_func\nstorep:\n\tstr\tr1, [r0]\n\tbx\tlr\n.Lfe1:\n\t.size\t storep,.Lfe1-storep\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"storep\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name storep # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:storep:gcc2.7.2kmc","sym":"storep","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","store"],"loc":1,"refSource":"void storep(int *p,int v){ *p=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,0(a0)\n\t...\n","ctx":"void storep(int*,int);","proto":{"storep":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1cef70b9422e0dc8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 storep\n\n\nContents of section .text:\n 0000 03e00008 ac850000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void storep(s32 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void storep(s32 *arg0, s32 arg1) {\n *arg0 = arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `storep` — benchmark function synthetic:storep:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel storep\n jr\t$ra\n sw\t$a1, 0($a0)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid storep(int*,int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function storep # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `storep` — benchmark function synthetic:storep:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:storep:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,0(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1cef70b9422e0dc8/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 storep\n\n\nContents of section .text:\n 0000 03e00008 ac850000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"storep\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name storep # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:storep:ido7.1","sym":"storep","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","store"],"loc":1,"refSource":"void storep(int *p,int v){ *p=v; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,0(a0)\n\t...\n","ctx":"void storep(int*,int);","proto":{"storep":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 storep\n\n\nContents of section .text:\n 0000 03e00008 ac850000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 63656637 30623934 32326530 ef-1cef70b9422e0\n 0130 6463382f 7265662e 63007374 6f726570 dc8/ref.c.storep\n 0140 00000000 73746f72 65700000 00000000 ....storep......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void storep(s32 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void storep(s32 *arg0, s32 arg1) {\n *arg0 = arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `storep` — benchmark function synthetic:storep:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel storep\n jr\t$ra\n sw\t$a1, 0($a0)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid storep(int*,int);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function storep # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `storep` — benchmark function synthetic:storep:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:storep:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsw\ta1,0(a0)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 storep\n\n\nContents of section .text:\n 0000 03e00008 ac850000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000030 00000000 . .........0....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000030 00000000 00000000 00000000 ...0............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002bc 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 00000008 0000025c 00000001 00000264 .......\\.......d\n 0050 00000000 00000000 00000001 000002ac ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 63656637 30623934 32326530 ef-1cef70b9422e0\n 0130 6463382f 7265662e 63007374 6f726570 dc8/ref.c.storep\n 0140 00000000 73746f72 65700000 00000000 ....storep......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000002 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"storep\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name storep # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:storep:mwcc_242_81","sym":"storep","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","store"],"loc":1,"refSource":"void storep(int *p,int v){ *p=v; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,0(r3)\n 4:\tblr\n","ctx":"void storep(int*,int);","proto":{"storep":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 storep\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 storep\n\n\nContents of section .text:\n 0000 90830000 4e800020 ....N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void storep(s32 * a0, u32 a1) {\n *a0 = a1;\n return;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void storep(s32 *arg0, s32 arg1) {\n *arg0 = arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `storep` — benchmark function synthetic:storep:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel storep\n stw r4,0(r3)\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid storep(int*,int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function storep # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `storep` — benchmark function synthetic:storep:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:storep:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstw r4,0(r3)\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 storep\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 storep\n\n\nContents of section .text:\n 0000 90830000 4e800020 ....N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"storep\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name storep # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strcmp1:agbcc","sym":"strcmp1","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","memory","pointer","compare"],"loc":1,"refSource":"int strcmp1(char *a,char *b){ while(*a && *a==*b){a++;b++;} return *a-*b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstrcmp1\n\t.type\t strcmp1,function\n\t.thumb_func\nstrcmp1:\n\tb\t.L8\n.L5:\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n.L8:\n\tldrb\tr2, [r0]\n\tcmp\tr2, #0\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr3, [r1]\n\tcmp\tr2, r3\n\tbeq\t.L5\t@cond_branch\n.L4:\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t strcmp1,.Lfe1-strcmp1\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'strcmp1' — structure: cannot structure 'strcmp1': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* @ Generated by gcc 2.9-arm-000512 for Thumb/elf */\n/* \t.code\t16 */\n/* .gcc2_compiled.: */\n/* .text */\n/* \t.align\t2, 0 */\n/* \t.globl\tstrcmp1 */\n/* \t.type\t strcmp1,function */\n/* \t.thumb_func */\n/* strcmp1: */\n/* \tb\t.L8 */\n/* .L5: */\n/* \tadd\tr0, r0, #0x1 */\n/* \tadd\tr1, r1, #0x1 */\n/* .L8: */\n/* \tldrb\tr2, [r0] */\n/* \tcmp\tr2, #0 */\n/* \tbeq\t.L4\t@cond_branch */\n/* \tldrb\tr3, [r1] */\n/* \tcmp\tr2, r3 */\n/* \tbeq\t.L5\t@cond_branch */\n/* .L4: */\n/* \tldrb\tr0, [r0] */\n/* \tldrb\tr1, [r1] */\n/* \tsub\tr0, r0, r1 */\n/* \tbx\tlr */\n/* .Lfe1: */\n/* \t.size\t strcmp1,.Lfe1-strcmp1 */\nvoid strcmp1(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'strcmp1': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'strcmp1': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 strcmp1(u8 *arg0, u8 *arg1) {\n u8 *var_r0;\n u8 *var_r1;\n u8 temp_r2;\n\n var_r0 = arg0;\n var_r1 = arg1;\nloop_2:\n temp_r2 = *var_r0;\n if ((temp_r2 != 0) && (temp_r2 == *var_r1)) {\n var_r0 += 1;\n var_r1 += 1;\n goto loop_2;\n }\n return *var_r0 - *var_r1;\n}\n","score":10,"maxScore":15,"compileErrors":null,"breakdown":{"insert":2,"delete":3,"replace":2,"opMismatch":1,"argMismatch":2},"quality":{"score":88,"lines":15,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":10,"maxScore":15,"ratio":0.6666666666666666,"kinds":{"insert":2,"delete":3,"replace":2,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strcmp1` — benchmark function synthetic:strcmp1:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstrcmp1\n\t.type\t strcmp1,function\n\t.thumb_func\nstrcmp1:\n\tb\t.L8\n.L5:\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n.L8:\n\tldrb\tr2, [r0]\n\tcmp\tr2, #0\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr3, [r1]\n\tcmp\tr2, r3\n\tbeq\t.L5\t@cond_branch\n.L4:\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t strcmp1,.Lfe1-strcmp1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strcmp1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strcmp1` — benchmark function synthetic:strcmp1:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strcmp1:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstrcmp1\n\t.type\t strcmp1,function\n\t.thumb_func\nstrcmp1:\n\tb\t.L8\n.L5:\n\tadd\tr0, r0, #0x1\n\tadd\tr1, r1, #0x1\n.L8:\n\tldrb\tr2, [r0]\n\tcmp\tr2, #0\n\tbeq\t.L4\t@cond_branch\n\tldrb\tr3, [r1]\n\tcmp\tr2, r3\n\tbeq\t.L5\t@cond_branch\n.L4:\n\tldrb\tr0, [r0]\n\tldrb\tr1, [r1]\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t strcmp1,.Lfe1-strcmp1\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name strcmp1 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strcmp1:gcc2.7.2kmc","sym":"strcmp1","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","memory","pointer","compare"],"loc":1,"refSource":"int strcmp1(char *a,char *b){ while(*a && *a==*b){a++;b++;} return *a-*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tv1,0(a0)\n 4:\tbeqz\tv1,28 \n 8:\tnop\n c:\tlbu\tv0,0(a1)\n 10:\tbne\tv1,v0,28 \n 14:\tnop\n 18:\taddiu\ta0,a0,1\n 1c:\tlbu\tv1,0(a0)\n 20:\tbnez\tv1,c \n 24:\taddiu\ta1,a1,1\n 28:\tlbu\tv1,0(a0)\n 2c:\tlbu\tv0,0(a1)\n 30:\tjr\tra\n 34:\tsubu\tv0,v1,v0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-76d04718a4a46a8a/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 strcmp1\n\n\nContents of section .text:\n 0000 90830000 10600008 00000000 90a20000 .....`..........\n 0010 14620005 00000000 24840001 90830000 .b......$.......\n 0020 1460fffa 24a50001 90830000 90a20000 .`..$...........\n 0030 03e00008 00621023 00000000 00000000 .....b.#........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'strcmp1' — structure: cannot structure 'strcmp1': unrecovered back-edge into block #1 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlbu\tv1,0(a0) */\n/* 4:\tbeqz\tv1,28 */\n/* 8:\tnop */\n/* c:\tlbu\tv0,0(a1) */\n/* 10:\tbne\tv1,v0,28 */\n/* 14:\tnop */\n/* 18:\taddiu\ta0,a0,1 */\n/* 1c:\tlbu\tv1,0(a0) */\n/* 20:\tbnez\tv1,c */\n/* 24:\taddiu\ta1,a1,1 */\n/* 28:\tlbu\tv1,0(a0) */\n/* 2c:\tlbu\tv0,0(a1) */\n/* 30:\tjr\tra */\n/* 34:\tsubu\tv0,v1,v0 */\n/* \t... */\nvoid strcmp1(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'strcmp1': unrecovered back-edge into block #1 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'strcmp1': unrecovered back-edge into block #1 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 strcmp1(u8 *arg0, u8 *arg1) {\n u8 *var_a0;\n u8 *var_a1;\n u8 var_v1;\n\n var_a0 = arg0;\n var_a1 = arg1;\n var_v1 = *var_a0;\n if (var_v1 != 0) {\nloop_1:\n if (var_v1 == *var_a1) {\n var_a0 += 1;\n var_v1 = *var_a0;\n var_a1 += 1;\n if (var_v1 != 0) {\n goto loop_1;\n }\n }\n }\n return *var_a0 - *var_a1;\n}\n","score":0,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":88,"lines":20,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strcmp1` — benchmark function synthetic:strcmp1:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel strcmp1\n lbu\t$v1, 0($a0)\n beqz\t$v1, .L28\n nop\n.Lc:\n lbu\t$v0, 0($a1)\n bne\t$v1, $v0, .L28\n nop\n addiu\t$a0, $a0, 1\n lbu\t$v1, 0($a0)\n bnez\t$v1, .Lc\n addiu\t$a1, $a1, 1\n.L28:\n lbu\t$v1, 0($a0)\n lbu\t$v0, 0($a1)\n jr\t$ra\n subu\t$v0, $v1, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strcmp1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strcmp1` — benchmark function synthetic:strcmp1:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strcmp1:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tv1,0(a0)\n 4:\tbeqz\tv1,28 \n 8:\tnop\n c:\tlbu\tv0,0(a1)\n 10:\tbne\tv1,v0,28 \n 14:\tnop\n 18:\taddiu\ta0,a0,1\n 1c:\tlbu\tv1,0(a0)\n 20:\tbnez\tv1,c \n 24:\taddiu\ta1,a1,1\n 28:\tlbu\tv1,0(a0)\n 2c:\tlbu\tv0,0(a1)\n 30:\tjr\tra\n 34:\tsubu\tv0,v1,v0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-76d04718a4a46a8a/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000038 strcmp1\n\n\nContents of section .text:\n 0000 90830000 10600008 00000000 90a20000 .....`..........\n 0010 14620005 00000000 24840001 90830000 .b......$.......\n 0020 1460fffa 24a50001 90830000 90a20000 .`..$...........\n 0030 03e00008 00621023 00000000 00000000 .....b.#........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name strcmp1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strcmp1:ido7.1","sym":"strcmp1","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","memory","pointer","compare"],"loc":1,"refSource":"int strcmp1(char *a,char *b){ while(*a && *a==*b){a++;b++;} return *a-*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tv1,0(a0)\n 4:\tbeqzl\tv1,3c \n 8:\tlbu\tt8,0(a1)\n c:\tlbu\tt6,0(a1)\n 10:\tbnel\tv1,t6,3c \n 14:\tlbu\tt8,0(a1)\n 18:\tlbu\tv1,1(a0)\n 1c:\taddiu\ta0,a0,1\n 20:\taddiu\ta1,a1,1\n 24:\tbeqzl\tv1,3c \n 28:\tlbu\tt8,0(a1)\n 2c:\tlbu\tt7,0(a1)\n 30:\tbeql\tv1,t7,1c \n 34:\tlbu\tv1,1(a0)\n 38:\tlbu\tt8,0(a1)\n 3c:\tjr\tra\n 40:\tsubu\tv0,v1,t8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t00000044 strcmp1\n\n\nContents of section .text:\n 0000 90830000 5060000d 90b80000 90ae0000 ....P`..........\n 0010 546e000a 90b80000 90830001 24840001 Tn..........$...\n 0020 24a50001 50600005 90b80000 90af0000 $...P`..........\n 0030 506ffffa 90830001 90b80000 03e00008 Po..............\n 0040 00781023 00000000 00000000 00000000 .x.#............\nContents of section .options:\n 0000 01200000 00000000 8100c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000011 00000004 000001b8 p...............\n 0010 00000005 000002fc 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000038 00000264 ....... ...8...d\n 0040 00000008 0000029c 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 08070000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000044 20200001 00000001 .......D ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 36643034 37313861 34613436 ef-76d04718a4a46\n 0130 6138612f 7265662e 63007374 72636d70 a8a/ref.c.strcmp\n 0140 31000000 73747263 6d703100 00000000 1...strcmp1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000011 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'strcmp1' — lift: cannot lift 'strcmp1': unmodelled control transfer 'beqzl' at 0x4 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlbu\tv1,0(a0) */\n/* 4:\tbeqzl\tv1,3c */\n/* 8:\tlbu\tt8,0(a1) */\n/* c:\tlbu\tt6,0(a1) */\n/* 10:\tbnel\tv1,t6,3c */\n/* 14:\tlbu\tt8,0(a1) */\n/* 18:\tlbu\tv1,1(a0) */\n/* 1c:\taddiu\ta0,a0,1 */\n/* 20:\taddiu\ta1,a1,1 */\n/* 24:\tbeqzl\tv1,3c */\n/* 28:\tlbu\tt8,0(a1) */\n/* 2c:\tlbu\tt7,0(a1) */\n/* 30:\tbeql\tv1,t7,1c */\n/* 34:\tlbu\tv1,1(a0) */\n/* 38:\tlbu\tt8,0(a1) */\n/* 3c:\tjr\tra */\n/* 40:\tsubu\tv0,v1,t8 */\n/* \t... */\nvoid strcmp1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'strcmp1': unmodelled control transfer 'beqzl' at 0x4 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":26,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'strcmp1': unmodelled control transfer 'beqzl' at 0x4 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 strcmp1(u8 *arg0, u8 *arg1) {\n u8 *var_a0;\n u8 *var_a1;\n u8 var_v1;\n\n var_a0 = arg0;\n var_a1 = arg1;\n var_v1 = *var_a0;\n if ((var_v1 != 0) && (var_v1 == *var_a1)) {\nloop_2:\n var_v1 = var_a0->unk1;\n var_a0 += 1;\n var_a1 += 1;\n if (var_v1 != 0) {\n if (var_v1 == *var_a1) {\n goto loop_2;\n }\n }\n }\n return var_v1 - *var_a1;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":88,"lines":20,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 12: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strcmp1` — benchmark function synthetic:strcmp1:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel strcmp1\n lbu\t$v1, 0($a0)\n beqzl\t$v1, .L3c\n lbu\t$t8, 0($a1)\n lbu\t$t6, 0($a1)\n bnel\t$v1, $t6, .L3c\n lbu\t$t8, 0($a1)\n lbu\t$v1, 1($a0)\n.L1c:\n addiu\t$a0, $a0, 1\n addiu\t$a1, $a1, 1\n beqzl\t$v1, .L3c\n lbu\t$t8, 0($a1)\n lbu\t$t7, 0($a1)\n beql\t$v1, $t7, .L1c\n lbu\t$v1, 1($a0)\n lbu\t$t8, 0($a1)\n.L3c:\n jr\t$ra\n subu\t$v0, $v1, $t8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strcmp1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strcmp1` — benchmark function synthetic:strcmp1:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strcmp1:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tv1,0(a0)\n 4:\tbeqzl\tv1,3c \n 8:\tlbu\tt8,0(a1)\n c:\tlbu\tt6,0(a1)\n 10:\tbnel\tv1,t6,3c \n 14:\tlbu\tt8,0(a1)\n 18:\tlbu\tv1,1(a0)\n 1c:\taddiu\ta0,a0,1\n 20:\taddiu\ta1,a1,1\n 24:\tbeqzl\tv1,3c \n 28:\tlbu\tt8,0(a1)\n 2c:\tlbu\tt7,0(a1)\n 30:\tbeql\tv1,t7,1c \n 34:\tlbu\tv1,1(a0)\n 38:\tlbu\tt8,0(a1)\n 3c:\tjr\tra\n 40:\tsubu\tv0,v1,t8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t00000044 strcmp1\n\n\nContents of section .text:\n 0000 90830000 5060000d 90b80000 90ae0000 ....P`..........\n 0010 546e000a 90b80000 90830001 24840001 Tn..........$...\n 0020 24a50001 50600005 90b80000 90af0000 $...P`..........\n 0030 506ffffa 90830001 90b80000 03e00008 Po..............\n 0040 00781023 00000000 00000000 00000000 .x.#............\nContents of section .options:\n 0000 01200000 00000000 8100c03c 00000000 . .........<....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8100c03c 00000000 00000000 00000000 ...<............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000011 00000004 000001b8 p...............\n 0010 00000005 000002fc 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000038 00000264 ....... ...8...d\n 0040 00000008 0000029c 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 08070000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000044 20200001 00000001 .......D ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d37 36643034 37313861 34613436 ef-76d04718a4a46\n 0130 6138612f 7265662e 63007374 72636d70 a8a/ref.c.strcmp\n 0140 31000000 73747263 6d703100 00000000 1...strcmp1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000011 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name strcmp1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strcmp1:mwcc_242_81","sym":"strcmp1","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","memory","pointer","compare"],"loc":1,"refSource":"int strcmp1(char *a,char *b){ while(*a && *a==*b){a++;b++;} return *a-*b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tb c \n 4:\taddi r3,r3,1\n 8:\taddi r4,r4,1\n c:\tlbz r6,0(r3)\n 10:\textsb. r0,r6\n 14:\tbeq 2c \n 18:\tlbz r0,0(r4)\n 1c:\textsb r5,r6\n 20:\textsb r0,r0\n 24:\tcmpw r5,r0\n 28:\tbeq 4 \n 2c:\tlbz r3,0(r4)\n 30:\textsb r0,r6\n 34:\textsb r3,r3\n 38:\tsubf r3,r3,r0\n 3c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000040 strcmp1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 strcmp1\n\n\nContents of section .text:\n 0000 4800000c 38630001 38840001 88c30000 H...8c..8.......\n 0010 7cc00775 41820018 88040000 7cc50774 |..uA.......|..t\n 0020 7c000774 7c050000 4182ffdc 88640000 |..t|...A....d..\n 0030 7cc00774 7c630774 7c630050 4e800020 |..t|c.t|c.PN.. \nContents of section .mwcats.text:\n 0000 02000040 00000000 ...@.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'strcmp1' — structure: cannot structure 'strcmp1': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break) */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tb c */\n/* 4:\taddi r3,r3,1 */\n/* 8:\taddi r4,r4,1 */\n/* c:\tlbz r6,0(r3) */\n/* 10:\textsb. r0,r6 */\n/* 14:\tbeq 2c */\n/* 18:\tlbz r0,0(r4) */\n/* 1c:\textsb r5,r6 */\n/* 20:\textsb r0,r0 */\n/* 24:\tcmpw r5,r0 */\n/* 28:\tbeq 4 */\n/* 2c:\tlbz r3,0(r4) */\n/* 30:\textsb r0,r6 */\n/* 34:\textsb r3,r3 */\n/* 38:\tsubf r3,r3,r0 */\n/* 3c:\tblr */\nvoid strcmp1(void) {\n ASMLIFT_ERROR(\"could not decompile (structure): cannot structure 'strcmp1': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":24,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["structure: cannot structure 'strcmp1': unrecovered back-edge into block #2 (loop-recovery declined this shape: multi-latch, irreducible/overlapping loops, a conditional continue, or an unsafe break)"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 strcmp1(u8 *arg0, u8 *arg1) {\n u8 *var_r3;\n u8 *var_r4;\n u8 temp_r6;\n\n var_r3 = arg0;\n var_r4 = arg1;\nloop_2:\n temp_r6 = *var_r3;\n if (((s8) temp_r6 != 0) && ((s8) temp_r6 == (s8) *var_r4)) {\n var_r3 += 1;\n var_r4 += 1;\n goto loop_2;\n }\n return (s8) temp_r6 - (s8) *var_r4;\n}\n","score":23,"maxScore":25,"compileErrors":null,"breakdown":{"insert":9,"delete":11,"replace":0,"opMismatch":0,"argMismatch":3},"quality":{"score":82,"lines":15,"gotos":1,"casts":5,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":23,"maxScore":25,"ratio":0.92,"kinds":{"insert":9,"delete":11,"replace":0,"opMismatch":0,"argMismatch":3}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strcmp1` — benchmark function synthetic:strcmp1:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel strcmp1\n b .Lc\n.L4:\n addi r3,r3,1\n addi r4,r4,1\n.Lc:\n lbz r6,0(r3)\n extsb. r0,r6\n beq .L2c\n lbz r0,0(r4)\n extsb r5,r6\n extsb r0,r0\n cmpw r5,r0\n beq .L4\n.L2c:\n lbz r3,0(r4)\n extsb r0,r6\n extsb r3,r3\n subf r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strcmp1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strcmp1` — benchmark function synthetic:strcmp1:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strcmp1:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tb c \n 4:\taddi r3,r3,1\n 8:\taddi r4,r4,1\n c:\tlbz r6,0(r3)\n 10:\textsb. r0,r6\n 14:\tbeq 2c \n 18:\tlbz r0,0(r4)\n 1c:\textsb r5,r6\n 20:\textsb r0,r0\n 24:\tcmpw r5,r0\n 28:\tbeq 4 \n 2c:\tlbz r3,0(r4)\n 30:\textsb r0,r6\n 34:\textsb r3,r3\n 38:\tsubf r3,r3,r0\n 3c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000040 strcmp1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 strcmp1\n\n\nContents of section .text:\n 0000 4800000c 38630001 38840001 88c30000 H...8c..8.......\n 0010 7cc00775 41820018 88040000 7cc50774 |..uA.......|..t\n 0020 7c000774 7c050000 4182ffdc 88640000 |..t|...A....d..\n 0030 7cc00774 7c630774 7c630050 4e800020 |..t|c.t|c.PN.. \nContents of section .mwcats.text:\n 0000 02000040 00000000 ...@.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name strcmp1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strlen1:agbcc","sym":"strlen1","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","while","memory","pointer"],"loc":1,"refSource":"int strlen1(char *s){ int n=0; while(*s){n++;s++;} return n; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstrlen1\n\t.type\t strlen1,function\n\t.thumb_func\nstrlen1:\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t strlen1,.Lfe1-strlen1\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 strlen1(u8 * a0) {\n u8 * v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n while (*v0 != 0) {\n v1 = v1 + 1;\n v0 = v0 + 1;\n }\n return v1;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 strlen1(u8 *arg0) {\n s32 var_r2;\n u8 *var_r1;\n\n var_r1 = arg0;\n var_r2 = 0;\nloop_2:\n if (*var_r1 != 0) {\n var_r2 += 1;\n var_r1 += 1;\n goto loop_2;\n }\n return var_r2;\n}\n","score":7,"maxScore":13,"compileErrors":null,"breakdown":{"insert":3,"delete":3,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":88,"lines":13,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strlen1` — benchmark function synthetic:strlen1:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstrlen1\n\t.type\t strlen1,function\n\t.thumb_func\nstrlen1:\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t strlen1,.Lfe1-strlen1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strlen1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strlen1` — benchmark function synthetic:strlen1:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strlen1:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstrlen1\n\t.type\t strlen1,function\n\t.thumb_func\nstrlen1:\n\tadd\tr1, r0, #0\n\tmov\tr2, #0x0\n\tb\t.L7\n.L5:\n\tadd\tr2, r2, #0x1\n\tadd\tr1, r1, #0x1\n.L7:\n\tldrb\tr0, [r1]\n\tcmp\tr0, #0\n\tbne\t.L5\t@cond_branch\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t strlen1,.Lfe1-strlen1\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name strlen1 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strlen1:gcc2.7.2kmc","sym":"strlen1","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","while","memory","pointer"],"loc":1,"refSource":"int strlen1(char *s){ int n=0; while(*s){n++;s++;} return n; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tv0,0(a0)\n 4:\tbeqz\tv0,1c \n 8:\tmove\tv1,zero\n c:\taddiu\ta0,a0,1\n 10:\tlbu\tv0,0(a0)\n 14:\tbnez\tv0,c \n 18:\taddiu\tv1,v1,1\n 1c:\tjr\tra\n 20:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-90eaa0315695119d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 strlen1\n\n\nContents of section .text:\n 0000 90820000 10400005 00001821 24840001 .....@.....!$...\n 0010 90820000 1440fffd 24630001 03e00008 .....@..$c......\n 0020 00601021 00000000 00000000 00000000 .`.!............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 strlen1(u8 * a0) {\n u8 * v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n while (*v0 != 0) {\n v0 = v0 + 1;\n v1 = v1 + 1;\n }\n return v1;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 strlen1(u8 *arg0) {\n s32 var_v1;\n u8 *var_a0;\n\n var_a0 = arg0;\n var_v1 = 0;\n if (*var_a0 != 0) {\n do {\n var_a0 += 1;\n var_v1 += 1;\n } while (*var_a0 != 0);\n }\n return var_v1;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strlen1` — benchmark function synthetic:strlen1:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel strlen1\n lbu\t$v0, 0($a0)\n beqz\t$v0, .L1c\n move\t$v1, $zero\n.Lc:\n addiu\t$a0, $a0, 1\n lbu\t$v0, 0($a0)\n bnez\t$v0, .Lc\n addiu\t$v1, $v1, 1\n.L1c:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strlen1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strlen1` — benchmark function synthetic:strlen1:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strlen1:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tv0,0(a0)\n 4:\tbeqz\tv0,1c \n 8:\tmove\tv1,zero\n c:\taddiu\ta0,a0,1\n 10:\tlbu\tv0,0(a0)\n 14:\tbnez\tv0,c \n 18:\taddiu\tv1,v1,1\n 1c:\tjr\tra\n 20:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-90eaa0315695119d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 strlen1\n\n\nContents of section .text:\n 0000 90820000 10400005 00001821 24840001 .....@.....!$...\n 0010 90820000 1440fffd 24630001 03e00008 .....@..$c......\n 0020 00601021 00000000 00000000 00000000 .`.!............\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name strlen1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strlen1:ido7.1","sym":"strlen1","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","while","memory","pointer"],"loc":1,"refSource":"int strlen1(char *s){ int n=0; while(*s){n++;s++;} return n; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tt6,0(a0)\n 4:\tmove\tv1,zero\n 8:\tbeqz\tt6,24 \n c:\tnop\n 10:\tlbu\tt7,1(a0)\n 14:\taddiu\tv1,v1,1\n 18:\taddiu\ta0,a0,1\n 1c:\tbnezl\tt7,14 \n 20:\tlbu\tt7,1(a0)\n 24:\tjr\tra\n 28:\tmove\tv0,v1\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c strlen1\n\n\nContents of section .text:\n 0000 908e0000 00001825 11c00006 00000000 .......%........\n 0010 908f0001 24630001 24840001 55e0fffd ....$c..$...U...\n 0020 908f0001 03e00008 00601025 00000000 .........`.%....\nContents of section .options:\n 0000 01200000 00000000 8000c01c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c01c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000004 00000198 p...............\n 0010 00000005 000002dc 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 00000008 0000027c 00000001 00000284 .......|........\n 0050 00000000 00000000 00000001 000002cc ................\n 0060 08010000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000002c 20200001 00000001 ......., ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 30656161 30333135 36393531 ef-90eaa03156951\n 0130 3139642f 7265662e 63007374 726c656e 19d/ref.c.strlen\n 0140 31000000 7374726c 656e3100 00000000 1...strlen1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000b 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'strlen1' — lift: cannot lift 'strlen1': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tlbu\tt6,0(a0) */\n/* 4:\tmove\tv1,zero */\n/* 8:\tbeqz\tt6,24 */\n/* c:\tnop */\n/* 10:\tlbu\tt7,1(a0) */\n/* 14:\taddiu\tv1,v1,1 */\n/* 18:\taddiu\ta0,a0,1 */\n/* 1c:\tbnezl\tt7,14 */\n/* 20:\tlbu\tt7,1(a0) */\n/* 24:\tjr\tra */\n/* 28:\tmove\tv0,v1 */\n/* 2c:\tnop */\nvoid strlen1(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'strlen1': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'strlen1': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 strlen1(u8 *arg0) {\n s32 var_v1;\n u8 *var_a0;\n u8 temp_t7;\n\n var_a0 = arg0;\n var_v1 = 0;\n if (*var_a0 != 0) {\n do {\n temp_t7 = var_a0->unk1;\n var_v1 += 1;\n var_a0 += 1;\n } while (temp_t7 != 0);\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":1,"quality":{"score":100,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 11: Selector requires struct/union pointer as left hand side"]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strlen1` — benchmark function synthetic:strlen1:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel strlen1\n lbu\t$t6, 0($a0)\n move\t$v1, $zero\n beqz\t$t6, .L24\n nop\n lbu\t$t7, 1($a0)\n.L14:\n addiu\t$v1, $v1, 1\n addiu\t$a0, $a0, 1\n bnezl\t$t7, .L14\n lbu\t$t7, 1($a0)\n.L24:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strlen1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strlen1` — benchmark function synthetic:strlen1:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strlen1:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlbu\tt6,0(a0)\n 4:\tmove\tv1,zero\n 8:\tbeqz\tt6,24 \n c:\tnop\n 10:\tlbu\tt7,1(a0)\n 14:\taddiu\tv1,v1,1\n 18:\taddiu\ta0,a0,1\n 1c:\tbnezl\tt7,14 \n 20:\tlbu\tt7,1(a0)\n 24:\tjr\tra\n 28:\tmove\tv0,v1\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c strlen1\n\n\nContents of section .text:\n 0000 908e0000 00001825 11c00006 00000000 .......%........\n 0010 908f0001 24630001 24840001 55e0fffd ....$c..$...U...\n 0020 908f0001 03e00008 00601025 00000000 .........`.%....\nContents of section .options:\n 0000 01200000 00000000 8000c01c 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c01c 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000004 00000198 p...............\n 0010 00000005 000002dc 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 00000008 0000027c 00000001 00000284 .......|........\n 0050 00000000 00000000 00000001 000002cc ................\n 0060 08010000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000002c 20200001 00000001 ......., ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d39 30656161 30333135 36393531 ef-90eaa03156951\n 0130 3139642f 7265662e 63007374 726c656e 19d/ref.c.strlen\n 0140 31000000 7374726c 656e3100 00000000 1...strlen1.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000b 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name strlen1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:strlen1:mwcc_242_81","sym":"strlen1","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","while","memory","pointer"],"loc":1,"refSource":"int strlen1(char *s){ int n=0; while(*s){n++;s++;} return n; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r4,0\n 4:\tb 10 \n 8:\taddi r4,r4,1\n c:\taddi r3,r3,1\n 10:\tlbz r0,0(r3)\n 14:\textsb. r0,r0\n 18:\tbne 8 \n 1c:\tmr r3,r4\n 20:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000024 strlen1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 strlen1\n\n\nContents of section .text:\n 0000 38800000 4800000c 38840001 38630001 8...H...8...8c..\n 0010 88030000 7c000775 4082fff0 7c832378 ....|..u@...|.#x\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 strlen1(u8 * a0) {\n u8 * v0;\n s32 v1;\n v0 = a0;\n v1 = 0;\n while ((s8)*v0 != 0) {\n v1 = v1 + 1;\n v0 = v0 + 1;\n }\n return v1;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 strlen1(u8 *arg0) {\n s32 var_r4;\n u8 *var_r3;\n\n var_r3 = arg0;\n var_r4 = 0;\nloop_2:\n if ((s8) *var_r3 != 0) {\n var_r4 += 1;\n var_r3 += 1;\n goto loop_2;\n }\n return var_r4;\n}\n","score":7,"maxScore":12,"compileErrors":null,"breakdown":{"insert":3,"delete":3,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":88,"lines":13,"gotos":1,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `strlen1` — benchmark function synthetic:strlen1:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel strlen1\n li r4,0\n b .L10\n.L8:\n addi r4,r4,1\n addi r3,r3,1\n.L10:\n lbz r0,0(r3)\n extsb. r0,r0\n bne .L8\n mr r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function strlen1 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `strlen1` — benchmark function synthetic:strlen1:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:strlen1:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r4,0\n 4:\tb 10 \n 8:\taddi r4,r4,1\n c:\taddi r3,r3,1\n 10:\tlbz r0,0(r3)\n 14:\textsb. r0,r0\n 18:\tbne 8 \n 1c:\tmr r3,r4\n 20:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000024 strlen1\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 strlen1\n\n\nContents of section .text:\n 0000 38800000 4800000c 38840001 38630001 8...H...8...8c..\n 0010 88030000 7c000775 4082fff0 7c832378 ....|..u@...|.#x\n 0020 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000024 00000000 ...$.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name strlen1 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:structarr:agbcc","sym":"structarr","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","struct","memory","array"],"loc":2,"refSource":"struct P{int x;int y;};\nint structarr(struct P *a,int n){ int s=0,i; for(i=0;i= a1) {\n v1 = 0;\n } else {\n v0 = a0;\n v1 = 0;\n v2 = a1;\n do {\n v1 = v1 + *v0;\n v0 = v0 + 2;\n v2 = v2 - 1;\n } while (v2 != 0);\n }\n return v1;\n}\n","score":5,"maxScore":15,"compileErrors":null,"breakdown":{"insert":3,"delete":1,"replace":0,"opMismatch":1,"argMismatch":0},"quality":{"score":100,"lines":18,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 structarr(s32 *arg0, s32 arg1) {\n s32 *var_r2;\n s32 var_r1;\n s32 var_r3;\n\n var_r1 = arg1;\n var_r3 = 0;\n if (var_r1 > 0) {\n var_r2 = arg0;\n do {\n var_r3 += *var_r2;\n var_r2 += 8;\n var_r1 -= 1;\n } while (var_r1 != 0);\n }\n return var_r3;\n}\n","score":3,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":12,"ratio":0.25,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":2}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `structarr` — benchmark function synthetic:structarr:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstructarr\n\t.type\t structarr,function\n\t.thumb_func\nstructarr:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tldr\tr0, [r2]\n\tadd\tr3, r3, r0\n\tadd\tr2, r2, #0x8\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t structarr,.Lfe1-structarr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function structarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `structarr` — benchmark function synthetic:structarr:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:structarr:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tstructarr\n\t.type\t structarr,function\n\t.thumb_func\nstructarr:\n\tmov\tr3, #0x0\n\tcmp\tr3, r1\n\tbge\t.L4\t@cond_branch\n\tadd\tr2, r0, #0\n.L6:\n\tldr\tr0, [r2]\n\tadd\tr3, r3, r0\n\tadd\tr2, r2, #0x8\n\tsub\tr1, r1, #0x1\n\tcmp\tr1, #0\n\tbne\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r3, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t structarr,.Lfe1-structarr\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name structarr # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:structarr:gcc2.7.2kmc","sym":"structarr","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","struct","memory","array"],"loc":2,"refSource":"struct P{int x;int y;};\nint structarr(struct P *a,int n){ int s=0,i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,28 \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\taddiu\ta2,a2,1\n 18:\taddu\tv1,v1,v0\n 1c:\tslt\tv0,a2,a1\n 20:\tbnez\tv0,10 \n 24:\taddiu\ta0,a0,8\n 28:\tmove\tv0,v1\n 2c:\tjr\tra\n 30:\taddiu\tsp,sp,8\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3fd782bcc0049d41/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 structarr\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00007 00001821 '.....0!.......!\n 0010 8c820000 24c60001 00621821 00c5102a ....$....b.!...*\n 0020 1440fffb 24840008 00601021 03e00008 .@..$....`.!....\n 0030 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 structarr(s32 * a0, s32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n v0 = a0;\n v1 = 0;\n v2 = 0;\n while (v1 < a1) {\n v1 = v1 + 1;\n v2 = v2 + *v0;\n v0 = v0 + 2;\n }\n return v2;\n}\n","score":6,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 structarr(s32 *arg0, s32 arg1) {\n s32 *var_a0;\n s32 var_a2;\n s32 var_v1;\n\n var_a0 = arg0;\n var_a2 = 0;\n var_v1 = 0;\n if (arg1 > 0) {\n do {\n var_a2 += 1;\n var_v1 += *var_a0;\n var_a0 += 8;\n } while (var_a2 < arg1);\n }\n return var_v1;\n}\n","score":9,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":6,"maxScore":13,"ratio":0.46153846153846156,"kinds":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `structarr` — benchmark function synthetic:structarr:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel structarr\n addiu\t$sp, $sp, -8\n move\t$a2, $zero\n blez\t$a1, .L28\n move\t$v1, $zero\n.L10:\n lw\t$v0, 0($a0)\n addiu\t$a2, $a2, 1\n addu\t$v1, $v1, $v0\n slt\t$v0, $a2, $a1\n bnez\t$v0, .L10\n addiu\t$a0, $a0, 8\n.L28:\n move\t$v0, $v1\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function structarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `structarr` — benchmark function synthetic:structarr:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:structarr:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\ta2,zero\n 8:\tblez\ta1,28 \n c:\tmove\tv1,zero\n 10:\tlw\tv0,0(a0)\n 14:\taddiu\ta2,a2,1\n 18:\taddu\tv1,v1,v0\n 1c:\tslt\tv0,a2,a1\n 20:\tbnez\tv0,10 \n 24:\taddiu\ta0,a0,8\n 28:\tmove\tv0,v1\n 2c:\tjr\tra\n 30:\taddiu\tsp,sp,8\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-3fd782bcc0049d41/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000034 structarr\n\n\nContents of section .text:\n 0000 27bdfff8 00003021 18a00007 00001821 '.....0!.......!\n 0010 8c820000 24c60001 00621821 00c5102a ....$....b.!...*\n 0020 1440fffb 24840008 00601021 03e00008 .@..$....`.!....\n 0030 27bd0008 00000000 00000000 00000000 '...............\nContents of section .reginfo:\n 0000 a000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name structarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:structarr:ido7.1","sym":"structarr","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","struct","memory","array"],"loc":2,"refSource":"struct P{int x;int y;};\nint structarr(struct P *a,int n){ int s=0,i; for(i=0;i:\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,70 \n 8:\tmove\tv0,zero\n c:\tandi\tt0,a1,0x3\n 10:\tbeqz\tt0,38 \n 14:\tmove\ta3,t0\n 18:\tsll\tt6,zero,0x3\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\tt7,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\taddiu\ta2,a2,8\n 2c:\tbne\ta3,v0,20 \n 30:\taddu\tv1,v1,t7\n 34:\tbeq\tv0,a1,70 \n 38:\tsll\tt8,v0,0x3\n 3c:\tsll\tt9,a1,0x3\n 40:\taddu\ta3,t9,a0\n 44:\taddu\ta2,a0,t8\n 48:\tlw\tt1,0(a2)\n 4c:\tlw\tt2,8(a2)\n 50:\tlw\tt3,16(a2)\n 54:\taddu\tv1,v1,t1\n 58:\tlw\tt4,24(a2)\n 5c:\taddu\tv1,v1,t2\n 60:\taddiu\ta2,a2,32\n 64:\taddu\tv1,v1,t3\n 68:\tbne\ta2,a3,48 \n 6c:\taddu\tv1,v1,t4\n 70:\tjr\tra\n 74:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 structarr\n\n\nContents of section .text:\n 0000 00001825 18a0001a 00001025 30a80003 ...%.......%0...\n 0010 11000009 01003825 000070c0 008e3021 ......8%..p...0!\n 0020 8ccf0000 24420001 24c60008 14e2fffc ....$B..$.......\n 0030 006f1821 1045000e 0002c0c0 0005c8c0 .o.!.E..........\n 0040 03243821 00983021 8cc90000 8cca0008 .$8!..0!........\n 0050 8ccb0010 00691821 8ccc0018 006a1821 .....i.!.....j.!\n 0060 24c60020 006b1821 14c7fff7 006c1821 $.. .k.!.....l.!\n 0070 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8300dffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300dffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000004 000001e8 p...............\n 0010 00000005 00000330 00000001 000001ec .......0........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000038 00000294 .......P...8....\n 0040 0000000c 000002cc 00000001 000002d8 ................\n 0050 00000000 00000000 00000001 00000320 ............... \n 0060 08080802 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000078 20200001 00000001 .......x ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 66643738 32626363 30303439 ef-3fd782bcc0049\n 0130 6434312f 7265662e 63007374 72756374 d41/ref.c.struct\n 0140 61727200 73747275 63746172 72000000 arr.structarr...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 0000001e ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000004 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'structarr' — lift: cannot lift 'structarr': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow) */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tblez\ta1,70 */\n/* 8:\tmove\tv0,zero */\n/* c:\tandi\tt0,a1,0x3 */\n/* 10:\tbeqz\tt0,38 */\n/* 14:\tmove\ta3,t0 */\n/* 18:\tsll\tt6,zero,0x3 */\n/* 1c:\taddu\ta2,a0,t6 */\n/* 20:\tlw\tt7,0(a2) */\n/* 24:\taddiu\tv0,v0,1 */\n/* 28:\taddiu\ta2,a2,8 */\n/* 2c:\tbne\ta3,v0,20 */\n/* 30:\taddu\tv1,v1,t7 */\n/* 34:\tbeq\tv0,a1,70 */\n/* 38:\tsll\tt8,v0,0x3 */\n/* 3c:\tsll\tt9,a1,0x3 */\n/* 40:\taddu\ta3,t9,a0 */\n/* 44:\taddu\ta2,a0,t8 */\n/* 48:\tlw\tt1,0(a2) */\n/* 4c:\tlw\tt2,8(a2) */\n/* 50:\tlw\tt3,16(a2) */\n/* 54:\taddu\tv1,v1,t1 */\n/* 58:\tlw\tt4,24(a2) */\n/* 5c:\taddu\tv1,v1,t2 */\n/* 60:\taddiu\ta2,a2,32 */\n/* 64:\taddu\tv1,v1,t3 */\n/* 68:\tbne\ta2,a3,48 */\n/* 6c:\taddu\tv1,v1,t4 */\n/* 70:\tjr\tra */\n/* 74:\tmove\tv0,v1 */\n/* \t... */\nvoid structarr(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'structarr': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":39,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'structarr': branch to 0x38 is not a block boundary (out-of-range / mid-instruction target — tail branch or unrecovered control flow)"]},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 structarr(s32 arg0, s32 arg1) {\n s32 *var_a2;\n s32 temp_t0;\n s32 temp_t3;\n s32 temp_t4;\n s32 temp_t7;\n s32 temp_v1;\n s32 var_v0;\n s32 var_v1;\n void *var_a2_2;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg1 > 0) {\n temp_t0 = arg1 & 3;\n if (temp_t0 != 0) {\n var_a2 = arg0 + (0 * 8);\n do {\n temp_t7 = *var_a2;\n var_v0 += 1;\n var_a2 += 8;\n var_v1 += temp_t7;\n } while (temp_t0 != var_v0);\n if (var_v0 != arg1) {\n goto block_5;\n }\n } else {\nblock_5:\n var_a2_2 = arg0 + (var_v0 * 8);\n do {\n temp_t3 = var_a2_2->unk10;\n temp_t4 = var_a2_2->unk18;\n temp_v1 = var_v1 + var_a2_2->unk0 + var_a2_2->unk8;\n var_a2_2 += 0x20;\n var_v1 = temp_v1 + temp_t3 + temp_t4;\n } while (var_a2_2 != ((arg1 * 8) + arg0));\n }\n }\n return var_v1;\n}\n","score":null,"maxScore":null,"compileErrors":5,"quality":{"score":88,"lines":39,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["cfe: Error: /cand.c, line 32: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 33: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 34: Selector requires struct/union pointer as left hand side","cfe: Error: /cand.c, line 35: Bad operand type for += or -=","cfe: Error: /cand.c, line 37: Unacceptable operand of == or !="]},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `structarr` — benchmark function synthetic:structarr:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel structarr\n move\t$v1, $zero\n blez\t$a1, .L70\n move\t$v0, $zero\n andi\t$t0, $a1, 0x3\n beqz\t$t0, .L38\n move\t$a3, $t0\n sll\t$t6, $zero, 0x3\n addu\t$a2, $a0, $t6\n.L20:\n lw\t$t7, 0($a2)\n addiu\t$v0, $v0, 1\n addiu\t$a2, $a2, 8\n bne\t$a3, $v0, .L20\n addu\t$v1, $v1, $t7\n beq\t$v0, $a1, .L70\n.L38:\n sll\t$t8, $v0, 0x3\n sll\t$t9, $a1, 0x3\n addu\t$a3, $t9, $a0\n addu\t$a2, $a0, $t8\n.L48:\n lw\t$t1, 0($a2)\n lw\t$t2, 8($a2)\n lw\t$t3, 16($a2)\n addu\t$v1, $v1, $t1\n lw\t$t4, 24($a2)\n addu\t$v1, $v1, $t2\n addiu\t$a2, $a2, 32\n addu\t$v1, $v1, $t3\n bne\t$a2, $a3, .L48\n addu\t$v1, $v1, $t4\n.L70:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function structarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `structarr` — benchmark function synthetic:structarr:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:structarr:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta1,70 \n 8:\tmove\tv0,zero\n c:\tandi\tt0,a1,0x3\n 10:\tbeqz\tt0,38 \n 14:\tmove\ta3,t0\n 18:\tsll\tt6,zero,0x3\n 1c:\taddu\ta2,a0,t6\n 20:\tlw\tt7,0(a2)\n 24:\taddiu\tv0,v0,1\n 28:\taddiu\ta2,a2,8\n 2c:\tbne\ta3,v0,20 \n 30:\taddu\tv1,v1,t7\n 34:\tbeq\tv0,a1,70 \n 38:\tsll\tt8,v0,0x3\n 3c:\tsll\tt9,a1,0x3\n 40:\taddu\ta3,t9,a0\n 44:\taddu\ta2,a0,t8\n 48:\tlw\tt1,0(a2)\n 4c:\tlw\tt2,8(a2)\n 50:\tlw\tt3,16(a2)\n 54:\taddu\tv1,v1,t1\n 58:\tlw\tt4,24(a2)\n 5c:\taddu\tv1,v1,t2\n 60:\taddiu\ta2,a2,32\n 64:\taddu\tv1,v1,t3\n 68:\tbne\ta2,a3,48 \n 6c:\taddu\tv1,v1,t4\n 70:\tjr\tra\n 74:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000080 .text\n00000000 g F .text\t00000078 structarr\n\n\nContents of section .text:\n 0000 00001825 18a0001a 00001025 30a80003 ...%.......%0...\n 0010 11000009 01003825 000070c0 008e3021 ......8%..p...0!\n 0020 8ccf0000 24420001 24c60008 14e2fffc ....$B..$.......\n 0030 006f1821 1045000e 0002c0c0 0005c8c0 .o.!.E..........\n 0040 03243821 00983021 8cc90000 8cca0008 .$8!..0!........\n 0050 8ccb0010 00691821 8ccc0018 006a1821 .....i.!.....j.!\n 0060 24c60020 006b1821 14c7fff7 006c1821 $.. .k.!.....l.!\n 0070 03e00008 00601025 00000000 00000000 .....`.%........\nContents of section .options:\n 0000 01200000 00000000 8300dffc 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8300dffc 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001e 00000004 000001e8 p...............\n 0010 00000005 00000330 00000001 000001ec .......0........\n 0020 00000004 00000220 00000000 00000000 ....... ........\n 0030 00000011 00000250 00000038 00000294 .......P...8....\n 0040 0000000c 000002cc 00000001 000002d8 ................\n 0050 00000000 00000000 00000001 00000320 ............... \n 0060 08080802 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000003 ................\n 0090 00000003 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000078 20200001 00000001 .......x ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d33 66643738 32626363 30303439 ef-3fd782bcc0049\n 0130 6434312f 7265662e 63007374 72756374 d41/ref.c.struct\n 0140 61727200 73747275 63746172 72000000 arr.structarr...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 0000001e ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000004 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name structarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:structarr:mwcc_242_81","sym":"structarr","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","struct","memory","array"],"loc":2,"refSource":"struct P{int x;int y;};\nint structarr(struct P *a,int n){ int s=0,i; for(i=0;i:\n 0:\tcmpwi r4,0\n 4:\tli r7,0\n 8:\tli r8,0\n c:\tble a8 \n 10:\tcmpwi r4,8\n 14:\taddi r5,r4,-8\n 18:\tble 80 \n 1c:\taddi r0,r5,7\n 20:\tmr r6,r3\n 24:\tsrwi r0,r0,3\n 28:\tmtctr r0\n 2c:\tcmpwi r5,0\n 30:\tble 80 \n 34:\tlwz r5,0(r6)\n 38:\taddi r8,r8,8\n 3c:\tlwz r0,8(r6)\n 40:\tadd r7,r7,r5\n 44:\tlwz r5,16(r6)\n 48:\tadd r7,r7,r0\n 4c:\tlwz r0,24(r6)\n 50:\tadd r7,r7,r5\n 54:\tlwz r5,32(r6)\n 58:\tadd r7,r7,r0\n 5c:\tlwz r0,40(r6)\n 60:\tadd r7,r7,r5\n 64:\tlwz r5,48(r6)\n 68:\tadd r7,r7,r0\n 6c:\tlwz r0,56(r6)\n 70:\tadd r7,r7,r5\n 74:\taddi r6,r6,64\n 78:\tadd r7,r7,r0\n 7c:\tbdnz 34 \n 80:\tslwi r5,r8,3\n 84:\tsubf r0,r8,r4\n 88:\tadd r3,r3,r5\n 8c:\tmtctr r0\n 90:\tcmpw r8,r4\n 94:\tbge a8 \n 98:\tlwz r0,0(r3)\n 9c:\taddi r3,r3,8\n a0:\tadd r7,r7,r0\n a4:\tbdnz 98 \n a8:\tmr r3,r7\n ac:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000b0 structarr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 structarr\n\n\nContents of section .text:\n 0000 2c040000 38e00000 39000000 4081009c ,...8...9...@...\n 0010 2c040008 38a4fff8 40810068 38050007 ,...8...@..h8...\n 0020 7c661b78 5400e8fe 7c0903a6 2c050000 |f.xT...|...,...\n 0030 40810050 80a60000 39080008 80060008 @..P....9.......\n 0040 7ce72a14 80a60010 7ce70214 80060018 |.*.....|.......\n 0050 7ce72a14 80a60020 7ce70214 80060028 |.*.... |......(\n 0060 7ce72a14 80a60030 7ce70214 80060038 |.*....0|......8\n 0070 7ce72a14 38c60040 7ce70214 4200ffb8 |.*.8..@|...B...\n 0080 55051838 7c082050 7c632a14 7c0903a6 U..8|. P|c*.|...\n 0090 7c082000 40800014 80030000 38630008 |. .@.......8c..\n 00a0 7ce70214 4200fff4 7ce33b78 4e800020 |...B...|.;xN.. \nContents of section .mwcats.text:\n 0000 020000b0 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 structarr(s32 * a0, u32 a1) {\n s32 * v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 * v4;\n s32 v5;\n s32 v6;\n if (a1 <= 0) {\n v2 = 0;\n } else {\n if (a1 <= 8) {\n v1 = 0;\n v2 = 0;\n } else {\n v0 = a0;\n v1 = 0;\n v2 = 0;\n for (v3 = a1 + -8 + 7 >> 3; v3 != 0; v3 = v3 - 1) {\n v1 = v1 + 8;\n v2 = v2 + *v0 + v0[2] + v0[4] + v0[6] + v0[8] + v0[10] + v0[12] + v0[14];\n v0 = v0 + 16;\n }\n }\n v5 = v2;\n v6 = a1 - v1;\n v4 = a0 + (v1 << 3);\n while (v6 != 0) {\n v5 = v5 + *v4;\n v4 = v4 + 2;\n v6 = v6 - 1;\n }\n v2 = v5;\n }\n return v2;\n}\n","score":113,"maxScore":120,"compileErrors":null,"breakdown":{"insert":76,"delete":3,"replace":6,"opMismatch":6,"argMismatch":22},"quality":{"score":100,"lines":36,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 structarr(void *arg0, s32 arg1) {\n s32 *var_r3;\n s32 temp_r0;\n s32 temp_r0_2;\n s32 temp_r5;\n s32 temp_r7;\n s32 var_ctr_2;\n s32 var_r7;\n s32 var_r8;\n u32 var_ctr;\n void *var_r6;\n\n var_r7 = 0;\n var_r8 = 0;\n if (arg1 > 0) {\n temp_r5 = arg1 - 8;\n if (arg1 > 8) {\n var_r6 = arg0;\n var_ctr = (u32) (temp_r5 + 7) >> 3U;\n if (temp_r5 > 0) {\n do {\n var_r8 += 8;\n temp_r0 = var_r6->unk38;\n temp_r7 = var_r7 + var_r6->unk0 + var_r6->unk8 + var_r6->unk10 + var_r6->unk18 + var_r6->unk20 + var_r6->unk28 + var_r6->unk30;\n var_r6 += 0x40;\n var_r7 = temp_r7 + temp_r0;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_r3 = arg0 + (var_r8 * 8);\n var_ctr_2 = arg1 - var_r8;\n if (var_r8 < arg1) {\n do {\n temp_r0_2 = *var_r3;\n var_r3 += 8;\n var_r7 += temp_r0_2;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r7;\n}\n","score":null,"maxScore":null,"compileErrors":4,"quality":{"score":100,"lines":42,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class","# Error: ^^","# Error: ^","# illegal type"]},"gapSize":{"decompiler":"asmlift","score":113,"maxScore":120,"ratio":0.9416666666666667,"kinds":{"insert":76,"delete":3,"replace":6,"opMismatch":6,"argMismatch":22}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `structarr` — benchmark function synthetic:structarr:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel structarr\n cmpwi r4,0\n li r7,0\n li r8,0\n ble .La8\n cmpwi r4,8\n addi r5,r4,-8\n ble .L80\n addi r0,r5,7\n mr r6,r3\n srwi r0,r0,3\n mtctr r0\n cmpwi r5,0\n ble .L80\n.L34:\n lwz r5,0(r6)\n addi r8,r8,8\n lwz r0,8(r6)\n add r7,r7,r5\n lwz r5,16(r6)\n add r7,r7,r0\n lwz r0,24(r6)\n add r7,r7,r5\n lwz r5,32(r6)\n add r7,r7,r0\n lwz r0,40(r6)\n add r7,r7,r5\n lwz r5,48(r6)\n add r7,r7,r0\n lwz r0,56(r6)\n add r7,r7,r5\n addi r6,r6,64\n add r7,r7,r0\n bdnz .L34\n.L80:\n slwi r5,r8,3\n subf r0,r8,r4\n add r3,r3,r5\n mtctr r0\n cmpw r8,r4\n bge .La8\n.L98:\n lwz r0,0(r3)\n addi r3,r3,8\n add r7,r7,r0\n bdnz .L98\n.La8:\n mr r3,r7\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function structarr # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `structarr` — benchmark function synthetic:structarr:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:structarr:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r4,0\n 4:\tli r7,0\n 8:\tli r8,0\n c:\tble a8 \n 10:\tcmpwi r4,8\n 14:\taddi r5,r4,-8\n 18:\tble 80 \n 1c:\taddi r0,r5,7\n 20:\tmr r6,r3\n 24:\tsrwi r0,r0,3\n 28:\tmtctr r0\n 2c:\tcmpwi r5,0\n 30:\tble 80 \n 34:\tlwz r5,0(r6)\n 38:\taddi r8,r8,8\n 3c:\tlwz r0,8(r6)\n 40:\tadd r7,r7,r5\n 44:\tlwz r5,16(r6)\n 48:\tadd r7,r7,r0\n 4c:\tlwz r0,24(r6)\n 50:\tadd r7,r7,r5\n 54:\tlwz r5,32(r6)\n 58:\tadd r7,r7,r0\n 5c:\tlwz r0,40(r6)\n 60:\tadd r7,r7,r5\n 64:\tlwz r5,48(r6)\n 68:\tadd r7,r7,r0\n 6c:\tlwz r0,56(r6)\n 70:\tadd r7,r7,r5\n 74:\taddi r6,r6,64\n 78:\tadd r7,r7,r0\n 7c:\tbdnz 34 \n 80:\tslwi r5,r8,3\n 84:\tsubf r0,r8,r4\n 88:\tadd r3,r3,r5\n 8c:\tmtctr r0\n 90:\tcmpw r8,r4\n 94:\tbge a8 \n 98:\tlwz r0,0(r3)\n 9c:\taddi r3,r3,8\n a0:\tadd r7,r7,r0\n a4:\tbdnz 98 \n a8:\tmr r3,r7\n ac:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t000000b0 structarr\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 structarr\n\n\nContents of section .text:\n 0000 2c040000 38e00000 39000000 4081009c ,...8...9...@...\n 0010 2c040008 38a4fff8 40810068 38050007 ,...8...@..h8...\n 0020 7c661b78 5400e8fe 7c0903a6 2c050000 |f.xT...|...,...\n 0030 40810050 80a60000 39080008 80060008 @..P....9.......\n 0040 7ce72a14 80a60010 7ce70214 80060018 |.*.....|.......\n 0050 7ce72a14 80a60020 7ce70214 80060028 |.*.... |......(\n 0060 7ce72a14 80a60030 7ce70214 80060038 |.*....0|......8\n 0070 7ce72a14 38c60040 7ce70214 4200ffb8 |.*.8..@|...B...\n 0080 55051838 7c082050 7c632a14 7c0903a6 U..8|. P|c*.|...\n 0090 7c082000 40800014 80030000 38630008 |. .@.......8c..\n 00a0 7ce70214 4200fff4 7ce33b78 4e800020 |...B...|.;xN.. \nContents of section .mwcats.text:\n 0000 020000b0 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name structarr # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sub:agbcc","sym":"sub","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int sub(int a,int b){ return a-b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsub\n\t.type\t sub,function\n\t.thumb_func\nsub:\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sub,.Lfe1-sub\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sub(u32 a0, u32 a1) {\n return a0 - a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sub(s32 arg0, s32 arg1) {\n return arg0 - arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub` — benchmark function synthetic:sub:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsub\n\t.type\t sub,function\n\t.thumb_func\nsub:\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sub,.Lfe1-sub\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sub` — benchmark function synthetic:sub:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sub:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsub\n\t.type\t sub,function\n\t.thumb_func\nsub:\n\tsub\tr0, r0, r1\n\tbx\tlr\n.Lfe1:\n\t.size\t sub,.Lfe1-sub\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sub:gcc2.7.2kmc","sym":"sub","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int sub(int a,int b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsubu\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b50330a37fdfc67d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 sub\n\n\nContents of section .text:\n 0000 03e00008 00851023 00000000 00000000 .......#........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sub(u32 a0, u32 a1) {\n return a0 - a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sub(s32 arg0, s32 arg1) {\n return arg0 - arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub` — benchmark function synthetic:sub:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sub\n jr\t$ra\n subu\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sub` — benchmark function synthetic:sub:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sub:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsubu\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b50330a37fdfc67d/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 sub\n\n\nContents of section .text:\n 0000 03e00008 00851023 00000000 00000000 .......#........\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sub:ido7.1","sym":"sub","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic"],"loc":1,"refSource":"int sub(int a,int b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsubu\tv0,a0,a1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 sub\n\n\nContents of section .text:\n 0000 03e00008 00851023 00000000 00000000 .......#........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 35303333 30613337 66646663 ef-b50330a37fdfc\n 0130 3637642f 7265662e 63007375 62000000 67d/ref.c.sub...\n 0140 73756200 00000000 00000001 00000000 sub.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sub(u32 a0, u32 a1) {\n return a0 - a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sub(s32 arg0, s32 arg1) {\n return arg0 - arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub` — benchmark function synthetic:sub:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sub\n jr\t$ra\n subu\t$v0, $a0, $a1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sub` — benchmark function synthetic:sub:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sub:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tsubu\tv0,a0,a1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 sub\n\n\nContents of section .text:\n 0000 03e00008 00851023 00000000 00000000 .......#........\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b4 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000004 00000258 00000001 0000025c .......X.......\\\n 0050 00000000 00000000 00000001 000002a4 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 35303333 30613337 66646663 ef-b50330a37fdfc\n 0130 3637642f 7265662e 63007375 62000000 67d/ref.c.sub...\n 0140 73756200 00000000 00000001 00000000 sub.............\n 0150 00000032 00000000 00000004 00000000 ...2............\n 0160 00000002 00000000 00000000 00000001 ................\n 0170 00000000 00000011 00000000 00000000 ................\n 0180 01800000 00000000 00000001 00000000 ................\n 0190 00000000 00000000 18200001 00000000 ......... ......\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 7fffffff 00000000 00000000 ................\n 01c0 00000002 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sub:mwcc_242_81","sym":"sub","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic"],"loc":1,"refSource":"int sub(int a,int b){ return a-b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsubf r3,r4,r3\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sub\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sub\n\n\nContents of section .text:\n 0000 7c641850 4e800020 |d.PN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sub(u32 a0, u32 a1) {\n return a0 - a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sub(s32 arg0, s32 arg1) {\n return arg0 - arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sub` — benchmark function synthetic:sub:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sub\n subf r3,r4,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sub # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sub` — benchmark function synthetic:sub:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sub:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsubf r3,r4,r3\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 sub\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sub\n\n\nContents of section .text:\n 0000 7c641850 4e800020 |d.PN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sub # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sumto:agbcc","sym":"sumto","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["loop","for"],"loc":1,"refSource":"int sumto(int n){ int s=0,i; for(i=0;i 0) {\n do {\n var_r2 += var_r1;\n var_r1 += 1;\n } while (var_r1 < arg0);\n }\n return var_r2;\n}\n","score":2,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":1,"argMismatch":1},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sumto` — benchmark function synthetic:sumto:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsumto\n\t.type\t sumto,function\n\t.thumb_func\nsumto:\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tcmp\tr2, r0\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr2, r2, r1\n\tadd\tr1, r1, #0x1\n\tcmp\tr1, r0\n\tblt\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sumto,.Lfe1-sumto\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sumto # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sumto` — benchmark function synthetic:sumto:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sumto:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsumto\n\t.type\t sumto,function\n\t.thumb_func\nsumto:\n\tmov\tr2, #0x0\n\tmov\tr1, #0x0\n\tcmp\tr2, r0\n\tbge\t.L4\t@cond_branch\n.L6:\n\tadd\tr2, r2, r1\n\tadd\tr1, r1, #0x1\n\tcmp\tr1, r0\n\tblt\t.L6\t@cond_branch\n.L4:\n\tadd\tr0, r2, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sumto,.Lfe1-sumto\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sumto # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sumto:gcc2.7.2kmc","sym":"sumto","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["loop","for"],"loc":1,"refSource":"int sumto(int n){ int s=0,i; for(i=0;i:\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\tv1,zero\n 8:\tblez\ta0,24 \n c:\tmove\ta1,zero\n 10:\taddu\ta1,a1,v1\n 14:\taddiu\tv1,v1,1\n 18:\tslt\tv0,v1,a0\n 1c:\tbnezl\tv0,14 \n 20:\taddu\ta1,a1,v1\n 24:\tmove\tv0,a1\n 28:\tjr\tra\n 2c:\taddiu\tsp,sp,8\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a9448674df606c40/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 sumto\n\n\nContents of section .text:\n 0000 27bdfff8 00001821 18800006 00002821 '......!......(!\n 0010 00a32821 24630001 0064102a 5440fffd ..(!$c...d.*T@..\n 0020 00a32821 00a01021 03e00008 27bd0008 ..(!...!....'...\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sumto' — lift: cannot lift 'sumto': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-8 */\n/* 4:\tmove\tv1,zero */\n/* 8:\tblez\ta0,24 */\n/* c:\tmove\ta1,zero */\n/* 10:\taddu\ta1,a1,v1 */\n/* 14:\taddiu\tv1,v1,1 */\n/* 18:\tslt\tv0,v1,a0 */\n/* 1c:\tbnezl\tv0,14 */\n/* 20:\taddu\ta1,a1,v1 */\n/* 24:\tmove\tv0,a1 */\n/* 28:\tjr\tra */\n/* 2c:\taddiu\tsp,sp,8 */\nvoid sumto(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sumto': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":20,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sumto': unmodelled control transfer 'bnezl' at 0x1c — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sumto(s32 arg0) {\n s32 var_a1;\n s32 var_v1;\n\n var_v1 = 0;\n var_a1 = 0;\n if (arg0 > 0) {\n do {\n var_a1 += var_v1;\n var_v1 += 1;\n } while (var_v1 < arg0);\n }\n return var_a1;\n}\n","score":3,"maxScore":12,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":3,"maxScore":12,"ratio":0.25,"kinds":{"insert":0,"delete":2,"replace":1,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sumto` — benchmark function synthetic:sumto:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sumto\n addiu\t$sp, $sp, -8\n move\t$v1, $zero\n blez\t$a0, .L24\n move\t$a1, $zero\n addu\t$a1, $a1, $v1\n.L14:\n addiu\t$v1, $v1, 1\n slt\t$v0, $v1, $a0\n bnezl\t$v0, .L14\n addu\t$a1, $a1, $v1\n.L24:\n move\t$v0, $a1\n jr\t$ra\n addiu\t$sp, $sp, 8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sumto # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sumto` — benchmark function synthetic:sumto:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sumto:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-8\n 4:\tmove\tv1,zero\n 8:\tblez\ta0,24 \n c:\tmove\ta1,zero\n 10:\taddu\ta1,a1,v1\n 14:\taddiu\tv1,v1,1\n 18:\tslt\tv0,v1,a0\n 1c:\tbnezl\tv0,14 \n 20:\taddu\ta1,a1,v1\n 24:\tmove\tv0,a1\n 28:\tjr\tra\n 2c:\taddiu\tsp,sp,8\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a9448674df606c40/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000030 sumto\n\n\nContents of section .text:\n 0000 27bdfff8 00001821 18800006 00002821 '......!......(!\n 0010 00a32821 24630001 0064102a 5440fffd ..(!$c...d.*T@..\n 0020 00a32821 00a01021 03e00008 27bd0008 ..(!...!....'...\nContents of section .reginfo:\n 0000 a000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sumto # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sumto:ido7.1","sym":"sumto","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["loop","for"],"loc":1,"refSource":"int sumto(int n){ int s=0,i; for(i=0;i:\n 0:\tmove\tv1,zero\n 4:\tblez\ta0,54 \n 8:\tmove\tv0,zero\n c:\tandi\ta2,a0,0x3\n 10:\tbeqz\ta2,30 \n 14:\tmove\ta1,a2\n 18:\taddu\tv1,v1,v0\n 1c:\taddiu\tv0,v0,1\n 20:\tbnel\ta1,v0,1c \n 24:\taddu\tv1,v1,v0\n 28:\tbeq\tv0,a0,54 \n 2c:\tnop\n 30:\taddu\tv1,v1,v0\n 34:\taddu\tv1,v1,v0\n 38:\taddiu\tv1,v1,1\n 3c:\taddu\tv1,v1,v0\n 40:\taddiu\tv1,v1,2\n 44:\taddu\tv1,v1,v0\n 48:\taddiu\tv0,v0,4\n 4c:\tbne\tv0,a0,30 \n 50:\taddiu\tv1,v1,3\n 54:\tjr\tra\n 58:\tmove\tv0,v1\n 5c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t0000005c sumto\n\n\nContents of section .text:\n 0000 00001825 18800013 00001025 30860003 ...%.......%0...\n 0010 10c00007 00c02825 00621821 24420001 ......(%.b.!$B..\n 0020 54a2fffe 00621821 1044000a 00000000 T....b.!.D......\n 0030 00621821 00621821 24630001 00621821 .b.!.b.!$c...b.!\n 0040 24630002 00621821 24420004 1444fff8 $c...b.!$B...D..\n 0050 24630003 03e00008 00601025 00000000 $c.......`.%....\nContents of section .options:\n 0000 01200000 00000000 8000007c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000017 00000004 000001c8 p...............\n 0010 00000005 00000308 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 00000008 000002a8 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 08080400 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000005c 20200001 00000001 .......\\ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 39343438 36373464 66363036 ef-a9448674df606\n 0130 6334302f 7265662e 63007375 6d746f00 c40/ref.c.sumto.\n 0140 73756d74 6f000000 00000000 00000001 sumto...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000017 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000003 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sumto' — lift: cannot lift 'sumto': unmodelled control transfer 'bnel' at 0x20 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tmove\tv1,zero */\n/* 4:\tblez\ta0,54 */\n/* 8:\tmove\tv0,zero */\n/* c:\tandi\ta2,a0,0x3 */\n/* 10:\tbeqz\ta2,30 */\n/* 14:\tmove\ta1,a2 */\n/* 18:\taddu\tv1,v1,v0 */\n/* 1c:\taddiu\tv0,v0,1 */\n/* 20:\tbnel\ta1,v0,1c */\n/* 24:\taddu\tv1,v1,v0 */\n/* 28:\tbeq\tv0,a0,54 */\n/* 2c:\tnop */\n/* 30:\taddu\tv1,v1,v0 */\n/* 34:\taddu\tv1,v1,v0 */\n/* 38:\taddiu\tv1,v1,1 */\n/* 3c:\taddu\tv1,v1,v0 */\n/* 40:\taddiu\tv1,v1,2 */\n/* 44:\taddu\tv1,v1,v0 */\n/* 48:\taddiu\tv0,v0,4 */\n/* 4c:\tbne\tv0,a0,30 */\n/* 50:\taddiu\tv1,v1,3 */\n/* 54:\tjr\tra */\n/* 58:\tmove\tv0,v1 */\n/* 5c:\tnop */\nvoid sumto(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sumto': unmodelled control transfer 'bnel' at 0x20 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":32,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sumto': unmodelled control transfer 'bnel' at 0x20 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sumto(s32 arg0) {\n s32 temp_a2;\n s32 temp_v1;\n s32 var_v0;\n s32 var_v1;\n\n var_v1 = 0;\n var_v0 = 0;\n if (arg0 > 0) {\n temp_a2 = arg0 & 3;\n if (temp_a2 != 0) {\n do {\n var_v1 += var_v0;\n var_v0 += 1;\n } while (temp_a2 != var_v0);\n if (var_v0 != arg0) {\n goto loop_4;\n }\n } else {\n do {\nloop_4:\n temp_v1 = var_v1 + var_v0 + var_v0 + 1 + var_v0 + 2 + var_v0;\n var_v0 += 4;\n var_v1 = temp_v1 + 3;\n } while (var_v0 != arg0);\n }\n }\n return var_v1;\n}\n","score":15,"maxScore":34,"compileErrors":null,"breakdown":{"insert":11,"delete":0,"replace":0,"opMismatch":0,"argMismatch":4},"quality":{"score":88,"lines":28,"gotos":1,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":15,"maxScore":34,"ratio":0.4411764705882353,"kinds":{"insert":11,"delete":0,"replace":0,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sumto` — benchmark function synthetic:sumto:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sumto\n move\t$v1, $zero\n blez\t$a0, .L54\n move\t$v0, $zero\n andi\t$a2, $a0, 0x3\n beqz\t$a2, .L30\n move\t$a1, $a2\n addu\t$v1, $v1, $v0\n.L1c:\n addiu\t$v0, $v0, 1\n bnel\t$a1, $v0, .L1c\n addu\t$v1, $v1, $v0\n beq\t$v0, $a0, .L54\n nop\n.L30:\n addu\t$v1, $v1, $v0\n addu\t$v1, $v1, $v0\n addiu\t$v1, $v1, 1\n addu\t$v1, $v1, $v0\n addiu\t$v1, $v1, 2\n addu\t$v1, $v1, $v0\n addiu\t$v0, $v0, 4\n bne\t$v0, $a0, .L30\n addiu\t$v1, $v1, 3\n.L54:\n jr\t$ra\n move\t$v0, $v1\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sumto # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sumto` — benchmark function synthetic:sumto:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sumto:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmove\tv1,zero\n 4:\tblez\ta0,54 \n 8:\tmove\tv0,zero\n c:\tandi\ta2,a0,0x3\n 10:\tbeqz\ta2,30 \n 14:\tmove\ta1,a2\n 18:\taddu\tv1,v1,v0\n 1c:\taddiu\tv0,v0,1\n 20:\tbnel\ta1,v0,1c \n 24:\taddu\tv1,v1,v0\n 28:\tbeq\tv0,a0,54 \n 2c:\tnop\n 30:\taddu\tv1,v1,v0\n 34:\taddu\tv1,v1,v0\n 38:\taddiu\tv1,v1,1\n 3c:\taddu\tv1,v1,v0\n 40:\taddiu\tv1,v1,2\n 44:\taddu\tv1,v1,v0\n 48:\taddiu\tv0,v0,4\n 4c:\tbne\tv0,a0,30 \n 50:\taddiu\tv1,v1,3\n 54:\tjr\tra\n 58:\tmove\tv0,v1\n 5c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t0000005c sumto\n\n\nContents of section .text:\n 0000 00001825 18800013 00001025 30860003 ...%.......%0...\n 0010 10c00007 00c02825 00621821 24420001 ......(%.b.!$B..\n 0020 54a2fffe 00621821 1044000a 00000000 T....b.!.D......\n 0030 00621821 00621821 24630001 00621821 .b.!.b.!$c...b.!\n 0040 24630002 00621821 24420004 1444fff8 $c...b.!$B...D..\n 0050 24630003 03e00008 00601025 00000000 $c.......`.%....\nContents of section .options:\n 0000 01200000 00000000 8000007c 00000000 . .........|....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000007c 00000000 00000000 00000000 ...|............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000017 00000004 000001c8 p...............\n 0010 00000005 00000308 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 00000008 000002a8 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 08080400 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000005c 20200001 00000001 .......\\ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 39343438 36373464 66363036 ef-a9448674df606\n 0130 6334302f 7265662e 63007375 6d746f00 c40/ref.c.sumto.\n 0140 73756d74 6f000000 00000000 00000001 sumto...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000017 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000003 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sumto # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sumto:mwcc_242_81","sym":"sumto","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["loop","for"],"loc":1,"refSource":"int sumto(int n){ int s=0,i; for(i=0;i:\n 0:\tcmpwi r3,0\n 4:\tli r5,0\n 8:\tli r6,0\n c:\tble 90 \n 10:\tcmpwi r3,8\n 14:\taddi r4,r3,-8\n 18:\tble 74 \n 1c:\taddi r0,r4,7\n 20:\tsrwi r0,r0,3\n 24:\tmtctr r0\n 28:\tcmpwi r4,0\n 2c:\tble 74 \n 30:\tadd r5,r5,r6\n 34:\tadd r5,r6,r5\n 38:\taddi r5,r5,1\n 3c:\tadd r5,r6,r5\n 40:\taddi r5,r5,2\n 44:\tadd r5,r6,r5\n 48:\taddi r5,r5,3\n 4c:\tadd r5,r6,r5\n 50:\taddi r5,r5,4\n 54:\tadd r5,r6,r5\n 58:\taddi r5,r5,5\n 5c:\tadd r5,r6,r5\n 60:\taddi r5,r5,6\n 64:\tadd r5,r6,r5\n 68:\taddi r6,r6,8\n 6c:\taddi r5,r5,7\n 70:\tbdnz 30 \n 74:\tsubf r0,r6,r3\n 78:\tmtctr r0\n 7c:\tcmpw r6,r3\n 80:\tbge 90 \n 84:\tadd r5,r5,r6\n 88:\taddi r6,r6,1\n 8c:\tbdnz 84 \n 90:\tmr r3,r5\n 94:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000098 sumto\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sumto\n\n\nContents of section .text:\n 0000 2c030000 38a00000 38c00000 40810084 ,...8...8...@...\n 0010 2c030008 3883fff8 4081005c 38040007 ,...8...@..\\8...\n 0020 5400e8fe 7c0903a6 2c040000 40810048 T...|...,...@..H\n 0030 7ca53214 7ca62a14 38a50001 7ca62a14 |.2.|.*.8...|.*.\n 0040 38a50002 7ca62a14 38a50003 7ca62a14 8...|.*.8...|.*.\n 0050 38a50004 7ca62a14 38a50005 7ca62a14 8...|.*.8...|.*.\n 0060 38a50006 7ca62a14 38c60008 38a50007 8...|.*.8...8...\n 0070 4200ffc0 7c061850 7c0903a6 7c061800 B...|..P|...|...\n 0080 40800010 7ca53214 38c60001 4200fff8 @...|.2.8...B...\n 0090 7ca32b78 4e800020 |.+xN.. \nContents of section .mwcats.text:\n 0000 02000098 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 sumto(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n s32 v3;\n s32 v4;\n s32 v5;\n if (a0 <= 0) {\n v0 = 0;\n } else {\n if (a0 <= 8) {\n v1 = 0;\n v0 = 0;\n } else {\n v0 = 0;\n v1 = 0;\n for (v2 = a0 + -8 + 7 >> 3; v2 != 0; v2 = v2 - 1) {\n v0 = v1 + (v1 + (v1 + (v1 + (v1 + (v1 + (v1 + (v0 + v1) + 1) + 2) + 3) + 4) + 5) + 6) + 7;\n v1 = v1 + 8;\n }\n }\n v3 = v0;\n v4 = v1;\n for (v5 = a0 - v1; v5 != 0; v5 = v5 - 1) {\n v3 = v3 + v4;\n v4 = v4 + 1;\n }\n v0 = v3;\n }\n return v0;\n}\n","score":105,"maxScore":110,"compileErrors":null,"breakdown":{"insert":72,"delete":4,"replace":3,"opMismatch":4,"argMismatch":22},"quality":{"score":100,"lines":31,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sumto(s32 arg0) {\n s32 temp_r4;\n s32 temp_r5;\n s32 var_ctr_2;\n s32 var_r5;\n s32 var_r6;\n u32 var_ctr;\n\n var_r5 = 0;\n var_r6 = 0;\n if (arg0 > 0) {\n temp_r4 = arg0 - 8;\n if (arg0 > 8) {\n var_ctr = (u32) (temp_r4 + 7) >> 3U;\n if (temp_r4 > 0) {\n do {\n temp_r5 = var_r6 + (var_r6 + (var_r6 + (var_r6 + (var_r6 + (var_r6 + (var_r6 + (var_r5 + var_r6) + 1) + 2) + 3) + 4) + 5) + 6);\n var_r6 += 8;\n var_r5 = temp_r5 + 7;\n var_ctr -= 1;\n } while (var_ctr != 0);\n }\n }\n var_ctr_2 = arg0 - var_r6;\n if (var_r6 < arg0) {\n do {\n var_r5 += var_r6;\n var_r6 += 1;\n var_ctr_2 -= 1;\n } while (var_ctr_2 != 0);\n }\n }\n return var_r5;\n}\n","score":30,"maxScore":43,"compileErrors":null,"breakdown":{"insert":5,"delete":10,"replace":0,"opMismatch":2,"argMismatch":13},"quality":{"score":100,"lines":33,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":30,"maxScore":43,"ratio":0.6976744186046512,"kinds":{"insert":5,"delete":10,"replace":0,"opMismatch":2,"argMismatch":13}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sumto` — benchmark function synthetic:sumto:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sumto\n cmpwi r3,0\n li r5,0\n li r6,0\n ble .L90\n cmpwi r3,8\n addi r4,r3,-8\n ble .L74\n addi r0,r4,7\n srwi r0,r0,3\n mtctr r0\n cmpwi r4,0\n ble .L74\n.L30:\n add r5,r5,r6\n add r5,r6,r5\n addi r5,r5,1\n add r5,r6,r5\n addi r5,r5,2\n add r5,r6,r5\n addi r5,r5,3\n add r5,r6,r5\n addi r5,r5,4\n add r5,r6,r5\n addi r5,r5,5\n add r5,r6,r5\n addi r5,r5,6\n add r5,r6,r5\n addi r6,r6,8\n addi r5,r5,7\n bdnz .L30\n.L74:\n subf r0,r6,r3\n mtctr r0\n cmpw r6,r3\n bge .L90\n.L84:\n add r5,r5,r6\n addi r6,r6,1\n bdnz .L84\n.L90:\n mr r3,r5\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sumto # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sumto` — benchmark function synthetic:sumto:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sumto:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,0\n 4:\tli r5,0\n 8:\tli r6,0\n c:\tble 90 \n 10:\tcmpwi r3,8\n 14:\taddi r4,r3,-8\n 18:\tble 74 \n 1c:\taddi r0,r4,7\n 20:\tsrwi r0,r0,3\n 24:\tmtctr r0\n 28:\tcmpwi r4,0\n 2c:\tble 74 \n 30:\tadd r5,r5,r6\n 34:\tadd r5,r6,r5\n 38:\taddi r5,r5,1\n 3c:\tadd r5,r6,r5\n 40:\taddi r5,r5,2\n 44:\tadd r5,r6,r5\n 48:\taddi r5,r5,3\n 4c:\tadd r5,r6,r5\n 50:\taddi r5,r5,4\n 54:\tadd r5,r6,r5\n 58:\taddi r5,r5,5\n 5c:\tadd r5,r6,r5\n 60:\taddi r5,r5,6\n 64:\tadd r5,r6,r5\n 68:\taddi r6,r6,8\n 6c:\taddi r5,r5,7\n 70:\tbdnz 30 \n 74:\tsubf r0,r6,r3\n 78:\tmtctr r0\n 7c:\tcmpw r6,r3\n 80:\tbge 90 \n 84:\tadd r5,r5,r6\n 88:\taddi r6,r6,1\n 8c:\tbdnz 84 \n 90:\tmr r3,r5\n 94:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000098 sumto\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sumto\n\n\nContents of section .text:\n 0000 2c030000 38a00000 38c00000 40810084 ,...8...8...@...\n 0010 2c030008 3883fff8 4081005c 38040007 ,...8...@..\\8...\n 0020 5400e8fe 7c0903a6 2c040000 40810048 T...|...,...@..H\n 0030 7ca53214 7ca62a14 38a50001 7ca62a14 |.2.|.*.8...|.*.\n 0040 38a50002 7ca62a14 38a50003 7ca62a14 8...|.*.8...|.*.\n 0050 38a50004 7ca62a14 38a50005 7ca62a14 8...|.*.8...|.*.\n 0060 38a50006 7ca62a14 38c60008 38a50007 8...|.*.8...8...\n 0070 4200ffc0 7c061850 7c0903a6 7c061800 B...|..P|...|...\n 0080 40800010 7ca53214 38c60001 4200fff8 @...|.2.8...B...\n 0090 7ca32b78 4e800020 |.+xN.. \nContents of section .mwcats.text:\n 0000 02000098 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sumto # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_fall:agbcc","sym":"sw_fall","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","fallthrough"],"loc":1,"refSource":"int sw_fall(int x){ int r=0; switch(x){case 3:r++;case 2:r++;case 1:r++;} return r; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_fall\n\t.type\t sw_fall,function\n\t.thumb_func\nsw_fall:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0x2\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x2\n\tbgt\t.L9\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L6\t@cond_branch\n\tb\t.L3\n.L9:\n\tcmp\tr0, #0x3\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L5:\n\tadd\tr1, r1, #0x1\n.L6:\n\tadd\tr1, r1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_fall,.Lfe1-sw_fall\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 sw_fall(s32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n if (a0 != 2) {\n if (a0 <= 2) {\n if (a0 != 1) {\n return 0;\n } else {\n v1 = 0;\n return v1 + 1;\n }\n } else {\n if (a0 == 3) {\n v0 = 1;\n v1 = v0 + 1;\n return v1 + 1;\n } else {\n v2 = 0;\n return v2;\n }\n }\n } else {\n v0 = 0;\n v1 = v0 + 1;\n return v1 + 1;\n }\n}\n","score":11,"maxScore":18,"compileErrors":null,"breakdown":{"insert":3,"delete":2,"replace":1,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":28,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_fall(s32 arg0) {\n s32 var_r1;\n\n var_r1 = 0;\n switch (arg0) { /* irregular */\n case 3:\n var_r1 = 1;\n /* fallthrough */\n case 2:\n var_r1 += 1;\n /* fallthrough */\n case 1:\n var_r1 += 1;\n break;\n }\n return var_r1;\n}\n","score":0,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_fall` — benchmark function synthetic:sw_fall:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_fall\n\t.type\t sw_fall,function\n\t.thumb_func\nsw_fall:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0x2\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x2\n\tbgt\t.L9\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L6\t@cond_branch\n\tb\t.L3\n.L9:\n\tcmp\tr0, #0x3\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L5:\n\tadd\tr1, r1, #0x1\n.L6:\n\tadd\tr1, r1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_fall,.Lfe1-sw_fall\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_fall # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_fall` — benchmark function synthetic:sw_fall:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_fall:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_fall\n\t.type\t sw_fall,function\n\t.thumb_func\nsw_fall:\n\tmov\tr1, #0x0\n\tcmp\tr0, #0x2\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x2\n\tbgt\t.L9\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L6\t@cond_branch\n\tb\t.L3\n.L9:\n\tcmp\tr0, #0x3\n\tbne\t.L3\t@cond_branch\n\tmov\tr1, #0x1\n.L5:\n\tadd\tr1, r1, #0x1\n.L6:\n\tadd\tr1, r1, #0x1\n.L3:\n\tadd\tr0, r1, #0\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_fall,.Lfe1-sw_fall\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_fall # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_fall:gcc2.7.2kmc","sym":"sw_fall","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["switch","fallthrough"],"loc":1,"refSource":"int sw_fall(int x){ int r=0; switch(x){case 3:r++;case 2:r++;case 1:r++;} return r; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,2\n 4:\tbeq\ta0,v0,38 \n 8:\tmove\tv1,zero\n c:\tslti\tv0,a0,3\n 10:\tbeqz\tv0,28 \n 14:\tli\tv0,1\n 18:\tbeql\ta0,v0,40 \n 1c:\taddiu\tv1,v1,1\n 20:\tj\t40 \n 24:\tnop\n 28:\tli\tv0,3\n 2c:\tbne\ta0,v0,40 \n 30:\tnop\n 34:\tli\tv1,1\n 38:\taddiu\tv1,v1,1\n 3c:\taddiu\tv1,v1,1\n 40:\tjr\tra\n 44:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a34ccd26bd404b9b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000048 sw_fall\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020002 1082000c 00001821 28820003 $..........!(...\n 0010 10400005 24020001 50820009 24630001 .@..$...P...$c..\n 0020 08000010 00000000 24020003 14820004 ........$.......\n 0030 00000000 24030001 24630001 24630001 ....$...$c..$c..\n 0040 03e00008 00601021 00000000 00000000 .....`.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_fall' — lift: cannot lift 'sw_fall': unmodelled control transfer 'beql' at 0x18 — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tli\tv0,2 */\n/* 4:\tbeq\ta0,v0,38 */\n/* 8:\tmove\tv1,zero */\n/* c:\tslti\tv0,a0,3 */\n/* 10:\tbeqz\tv0,28 */\n/* 14:\tli\tv0,1 */\n/* 18:\tbeql\ta0,v0,40 */\n/* 1c:\taddiu\tv1,v1,1 */\n/* 20:\tj\t40 */\n/* 24:\tnop */\n/* 28:\tli\tv0,3 */\n/* 2c:\tbne\ta0,v0,40 */\n/* 30:\tnop */\n/* 34:\tli\tv1,1 */\n/* 38:\taddiu\tv1,v1,1 */\n/* 3c:\taddiu\tv1,v1,1 */\n/* 40:\tjr\tra */\n/* 44:\tmove\tv0,v1 */\n/* \t... */\nvoid sw_fall(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_fall': unmodelled control transfer 'beql' at 0x18 — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":27,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_fall': unmodelled control transfer 'beql' at 0x18 — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_fall(s32 arg0) {\n s32 var_v1;\n\n var_v1 = 0;\n switch (arg0) { /* irregular */\n case 3:\n var_v1 = 1;\n /* fallthrough */\n case 2:\n var_v1 += 1;\n /* fallthrough */\n case 1:\n var_v1 += 1;\n break;\n }\n return var_v1;\n}\n","score":0,"maxScore":18,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_fall` — benchmark function synthetic:sw_fall:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_fall\n li\t$v0, 2\n beq\t$a0, $v0, .L38\n move\t$v1, $zero\n slti\t$v0, $a0, 3\n beqz\t$v0, .L28\n li\t$v0, 1\n beql\t$a0, $v0, .L40\n addiu\t$v1, $v1, 1\n j\t.L40\n nop\n.L28:\n li\t$v0, 3\n bne\t$a0, $v0, .L40\n nop\n li\t$v1, 1\n.L38:\n addiu\t$v1, $v1, 1\n addiu\t$v1, $v1, 1\n.L40:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_fall # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_fall` — benchmark function synthetic:sw_fall:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_fall:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,2\n 4:\tbeq\ta0,v0,38 \n 8:\tmove\tv1,zero\n c:\tslti\tv0,a0,3\n 10:\tbeqz\tv0,28 \n 14:\tli\tv0,1\n 18:\tbeql\ta0,v0,40 \n 1c:\taddiu\tv1,v1,1\n 20:\tj\t40 \n 24:\tnop\n 28:\tli\tv0,3\n 2c:\tbne\ta0,v0,40 \n 30:\tnop\n 34:\tli\tv1,1\n 38:\taddiu\tv1,v1,1\n 3c:\taddiu\tv1,v1,1\n 40:\tjr\tra\n 44:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a34ccd26bd404b9b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000048 sw_fall\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000020 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020002 1082000c 00001821 28820003 $..........!(...\n 0010 10400005 24020001 50820009 24630001 .@..$...P...$c..\n 0020 08000010 00000000 24020003 14820004 ........$.......\n 0030 00000000 24030001 24630001 24630001 ....$...$c..$c..\n 0040 03e00008 00601021 00000000 00000000 .....`.!........\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_fall # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_fall:ido7.1","sym":"sw_fall","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["switch","fallthrough"],"loc":1,"refSource":"int sw_fall(int x){ int r=0; switch(x){case 3:r++;case 2:r++;case 1:r++;} return r; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,1\n 4:\tbeq\ta0,at,28 \n 8:\tmove\tv1,zero\n c:\tli\tat,2\n 10:\tbeq\ta0,at,24 \n 14:\tli\tat,3\n 18:\tbne\ta0,at,2c \n 1c:\tnop\n 20:\tli\tv1,1\n 24:\taddiu\tv1,v1,1\n 28:\taddiu\tv1,v1,1\n 2c:\tjr\tra\n 30:\tmove\tv0,v1\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 sw_fall\n\n\nContents of section .text:\n 0000 24010001 10810008 00001825 24010002 $..........%$...\n 0010 10810004 24010003 14810004 00000000 ....$...........\n 0020 24030001 24630001 24630001 03e00008 $...$c..$c......\n 0030 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8000001e 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001e 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001a8 p...............\n 0010 00000005 000002ec 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000038 00000254 ...........8...T\n 0040 00000008 0000028c 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 08030000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000034 20200001 00000001 .......4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 33346363 64323662 64343034 ef-a34ccd26bd404\n 0130 6239622f 7265662e 63007377 5f66616c b9b/ref.c.sw_fal\n 0140 6c000000 73775f66 616c6c00 00000000 l...sw_fall.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000d 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 sw_fall(u32 a0) {\n s32 v0;\n s32 v1;\n s32 v2;\n if (a0 != 1) {\n if (a0 != 2) {\n if (a0 == 3) {\n v0 = 1;\n v1 = v0 + 1;\n return v1 + 1;\n } else {\n v2 = 0;\n return v2;\n }\n } else {\n v0 = 0;\n v1 = v0 + 1;\n return v1 + 1;\n }\n } else {\n v1 = 0;\n return v1 + 1;\n }\n}\n","score":14,"maxScore":19,"compileErrors":null,"breakdown":{"insert":6,"delete":3,"replace":0,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":24,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_fall(s32 arg0) {\n s32 var_v1;\n\n var_v1 = 0;\n if (arg0 != 1) {\n if (arg0 != 2) {\n if (arg0 == 3) {\n var_v1 = 1;\n goto block_4;\n }\n } else {\nblock_4:\n var_v1 += 1;\n goto block_5;\n }\n } else {\nblock_5:\n var_v1 += 1;\n }\n return var_v1;\n}\n","score":0,"maxScore":13,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":76,"lines":20,"gotos":2,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_fall` — benchmark function synthetic:sw_fall:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_fall\n li\t$at, 1\n beq\t$a0, $at, .L28\n move\t$v1, $zero\n li\t$at, 2\n beq\t$a0, $at, .L24\n li\t$at, 3\n bne\t$a0, $at, .L2c\n nop\n li\t$v1, 1\n.L24:\n addiu\t$v1, $v1, 1\n.L28:\n addiu\t$v1, $v1, 1\n.L2c:\n jr\t$ra\n move\t$v0, $v1\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_fall # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_fall` — benchmark function synthetic:sw_fall:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_fall:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,1\n 4:\tbeq\ta0,at,28 \n 8:\tmove\tv1,zero\n c:\tli\tat,2\n 10:\tbeq\ta0,at,24 \n 14:\tli\tat,3\n 18:\tbne\ta0,at,2c \n 1c:\tnop\n 20:\tli\tv1,1\n 24:\taddiu\tv1,v1,1\n 28:\taddiu\tv1,v1,1\n 2c:\tjr\tra\n 30:\tmove\tv0,v1\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000034 sw_fall\n\n\nContents of section .text:\n 0000 24010001 10810008 00001825 24010002 $..........%$...\n 0010 10810004 24010003 14810004 00000000 ....$...........\n 0020 24030001 24630001 24630001 03e00008 $...$c..$c......\n 0030 00601025 00000000 00000000 00000000 .`.%............\nContents of section .options:\n 0000 01200000 00000000 8000001e 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000001e 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000d 00000004 000001a8 p...............\n 0010 00000005 000002ec 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000038 00000254 ...........8...T\n 0040 00000008 0000028c 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 08030000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000034 20200001 00000001 .......4 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 33346363 64323662 64343034 ef-a34ccd26bd404\n 0130 6239622f 7265662e 63007377 5f66616c b9b/ref.c.sw_fal\n 0140 6c000000 73775f66 616c6c00 00000000 l...sw_fall.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000d 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_fall # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_fall:mwcc_242_81","sym":"sw_fall","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["switch","fallthrough"],"loc":1,"refSource":"int sw_fall(int x){ int r=0; switch(x){case 3:r++;case 2:r++;case 1:r++;} return r; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,2\n 4:\tli r4,0\n 8:\tbeq 28 \n c:\tbge 1c \n 10:\tcmpwi r3,1\n 14:\tbge 2c \n 18:\tb 30 \n 1c:\tcmpwi r3,4\n 20:\tbge 30 \n 24:\tli r4,1\n 28:\taddi r4,r4,1\n 2c:\taddi r4,r4,1\n 30:\tmr r3,r4\n 34:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000038 sw_fall\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_fall\n\n\nContents of section .text:\n 0000 2c030002 38800000 41820020 40800010 ,...8...A.. @...\n 0010 2c030001 40800018 48000018 2c030004 ,...@...H...,...\n 0020 40800010 38800001 38840001 38840001 @...8...8...8...\n 0030 7c832378 4e800020 |.#xN.. \nContents of section .mwcats.text:\n 0000 02000038 00000000 ...8.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_fall' — lift: cannot lift 'sw_fall': conditional branch 'bge' has no reaching compare (cr0) in its block */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tcmpwi r3,2 */\n/* 4:\tli r4,0 */\n/* 8:\tbeq 28 */\n/* c:\tbge 1c */\n/* 10:\tcmpwi r3,1 */\n/* 14:\tbge 2c */\n/* 18:\tb 30 */\n/* 1c:\tcmpwi r3,4 */\n/* 20:\tbge 30 */\n/* 24:\tli r4,1 */\n/* 28:\taddi r4,r4,1 */\n/* 2c:\taddi r4,r4,1 */\n/* 30:\tmr r3,r4 */\n/* 34:\tblr */\nvoid sw_fall(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_fall': conditional branch 'bge' has no reaching compare (cr0) in its block\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":22,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_fall': conditional branch 'bge' has no reaching compare (cr0) in its block"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_fall(s32 arg0) {\n s32 var_r4;\n\n var_r4 = 0;\n switch (arg0) { /* irregular */\n case 3:\n var_r4 = 1;\n /* fallthrough */\n case 2:\n var_r4 += 1;\n /* fallthrough */\n case 1:\n var_r4 += 1;\n break;\n }\n return var_r4;\n}\n","score":0,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":16,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_fall` — benchmark function synthetic:sw_fall:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_fall\n cmpwi r3,2\n li r4,0\n beq .L28\n bge .L1c\n cmpwi r3,1\n bge .L2c\n b .L30\n.L1c:\n cmpwi r3,4\n bge .L30\n li r4,1\n.L28:\n addi r4,r4,1\n.L2c:\n addi r4,r4,1\n.L30:\n mr r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_fall # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_fall` — benchmark function synthetic:sw_fall:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_fall:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,2\n 4:\tli r4,0\n 8:\tbeq 28 \n c:\tbge 1c \n 10:\tcmpwi r3,1\n 14:\tbge 2c \n 18:\tb 30 \n 1c:\tcmpwi r3,4\n 20:\tbge 30 \n 24:\tli r4,1\n 28:\taddi r4,r4,1\n 2c:\taddi r4,r4,1\n 30:\tmr r3,r4\n 34:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000038 sw_fall\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_fall\n\n\nContents of section .text:\n 0000 2c030002 38800000 41820020 40800010 ,...8...A.. @...\n 0010 2c030001 40800018 48000018 2c030004 ,...@...H...,...\n 0020 40800010 38800001 38840001 38840001 @...8...8...8...\n 0030 7c832378 4e800020 |.#xN.. \nContents of section .mwcats.text:\n 0000 02000038 00000000 ...8.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_fall # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_jt:agbcc","sym":"sw_jt","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","jump-table","dense"],"loc":1,"refSource":"int sw_jt(int x){ switch(x){case 0:return 3;case 1:return 5;case 2:return 7;case 3:return 9;case 4:return 11;case 5:return 13;case 6:return 15;case 7:return 17;default:return -1;} }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_jt\n\t.type\t sw_jt,function\n\t.thumb_func\nsw_jt:\n\tcmp\tr0, #0x7\n\tbhi\t.L12\t@cond_branch\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L15\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t.L13\n\t.align\t2, 0\n\t.align\t2, 0\n.L13:\n\t.word\t.L4\n\t.word\t.L5\n\t.word\t.L6\n\t.word\t.L7\n\t.word\t.L8\n\t.word\t.L9\n\t.word\t.L10\n\t.word\t.L11\n.L4:\n\tmov\tr0, #0x3\n\tb\t.L14\n.L5:\n\tmov\tr0, #0x5\n\tb\t.L14\n.L6:\n\tmov\tr0, #0x7\n\tb\t.L14\n.L7:\n\tmov\tr0, #0x9\n\tb\t.L14\n.L8:\n\tmov\tr0, #0xb\n\tb\t.L14\n.L9:\n\tmov\tr0, #0xd\n\tb\t.L14\n.L10:\n\tmov\tr0, #0xf\n\tb\t.L14\n.L11:\n\tmov\tr0, #0x11\n\tb\t.L14\n.L12:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L14:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_jt,.Lfe1-sw_jt\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sw_jt(u32 a0) {\n s32 v0;\n switch (a0) {\n case 0:\n v0 = 3;\n break;\n case 1:\n v0 = 5;\n break;\n case 2:\n v0 = 7;\n break;\n case 3:\n v0 = 9;\n break;\n case 4:\n v0 = 11;\n break;\n case 5:\n v0 = 13;\n break;\n case 6:\n v0 = 15;\n break;\n case 7:\n v0 = 17;\n break;\n default:\n v0 = -1;\n }\n return v0;\n}\n","score":0,"maxScore":36,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":32,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_jt(u32 arg0) {\n switch (arg0) {\n case 0:\n return 3;\n case 1:\n return 5;\n case 2:\n return 7;\n case 3:\n return 9;\n case 4:\n return 0xB;\n case 5:\n return 0xD;\n case 6:\n return 0xF;\n case 7:\n return 0x11;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":36,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_jt` — benchmark function synthetic:sw_jt:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_jt\n\t.type\t sw_jt,function\n\t.thumb_func\nsw_jt:\n\tcmp\tr0, #0x7\n\tbhi\t.L12\t@cond_branch\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L15\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t.L13\n\t.align\t2, 0\n\t.align\t2, 0\n.L13:\n\t.word\t.L4\n\t.word\t.L5\n\t.word\t.L6\n\t.word\t.L7\n\t.word\t.L8\n\t.word\t.L9\n\t.word\t.L10\n\t.word\t.L11\n.L4:\n\tmov\tr0, #0x3\n\tb\t.L14\n.L5:\n\tmov\tr0, #0x5\n\tb\t.L14\n.L6:\n\tmov\tr0, #0x7\n\tb\t.L14\n.L7:\n\tmov\tr0, #0x9\n\tb\t.L14\n.L8:\n\tmov\tr0, #0xb\n\tb\t.L14\n.L9:\n\tmov\tr0, #0xd\n\tb\t.L14\n.L10:\n\tmov\tr0, #0xf\n\tb\t.L14\n.L11:\n\tmov\tr0, #0x11\n\tb\t.L14\n.L12:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L14:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_jt,.Lfe1-sw_jt\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_jt # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_jt` — benchmark function synthetic:sw_jt:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_jt:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_jt\n\t.type\t sw_jt,function\n\t.thumb_func\nsw_jt:\n\tcmp\tr0, #0x7\n\tbhi\t.L12\t@cond_branch\n\tlsl\tr0, r0, #0x2\n\tldr\tr1, .L15\n\tadd\tr0, r0, r1\n\tldr\tr0, [r0]\n\tmov\tpc, r0\n.L16:\n\t.align\t2, 0\n.L15:\n\t.word\t.L13\n\t.align\t2, 0\n\t.align\t2, 0\n.L13:\n\t.word\t.L4\n\t.word\t.L5\n\t.word\t.L6\n\t.word\t.L7\n\t.word\t.L8\n\t.word\t.L9\n\t.word\t.L10\n\t.word\t.L11\n.L4:\n\tmov\tr0, #0x3\n\tb\t.L14\n.L5:\n\tmov\tr0, #0x5\n\tb\t.L14\n.L6:\n\tmov\tr0, #0x7\n\tb\t.L14\n.L7:\n\tmov\tr0, #0x9\n\tb\t.L14\n.L8:\n\tmov\tr0, #0xb\n\tb\t.L14\n.L9:\n\tmov\tr0, #0xd\n\tb\t.L14\n.L10:\n\tmov\tr0, #0xf\n\tb\t.L14\n.L11:\n\tmov\tr0, #0x11\n\tb\t.L14\n.L12:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L14:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_jt,.Lfe1-sw_jt\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_jt # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_jt:gcc2.7.2kmc","sym":"sw_jt","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["switch","jump-table","dense"],"loc":1,"refSource":"int sw_jt(int x){ switch(x){case 0:return 3;case 1:return 5;case 2:return 7;case 3:return 9;case 4:return 11;case 5:return 13;case 6:return 15;case 7:return 17;default:return -1;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltiu\tv0,a0,8\n 4:\tbeqz\tv0,60 \n 8:\tsll\tv0,a0,0x2\n c:\tlui\tat,0x0\n 10:\taddu\tat,at,v0\n 14:\tlw\tv0,0(at)\n 18:\tjr\tv0\n 1c:\tnop\n 20:\tj\t64 \n 24:\tli\tv0,3\n 28:\tj\t64 \n 2c:\tli\tv0,5\n 30:\tj\t64 \n 34:\tli\tv0,7\n 38:\tj\t64 \n 3c:\tli\tv0,9\n 40:\tj\t64 \n 44:\tli\tv0,11\n 48:\tj\t64 \n 4c:\tli\tv0,13\n 50:\tj\t64 \n 54:\tli\tv0,15\n 58:\tj\t64 \n 5c:\tli\tv0,17\n 60:\tli\tv0,-1\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-478c2b4db5ad2fcb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .rodata\t00000000 .rodata\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c sw_jt\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_MIPS_HI16 .rodata\n00000014 R_MIPS_LO16 .rodata\n00000020 R_MIPS_26 .text\n00000028 R_MIPS_26 .text\n00000030 R_MIPS_26 .text\n00000038 R_MIPS_26 .text\n00000040 R_MIPS_26 .text\n00000048 R_MIPS_26 .text\n00000050 R_MIPS_26 .text\n00000058 R_MIPS_26 .text\n\n\nRELOCATION RECORDS FOR [.rodata]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_32 .text\n00000004 R_MIPS_32 .text\n00000008 R_MIPS_32 .text\n0000000c R_MIPS_32 .text\n00000010 R_MIPS_32 .text\n00000014 R_MIPS_32 .text\n00000018 R_MIPS_32 .text\n0000001c R_MIPS_32 .text\n\n\nContents of section .text:\n 0000 2c820008 10400016 00041080 3c010000 ,....@......<...\n 0010 00220821 8c220000 00400008 00000000 .\".!.\"...@......\n 0020 08000019 24020003 08000019 24020005 ....$.......$...\n 0030 08000019 24020007 08000019 24020009 ....$.......$...\n 0040 08000019 2402000b 08000019 2402000d ....$.......$...\n 0050 08000019 2402000f 08000019 24020011 ....$.......$...\n 0060 2402ffff 03e00008 00000000 00000000 $...............\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .rodata:\n 0000 00000020 00000028 00000030 00000038 ... ...(...0...8\n 0010 00000040 00000048 00000050 00000058 ...@...H...P...X\nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sw_jt(u32 a0) {\n s32 v0;\n switch (a0) {\n case 0:\n v0 = 3;\n break;\n case 1:\n v0 = 5;\n break;\n case 2:\n v0 = 7;\n break;\n case 3:\n v0 = 9;\n break;\n case 4:\n v0 = 11;\n break;\n case 5:\n v0 = 13;\n break;\n case 6:\n v0 = 15;\n break;\n case 7:\n v0 = 17;\n break;\n default:\n v0 = -1;\n }\n return v0;\n}\n","score":0,"maxScore":27,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":32,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_jt(u32 arg0) {\n switch (arg0) {\n case 0:\n return 3;\n case 1:\n return 5;\n case 2:\n return 7;\n case 3:\n return 9;\n case 4:\n return 0xB;\n case 5:\n return 0xD;\n case 6:\n return 0xF;\n case 7:\n return 0x11;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":27,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_jt` — benchmark function synthetic:sw_jt:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_jt\n sltiu\t$v0, $a0, 8\n beqz\t$v0, .L60\n sll\t$v0, $a0, 0x2\n lui\t$at, %hi(jtbl_rodata_0)\n addu\t$at, $at, $v0\n lw\t$v0, %lo(jtbl_rodata_0)($at)\n jr\t$v0\n nop\n.L20:\n j\t.L64\n li\t$v0, 3\n.L28:\n j\t.L64\n li\t$v0, 5\n.L30:\n j\t.L64\n li\t$v0, 7\n.L38:\n j\t.L64\n li\t$v0, 9\n.L40:\n j\t.L64\n li\t$v0, 11\n.L48:\n j\t.L64\n li\t$v0, 13\n.L50:\n j\t.L64\n li\t$v0, 15\n.L58:\n j\t.L64\n li\t$v0, 17\n.L60:\n li\t$v0, -1\n.L64:\n jr\t$ra\n nop\n nop\n.rodata\nglabel jtbl_rodata_0\n.word .L20\n.word .L28\n.word .L30\n.word .L38\n.word .L40\n.word .L48\n.word .L50\n.word .L58\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_jt # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_jt` — benchmark function synthetic:sw_jt:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_jt:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltiu\tv0,a0,8\n 4:\tbeqz\tv0,60 \n 8:\tsll\tv0,a0,0x2\n c:\tlui\tat,0x0\n 10:\taddu\tat,at,v0\n 14:\tlw\tv0,0(at)\n 18:\tjr\tv0\n 1c:\tnop\n 20:\tj\t64 \n 24:\tli\tv0,3\n 28:\tj\t64 \n 2c:\tli\tv0,5\n 30:\tj\t64 \n 34:\tli\tv0,7\n 38:\tj\t64 \n 3c:\tli\tv0,9\n 40:\tj\t64 \n 44:\tli\tv0,11\n 48:\tj\t64 \n 4c:\tli\tv0,13\n 50:\tj\t64 \n 54:\tli\tv0,15\n 58:\tj\t64 \n 5c:\tli\tv0,17\n 60:\tli\tv0,-1\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-478c2b4db5ad2fcb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .rodata\t00000000 .rodata\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000006c sw_jt\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_MIPS_HI16 .rodata\n00000014 R_MIPS_LO16 .rodata\n00000020 R_MIPS_26 .text\n00000028 R_MIPS_26 .text\n00000030 R_MIPS_26 .text\n00000038 R_MIPS_26 .text\n00000040 R_MIPS_26 .text\n00000048 R_MIPS_26 .text\n00000050 R_MIPS_26 .text\n00000058 R_MIPS_26 .text\n\n\nRELOCATION RECORDS FOR [.rodata]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_32 .text\n00000004 R_MIPS_32 .text\n00000008 R_MIPS_32 .text\n0000000c R_MIPS_32 .text\n00000010 R_MIPS_32 .text\n00000014 R_MIPS_32 .text\n00000018 R_MIPS_32 .text\n0000001c R_MIPS_32 .text\n\n\nContents of section .text:\n 0000 2c820008 10400016 00041080 3c010000 ,....@......<...\n 0010 00220821 8c220000 00400008 00000000 .\".!.\"...@......\n 0020 08000019 24020003 08000019 24020005 ....$.......$...\n 0030 08000019 24020007 08000019 24020009 ....$.......$...\n 0040 08000019 2402000b 08000019 2402000d ....$.......$...\n 0050 08000019 2402000f 08000019 24020011 ....$.......$...\n 0060 2402ffff 03e00008 00000000 00000000 $...............\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .rodata:\n 0000 00000020 00000028 00000030 00000038 ... ...(...0...8\n 0010 00000040 00000048 00000050 00000058 ...@...H...P...X\nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_jt # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_jt:ido7.1","sym":"sw_jt","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["switch","jump-table","dense"],"loc":1,"refSource":"int sw_jt(int x){ switch(x){case 0:return 3;case 1:return 5;case 2:return 7;case 3:return 9;case 4:return 11;case 5:return 13;case 6:return 15;case 7:return 17;default:return -1;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltiu\tat,a0,8\n 4:\tbeqz\tat,64 \n 8:\tli\tv0,-1\n c:\tsll\tt6,a0,0x2\n 10:\tlui\tat,0x0\n 14:\taddu\tat,at,t6\n 18:\tlw\tt6,0(at)\n 1c:\tjr\tt6\n 20:\tnop\n 24:\tjr\tra\n 28:\tli\tv0,3\n 2c:\tjr\tra\n 30:\tli\tv0,5\n 34:\tjr\tra\n 38:\tli\tv0,7\n 3c:\tjr\tra\n 40:\tli\tv0,9\n 44:\tjr\tra\n 48:\tli\tv0,11\n 4c:\tjr\tra\n 50:\tli\tv0,13\n 54:\tjr\tra\n 58:\tli\tv0,15\n 5c:\tjr\tra\n 60:\tli\tv0,17\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 l d .rodata\t00000020 .rodata\n00000000 g F .text\t0000006c sw_jt\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 .rodata\n00000018 R_MIPS_LO16 .rodata\n\n\nRELOCATION RECORDS FOR [.rodata]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_32 .text\n00000004 R_MIPS_32 .text\n00000008 R_MIPS_32 .text\n0000000c R_MIPS_32 .text\n00000010 R_MIPS_32 .text\n00000014 R_MIPS_32 .text\n00000018 R_MIPS_32 .text\n0000001c R_MIPS_32 .text\n\n\nContents of section .text:\n 0000 2c810008 10200017 2402ffff 00047080 ,.... ..$.....p.\n 0010 3c010000 002e0821 8c2e0000 01c00008 <......!........\n 0020 00000000 03e00008 24020003 03e00008 ........$.......\n 0030 24020005 03e00008 24020007 03e00008 $.......$.......\n 0040 24020009 03e00008 2402000b 03e00008 $.......$.......\n 0050 2402000d 03e00008 2402000f 03e00008 $.......$.......\n 0060 24020011 03e00008 00000000 00000000 $...............\nContents of section .rodata:\n 0000 00000024 0000002c 00000034 0000003c ...$...,...4...<\n 0010 00000044 0000004c 00000054 0000005c ...D...L...T...\\\nContents of section .options:\n 0000 01200000 00000000 80004016 00000000 . ........@.....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004016 00000000 00000000 00000000 ..@.............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001b 00000004 00000288 p...............\n 0010 00000005 000003c8 00000001 0000028c ................\n 0020 00000004 000002c0 00000000 00000000 ................\n 0030 00000011 000002f0 00000034 00000334 ...........4...4\n 0040 00000008 00000368 00000001 00000370 .......h.......p\n 0050 00000000 00000000 00000001 000003b8 ................\n 0060 08080800 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000006c 20200001 00000001 .......l ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 37386332 62346462 35616432 ef-478c2b4db5ad2\n 0130 6663622f 7265662e 63007377 5f6a7400 fcb/ref.c.sw_jt.\n 0140 73775f6a 74000000 00000000 00000001 sw_jt...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 0000001b 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000003 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sw_jt(u32 a0) {\n switch (a0) {\n case 0:\n return 3;\n case 1:\n return 5;\n case 2:\n return 7;\n case 3:\n return 9;\n case 4:\n return 11;\n case 5:\n return 13;\n case 6:\n return 15;\n case 7:\n return 17;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":27,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_jt(u32 arg0) {\n switch (arg0) {\n case 0:\n return 3;\n case 1:\n return 5;\n case 2:\n return 7;\n case 3:\n return 9;\n case 4:\n return 0xB;\n case 5:\n return 0xD;\n case 6:\n return 0xF;\n case 7:\n return 0x11;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":27,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_jt` — benchmark function synthetic:sw_jt:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_jt\n sltiu\t$at, $a0, 8\n beqz\t$at, .L64\n li\t$v0, -1\n sll\t$t6, $a0, 0x2\n lui\t$at, %hi(jtbl_rodata_0)\n addu\t$at, $at, $t6\n lw\t$t6, %lo(jtbl_rodata_0)($at)\n jr\t$t6\n nop\n.L24:\n jr\t$ra\n li\t$v0, 3\n.L2c:\n jr\t$ra\n li\t$v0, 5\n.L34:\n jr\t$ra\n li\t$v0, 7\n.L3c:\n jr\t$ra\n li\t$v0, 9\n.L44:\n jr\t$ra\n li\t$v0, 11\n.L4c:\n jr\t$ra\n li\t$v0, 13\n.L54:\n jr\t$ra\n li\t$v0, 15\n.L5c:\n jr\t$ra\n li\t$v0, 17\n.L64:\n jr\t$ra\n nop\n nop\n.rodata\nglabel jtbl_rodata_0\n.word .L24\n.word .L2c\n.word .L34\n.word .L3c\n.word .L44\n.word .L4c\n.word .L54\n.word .L5c\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_jt # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_jt` — benchmark function synthetic:sw_jt:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_jt:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsltiu\tat,a0,8\n 4:\tbeqz\tat,64 \n 8:\tli\tv0,-1\n c:\tsll\tt6,a0,0x2\n 10:\tlui\tat,0x0\n 14:\taddu\tat,at,t6\n 18:\tlw\tt6,0(at)\n 1c:\tjr\tt6\n 20:\tnop\n 24:\tjr\tra\n 28:\tli\tv0,3\n 2c:\tjr\tra\n 30:\tli\tv0,5\n 34:\tjr\tra\n 38:\tli\tv0,7\n 3c:\tjr\tra\n 40:\tli\tv0,9\n 44:\tjr\tra\n 48:\tli\tv0,11\n 4c:\tjr\tra\n 50:\tli\tv0,13\n 54:\tjr\tra\n 58:\tli\tv0,15\n 5c:\tjr\tra\n 60:\tli\tv0,17\n 64:\tjr\tra\n 68:\tnop\n 6c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000070 .text\n00000000 l d .rodata\t00000020 .rodata\n00000000 g F .text\t0000006c sw_jt\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_HI16 .rodata\n00000018 R_MIPS_LO16 .rodata\n\n\nRELOCATION RECORDS FOR [.rodata]:\nOFFSET TYPE VALUE\n00000000 R_MIPS_32 .text\n00000004 R_MIPS_32 .text\n00000008 R_MIPS_32 .text\n0000000c R_MIPS_32 .text\n00000010 R_MIPS_32 .text\n00000014 R_MIPS_32 .text\n00000018 R_MIPS_32 .text\n0000001c R_MIPS_32 .text\n\n\nContents of section .text:\n 0000 2c810008 10200017 2402ffff 00047080 ,.... ..$.....p.\n 0010 3c010000 002e0821 8c2e0000 01c00008 <......!........\n 0020 00000000 03e00008 24020003 03e00008 ........$.......\n 0030 24020005 03e00008 24020007 03e00008 $.......$.......\n 0040 24020009 03e00008 2402000b 03e00008 $.......$.......\n 0050 2402000d 03e00008 2402000f 03e00008 $.......$.......\n 0060 24020011 03e00008 00000000 00000000 $...............\nContents of section .rodata:\n 0000 00000024 0000002c 00000034 0000003c ...$...,...4...<\n 0010 00000044 0000004c 00000054 0000005c ...D...L...T...\\\nContents of section .options:\n 0000 01200000 00000000 80004016 00000000 . ........@.....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004016 00000000 00000000 00000000 ..@.............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000001b 00000004 00000288 p...............\n 0010 00000005 000003c8 00000001 0000028c ................\n 0020 00000004 000002c0 00000000 00000000 ................\n 0030 00000011 000002f0 00000034 00000334 ...........4...4\n 0040 00000008 00000368 00000001 00000370 .......h.......p\n 0050 00000000 00000000 00000001 000003b8 ................\n 0060 08080800 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000006c 20200001 00000001 .......l ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d34 37386332 62346462 35616432 ef-478c2b4db5ad2\n 0130 6663622f 7265662e 63007377 5f6a7400 fcb/ref.c.sw_jt.\n 0140 73775f6a 74000000 00000000 00000001 sw_jt...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 0000001b 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000003 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_jt # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_jt:mwcc_242_81","sym":"sw_jt","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["switch","jump-table","dense"],"loc":1,"refSource":"int sw_jt(int x){ switch(x){case 0:return 3;case 1:return 5;case 2:return 7;case 3:return 9;case 4:return 11;case 5:return 13;case 6:return 15;case 7:return 17;default:return -1;} }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmplwi r3,7\n 4:\tbgt 60 \n 8:\tlis r4,0\n\t\t\ta: R_PPC_ADDR16_HA\t@15\n c:\tslwi r0,r3,2\n 10:\taddi r3,r4,0\n\t\t\t12: R_PPC_ADDR16_LO\t@15\n 14:\tlwzx r0,r3,r0\n 18:\tmtctr r0\n 1c:\tbctr\n 20:\tli r3,3\n 24:\tblr\n 28:\tli r3,5\n 2c:\tblr\n 30:\tli r3,7\n 34:\tblr\n 38:\tli r3,9\n 3c:\tblr\n 40:\tli r3,11\n 44:\tblr\n 48:\tli r3,13\n 4c:\tblr\n 50:\tli r3,15\n 54:\tblr\n 58:\tli r3,17\n 5c:\tblr\n 60:\tli r3,-1\n 64:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 l O .data\t00000020 @15\n00000000 g F .text\t00000068 sw_jt\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000a R_PPC_ADDR16_HA @15\n00000012 R_PPC_ADDR16_LO @15\n\n\nRELOCATION RECORDS FOR [.data]:\nOFFSET TYPE VALUE\n00000000 R_PPC_ADDR32 sw_jt+0x00000020\n00000004 R_PPC_ADDR32 sw_jt+0x00000028\n00000008 R_PPC_ADDR32 sw_jt+0x00000030\n0000000c R_PPC_ADDR32 sw_jt+0x00000038\n00000010 R_PPC_ADDR32 sw_jt+0x00000040\n00000014 R_PPC_ADDR32 sw_jt+0x00000048\n00000018 R_PPC_ADDR32 sw_jt+0x00000050\n0000001c R_PPC_ADDR32 sw_jt+0x00000058\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_jt\n\n\nContents of section .text:\n 0000 28030007 4181005c 3c800000 5460103a (...A..\\<...T`.:\n 0010 38640000 7c03002e 7c0903a6 4e800420 8d..|...|...N.. \n 0020 38600003 4e800020 38600005 4e800020 8`..N.. 8`..N.. \n 0030 38600007 4e800020 38600009 4e800020 8`..N.. 8`..N.. \n 0040 3860000b 4e800020 3860000d 4e800020 8`..N.. 8`..N.. \n 0050 3860000f 4e800020 38600011 4e800020 8`..N.. 8`..N.. \n 0060 3860ffff 4e800020 8`..N.. \nContents of section .data:\n 0000 00000000 00000000 00000000 00000000 ................\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .mwcats.text:\n 0000 02000068 00000000 ...h.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000008 00000000 00000004 ................\n 0050 00000000 00000004 00000000 00000004 ................\n 0060 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sw_jt(u32 a0) {\n switch (a0) {\n case 0:\n return 3;\n case 1:\n return 5;\n case 2:\n return 7;\n case 3:\n return 9;\n case 4:\n return 11;\n case 5:\n return 13;\n case 6:\n return 15;\n case 7:\n return 17;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":26,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_jt(u32 arg0) {\n switch (arg0) {\n case 0:\n return 3;\n case 1:\n return 5;\n case 2:\n return 7;\n case 3:\n return 9;\n case 4:\n return 0xB;\n case 5:\n return 0xD;\n case 6:\n return 0xF;\n case 7:\n return 0x11;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":26,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":22,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_jt` — benchmark function synthetic:sw_jt:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_jt\n cmplwi r3,7\n bgt .L60\n lis r4,jtbl_15@ha\n slwi r0,r3,2\n addi r3,r4,jtbl_15@l\n lwzx r0,r3,r0\n mtctr r0\n bctr\n.L20:\n li r3,3\n blr\n.L28:\n li r3,5\n blr\n.L30:\n li r3,7\n blr\n.L38:\n li r3,9\n blr\n.L40:\n li r3,11\n blr\n.L48:\n li r3,13\n blr\n.L50:\n li r3,15\n blr\n.L58:\n li r3,17\n blr\n.L60:\n li r3,-1\n blr\n.rodata\nglabel jtbl_15\n.word .L20\n.word .L28\n.word .L30\n.word .L38\n.word .L40\n.word .L48\n.word .L50\n.word .L58\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_jt # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_jt` — benchmark function synthetic:sw_jt:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_jt:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmplwi r3,7\n 4:\tbgt 60 \n 8:\tlis r4,0\n\t\t\ta: R_PPC_ADDR16_HA\t@15\n c:\tslwi r0,r3,2\n 10:\taddi r3,r4,0\n\t\t\t12: R_PPC_ADDR16_LO\t@15\n 14:\tlwzx r0,r3,r0\n 18:\tmtctr r0\n 1c:\tbctr\n 20:\tli r3,3\n 24:\tblr\n 28:\tli r3,5\n 2c:\tblr\n 30:\tli r3,7\n 34:\tblr\n 38:\tli r3,9\n 3c:\tblr\n 40:\tli r3,11\n 44:\tblr\n 48:\tli r3,13\n 4c:\tblr\n 50:\tli r3,15\n 54:\tblr\n 58:\tli r3,17\n 5c:\tblr\n 60:\tli r3,-1\n 64:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 l O .data\t00000020 @15\n00000000 g F .text\t00000068 sw_jt\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000a R_PPC_ADDR16_HA @15\n00000012 R_PPC_ADDR16_LO @15\n\n\nRELOCATION RECORDS FOR [.data]:\nOFFSET TYPE VALUE\n00000000 R_PPC_ADDR32 sw_jt+0x00000020\n00000004 R_PPC_ADDR32 sw_jt+0x00000028\n00000008 R_PPC_ADDR32 sw_jt+0x00000030\n0000000c R_PPC_ADDR32 sw_jt+0x00000038\n00000010 R_PPC_ADDR32 sw_jt+0x00000040\n00000014 R_PPC_ADDR32 sw_jt+0x00000048\n00000018 R_PPC_ADDR32 sw_jt+0x00000050\n0000001c R_PPC_ADDR32 sw_jt+0x00000058\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_jt\n\n\nContents of section .text:\n 0000 28030007 4181005c 3c800000 5460103a (...A..\\<...T`.:\n 0010 38640000 7c03002e 7c0903a6 4e800420 8d..|...|...N.. \n 0020 38600003 4e800020 38600005 4e800020 8`..N.. 8`..N.. \n 0030 38600007 4e800020 38600009 4e800020 8`..N.. 8`..N.. \n 0040 3860000b 4e800020 3860000d 4e800020 8`..N.. 8`..N.. \n 0050 3860000f 4e800020 38600011 4e800020 8`..N.. 8`..N.. \n 0060 3860ffff 4e800020 8`..N.. \nContents of section .data:\n 0000 00000000 00000000 00000000 00000000 ................\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .mwcats.text:\n 0000 02000068 00000000 ...h.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000008 00000000 00000004 ................\n 0050 00000000 00000004 00000000 00000004 ................\n 0060 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_jt # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_op:agbcc","sym":"sw_op","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","comparison-tree","arithmetic"],"loc":1,"refSource":"int sw_op(int op,int a,int b){ switch(op){case 0:return a+b;case 1:return a-b;case 2:return a*b;case 3:return a&b;default:return 0;} }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_op\n\t.type\t sw_op,function\n\t.thumb_func\nsw_op:\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x1\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr0, #0x2\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr0, #0x3\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tadd\tr0, r1, r2\n\tb\t.L11\n.L5:\n\tsub\tr0, r1, r2\n\tb\t.L11\n.L6:\n\tmov\tr0, r1\n\tmul\tr0, r0, r2\n\tb\t.L11\n.L7:\n\tand\tr1, r1, r2\n\tadd\tr0, r1, #0\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_op,.Lfe1-sw_op\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 sw_op(s32 a0, s32 a1, s32 a2) {\n switch (a0) {\n case 0:\n return a1 + a2;\n case 1:\n return a1 - a2;\n case 2:\n return a1 * a2;\n case 3:\n return a1 & a2;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_op(s32 arg0, s32 arg1, s32 arg2) {\n switch (arg0) { /* irregular */\n case 0:\n return arg1 + arg2;\n case 1:\n return arg1 - arg2;\n case 2:\n return arg1 * arg2;\n case 3:\n return arg1 & arg2;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":24,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_op` — benchmark function synthetic:sw_op:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_op\n\t.type\t sw_op,function\n\t.thumb_func\nsw_op:\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x1\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr0, #0x2\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr0, #0x3\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tadd\tr0, r1, r2\n\tb\t.L11\n.L5:\n\tsub\tr0, r1, r2\n\tb\t.L11\n.L6:\n\tmov\tr0, r1\n\tmul\tr0, r0, r2\n\tb\t.L11\n.L7:\n\tand\tr1, r1, r2\n\tadd\tr0, r1, #0\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_op,.Lfe1-sw_op\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_op # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_op` — benchmark function synthetic:sw_op:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_op:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_op\n\t.type\t sw_op,function\n\t.thumb_func\nsw_op:\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x1\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr0, #0x2\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr0, #0x3\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tadd\tr0, r1, r2\n\tb\t.L11\n.L5:\n\tsub\tr0, r1, r2\n\tb\t.L11\n.L6:\n\tmov\tr0, r1\n\tmul\tr0, r0, r2\n\tb\t.L11\n.L7:\n\tand\tr1, r1, r2\n\tadd\tr0, r1, #0\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_op,.Lfe1-sw_op\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_op # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_op:gcc2.7.2kmc","sym":"sw_op","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["switch","comparison-tree","arithmetic"],"loc":1,"refSource":"int sw_op(int op,int a,int b){ switch(op){case 0:return a+b;case 1:return a-b;case 2:return a*b;case 3:return a&b;default:return 0;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tbeq\ta0,v0,3c \n 8:\tslti\tv0,a0,2\n c:\tbeqzl\tv0,24 \n 10:\tli\tv0,2\n 14:\tbeqz\ta0,50 \n 18:\taddu\tv0,a1,a2\n 1c:\tj\t50 \n 20:\tmove\tv0,zero\n 24:\tbeq\ta0,v0,44 \n 28:\tli\tv0,3\n 2c:\tbeq\ta0,v0,50 \n 30:\tand\tv0,a1,a2\n 34:\tj\t50 \n 38:\tmove\tv0,zero\n 3c:\tj\t50 \n 40:\tsubu\tv0,a1,a2\n 44:\tnop\n 48:\tmult\ta1,a2\n 4c:\tmflo\tv0\n 50:\tjr\tra\n 54:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d6a51790181c9921/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 sw_op\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n00000034 R_MIPS_26 .text\n0000003c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020001 1082000d 28820002 50400005 $.......(...P@..\n 0010 24020002 1080000e 00a61021 08000014 $..........!....\n 0020 00001021 10820007 24020003 10820008 ...!....$.......\n 0030 00a61024 08000014 00001021 08000014 ...$.......!....\n 0040 00a61023 00000000 00a60018 00001012 ...#............\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_op' — lift: cannot lift 'sw_op': unmodelled control transfer 'beqzl' at 0xc — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tli\tv0,1 */\n/* 4:\tbeq\ta0,v0,3c */\n/* 8:\tslti\tv0,a0,2 */\n/* c:\tbeqzl\tv0,24 */\n/* 10:\tli\tv0,2 */\n/* 14:\tbeqz\ta0,50 */\n/* 18:\taddu\tv0,a1,a2 */\n/* 1c:\tj\t50 */\n/* 20:\tmove\tv0,zero */\n/* 24:\tbeq\ta0,v0,44 */\n/* 28:\tli\tv0,3 */\n/* 2c:\tbeq\ta0,v0,50 */\n/* 30:\tand\tv0,a1,a2 */\n/* 34:\tj\t50 */\n/* 38:\tmove\tv0,zero */\n/* 3c:\tj\t50 */\n/* 40:\tsubu\tv0,a1,a2 */\n/* 44:\tnop */\n/* 48:\tmult\ta1,a2 */\n/* 4c:\tmflo\tv0 */\n/* 50:\tjr\tra */\n/* 54:\tnop */\n/* \t... */\nvoid sw_op(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_op': unmodelled control transfer 'beqzl' at 0xc — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":31,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_op': unmodelled control transfer 'beqzl' at 0xc — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sw_op(s32 arg0, s32 arg1, s32 arg2) {\n s32 var_v0;\n\n if (arg0 != 1) {\n if (arg0 >= 2) {\n if (arg0 != 2) {\n var_v0 = arg1 & arg2;\n if (arg0 != 3) {\n return 0;\n }\n /* Duplicate return node #11. Try simplifying control flow for better match */\n return var_v0;\n }\n var_v0 = arg1 * arg2;\n /* Duplicate return node #11. Try simplifying control flow for better match */\n return var_v0;\n }\n var_v0 = arg1 + arg2;\n if (arg0 != 0) {\n return 0;\n }\n return var_v0;\n }\n return arg1 - arg2;\n}\n","score":22,"maxScore":30,"compileErrors":null,"breakdown":{"insert":8,"delete":7,"replace":2,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":24,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":22,"maxScore":30,"ratio":0.7333333333333333,"kinds":{"insert":8,"delete":7,"replace":2,"opMismatch":0,"argMismatch":5}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_op` — benchmark function synthetic:sw_op:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_op\n li\t$v0, 1\n beq\t$a0, $v0, .L3c\n slti\t$v0, $a0, 2\n beqzl\t$v0, .L24\n li\t$v0, 2\n beqz\t$a0, .L50\n addu\t$v0, $a1, $a2\n j\t.L50\n move\t$v0, $zero\n.L24:\n beq\t$a0, $v0, .L44\n li\t$v0, 3\n beq\t$a0, $v0, .L50\n and\t$v0, $a1, $a2\n j\t.L50\n move\t$v0, $zero\n.L3c:\n j\t.L50\n subu\t$v0, $a1, $a2\n.L44:\n nop\n mult\t$a1, $a2\n mflo\t$v0\n.L50:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_op # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_op` — benchmark function synthetic:sw_op:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_op:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tbeq\ta0,v0,3c \n 8:\tslti\tv0,a0,2\n c:\tbeqzl\tv0,24 \n 10:\tli\tv0,2\n 14:\tbeqz\ta0,50 \n 18:\taddu\tv0,a1,a2\n 1c:\tj\t50 \n 20:\tmove\tv0,zero\n 24:\tbeq\ta0,v0,44 \n 28:\tli\tv0,3\n 2c:\tbeq\ta0,v0,50 \n 30:\tand\tv0,a1,a2\n 34:\tj\t50 \n 38:\tmove\tv0,zero\n 3c:\tj\t50 \n 40:\tsubu\tv0,a1,a2\n 44:\tnop\n 48:\tmult\ta1,a2\n 4c:\tmflo\tv0\n 50:\tjr\tra\n 54:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d6a51790181c9921/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000058 sw_op\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n00000034 R_MIPS_26 .text\n0000003c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020001 1082000d 28820002 50400005 $.......(...P@..\n 0010 24020002 1080000e 00a61021 08000014 $..........!....\n 0020 00001021 10820007 24020003 10820008 ...!....$.......\n 0030 00a61024 08000014 00001021 08000014 ...$.......!....\n 0040 00a61023 00000000 00a60018 00001012 ...#............\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000074 00000000 00000000 00000000 ...t............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_op # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_op:ido7.1","sym":"sw_op","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["switch","comparison-tree","arithmetic"],"loc":1,"refSource":"int sw_op(int op,int a,int b){ switch(op){case 0:return a+b;case 1:return a-b;case 2:return a*b;case 3:return a&b;default:return 0;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,28 \n 4:\tli\tat,1\n 8:\tbeq\ta0,at,30 \n c:\tli\tat,2\n 10:\tbeq\ta0,at,38 \n 14:\tli\tat,3\n 18:\tbeq\ta0,at,48 \n 1c:\tmove\tv0,zero\n 20:\tb\t50 \n 24:\tnop\n 28:\tjr\tra\n 2c:\taddu\tv0,a1,a2\n 30:\tjr\tra\n 34:\tsubu\tv0,a1,a2\n 38:\tmultu\ta1,a2\n 3c:\tmflo\tv0\n 40:\tjr\tra\n 44:\tnop\n 48:\tjr\tra\n 4c:\tand\tv0,a1,a2\n 50:\tjr\tra\n 54:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000058 sw_op\n\n\nContents of section .text:\n 0000 10800009 24010001 10810009 24010002 ....$.......$...\n 0010 10810009 24010003 1081000b 00001025 ....$..........%\n 0020 1000000b 00000000 03e00008 00a61021 ...............!\n 0030 03e00008 00a61023 00a60019 00001012 .......#........\n 0040 03e00008 00000000 03e00008 00a61024 ...............$\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000076 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000016 00000004 000001c8 p...............\n 0010 00000005 00000308 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 00000008 000002a8 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 08080300 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000058 20200001 00000001 .......X ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 36613531 37393031 38316339 ef-d6a51790181c9\n 0130 3932312f 7265662e 63007377 5f6f7000 921/ref.c.sw_op.\n 0140 73775f6f 70000000 00000000 00000001 sw_op...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000016 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000003 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sw_op(u32 a0, u32 a1, u32 a2) {\n switch (a0) {\n case 0:\n return a1 + a2;\n case 1:\n return a1 - a2;\n case 2:\n return a1 * a2;\n case 3:\n return a1 & a2;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_op(s32 arg0, s32 arg1, s32 arg2) {\n switch (arg0) { /* irregular */\n case 0:\n return arg1 + arg2;\n case 1:\n return arg1 - arg2;\n case 2:\n return arg1 * arg2;\n case 3:\n return arg1 & arg2;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_op` — benchmark function synthetic:sw_op:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_op\n beqz\t$a0, .L28\n li\t$at, 1\n beq\t$a0, $at, .L30\n li\t$at, 2\n beq\t$a0, $at, .L38\n li\t$at, 3\n beq\t$a0, $at, .L48\n move\t$v0, $zero\n b\t.L50\n nop\n.L28:\n jr\t$ra\n addu\t$v0, $a1, $a2\n.L30:\n jr\t$ra\n subu\t$v0, $a1, $a2\n.L38:\n multu\t$a1, $a2\n mflo\t$v0\n jr\t$ra\n nop\n.L48:\n jr\t$ra\n and\t$v0, $a1, $a2\n.L50:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_op # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_op` — benchmark function synthetic:sw_op:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_op:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,28 \n 4:\tli\tat,1\n 8:\tbeq\ta0,at,30 \n c:\tli\tat,2\n 10:\tbeq\ta0,at,38 \n 14:\tli\tat,3\n 18:\tbeq\ta0,at,48 \n 1c:\tmove\tv0,zero\n 20:\tb\t50 \n 24:\tnop\n 28:\tjr\tra\n 2c:\taddu\tv0,a1,a2\n 30:\tjr\tra\n 34:\tsubu\tv0,a1,a2\n 38:\tmultu\ta1,a2\n 3c:\tmflo\tv0\n 40:\tjr\tra\n 44:\tnop\n 48:\tjr\tra\n 4c:\tand\tv0,a1,a2\n 50:\tjr\tra\n 54:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000058 sw_op\n\n\nContents of section .text:\n 0000 10800009 24010001 10810009 24010002 ....$.......$...\n 0010 10810009 24010003 1081000b 00001025 ....$..........%\n 0020 1000000b 00000000 03e00008 00a61021 ...............!\n 0030 03e00008 00a61023 00a60019 00001012 .......#........\n 0040 03e00008 00000000 03e00008 00a61024 ...............$\n 0050 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000076 00000000 . .........v....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000076 00000000 00000000 00000000 ...v............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000016 00000004 000001c8 p...............\n 0010 00000005 00000308 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000034 00000274 .......0...4...t\n 0040 00000008 000002a8 00000001 000002b0 ................\n 0050 00000000 00000000 00000001 000002f8 ................\n 0060 08080300 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000058 20200001 00000001 .......X ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 36613531 37393031 38316339 ef-d6a51790181c9\n 0130 3932312f 7265662e 63007377 5f6f7000 921/ref.c.sw_op.\n 0140 73775f6f 70000000 00000000 00000001 sw_op...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000016 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000003 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_op # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_op:mwcc_242_81","sym":"sw_op","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["switch","comparison-tree","arithmetic"],"loc":1,"refSource":"int sw_op(int op,int a,int b){ switch(op){case 0:return a+b;case 1:return a-b;case 2:return a*b;case 3:return a&b;default:return 0;} }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,2\n 4:\tbeq 38 \n 8:\tbge 1c \n c:\tcmpwi r3,0\n 10:\tbeq 28 \n 14:\tbge 30 \n 18:\tb 48 \n 1c:\tcmpwi r3,4\n 20:\tbge 48 \n 24:\tb 40 \n 28:\tadd r3,r4,r5\n 2c:\tblr\n 30:\tsubf r3,r5,r4\n 34:\tblr\n 38:\tmullw r3,r4,r5\n 3c:\tblr\n 40:\tand r3,r4,r5\n 44:\tblr\n 48:\tli r3,0\n 4c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000050 sw_op\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_op\n\n\nContents of section .text:\n 0000 2c030002 41820034 40800014 2c030000 ,...A..4@...,...\n 0010 41820018 4080001c 48000030 2c030004 A...@...H..0,...\n 0020 40800028 4800001c 7c642a14 4e800020 @..(H...|d*.N.. \n 0030 7c652050 4e800020 7c6429d6 4e800020 |e PN.. |d).N.. \n 0040 7c832838 4e800020 38600000 4e800020 |.(8N.. 8`..N.. \nContents of section .mwcats.text:\n 0000 02000050 00000000 ...P.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_op' — lift: cannot lift 'sw_op': conditional branch 'bge' has no reaching compare (cr0) in its block */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tcmpwi r3,2 */\n/* 4:\tbeq 38 */\n/* 8:\tbge 1c */\n/* c:\tcmpwi r3,0 */\n/* 10:\tbeq 28 */\n/* 14:\tbge 30 */\n/* 18:\tb 48 */\n/* 1c:\tcmpwi r3,4 */\n/* 20:\tbge 48 */\n/* 24:\tb 40 */\n/* 28:\tadd r3,r4,r5 */\n/* 2c:\tblr */\n/* 30:\tsubf r3,r5,r4 */\n/* 34:\tblr */\n/* 38:\tmullw r3,r4,r5 */\n/* 3c:\tblr */\n/* 40:\tand r3,r4,r5 */\n/* 44:\tblr */\n/* 48:\tli r3,0 */\n/* 4c:\tblr */\nvoid sw_op(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_op': conditional branch 'bge' has no reaching compare (cr0) in its block\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":28,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_op': conditional branch 'bge' has no reaching compare (cr0) in its block"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_op(s32 arg0, s32 arg1, s32 arg2) {\n switch (arg0) { /* irregular */\n case 0:\n return arg1 + arg2;\n case 1:\n return arg1 - arg2;\n case 2:\n return arg1 * arg2;\n case 3:\n return arg1 & arg2;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_op` — benchmark function synthetic:sw_op:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_op\n cmpwi r3,2\n beq .L38\n bge .L1c\n cmpwi r3,0\n beq .L28\n bge .L30\n b .L48\n.L1c:\n cmpwi r3,4\n bge .L48\n b .L40\n.L28:\n add r3,r4,r5\n blr\n.L30:\n subf r3,r5,r4\n blr\n.L38:\n mullw r3,r4,r5\n blr\n.L40:\n and r3,r4,r5\n blr\n.L48:\n li r3,0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_op # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_op` — benchmark function synthetic:sw_op:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_op:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,2\n 4:\tbeq 38 \n 8:\tbge 1c \n c:\tcmpwi r3,0\n 10:\tbeq 28 \n 14:\tbge 30 \n 18:\tb 48 \n 1c:\tcmpwi r3,4\n 20:\tbge 48 \n 24:\tb 40 \n 28:\tadd r3,r4,r5\n 2c:\tblr\n 30:\tsubf r3,r5,r4\n 34:\tblr\n 38:\tmullw r3,r4,r5\n 3c:\tblr\n 40:\tand r3,r4,r5\n 44:\tblr\n 48:\tli r3,0\n 4c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000050 sw_op\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_op\n\n\nContents of section .text:\n 0000 2c030002 41820034 40800014 2c030000 ,...A..4@...,...\n 0010 41820018 4080001c 48000030 2c030004 A...@...H..0,...\n 0020 40800028 4800001c 7c642a14 4e800020 @..(H...|d*.N.. \n 0030 7c652050 4e800020 7c6429d6 4e800020 |e PN.. |d).N.. \n 0040 7c832838 4e800020 38600000 4e800020 |.(8N.. 8`..N.. \nContents of section .mwcats.text:\n 0000 02000050 00000000 ...P.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_op # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_ret:agbcc","sym":"sw_ret","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","comparison-tree"],"loc":1,"refSource":"int sw_ret(int x){ switch(x){case 0:return 10;case 1:return 20;case 2:return 30;case 3:return 40;default:return -1;} }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_ret\n\t.type\t sw_ret,function\n\t.thumb_func\nsw_ret:\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x1\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr0, #0x2\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr0, #0x3\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tmov\tr0, #0xa\n\tb\t.L11\n.L5:\n\tmov\tr0, #0x14\n\tb\t.L11\n.L6:\n\tmov\tr0, #0x1e\n\tb\t.L11\n.L7:\n\tmov\tr0, #0x28\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_ret,.Lfe1-sw_ret\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 sw_ret(s32 a0) {\n switch (a0) {\n case 0:\n return 10;\n case 1:\n return 20;\n case 2:\n return 30;\n case 3:\n return 40;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":23,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_ret(s32 arg0) {\n switch (arg0) { /* irregular */\n case 0:\n return 0xA;\n case 1:\n return 0x14;\n case 2:\n return 0x1E;\n case 3:\n return 0x28;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":23,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_ret` — benchmark function synthetic:sw_ret:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_ret\n\t.type\t sw_ret,function\n\t.thumb_func\nsw_ret:\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x1\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr0, #0x2\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr0, #0x3\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tmov\tr0, #0xa\n\tb\t.L11\n.L5:\n\tmov\tr0, #0x14\n\tb\t.L11\n.L6:\n\tmov\tr0, #0x1e\n\tb\t.L11\n.L7:\n\tmov\tr0, #0x28\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_ret,.Lfe1-sw_ret\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_ret # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_ret` — benchmark function synthetic:sw_ret:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_ret:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_ret\n\t.type\t sw_ret,function\n\t.thumb_func\nsw_ret:\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr0, #0x1\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr0, #0x2\n\tbeq\t.L6\t@cond_branch\n\tcmp\tr0, #0x3\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tmov\tr0, #0xa\n\tb\t.L11\n.L5:\n\tmov\tr0, #0x14\n\tb\t.L11\n.L6:\n\tmov\tr0, #0x1e\n\tb\t.L11\n.L7:\n\tmov\tr0, #0x28\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x1\n\tneg\tr0, r0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_ret,.Lfe1-sw_ret\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_ret # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_ret:gcc2.7.2kmc","sym":"sw_ret","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["switch","comparison-tree"],"loc":1,"refSource":"int sw_ret(int x){ switch(x){case 0:return 10;case 1:return 20;case 2:return 30;case 3:return 40;default:return -1;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tbeq\ta0,v0,3c \n 8:\tslti\tv0,a0,2\n c:\tbeqzl\tv0,24 \n 10:\tli\tv0,2\n 14:\tbeqz\ta0,48 \n 18:\tli\tv0,10\n 1c:\tj\t48 \n 20:\tli\tv0,-1\n 24:\tbeq\ta0,v0,44 \n 28:\tli\tv0,3\n 2c:\tbeq\ta0,v0,48 \n 30:\tli\tv0,40\n 34:\tj\t48 \n 38:\tli\tv0,-1\n 3c:\tj\t48 \n 40:\tli\tv0,20\n 44:\tli\tv0,30\n 48:\tjr\tra\n 4c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-63d54cb61a8e4a30/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 sw_ret\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n00000034 R_MIPS_26 .text\n0000003c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020001 1082000d 28820002 50400005 $.......(...P@..\n 0010 24020002 1080000c 2402000a 08000012 $.......$.......\n 0020 2402ffff 10820007 24020003 10820006 $.......$.......\n 0030 24020028 08000012 2402ffff 08000012 $..(....$.......\n 0040 24020014 2402001e 03e00008 00000000 $...$...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_ret' — lift: cannot lift 'sw_ret': unmodelled control transfer 'beqzl' at 0xc — branch-likely / coprocessor branch not supported */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tli\tv0,1 */\n/* 4:\tbeq\ta0,v0,3c */\n/* 8:\tslti\tv0,a0,2 */\n/* c:\tbeqzl\tv0,24 */\n/* 10:\tli\tv0,2 */\n/* 14:\tbeqz\ta0,48 */\n/* 18:\tli\tv0,10 */\n/* 1c:\tj\t48 */\n/* 20:\tli\tv0,-1 */\n/* 24:\tbeq\ta0,v0,44 */\n/* 28:\tli\tv0,3 */\n/* 2c:\tbeq\ta0,v0,48 */\n/* 30:\tli\tv0,40 */\n/* 34:\tj\t48 */\n/* 38:\tli\tv0,-1 */\n/* 3c:\tj\t48 */\n/* 40:\tli\tv0,20 */\n/* 44:\tli\tv0,30 */\n/* 48:\tjr\tra */\n/* 4c:\tnop */\nvoid sw_ret(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_ret': unmodelled control transfer 'beqzl' at 0xc — branch-likely / coprocessor branch not supported\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":28,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_ret': unmodelled control transfer 'beqzl' at 0xc — branch-likely / coprocessor branch not supported"]},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sw_ret(s32 arg0) {\n s32 var_v0;\n\n if (arg0 != 1) {\n if (arg0 >= 2) {\n if (arg0 != 2) {\n var_v0 = 0x28;\n if (arg0 != 3) {\n return -1;\n }\n /* Duplicate return node #11. Try simplifying control flow for better match */\n return var_v0;\n }\n var_v0 = 0x1E;\n /* Duplicate return node #11. Try simplifying control flow for better match */\n return var_v0;\n }\n var_v0 = 0xA;\n if (arg0 != 0) {\n return -1;\n }\n return var_v0;\n }\n return 0x14;\n}\n","score":18,"maxScore":25,"compileErrors":null,"breakdown":{"insert":5,"delete":5,"replace":4,"opMismatch":0,"argMismatch":4},"quality":{"score":100,"lines":24,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":18,"maxScore":25,"ratio":0.72,"kinds":{"insert":5,"delete":5,"replace":4,"opMismatch":0,"argMismatch":4}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_ret` — benchmark function synthetic:sw_ret:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_ret\n li\t$v0, 1\n beq\t$a0, $v0, .L3c\n slti\t$v0, $a0, 2\n beqzl\t$v0, .L24\n li\t$v0, 2\n beqz\t$a0, .L48\n li\t$v0, 10\n j\t.L48\n li\t$v0, -1\n.L24:\n beq\t$a0, $v0, .L44\n li\t$v0, 3\n beq\t$a0, $v0, .L48\n li\t$v0, 40\n j\t.L48\n li\t$v0, -1\n.L3c:\n j\t.L48\n li\t$v0, 20\n.L44:\n li\t$v0, 30\n.L48:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_ret # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_ret` — benchmark function synthetic:sw_ret:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_ret:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tbeq\ta0,v0,3c \n 8:\tslti\tv0,a0,2\n c:\tbeqzl\tv0,24 \n 10:\tli\tv0,2\n 14:\tbeqz\ta0,48 \n 18:\tli\tv0,10\n 1c:\tj\t48 \n 20:\tli\tv0,-1\n 24:\tbeq\ta0,v0,44 \n 28:\tli\tv0,3\n 2c:\tbeq\ta0,v0,48 \n 30:\tli\tv0,40\n 34:\tj\t48 \n 38:\tli\tv0,-1\n 3c:\tj\t48 \n 40:\tli\tv0,20\n 44:\tli\tv0,30\n 48:\tjr\tra\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-63d54cb61a8e4a30/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000050 sw_ret\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n00000034 R_MIPS_26 .text\n0000003c R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 24020001 1082000d 28820002 50400005 $.......(...P@..\n 0010 24020002 1080000c 2402000a 08000012 $.......$.......\n 0020 2402ffff 10820007 24020003 10820006 $.......$.......\n 0030 24020028 08000012 2402ffff 08000012 $..(....$.......\n 0040 24020014 2402001e 03e00008 00000000 $...$...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_ret # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_ret:ido7.1","sym":"sw_ret","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["switch","comparison-tree"],"loc":1,"refSource":"int sw_ret(int x){ switch(x){case 0:return 10;case 1:return 20;case 2:return 30;case 3:return 40;default:return -1;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,28 \n 4:\tli\tat,1\n 8:\tbeq\ta0,at,30 \n c:\tli\tat,2\n 10:\tbeq\ta0,at,38 \n 14:\tli\tat,3\n 18:\tbeq\ta0,at,40 \n 1c:\tli\tv0,-1\n 20:\tb\t48 \n 24:\tnop\n 28:\tjr\tra\n 2c:\tli\tv0,10\n 30:\tjr\tra\n 34:\tli\tv0,20\n 38:\tjr\tra\n 3c:\tli\tv0,30\n 40:\tjr\tra\n 44:\tli\tv0,40\n 48:\tjr\tra\n 4c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t00000050 sw_ret\n\n\nContents of section .text:\n 0000 10800009 24010001 10810009 24010002 ....$.......$...\n 0010 10810009 24010003 10810009 2402ffff ....$.......$...\n 0020 10000009 00000000 03e00008 2402000a ............$...\n 0030 03e00008 24020014 03e00008 2402001e ....$.......$...\n 0040 03e00008 24020028 03e00008 00000000 ....$..(........\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000014 00000004 000001b8 p...............\n 0010 00000005 000002fc 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000038 00000264 ....... ...8...d\n 0040 00000008 0000029c 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 08080100 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000050 20200001 00000001 .......P ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 33643534 63623631 61386534 ef-63d54cb61a8e4\n 0130 6133302f 7265662e 63007377 5f726574 a30/ref.c.sw_ret\n 0140 00000000 73775f72 65740000 00000000 ....sw_ret......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000014 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000003 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sw_ret(u32 a0) {\n switch (a0) {\n case 0:\n return 10;\n case 1:\n return 20;\n case 2:\n return 30;\n case 3:\n return 40;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_ret(s32 arg0) {\n switch (arg0) { /* irregular */\n case 0:\n return 0xA;\n case 1:\n return 0x14;\n case 2:\n return 0x1E;\n case 3:\n return 0x28;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_ret` — benchmark function synthetic:sw_ret:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_ret\n beqz\t$a0, .L28\n li\t$at, 1\n beq\t$a0, $at, .L30\n li\t$at, 2\n beq\t$a0, $at, .L38\n li\t$at, 3\n beq\t$a0, $at, .L40\n li\t$v0, -1\n b\t.L48\n nop\n.L28:\n jr\t$ra\n li\t$v0, 10\n.L30:\n jr\t$ra\n li\t$v0, 20\n.L38:\n jr\t$ra\n li\t$v0, 30\n.L40:\n jr\t$ra\n li\t$v0, 40\n.L48:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_ret # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_ret` — benchmark function synthetic:sw_ret:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_ret:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,28 \n 4:\tli\tat,1\n 8:\tbeq\ta0,at,30 \n c:\tli\tat,2\n 10:\tbeq\ta0,at,38 \n 14:\tli\tat,3\n 18:\tbeq\ta0,at,40 \n 1c:\tli\tv0,-1\n 20:\tb\t48 \n 24:\tnop\n 28:\tjr\tra\n 2c:\tli\tv0,10\n 30:\tjr\tra\n 34:\tli\tv0,20\n 38:\tjr\tra\n 3c:\tli\tv0,30\n 40:\tjr\tra\n 44:\tli\tv0,40\n 48:\tjr\tra\n 4c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000050 .text\n00000000 g F .text\t00000050 sw_ret\n\n\nContents of section .text:\n 0000 10800009 24010001 10810009 24010002 ....$.......$...\n 0010 10810009 24010003 10810009 2402ffff ....$.......$...\n 0020 10000009 00000000 03e00008 2402000a ............$...\n 0030 03e00008 24020014 03e00008 2402001e ....$.......$...\n 0040 03e00008 24020028 03e00008 00000000 ....$..(........\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000014 00000004 000001b8 p...............\n 0010 00000005 000002fc 00000001 000001bc ................\n 0020 00000004 000001f0 00000000 00000000 ................\n 0030 00000011 00000220 00000038 00000264 ....... ...8...d\n 0040 00000008 0000029c 00000001 000002a4 ................\n 0050 00000000 00000000 00000001 000002ec ................\n 0060 08080100 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000050 20200001 00000001 .......P ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d36 33643534 63623631 61386534 ef-63d54cb61a8e4\n 0130 6133302f 7265662e 63007377 5f726574 a30/ref.c.sw_ret\n 0140 00000000 73775f72 65740000 00000000 ....sw_ret......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000014 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000003 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_ret # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_ret:mwcc_242_81","sym":"sw_ret","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["switch","comparison-tree"],"loc":1,"refSource":"int sw_ret(int x){ switch(x){case 0:return 10;case 1:return 20;case 2:return 30;case 3:return 40;default:return -1;} }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,2\n 4:\tbeq 38 \n 8:\tbge 1c \n c:\tcmpwi r3,0\n 10:\tbeq 28 \n 14:\tbge 30 \n 18:\tb 48 \n 1c:\tcmpwi r3,4\n 20:\tbge 48 \n 24:\tb 40 \n 28:\tli r3,10\n 2c:\tblr\n 30:\tli r3,20\n 34:\tblr\n 38:\tli r3,30\n 3c:\tblr\n 40:\tli r3,40\n 44:\tblr\n 48:\tli r3,-1\n 4c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000050 sw_ret\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_ret\n\n\nContents of section .text:\n 0000 2c030002 41820034 40800014 2c030000 ,...A..4@...,...\n 0010 41820018 4080001c 48000030 2c030004 A...@...H..0,...\n 0020 40800028 4800001c 3860000a 4e800020 @..(H...8`..N.. \n 0030 38600014 4e800020 3860001e 4e800020 8`..N.. 8`..N.. \n 0040 38600028 4e800020 3860ffff 4e800020 8`.(N.. 8`..N.. \nContents of section .mwcats.text:\n 0000 02000050 00000000 ...P.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_ret' — lift: cannot lift 'sw_ret': conditional branch 'bge' has no reaching compare (cr0) in its block */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tcmpwi r3,2 */\n/* 4:\tbeq 38 */\n/* 8:\tbge 1c */\n/* c:\tcmpwi r3,0 */\n/* 10:\tbeq 28 */\n/* 14:\tbge 30 */\n/* 18:\tb 48 */\n/* 1c:\tcmpwi r3,4 */\n/* 20:\tbge 48 */\n/* 24:\tb 40 */\n/* 28:\tli r3,10 */\n/* 2c:\tblr */\n/* 30:\tli r3,20 */\n/* 34:\tblr */\n/* 38:\tli r3,30 */\n/* 3c:\tblr */\n/* 40:\tli r3,40 */\n/* 44:\tblr */\n/* 48:\tli r3,-1 */\n/* 4c:\tblr */\nvoid sw_ret(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_ret': conditional branch 'bge' has no reaching compare (cr0) in its block\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":28,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_ret': conditional branch 'bge' has no reaching compare (cr0) in its block"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_ret(s32 arg0) {\n switch (arg0) { /* irregular */\n case 0:\n return 0xA;\n case 1:\n return 0x14;\n case 2:\n return 0x1E;\n case 3:\n return 0x28;\n default:\n return -1;\n }\n}\n","score":0,"maxScore":20,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_ret` — benchmark function synthetic:sw_ret:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_ret\n cmpwi r3,2\n beq .L38\n bge .L1c\n cmpwi r3,0\n beq .L28\n bge .L30\n b .L48\n.L1c:\n cmpwi r3,4\n bge .L48\n b .L40\n.L28:\n li r3,10\n blr\n.L30:\n li r3,20\n blr\n.L38:\n li r3,30\n blr\n.L40:\n li r3,40\n blr\n.L48:\n li r3,-1\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_ret # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_ret` — benchmark function synthetic:sw_ret:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_ret:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,2\n 4:\tbeq 38 \n 8:\tbge 1c \n c:\tcmpwi r3,0\n 10:\tbeq 28 \n 14:\tbge 30 \n 18:\tb 48 \n 1c:\tcmpwi r3,4\n 20:\tbge 48 \n 24:\tb 40 \n 28:\tli r3,10\n 2c:\tblr\n 30:\tli r3,20\n 34:\tblr\n 38:\tli r3,30\n 3c:\tblr\n 40:\tli r3,40\n 44:\tblr\n 48:\tli r3,-1\n 4c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000050 sw_ret\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_ret\n\n\nContents of section .text:\n 0000 2c030002 41820034 40800014 2c030000 ,...A..4@...,...\n 0010 41820018 4080001c 48000030 2c030004 A...@...H..0,...\n 0020 40800028 4800001c 3860000a 4e800020 @..(H...8`..N.. \n 0030 38600014 4e800020 3860001e 4e800020 8`..N.. 8`..N.. \n 0040 38600028 4e800020 3860ffff 4e800020 8`.(N.. 8`..N.. \nContents of section .mwcats.text:\n 0000 02000050 00000000 ...P.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_ret # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_sparse:agbcc","sym":"sw_sparse","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","sparse"],"loc":1,"refSource":"int sw_sparse(int x){ switch(x){case 1:return 1;case 10:return 2;case 100:return 3;case 1000:return 4;default:return 0;} }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_sparse\n\t.type\t sw_sparse,function\n\t.thumb_func\nsw_sparse:\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0xa\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr1, #0xa\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr1, #0x64\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0xfa\n\tlsl\tr0, r0, #0x2\n\tcmp\tr1, r0\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tmov\tr0, #0x1\n\tb\t.L11\n.L5:\n\tmov\tr0, #0x2\n\tb\t.L11\n.L6:\n\tmov\tr0, #0x3\n\tb\t.L11\n.L7:\n\tmov\tr0, #0x4\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_sparse,.Lfe1-sw_sparse\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 sw_sparse(s32 a0) {\n switch (a0) {\n case 1:\n return 1;\n case 10:\n return 2;\n case 100:\n return 3;\n case 1000:\n return 4;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":25,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_sparse(s32 arg0) {\n switch (arg0) { /* irregular */\n case 0x1:\n return 1;\n case 0xA:\n return 2;\n case 0x64:\n return 3;\n case 0x3E8:\n return 4;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":25,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_sparse` — benchmark function synthetic:sw_sparse:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_sparse\n\t.type\t sw_sparse,function\n\t.thumb_func\nsw_sparse:\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0xa\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr1, #0xa\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr1, #0x64\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0xfa\n\tlsl\tr0, r0, #0x2\n\tcmp\tr1, r0\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tmov\tr0, #0x1\n\tb\t.L11\n.L5:\n\tmov\tr0, #0x2\n\tb\t.L11\n.L6:\n\tmov\tr0, #0x3\n\tb\t.L11\n.L7:\n\tmov\tr0, #0x4\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_sparse,.Lfe1-sw_sparse\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_sparse # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_sparse` — benchmark function synthetic:sw_sparse:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_sparse:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_sparse\n\t.type\t sw_sparse,function\n\t.thumb_func\nsw_sparse:\n\tadd\tr1, r0, #0\n\tcmp\tr1, #0xa\n\tbeq\t.L5\t@cond_branch\n\tcmp\tr1, #0xa\n\tbgt\t.L10\t@cond_branch\n\tcmp\tr1, #0x1\n\tbeq\t.L4\t@cond_branch\n\tb\t.L8\n.L10:\n\tcmp\tr1, #0x64\n\tbeq\t.L6\t@cond_branch\n\tmov\tr0, #0xfa\n\tlsl\tr0, r0, #0x2\n\tcmp\tr1, r0\n\tbeq\t.L7\t@cond_branch\n\tb\t.L8\n.L4:\n\tmov\tr0, #0x1\n\tb\t.L11\n.L5:\n\tmov\tr0, #0x2\n\tb\t.L11\n.L6:\n\tmov\tr0, #0x3\n\tb\t.L11\n.L7:\n\tmov\tr0, #0x4\n\tb\t.L11\n.L8:\n\tmov\tr0, #0x0\n.L11:\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_sparse,.Lfe1-sw_sparse\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_sparse # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_sparse:gcc2.7.2kmc","sym":"sw_sparse","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["switch","sparse"],"loc":1,"refSource":"int sw_sparse(int x){ switch(x){case 1:return 1;case 10:return 2;case 100:return 3;case 1000:return 4;default:return 0;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,10\n 4:\tbeq\ta0,v0,40 \n 8:\tslti\tv0,a0,11\n c:\tbeqz\tv0,24 \n 10:\tli\tv0,1\n 14:\tbeq\ta0,v0,4c \n 18:\tnop\n 1c:\tj\t4c \n 20:\tmove\tv0,zero\n 24:\tli\tv0,100\n 28:\tbeq\ta0,v0,48 \n 2c:\tli\tv0,1000\n 30:\tbeq\ta0,v0,4c \n 34:\tli\tv0,4\n 38:\tj\t4c \n 3c:\tmove\tv0,zero\n 40:\tj\t4c \n 44:\tli\tv0,2\n 48:\tli\tv0,3\n 4c:\tjr\tra\n 50:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a8faf8a265802921/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 sw_sparse\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n00000038 R_MIPS_26 .text\n00000040 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 2402000a 1082000e 2882000b 10400005 $.......(....@..\n 0010 24020001 1082000d 00000000 08000013 $...............\n 0020 00001021 24020064 10820007 240203e8 ...!$..d....$...\n 0030 10820006 24020004 08000013 00001021 ....$..........!\n 0040 08000013 24020002 24020003 03e00008 ....$...$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 sw_sparse(u32 a0) {\n s32 v0;\n if (a0 == 10) {\n v0 = 2;\n } else {\n if (a0 < 11 == 0) {\n if (a0 == 100) {\n v0 = 3;\n } else {\n if (a0 == 1000) {\n v0 = 4;\n } else {\n v0 = 0;\n }\n }\n } else {\n v0 = a0 == 1;\n }\n }\n return v0;\n}\n","score":19,"maxScore":24,"compileErrors":null,"breakdown":{"insert":3,"delete":6,"replace":7,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":21,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 sw_sparse(s32 arg0) {\n s32 var_v0;\n\n if (arg0 != 0xA) {\n var_v0 = 1;\n if (arg0 < 0xB) {\n if (arg0 != 1) {\n return 0;\n }\n /* Duplicate return node #9. Try simplifying control flow for better match */\n return var_v0;\n }\n if (arg0 != 0x64) {\n var_v0 = 4;\n if (arg0 != 0x3E8) {\n return 0;\n }\n /* Duplicate return node #9. Try simplifying control flow for better match */\n return var_v0;\n }\n var_v0 = 3;\n return var_v0;\n }\n return 2;\n}\n","score":15,"maxScore":22,"compileErrors":null,"breakdown":{"insert":1,"delete":4,"replace":4,"opMismatch":0,"argMismatch":6},"quality":{"score":100,"lines":24,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"m2c","score":15,"maxScore":22,"ratio":0.6818181818181818,"kinds":{"insert":1,"delete":4,"replace":4,"opMismatch":0,"argMismatch":6}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_sparse` — benchmark function synthetic:sw_sparse:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_sparse\n li\t$v0, 10\n beq\t$a0, $v0, .L40\n slti\t$v0, $a0, 11\n beqz\t$v0, .L24\n li\t$v0, 1\n beq\t$a0, $v0, .L4c\n nop\n j\t.L4c\n move\t$v0, $zero\n.L24:\n li\t$v0, 100\n beq\t$a0, $v0, .L48\n li\t$v0, 1000\n beq\t$a0, $v0, .L4c\n li\t$v0, 4\n j\t.L4c\n move\t$v0, $zero\n.L40:\n j\t.L4c\n li\t$v0, 2\n.L48:\n li\t$v0, 3\n.L4c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_sparse # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_sparse` — benchmark function synthetic:sw_sparse:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_sparse:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,10\n 4:\tbeq\ta0,v0,40 \n 8:\tslti\tv0,a0,11\n c:\tbeqz\tv0,24 \n 10:\tli\tv0,1\n 14:\tbeq\ta0,v0,4c \n 18:\tnop\n 1c:\tj\t4c \n 20:\tmove\tv0,zero\n 24:\tli\tv0,100\n 28:\tbeq\ta0,v0,48 \n 2c:\tli\tv0,1000\n 30:\tbeq\ta0,v0,4c \n 34:\tli\tv0,4\n 38:\tj\t4c \n 3c:\tmove\tv0,zero\n 40:\tj\t4c \n 44:\tli\tv0,2\n 48:\tli\tv0,3\n 4c:\tjr\tra\n 50:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-a8faf8a265802921/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000054 sw_sparse\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000001c R_MIPS_26 .text\n00000038 R_MIPS_26 .text\n00000040 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 2402000a 1082000e 2882000b 10400005 $.......(....@..\n 0010 24020001 1082000d 00000000 08000013 $...............\n 0020 00001021 24020064 10820007 240203e8 ...!$..d....$...\n 0030 10820006 24020004 08000013 00001021 ....$..........!\n 0040 08000013 24020002 24020003 03e00008 ....$...$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_sparse # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_sparse:ido7.1","sym":"sw_sparse","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["switch","sparse"],"loc":1,"refSource":"int sw_sparse(int x){ switch(x){case 1:return 1;case 10:return 2;case 100:return 3;case 1000:return 4;default:return 0;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,1\n 4:\tbeq\ta0,at,2c \n 8:\tli\tat,10\n c:\tbeq\ta0,at,34 \n 10:\tli\tat,100\n 14:\tbeq\ta0,at,3c \n 18:\tli\tat,1000\n 1c:\tbeq\ta0,at,44 \n 20:\tmove\tv0,zero\n 24:\tb\t4c \n 28:\tnop\n 2c:\tjr\tra\n 30:\tli\tv0,1\n 34:\tjr\tra\n 38:\tli\tv0,2\n 3c:\tjr\tra\n 40:\tli\tv0,3\n 44:\tjr\tra\n 48:\tli\tv0,4\n 4c:\tjr\tra\n 50:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000054 sw_sparse\n\n\nContents of section .text:\n 0000 24010001 10810009 2401000a 10810009 $.......$.......\n 0010 24010064 10810009 240103e8 10810009 $..d....$.......\n 0020 00001025 10000009 00000000 03e00008 ...%............\n 0030 24020001 03e00008 24020002 03e00008 $.......$.......\n 0040 24020003 03e00008 24020004 03e00008 $.......$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000015 00000004 000001c8 p...............\n 0010 00000005 00000310 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000038 00000274 .......0...8...t\n 0040 0000000c 000002ac 00000001 000002b8 ................\n 0050 00000000 00000000 00000001 00000300 ................\n 0060 08080200 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000054 20200001 00000001 .......T ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 38666166 38613236 35383032 ef-a8faf8a265802\n 0130 3932312f 7265662e 63007377 5f737061 921/ref.c.sw_spa\n 0140 72736500 73775f73 70617273 65000000 rse.sw_sparse...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000015 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000003 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 sw_sparse(u32 a0) {\n switch (a0) {\n case 1:\n return 1;\n case 10:\n return 2;\n case 100:\n return 3;\n case 1000:\n return 4;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":21,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_sparse(s32 arg0) {\n switch (arg0) { /* irregular */\n case 0x1:\n return 1;\n case 0xA:\n return 2;\n case 0x64:\n return 3;\n case 0x3E8:\n return 4;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":21,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_sparse` — benchmark function synthetic:sw_sparse:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_sparse\n li\t$at, 1\n beq\t$a0, $at, .L2c\n li\t$at, 10\n beq\t$a0, $at, .L34\n li\t$at, 100\n beq\t$a0, $at, .L3c\n li\t$at, 1000\n beq\t$a0, $at, .L44\n move\t$v0, $zero\n b\t.L4c\n nop\n.L2c:\n jr\t$ra\n li\t$v0, 1\n.L34:\n jr\t$ra\n li\t$v0, 2\n.L3c:\n jr\t$ra\n li\t$v0, 3\n.L44:\n jr\t$ra\n li\t$v0, 4\n.L4c:\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_sparse # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_sparse` — benchmark function synthetic:sw_sparse:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_sparse:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,1\n 4:\tbeq\ta0,at,2c \n 8:\tli\tat,10\n c:\tbeq\ta0,at,34 \n 10:\tli\tat,100\n 14:\tbeq\ta0,at,3c \n 18:\tli\tat,1000\n 1c:\tbeq\ta0,at,44 \n 20:\tmove\tv0,zero\n 24:\tb\t4c \n 28:\tnop\n 2c:\tjr\tra\n 30:\tli\tv0,1\n 34:\tjr\tra\n 38:\tli\tv0,2\n 3c:\tjr\tra\n 40:\tli\tv0,3\n 44:\tjr\tra\n 48:\tli\tv0,4\n 4c:\tjr\tra\n 50:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000060 .text\n00000000 g F .text\t00000054 sw_sparse\n\n\nContents of section .text:\n 0000 24010001 10810009 2401000a 10810009 $.......$.......\n 0010 24010064 10810009 240103e8 10810009 $..d....$.......\n 0020 00001025 10000009 00000000 03e00008 ...%............\n 0030 24020001 03e00008 24020002 03e00008 $.......$.......\n 0040 24020003 03e00008 24020004 03e00008 $.......$.......\n 0050 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000015 00000004 000001c8 p...............\n 0010 00000005 00000310 00000001 000001cc ................\n 0020 00000004 00000200 00000000 00000000 ................\n 0030 00000011 00000230 00000038 00000274 .......0...8...t\n 0040 0000000c 000002ac 00000001 000002b8 ................\n 0050 00000000 00000000 00000001 00000300 ................\n 0060 08080200 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000054 20200001 00000001 .......T ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d61 38666166 38613236 35383032 ef-a8faf8a265802\n 0130 3932312f 7265662e 63007377 5f737061 921/ref.c.sw_spa\n 0140 72736500 73775f73 70617273 65000000 rse.sw_sparse...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000015 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000003 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_sparse # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_sparse:mwcc_242_81","sym":"sw_sparse","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["switch","sparse"],"loc":1,"refSource":"int sw_sparse(int x){ switch(x){case 1:return 1;case 10:return 2;case 100:return 3;case 1000:return 4;default:return 0;} }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,100\n 4:\tbeq 40 \n 8:\tbge 24 \n c:\tcmpwi r3,10\n 10:\tbeq 38 \n 14:\tbge 50 \n 18:\tcmpwi r3,1\n 1c:\tbeq 30 \n 20:\tb 50 \n 24:\tcmpwi r3,1000\n 28:\tbeq 48 \n 2c:\tb 50 \n 30:\tli r3,1\n 34:\tblr\n 38:\tli r3,2\n 3c:\tblr\n 40:\tli r3,3\n 44:\tblr\n 48:\tli r3,4\n 4c:\tblr\n 50:\tli r3,0\n 54:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000058 sw_sparse\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_sparse\n\n\nContents of section .text:\n 0000 2c030064 4182003c 4080001c 2c03000a ,..dA..<@...,...\n 0010 41820028 4080003c 2c030001 41820014 A..(@..<,...A...\n 0020 48000030 2c0303e8 41820020 48000024 H..0,...A.. H..$\n 0030 38600001 4e800020 38600002 4e800020 8`..N.. 8`..N.. \n 0040 38600003 4e800020 38600004 4e800020 8`..N.. 8`..N.. \n 0050 38600000 4e800020 8`..N.. \nContents of section .mwcats.text:\n 0000 02000058 00000000 ...X.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_sparse' — lift: cannot lift 'sw_sparse': conditional branch 'bge' has no reaching compare (cr0) in its block */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tcmpwi r3,100 */\n/* 4:\tbeq 40 */\n/* 8:\tbge 24 */\n/* c:\tcmpwi r3,10 */\n/* 10:\tbeq 38 */\n/* 14:\tbge 50 */\n/* 18:\tcmpwi r3,1 */\n/* 1c:\tbeq 30 */\n/* 20:\tb 50 */\n/* 24:\tcmpwi r3,1000 */\n/* 28:\tbeq 48 */\n/* 2c:\tb 50 */\n/* 30:\tli r3,1 */\n/* 34:\tblr */\n/* 38:\tli r3,2 */\n/* 3c:\tblr */\n/* 40:\tli r3,3 */\n/* 44:\tblr */\n/* 48:\tli r3,4 */\n/* 4c:\tblr */\n/* 50:\tli r3,0 */\n/* 54:\tblr */\nvoid sw_sparse(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_sparse': conditional branch 'bge' has no reaching compare (cr0) in its block\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":30,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_sparse': conditional branch 'bge' has no reaching compare (cr0) in its block"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 sw_sparse(s32 arg0) {\n switch (arg0) { /* irregular */\n case 0x1:\n return 1;\n case 0xA:\n return 2;\n case 0x64:\n return 3;\n case 0x3E8:\n return 4;\n default:\n return 0;\n }\n}\n","score":0,"maxScore":22,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":14,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_sparse` — benchmark function synthetic:sw_sparse:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_sparse\n cmpwi r3,100\n beq .L40\n bge .L24\n cmpwi r3,10\n beq .L38\n bge .L50\n cmpwi r3,1\n beq .L30\n b .L50\n.L24:\n cmpwi r3,1000\n beq .L48\n b .L50\n.L30:\n li r3,1\n blr\n.L38:\n li r3,2\n blr\n.L40:\n li r3,3\n blr\n.L48:\n li r3,4\n blr\n.L50:\n li r3,0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_sparse # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_sparse` — benchmark function synthetic:sw_sparse:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_sparse:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,100\n 4:\tbeq 40 \n 8:\tbge 24 \n c:\tcmpwi r3,10\n 10:\tbeq 38 \n 14:\tbge 50 \n 18:\tcmpwi r3,1\n 1c:\tbeq 30 \n 20:\tb 50 \n 24:\tcmpwi r3,1000\n 28:\tbeq 48 \n 2c:\tb 50 \n 30:\tli r3,1\n 34:\tblr\n 38:\tli r3,2\n 3c:\tblr\n 40:\tli r3,3\n 44:\tblr\n 48:\tli r3,4\n 4c:\tblr\n 50:\tli r3,0\n 54:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000058 sw_sparse\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_sparse\n\n\nContents of section .text:\n 0000 2c030064 4182003c 4080001c 2c03000a ,..dA..<@...,...\n 0010 41820028 4080003c 2c030001 41820014 A..(@..<,...A...\n 0020 48000030 2c0303e8 41820020 48000024 H..0,...A.. H..$\n 0030 38600001 4e800020 38600002 4e800020 8`..N.. 8`..N.. \n 0040 38600003 4e800020 38600004 4e800020 8`..N.. 8`..N.. \n 0050 38600000 4e800020 8`..N.. \nContents of section .mwcats.text:\n 0000 02000058 00000000 ...X.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_sparse # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_void:agbcc","sym":"sw_void","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["switch","void","memory"],"loc":1,"refSource":"void sw_void(int x,int *p){ switch(x){case 0:*p=1;break;case 1:*p=2;break;default:*p=0;} }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_void\n\t.type\t sw_void,function\n\t.thumb_func\nsw_void:\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L4:\n\tmov\tr0, #0x1\n\tb\t.L8\n.L5:\n\tmov\tr0, #0x2\n.L8:\n\tstr\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_void,.Lfe1-sw_void\n","ctx":"void sw_void(int,int*);","proto":{"sw_void":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void sw_void(u32 a0, s32 * a1) {\n s32 v0;\n switch (a0) {\n case 0:\n v0 = 1;\n break;\n case 1:\n v0 = 2;\n break;\n default:\n v0 = 0;\n }\n *a1 = v0;\n return;\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":15,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void sw_void(s32 arg0, s32 *arg1) {\n s32 var_r0;\n\n if (arg0 != 0) {\n if (arg0 != 1) {\n var_r0 = 0;\n } else {\n var_r0 = 2;\n }\n } else {\n var_r0 = 1;\n }\n *arg1 = var_r0;\n}\n","score":9,"maxScore":12,"compileErrors":null,"breakdown":{"insert":1,"delete":2,"replace":0,"opMismatch":1,"argMismatch":5},"quality":{"score":100,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_void` — benchmark function synthetic:sw_void:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_void\n\t.type\t sw_void,function\n\t.thumb_func\nsw_void:\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L4:\n\tmov\tr0, #0x1\n\tb\t.L8\n.L5:\n\tmov\tr0, #0x2\n.L8:\n\tstr\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_void,.Lfe1-sw_void\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid sw_void(int,int*);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_void # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_void` — benchmark function synthetic:sw_void:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_void:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tsw_void\n\t.type\t sw_void,function\n\t.thumb_func\nsw_void:\n\tcmp\tr0, #0\n\tbeq\t.L4\t@cond_branch\n\tcmp\tr0, #0x1\n\tbeq\t.L5\t@cond_branch\n\tmov\tr0, #0x0\n\tb\t.L8\n.L4:\n\tmov\tr0, #0x1\n\tb\t.L8\n.L5:\n\tmov\tr0, #0x2\n.L8:\n\tstr\tr0, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t sw_void,.Lfe1-sw_void\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sw_void\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_void # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_void:gcc2.7.2kmc","sym":"sw_void","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["switch","void","memory"],"loc":1,"refSource":"void sw_void(int x,int *p){ switch(x){case 0:*p=1;break;case 1:*p=2;break;default:*p=0;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,18 \n 4:\tli\tv0,1\n 8:\tbeq\ta0,v0,20 \n c:\tli\tv0,2\n 10:\tj\t24 \n 14:\tsw\tzero,0(a1)\n 18:\tj\t24 \n 1c:\tsw\tv0,0(a1)\n 20:\tsw\tv0,0(a1)\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\n","ctx":"void sw_void(int,int*);","proto":{"sw_void":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d63e783ff13c22bb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c sw_void\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 .text\n00000018 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 10800005 24020001 10820005 24020002 ....$.......$...\n 0010 08000009 aca00000 08000009 aca20000 ................\n 0020 aca20000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void sw_void(u32 a0, s32 * a1) {\n switch (a0) {\n case 0:\n *a1 = 1;\n break;\n case 1:\n *a1 = 2;\n break;\n default:\n *a1 = 0;\n }\n return;\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"void sw_void(s32 arg0, s32 *arg1) {\n if (arg0 != 0) {\n if (arg0 != 1) {\n *arg1 = 0;\n return;\n }\n *arg1 = 2;\n return;\n }\n *arg1 = 1;\n}\n","score":2,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":11,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_void` — benchmark function synthetic:sw_void:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_void\n beqz\t$a0, .L18\n li\t$v0, 1\n beq\t$a0, $v0, .L20\n li\t$v0, 2\n j\t.L24\n sw\t$zero, 0($a1)\n.L18:\n j\t.L24\n sw\t$v0, 0($a1)\n.L20:\n sw\t$v0, 0($a1)\n.L24:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid sw_void(int,int*);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_void # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_void` — benchmark function synthetic:sw_void:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_void:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,18 \n 4:\tli\tv0,1\n 8:\tbeq\ta0,v0,20 \n c:\tli\tv0,2\n 10:\tj\t24 \n 14:\tsw\tzero,0(a1)\n 18:\tj\t24 \n 1c:\tsw\tv0,0(a1)\n 20:\tsw\tv0,0(a1)\n 24:\tjr\tra\n 28:\tnop\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-d63e783ff13c22bb/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000002c sw_void\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000010 R_MIPS_26 .text\n00000018 R_MIPS_26 .text\n\n\nContents of section .text:\n 0000 10800005 24020001 10820005 24020002 ....$.......$...\n 0010 08000009 aca00000 08000009 aca20000 ................\n 0020 aca20000 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sw_void\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_void # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_void:ido7.1","sym":"sw_void","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["switch","void","memory"],"loc":1,"refSource":"void sw_void(int x,int *p){ switch(x){case 0:*p=1;break;case 1:*p=2;break;default:*p=0;} }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,1c \n 4:\tli\tt6,1\n 8:\tli\tat,1\n c:\tbeq\ta0,at,24 \n 10:\tli\tt7,2\n 14:\tb\t30 \n 18:\tsw\tzero,0(a1)\n 1c:\tjr\tra\n 20:\tsw\tt6,0(a1)\n 24:\tjr\tra\n 28:\tsw\tt7,0(a1)\n 2c:\tsw\tzero,0(a1)\n 30:\tjr\tra\n 34:\tnop\n\t...\n","ctx":"void sw_void(int,int*);","proto":{"sw_void":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000038 sw_void\n\n\nContents of section .text:\n 0000 10800006 240e0001 24010001 10810005 ....$...$.......\n 0010 240f0002 10000006 aca00000 03e00008 $...............\n 0020 acae0000 03e00008 acaf0000 aca00000 ................\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8000c032 00000000 . .........2....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c032 00000000 00000000 00000000 ...2............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000e 00000004 000001a8 p...............\n 0010 00000005 000002ec 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000038 00000254 ...........8...T\n 0040 00000008 0000028c 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 08040000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000038 20200001 00000001 .......8 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 36336537 38336666 31336332 ef-d63e783ff13c2\n 0130 3262622f 7265662e 63007377 5f766f69 2bb/ref.c.sw_voi\n 0140 64000000 73775f76 6f696400 00000000 d...sw_void.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000e 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void sw_void(u32 a0, s32 * a1) {\n switch (a0) {\n case 0:\n *a1 = 1;\n return;\n case 1:\n *a1 = 2;\n return;\n default:\n *a1 = 0;\n return;\n }\n}\n","score":0,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void sw_void(s32 arg0, s32 *arg1) {\n switch (arg0) { /* irregular */\n case 0:\n *arg1 = 1;\n return;\n case 1:\n *arg1 = 2;\n return;\n default:\n *arg1 = 0;\n return;\n }\n}\n","score":0,"maxScore":14,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_void` — benchmark function synthetic:sw_void:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_void\n beqz\t$a0, .L1c\n li\t$t6, 1\n li\t$at, 1\n beq\t$a0, $at, .L24\n li\t$t7, 2\n b\t.L30\n sw\t$zero, 0($a1)\n.L1c:\n jr\t$ra\n sw\t$t6, 0($a1)\n.L24:\n jr\t$ra\n sw\t$t7, 0($a1)\n sw\t$zero, 0($a1)\n.L30:\n jr\t$ra\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid sw_void(int,int*);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_void # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_void` — benchmark function synthetic:sw_void:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_void:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tbeqz\ta0,1c \n 4:\tli\tt6,1\n 8:\tli\tat,1\n c:\tbeq\ta0,at,24 \n 10:\tli\tt7,2\n 14:\tb\t30 \n 18:\tsw\tzero,0(a1)\n 1c:\tjr\tra\n 20:\tsw\tt6,0(a1)\n 24:\tjr\tra\n 28:\tsw\tt7,0(a1)\n 2c:\tsw\tzero,0(a1)\n 30:\tjr\tra\n 34:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000040 .text\n00000000 g F .text\t00000038 sw_void\n\n\nContents of section .text:\n 0000 10800006 240e0001 24010001 10810005 ....$...$.......\n 0010 240f0002 10000006 aca00000 03e00008 $...............\n 0020 acae0000 03e00008 acaf0000 aca00000 ................\n 0030 03e00008 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 8000c032 00000000 . .........2....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c032 00000000 00000000 00000000 ...2............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000e 00000004 000001a8 p...............\n 0010 00000005 000002ec 00000001 000001ac ................\n 0020 00000004 000001e0 00000000 00000000 ................\n 0030 00000011 00000210 00000038 00000254 ...........8...T\n 0040 00000008 0000028c 00000001 00000294 ................\n 0050 00000000 00000000 00000001 000002dc ................\n 0060 08040000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000038 20200001 00000001 .......8 ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 36336537 38336666 31336332 ef-d63e783ff13c2\n 0130 3262622f 7265662e 63007377 5f766f69 2bb/ref.c.sw_voi\n 0140 64000000 73775f76 6f696400 00000000 d...sw_void.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 0000000e 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000002 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sw_void\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_void # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:sw_void:mwcc_242_81","sym":"sw_void","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["switch","void","memory"],"loc":1,"refSource":"void sw_void(int x,int *p){ switch(x){case 0:*p=1;break;case 1:*p=2;break;default:*p=0;} }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,1\n 4:\tbeq 24 \n 8:\tbge 30 \n c:\tcmpwi r3,0\n 10:\tbge 18 \n 14:\tb 30 \n 18:\tli r0,1\n 1c:\tstw r0,0(r4)\n 20:\tblr\n 24:\tli r0,2\n 28:\tstw r0,0(r4)\n 2c:\tblr\n 30:\tli r0,0\n 34:\tstw r0,0(r4)\n 38:\tblr\n","ctx":"void sw_void(int,int*);","proto":{"sw_void":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000003c sw_void\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_void\n\n\nContents of section .text:\n 0000 2c030001 41820020 40800028 2c030000 ,...A.. @..(,...\n 0010 40800008 4800001c 38000001 90040000 @...H...8.......\n 0020 4e800020 38000002 90040000 4e800020 N.. 8.......N.. \n 0030 38000000 90040000 4e800020 8.......N.. \nContents of section .mwcats.text:\n 0000 0200003c 00000000 ...<.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'sw_void' — lift: cannot lift 'sw_void': conditional branch 'bge' has no reaching compare (cr0) in its block */\n/* original assembly: */\n/* target.o: file format elf32-powerpc */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\tcmpwi r3,1 */\n/* 4:\tbeq 24 */\n/* 8:\tbge 30 */\n/* c:\tcmpwi r3,0 */\n/* 10:\tbge 18 */\n/* 14:\tb 30 */\n/* 18:\tli r0,1 */\n/* 1c:\tstw r0,0(r4) */\n/* 20:\tblr */\n/* 24:\tli r0,2 */\n/* 28:\tstw r0,0(r4) */\n/* 2c:\tblr */\n/* 30:\tli r0,0 */\n/* 34:\tstw r0,0(r4) */\n/* 38:\tblr */\nvoid sw_void(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'sw_void': conditional branch 'bge' has no reaching compare (cr0) in its block\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":23,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'sw_void': conditional branch 'bge' has no reaching compare (cr0) in its block"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void sw_void(s32 arg0, s32 *arg1) {\n switch (arg0) { /* irregular */\n case 0:\n *arg1 = 1;\n return;\n case 1:\n *arg1 = 2;\n return;\n default:\n *arg1 = 0;\n return;\n }\n}\n","score":0,"maxScore":15,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":96,"lines":13,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `sw_void` — benchmark function synthetic:sw_void:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel sw_void\n cmpwi r3,1\n beq .L24\n bge .L30\n cmpwi r3,0\n bge .L18\n b .L30\n.L18:\n li r0,1\n stw r0,0(r4)\n blr\n.L24:\n li r0,2\n stw r0,0(r4)\n blr\n.L30:\n li r0,0\n stw r0,0(r4)\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid sw_void(int,int*);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function sw_void # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `sw_void` — benchmark function synthetic:sw_void:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:sw_void:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tcmpwi r3,1\n 4:\tbeq 24 \n 8:\tbge 30 \n c:\tcmpwi r3,0\n 10:\tbge 18 \n 14:\tb 30 \n 18:\tli r0,1\n 1c:\tstw r0,0(r4)\n 20:\tblr\n 24:\tli r0,2\n 28:\tstw r0,0(r4)\n 2c:\tblr\n 30:\tli r0,0\n 34:\tstw r0,0(r4)\n 38:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000003c sw_void\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 sw_void\n\n\nContents of section .text:\n 0000 2c030001 41820020 40800028 2c030000 ,...A.. @..(,...\n 0010 40800008 4800001c 38000001 90040000 @...H...8.......\n 0020 4e800020 38000002 90040000 4e800020 N.. 8.......N.. \n 0030 38000000 90040000 4e800020 8.......N.. \nContents of section .mwcats.text:\n 0000 0200003c 00000000 ...<.... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sw_void\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name sw_void # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:swapp:agbcc","sym":"swapp","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["memory","store","load"],"loc":1,"refSource":"void swapp(int *a,int *b){ int t=*a;*a=*b;*b=t; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tswapp\n\t.type\t swapp,function\n\t.thumb_func\nswapp:\n\tldr\tr3, [r0]\n\tldr\tr2, [r1]\n\tstr\tr2, [r0]\n\tstr\tr3, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t swapp,.Lfe1-swapp\n","ctx":"void swapp(int*,int*);","proto":{"swapp":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void swapp(s32 * a0, s32 * a1) {\n s32 v0;\n v0 = *a0;\n *a0 = *a1;\n *a1 = v0;\n return;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void swapp(s32 *arg0, s32 *arg1) {\n s32 temp_r3;\n\n temp_r3 = *arg0;\n *arg0 = *arg1;\n *arg1 = temp_r3;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `swapp` — benchmark function synthetic:swapp:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tswapp\n\t.type\t swapp,function\n\t.thumb_func\nswapp:\n\tldr\tr3, [r0]\n\tldr\tr2, [r1]\n\tstr\tr2, [r0]\n\tstr\tr3, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t swapp,.Lfe1-swapp\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid swapp(int*,int*);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function swapp # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `swapp` — benchmark function synthetic:swapp:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:swapp:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tswapp\n\t.type\t swapp,function\n\t.thumb_func\nswapp:\n\tldr\tr3, [r0]\n\tldr\tr2, [r1]\n\tstr\tr2, [r0]\n\tstr\tr3, [r1]\n\tbx\tlr\n.Lfe1:\n\t.size\t swapp,.Lfe1-swapp\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"swapp\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name swapp # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:swapp:gcc2.7.2kmc","sym":"swapp","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["memory","store","load"],"loc":1,"refSource":"void swapp(int *a,int *b){ int t=*a;*a=*b;*b=t; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a1)\n 4:\tlw\tv1,0(a0)\n 8:\tsw\tv0,0(a0)\n c:\tjr\tra\n 10:\tsw\tv1,0(a1)\n\t...\n","ctx":"void swapp(int*,int*);","proto":{"swapp":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1879e5d42d2f1731/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 swapp\n\n\nContents of section .text:\n 0000 8ca20000 8c830000 ac820000 03e00008 ................\n 0010 aca30000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void swapp(s32 * a0, s32 * a1) {\n s32 v0;\n v0 = *a0;\n *a0 = *a1;\n *a1 = v0;\n return;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void swapp(s32 *arg0, s32 *arg1) {\n s32 temp_v1;\n\n temp_v1 = *arg0;\n *arg0 = *arg1;\n *arg1 = temp_v1;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `swapp` — benchmark function synthetic:swapp:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel swapp\n lw\t$v0, 0($a1)\n lw\t$v1, 0($a0)\n sw\t$v0, 0($a0)\n jr\t$ra\n sw\t$v1, 0($a1)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid swapp(int*,int*);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function swapp # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `swapp` — benchmark function synthetic:swapp:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:swapp:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tv0,0(a1)\n 4:\tlw\tv1,0(a0)\n 8:\tsw\tv0,0(a0)\n c:\tjr\tra\n 10:\tsw\tv1,0(a1)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-1879e5d42d2f1731/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000014 swapp\n\n\nContents of section .text:\n 0000 8ca20000 8c830000 ac820000 03e00008 ................\n 0010 aca30000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"swapp\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name swapp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:swapp:ido7.1","sym":"swapp","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["memory","store","load"],"loc":1,"refSource":"void swapp(int *a,int *b){ int t=*a;*a=*b;*b=t; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tt6,0(a1)\n 4:\tlw\tv0,0(a0)\n 8:\tsw\tt6,0(a0)\n c:\tjr\tra\n 10:\tsw\tv0,0(a1)\n\t...\n","ctx":"void swapp(int*,int*);","proto":{"swapp":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 swapp\n\n\nContents of section .text:\n 0000 8cae0000 8c820000 ac8e0000 03e00008 ................\n 0010 aca20000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80004034 00000000 . ........@4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004034 00000000 00000000 00000000 ..@4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 38373965 35643432 64326631 ef-1879e5d42d2f1\n 0130 3733312f 7265662e 63007377 61707000 731/ref.c.swapp.\n 0140 73776170 70000000 00000000 00000001 swapp...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void swapp(s32 * a0, s32 * a1) {\n s32 v0;\n v0 = *a0;\n *a0 = *a1;\n *a1 = v0;\n return;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void swapp(s32 *arg0, s32 *arg1) {\n s32 temp_v0;\n\n temp_v0 = *arg0;\n *arg0 = *arg1;\n *arg1 = temp_v0;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `swapp` — benchmark function synthetic:swapp:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel swapp\n lw\t$t6, 0($a1)\n lw\t$v0, 0($a0)\n sw\t$t6, 0($a0)\n jr\t$ra\n sw\t$v0, 0($a1)\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid swapp(int*,int*);\nCTX_INPUT\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function swapp # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `swapp` — benchmark function synthetic:swapp:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:swapp:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlw\tt6,0(a1)\n 4:\tlw\tv0,0(a0)\n 8:\tsw\tt6,0(a0)\n c:\tjr\tra\n 10:\tsw\tv0,0(a1)\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 swapp\n\n\nContents of section .text:\n 0000 8cae0000 8c820000 ac8e0000 03e00008 ................\n 0010 aca20000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80004034 00000000 . ........@4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80004034 00000000 00000000 00000000 ..@4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d31 38373965 35643432 64326631 ef-1879e5d42d2f1\n 0130 3733312f 7265662e 63007377 61707000 731/ref.c.swapp.\n 0140 73776170 70000000 00000000 00000001 swapp...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"swapp\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name swapp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:swapp:mwcc_242_81","sym":"swapp","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["memory","store","load"],"loc":1,"refSource":"void swapp(int *a,int *b){ int t=*a;*a=*b;*b=t; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r5,0(r3)\n 4:\tlwz r0,0(r4)\n 8:\tstw r0,0(r3)\n c:\tstw r5,0(r4)\n 10:\tblr\n","ctx":"void swapp(int*,int*);","proto":{"swapp":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 swapp\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 swapp\n\n\nContents of section .text:\n 0000 80a30000 80040000 90030000 90a40000 ................\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void swapp(s32 * a0, s32 * a1) {\n s32 v0;\n v0 = *a0;\n *a0 = *a1;\n *a1 = v0;\n return;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void swapp(s32 *arg0, s32 *arg1) {\n s32 temp_r5;\n\n temp_r5 = *arg0;\n *arg0 = *arg1;\n *arg1 = temp_r5;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":6,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `swapp` — benchmark function synthetic:swapp:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel swapp\n lwz r5,0(r3)\n lwz r0,0(r4)\n stw r0,0(r3)\n stw r5,0(r4)\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid swapp(int*,int*);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function swapp # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `swapp` — benchmark function synthetic:swapp:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:swapp:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r5,0(r3)\n 4:\tlwz r0,0(r4)\n 8:\tstw r0,0(r3)\n c:\tstw r5,0(r4)\n 10:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 swapp\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 swapp\n\n\nContents of section .text:\n 0000 80a30000 80040000 90030000 90a40000 ................\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"swapp\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name swapp # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:togglebit:agbcc","sym":"togglebit","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int togglebit(int x,int n){ return x ^ (1< in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttogglebit\n\t.type\t togglebit,function\n\t.thumb_func\ntogglebit:\n\tadd\tr2, r0, #0\n\tmov\tr0, #0x1\n\tlsl\tr0, r0, r1\n\teor\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t togglebit,.Lfe1-togglebit\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function togglebit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `togglebit` — benchmark function synthetic:togglebit:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:togglebit:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttogglebit\n\t.type\t togglebit,function\n\t.thumb_func\ntogglebit:\n\tadd\tr2, r0, #0\n\tmov\tr0, #0x1\n\tlsl\tr0, r0, r1\n\teor\tr0, r0, r2\n\tbx\tlr\n.Lfe1:\n\t.size\t togglebit,.Lfe1-togglebit\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name togglebit # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:togglebit:gcc2.7.2kmc","sym":"togglebit","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int togglebit(int x,int n){ return x ^ (1<:\n 0:\tli\tv0,1\n 4:\tsllv\tv0,v0,a1\n 8:\tjr\tra\n c:\txor\tv0,a0,v0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5cd94e79888f8fb7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 togglebit\n\n\nContents of section .text:\n 0000 24020001 00a21004 03e00008 00821026 $..............&\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 togglebit(u32 a0, u32 a1) {\n return a0 ^ 1 << a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 togglebit(s32 arg0, s32 arg1) {\n return arg0 ^ (1 << arg1);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `togglebit` — benchmark function synthetic:togglebit:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel togglebit\n li\t$v0, 1\n sllv\t$v0, $v0, $a1\n jr\t$ra\n xor\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function togglebit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `togglebit` — benchmark function synthetic:togglebit:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:togglebit:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tv0,1\n 4:\tsllv\tv0,v0,a1\n 8:\tjr\tra\n c:\txor\tv0,a0,v0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5cd94e79888f8fb7/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000010 togglebit\n\n\nContents of section .text:\n 0000 24020001 00a21004 03e00008 00821026 $..............&\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name togglebit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:togglebit:ido7.1","sym":"togglebit","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int togglebit(int x,int n){ return x ^ (1<:\n 0:\tli\tt6,1\n 4:\tsllv\tt7,t6,a1\n 8:\tjr\tra\n c:\txor\tv0,t7,a0\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 togglebit\n\n\nContents of section .text:\n 0000 240e0001 00ae7804 03e00008 01e41026 $.....x........&\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002c0 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 0000000c 0000025c 00000001 00000268 .......\\.......h\n 0050 00000000 00000000 00000001 000002b0 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 63643934 65373938 38386638 ef-5cd94e79888f8\n 0130 6662372f 7265662e 6300746f 67676c65 fb7/ref.c.toggle\n 0140 62697400 746f6767 6c656269 74000000 bit.togglebit...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000004 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 togglebit(u32 a0, u32 a1) {\n return 1 << a1 ^ a0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 togglebit(s32 arg0, s32 arg1) {\n return (1 << arg1) ^ arg0;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `togglebit` — benchmark function synthetic:togglebit:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel togglebit\n li\t$t6, 1\n sllv\t$t7, $t6, $a1\n jr\t$ra\n xor\t$v0, $t7, $a0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function togglebit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `togglebit` — benchmark function synthetic:togglebit:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:togglebit:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tt6,1\n 4:\tsllv\tt7,t6,a1\n 8:\tjr\tra\n c:\txor\tv0,t7,a0\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000010 togglebit\n\n\nContents of section .text:\n 0000 240e0001 00ae7804 03e00008 01e41026 $.....x........&\nContents of section .options:\n 0000 01200000 00000000 8000c034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 8000c034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000004 00000004 00000178 p..............x\n 0010 00000005 000002c0 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000038 00000224 ...........8...$\n 0040 0000000c 0000025c 00000001 00000268 .......\\.......h\n 0050 00000000 00000000 00000001 000002b0 ................\n 0060 03000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000010 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 63643934 65373938 38386638 ef-5cd94e79888f8\n 0130 6662372f 7265662e 6300746f 67676c65 fb7/ref.c.toggle\n 0140 62697400 746f6767 6c656269 74000000 bit.togglebit...\n 0150 00000000 00000001 00000000 00000038 ...............8\n 0160 00000000 00000004 00000000 00000004 ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000001 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name togglebit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:togglebit:mwcc_242_81","sym":"togglebit","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["bitwise","shift"],"loc":1,"refSource":"int togglebit(int x,int n){ return x ^ (1<:\n 0:\tli r0,1\n 4:\tslw r0,r0,r4\n 8:\txor r3,r3,r0\n c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 togglebit\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 togglebit\n\n\nContents of section .text:\n 0000 38000001 7c002030 7c630278 4e800020 8...|. 0|c.xN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 togglebit(u32 a0, u32 a1) {\n return a0 ^ 1 << a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 togglebit(s32 arg0, s32 arg1) {\n return arg0 ^ (1 << arg1);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `togglebit` — benchmark function synthetic:togglebit:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel togglebit\n li r0,1\n slw r0,r0,r4\n xor r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function togglebit # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `togglebit` — benchmark function synthetic:togglebit:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:togglebit:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli r0,1\n 4:\tslw r0,r0,r4\n 8:\txor r3,r3,r0\n c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000010 togglebit\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 togglebit\n\n\nContents of section .text:\n 0000 38000001 7c002030 7c630278 4e800020 8...|. 0|c.xN.. \nContents of section .mwcats.text:\n 0000 02000010 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name togglebit # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tos8:agbcc","sym":"tos8","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","narrow","signed"],"loc":1,"refSource":"s8 tos8(int x){ return (s8)x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttos8\n\t.type\t tos8,function\n\t.thumb_func\ntos8:\n\tlsl\tr0, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t tos8,.Lfe1-tos8\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tos8(u32 a0) {\n return (s8)a0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 tos8(s8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tos8` — benchmark function synthetic:tos8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttos8\n\t.type\t tos8,function\n\t.thumb_func\ntos8:\n\tlsl\tr0, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t tos8,.Lfe1-tos8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tos8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tos8` — benchmark function synthetic:tos8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tos8:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttos8\n\t.type\t tos8,function\n\t.thumb_func\ntos8:\n\tlsl\tr0, r0, #0x18\n\tasr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t tos8,.Lfe1-tos8\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name tos8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tos8:gcc2.7.2kmc","sym":"tos8","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","narrow","signed"],"loc":1,"refSource":"s8 tos8(int x){ return (s8)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x18\n 4:\tjr\tra\n 8:\tsra\tv0,v0,0x18\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-07dea59d72245370/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c tos8\n\n\nContents of section .text:\n 0000 00041600 03e00008 00021603 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 tos8(s32 a0) {\n return a0 << 24 >> 24;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s8 tos8(s8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tos8` — benchmark function synthetic:tos8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tos8\n sll\t$v0, $a0, 0x18\n jr\t$ra\n sra\t$v0, $v0, 0x18\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tos8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tos8` — benchmark function synthetic:tos8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tos8:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x18\n 4:\tjr\tra\n 8:\tsra\tv0,v0,0x18\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-07dea59d72245370/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000000c tos8\n\n\nContents of section .text:\n 0000 00041600 03e00008 00021603 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name tos8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tos8:ido7.1","sym":"tos8","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","narrow","signed"],"loc":1,"refSource":"s8 tos8(int x){ return (s8)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x18\n 4:\tjr\tra\n 8:\tsra\tv0,v0,0x18\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c tos8\n\n\nContents of section .text:\n 0000 00041600 03e00008 00021603 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 37646561 35396437 32323435 ef-07dea59d72245\n 0130 3337302f 7265662e 6300746f 73380000 370/ref.c.tos8..\n 0140 746f7338 00000000 00000000 00000001 tos8............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000003 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 tos8(s32 a0) {\n return a0 << 24 >> 24;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s8 tos8(s8 arg0) {\n return arg0;\n}\n","score":3,"maxScore":4,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":0,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tos8` — benchmark function synthetic:tos8:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tos8\n sll\t$v0, $a0, 0x18\n jr\t$ra\n sra\t$v0, $v0, 0x18\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tos8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tos8` — benchmark function synthetic:tos8:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tos8:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsll\tv0,a0,0x18\n 4:\tjr\tra\n 8:\tsra\tv0,v0,0x18\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c tos8\n\n\nContents of section .text:\n 0000 00041600 03e00008 00021603 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 37646561 35396437 32323435 ef-07dea59d72245\n 0130 3337302f 7265662e 6300746f 73380000 370/ref.c.tos8..\n 0140 746f7338 00000000 00000000 00000001 tos8............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000003 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name tos8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tos8:mwcc_242_81","sym":"tos8","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","narrow","signed"],"loc":1,"refSource":"s8 tos8(int x){ return (s8)x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\textsb r3,r3\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 tos8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 tos8\n\n\nContents of section .text:\n 0000 7c630774 4e800020 |c.tN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tos8(u32 a0) {\n return (s8)a0;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s8 tos8(s8 arg0) {\n return arg0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tos8` — benchmark function synthetic:tos8:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tos8\n extsb r3,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tos8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tos8` — benchmark function synthetic:tos8:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tos8:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\textsb r3,r3\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 tos8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 tos8\n\n\nContents of section .text:\n 0000 7c630774 4e800020 |c.tN.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name tos8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou16:agbcc","sym":"tou16","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u16 tou16(int x){ return (u16)x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttou16\n\t.type\t tou16,function\n\t.thumb_func\ntou16:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t tou16,.Lfe1-tou16\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou16(u32 a0) {\n return (u16)a0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u16 tou16(u16 arg0) {\n return arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou16` — benchmark function synthetic:tou16:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttou16\n\t.type\t tou16,function\n\t.thumb_func\ntou16:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t tou16,.Lfe1-tou16\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou16` — benchmark function synthetic:tou16:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou16:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttou16\n\t.type\t tou16,function\n\t.thumb_func\ntou16:\n\tlsl\tr0, r0, #0x10\n\tlsr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t tou16,.Lfe1-tou16\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou16 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou16:gcc2.7.2kmc","sym":"tou16","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u16 tou16(int x){ return (u16)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xffff\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-214af963cce42910/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 tou16\n\n\nContents of section .text:\n 0000 03e00008 3082ffff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou16(u32 a0) {\n return a0 & 65535;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 tou16(s32 arg0) {\n return arg0 & 0xFFFF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou16` — benchmark function synthetic:tou16:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tou16\n jr\t$ra\n andi\t$v0, $a0, 0xffff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou16` — benchmark function synthetic:tou16:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou16:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xffff\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-214af963cce42910/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 tou16\n\n\nContents of section .text:\n 0000 03e00008 3082ffff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou16 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou16:ido7.1","sym":"tou16","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u16 tou16(int x){ return (u16)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xffff\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 tou16\n\n\nContents of section .text:\n 0000 03e00008 3082ffff 00000000 00000000 ....0...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 31346166 39363363 63653432 ef-214af963cce42\n 0130 3931302f 7265662e 6300746f 75313600 910/ref.c.tou16.\n 0140 746f7531 36000000 00000000 00000001 tou16...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou16(u32 a0) {\n return a0 & 65535;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 tou16(s32 arg0) {\n return arg0 & 0xFFFF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou16` — benchmark function synthetic:tou16:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tou16\n jr\t$ra\n andi\t$v0, $a0, 0xffff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou16` — benchmark function synthetic:tou16:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou16:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xffff\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 tou16\n\n\nContents of section .text:\n 0000 03e00008 3082ffff 00000000 00000000 ....0...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d32 31346166 39363363 63653432 ef-214af963cce42\n 0130 3931302f 7265662e 6300746f 75313600 910/ref.c.tou16.\n 0140 746f7531 36000000 00000000 00000001 tou16...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou16 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou16:mwcc_242_81","sym":"tou16","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u16 tou16(int x){ return (u16)x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,16\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 tou16\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 tou16\n\n\nContents of section .text:\n 0000 5463043e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou16(u32 a0) {\n return a0 & 65535;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u16 tou16(u16 arg0) {\n return arg0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou16` — benchmark function synthetic:tou16:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tou16\n clrlwi r3,r3,16\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou16 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou16` — benchmark function synthetic:tou16:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou16:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,16\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 tou16\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 tou16\n\n\nContents of section .text:\n 0000 5463043e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou16 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou8:agbcc","sym":"tou8","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u8 tou8(int x){ return (u8)x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttou8\n\t.type\t tou8,function\n\t.thumb_func\ntou8:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t tou8,.Lfe1-tou8\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou8(u32 a0) {\n return (u8)a0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u8 tou8(u8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou8` — benchmark function synthetic:tou8:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttou8\n\t.type\t tou8,function\n\t.thumb_func\ntou8:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t tou8,.Lfe1-tou8\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou8` — benchmark function synthetic:tou8:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou8:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttou8\n\t.type\t tou8,function\n\t.thumb_func\ntou8:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t tou8,.Lfe1-tou8\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou8 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou8:gcc2.7.2kmc","sym":"tou8","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u8 tou8(int x){ return (u8)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b02672a7f125af2b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 tou8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou8(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 tou8(s32 arg0) {\n return arg0 & 0xFF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou8` — benchmark function synthetic:tou8:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tou8\n jr\t$ra\n andi\t$v0, $a0, 0xff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou8` — benchmark function synthetic:tou8:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou8:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-b02672a7f125af2b/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 tou8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou8:ido7.1","sym":"tou8","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u8 tou8(int x){ return (u8)x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 tou8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 30323637 32613766 31323561 ef-b02672a7f125a\n 0130 6632622f 7265662e 6300746f 75380000 f2b/ref.c.tou8..\n 0140 746f7538 00000000 00000000 00000001 tou8............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou8(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 tou8(s32 arg0) {\n return arg0 & 0xFF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou8` — benchmark function synthetic:tou8:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tou8\n jr\t$ra\n andi\t$v0, $a0, 0xff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou8` — benchmark function synthetic:tou8:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou8:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t00000008 tou8\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .options:\n 0000 01200000 00000000 80000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000002 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 01000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000008 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d62 30323637 32613766 31323561 ef-b02672a7f125a\n 0130 6632622f 7265662e 6300746f 75380000 f2b/ref.c.tou8..\n 0140 746f7538 00000000 00000000 00000001 tou8............\n 0150 00000000 00000033 00000000 00000004 .......3........\n 0160 00000000 00000002 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:tou8:mwcc_242_81","sym":"tou8","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","narrow"],"loc":1,"refSource":"u8 tou8(int x){ return (u8)x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,24\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 tou8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 tou8\n\n\nContents of section .text:\n 0000 5463063e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 tou8(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 tou8(u8 arg0) {\n return arg0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `tou8` — benchmark function synthetic:tou8:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel tou8\n clrlwi r3,r3,24\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function tou8 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `tou8` — benchmark function synthetic:tou8:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:tou8:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,24\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 tou8\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 tou8\n\n\nContents of section .text:\n 0000 5463063e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name tou8 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:truncmul:agbcc","sym":"truncmul","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"s16 truncmul(s16 a,s16 b){ return a*b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttruncmul\n\t.type\t truncmul,function\n\t.thumb_func\ntruncmul:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t truncmul,.Lfe1-truncmul\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 truncmul(u32 a0, u32 a1) {\n return (s16)((s16)a0 * (s16)a1);\n}\n","score":4,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":4,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":98,"lines":3,"gotos":0,"casts":3,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s16 truncmul(s16 arg0, s16 arg1) {\n return (s16) (arg0 * arg1);\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `truncmul` — benchmark function synthetic:truncmul:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttruncmul\n\t.type\t truncmul,function\n\t.thumb_func\ntruncmul:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t truncmul,.Lfe1-truncmul\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function truncmul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `truncmul` — benchmark function synthetic:truncmul:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:truncmul:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\ttruncmul\n\t.type\t truncmul,function\n\t.thumb_func\ntruncmul:\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tlsl\tr1, r1, #0x10\n\tasr\tr1, r1, #0x10\n\tmul\tr0, r0, r1\n\tlsl\tr0, r0, #0x10\n\tasr\tr0, r0, #0x10\n\tbx\tlr\n.Lfe1:\n\t.size\t truncmul,.Lfe1-truncmul\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name truncmul # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:truncmul:gcc2.7.2kmc","sym":"truncmul","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"s16 truncmul(s16 a,s16 b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmult\ta0,a1\n 8:\tmflo\tv0\n c:\tsll\tv0,v0,0x10\n 10:\tnop\n 14:\tjr\tra\n 18:\tsra\tv0,v0,0x10\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5e885505a19e4205/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c truncmul\n\n\nContents of section .text:\n 0000 00000000 00850018 00001012 00021400 ................\n 0010 00000000 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"match","source":"s32 truncmul(s32 a0, s32 a1) {\n return a0 * a1 << 16 >> 16;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s16 truncmul(s32 arg0, s32 arg1) {\n return (s16) (arg0 * arg1);\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `truncmul` — benchmark function synthetic:truncmul:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel truncmul\n nop\n mult\t$a0, $a1\n mflo\t$v0\n sll\t$v0, $v0, 0x10\n nop\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function truncmul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `truncmul` — benchmark function synthetic:truncmul:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:truncmul:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tnop\n 4:\tmult\ta0,a1\n 8:\tmflo\tv0\n c:\tsll\tv0,v0,0x10\n 10:\tnop\n 14:\tjr\tra\n 18:\tsra\tv0,v0,0x10\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-5e885505a19e4205/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c truncmul\n\n\nContents of section .text:\n 0000 00000000 00850018 00001012 00021400 ................\n 0010 00000000 03e00008 00021403 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name truncmul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:truncmul:ido7.1","sym":"truncmul","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"s16 truncmul(s16 a,s16 b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tsll\ta1,a1,0x10\n c:\tsll\ta0,a0,0x10\n 10:\tsra\ta0,a0,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tmultu\ta0,a1\n 1c:\tmflo\tv0\n 20:\tsll\tv0,v0,0x10\n 24:\tjr\tra\n 28:\tsra\tv0,v0,0x10\n 2c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c truncmul\n\n\nContents of section .text:\n 0000 afa40000 afa50004 00052c00 00042400 ..........,...$.\n 0010 00042403 00052c03 00850019 00001012 ..$...,.........\n 0020 00021400 03e00008 00021403 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000004 00000198 p...............\n 0010 00000005 000002e0 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 0000000c 0000027c 00000001 00000288 .......|........\n 0050 00000000 00000000 00000001 000002d0 ................\n 0060 08010000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000002c 20200001 00000001 ......., ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 65383835 35303561 31396534 ef-5e885505a19e4\n 0130 3230352f 7265662e 63007472 756e636d 205/ref.c.truncm\n 0140 756c0000 7472756e 636d756c 00000000 ul..truncmul....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 0000000b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000002 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\n","asmlift":{"decompiler":"asmlift","candidateLabel":"signed","outcome":"nonmatch","source":"s32 truncmul(s32 a0, s32 a1) {\n return (a0 << 16 >> 16) * (a1 << 16 >> 16) << 16 >> 16;\n}\n","score":7,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":2,"replace":0,"opMismatch":0,"argMismatch":5},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s16 truncmul(s16 arg0, s16 arg1) {\n return (s16) (arg0 * arg1);\n}\n","score":0,"maxScore":11,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `truncmul` — benchmark function synthetic:truncmul:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel truncmul\n sw\t$a0, 0($sp)\n sw\t$a1, 4($sp)\n sll\t$a1, $a1, 0x10\n sll\t$a0, $a0, 0x10\n sra\t$a0, $a0, 0x10\n sra\t$a1, $a1, 0x10\n multu\t$a0, $a1\n mflo\t$v0\n sll\t$v0, $v0, 0x10\n jr\t$ra\n sra\t$v0, $v0, 0x10\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function truncmul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `truncmul` — benchmark function synthetic:truncmul:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:truncmul:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tsw\ta1,4(sp)\n 8:\tsll\ta1,a1,0x10\n c:\tsll\ta0,a0,0x10\n 10:\tsra\ta0,a0,0x10\n 14:\tsra\ta1,a1,0x10\n 18:\tmultu\ta0,a1\n 1c:\tmflo\tv0\n 20:\tsll\tv0,v0,0x10\n 24:\tjr\tra\n 28:\tsra\tv0,v0,0x10\n 2c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000030 .text\n00000000 g F .text\t0000002c truncmul\n\n\nContents of section .text:\n 0000 afa40000 afa50004 00052c00 00042400 ..........,...$.\n 0010 00042403 00052c03 00850019 00001012 ..$...,.........\n 0020 00021400 03e00008 00021403 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 a0000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 0000000b 00000004 00000198 p...............\n 0010 00000005 000002e0 00000001 0000019c ................\n 0020 00000004 000001d0 00000000 00000000 ................\n 0030 00000011 00000200 00000038 00000244 ...........8...D\n 0040 0000000c 0000027c 00000001 00000288 .......|........\n 0050 00000000 00000000 00000001 000002d0 ................\n 0060 08010000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000002c 20200001 00000001 ......., ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d35 65383835 35303561 31396534 ef-5e885505a19e4\n 0130 3230352f 7265662e 63007472 756e636d 205/ref.c.truncm\n 0140 756c0000 7472756e 636d756c 00000000 ul..truncmul....\n 0150 00000000 00000001 00000000 00000037 ...............7\n 0160 00000000 00000004 00000000 0000000b ................\n 0170 00000000 00000000 00000001 00000000 ................\n 0180 00000011 00000000 00000000 01800000 ................\n 0190 00000000 00000002 00000000 00000000 ................\n 01a0 00000000 18200001 00000000 00000000 ..... ..........\n 01b0 00000000 00000000 00000000 00000000 ................\n 01c0 7fffffff 00000000 00000000 00000002 ................\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name truncmul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:truncmul:mwcc_242_81","sym":"truncmul","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","narrow","arithmetic"],"loc":1,"refSource":"s16 truncmul(s16 a,s16 b){ return a*b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmullw r0,r3,r4\n 4:\textsh r3,r0\n 8:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c truncmul\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 truncmul\n\n\nContents of section .text:\n 0000 7c0321d6 7c030734 4e800020 |.!.|..4N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 truncmul(u32 a0, u32 a1) {\n return (s16)(a0 * a1);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s16 truncmul(s32 arg0, s32 arg1) {\n return (s16) (arg0 * arg1);\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `truncmul` — benchmark function synthetic:truncmul:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel truncmul\n mullw r0,r3,r4\n extsh r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function truncmul # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `truncmul` — benchmark function synthetic:truncmul:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:truncmul:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tmullw r0,r3,r4\n 4:\textsh r3,r0\n 8:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000000c truncmul\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 truncmul\n\n\nContents of section .text:\n 0000 7c0321d6 7c030734 4e800020 |.!.|..4N.. \nContents of section .mwcats.text:\n 0000 0200000c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name truncmul # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc:agbcc","sym":"udivc","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","unsigned-div-const"],"loc":1,"refSource":"unsigned udivc(unsigned a){ return a/7; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivc\n\t.type\t udivc,function\n\t.thumb_func\nudivc:\n\tpush\t{lr}\n\tmov\tr1, #0x7\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivc,.Lfe1-udivc\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc(u32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivc(u32 arg0) {\n return arg0 / 7U;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc` — benchmark function synthetic:udivc:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivc\n\t.type\t udivc,function\n\t.thumb_func\nudivc:\n\tpush\t{lr}\n\tmov\tr1, #0x7\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivc,.Lfe1-udivc\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc` — benchmark function synthetic:udivc:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivc\n\t.type\t udivc,function\n\t.thumb_func\nudivc:\n\tpush\t{lr}\n\tmov\tr1, #0x7\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivc,.Lfe1-udivc\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc:gcc2.7.2kmc","sym":"udivc","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","unsigned-div-const"],"loc":1,"refSource":"unsigned udivc(unsigned a){ return a/7; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x2492\n 4:\tori\tv0,v0,0x4925\n 8:\tmultu\ta0,v0\n c:\tmfhi\tv0\n 10:\tsubu\ta0,a0,v0\n 14:\tsrl\ta0,a0,0x1\n 18:\taddu\tv0,v0,a0\n 1c:\tjr\tra\n 20:\tsrl\tv0,v0,0x2\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ff00d74040eb2125/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 udivc\n\n\nContents of section .text:\n 0000 3c022492 34424925 00820019 00001010 <.$.4BI%........\n 0010 00822023 00042042 00441021 03e00008 .. #.. B.D.!....\n 0020 00021082 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc(u32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":9,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u32 udivc(s32 arg0) {\n s32 temp_hi;\n\n temp_hi = arg0 / 7;\n return (u32) (temp_hi + ((u32) (arg0 - temp_hi) >> 1)) >> 2;\n}\n","score":8,"maxScore":13,"compileErrors":null,"breakdown":{"insert":4,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":5,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc` — benchmark function synthetic:udivc:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivc\n lui\t$v0, 0x2492\n ori\t$v0, $v0, 0x4925\n multu\t$a0, $v0\n mfhi\t$v0\n subu\t$a0, $a0, $v0\n srl\t$a0, $a0, 0x1\n addu\t$v0, $v0, $a0\n jr\t$ra\n srl\t$v0, $v0, 0x2\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc` — benchmark function synthetic:udivc:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0x2492\n 4:\tori\tv0,v0,0x4925\n 8:\tmultu\ta0,v0\n c:\tmfhi\tv0\n 10:\tsubu\ta0,a0,v0\n 14:\tsrl\ta0,a0,0x1\n 18:\taddu\tv0,v0,a0\n 1c:\tjr\tra\n 20:\tsrl\tv0,v0,0x2\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ff00d74040eb2125/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000024 udivc\n\n\nContents of section .text:\n 0000 3c022492 34424925 00820019 00001010 <.$.4BI%........\n 0010 00822023 00042042 00441021 03e00008 .. #.. B.D.!....\n 0020 00021082 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc:ido7.1","sym":"udivc","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","unsigned-div-const"],"loc":1,"refSource":"unsigned udivc(unsigned a){ return a/7; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,7\n 4:\tdivu\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 udivc\n\n\nContents of section .text:\n 0000 24010007 0081001b 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 66303064 37343034 30656232 ef-ff00d74040eb2\n 0130 3132352f 7265662e 63007564 69766300 125/ref.c.udivc.\n 0140 75646976 63000000 00000000 00000001 udivc...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc(u32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivc(u32 arg0) {\n return arg0 / 7U;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc` — benchmark function synthetic:udivc:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivc\n li\t$at, 7\n divu\t$zero, $a0, $at\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc` — benchmark function synthetic:udivc:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,7\n 4:\tdivu\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 udivc\n\n\nContents of section .text:\n 0000 24010007 0081001b 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d66 66303064 37343034 30656232 ef-ff00d74040eb2\n 0130 3132352f 7265662e 63007564 69766300 125/ref.c.udivc.\n 0140 75646976 63000000 00000000 00000001 udivc...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000005 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc:mwcc_242_81","sym":"udivc","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","unsigned-div-const"],"loc":1,"refSource":"unsigned udivc(unsigned a){ return a/7; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,9362\n 4:\taddi r0,r4,18725\n 8:\tmulhwu r4,r0,r3\n c:\tsubf r0,r4,r3\n 10:\tsrwi r0,r0,1\n 14:\tadd r0,r0,r4\n 18:\tsrwi r3,r0,2\n 1c:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 udivc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 udivc\n\n\nContents of section .text:\n 0000 3c802492 38044925 7c801816 7c041850 <.$.8.I%|...|..P\n 0010 5400f87e 7c002214 5403f0be 4e800020 T..~|.\".T...N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc(u32 a0) {\n return a0 / 7;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u32 udivc(s32 arg0) {\n s32 temp_r4;\n\n temp_r4 = arg0 / 7;\n return (u32) (((u32) (arg0 - temp_r4) >> 1U) + temp_r4) >> 2U;\n}\n","score":8,"maxScore":12,"compileErrors":null,"breakdown":{"insert":4,"delete":0,"replace":1,"opMismatch":0,"argMismatch":3},"quality":{"score":100,"lines":5,"gotos":0,"casts":2,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc` — benchmark function synthetic:udivc:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivc\n lis r4,9362\n addi r0,r4,18725\n mulhwu r4,r0,r3\n subf r0,r4,r3\n srwi r0,r0,1\n add r0,r0,r4\n srwi r3,r0,2\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc` — benchmark function synthetic:udivc:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,9362\n 4:\taddi r0,r4,18725\n 8:\tmulhwu r4,r0,r3\n c:\tsubf r0,r4,r3\n 10:\tsrwi r0,r0,1\n 14:\tadd r0,r0,r4\n 18:\tsrwi r3,r0,2\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000020 udivc\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 udivc\n\n\nContents of section .text:\n 0000 3c802492 38044925 7c801816 7c041850 <.$.8.I%|...|..P\n 0010 5400f87e 7c002214 5403f0be 4e800020 T..~|.\".T...N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc10:agbcc","sym":"udivc10","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","unsigned-div-const","magic-div"],"loc":1,"refSource":"unsigned udivc10(unsigned a){ return a/10; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivc10\n\t.type\t udivc10,function\n\t.thumb_func\nudivc10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivc10,.Lfe1-udivc10\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc10(u32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivc10(u32 arg0) {\n return arg0 / 10U;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc10` — benchmark function synthetic:udivc10:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivc10\n\t.type\t udivc10,function\n\t.thumb_func\nudivc10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivc10,.Lfe1-udivc10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc10` — benchmark function synthetic:udivc10:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc10:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivc10\n\t.type\t udivc10,function\n\t.thumb_func\nudivc10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivc10,.Lfe1-udivc10\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc10 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc10:gcc2.7.2kmc","sym":"udivc10","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","unsigned-div-const","magic-div"],"loc":1,"refSource":"unsigned udivc10(unsigned a){ return a/10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0xcccc\n 4:\tori\tv0,v0,0xcccd\n 8:\tmultu\ta0,v0\n c:\tmfhi\tv1\n\t...\n 18:\tjr\tra\n 1c:\tsrl\tv0,v1,0x3\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-de2e270188bb4718/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 udivc10\n\n\nContents of section .text:\n 0000 3c02cccc 3442cccd 00820019 00001810 <...4B..........\n 0010 00000000 00000000 03e00008 000310c2 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc10(u32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 udivc10(s32 arg0) {\n return arg0 / 10;\n}\n","score":6,"maxScore":9,"compileErrors":null,"breakdown":{"insert":1,"delete":0,"replace":3,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc10` — benchmark function synthetic:udivc10:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivc10\n lui\t$v0, 0xcccc\n ori\t$v0, $v0, 0xcccd\n multu\t$a0, $v0\n mfhi\t$v1\n jr\t$ra\n srl\t$v0, $v1, 0x3\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc10` — benchmark function synthetic:udivc10:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc10:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0xcccc\n 4:\tori\tv0,v0,0xcccd\n 8:\tmultu\ta0,v0\n c:\tmfhi\tv1\n\t...\n 18:\tjr\tra\n 1c:\tsrl\tv0,v1,0x3\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-de2e270188bb4718/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000020 udivc10\n\n\nContents of section .text:\n 0000 3c02cccc 3442cccd 00820019 00001810 <...4B..........\n 0010 00000000 00000000 03e00008 000310c2 ................\nContents of section .reginfo:\n 0000 8000001c 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc10:ido7.1","sym":"udivc10","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","unsigned-div-const","magic-div"],"loc":1,"refSource":"unsigned udivc10(unsigned a){ return a/10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdivu\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 udivc10\n\n\nContents of section .text:\n 0000 2401000a 0081001b 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 65326532 37303138 38626234 ef-de2e270188bb4\n 0130 3731382f 7265662e 63007564 69766331 718/ref.c.udivc1\n 0140 30000000 75646976 63313000 00000000 0...udivc10.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc10(u32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivc10(u32 arg0) {\n return arg0 / 10U;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc10` — benchmark function synthetic:udivc10:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivc10\n li\t$at, 10\n divu\t$zero, $a0, $at\n mflo\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc10` — benchmark function synthetic:udivc10:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc10:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdivu\tzero,a0,at\n 8:\tmflo\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 udivc10\n\n\nContents of section .text:\n 0000 2401000a 0081001b 00001012 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d64 65326532 37303138 38626234 ef-de2e270188bb4\n 0130 3731382f 7265662e 63007564 69766331 718/ref.c.udivc1\n 0140 30000000 75646976 63313000 00000000 0...udivc10.....\n 0150 00000001 00000000 00000036 00000000 ...........6....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivc10:mwcc_242_81","sym":"udivc10","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","unsigned-div-const","magic-div"],"loc":1,"refSource":"unsigned udivc10(unsigned a){ return a/10; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,-13107\n 4:\taddi r0,r4,-13107\n 8:\tmulhwu r0,r0,r3\n c:\tsrwi r3,r0,3\n 10:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 udivc10\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 udivc10\n\n\nContents of section .text:\n 0000 3c80cccd 3804cccd 7c001816 5403e8fe <...8...|...T...\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivc10(u32 a0) {\n return a0 / 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 udivc10(s32 arg0) {\n return arg0 / 10;\n}\n","score":6,"maxScore":7,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":1,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivc10` — benchmark function synthetic:udivc10:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivc10\n lis r4,-13107\n addi r0,r4,-13107\n mulhwu r0,r0,r3\n srwi r3,r0,3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivc10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivc10` — benchmark function synthetic:udivc10:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivc10:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,-13107\n 4:\taddi r0,r4,-13107\n 8:\tmulhwu r0,r0,r3\n c:\tsrwi r3,r0,3\n 10:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000014 udivc10\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 udivc10\n\n\nContents of section .text:\n 0000 3c80cccd 3804cccd 7c001816 5403e8fe <...8...|...T...\n 0010 4e800020 N.. \nContents of section .mwcats.text:\n 0000 02000014 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivc10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivv:agbcc","sym":"udivv","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","div-reg","unsigned"],"loc":1,"refSource":"unsigned udivv(unsigned a,unsigned b){ return a/b; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivv\n\t.type\t udivv,function\n\t.thumb_func\nudivv:\n\tpush\t{lr}\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivv,.Lfe1-udivv\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivv(u32 a0, u32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivv(u32 arg0, u32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivv` — benchmark function synthetic:udivv:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivv\n\t.type\t udivv,function\n\t.thumb_func\nudivv:\n\tpush\t{lr}\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivv,.Lfe1-udivv\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivv` — benchmark function synthetic:udivv:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivv:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tudivv\n\t.type\t udivv,function\n\t.thumb_func\nudivv:\n\tpush\t{lr}\n\tbl\t__udivsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t udivv,.Lfe1-udivv\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivv # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivv:gcc2.7.2kmc","sym":"udivv","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","div-reg","unsigned"],"loc":1,"refSource":"unsigned udivv(unsigned a,unsigned b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivu\tzero,a0,a1\n 4:\tbnez\ta1,10 \n 8:\tnop\n c:\tbreak\t0x7\n 10:\tmflo\tv0\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-e7bcc78fba02c0f5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c udivv\n\n\nContents of section .text:\n 0000 0085001b 14a00002 00000000 0007000d ................\n 0010 00001012 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivv(u32 a0, u32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivv(u32 arg0, u32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivv` — benchmark function synthetic:udivv:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivv\n divu\t$zero, $a0, $a1\n bnez\t$a1, .L10\n nop\n break\t0x7\n.L10:\n mflo\t$v0\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivv` — benchmark function synthetic:udivv:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivv:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivu\tzero,a0,a1\n 4:\tbnez\ta1,10 \n 8:\tnop\n c:\tbreak\t0x7\n 10:\tmflo\tv0\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-e7bcc78fba02c0f5/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c udivv\n\n\nContents of section .text:\n 0000 0085001b 14a00002 00000000 0007000d ................\n 0010 00001012 03e00008 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivv:ido7.1","sym":"udivv","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","div-reg","unsigned"],"loc":1,"refSource":"unsigned udivv(unsigned a,unsigned b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivu\tzero,a0,a1\n 4:\tmflo\tv0\n 8:\tbnez\ta1,14 \n c:\tnop\n 10:\tbreak\t0x7\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c udivv\n\n\nContents of section .text:\n 0000 0085001b 00001012 14a00002 00000000 ................\n 0010 0007000d 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 37626363 37386662 61303263 ef-e7bcc78fba02c\n 0130 3066352f 7265662e 63007564 69767600 0f5/ref.c.udivv.\n 0140 75646976 76000000 00000000 00000001 udivv...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivv(u32 a0, u32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivv(u32 arg0, u32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivv` — benchmark function synthetic:udivv:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivv\n divu\t$zero, $a0, $a1\n mflo\t$v0\n bnez\t$a1, .L14\n nop\n break\t0x7\n.L14:\n jr\t$ra\n nop\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivv` — benchmark function synthetic:udivv:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivv:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivu\tzero,a0,a1\n 4:\tmflo\tv0\n 8:\tbnez\ta1,14 \n c:\tnop\n 10:\tbreak\t0x7\n 14:\tjr\tra\n 18:\tnop\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t0000001c udivv\n\n\nContents of section .text:\n 0000 0085001b 00001012 14a00002 00000000 ................\n 0010 0007000d 03e00008 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000034 00000000 . .........4....\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000034 00000000 00000000 00000000 ...4............\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000007 00000004 00000188 p...............\n 0010 00000005 000002c8 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000034 00000234 ...........4...4\n 0040 00000008 00000268 00000001 00000270 .......h.......p\n 0050 00000000 00000000 00000001 000002b8 ................\n 0060 06000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000001c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d65 37626363 37386662 61303263 ef-e7bcc78fba02c\n 0130 3066352f 7265662e 63007564 69767600 0f5/ref.c.udivv.\n 0140 75646976 76000000 00000000 00000001 udivv...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000007 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:udivv:mwcc_242_81","sym":"udivv","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","div-reg","unsigned"],"loc":1,"refSource":"unsigned udivv(unsigned a,unsigned b){ return a/b; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivwu r3,r3,r4\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 udivv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 udivv\n\n\nContents of section .text:\n 0000 7c632396 4e800020 |c#.N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 udivv(u32 a0, u32 a1) {\n return a0 / a1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 udivv(u32 arg0, u32 arg1) {\n return arg0 / arg1;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `udivv` — benchmark function synthetic:udivv:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel udivv\n divwu r3,r3,r4\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function udivv # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `udivv` — benchmark function synthetic:udivv:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:udivv:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tdivwu r3,r3,r4\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 udivv\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 udivv\n\n\nContents of section .text:\n 0000 7c632396 4e800020 |c#.N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name udivv # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:umod10:agbcc","sym":"umod10","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["arithmetic","unsigned-mod-const","magic-div"],"loc":1,"refSource":"unsigned umod10(unsigned a){ return a%10; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tumod10\n\t.type\t umod10,function\n\t.thumb_func\numod10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__umodsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t umod10,.Lfe1-umod10\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 umod10(u32 a0) {\n return a0 % 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 umod10(u32 arg0) {\n return arg0 % 10U;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `umod10` — benchmark function synthetic:umod10:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tumod10\n\t.type\t umod10,function\n\t.thumb_func\numod10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__umodsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t umod10,.Lfe1-umod10\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function umod10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `umod10` — benchmark function synthetic:umod10:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:umod10:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tumod10\n\t.type\t umod10,function\n\t.thumb_func\numod10:\n\tpush\t{lr}\n\tmov\tr1, #0xa\n\tbl\t__umodsi3\n\tpop\t{r1}\n\tbx\tr1\n.Lfe1:\n\t.size\t umod10,.Lfe1-umod10\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name umod10 # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:umod10:gcc2.7.2kmc","sym":"umod10","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["arithmetic","unsigned-mod-const","magic-div"],"loc":1,"refSource":"unsigned umod10(unsigned a){ return a%10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0xcccc\n 4:\tori\tv0,v0,0xcccd\n 8:\tmultu\ta0,v0\n c:\tmfhi\ta1\n 10:\tsrl\tv1,a1,0x3\n 14:\tsll\tv0,v1,0x2\n 18:\taddu\tv0,v0,v1\n 1c:\tsll\tv0,v0,0x1\n 20:\tjr\tra\n 24:\tsubu\tv0,a0,v0\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-02d32a69804edd71/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 umod10\n\n\nContents of section .text:\n 0000 3c02cccc 3442cccd 00820019 00002810 <...4B........(.\n 0010 000518c2 00031080 00431021 00021040 .........C.!...@\n 0020 03e00008 00821023 00000000 00000000 .......#........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 umod10(u32 a0) {\n return a0 - a0 / 10 * 10;\n}\n","score":0,"maxScore":10,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 umod10(s32 arg0) {\n return arg0 % 10;\n}\n","score":6,"maxScore":12,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":2,"opMismatch":0,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `umod10` — benchmark function synthetic:umod10:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel umod10\n lui\t$v0, 0xcccc\n ori\t$v0, $v0, 0xcccd\n multu\t$a0, $v0\n mfhi\t$a1\n srl\t$v1, $a1, 0x3\n sll\t$v0, $v1, 0x2\n addu\t$v0, $v0, $v1\n sll\t$v0, $v0, 0x1\n jr\t$ra\n subu\t$v0, $a0, $v0\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function umod10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `umod10` — benchmark function synthetic:umod10:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:umod10:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlui\tv0,0xcccc\n 4:\tori\tv0,v0,0xcccd\n 8:\tmultu\ta0,v0\n c:\tmfhi\ta1\n 10:\tsrl\tv1,a1,0x3\n 14:\tsll\tv0,v1,0x2\n 18:\taddu\tv0,v0,v1\n 1c:\tsll\tv0,v0,0x1\n 20:\tjr\tra\n 24:\tsubu\tv0,a0,v0\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-02d32a69804edd71/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000028 umod10\n\n\nContents of section .text:\n 0000 3c02cccc 3442cccd 00820019 00002810 <...4B........(.\n 0010 000518c2 00031080 00431021 00021040 .........C.!...@\n 0020 03e00008 00821023 00000000 00000000 .......#........\nContents of section .reginfo:\n 0000 8000003c 00000000 00000000 00000000 ...<............\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name umod10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:umod10:ido7.1","sym":"umod10","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["arithmetic","unsigned-mod-const","magic-div"],"loc":1,"refSource":"unsigned umod10(unsigned a){ return a%10; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdivu\tzero,a0,at\n 8:\tmfhi\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 umod10\n\n\nContents of section .text:\n 0000 2401000a 0081001b 00001010 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 32643332 61363938 30346564 ef-02d32a69804ed\n 0130 6437312f 7265662e 6300756d 6f643130 d71/ref.c.umod10\n 0140 00000000 756d6f64 31300000 00000000 ....umod10......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"u32 umod10(u32 a0) {\n return a0 % 10;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u32 umod10(u32 arg0) {\n return arg0 % 10U;\n}\n","score":0,"maxScore":5,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `umod10` — benchmark function synthetic:umod10:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel umod10\n li\t$at, 10\n divu\t$zero, $a0, $at\n mfhi\t$v0\n jr\t$ra\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function umod10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `umod10` — benchmark function synthetic:umod10:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:umod10:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tli\tat,10\n 4:\tdivu\tzero,a0,at\n 8:\tmfhi\tv0\n c:\tjr\tra\n 10:\tnop\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000020 .text\n00000000 g F .text\t00000014 umod10\n\n\nContents of section .text:\n 0000 2401000a 0081001b 00001010 03e00008 $...............\n 0010 00000000 00000000 00000000 00000000 ................\nContents of section .options:\n 0000 01200000 00000000 80000016 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 80000016 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000005 00000004 00000188 p...............\n 0010 00000005 000002cc 00000001 0000018c ................\n 0020 00000004 000001c0 00000000 00000000 ................\n 0030 00000011 000001f0 00000038 00000234 ...........8...4\n 0040 00000008 0000026c 00000001 00000274 .......l.......t\n 0050 00000000 00000000 00000001 000002bc ................\n 0060 04000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 00000014 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d30 32643332 61363938 30346564 ef-02d32a69804ed\n 0130 6437312f 7265662e 6300756d 6f643130 d71/ref.c.umod10\n 0140 00000000 756d6f64 31300000 00000000 ....umod10......\n 0150 00000001 00000000 00000035 00000000 ...........5....\n 0160 00000004 00000000 00000005 00000000 ................\n 0170 00000000 00000001 00000000 00000011 ................\n 0180 00000000 00000000 01800000 00000000 ................\n 0190 00000001 00000000 00000000 00000000 ................\n 01a0 18200001 00000000 00000000 00000000 . ..............\n 01b0 00000000 00000000 00000000 7fffffff ................\n 01c0 00000000 00000000 00000002 ............\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name umod10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:umod10:mwcc_242_81","sym":"umod10","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["arithmetic","unsigned-mod-const","magic-div"],"loc":1,"refSource":"unsigned umod10(unsigned a){ return a%10; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,-13107\n 4:\taddi r0,r4,-13107\n 8:\tmulhwu r0,r0,r3\n c:\tsrwi r0,r0,3\n 10:\tmulli r0,r0,10\n 14:\tsubf r3,r0,r3\n 18:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c umod10\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 umod10\n\n\nContents of section .text:\n 0000 3c80cccd 3804cccd 7c001816 5400e8fe <...8...|...T...\n 0010 1c00000a 7c601850 4e800020 ....|`.PN.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 umod10(u32 a0) {\n return a0 - a0 / 10 * 10;\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 umod10(s32 arg0) {\n return arg0 % 10;\n}\n","score":6,"maxScore":9,"compileErrors":null,"breakdown":{"insert":2,"delete":0,"replace":1,"opMismatch":1,"argMismatch":2},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `umod10` — benchmark function synthetic:umod10:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel umod10\n lis r4,-13107\n addi r0,r4,-13107\n mulhwu r0,r0,r3\n srwi r0,r0,3\n mulli r0,r0,10\n subf r3,r0,r3\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function umod10 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `umod10` — benchmark function synthetic:umod10:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:umod10:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlis r4,-13107\n 4:\taddi r0,r4,-13107\n 8:\tmulhwu r0,r0,r3\n c:\tsrwi r0,r0,3\n 10:\tmulli r0,r0,10\n 14:\tsubf r3,r0,r3\n 18:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t0000001c umod10\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 umod10\n\n\nContents of section .text:\n 0000 3c80cccd 3804cccd 7c001816 5400e8fe <...8...|...T...\n 0010 1c00000a 7c601850 4e800020 ....|`.PN.. \nContents of section .mwcats.text:\n 0000 0200001c 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name umod10 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:Vec__len2:mwcc_242_81","sym":"Vec__len2","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c++","features":["c++","method","this-ptr"],"loc":2,"refSource":"struct Vec{int x;int y;int len2(){ return x*x+y*y; }};\nextern \"C\" int Vec__len2(Vec*v){ return v->len2(); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r4,0(r3)\n 4:\tlwz r0,4(r3)\n 8:\tmullw r3,r4,r4\n c:\tmullw r0,r0,r0\n 10:\tadd r3,r3,r0\n 14:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.cp\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 Vec__len2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 Vec__len2\n\n\nContents of section .text:\n 0000 80830000 80030004 7c6421d6 7c0001d6 ........|d!.|...\n 0010 7c630214 4e800020 |c..N.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 Vec__len2(s32 * a0) {\n return *a0 * *a0 + a0[1] * a0[1];\n}\n","score":0,"maxScore":6,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"noncompile","source":"s32 Vec__len2(void *arg0) {\n s32 temp_r0;\n s32 temp_r4;\n\n temp_r4 = arg0->unk0;\n temp_r0 = arg0->unk4;\n return (temp_r4 * temp_r4) + (temp_r0 * temp_r0);\n}\n","score":null,"maxScore":null,"compileErrors":2,"quality":{"score":100,"lines":7,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0},"errorMarkers":["# Error: ^^","# not a struct/union/class"]},"note":"C++ method via this-pointer","gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `Vec__len2` — benchmark function synthetic:Vec__len2:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel Vec__len2\n lwz r4,0(r3)\n lwz r0,4(r3)\n mullw r3,r4,r4\n mullw r0,r0,r0\n add r3,r3,r0\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c++ # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function Vec__len2 # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `Vec__len2` — benchmark function synthetic:Vec__len2:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:Vec__len2:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tlwz r4,0(r3)\n 4:\tlwz r0,4(r3)\n 8:\tmullw r3,r4,r4\n c:\tmullw r0,r0,r0\n 10:\tadd r3,r3,r0\n 14:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.cp\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000018 Vec__len2\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 Vec__len2\n\n\nContents of section .text:\n 0000 80830000 80030004 7c6421d6 7c0001d6 ........|d!.|...\n 0010 7c630214 4e800020 |c..N.. \nContents of section .mwcats.text:\n 0000 02000018 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name Vec__len2 # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:voidcall:agbcc","sym":"voidcall","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["call","void"],"loc":2,"refSource":"void sink(int);\nvoid voidcall(int x){ sink(x); }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tvoidcall\n\t.type\t voidcall,function\n\t.thumb_func\nvoidcall:\n\tpush\t{lr}\n\tbl\tsink\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t voidcall,.Lfe1-voidcall\n","ctx":"void sink(int); void voidcall(int);","proto":{"sink":{"params":1,"returnsVoid":true},"voidcall":{"returnsVoid":true}},"asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void voidcall(u32 a0) {\n sink(a0);\n return;\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void voidcall(s32 arg0) {\n sink(arg0);\n}\n","score":0,"maxScore":4,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `voidcall` — benchmark function synthetic:voidcall:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tvoidcall\n\t.type\t voidcall,function\n\t.thumb_func\nvoidcall:\n\tpush\t{lr}\n\tbl\tsink\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t voidcall,.Lfe1-voidcall\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid sink(int); void voidcall(int);\nCTX_INPUT\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function voidcall # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `voidcall` — benchmark function synthetic:voidcall:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:voidcall:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tvoidcall\n\t.type\t voidcall,function\n\t.thumb_func\nvoidcall:\n\tpush\t{lr}\n\tbl\tsink\n\tpop\t{r0}\n\tbx\tr0\n.Lfe1:\n\t.size\t voidcall,.Lfe1-voidcall\nASM_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sink\": {\n \"params\": 1,\n \"returnsVoid\": true\n },\n \"voidcall\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name voidcall # the symbol to decompile (multi-function input selects by name)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:voidcall:gcc2.7.2kmc","sym":"voidcall","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["call","void"],"loc":2,"refSource":"void sink(int);\nvoid voidcall(int x){ sink(x); }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tlw\tra,16(sp)\n 14:\tjr\tra\n 18:\taddiu\tsp,sp,24\n 1c:\tnop\n","ctx":"void sink(int); void voidcall(int);","proto":{"sink":{"params":1,"returnsVoid":true},"voidcall":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ca1ff746d8e9195e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c voidcall\n00000000 *UND*\t00000000 sink\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 sink\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a0000000 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","outcome":"declined","source":"/* asmlift could not decompile 'voidcall' — lift: cannot lift 'voidcall': function call 'jal' at 0x8 — MIPS calls not yet modelled */\n/* original assembly: */\n/* target.o: file format elf32-tradbigmips */\n/* Disassembly of section .text: */\n/* 00000000 : */\n/* 0:\taddiu\tsp,sp,-24 */\n/* 4:\tsw\tra,16(sp) */\n/* 8:\tjal\t0 */\n/* c:\tnop */\n/* 10:\tlw\tra,16(sp) */\n/* 14:\tjr\tra */\n/* 18:\taddiu\tsp,sp,24 */\n/* 1c:\tnop */\nvoid voidcall(void) {\n ASMLIFT_ERROR(\"could not decompile (lift): cannot lift 'voidcall': function call 'jal' at 0x8 — MIPS calls not yet modelled\");\n}\n","score":null,"maxScore":null,"compileErrors":null,"quality":{"score":88,"lines":16,"gotos":0,"casts":1,"unkGlue":1,"rawMem":0,"addrDeref":0},"errorMarkers":["lift: cannot lift 'voidcall': function call 'jal' at 0x8 — MIPS calls not yet modelled"]},"m2c":{"decompiler":"m2c","outcome":"match","source":"void voidcall(s32 arg0) {\n sink(arg0);\n}\n","score":0,"maxScore":7,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `voidcall` — benchmark function synthetic:voidcall:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel voidcall\n addiu\t$sp, $sp, -24\n sw\t$ra, 16($sp)\n jal\tsink\n nop\n lw\t$ra, 16($sp)\n jr\t$ra\n addiu\t$sp, $sp, 24\n nop\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid sink(int); void voidcall(int);\nCTX_INPUT\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function voidcall # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `voidcall` — benchmark function synthetic:voidcall:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:voidcall:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\taddiu\tsp,sp,-24\n 4:\tsw\tra,16(sp)\n 8:\tjal\t0 \n c:\tnop\n 10:\tlw\tra,16(sp)\n 14:\tjr\tra\n 18:\taddiu\tsp,sp,24\n 1c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-ca1ff746d8e9195e/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t0000001c voidcall\n00000000 *UND*\t00000000 sink\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n00000008 R_MIPS_26 sink\n\n\nContents of section .text:\n 0000 27bdffe8 afbf0010 0c000000 00000000 '...............\n 0010 8fbf0010 03e00008 27bd0018 00000000 ........'.......\nContents of section .reginfo:\n 0000 a0000000 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sink\": {\n \"params\": 1,\n \"returnsVoid\": true\n },\n \"voidcall\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name voidcall # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:voidcall:mwcc_242_81","sym":"voidcall","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["call","void"],"loc":2,"refSource":"void sink(int);\nvoid voidcall(int x){ sink(x); }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\tsink\n 10:\tlwz r0,20(r1)\n 14:\tmtlr r0\n 18:\taddi r1,r1,16\n 1c:\tblr\n","ctx":"void sink(int); void voidcall(int);","proto":{"sink":{"params":1,"returnsVoid":true},"voidcall":{"returnsVoid":true}},"asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 sink\n00000000 g F .text\t00000020 voidcall\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 sink\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 voidcall\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 7c0803a6 38210010 4e800020 ....|...8!..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000004 00000000 ............ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"void voidcall(u32 a0) {\n sink(a0);\n return;\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":4,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"void voidcall(s32 arg0) {\n sink(arg0);\n}\n","score":0,"maxScore":8,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `voidcall` — benchmark function synthetic:voidcall:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel voidcall\n stwu r1,-16(r1)\n mflr r0\n stw r0,20(r1)\n bl sink\n lwz r0,20(r1)\n mtlr r0\n addi r1,r1,16\n blr\nASM_INPUT\n\n# The exact context header the benchmark passed via --context — prototypes only\n# (no struct/global layouts: the benchmark measures cold recovery).\ncat > ctx.h <<'CTX_INPUT'\nvoid sink(int); void voidcall(int);\nCTX_INPUT\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function voidcall # the symbol to decompile from in.s\n --context ctx.h # the C context header above (typedefs + prototypes)\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `voidcall` — benchmark function synthetic:voidcall:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:voidcall:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tstwu r1,-16(r1)\n 4:\tmflr r0\n 8:\tstw r0,20(r1)\n c:\tbl c \n\t\t\tc: R_PPC_REL24\tsink\n 10:\tlwz r0,20(r1)\n 14:\tmtlr r0\n 18:\taddi r1,r1,16\n 1c:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 *UND*\t00000000 sink\n00000000 g F .text\t00000020 voidcall\n\n\nRELOCATION RECORDS FOR [.text]:\nOFFSET TYPE VALUE\n0000000c R_PPC_REL24 sink\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 voidcall\n\n\nContents of section .text:\n 0000 9421fff0 7c0802a6 90010014 48000001 .!..|.......H...\n 0010 80010014 7c0803a6 38210010 4e800020 ....|...8!..N.. \nContents of section .mwcats.text:\n 0000 02000020 00000000 ... .... \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000000 ................\n 0050 00000000 00000004 00000000 ............\nDUMP_INPUT\n\n# The prototype hints the benchmark fed asmlift (callee arities / void-ness).\ncat > proto.json <<'PROTO_INPUT'\n{\n \"sink\": {\n \"params\": 1,\n \"returnsVoid\": true\n },\n \"voidcall\": {\n \"returnsVoid\": true\n }\n}\nPROTO_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name voidcall # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --proto proto.json # the prototype hints above (callee arities / void-ness)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:zextb:agbcc","sym":"zextb","project":"synthetic","tier":"synthetic","toolchain":"agbcc","isa":"arm","compiler":"agbcc","language":"c","features":["cast","zero-extend"],"loc":1,"refSource":"int zextb(u8 x){ return x; }","targetAsm":"@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tzextb\n\t.type\t zextb,function\n\t.thumb_func\nzextb:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t zextb,.Lfe1-zextb\n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 zextb(u32 a0) {\n return (u8)a0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":1,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"u8 zextb(u8 arg0) {\n return arg0;\n}\n","score":0,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `zextb` — benchmark function synthetic:zextb:agbcc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The exact agbcc `.s` text the benchmark fed m2c, verbatim.\ncat > in.s <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tzextb\n\t.type\t zextb,function\n\t.thumb_func\nzextb:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t zextb,.Lfe1-zextb\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target gba # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function zextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `zextb` — benchmark function synthetic:zextb:agbcc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:zextb:agbcc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact agbcc `.s` text.\ncat > in.asm <<'ASM_INPUT'\n@ Generated by gcc 2.9-arm-000512 for Thumb/elf\n\t.code\t16\n.gcc2_compiled.:\n.text\n\t.align\t2, 0\n\t.globl\tzextb\n\t.type\t zextb,function\n\t.thumb_func\nzextb:\n\tlsl\tr0, r0, #0x18\n\tlsr\tr0, r0, #0x18\n\tbx\tlr\n.Lfe1:\n\t.size\t zextb,.Lfe1-zextb\nASM_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target agbcc # frontend + target description (ISA, calling convention, compiler idioms)\n --name zextb # the symbol to decompile (multi-function input selects by name)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:zextb:gcc2.7.2kmc","sym":"zextb","project":"synthetic","tier":"synthetic","toolchain":"gcc2.7.2kmc","isa":"mips","compiler":"gcc","language":"c","features":["cast","zero-extend"],"loc":1,"refSource":"int zextb(u8 x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-8dba1aa4740ff3ce/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 zextb\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2. \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 zextb(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"match","source":"s32 zextb(s32 arg0) {\n return arg0 & 0xFF;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `zextb` — benchmark function synthetic:zextb:gcc2.7.2kmc.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel zextb\n jr\t$ra\n andi\t$v0, $a0, 0xff\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-gcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function zextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `zextb` — benchmark function synthetic:zextb:gcc2.7.2kmc.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:zextb:gcc2.7.2kmc --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tjr\tra\n 4:\tandi\tv0,a0,0xff\n\t...\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 /host-tmp/asmlift-mgcc-ref-8dba1aa4740ff3ce/ref.c\n00000000 l O .text\t00000000 gcc2_compiled.\n00000000 l d .text\t00000000 .text\n00000000 l d .data\t00000000 .data\n00000000 l d .bss\t00000000 .bss\n00000000 l d .reginfo\t00000000 .reginfo\n00000000 l d .note\t00000000 .note\n00000000 l d .comment\t00000000 .comment\n00000000 g F .text\t00000008 zextb\n\n\nContents of section .text:\n 0000 03e00008 308200ff 00000000 00000000 ....0...........\nContents of section .reginfo:\n 0000 80000014 00000000 00000000 00000000 ................\n 0010 00000000 00000000 ........ \nContents of section .note:\n 0000 00000008 00000000 00000001 30312e30 ............01.0\n 0010 31000000 1... \nContents of section .comment:\n 0000 00474343 3a202847 4e552920 322e372e .GCC: (GNU) 2.7.\n 0010 3200 2.\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target gcc2.7.2kmc # frontend + target description (ISA, calling convention, compiler idioms)\n --name zextb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:zextb:ido7.1","sym":"zextb","project":"synthetic","tier":"synthetic","toolchain":"ido7.1","isa":"mips","compiler":"ido","language":"c","features":["cast","zero-extend"],"loc":1,"refSource":"int zextb(u8 x){ return x; }","targetAsm":"\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tjr\tra\n 8:\tandi\tv0,a0,0xff\n c:\tnop\n","asmDump":"\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c zextb\n\n\nContents of section .text:\n 0000 afa40000 03e00008 308200ff 00000000 ........0.......\nContents of section .options:\n 0000 01200000 00000000 a0000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 64626131 61613437 34306666 ef-8dba1aa4740ff\n 0130 3363652f 7265662e 63007a65 78746200 3ce/ref.c.zextb.\n 0140 7a657874 62000000 00000000 00000001 zextb...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000003 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........ \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"nonmatch","source":"s32 zextb(u32 a0) {\n return a0 & 255;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"s32 zextb(s32 arg0) {\n return arg0 & 0xFF;\n}\n","score":1,"maxScore":3,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":{"decompiler":"asmlift","score":1,"maxScore":3,"ratio":0.3333333333333333,"kinds":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0}},"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `zextb` — benchmark function synthetic:zextb:ido7.1.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel zextb\n sw\t$a0, 0($sp)\n jr\t$ra\n andi\t$v0, $a0, 0xff\n nop\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target mips-ido-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function zextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `zextb` — benchmark function synthetic:zextb:ido7.1.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:zextb:ido7.1 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tsw\ta0,0(sp)\n 4:\tjr\tra\n 8:\tandi\tv0,a0,0xff\n c:\tnop\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-tradbigmips\n\nSYMBOL TABLE:\n00000000 l d .text\t00000010 .text\n00000000 g F .text\t0000000c zextb\n\n\nContents of section .text:\n 0000 afa40000 03e00008 308200ff 00000000 ........0.......\nContents of section .options:\n 0000 01200000 00000000 a0000014 00000000 . ..............\n 0010 00000000 00000000 00000000 00007ff0 ................\n 0020 07100000 00000000 00000000 00000000 ................\n 0030 08100000 00000000 00000000 00000000 ................\nContents of section .reginfo:\n 0000 a0000014 00000000 00000000 00000000 ................\n 0010 00000000 00007ff0 ........ \nContents of section .mdebug:\n 0000 7009070a 00000003 00000004 00000178 p..............x\n 0010 00000005 000002b8 00000001 0000017c ...............|\n 0020 00000004 000001b0 00000000 00000000 ................\n 0030 00000011 000001e0 00000034 00000224 ...........4...$\n 0040 00000008 00000258 00000001 00000260 .......X.......`\n 0050 00000000 00000000 00000001 000002a8 ................\n 0060 02000000 00000000 00000001 00000000 ................\n 0070 00000000 00000000 ffffffff 00000000 ................\n 0080 00000000 00000000 001d001f 00000002 ................\n 0090 00000002 00000000 00000001 00000000 ................\n 00a0 2c200004 0000002e 00000000 1820000f , ........... ..\n 00b0 0000002e 0000000c 20200001 00000001 ........ ......\n 00c0 00000000 20200000 02000000 03000000 .... ..........\n 00d0 04000000 05000000 06000000 07000000 ................\n 00e0 08000000 09000000 20000000 21000000 ........ ...!...\n 00f0 0a000000 0b000000 0b000000 1a000000 ................\n 0100 00000000 00000003 06000000 002f746d ............./tm\n 0110 702f6173 6d6c6966 742d6d69 70732d72 p/asmlift-mips-r\n 0120 65662d38 64626131 61613437 34306666 ef-8dba1aa4740ff\n 0130 3363652f 7265662e 63007a65 78746200 3ce/ref.c.zextb.\n 0140 7a657874 62000000 00000000 00000001 zextb...........\n 0150 00000000 00000034 00000000 00000004 .......4........\n 0160 00000000 00000003 00000000 00000000 ................\n 0170 00000001 00000000 00000011 00000000 ................\n 0180 00000000 01800000 00000000 00000001 ................\n 0190 00000000 00000000 00000000 18200001 ............. ..\n 01a0 00000000 00000000 00000000 00000000 ................\n 01b0 00000000 00000000 7fffffff 00000000 ................\n 01c0 00000000 00000002 ........\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target ido7.1 # frontend + target description (ISA, calling convention, compiler idioms)\n --name zextb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}},{"id":"synthetic:zextb:mwcc_242_81","sym":"zextb","project":"synthetic","tier":"synthetic","toolchain":"mwcc_242_81","isa":"ppc","compiler":"mwcc","language":"c","features":["cast","zero-extend"],"loc":1,"refSource":"int zextb(u8 x){ return x; }","targetAsm":"\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,24\n 4:\tblr\n","asmDump":"\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 zextb\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 zextb\n\n\nContents of section .text:\n 0000 5463063e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 .... \n","asmlift":{"decompiler":"asmlift","candidateLabel":"unsigned","outcome":"match","source":"s32 zextb(u32 a0) {\n return a0 & 255;\n}\n","score":0,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":0,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"m2c":{"decompiler":"m2c","outcome":"nonmatch","source":"u8 zextb(u8 arg0) {\n return arg0;\n}\n","score":1,"maxScore":2,"compileErrors":null,"breakdown":{"insert":0,"delete":1,"replace":0,"opMismatch":0,"argMismatch":0},"quality":{"score":100,"lines":3,"gotos":0,"casts":0,"unkGlue":0,"rawMem":0,"addrDeref":0}},"gapSize":null,"scripts":{"m2c":"#!/usr/bin/env bash\n# Reproduce m2c on `zextb` — benchmark function synthetic:zextb:mwcc_242_81.\nset -euo pipefail\n\n# m2c checkout (https://github.com/matt-kempster/m2c); the benchmark pins commit 94098d4:\n# git clone https://github.com/matt-kempster/m2c && git -C m2c checkout 94098d4de68c2fcc13fb8cf1096a1520eb171abe\nM2C_PATH='/path/to/m2c'\n\n# The benchmark's objdump→GNU-as normalization of this function's disassembly (m2c cannot\n# read raw objdump), including the jump-table/const data sections recovered from the target\n# object — the exact text the benchmark fed m2c.\ncat > in.s <<'ASM_INPUT'\nglabel zextb\n clrlwi r3,r3,24\n blr\nASM_INPUT\n\n# (This function ran with NO context header — the benchmark fed m2c the assembly alone.)\n\nargs=(\n --target ppc-mwcc-c # ISA + compiler dialect (selects m2c's code-shape assumptions)\n --function zextb # the symbol to decompile from in.s\n --no-cache # bypass m2c's on-disk cache — always a fresh run\n)\npython3 \"$M2C_PATH/m2c.py\" \"${args[@]}\" in.s\n","asmlift":"#!/usr/bin/env bash\n# Reproduce asmlift on `zextb` — benchmark function synthetic:zextb:mwcc_242_81.\nset -euo pipefail\n\n# asmlift checkout — run `pnpm install` there once, with this function's toolchain available\n# (`pnpm bench setup` fetches bench-owned toolchains + pinned project checkouts;\n# apps/benchmark/README lists the env-var overrides; .github/workflows/benchmark.yml shows a\n# complete from-scratch setup):\nASMLIFT_PATH='/path/to/asmlift'\n\n# ── Step 1: scoring inputs ───────────────────────────────────────────────────\n# Builds this function's target object (content-cached) and writes a decomp.yaml whose compile\n# command is the benchmark's own toolchain invocation — what --score-against compiles with.\n# (progress goes to stderr so the script's stdout stays purely the decompiled source)\npnpm --dir \"$ASMLIFT_PATH\" bench target synthetic:zextb:mwcc_242_81 --out \"$PWD\" 1>&2\n\n# ── Step 2: the input the benchmark fed asmlift, verbatim ────────────────────\n# The exact `objdump -d --no-show-raw-insn` text.\ncat > in.asm <<'ASM_INPUT'\n\ntarget.o: file format elf32-powerpc\n\n\nDisassembly of section .text:\n\n00000000 :\n 0:\tclrlwi r3,r3,24\n 4:\tblr\nASM_INPUT\n\n# The target object's objdump -s -r -t dump — the data sections (jump tables, anonymous\n# constants) the text-only disassembly lacks; the benchmark recovered them from the object.\ncat > dump.txt <<'DUMP_INPUT'\n\ntarget.o: file format elf32-powerpc\n\nSYMBOL TABLE:\n00000000 l df *ABS*\t00000000 ref.c\n00000000 l d .text\t00000000 .text\n00000000 l d .mwcats.text\t00000000 .mwcats.text\n00000000 g F .text\t00000008 zextb\n\n\nRELOCATION RECORDS FOR [.mwcats.text]:\nOFFSET TYPE VALUE\n00000004 R_PPC_ADDR32 zextb\n\n\nContents of section .text:\n 0000 5463063e 4e800020 Tc.>N.. \nContents of section .mwcats.text:\n 0000 02000008 00000000 ........ \nContents of section .comment:\n 0000 436f6465 57617272 696f720a 02040201 CodeWarrior.....\n 0010 01020016 2c000000 00000000 00000000 ....,...........\n 0020 00000000 00000000 00000000 00000000 ................\n 0030 00000000 00000001 00000000 00000004 ................\n 0040 00000000 00000004 00000000 00000004 ................\n 0050 00000000 ....\nDUMP_INPUT\n\n# ── Step 3: decompile + benchmark-grade scoring ──────────────────────────────\nargs=(\n in.asm # input: the disassembly text above\n --target mwcc_242_81 # frontend + target description (ISA, calling convention, compiler idioms)\n --name zextb # the symbol to decompile (multi-function input selects by name)\n --asm-data dump.txt # the data sections above (jump-table/const recovery)\n --config decomp.yaml # the compile command from step 1\n --score-against target.o # rank candidate variants, objdiff-score each; exit 0 only on byte-exact\n)\n# the checkout's own asmlift bin (pnpm links it; it runs through the repo's pinned tsx)\n\"$ASMLIFT_PATH/node_modules/.bin/asmlift\" \"${args[@]}\"\n"}}]} \ No newline at end of file diff --git a/apps/web/src/pages/playground/cpp-spec.ts b/apps/web/src/pages/playground/cpp-spec.ts index cd6c540d..713953da 100644 --- a/apps/web/src/pages/playground/cpp-spec.ts +++ b/apps/web/src/pages/playground/cpp-spec.ts @@ -153,7 +153,10 @@ export function deriveSpec(name: string, sfn: SFn): CppFnSpec { const maxIdx = new Map([...recv.values()].map((c) => [c, -1])); const visitE = (e: Expr): void => { - if (e.k === 'index' && e.base.k === 'var' && e.idx.k === 'const') { + // `!e.lead?.length` mirrors core's cpp.ts leaf hook: a multidimensional array global's access + // is not a receiver access, and its `[0]` prefix is not a member index. Kept in step with that + // copy — the two predicates must not drift. + if (e.k === 'index' && e.base.k === 'var' && e.idx.k === 'const' && !e.lead?.length) { const cls = recv.get(e.base.name); if (cls !== undefined) { maxIdx.set(cls, Math.max(maxIdx.get(cls) ?? -1, e.idx.value)); diff --git a/apps/web/src/pages/playground/score-wasm.ts b/apps/web/src/pages/playground/score-wasm.ts index 2417db3f..8d71e2a2 100644 --- a/apps/web/src/pages/playground/score-wasm.ts +++ b/apps/web/src/pages/playground/score-wasm.ts @@ -13,7 +13,13 @@ // engine failure throws, and a row that cannot be displayed can never count as matched. import { cBackend } from '@asmlift/core/backend/c'; import { renderDeclarations } from '@asmlift/core/declare'; -import { type DroppedCandidate, type RankedResult, type Scored, enumerateCandidates } from '@asmlift/core/rank'; +import { + type DroppedCandidate, + type RankedResult, + type Scored, + compareScored, + enumerateCandidates, +} from '@asmlift/core/rank'; import type { SymbolMap } from '@asmlift/core/symbols'; import { C_TYPEDEFS, type TargetDescription } from '@asmlift/core/target'; import { assemble, compileToObject } from 'agbcc'; @@ -195,9 +201,11 @@ export async function rankCandidatesInBrowser( // Mirrors core's `rankBy` (which this cannot reuse — the wasm scorer is async): a candidate // that fails to build is DROPPED rather than allowed to sink a sibling that compiles, and each - // drop is RECORDED so a failed spelling is never invisible. Enumeration order breaks a score - // tie, exactly as `rankBy` spells it — the named spelling is enumerated before its - // `/raw-globals` sibling, so equal bytes show the reader the named one. + // drop is RECORDED so a failed spelling is never invisible. + // + // The ORDERING is not re-spelled here, it is IMPORTED — `compareScored` is core's one copy. Two + // drivers over the same enumeration with two hand-written comparators is how the playground and + // the CLI come to disagree about which spelling of the same function is best. const results: (Scored & { order: number })[] = []; const dropped: DroppedCandidate[] = []; let lastErr: unknown = null; @@ -219,6 +227,6 @@ export async function rankCandidatesInBrowser( const why = lastErr instanceof Error ? lastErr.message.split('\n')[0] : String(lastErr ?? 'no candidate produced'); throw new Error(`no scorable candidate for '${name}': ${why}`, { cause: lastErr }); } - results.sort((a, b) => a.score.score - b.score.score || a.order - b.order); + results.sort(compareScored); return { best: results[0], candidates: results.map(({ order: _order, ...c }) => c), dropped }; } diff --git a/packages/cli/package.json b/packages/cli/package.json index c0d58507..deabcb66 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@asmlift/core": "workspace:^", - "@gba-kit/debug-info": "^0.4.0", + "@gba-kit/debug-info": "^0.5.0", "objdiff-wasm": "3.7.3", "yaml": "^2.9.0" }, diff --git a/packages/cli/src/symbols-provider.ts b/packages/cli/src/symbols-provider.ts index bc1cf6f8..894d63e0 100644 --- a/packages/cli/src/symbols-provider.ts +++ b/packages/cli/src/symbols-provider.ts @@ -21,7 +21,8 @@ // its own capability, so `UPGRADE` names the required version in ONE place, as remediation advice // rather than as the test. `assertPointeeFactPresent` and `assertPointeeCapabilityWitnessed` are // the same gate one release later, for the facts an INTERIOR spelling through a pointer global -// needs (what it points at, and which of a layout's members are arrays). +// needs (what it points at, and which of a layout's members are arrays); `assertArrayDimsPresent` +// is the release after that, for an array's RANK. import { addressCastMacrosFrom } from '@asmlift/core/macros'; import type { SymbolInfo, SymbolMap, SymbolStructField } from '@asmlift/core/symbols'; import { readFileSync } from 'node:fs'; @@ -48,6 +49,10 @@ type DwarfShape = elemSize: number | null; elemSigned: boolean | null; length: number | null; + /** the per-dimension extents (the RANK). OPTIONAL at this boundary only because the type + * must also describe a package that predates the fact; its runtime AVAILABILITY is + * asserted separately (assertArrayDimsPresent). */ + dims?: (number | null)[] | null; volatile?: boolean; const?: boolean; } @@ -86,7 +91,7 @@ interface DwarfMember { * declares; emitting one produces non-compiling output, so they never win the canonical pick. */ export const PLACEHOLDER = /^(?:sub_|_)[0-9A-Fa-f]{6,8}$/; -const UPGRADE = 'upgrade @gba-kit/debug-info to >= 0.4.0 (or drop tools.asmlift.elf to run without a map)'; +const UPGRADE = 'upgrade @gba-kit/debug-info to >= 0.5.0 (or drop tools.asmlift.elf to run without a map)'; /** The cv-qualifier facts, probed on the first shaped variable. A 0.3-era package returns the * same object KINDS from `variableShape` but never sets `volatile`/`const`, so a @@ -116,6 +121,25 @@ function assertMemberFactsPresent(m: object, elfPath: string): void { } } +/** The same probe for the ARRAY arm's RANK. A package that reports only the flattened element + * count leaves core reading every array as rank 1, so `gBgTilemapBufs[i]` gets emitted for a + * `u16[4][0x400]`. Against the project's own header that is usually a type error — but where the + * row address flows into an integer context it is only a warning, and then the emitted C + * addresses a DIFFERENT object than the asm did. That is the plausible-but-wrong class, so the + * fact is required rather than defaulted. Key presence, not value: `dims` is legitimately null + * for an array whose DWARF carries no subranges, and an unreleased build reports the fact while + * still carrying its previous version number. Witnessed on the first array shape — any array + * exercises it, and an ELF with none can spell no array access to get wrong. */ +export function assertArrayDimsPresent(sh: DwarfShape, elfPath: string): void { + if (sh.kind === 'array' && !('dims' in sh)) { + throw new Error( + `cannot build a symbol map from ${elfPath}: the installed @gba-kit/debug-info reports no ` + + `array rank (an array variableShape() result has no 'dims' key), so a multidimensional ` + + `global would be indexed with one subscript — ${UPGRADE}`, + ); + } +} + /** The same probe for the POINTER arm's pointee — but this fact cannot be witnessed on every * variable, so the witness is tracked across the whole load and settled by * {@link assertPointeeCapabilityWitnessed}. A pointer shape carries `pointee` whatever it points @@ -239,6 +263,7 @@ export async function loadSymbolMap(elfPath: string): Promise { const sh = shapeOf(s.name); if (sh) { assertShapeFactsPresent(sh, elfPath); + assertArrayDimsPresent(sh, elfPath); assertPointeeFactPresent(sh, elfPath); if (sh.kind === 'pointer') { pointeeWitnessed = true; // the probe above ran and passed on a real pointer shape @@ -263,6 +288,12 @@ export async function loadSymbolMap(elfPath: string): Promise { if (sh.elemSize !== null && sh.length !== null) { info.size = sh.elemSize * sh.length; } + // The RANK. `length` above is the PRODUCT of the dimensions, so it cannot say how many + // subscripts reach an element — see SymbolInfo.dims. Absent when the DWARF gave the + // array no subranges; core then attempts no bare-name spelling for it. + if (sh.dims !== null && sh.dims !== undefined) { + info.dims = sh.dims; + } } else if (sh.kind === 'struct') { info.shape = 'struct'; if (sh.size !== null) { diff --git a/packages/cli/test/matching/m2.test.ts b/packages/cli/test/matching/m2.test.ts index 98aaf7ce..5a0ee374 100644 --- a/packages/cli/test/matching/m2.test.ts +++ b/packages/cli/test/matching/m2.test.ts @@ -1,11 +1,16 @@ -// M2 — a SERIALIZABLE idiom pattern that MOVES A REAL objdiff score on a function -// the naive lift gets wrong. +// M2 — a SERIALIZABLE idiom pattern that folds a real idiom to the source spelling. // -// `half` = agbcc's signed x/2, lowered (no hw-divide) to `lsr #31; add; asr #1`. Without -// the pattern, asmlift emits the raw shifts — which agbcc recompiles with an `asr` where -// the target has `lsr` (the sign-bit shift), so it does NOT match. With the pattern (a -// pure data object) the idiom folds to `x / 2` and recompiles byte-exact. The score -// delta is measured by real objdiff, not asserted. +// `half` = agbcc's signed x/2, lowered (no hw-divide) to `lsr #31; add; asr #1`. With the +// pattern (a pure data object) the idiom folds to `x / 2` and recompiles byte-exact. +// +// HISTORICAL NOTE — this test used to assert the pattern MOVED the score, because the raw +// lowering did not match: asmlift spelled the sign-bit shift as a bare `x >> 31`, C's ARITHMETIC +// shift, where the target has `lsr`. That was the shift-direction miscompile, not a fact about +// the pattern, and it is fixed at the rendering layer — the raw lowering now spells +// `(s32)(a0 + ((u32)a0 >> 31)) >> 1` and matches on its own. So the pattern's payoff is +// READABILITY, and the claim under test is that folding it stays byte-exact rather than that it +// rescues a broken lift. The signedness lever is still pinned on a shape no spelling can hide +// (m3.test.ts, division). import { SDIV_POW2_2 } from '@asmlift/core/pattern/engine'; import { decompile } from '@asmlift/core/pipeline'; import { ARMV4T_AGBCC } from '@asmlift/core/target'; @@ -29,10 +34,11 @@ test('M2: the sdiv-pow2 pattern moves the objdiff score to 0', () => { console.log('without pattern:', without.source.trim(), '→ score', sWithout.score); console.log('with pattern: ', withPat.source.trim(), '→ score', sWith.score); - // the pattern fired, folded the idiom, and moved the score strictly toward 0 + // the pattern fired, folded the idiom, and the folded spelling is byte-exact expect(withPat.patternHits).toBe(1); expect(without.patternHits).toBe(0); - expect(sWith.score).toBeLessThan(sWithout.score); // the score MOVED - expect(sWith.match).toBe(true); // …all the way to byte-exact + expect(sWith.score).toBeLessThanOrEqual(sWithout.score); // folding never COSTS bytes + expect(sWith.match).toBe(true); // …and lands byte-exact expect(withPat.source).toContain('/ 2'); + expect(without.source).not.toContain('/ 2'); // the baseline really is the unfolded shift tree }); diff --git a/packages/cli/test/matching/m3.test.ts b/packages/cli/test/matching/m3.test.ts index 2a911dc0..6fe819a2 100644 --- a/packages/cli/test/matching/m3.test.ts +++ b/packages/cli/test/matching/m3.test.ts @@ -1,22 +1,33 @@ -// M3 — type recovery as RANKED CANDIDATES re-ranked by the differ. -// `x >> 1` compiles to `lsr` if x is unsigned but `asr` if signed — the asm alone can't -// say which. asmlift emits both candidates; the objdiff score, not a guess, picks the -// one that matches. This is "types are differ-ranked levers", demonstrated end-to-end. +// M3 — type recovery as RANKED CANDIDATES re-ranked by the differ: "types are differ-ranked +// levers", demonstrated end-to-end. The asm alone cannot say whether a value is signed; asmlift +// emits both candidates and the objdiff score, not a guess, picks the one that matches. +// +// The discriminating shape is DIVISION. `x / 3` calls `__udivsi3` when x is unsigned and +// `__divsi3` when it is signed — a different relocation, so no spelling of the body can hide the +// choice and the type is the only channel that carries it. +// +// `x >> 1` used to be that shape too, and is kept below as a control on what changed: since the +// shift-direction fix, the emitted C states `shr_u` explicitly (`(u32)a0 >> 1`) instead of leaving +// it to the parameter's declared type, so BOTH candidates now recompile byte-exact. The lever is +// intact — that spelling simply stopped depending on it. import { ARMV4T_AGBCC } from '@asmlift/core/target'; import { assembleTarget, compileTargetAsm } from '@asmlift/toolchains'; import { expect, test } from 'vitest'; import { decompileRanked } from '../../src/rank'; -test('M3: the differ picks the correct signedness candidate', () => { - // target built from the UNSIGNED shift → `lsr r0, r0, #1` - const targetAsm = compileTargetAsm('unsigned ushr(unsigned x){ return x >> 1; }'); - const targetObj = assembleTarget(targetAsm); - - const ranked = decompileRanked('ushr', targetAsm, ARMV4T_AGBCC, targetObj); - for (const c of ranked.candidates) { - console.log(` ${c.label}: score ${c.score.score} ${c.source.trim()}`); +const rank = (sym: string, c: string) => { + const targetAsm = compileTargetAsm(c); + const ranked = decompileRanked(sym, targetAsm, ARMV4T_AGBCC, assembleTarget(targetAsm)); + for (const cand of ranked.candidates) { + console.log(` ${sym} ${cand.label}: score ${cand.score.score} ${cand.source.trim()}`); } + return ranked; +}; + +test('M3: the differ picks the correct signedness candidate', () => { + // target built from the UNSIGNED division → a `__udivsi3` call + const ranked = rank('udiv', 'unsigned udiv(unsigned x){ return x / 3; }'); // the winner is the unsigned candidate, and it matches byte-exact expect(ranked.best.label).toBe('unsigned'); @@ -25,3 +36,13 @@ test('M3: the differ picks the correct signedness candidate', () => { const signed = ranked.candidates.find((c) => c.label === 'signed')!; expect(signed.score.score).toBeGreaterThan(ranked.best.score.score); }); + +test('M3 control: `x >> 1` no longer needs the lever — the spelling carries the shift direction', () => { + const ranked = rank('ushr', 'unsigned ushr(unsigned x){ return x >> 1; }'); + expect(ranked.best.label).toBe('unsigned'); // the simpler spelling still wins the tie + expect(ranked.best.score.match).toBe(true); + // Both match: the signed candidate spells `(u32)a0 >> 1`, which is the same bytes. Before the + // shift-direction fix it spelled a bare `a0 >> 1` — C's ARITHMETIC shift, `asr` where the + // target has `lsr` — and lost. Byte-equality here is the fix working, not the lever failing. + expect(ranked.candidates.every((c) => c.score.match)).toBe(true); +}); diff --git a/packages/cli/test/matching/m5.test.ts b/packages/cli/test/matching/m5.test.ts index 30791771..4fb68cc5 100644 --- a/packages/cli/test/matching/m5.test.ts +++ b/packages/cli/test/matching/m5.test.ts @@ -27,13 +27,17 @@ test('M5: report captures stages, a scored pattern event, candidates, and the sc expect(ids).toEqual(['stage:lift', 'stage:idiom', 'stage:recover', 'stage:structure', 'stage:emit']); expect(report.trace.every((t) => t.verified)).toBe(true); - // the idiom pattern fired and its objdiff score delta is recorded (moved toward match) + // the idiom pattern fired and its objdiff score delta is RECORDED — what this pins is that the + // report carries a real, measured before/after, not that this particular fold improves it. The + // sdiv-pow2 baseline used to score 1 because the raw lowering spelled the sign-bit shift as C's + // arithmetic `>>`; since the shift-direction fix it matches unfolded, so the delta is 0 and the + // fold's payoff is readability (see m2.test.ts). expect(report.patternEvents).toHaveLength(1); const ev = report.patternEvents[0]; expect(ev.hits).toBe(1); - expect(ev.scoreBefore).toBe(1); expect(ev.scoreAfter).toBe(0); - expect(ev.scoreDelta).toBe(-1); + expect(ev.scoreDelta).toBe(ev.scoreAfter! - ev.scoreBefore!); + expect(ev.scoreDelta).toBeLessThanOrEqual(0); // a fold must never cost bytes // ranked candidates + a byte-exact final score expect(report.candidates?.length).toBe(2); diff --git a/packages/cli/test/matching/mips-controlflow.test.ts b/packages/cli/test/matching/mips-controlflow.test.ts index 4795e976..e889582a 100644 --- a/packages/cli/test/matching/mips-controlflow.test.ts +++ b/packages/cli/test/matching/mips-controlflow.test.ts @@ -111,7 +111,11 @@ describe('MIPS (IDO) ranked candidates — scoring dispatches to the right compi const ranked = decompileRanked('ushr', asm, MIPS_IDO, obj); expect(ranked.best.label).toBe('unsigned'); // srl ⇒ unsigned wins; agbcc-scoring couldn't tell expect(ranked.best.score.match).toBe(true); // byte-exact via the IDO scorer, not agbcc - const signed = ranked.candidates.find((c) => c.label === 'signed')!; - expect(signed.score.score).toBeGreaterThan(0); // the wrong candidate is genuinely worse + // What this pins is the DISPATCH: an agbcc-scored MIPS candidate would be compiled by the + // wrong compiler and could not score 0 at all. It no longer pins signedness discrimination — + // since the shift-direction fix the signed candidate spells `(u32)a0 >> 1`, the same bytes. + // The signedness lever itself is pinned on a shape that cannot be spelled away (m3.test.ts, + // division: `__udivsi3` vs `__divsi3` is a different relocation). + expect(ranked.candidates.every((c) => c.score.match)).toBe(true); }); }); diff --git a/packages/cli/test/matching/ppc-mwcc.test.ts b/packages/cli/test/matching/ppc-mwcc.test.ts index 64f3e18a..63f25ef3 100644 --- a/packages/cli/test/matching/ppc-mwcc.test.ts +++ b/packages/cli/test/matching/ppc-mwcc.test.ts @@ -213,12 +213,16 @@ const WIDEN_CASES: { sym: string; c: string; proto?: Prototypes; expect: string { sym: 'extract', c: 'int extract(int x){ return (x >> 5) & 0xff; }', - expect: 's32 extract(s32 a0) {\n return a0 >> 5 & 255;\n}\n', + // the rotate makes rlwinm's shift LOGICAL (the lift records `shr_u`), so the operand is + // spelled unsigned — a bare `>>` over the `s32`-declared a0 is C's arithmetic shift + expect: 's32 extract(s32 a0) {\n return (u32)a0 >> 5 & 255;\n}\n', }, { sym: 'shr_and', c: 'unsigned shr_and(unsigned x){ return (x >> 8) & 0xf; }', - expect: 's32 shr_and(s32 a0) {\n return a0 >> 8 & 15;\n}\n', + // source shifts an `unsigned`; the old spelling was the arithmetic shift and matched only + // because `& 15` masks the difference away + expect: 's32 shr_and(s32 a0) {\n return (u32)a0 >> 8 & 15;\n}\n', }, ]; diff --git a/packages/cli/test/offline/symbols-provider.test.ts b/packages/cli/test/offline/symbols-provider.test.ts index 00be5c58..87591f98 100644 --- a/packages/cli/test/offline/symbols-provider.test.ts +++ b/packages/cli/test/offline/symbols-provider.test.ts @@ -12,7 +12,13 @@ import type { SymbolInfo } from '@asmlift/core/symbols'; import { describe, expect, test } from 'vitest'; -import { PLACEHOLDER, assertPointeeCapabilityWitnessed, canonicalOrder, layoutOf } from '../../src/symbols-provider'; +import { + PLACEHOLDER, + assertArrayDimsPresent, + assertPointeeCapabilityWitnessed, + canonicalOrder, + layoutOf, +} from '../../src/symbols-provider'; const sym = (name: string, declared?: true): SymbolInfo => ({ name, @@ -147,3 +153,27 @@ describe('PLACEHOLDER — the rename-leftover shape', () => { } }); }); + +describe('assertArrayDimsPresent — the array-RANK capability gate', () => { + const arr = (extra: object) => + ({ kind: 'array', elemSize: 2, elemSigned: false, length: 4096, volatile: false, const: false, ...extra }) as never; + + test('an array shape carrying `dims` passes — including the legitimately null value', () => { + expect(() => assertArrayDimsPresent(arr({ dims: [4, 1024] }), '/tmp/x.elf')).not.toThrow(); + expect(() => assertArrayDimsPresent(arr({ dims: null }), '/tmp/x.elf')).not.toThrow(); + }); + + test('REFUSES an array shape with no `dims` KEY at all', () => { + // the silent failure this stops: without rank, `u16 g[4][0x400]` is indexed `g[i]`, which is + // a ROW — a type error against the project's header, or, where the row address reaches an + // integer context, a warning and a different address than the asm computed. Probed by key + // presence because `null` is a real answer and a version string is not a capability witness. + expect(() => assertArrayDimsPresent(arr({}), '/tmp/x.elf')).toThrow(/array rank/); + }); + + test('is inert on every non-array shape — they have no rank to lose', () => { + expect(() => + assertArrayDimsPresent({ kind: 'scalar', size: 4, signed: true, volatile: false, const: false }, '/tmp/x.elf'), + ).not.toThrow(); + }); +}); diff --git a/packages/core/src/backend/cfamily.ts b/packages/core/src/backend/cfamily.ts index c4553fac..634c70b4 100644 --- a/packages/core/src/backend/cfamily.ts +++ b/packages/core/src/backend/cfamily.ts @@ -9,6 +9,78 @@ import { IrType, T, scalarTypeForAccess, typeToString } from '../ir/types'; import { BinOp, Expr, SFn, Stmt, dotBase } from '../l3/ast'; import { type VarTypes, declaredTypes, derefStrideOk, exprCType } from '../l3/typing'; +/** + * The C SIGNEDNESS a rendered integer expression actually has — `true`/`false`, or `undefined` + * when it is not determinable here. The deliberate complement to l3/typing's `exprCType`, which is + * pointer-ness-accurate and reports every integer as `s32` by contract; this models the two C + * rules that contract omits, integer PROMOTION and the usual arithmetic CONVERSIONS. + * + * It lives HERE, in the C-family backend, because it is a model of C's own rules with no meaning + * for another language — the same reason the cast it feeds is synthesized here rather than in the + * tower. `exprCType` stays in l3/ because Pascal consults it too. + * + * It exists for one question, and the question is byte-load-bearing: C spells both `>>>` and `>>` + * as `>>` and chooses between them from the left operand's type. A logical shift rendered over a + * signed expression recompiles to `asr` where the target has `lsr`, and evaluates to a different + * value. The C-family backend casts the operand whenever this returns anything but the signedness + * the operator needs, so `undefined` is the safe answer in every case the model does not cover — a + * redundant cast is codegen-identical, a missing one is a miscompile. + * + * Anything narrower than 32 bits promotes to `int` and is therefore SIGNED, whatever it was + * declared. Pointers, calls and markers are `undefined`. + */ +function renderedIntSignedness(e: Expr, varType: VarTypes): boolean | undefined { + const rec = (x: Expr): boolean | undefined => renderedIntSignedness(x, varType); + // an lvalue-ish leaf: its C type is a declaration / an explicit cast / a carried access width + const promoted = (t: IrType | undefined): boolean | undefined => + t?.kind !== 'int' ? undefined : t.width < 32 ? true : t.width === 32 ? t.signed : undefined; + switch (e.k) { + case 'var': + case 'cast': + case 'index': + case 'field': + return promoted(exprCType(e, varType)); + // A decimal literal is `int` when it fits in one; C89 gives a larger one an unsigned type, + // which is not the same operand — so it is left undetermined rather than assumed. INT_MIN is + // in that larger class despite fitting: the backend prints it as `-2147483648`, which C lexes + // as unary minus applied to `2147483648` — a constant too big for `int`, hence unsigned long. + case 'const': + return e.value > -2147483648 && e.value <= 2147483647 ? true : undefined; + // `-x` / `~x` carry the PROMOTED type of the operand; `!x` is `int`. + case 'un': + return e.op === '!' ? true : rec(e.e); + case 'bin': { + // Shifts take the type of the LEFT operand alone — the right is promoted independently. + if (e.op === '<<' || e.op === '>>' || e.op === '>>>') { + return rec(e.l); + } + // Comparisons and the logical connectives yield `int`. + if (['<', '<=', '>', '>=', '==', '!=', '&&', '||'].includes(e.op)) { + return true; + } + // Usual arithmetic conversions over the remaining binary operators: at equal rank, unsigned + // wins. Either side unknown leaves the result unknown — EXCEPT when the known side is + // unsigned, which already decides it. + // + // That exception is the one place this returns a DEFINITE answer from an unknown operand, + // and it is sound only because every integer here is rank `int`: at UNEQUAL rank C converts + // to the wider type first, so `unsigned int & long long` is SIGNED. Core has no 64-bit + // integer type at all (the decomp typedef vocabulary stops at 32 — see contracts.ts + // SCALAR_WIDTHS), so the unequal-rank case cannot arise. Adding one would invalidate this. + const l = rec(e.l); + const r = rec(e.r); + if (l === false || r === false) { + return false; + } + return l === true && r === true ? true : undefined; + } + case 'call': + case 'marker': + case 'addr': + return undefined; + } +} + // C operator precedence (lower binds tighter). Used to emit MINIMAL parentheses. Shared: C++ has // the same precedence for these operators. const PREC: Record = { @@ -19,6 +91,7 @@ const PREC: Record = { '-': 4, '<<': 5, '>>': 5, + '>>>': 5, // spells as C's `>>` (see printExpr's shift rule) — same precedence '<': 6, '<=': 6, '>': 6, @@ -103,6 +176,28 @@ function printExpr(e: Expr, parentPrec: number, vt: VarTypes, leaf?: LeafHook): derefStrideOk(exprCType(ix.base, vt), ix.width) ? ix.base : { k: 'cast', to: T.ptr(scalarTypeForAccess(ix.width, ix.signed)), e: ix.base }; + // C-FAMILY SHIFT LEGALIZATION, the same discipline one operator over. The tower keeps the two + // right shifts apart (`>>>` logical, `>>` arithmetic); C spells BOTH `>>` and picks between them + // from the LEFT OPERAND'S TYPE. So the operand must be made to carry the choice, or an `shr_u` + // recompiles to `asr` where the target has `lsr` AND evaluates differently — + // `*(u8 *)&g << 30 >> 30` promotes to `int`, so a 2-bit field holding 2 comes out -1. + // + // (engine.ts's zext fold covers the same hazard for widths C can NAME, by folding the whole + // shift pair to a cast op. Every other extract width — every bitfield read — lands here.) + // + // The cast is added unless the operand PROVABLY renders with the signedness the op needs: + // renderedIntSignedness answers `undefined` wherever its model does not reach, and a redundant + // cast is codegen-identical while a missing one is a miscompile. An existing 32-bit integer cast + // is REPLACED rather than wrapped — `(u32)(s32)&g` and `(u32)&g` are the same bytes, and the + // arithmetic rules upstream do emit that inner cast (intifyAddr). + const shiftOperand = (e0: Extract): Expr => { + const wantSigned = e0.op === '>>'; + if (renderedIntSignedness(e0.l, vt) === wantSigned) { + return e0.l; + } + const inner = e0.l.k === 'cast' && e0.l.to.kind === 'int' && e0.l.to.width === 32 ? e0.l.e : e0.l; + return { k: 'cast', to: T.int(32, wantSigned), e: inner }; + }; switch (e.k) { case 'var': return e.name; @@ -123,6 +218,21 @@ function printExpr(e: Expr, parentPrec: number, vt: VarTypes, leaf?: LeafHook): // binds tighter than any prefix operator, so a cast/unary/deref base is printed at prec 1 // and parenthesizes itself: `((u8 *)p)[1]`). The postfix form needs no outer parentheses. const base = legalized(e); + // Leading constant subscripts (a multidimensional array global's bare spelling) keep the + // postfix form whatever `idx` is: `g[0][0]` is the element, `*g[0]` would be its ROW. + // + // `lead` implies the base already strides the access width — its only producer registers a + // matching element type for the global (structure.ts bareArrayLead + noteGlobal). Nothing + // else enforced that, and the failure would be quiet-ish: legalization would wrap the base, + // spelling `((u16 *)g)[0][i]`, which subscripts a `u16` twice. Check it rather than assume. + if (e.lead && e.lead.length > 0) { + if (base !== e.base) { + throw new Error( + `c backend: a multidimensional array access needs a base that strides ${e.width} bytes as spelled`, + ); + } + return `${rec(base, 1)}${e.lead.map((l) => `[${l}]`).join('')}[${rec(e.idx, 99)}]`; + } if (e.idx.k === 'const' && e.idx.value === 0) { const s = `*${rec(base, 2)}`; return parentPrec < 2 ? `(${s})` : s; @@ -141,6 +251,13 @@ function printExpr(e: Expr, parentPrec: number, vt: VarTypes, leaf?: LeafHook): // first (the C++ member-access rewrite). const ix = dotBase(e); if (ix) { + // This path spells the index node from parts, so a `lead` would be DROPPED — an element + // access silently becoming a row's. Unreachable today (arrayAccess's lead branch requires + // `fieldOff === undefined`, which is exclusive with the dot form), but this is a + // text-returning path with no other guard, so it refuses rather than assumes. + if (ix.lead && ix.lead.length > 0) { + throw new Error(`c backend: a multidimensional array element has no struct-field spelling yet`); + } const hooked = leaf?.(ix, rec); const baseTxt = hooked ?? `${rec(ix.base, 1)}[${rec(ix.idx, 99)}]`; return `${baseTxt}.${e.name}`; @@ -173,7 +290,9 @@ function printExpr(e: Expr, parentPrec: number, vt: VarTypes, leaf?: LeafHook): } case 'bin': { const p = PREC[e.op]; - const s = `${rec(e.l, p)} ${e.op} ${rec(e.r, p - 1)}`; + // Both right shifts spell C's `>>`; `shiftOperand` supplies the operand cast that says which. + const shift = e.op === '>>' || e.op === '>>>'; + const s = `${rec(shift ? shiftOperand(e) : e.l, p)} ${shift ? '>>' : e.op} ${rec(e.r, p - 1)}`; return p > parentPrec ? `(${s})` : s; } } diff --git a/packages/core/src/backend/cpp.ts b/packages/core/src/backend/cpp.ts index d1777fa0..eedde994 100644 --- a/packages/core/src/backend/cpp.ts +++ b/packages/core/src/backend/cpp.ts @@ -90,7 +90,9 @@ export function cppBackend(spec: CppFnSpec): LanguageBackend { // class pointer, and print an unscaled `this[2]` that C++ strides by sizeof(class). // Correct bytes over idiomatic spelling, never the reverse. const leaf: LeafHook = (e: Expr) => { - if (e.k === 'index' && e.base.k === 'var' && e.idx.k === 'const') { + // `lead` (a multidimensional array global) is not a receiver access and must not be + // rewritten to one — the hook returns text, so a dropped subscript would be silent. + if (e.k === 'index' && e.base.k === 'var' && e.idx.k === 'const' && !e.lead?.length) { const r = recv.get(e.base.name); if (r) { if (e.width === 4) { diff --git a/packages/core/src/backend/pascal.ts b/packages/core/src/backend/pascal.ts index f6f35828..331c8e07 100644 --- a/packages/core/src/backend/pascal.ts +++ b/packages/core/src/backend/pascal.ts @@ -35,6 +35,10 @@ const BIT_FN: Partial> = { '|': 'bitor', '^': 'bitxor', '<<': 'lshift', + // `rshift` over this backend's signed `Integer` reproduces IDO's `sra` — verified byte-exact + // against upas (pascal-ido.test.ts `asr2`). `>>>`, the LOGICAL shift, has no verified spelling + // here and is therefore absent: it reaches the loud decline below rather than borrowing this + // one, which would emit an arithmetic shift where the machine did a logical one. '>>': 'rshift', }; @@ -83,6 +87,13 @@ function makePrinter(vt: VarTypes) { // any plausible `^Integer`-shaped callee agrees with the machine width; a sub-word access // through an unknowable base would DISCARD the node's width (upas checks types, not // machine widths), so it declines like a definite mismatch. + // Leading constant subscripts (a multidimensional array global) have no IDO Pascal + // spelling yet, and dropping them would read a ROW's address as an element — decline + // LOUD, like the address-of case above. Unreachable today (the symbol map is agbcc-only), + // but silence here would be the wrong kind of unreachable. + if (e.lead && e.lead.length > 0) { + throw new Error(`pascal backend: a multidimensional array access has no IDO Pascal spelling yet`); + } const bt = exprCType(e.base, vt); if ((bt !== undefined && !derefStrideOk(bt, e.width)) || (bt === undefined && e.width !== 4)) { throw new Error( diff --git a/packages/core/src/contracts.ts b/packages/core/src/contracts.ts index 461bfb1c..77e2a3f0 100644 --- a/packages/core/src/contracts.ts +++ b/packages/core/src/contracts.ts @@ -5,7 +5,7 @@ // wrong C. import type { Fn, Value } from './ir/core'; import { type IrType, typeToString } from './ir/types'; -import type { Expr, SFn, Stmt } from './l3/ast'; +import type { BinOp, Expr, SFn, Stmt } from './l3/ast'; import { exprChildren, fieldSpellsDot, stmtChildren, stmtExprs } from './l3/ast'; import { declaredTypes, exprCType } from './l3/typing'; @@ -72,7 +72,7 @@ export function assertDerefsTyped(sfn: SFn): void { const ctype = (e: Expr): IrType | undefined => exprCType(e, vt); const bad: string[] = []; // Ops C rejects outright on a pointer operand (the additive ops and &&/|| are legal C). - const NO_PTR_OPS = new Set(['&', '|', '^', '<<', '>>', '*', '/', '%']); + const NO_PTR_OPS = new Set(['&', '|', '^', '<<', '>>', '>>>', '*', '/', '%']); // The comparison operators — where a bare `&SYM` operand is SIGN-ambiguous, not ill-formed. const CMP_OPS = new Set(['<', '<=', '>', '>=', '==', '!=']); // 1/2/4 only: the decomp typedef vocabulary (C_TYPEDEFS) has no 64-bit scalar, so a width-8 diff --git a/packages/core/src/declare.ts b/packages/core/src/declare.ts index 1c6ee082..7127995a 100644 --- a/packages/core/src/declare.ts +++ b/packages/core/src/declare.ts @@ -37,6 +37,7 @@ import { ENUM_IS_SIGNED, type SymbolInfo, type SymbolStructField, + arrayInnerExtents, declaredFields, pointeeFields, symbolFieldType, @@ -139,7 +140,14 @@ export function renderDeclarations(refs: SymbolRef[]): string { // A non-1/2/4 element width is never bare-indexed by core (only &gSym cast forms), so // an unsized u8[] decl is codegen-identical for every spelling core emits. const elem = info.elemSize !== undefined ? intType(info.elemSize, info.elemSigned ?? false) : null; - lines.push(`extern ${quals(info)}${elem ?? 'u8'} ${name}[];`); + // The RANK must be reproduced, or the declaration disagrees with the access core spells: + // a `gSym[0][i]` needs a 2-D declaration to be an element rather than a type error. The + // OUTERMOST extent is always left unsized — it is the one C lets a declaration omit, and + // omitting it keeps this decl compatible with the project's real one whatever its size + // (the same reason the rank-1 form has always been `[]`). Inner extents are load-bearing: + // they are what scales each leading subscript, so they are spelled exactly. + const rank = (arrayInnerExtents(info) ?? []).map((d) => `[${d}]`).join(''); + lines.push(`extern ${quals(info)}${elem ?? 'u8'} ${name}[]${rank};`); break; } case 'struct': { diff --git a/packages/core/src/l3/ast.ts b/packages/core/src/l3/ast.ts index 1ff3afa0..f8a93393 100644 --- a/packages/core/src/l3/ast.ts +++ b/packages/core/src/l3/ast.ts @@ -38,7 +38,13 @@ export type Expr = // Variable-index `a[i]` is recovered at the IR level (`aload`/`astore` carry elemSize; // raise/arrays.ts) but still LOWERS to this one C-shaped `index` node, so it stays C-only // (a Pascal array-access spelling is future work). Treat `index` with idx ≠ 0 as C-shaped. - | { k: 'index'; base: Expr; idx: Expr; width: number; signed: boolean } + // `lead` prefixes CONSTANT subscripts before `idx` — `g[0][i]` rather than `g[i]`. It exists for + // exactly one inhabitant: the bare-name spelling of a MULTIDIMENSIONAL array global, where one + // subscript reaches a row and the element needs the leading dimensions pinned first. The node + // still denotes ONE `width`-byte element, so its type, its legalization and its stride contract + // are unchanged — this is a spelling of the same address, not a new kind of access. Absent for + // every rank-1 access, which is why it is optional rather than an empty array. + | { k: 'index'; base: Expr; idx: Expr; width: number; signed: boolean; lead?: number[] } // A named struct-field access `base->name` (raise/structs.ts recovered `base` as a struct // pointer, so the byte offset resolves to a named field instead of a scaled array index). // Unlike `index`, this carries the field NAME (which encodes the byte offset, `field_`), @@ -53,8 +59,45 @@ export type Expr = // default) never produces this node; it keeps the `"?"` sentinel → ContractError behavior. | { k: 'marker'; reason: string; args: Expr[] }; +// `>>` is the ARITHMETIC right shift and `>>>` the LOGICAL one. C spells both `>>` and picks from +// the left operand's type, so the C backend synthesizes the cast that pins the choice — exactly as +// it already synthesizes scalar deref casts from an `index` node's width. A backend with no +// spelling for one of them (IDO Pascal) declines LOUDLY on the operation itself, rather than on +// whatever artifact another language's spelling happened to leave in the tree. +// +// WHY THIS ONE SPLIT AND NOT THE OTHERS. "The machine distinguishes them" is NOT the rule — the +// machine distinguishes `divu`/`div` and `sltu`/`slt` too, and ARITH_TO_BIN deliberately collapses +// `udiv`→`/`, `umod`→`%`, `icmp_u*`→`<` etc., noting that "unsignedness is in the operand types". +// Taking the machine as the rule would license four more splits with no inhabitant, which is what +// "earn the level" forbids. The rule is the repo's own: the shift split because a real, +// byte-load-bearing divergence HAD inhabitants (~20 rows, 5 projects, 4 compilers) and no other +// channel could carry it — the operand type could not, since a promoted narrow value is signed +// whatever it was loaded as. +// +// The collapsed operators lean on exactly that channel, so they carry the same latent hazard: +// `*(u16 *)p / 3` renders as a signed division of a promoted `int` where the asm did `divu`. It is +// tolerated because no row has produced such a divergence. When one does, the fix is this same +// split — not a per-site patch. export type BinOp = - '+' | '-' | '*' | '/' | '%' | '<' | '<=' | '>' | '>=' | '==' | '!=' | '&' | '|' | '^' | '<<' | '>>' | '&&' | '||'; + | '+' + | '-' + | '*' + | '/' + | '%' + | '<' + | '<=' + | '>' + | '>=' + | '==' + | '!=' + | '&' + | '|' + | '^' + | '<<' + | '>>' + | '>>>' + | '&&' + | '||'; export type Stmt = | { k: 'assign'; name: string; value: Expr } @@ -189,7 +232,18 @@ export function exprEquals(a: Expr, b: Expr): boolean { } case 'index': { const bb = b as typeof a; - return a.width === bb.width && a.signed === bb.signed && exprEquals(a.base, bb.base) && exprEquals(a.idx, bb.idx); + // `lead` is part of the ADDRESS (`g[0][i]` and `g[1][i]` are different elements), so it + // must be compared — an omission here would let CSE/dedup collapse two distinct accesses. + const lead = a.lead ?? []; + const bLead = bb.lead ?? []; + return ( + a.width === bb.width && + a.signed === bb.signed && + lead.length === bLead.length && + lead.every((v, i) => v === bLead[i]) && + exprEquals(a.base, bb.base) && + exprEquals(a.idx, bb.idx) + ); } case 'field': { const bb = b as typeof a; diff --git a/packages/core/src/l3/reindex.ts b/packages/core/src/l3/reindex.ts index e7c1e9e9..75ea50f3 100644 --- a/packages/core/src/l3/reindex.ts +++ b/packages/core/src/l3/reindex.ts @@ -163,10 +163,17 @@ function reindexExpr(e: Expr, walk: WalkLoop, iv: string): Expr | null { if (mentionsVar(e.idx, walk.p)) { return null; // a p-dependent element offset — beyond the v1 shape } + if (e.lead && e.lead.length > 0) { + return null; // leading subscripts (a multidim array global) — the rebuild below would drop + // them, turning an element access into a row's. Decline rather than reindex. + } const idx: Expr = e.idx.k === 'const' && e.idx.value === 0 ? { k: 'var', name: iv } : { k: 'bin', op: '+', l: { k: 'var', name: iv }, r: e.idx }; + // NOTE: this rebuilds the node from parts, so any field not named here is DROPPED. `lead` is + // declined above (the deref side); it cannot arrive on the base side either, since `walk.base` + // is a local pointer and structuring only ever puts `lead` on an array GLOBAL's own name. return { k: 'index', base: { k: 'var', name: walk.base }, idx, width: e.width, signed: e.signed }; } let failed = false; diff --git a/packages/core/src/raise/recover.ts b/packages/core/src/raise/recover.ts index 3612d4c3..dcd1dcd6 100644 --- a/packages/core/src/raise/recover.ts +++ b/packages/core/src/raise/recover.ts @@ -40,8 +40,11 @@ export function recoverTypes(fn: Fn): void { op.operands.forEach((o) => setInt(o, false)); op.results.forEach((r) => setInt(r, false)); } - // A rotate is a bitwise permutation: its value operand and result are unsigned (the C - // idiom's `>>` must be the LOGICAL shift or the spelling stops round-tripping). The + // A rotate is a bitwise permutation, so its value operand and result are unsigned. This is + // now a TYPE fact only: the C idiom's logical shift is stated on the node (structure.ts + // spells the idiom with `>>>`, and the C backend supplies whatever cast that needs), so the + // spelling no longer depends on this seeding to round-trip. Kept because it is true, and + // because it keeps the rotated value from rendering as a signed operand elsewhere. The // rotate AMOUNT (operand 1, register form) keeps its own signedness. if (op.opcode === 'rotr' || op.opcode === 'rotl') { setInt(op.operands[0], false); diff --git a/packages/core/src/rank.ts b/packages/core/src/rank.ts index 8b217dfe..6f2232a0 100644 --- a/packages/core/src/rank.ts +++ b/packages/core/src/rank.ts @@ -123,6 +123,17 @@ export interface EnumerateOptions { export interface Candidate { label: string; source: string; + /** Which PREFERENCE GROUP this spelling belongs to — the symbol-variant index (0 = the map's own + * named spellings, 1 = their `/raw-globals` siblings). Enumeration emits the groups in + * preference order, and a lower group WINS a score tie: when both compile to the same bytes the + * reader should get `gCounter.field`, not a byte offset off a hoisted `(u8 *)` base. + * + * Carried structurally rather than left to enumeration order because the readability tie-break + * (compareScored) must compare only spellings that are genuinely alternatives of the same + * thing. Ranking a named spelling against a raw-address one on cast count is not a readability + * comparison at all — the raw form's `(u8 *)` base is not counted, so it would win by + * construction, trading named struct fields for anonymous byte offsets. */ + group: number; /** the map-derived VALUE references this candidate's tree contains — what the scoring * layer's declaration synthesis renders. DERIVED, never carried: computed once from the * exact tree this candidate's source was emitted from, at the moment the candidate is @@ -211,7 +222,7 @@ export function enumerateCandidates( { suffix: '/raw-globals', symbols: undefined }, ] : [{ suffix: '' }]; - for (const sv of symbolVariants) { + for (const [svIndex, sv] of symbolVariants.entries()) { const svOpts = sv.symbols ? baseOpts : { ...baseOpts, symbols: undefined }; for (const cand of SIGN_CANDS) { const fn = frontend.lift(name, asm, target, prototypes, opts.asmData, sv.symbols); @@ -298,6 +309,7 @@ export function enumerateCandidates( out.push({ label: `${cand.label}${s.suffix}${sp.suffix}${sv.suffix}`, source, + group: svIndex, ...(sp.symbolRefs ? { symbolRefs: sp.symbolRefs } : {}), }); } @@ -332,15 +344,59 @@ export function rankBy( if (results.length === 0) { throw new Error(`no scorable candidate for '${symbol}': ${firstLine(lastScoreErr)}`, { cause: lastScoreErr }); } - // Score first; ENUMERATION ORDER breaks a tie. That order is meaningful, not incidental: - // enumerateCandidates emits the symbol-map spellings before their `/raw-globals` siblings, so - // when both compile to the same bytes the named one wins and the reader gets `gCounter` rather - // than a bare address. Spelled as an explicit comparator because relying on Array#sort's - // stability would make the preference an accident of two unrelated decisions. - results.sort((a, b) => a.score.score - b.score.score || a.order - b.order); + results.sort(compareScored); return { best: results[0], candidates: results.map(({ order: _order, ...c }) => c), dropped }; } +/** THE candidate ordering — score, then preference group, then readability, then enumeration + * order. Exported because there are TWO drivers over the same enumeration (this module's sync + * `rankBy` for the Node/objdiff scorer, and the webapp's async await-loop for the wasm one), and + * a per-driver copy would let the same input produce two different winners. + * + * SCORE dominates absolutely: the differ is the fitness function, and a tie means the axis that + * separates these two spellings did not change the bytes — so everything below only chooses what + * the READER sees, and can never cost a match. + * + * GROUP next: a named symbol-map spelling beats its `/raw-globals` sibling at equal bytes. + * + * CAST COUNT next, and only WITHIN a group. A wrong signedness pin is what manufactures casts — + * the C backend has to cast a shift operand back to the signedness the machine op needs, so + * pinning `u32` on a genuinely-signed parameter buys `s32 f(u32 a0) { return (s32)a0 >> a1; }` + * for the same bytes as `s32 f(s32 a0) { return a0 >> a1; }`. Before the backend synthesized that + * cast the wrong pin simply lost on score; now it ties, and enumeration order alone would + * silently install the noisier spelling. + * + * ENUMERATION ORDER last, which makes this a strict total order (indices are unique) and the + * result deterministic. Spelled explicitly rather than leaning on Array#sort's stability, which + * would make each preference an accident of two unrelated decisions. */ +export function compareScored( + a: Candidate & { score: S; order: number }, + b: Candidate & { score: S; order: number }, +): number { + return ( + a.score.score - b.score.score || a.group - b.group || castCount(a.source) - castCount(b.source) || a.order - b.order + ); +} + +/** Scalar casts in a candidate's rendered source — the readability tie-break above. + * + * A TEXT count over the emitted string, matching how the benchmark's own readability metric + * measures the same thing (apps/benchmark/src/eval/quality.ts) — the two must agree about what + * "cast noise" means, or ranking optimizes for something the report then scores differently. + * + * It counts the decomp typedef vocabulary only, so a pointer or struct cast is not read as noise + * — those are structural spellings a candidate does not choose. And it carries `quality.ts`'s + * ADDRESS-CAST exemption: `(u32)&gSym` / `(s32)&gSym` is the CORRECT source spelling of integer + * arithmetic on a link-time address, which decomp projects write themselves. Counting it would + * penalize precisely the named spelling this ranking is supposed to prefer. + * + * Deterministic, and total on any string. */ +function castCount(source: string): number { + const all = source.match(/\((?:u|s)(?:8|16|32)\)/g)?.length ?? 0; + const addr = source.match(/\((?:u|s)32\)\s*&/g)?.length ?? 0; + return all - addr; +} + /** First line of whatever the scorer threw — the compiler's own diagnostic, not a stack. */ function firstLine(e: unknown): string { return e instanceof Error ? e.message.split('\n')[0] : String(e ?? 'no candidate produced'); diff --git a/packages/core/src/structure/structure.ts b/packages/core/src/structure/structure.ts index c0f14803..cf054599 100644 --- a/packages/core/src/structure/structure.ts +++ b/packages/core/src/structure/structure.ts @@ -46,6 +46,7 @@ import { type DeclaredField, type SymbolInfo, type SymbolStructField, + arrayInnerExtents, declaredFields, isArrayField, pointeeFields, @@ -108,6 +109,32 @@ function globalOf(e: Expr, width: number): { name: string; idx: Expr } | null { return null; } +// THE one gate on the BARE-NAME array-global spelling (`gSym[i]` rather than `((T *)&gSym)[i]`), +// shared by the constant-offset and variable-index access paths so the two cannot disagree. +// Returns the `index` node's `lead` fragment when the bare form is spellable, or null to fall +// through to the always-valid `&gSym` cast form. +// +// Two facts are required, not one. The element WIDTH must match, as it always has. And the RANK +// must be SPELLABLE, because one subscript reaches an element only on a rank-1 array: on `u16 +// g[4][0x400]`, `g[i]` is a ROW. Against the project's own header that is usually a type error, +// but where the row address flows into an integer context it is merely a warning and the emitted C +// then addresses a different object than the asm did — silently. +// +// A rank > 1 pins the leading dimensions at 0 and puts the whole flat element index in the last +// subscript (`g[0][i]`) — the same address arithmetic, and the idiom decomp sources themselves use +// when the split is not observable in the asm either (`gBgTilemapBufs[0][…]` in kleod, +// `gNatureStatTable[nature][…]` in pokeemerald). A rank the map states but cannot spell (an unknown +// inner extent) gets no bare form at all; `((T *)&gSym)[i]` is byte-identical and valid under ANY +// declaration, which is why it is the safe fallback. See symbols.ts arrayInnerExtents for why an +// ABSENT rank is read as 1 rather than as unknown. +function bareArrayLead(si: SymbolInfo, width: number): { lead?: number[] } | null { + if (si.shape !== 'array' || si.elemSize !== width) { + return null; + } + const inner = arrayInnerExtents(si); + return inner === null ? null : inner.length === 0 ? {} : { lead: new Array(inner.length).fill(0) }; +} + // A BYTE residual read as an ELEMENT index of `elemSize`-wide elements, or null when it is not one // — the residual then addresses mid-element and no whole-element spelling can express it, so the // caller falls through to the honest cast forms. THE one copy of the rule, indexing the @@ -402,9 +429,10 @@ function memAccess( // dogfood proved agbcc needs for ROM tables — with the element type registered in the env // so the stride check passes and no cast is added. Element-width match only. const siArr = sym?.info(g.name); - if (siArr?.shape === 'array' && siArr.elemSize === width) { - sym!.noteGlobal(g.name, T.ptr(T.int(width * 8, siArr.elemSigned ?? false))); - return { k: 'index', base: { k: 'var', name: g.name }, idx, width, signed }; + const lead = siArr === undefined ? null : bareArrayLead(siArr, width); + if (lead !== null) { + sym!.noteGlobal(g.name, T.ptr(T.int(width * 8, siArr!.elemSigned ?? false))); + return { k: 'index', base: { k: 'var', name: g.name }, idx, width, signed, ...lead }; } return { k: 'index', base: { k: 'addr', name: g.name }, idx, width, signed }; } @@ -447,9 +475,10 @@ function arrayAccess( if (baseExpr.k === 'addr' && fieldOff === undefined) { // ARRAY-declared global (symbol map): the bare-name spelling, same rule as memAccess. const si = sym?.info(baseExpr.name); - if (si?.shape === 'array' && si.elemSize === elemSize) { - sym!.noteGlobal(baseExpr.name, T.ptr(T.int(elemSize * 8, si.elemSigned ?? false))); - return { k: 'index', base: { k: 'var', name: baseExpr.name }, idx: idxExpr, width: elemSize, signed }; + const lead = si === undefined ? null : bareArrayLead(si, elemSize); + if (lead !== null) { + sym!.noteGlobal(baseExpr.name, T.ptr(T.int(elemSize * 8, si!.elemSigned ?? false))); + return { k: 'index', base: { k: 'var', name: baseExpr.name }, idx: idxExpr, width: elemSize, signed, ...lead }; } return { k: 'index', base: baseExpr, idx: idxExpr, width: elemSize, signed }; } @@ -520,7 +549,7 @@ const ARITH_TO_BIN: Record = { and: '&', xor: '^', shl: '<<', - shr_u: '>>', + shr_u: '>>>', // the LOGICAL right shift; the C backend spells it `>>` over an unsigned operand shr_s: '>>', logic_and: '&&', logic_or: '||', // short-circuit connectives (raise/shortcircuit.ts) @@ -1231,6 +1260,9 @@ export function structure(fn: Fn, opts: StructureOptions = {}): SFn { l = isPtrGlobal(l) ? intifyPtrGlobal(l) : l; r = isPtrGlobal(r) ? intifyPtrGlobal(r) : r; } + // (The two right shifts stay DISTINCT ops here — `>>>` logical, `>>` arithmetic. Which token + // a language spells each with, and what cast pins the choice, is a BACKEND decision; see + // l3/ast.ts BinOp and backend/cfamily.ts's shift rule.) // SCOPE: this and intifyAddr cover the ARITHMETIC escapes. A pointer global under a // COMPARISON (`gPtr < K` — C compares unsigned whatever the asm's icmp_s* said) is the same // class as intifyAddrCmp's `addr` rule and is deliberately left alone here: it is valid C @@ -1242,8 +1274,9 @@ export function structure(fn: Fn, opts: StructureOptions = {}): SFn { // The C rotate idiom — `x >> n | x << (32 - n)` (mirrored for rotl). Byte-exact round-trip // on agbcc (thumb ror) and mwcc (rotlw/rotlwi), verified against both toolchains before the // ops landed. `x` and `n` render twice — both pure by construction (SSA values; the rotate's - // operands are register reads), and recovery seeds the rotated value unsigned so `>>` - // spells the logical shift the idiom requires. + // operands are register reads). The right half is the LOGICAL shift `>>>` — the idiom is + // wrong with an arithmetic one — stated on the node rather than left to the rotated value's + // recovered unsignedness, which is a property of recovery rather than of the idiom. // // (The PPC mirror fold — `rotl(x, 32 - m)` ⇒ rotr(x, m) — lives in the PATTERN layer, // engine.ts ROTL_MIRROR: it is a compiler-spelling idiom, mwcc-gated there, not a @@ -1260,7 +1293,7 @@ export function structure(fn: Fn, opts: StructureOptions = {}): SFn { n.k === 'const' ? { k: 'const', value: 32 - n.value } : { k: 'bin', op: '-', l: { k: 'const', value: 32 }, r: n }; - const [near, far] = dir === 'rotr' ? (['>>', '<<'] as const) : (['<<', '>>'] as const); + const [near, far] = dir === 'rotr' ? (['>>>', '<<'] as const) : (['<<', '>>>'] as const); return { k: 'bin', op: '|', diff --git a/packages/core/src/symbols.ts b/packages/core/src/symbols.ts index c33f4bed..0a468854 100644 --- a/packages/core/src/symbols.ts +++ b/packages/core/src/symbols.ts @@ -118,6 +118,15 @@ export interface SymbolInfo { elemSize?: number; /** element signedness for `shape:'array'` (default unsigned) — types the env entry */ elemSigned?: boolean; + /** ARRAY RANK for `shape:'array'` — the per-dimension extents, outermost first (`u16 + * g[4][0x400]` → `[4, 1024]`), `null` for an unbounded one. It is NOT `size`/`elemSize` + * restated: those size the object, this says how many subscripts reach an ELEMENT. `gSym[i]` + * on a rank-2 array is a ROW — against the project's own header that is a type error, or, + * where the row address flows into an integer context, silently the wrong address. So the + * bare spelling needs the leading subscripts (`gSym[0][i]`), and its ABSENCE is what forbids + * the bare spelling from being attempted at all (see the provider's dims capability gate: + * a package that cannot report rank must not be read as "rank 1"). */ + dims?: (number | null)[]; /** the real struct tag for `shape:'struct'` — names the synthesized struct declaration * (absent ⇒ synthesis mints a placeholder tag; the tag is codegen-arbitrary) */ structName?: string; @@ -145,6 +154,33 @@ export interface SymbolInfo { macroBody?: string; } +/** THE one reading of {@link SymbolInfo.dims} for spelling C, shared by the access side + * (structure.ts's bare-name gate) and the declaration side (declare.ts) so the two cannot + * disagree about an array's shape. + * + * Returns the INNER extents — every dimension but the outermost. The outermost is excluded + * because C lets a declaration omit it, and the inner ones are exactly what scales a leading + * subscript. `[]` is the rank-1 answer: one subscript, `extern T gSym[];`, the spelling this has + * always had. + * + * An ABSENT `dims` also reads as rank 1, because that is what the author of such a map said: the + * ELF provider's capability gate refuses a @gba-kit/debug-info that cannot report rank, so + * absence here can only come from a hand-written map whose `shape:'array'` states a plain array. + * Absence never means "the package could not say" — that case fails loudly at load. + * + * Null means NO consistent pair is available (a stated rank with an unknown inner extent, which + * neither a declaration nor a subscript can spell). Both sides honour it the same way: the access + * falls back to `((T *)&gSym)[i]`, the declaration to the flat `extern T gSym[];` — valid + * together under whatever the project's own header says. */ +export function arrayInnerExtents(info: SymbolInfo): number[] | null { + const dims = info.shape === 'array' ? info.dims : undefined; + if (dims === undefined || dims.length <= 1) { + return []; + } + const inner = dims.slice(1); + return inner.every((d) => typeof d === 'number' && d > 0) ? (inner as number[]) : null; +} + /** address → symbols at that address; `[0]` is the provider's canonical pick. */ export type SymbolMap = Map; diff --git a/packages/core/test/array-rank-guards.test.ts b/packages/core/test/array-rank-guards.test.ts new file mode 100644 index 00000000..7bd5ef34 --- /dev/null +++ b/packages/core/test/array-rank-guards.test.ts @@ -0,0 +1,183 @@ +// The `index.lead` safety perimeter (the multidimensional array-global spelling). +// +// `lead` is an OPTIONAL field on an existing node, which is only safe because every generic +// rewrite preserves it (`mapExprChildren` spreads) and every site that REBUILDS an `index` from +// parts either carries it or refuses. Those refusals are the entire argument, so they are pinned +// here: each one is a place where dropping `lead` would turn an ELEMENT access into a ROW's — +// a wrong address, silently. +import { describe, expect, test } from 'vitest'; + +import { cBackend } from '../src/backend/c'; +import { pascalBackend } from '../src/backend/pascal'; +import { T } from '../src/ir/types'; +import type { Expr, SFn } from '../src/l3/ast'; +import { exprEquals } from '../src/l3/ast'; +import { decompile } from '../src/pipeline'; +import { compareScored } from '../src/rank'; +import type { SymbolMap } from '../src/symbols'; +import { ARMV4T_AGBCC } from '../src/target'; + +const ixLead = (lead?: number[]): Expr => ({ + k: 'index', + base: { k: 'var', name: 'g' }, + idx: { k: 'var', name: 'i' }, + width: 2, + signed: false, + ...(lead ? { lead } : {}), +}); + +const fnOf = (value: Expr): SFn => ({ + name: 'f', + params: [], + locals: [{ name: 'i', type: T.u(32) }], + globals: [{ name: 'g', type: T.ptr(T.u(16)) }], + retType: T.u(16), + body: [{ k: 'return', value }], +}); + +describe('exprEquals treats `lead` as part of the address', () => { + test('different leading subscripts are DIFFERENT expressions', () => { + // `g[0][i]` and `g[1][i]` are 2048 bytes apart; collapsing them in any dedup/CSE path + // would silently reuse one element's value for the other's. + expect(exprEquals(ixLead([0]), ixLead([1]))).toBe(false); + expect(exprEquals(ixLead([0]), ixLead())).toBe(false); // `g[0][i]` is not `g[i]` + expect(exprEquals(ixLead([0, 0]), ixLead([0]))).toBe(false); // rank is part of it too + }); + + test('identical leading subscripts still compare equal', () => { + expect(exprEquals(ixLead([0, 0]), ixLead([0, 0]))).toBe(true); + expect(exprEquals(ixLead(), ixLead())).toBe(true); + }); +}); + +describe('backends either spell `lead` or refuse it', () => { + test('the C backend spells every leading subscript', () => { + expect(cBackend.emit(fnOf(ixLead([0, 0])))).toContain('g[0][0][i]'); + }); + + test('the C backend REFUSES a lead whose base does not stride the access width', () => { + // `lead` implies the base is already a matching element pointer. If it were not, the + // deref legalization would wrap it and spell `((u16 *)g)[0][i]` — a double subscript of a + // scalar. The invariant is checked rather than assumed. + const fn = fnOf(ixLead([0])); + fn.globals = [{ name: 'g', type: T.ptr(T.u(8)) }]; // stride 1 vs the node's width 2 + expect(() => cBackend.emit(fn)).toThrow(/multidimensional array access needs a base that strides/); + }); + + test('the C backend REFUSES a lead under the dot form rather than dropping it', () => { + // `arr[i].field` spells its base index node from parts, so a `lead` there would vanish. + // Unreachable today (the lead branch requires `fieldOff === undefined`), but this is a + // text-returning path and silence would spell a ROW's address. + const fn = fnOf({ k: 'field', base: ixLead([0]), name: 'field_0' }); + expect(() => cBackend.emit(fn)).toThrow(/no struct-field spelling/); + }); + + test('the Pascal backend DECLINES rather than dropping the subscripts', () => { + // IDO Pascal has no spelling for this yet; emitting `g[i]` would read a row's address. + expect(() => pascalBackend.emit(fnOf(ixLead([0])))).toThrow(/multidimensional/); + }); +}); + +describe('shift signedness is judged in the environment that PRINTS the code', () => { + test("an array global's ELEMENT signedness reaches the shift rule", () => { + // The map says the elements are u32; the asm shifts one arithmetically (`asr`). The operand + // must be cast back to signed, or C spells the LOGICAL shift over the u32 element and the + // value differs for a negative element. + // + // This is why the rule lives in the backend: the structurer's variable environment holds + // params and locals only, so it types `gTable[i]` from the access width alone and would + // answer "signed" for every word load whatever the map said. The backend judges against + // `declaredTypes(sfn)`, which includes the shaped globals. + const asm = + 'f:\n\tldr\tr1, .L1\n\tlsls\tr0, r0, #0x2\n\tadds\tr0, r1, r0\n\tldr\tr0, [r0]\n' + + '\tasrs\tr0, r0, #0x4\n\tbx\tlr\n.L1:\n\t.word\t0x08057B4C\n'; + const map: SymbolMap = new Map([ + [ + 0x08057b4c, + [ + { + name: 'gTable', + kind: 'data' as const, + shape: 'array' as const, + elemSize: 4, + elemSigned: false, + dims: [64], + }, + ], + ], + ]); + expect(decompile('f', asm, ARMV4T_AGBCC, { symbols: map }).source).toContain('(s32)gTable[a0] >> 4'); + }); +}); + +describe('the candidate ordering (rank.ts compareScored)', () => { + // Score dominates absolutely; everything below only chooses what the READER sees. The pieces + // under it exist because the C backend's shift cast made a WRONG signedness pin byte-equal to + // the right one — before that, the wrong pin simply lost on score. + const cand = (label: string, group: number, source: string, score: number, order: number) => ({ + label, + group, + source, + score: { score }, + order, + }); + + test('score wins over everything', () => { + const worse = cand('a', 0, 'x;', 1, 0); + const better = cand('b', 1, '(u32)(s32)(u8)x;', 0, 9); + expect([worse, better].sort(compareScored)[0].label).toBe('b'); + }); + + test('a named symbol-map spelling beats its /raw-globals sibling at equal bytes', () => { + // …even though the raw one looks cheaper by cast count: its `(u8 *)` base is a POINTER cast, + // which is not counted, so ranking these two on casts would trade named struct fields for + // anonymous byte offsets. The group comparison is what stops that. + const named = cand('signed', 0, 'a0 = (s32)(gSys.idx << 24) >> 24;', 20, 0); + const raw = cand('signed/raw-globals', 1, 'p0 = (u8 *)&gSys; a0 = p0[1] << 24 >> 24;', 20, 1); + expect([raw, named].sort(compareScored)[0].label).toBe('signed'); + }); + + test('WITHIN a group, fewer casts wins over enumeration order', () => { + // the wrong signedness pin is what manufactures the cast, and it is enumerated FIRST + const noisy = cand('unsigned', 0, 'return (s32)a0 >> a1;', 0, 0); + const clean = cand('signed', 0, 'return a0 >> a1;', 0, 1); + expect([noisy, clean].sort(compareScored)[0].label).toBe('signed'); + }); + + test('an ADDRESS cast is not counted — it is the correct source spelling, not noise', () => { + // `(u32)&gSym` is what decomp projects write for integer arithmetic on a link-time address; + // counting it would penalize the named spelling this ordering exists to prefer. Same + // exemption the benchmark's readability metric applies (apps/benchmark/src/eval/quality.ts). + // The address-cast candidate is enumerated FIRST, so it only loses if its `(u32)&` is + // counted as noise. It must not be. + const addr = cand('named', 0, 'return (u32)&gSym + 4;', 0, 0); + const bare = cand('raw', 0, 'return 50336308 + 4;', 0, 1); + expect([bare, addr].sort(compareScored)[0].label).toBe('named'); + // …while a genuine value cast in the same position DOES lose. + const noisy = cand('noisy', 0, 'return (u32)v0 + 4;', 0, 0); + expect([bare, noisy].sort(compareScored)[0].label).toBe('raw'); + }); + + test('equal on every key falls back to enumeration order — a strict total order', () => { + const a = cand('a', 0, 'x;', 0, 0); + const b = cand('b', 0, 'x;', 0, 1); + expect([b, a].sort(compareScored).map((c) => c.label)).toEqual(['a', 'b']); + }); +}); + +describe('the LOGICAL right shift has no IDO Pascal spelling — it declines, never borrows `rshift`', () => { + // `rshift` over this backend's signed `Integer` reproduces IDO's `sra` (pinned byte-exact + // against upas by pascal-ido.test.ts `asr2`). Mapping `>>>` onto it too would emit an + // ARITHMETIC shift where the machine did a logical one — silently wrong, in the backend whose + // whole discipline is to decline what it cannot spell faithfully. + const shiftFn = (op: '>>' | '>>>'): SFn => + fnOf({ k: 'bin', op, l: { k: 'var', name: 'i' }, r: { k: 'const', value: 1 } }); + + test('the ARITHMETIC shift still spells rshift', () => { + expect(pascalBackend.emit(shiftFn('>>'))).toContain('rshift(i, 1)'); + }); + + test('the LOGICAL shift declines LOUDLY, naming the operator', () => { + expect(() => pascalBackend.emit(shiftFn('>>>'))).toThrow(/operator '>>>' has no faithful IDO Pascal spelling/); + }); +}); diff --git a/packages/core/test/declare.test.ts b/packages/core/test/declare.test.ts index a4162695..4169016f 100644 --- a/packages/core/test/declare.test.ts +++ b/packages/core/test/declare.test.ts @@ -59,6 +59,34 @@ test('a volatile scalar (MMIO) keeps volatile; a const array keeps const + eleme ).toBe('extern const s16 gTable[];\n'); }); +test('a MULTIDIMENSIONAL array declares its inner extents — the rank core spells against', () => { + // core emits `gBgTilemapBufs[0][i]` for a rank-2 array; a flat `u16 g[]` decl would make that a + // type error, and the inner extent is what scales the leading subscript. The OUTERMOST is left + // unsized for the same reason the rank-1 form always has been: C lets a declaration omit it, so + // this stays compatible with the project's real declaration whatever its size. + expect( + renderDeclarations([ + ref('gBgTilemapBufs', { kind: 'data', shape: 'array', elemSize: 2, elemSigned: false, dims: [4, 1024] }), + ]), + ).toBe('extern u16 gBgTilemapBufs[][1024];\n'); + expect( + renderDeclarations([ + ref('gGrid', { kind: 'data', shape: 'array', elemSize: 1, elemSigned: false, dims: [2, 3, 4] }), + ]), + ).toBe('extern u8 gGrid[][3][4];\n'); +}); + +test('an UNSPELLABLE rank falls back to the flat decl — matching the cast form core then emits', () => { + // `dims: [2, null]` — neither `g[i]` nor `g[0][i]` is spellable, so core uses `((u16 *)&g)[i]` + // and the declaration must be the one that form compiles against. The pair is decided in ONE + // place (symbols.ts arrayInnerExtents) so the two sides cannot drift. + expect( + renderDeclarations([ + ref('gRagged', { kind: 'data', shape: 'array', elemSize: 2, elemSigned: false, dims: [2, null] }), + ]), + ).toBe('extern u16 gRagged[];\n'); +}); + test('a value-referenced code symbol gets a void prototype', () => { expect(renderDeclarations([ref('DoThing', { kind: 'code' })])).toBe('void DoThing(void);\n'); }); diff --git a/packages/core/test/ppc-frontend.test.ts b/packages/core/test/ppc-frontend.test.ts index 14de70e2..4ef29202 100644 --- a/packages/core/test/ppc-frontend.test.ts +++ b/packages/core/test/ppc-frontend.test.ts @@ -117,10 +117,12 @@ describe('PPC-WIDEN frontend (calls, frame transparency, rlwinm extract, CTR loo expect(src).not.toContain('func'); }); - // rlwinm right-shift extract `(x>>n)&m` (ME=31) — modelled as shift + mask. + // rlwinm right-shift extract `(x>>n)&m` (ME=31) — modelled as shift + mask. The rotate makes + // the shift LOGICAL, which is what the lift records (`shr_u`); over the `s32`-declared `a0` a + // bare `>>` would be C's arithmetic one, so the operand is spelled unsigned. test('rlwinm right-shift extract decodes to a shift + mask', () => { expect(dis('ext', '0:\trlwinm r3,r3,27,24,31\n4:\tblr\n')).toBe( - 's32 ext(s32 a0) {\n return a0 >> 5 & 255;\n}\n', + 's32 ext(s32 a0) {\n return (u32)a0 >> 5 & 255;\n}\n', ); }); diff --git a/packages/core/test/structure-guard.test.ts b/packages/core/test/structure-guard.test.ts index 4d0b4017..947daf63 100644 --- a/packages/core/test/structure-guard.test.ts +++ b/packages/core/test/structure-guard.test.ts @@ -207,8 +207,11 @@ test('P2 recovers a merged-return loop with an in-body early `return` (return-tr expect(src).toContain('if (v1 > 31) {'); // the bound exit becomes an in-body early return expect(src).toContain('return v1;'); // both exits return (the else-arm value merge) expect(src).not.toContain('break;'); // it is a RETURN trampoline, not a break - // update lands before the bound test: shift then increment, then the conditional return - expect(src).toContain('v0 = v0 >> 1;'); + // update lands before the bound test: shift then increment, then the conditional return. + // The `(u32)` is load-bearing, not decoration: the op is `shr_u` and `v0` is declared `s32`, so + // the bare `v0 >> 1` is C's ARITHMETIC shift — `asr` where the asm had `lsr`, and a different + // value for a negative `v0`. + expect(src).toContain('v0 = (u32)v0 >> 1;'); expect(src).toContain('v1 = (u8)(v1 + 1);'); }); diff --git a/packages/core/test/symbols.test.ts b/packages/core/test/symbols.test.ts index 9e841e5f..65ef95fe 100644 --- a/packages/core/test/symbols.test.ts +++ b/packages/core/test/symbols.test.ts @@ -31,6 +31,10 @@ const mapOf = (entries: [number, Parameters[1]][]): Symbol // ldr rN, =0x03001234; load/store through it — the numeric-pool shape the promotion targets const LOADW = '\tldr\tr0, .L1\n\tldr\tr0, [r0]\n\tbx\tlr\n.L1:\n\t.word\t0x03001234\n'; +// a u16 table indexed by a0*2: ldr r1,=tbl; lsls r0,#1; adds r0,r1,r0; ldrh r0,[r0] +const ARRAY_U16_BODY = + '\tldr\tr1, .L1\n\tlsls\tr0, r0, #0x1\n\tadds\tr0, r1, r0\n\tldrh\tr0, [r0]\n\tbx\tlr\n.L1:\n\t.word\t0x08057B4C\n'; + describe('inertness (the optionality contract)', () => { test('no map ⇒ byte-identical raw-literal output', () => { const base = run('f', LOADW); @@ -127,10 +131,55 @@ describe('declaration shapes (P2)', () => { expect(src).toContain('gState'); // still named (interior/index spelling), just not a field }); + // ── ARRAY RANK ──────────────────────────────────────────────────────────────────────────── + // `dims` is the rank the flat element count multiplies away. One subscript reaches an element + // only on a rank-1 array; on `u16 g[4][0x400]`, `g[i]` is a ROW, so an element access has to + // pin the leading dimensions. Skipping that is not merely unreadable — against the project's + // own header it is a type error, or, where the row address flows into an integer context, a + // warning and a silently different address. + test('a MULTIDIMENSIONAL array global pins the leading dimensions — gSym[0][i]', () => { + // exactly kleod's `extern u16 gBgTilemapBufs[4][0x400]` shape + const map = mapOf([ + [ + 0x03000900, + { name: 'gBgTilemapBufs', kind: 'data', shape: 'array', elemSize: 2, elemSigned: false, dims: [4, 1024] }, + ], + ]); + const src = run('f', ARRAY_U16_BODY.replace('0x08057B4C', '0x03000900'), map); + expect(src).toContain('gBgTilemapBufs[0]['); + expect(src).not.toMatch(/gBgTilemapBufs\[[^0]/); // never the one-subscript row access + expect(src).not.toContain('&gBgTilemapBufs'); // still the bare form, not the cast fallback + }); + + test('a rank-3 array global pins BOTH leading dimensions', () => { + const map = mapOf([ + [0x08057b4c, { name: 'gGrid', kind: 'data', shape: 'array', elemSize: 2, elemSigned: false, dims: [6, 9, 3] }], + ]); + expect(run('f', ARRAY_U16_BODY, map)).toContain('gGrid[0][0]['); + }); + + test('a rank-1 `dims` is the same bare spelling as no dims at all', () => { + const map = mapOf([ + [0x08057b4c, { name: 'gTbl', kind: 'data', shape: 'array', elemSize: 2, elemSigned: false, dims: [64] }], + ]); + const src = run('f', ARRAY_U16_BODY, map); + expect(src).toContain('gTbl['); + expect(src).not.toContain('gTbl[0]['); // rank 1 takes exactly one subscript + }); + + test('a stated rank with an UNKNOWN inner extent declines the bare form, never guesses rank 1', () => { + // `dims: [2, null]` cannot be spelled as either `g[i]` or `g[0][i]`: the fallback cast form is + // the only reading that is byte-identical under whatever the header actually declares. + const map = mapOf([ + [0x08057b4c, { name: 'gRagged', kind: 'data', shape: 'array', elemSize: 2, elemSigned: false, dims: [2, null] }], + ]); + const src = run('f', ARRAY_U16_BODY, map); + expect(src).toContain('&gRagged'); // the honest cast form + expect(src).not.toMatch(/[^&]gRagged\[/); // no bare subscript of any arity + }); + test('an array global spells the BARE gSym[i], uncast', () => { - // u16 table indexed by a0*2: ldr r1,=tbl; lsls r0,#1; adds r0,r1,r0; ldrh r0,[r0] - const body = - '\tldr\tr1, .L1\n\tlsls\tr0, r0, #0x1\n\tadds\tr0, r1, r0\n\tldrh\tr0, [r0]\n\tbx\tlr\n.L1:\n\t.word\t0x08057B4C\n'; + const body = ARRAY_U16_BODY; const map = mapOf([ [0x08057b4c, { name: 'gBlendModeTable', kind: 'data', shape: 'array', elemSize: 2, elemSigned: false }], ]); @@ -771,3 +820,50 @@ describe('the numeric-pool veto exempts MACRO names — the veto is about reloca expect(run('f', MIXED, symbols)).not.toContain('gExtern'); }); }); + +describe('shift-direction fidelity — `shr_u` must not recompile as `asr`', () => { + // C spells the logical and the arithmetic right shift the SAME (`>>`) and chooses from the left + // operand's type. engine.ts's zext fold fixes the byte/half case by folding the whole shift PAIR + // to a cast, which it can only do for widths C can name; every other extract width — every + // bitfield read — reached the backend as a raw `x << k >> k` over a signed-promoted operand. + // That is `asr` where the target has `lsr`, and a different VALUE: a 2-bit field holding 2 + // evaluates to -1. + const extract = (lo: number) => + // ldrb r0,[r1]; lsl r0,#lo; lsr r0,#lo — the agbcc bitfield read + `\tldr\tr1, .L1\n\tldrb\tr0, [r1]\n\tlsl\tr0, r0, #${lo}\n\tlsr\tr0, r0, #${lo}\n\tbx\tlr\n.L1:\n\t.word\t0x03005220\n`; + + test('a BITFIELD-width extract spells its operand unsigned', () => { + const src = run('f', extract(30)); + expect(src).toMatch(/\(u32\)/); + expect(src).toContain('>> 30'); + // the failure this pins: a bare `<< 30 >> 30` over an int-promoted u8 is the arithmetic shift + expect(src).not.toMatch(/\)\s*<< 30 >> 30/); + }); + + test('a BYTE-width extract still folds to the cast — the fold owns that width, not this rule', () => { + // width 8 (shift 24) is engine.ts's zext8: it must keep producing `(u8)x`, not grow a `(u32)` + const src = run('f', extract(24)); + expect(src).toContain('(u8)'); + expect(src).not.toContain('>> 24'); + }); + + test('an ARITHMETIC shift over a signed operand gains NO cast — the rule is not a blanket wrap', () => { + // `asr r0,r0,#4` on a word-loaded (s32-rendered) value: `>>` is already the shift the asm did + const src = run('f', '\tldr\tr1, .L1\n\tldr\tr0, [r1]\n\tasr\tr0, r0, #0x4\n\tbx\tlr\n.L1:\n\t.word\t0x03005220\n'); + expect(src).toContain('>> 4'); + expect(src).not.toContain('(s32)'); + expect(src).not.toContain('(u32)'); + }); + + test('a narrow operand is NOT treated as unsigned just because it was loaded unsigned', () => { + // `*(u8 *)p >> 4` — C promotes the u8 to `int`, so the bare `>>` is the ARITHMETIC shift and + // the asm's `lsr` needs the operand spelled unsigned. Promotion is the whole reason this + // cannot be read off the load width. + const src = run( + 'f', + '\tldr\tr1, .L1\n\tldrb\tr0, [r1]\n\tlsr\tr0, r0, #0x4\n\tbx\tlr\n.L1:\n\t.word\t0x03005220\n', + ); + expect(src).toContain('(u32)'); + expect(src).toContain('>> 4'); + }); +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 678bf39c..1bcf5199 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -142,8 +142,8 @@ importers: specifier: workspace:^ version: link:../core '@gba-kit/debug-info': - specifier: ^0.4.0 - version: 0.4.0 + specifier: ^0.5.0 + version: 0.5.0 objdiff-wasm: specifier: 3.7.3 version: 3.7.3 @@ -626,8 +626,8 @@ packages: resolution: {integrity: sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@gba-kit/debug-info@0.4.0': - resolution: {integrity: sha512-iM2gkcbf02RXNRq3DpSleHNY4O5kCxLeOiiaQ8WiOwT58+dHorQD13gq1Ct2Qiz1jyxQWMH2f3uIQ2wlLNGD9w==} + '@gba-kit/debug-info@0.5.0': + resolution: {integrity: sha512-VxSCtktC5+AEEPtZsKCXx+gXkPtjvVJhV74ZTsN+KdiChs5Ys+8xc+LB7eAHIhdD4dIqCHRseA6OIplcAjs5EQ==} '@humanfs/core@0.19.2': resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} @@ -2329,7 +2329,7 @@ snapshots: '@eslint/core': 1.2.1 levn: 0.4.1 - '@gba-kit/debug-info@0.4.0': {} + '@gba-kit/debug-info@0.5.0': {} '@humanfs/core@0.19.2': dependencies: